From 73e0561610acaea15e7768c19135d0b5a3b7873d Mon Sep 17 00:00:00 2001
From: Daniel Becker <2900921+dabeck@users.noreply.github.com>
Date: Mon, 5 Aug 2019 18:08:04 +0200
Subject: [PATCH] Update lego
---
Gopkg.lock | 267 +-
Gopkg.toml | 6 +-
docs/configuration/acme.md | 4 +-
.../exporter/ocagent/LICENSE | 201 +
.../exporter/ocagent/common.go | 38 +
.../exporter/ocagent/connection.go | 97 +
.../exporter/ocagent/nodeinfo.go | 46 +
.../exporter/ocagent/ocagent.go | 496 +
.../exporter/ocagent/options.go | 128 +
.../exporter/ocagent/transform_spans.go | 248 +
.../ocagent/transform_stats_to_metrics.go | 274 +
.../exporter/ocagent/version.go | 17 +
.../dns/mgmt/2017-09-01/dns/models.go | 340 +-
.../dns/mgmt/2017-09-01/dns/recordsets.go | 235 +-
.../services/dns/mgmt/2017-09-01/dns/zones.go | 175 +-
.../Azure/azure-sdk-for-go/version/version.go | 2 +-
.../Azure/go-autorest/autorest/adal/config.go | 88 +-
.../Azure/go-autorest/autorest/adal/sender.go | 2 +-
.../Azure/go-autorest/autorest/adal/token.go | 577 +-
.../go-autorest/autorest/adal/version.go | 45 +
.../go-autorest/autorest/authorization.go | 103 +-
.../Azure/go-autorest/autorest/azure/async.go | 1043 +-
.../go-autorest/autorest/azure/auth/auth.go | 523 +-
.../Azure/go-autorest/autorest/azure/azure.go | 75 +-
.../go-autorest/autorest/azure/cli/profile.go | 79 +
.../go-autorest/autorest/azure/cli/token.go | 170 +
.../autorest/azure/environments.go | 105 +-
.../Azure/go-autorest/autorest/azure/rp.go | 8 +-
.../Azure/go-autorest/autorest/client.go | 92 +-
.../Azure/go-autorest/autorest/preparer.go | 74 +-
.../Azure/go-autorest/autorest/responder.go | 19 +
.../Azure/go-autorest/autorest/sender.go | 137 +-
.../Azure/go-autorest/autorest/to/convert.go | 5 +
.../Azure/go-autorest/autorest/utility.go | 12 +-
.../go-autorest/autorest/validation/error.go | 48 +
.../autorest/validation/validation.go | 400 +
.../Azure/go-autorest/autorest/version.go | 23 +-
.../Azure/go-autorest/logger/logger.go | 328 +
.../Azure/go-autorest/tracing/tracing.go | 195 +
.../JamesClonk/vultr/lib/account_info.go | 71 -
.../JamesClonk/vultr/lib/applications.go | 38 -
.../JamesClonk/vultr/lib/block_storage.go | 210 -
.../github.com/JamesClonk/vultr/lib/client.go | 249 -
vendor/github.com/JamesClonk/vultr/lib/dns.go | 150 -
.../JamesClonk/vultr/lib/firewall.go | 248 -
vendor/github.com/JamesClonk/vultr/lib/ip.go | 192 -
vendor/github.com/JamesClonk/vultr/lib/iso.go | 44 -
vendor/github.com/JamesClonk/vultr/lib/os.go | 37 -
.../github.com/JamesClonk/vultr/lib/plans.go | 78 -
.../JamesClonk/vultr/lib/regions.go | 44 -
.../JamesClonk/vultr/lib/reservedip.go | 192 -
.../JamesClonk/vultr/lib/scripts.go | 126 -
.../JamesClonk/vultr/lib/servers.go | 561 -
.../JamesClonk/vultr/lib/snapshots.go | 72 -
.../JamesClonk/vultr/lib/sshkeys.go | 82 -
.../edgegrid/signer.go | 21 +
.../alibaba-cloud-sdk-go/sdk/api_timeout.go | 249 +
.../credentials/bearer_token_credential.go | 12 +
.../sdk/auth/credentials/ecs_ram_role.go | 24 +-
.../sdk/auth/credentials/provider/env.go | 30 +
.../provider/instance_credentials.go | 92 +
.../provider/profile_credentials.go | 158 +
.../sdk/auth/credentials/provider/provider.go | 19 +
.../credentials/provider/provider_chain.go | 34 +
.../credentials/sts_role_arn_credential.go | 12 +
.../sdk/auth/roa_signature_composer.go | 27 +-
.../sdk/auth/rpc_signature_composer.go | 20 +-
.../alibaba-cloud-sdk-go/sdk/auth/signer.go | 21 +-
.../sdk/auth/signers/algorithms.go | 18 +-
.../sdk/auth/signers/credential_updater.go | 5 +-
.../sdk/auth/signers/signer_access_key.go | 8 +-
.../sdk/auth/signers/signer_bearer_token.go | 35 +
.../sdk/auth/signers/signer_ecs_ram_role.go | 62 +-
.../sdk/auth/signers/signer_key_pair.go | 56 +-
.../sdk/auth/signers/signer_ram_role_arn.go | 37 +-
.../sdk/auth/signers/signer_sts_token.go | 8 +-
.../sdk/auth/signers/signer_v2.go | 8 +-
.../aliyun/alibaba-cloud-sdk-go/sdk/client.go | 535 +-
.../aliyun/alibaba-cloud-sdk-go/sdk/config.go | 24 +-
.../sdk/endpoints/endpoints_config.go | 4593 ++-
.../sdk/endpoints/local_global_resolver.go | 10 +-
.../sdk/endpoints/local_regional_resolver.go | 13 +-
.../sdk/endpoints/location_resolver.go | 85 +-
.../sdk/endpoints/mapping_resolver.go | 9 +
.../sdk/endpoints/resolver.go | 26 +-
.../sdk/endpoints/simple_host_resolver.go | 8 +
.../sdk/errors/client_error.go | 2 +-
.../sdk/errors/server_error.go | 7 +-
.../signature_does_not_match_wrapper.go | 36 +-
.../aliyun/alibaba-cloud-sdk-go/sdk/logger.go | 116 +
.../{acs_reqeust.go => acs_request.go} | 127 +-
.../sdk/requests/common_request.go | 56 +-
.../sdk/requests/roa_request.go | 68 +-
.../sdk/requests/rpc_request.go | 18 +-
.../sdk/responses/json_parser.go | 35 +-
.../sdk/responses/response.go | 10 +-
.../alibaba-cloud-sdk-go/sdk/utils/debug.go | 36 +
.../alibaba-cloud-sdk-go/sdk/utils/utils.go | 96 +-
.../alidns/add_batch_domain_records.go | 106 -
.../services/alidns/add_domain.go | 11 +-
.../services/alidns/add_domain_group.go | 4 +-
.../services/alidns/add_domain_record.go | 10 +-
.../alidns/add_gtm_access_strategy.go | 110 +
.../services/alidns/add_gtm_address_pool.go | 117 +
.../services/alidns/add_gtm_monitor.go | 119 +
.../alidns/apply_for_retrieval_domain_name.go | 106 -
.../services/alidns/change_domain_group.go | 6 +-
.../alidns/change_domain_of_dns_product.go | 6 +-
.../services/alidns/check_domain_record.go | 6 +-
.../services/alidns/client.go | 33 +-
.../services/alidns/create_instance.go | 111 +
.../alidns/delete_batch_domain_records.go | 106 -
.../services/alidns/delete_batch_domains.go | 106 -
.../services/alidns/delete_domain.go | 4 +-
.../services/alidns/delete_domain_group.go | 6 +-
.../services/alidns/delete_domain_record.go | 6 +-
.../alidns/delete_gtm_access_strategy.go | 105 +
.../alidns/delete_gtm_address_pool.go | 105 +
.../alidns/delete_sub_domain_records.go | 6 +-
.../services/alidns/describe_batch_result.go | 110 -
.../alidns/describe_batch_result_count.go | 113 +
.../alidns/describe_batch_result_detail.go | 112 +
.../alidns/describe_dns_product_instance.go | 37 +-
.../alidns/describe_dns_product_instances.go | 12 +-
.../alidns/describe_dnsslb_sub_domains.go | 12 +-
.../alidns/describe_domain_dns_statistics.go | 108 +
.../services/alidns/describe_domain_groups.go | 12 +-
.../services/alidns/describe_domain_info.go | 9 +-
.../services/alidns/describe_domain_logs.go | 23 +-
.../services/alidns/describe_domain_ns.go | 4 +-
.../alidns/describe_domain_record_info.go | 10 +-
.../alidns/describe_domain_records.go | 29 +-
.../alidns/describe_domain_statistics.go | 108 +
.../describe_domain_statistics_summary.go | 118 +
.../alidns/describe_domain_whois_info.go | 113 -
.../services/alidns/describe_domains.go | 22 +-
.../alidns/describe_gtm_access_strategies.go | 112 +
.../alidns/describe_gtm_access_strategy.go | 116 +
...be_gtm_access_strategy_available_config.go | 107 +
.../describe_gtm_available_alert_group.go | 105 +
.../services/alidns/describe_gtm_instance.go | 118 +
.../describe_gtm_instance_address_pool.go | 118 +
.../describe_gtm_instance_address_pools.go | 112 +
.../alidns/describe_gtm_instance_status.go | 107 +
.../describe_gtm_instance_system_cname.go | 106 +
.../services/alidns/describe_gtm_instances.go | 113 +
.../services/alidns/describe_gtm_logs.go | 115 +
.../describe_gtm_monitor_available_config.go | 105 +
.../alidns/describe_gtm_monitor_config.go | 117 +
.../services/alidns/describe_record_logs.go | 14 +-
.../alidns/describe_record_statistics.go | 109 +
.../describe_record_statistics_history.go | 109 +
.../describe_record_statistics_summary.go | 119 +
.../alidns/describe_sub_domain_records.go | 15 +-
.../services/alidns/describe_support_lines.go | 5 +-
.../services/alidns/get_main_domain_name.go | 8 +-
.../alidns/modify_hichina_domain_dns.go | 4 +-
.../services/alidns/operate_batch_domain.go | 121 +
.../alidns/query_create_instance_price.go | 112 +
.../services/alidns/retrieval_domain_name.go | 107 -
.../services/alidns/set_dnsslb_status.go | 6 +-
.../alidns/set_domain_record_status.go | 6 +-
.../services/alidns/set_gtm_access_mode.go | 106 +
.../services/alidns/set_gtm_monitor_status.go | 106 +
.../services/alidns/struct_addr.go | 29 +
.../services/alidns/struct_addr_pool.go | 33 +
...be_gtm_access_strategy_available_config.go | 21 +
..._in_describe_gtm_instance_address_pools.go | 21 +
...{struct_status_list.go => struct_addrs.go} | 6 +-
.../alidns/struct_batch_result_detail.go | 36 +
...sult.go => struct_batch_result_details.go} | 7 +-
.../services/alidns/struct_dns_product.go | 31 +-
.../services/alidns/struct_domain.go | 2 +-
.../services/alidns/struct_domain_group.go | 2 +-
.../services/alidns/struct_domain_log.go | 3 +-
.../services/alidns/struct_gtm_instance.go | 33 +
..._whois_info.go => struct_gtm_instances.go} | 6 +-
.../services/alidns/struct_isp_city_node.go | 28 +
...n_describe_gtm_monitor_available_config.go | 21 +
...ty_nodes_in_describe_gtm_monitor_config.go | 21 +
.../services/alidns/struct_line.go | 25 +
...lines_in_describe_gtm_access_strategies.go | 21 +
...t_lines_in_describe_gtm_access_strategy.go | 21 +
...be_gtm_access_strategy_available_config.go | 21 +
.../services/alidns/struct_log.go | 29 +
...{struct_fail_results.go => struct_logs.go} | 6 +-
.../services/alidns/struct_record.go | 18 +-
.../services/alidns/struct_record_line.go | 4 +-
.../services/alidns/struct_record_log.go | 2 +-
.../services/alidns/struct_rule.go | 23 +
.../services/alidns/struct_rules.go | 21 +
.../services/alidns/struct_slb_sub_domain.go | 2 +-
.../services/alidns/struct_statistic.go | 24 +
...stics_in_describe_domain_dns_statistics.go | 21 +
...tatistics_in_describe_domain_statistics.go | 21 +
...s_in_describe_domain_statistics_summary.go | 21 +
...tatistics_in_describe_record_statistics.go | 21 +
...s_in_describe_record_statistics_history.go | 21 +
...s_in_describe_record_statistics_summary.go | 21 +
.../services/alidns/struct_strategies.go | 21 +
.../services/alidns/struct_strategy.go | 33 +
.../alidns/update_batch_domain_records.go | 106 -
.../services/alidns/update_dnsslb_weight.go | 6 +-
.../services/alidns/update_domain_group.go | 6 +-
.../services/alidns/update_domain_record.go | 10 +-
.../alidns/update_gtm_access_strategy.go | 109 +
.../alidns/update_gtm_address_pool.go | 116 +
.../update_gtm_instance_global_config.go | 112 +
.../services/alidns/update_gtm_monitor.go | 118 +
vendor/github.com/aws/aws-sdk-go/NOTICE.txt | 2 +-
.../aws/aws-sdk-go/aws/awserr/error.go | 23 +-
.../aws/aws-sdk-go/aws/awserr/types.go | 31 +-
.../aws/aws-sdk-go/aws/awsutil/equal.go | 2 +-
.../aws/aws-sdk-go/aws/awsutil/path_value.go | 11 +-
.../aws-sdk-go/aws/awsutil/string_value.go | 25 +-
.../aws/aws-sdk-go/aws/client/client.go | 6 +-
.../aws/aws-sdk-go/aws/client/logger.go | 120 +-
.../aws/client/metadata/client_info.go | 1 +
.../github.com/aws/aws-sdk-go/aws/config.go | 60 +-
.../aws/{context.go => context_1_5.go} | 40 +-
.../aws/aws-sdk-go/aws/context_1_7.go | 9 -
.../aws/aws-sdk-go/aws/context_1_9.go | 11 +
...ntext_1_6.go => context_background_1_5.go} | 15 +
.../aws-sdk-go/aws/context_background_1_7.go | 20 +
.../aws/aws-sdk-go/aws/context_sleep.go | 24 +
.../aws-sdk-go/aws/corehandlers/handlers.go | 4 +-
.../aws-sdk-go/aws/corehandlers/user_agent.go | 2 +-
.../aws/credentials/chain_provider.go | 4 +-
.../aws-sdk-go/aws/credentials/credentials.go | 71 +-
.../ec2rolecreds/ec2_role_provider.go | 12 +-
.../aws/credentials/endpointcreds/provider.go | 22 +-
.../aws/credentials/env_provider.go | 4 -
.../aws/credentials/processcreds/provider.go | 425 +
.../shared_credentials_provider.go | 30 +-
.../aws/credentials/static_provider.go | 2 -
.../stscreds/assume_role_provider.go | 22 +-
.../stscreds/web_identity_provider.go | 97 +
.../aws/aws-sdk-go/aws/crr/cache.go | 119 +
.../aws/aws-sdk-go/aws/crr/endpoint.go | 99 +
.../aws/aws-sdk-go/aws/crr/sync_map.go | 29 +
.../aws/aws-sdk-go/aws/crr/sync_map_1_8.go | 48 +
.../github.com/aws/aws-sdk-go/aws/csm/doc.go | 69 +
.../aws/aws-sdk-go/aws/csm/enable.go | 89 +
.../aws/aws-sdk-go/aws/csm/metric.go | 109 +
.../aws/aws-sdk-go/aws/csm/metric_chan.go | 54 +
.../aws-sdk-go/aws/csm/metric_exception.go | 26 +
.../aws/aws-sdk-go/aws/csm/reporter.go | 265 +
.../aws/aws-sdk-go/aws/defaults/defaults.go | 31 +-
.../aws/aws-sdk-go/aws/ec2metadata/api.go | 25 +-
.../aws/aws-sdk-go/aws/ec2metadata/service.go | 10 +-
.../aws/aws-sdk-go/aws/endpoints/decode.go | 59 +-
.../aws/aws-sdk-go/aws/endpoints/defaults.go | 2254 +-
.../aws/endpoints/dep_service_ids.go | 141 +
.../aws/aws-sdk-go/aws/endpoints/endpoints.go | 9 +-
.../aws/aws-sdk-go/aws/endpoints/v3model.go | 5 +-
.../aws/endpoints/v3model_codegen.go | 24 +-
.../github.com/aws/aws-sdk-go/aws/errors.go | 4 -
.../github.com/aws/aws-sdk-go/aws/logger.go | 6 +
.../aws/request/connection_reset_error.go | 17 +-
.../request/connection_reset_error_other.go | 11 -
.../aws/aws-sdk-go/aws/request/handlers.go | 66 +
.../aws-sdk-go/aws/request/offset_reader.go | 15 +-
.../aws/aws-sdk-go/aws/request/request.go | 253 +-
.../aws/aws-sdk-go/aws/request/request_1_7.go | 2 +-
.../aws/aws-sdk-go/aws/request/request_1_8.go | 7 +-
.../aws/request/request_pagination.go | 17 +-
.../aws/aws-sdk-go/aws/request/retryer.go | 4 +-
.../aws/aws-sdk-go/aws/request/validation.go | 52 +
.../aws/session/cabundle_transport.go | 26 +
.../aws/session/cabundle_transport_1_5.go | 22 +
.../aws/session/cabundle_transport_1_6.go | 23 +
.../aws/aws-sdk-go/aws/session/credentials.go | 258 +
.../aws/aws-sdk-go/aws/session/doc.go | 6 +-
.../aws/aws-sdk-go/aws/session/env_config.go | 94 +-
.../aws/aws-sdk-go/aws/session/session.go | 205 +-
.../aws-sdk-go/aws/session/shared_config.go | 389 +-
.../aws/aws-sdk-go/aws/signer/v4/v4.go | 105 +-
vendor/github.com/aws/aws-sdk-go/aws/types.go | 20 +-
.../github.com/aws/aws-sdk-go/aws/version.go | 2 +-
.../aws/aws-sdk-go/internal/ini/ast.go | 120 +
.../aws-sdk-go/internal/ini/comma_token.go | 11 +
.../aws-sdk-go/internal/ini/comment_token.go | 35 +
.../aws/aws-sdk-go/internal/ini/doc.go | 29 +
.../aws-sdk-go/internal/ini/empty_token.go | 4 +
.../aws/aws-sdk-go/internal/ini/expression.go | 24 +
.../aws/aws-sdk-go/internal/ini/fuzz.go | 17 +
.../aws/aws-sdk-go/internal/ini/ini.go | 51 +
.../aws/aws-sdk-go/internal/ini/ini_lexer.go | 165 +
.../aws/aws-sdk-go/internal/ini/ini_parser.go | 349 +
.../aws-sdk-go/internal/ini/literal_tokens.go | 324 +
.../aws-sdk-go/internal/ini/newline_token.go | 30 +
.../aws-sdk-go/internal/ini/number_helper.go | 152 +
.../aws/aws-sdk-go/internal/ini/op_tokens.go | 39 +
.../aws-sdk-go/internal/ini/parse_error.go | 43 +
.../aws-sdk-go/internal/ini/parse_stack.go | 60 +
.../aws/aws-sdk-go/internal/ini/sep_tokens.go | 41 +
.../aws/aws-sdk-go/internal/ini/skipper.go | 45 +
.../aws/aws-sdk-go/internal/ini/statement.go | 35 +
.../aws/aws-sdk-go/internal/ini/value_util.go | 284 +
.../aws/aws-sdk-go/internal/ini/visitor.go | 166 +
.../aws/aws-sdk-go/internal/ini/walker.go | 25 +
.../aws/aws-sdk-go/internal/ini/ws_token.go | 24 +
.../aws/aws-sdk-go/internal/sdkuri/path.go | 23 +
.../internal/shareddefaults/ecs_container.go | 12 +
.../private/protocol/ec2query/build.go | 3 +-
.../private/protocol/ec2query/unmarshal.go | 34 +-
.../aws/aws-sdk-go/private/protocol/host.go | 68 +
.../private/protocol/host_prefix.go | 54 +
.../private/protocol/json/jsonutil/build.go | 12 +-
.../protocol/json/jsonutil/unmarshal.go | 56 +-
.../private/protocol/jsonrpc/jsonrpc.go | 41 +-
.../aws-sdk-go/private/protocol/payload.go | 81 +
.../private/protocol/query/build.go | 2 +-
.../protocol/query/queryutil/queryutil.go | 7 +-
.../private/protocol/query/unmarshal.go | 6 +-
.../private/protocol/query/unmarshal_error.go | 85 +-
.../aws-sdk-go/private/protocol/rest/build.go | 39 +-
.../private/protocol/rest/unmarshal.go | 18 +-
.../private/protocol/restxml/restxml.go | 14 +-
.../aws-sdk-go/private/protocol/timestamp.go | 72 +
.../private/protocol/xml/xmlutil/build.go | 32 +-
.../private/protocol/xml/xmlutil/unmarshal.go | 29 +-
.../protocol/xml/xmlutil/xml_to_struct.go | 1 +
.../aws/aws-sdk-go/service/dynamodb/api.go | 5013 ++-
.../aws-sdk-go/service/dynamodb/doc_custom.go | 2 +-
.../dynamodb/dynamodbattribute/decode.go | 19 +-
.../service/dynamodb/dynamodbattribute/doc.go | 8 +-
.../dynamodb/dynamodbattribute/encode.go | 5 +
.../dynamodb/dynamodbattribute/field.go | 8 +-
.../service/dynamodb/dynamodbattribute/tag.go | 4 +-
.../dynamodb/dynamodbiface/interface.go | 12 +
.../aws/aws-sdk-go/service/dynamodb/errors.go | 139 +-
.../aws-sdk-go/service/dynamodb/service.go | 9 +-
.../aws/aws-sdk-go/service/ec2/api.go | 29477 ++++++++++++++--
.../aws/aws-sdk-go/service/ec2/doc.go | 20 +-
.../aws/aws-sdk-go/service/ec2/service.go | 6 +-
.../aws/aws-sdk-go/service/ecs/api.go | 6249 +++-
.../aws/aws-sdk-go/service/ecs/doc.go | 2 +-
.../aws/aws-sdk-go/service/ecs/errors.go | 40 +-
.../aws/aws-sdk-go/service/ecs/service.go | 6 +-
.../aws/aws-sdk-go/service/lightsail/api.go | 8495 ++++-
.../aws/aws-sdk-go/service/lightsail/doc.go | 8 +-
.../aws-sdk-go/service/lightsail/service.go | 6 +-
.../aws/aws-sdk-go/service/route53/api.go | 1991 +-
.../service/route53/customizations.go | 2 +-
.../aws/aws-sdk-go/service/route53/doc.go | 3 +
.../aws/aws-sdk-go/service/route53/errors.go | 48 +-
.../aws/aws-sdk-go/service/route53/service.go | 6 +-
.../service/route53/unmarshal_error.go | 123 +-
.../aws/aws-sdk-go/service/sts/api.go | 1134 +-
.../aws-sdk-go/service/sts/customizations.go | 12 -
.../aws/aws-sdk-go/service/sts/doc.go | 76 +-
.../aws/aws-sdk-go/service/sts/errors.go | 2 +-
.../aws/aws-sdk-go/service/sts/service.go | 6 +-
.../service/sts/stsiface/interface.go | 96 +
.../opencensus-proto/LICENSE | 202 +
.../gen-go/agent/common/v1/common.pb.go | 361 +
.../agent/metrics/v1/metrics_service.pb.go | 275 +
.../agent/metrics/v1/metrics_service.pb.gw.go | 150 +
.../gen-go/agent/trace/v1/trace_service.pb.go | 457 +
.../agent/trace/v1/trace_service.pb.gw.go | 150 +
.../gen-go/metrics/v1/metrics.pb.go | 1127 +
.../gen-go/resource/v1/resource.pb.go | 100 +
.../gen-go/trace/v1/trace.pb.go | 1553 +
.../gen-go/trace/v1/trace_config.pb.go | 359 +
.../cloudflare-go/access_application.go | 180 +
.../cloudflare/cloudflare-go/access_policy.go | 221 +
.../cloudflare-go/account_members.go | 186 +
.../cloudflare/cloudflare-go/account_roles.go | 80 +
.../cloudflare/cloudflare-go/accounts.go | 114 +
.../cloudflare/cloudflare-go/argo.go | 120 +
.../cloudflare/cloudflare-go/auditlogs.go | 143 +
.../cloudflare/cloudflare-go/cloudflare.go | 192 +-
.../cloudflare/cloudflare-go/cpage.go | 29 -
.../cloudflare-go/custom_hostname.go | 27 +-
.../cloudflare/cloudflare-go/custom_pages.go | 176 +
.../cloudflare/cloudflare-go/dns.go | 6 +-
.../cloudflare/cloudflare-go/duration.go | 40 +
.../cloudflare/cloudflare-go/errors.go | 2 +
.../cloudflare/cloudflare-go/filter.go | 241 +
.../cloudflare/cloudflare-go/firewall.go | 47 +-
.../cloudflare-go/firewall_rules.go | 196 +
.../cloudflare-go/load_balancing.go | 107 +-
.../cloudflare/cloudflare-go/lockdown.go | 3 +-
.../cloudflare/cloudflare-go/logpush.go | 224 +
.../cloudflare/cloudflare-go/options.go | 17 +-
.../cloudflare/cloudflare-go/organizations.go | 3 +-
.../cloudflare/cloudflare-go/origin_ca.go | 9 +-
.../cloudflare/cloudflare-go/page_rules.go | 75 +-
.../cloudflare/cloudflare-go/rate_limiting.go | 19 +-
.../cloudflare/cloudflare-go/registrar.go | 175 +
.../cloudflare/cloudflare-go/spectrum.go | 158 +
.../cloudflare/cloudflare-go/ssl.go | 39 +-
.../cloudflare/cloudflare-go/universal_ssl.go | 50 +
.../cloudflare/cloudflare-go/virtualdns.go | 67 +
.../cloudflare/cloudflare-go/waf.go | 62 +-
.../cloudflare/cloudflare-go/workers.go | 312 +
.../cloudflare/cloudflare-go/workers_kv.go | 192 +
.../cloudflare/cloudflare-go/zone.go | 177 +-
.../github.com/decker502/dnspod-go/dnspod.go | 28 +-
.../decker502/dnspod-go/domain_records.go | 4 +-
.../github.com/decker502/dnspod-go/domains.go | 43 +-
.../dnsimple/dnsimple-go/dnsimple/dnsimple.go | 2 +-
.../dnsimple/dnsimple-go/dnsimple/domains.go | 14 +-
.../dnsimple-go/dnsimple/registrar.go | 2 +-
.../dnsimple/registrar_whois_privacy.go | 36 +-
.../dnsimple/dnsimple-go/dnsimple/tlds.go | 2 +-
.../github.com/exoscale/egoscale/addresses.go | 37 +-
.../exoscale/egoscale/async_jobs.go | 42 +
vendor/github.com/exoscale/egoscale/client.go | 8 +
vendor/github.com/exoscale/egoscale/dns.go | 5 +-
.../github.com/exoscale/egoscale/request.go | 2 +-
.../github.com/exoscale/egoscale/runstatus.go | 2 +-
.../github.com/exoscale/egoscale/templates.go | 47 +-
vendor/github.com/exoscale/egoscale/uuid.go | 4 +-
.../github.com/exoscale/egoscale/version.go | 2 +-
.../exoscale/egoscale/virtual_machines.go | 5 +-
.../acme/api/internal/sender/useragent.go | 2 +-
.../go-acme/lego/certificate/authorization.go | 4 +-
.../lego/providers/dns/dns_providers.go | 8 +-
.../lego/providers/dns/dnspod/dnspod.go | 3 +-
.../lego/providers/dns/joker/client.go | 15 +-
.../go-acme/lego/providers/dns/joker/joker.go | 14 +-
.../lego/providers/dns/namesilo/namesilo.go | 142 +
.../go-acme/lego/providers/dns/otc/client.go | 12 +-
.../lego/providers/dns/versio/client.go | 127 +
.../lego/providers/dns/versio/versio.go | 155 +
.../go-acme/lego/providers/dns/vultr/vultr.go | 39 +-
.../go-acme/lego/registration/registar.go | 2 +-
vendor/github.com/go-resty/resty/resty.go | 9 -
.../{satori/go.uuid => gofrs/uuid}/LICENSE | 0
.../{satori/go.uuid => gofrs/uuid}/codec.go | 146 +-
vendor/github.com/gofrs/uuid/fuzz.go | 47 +
vendor/github.com/gofrs/uuid/generator.go | 299 +
.../{satori/go.uuid => gofrs/uuid}/sql.go | 37 +-
.../{satori/go.uuid => gofrs/uuid}/uuid.go | 82 +-
vendor/github.com/golang/protobuf/LICENSE | 3 -
.../golang/protobuf/jsonpb/jsonpb.go | 1284 +
.../golang/protobuf/proto/decode.go | 1 -
.../golang/protobuf/proto/deprecated.go | 63 +
.../golang/protobuf/proto/encode.go | 18 -
.../github.com/golang/protobuf/proto/equal.go | 3 +-
.../golang/protobuf/proto/extensions.go | 78 +-
.../github.com/golang/protobuf/proto/lib.go | 100 +-
.../golang/protobuf/proto/message_set.go | 137 +-
.../golang/protobuf/proto/pointer_reflect.go | 5 +-
.../golang/protobuf/proto/pointer_unsafe.go | 15 +-
.../golang/protobuf/proto/properties.go | 52 +-
.../golang/protobuf/proto/table_marshal.go | 235 +-
.../golang/protobuf/proto/table_unmarshal.go | 198 +-
.../github.com/golang/protobuf/proto/text.go | 4 +-
.../golang/protobuf/proto/text_parser.go | 6 +-
.../protoc-gen-go/descriptor/descriptor.pb.go | 2887 ++
.../protoc-gen-go/generator/generator.go | 2806 ++
.../generator/internal/remap/remap.go | 117 +
.../protoc-gen-go/plugin/plugin.pb.go | 369 +
.../github.com/golang/protobuf/ptypes/any.go | 10 +-
.../golang/protobuf/ptypes/any/any.pb.go | 47 +-
.../golang/protobuf/ptypes/duration.go | 2 +-
.../protobuf/ptypes/duration/duration.pb.go | 30 +-
.../protobuf/ptypes/struct/struct.pb.go | 336 +
.../golang/protobuf/ptypes/timestamp.go | 6 +-
.../protobuf/ptypes/timestamp/timestamp.pb.go | 38 +-
.../protobuf/ptypes/wrappers/wrappers.pb.go | 461 +
.../grpc-ecosystem/grpc-gateway/LICENSE.txt | 27 +
.../grpc-gateway/internal/stream_chunk.pb.go | 118 +
.../grpc-gateway/runtime/context.go | 210 +
.../grpc-gateway/runtime/convert.go | 312 +
.../grpc-gateway/runtime/doc.go | 5 +
.../grpc-gateway/runtime/errors.go | 146 +
.../grpc-gateway/runtime/fieldmask.go | 70 +
.../grpc-gateway/runtime/handler.go | 209 +
.../runtime/marshal_httpbodyproto.go | 43 +
.../grpc-gateway/runtime/marshal_json.go | 45 +
.../grpc-gateway/runtime/marshal_jsonpb.go | 262 +
.../grpc-gateway/runtime/marshal_proto.go | 62 +
.../grpc-gateway/runtime/marshaler.go | 48 +
.../runtime/marshaler_registry.go | 91 +
.../grpc-gateway/runtime/mux.go | 303 +
.../grpc-gateway/runtime/pattern.go | 262 +
.../grpc-gateway/runtime/proto2_convert.go | 80 +
.../grpc-gateway/runtime/proto_errors.go | 106 +
.../grpc-gateway/runtime/query.go | 391 +
.../third_party/googleapis/LICENSE | 201 +
.../grpc-gateway/utilities/doc.go | 2 +
.../grpc-gateway/utilities/pattern.go | 22 +
.../grpc-gateway/utilities/readerfactory.go | 20 +
.../grpc-gateway/utilities/trie.go | 177 +
vendor/github.com/jmespath/go-jmespath/api.go | 2 +-
.../go/{feature_adapter.go => adapter.go} | 46 +-
.../go/{feature_any.go => any.go} | 86 +-
.../go/{feature_any_array.go => any_array.go} | 0
.../go/{feature_any_bool.go => any_bool.go} | 0
.../go/{feature_any_float.go => any_float.go} | 0
.../go/{feature_any_int32.go => any_int32.go} | 0
.../go/{feature_any_int64.go => any_int64.go} | 0
...{feature_any_invalid.go => any_invalid.go} | 0
.../go/{feature_any_nil.go => any_nil.go} | 0
.../{feature_any_number.go => any_number.go} | 2 +-
.../{feature_any_object.go => any_object.go} | 0
.../go/{feature_any_string.go => any_str.go} | 2 +-
.../{feature_any_uint32.go => any_uint32.go} | 0
.../{feature_any_uint64.go => any_uint64.go} | 0
.../go/{feature_config.go => config.go} | 201 +-
.../go/feature_config_with_sync_map.go | 51 -
.../go/feature_config_without_sync_map.go | 54 -
.../json-iterator/go/feature_json_number.go | 31 -
.../json-iterator/go/feature_reflect.go | 607 -
.../json-iterator/go/feature_reflect_array.go | 110 -
.../json-iterator/go/feature_reflect_map.go | 260 -
.../go/feature_reflect_native.go | 789 -
.../json-iterator/go/feature_reflect_slice.go | 143 -
.../json-iterator/go/feature_stream_int.go | 320 -
.../go/{feature_iter.go => iter.go} | 0
.../{feature_iter_array.go => iter_array.go} | 0
.../{feature_iter_float.go => iter_float.go} | 20 +-
.../go/{feature_iter_int.go => iter_int.go} | 6 +
...{feature_iter_object.go => iter_object.go} | 150 +-
.../go/{feature_iter_skip.go => iter_skip.go} | 25 +-
...ter_skip_sloppy.go => iter_skip_sloppy.go} | 0
...ter_skip_strict.go => iter_skip_strict.go} | 14 +-
.../{feature_iter_string.go => iter_str.go} | 0
.../go/{feature_pool.go => pool.go} | 35 +-
vendor/github.com/json-iterator/go/reflect.go | 332 +
.../json-iterator/go/reflect_array.go | 104 +
.../json-iterator/go/reflect_dynamic.go | 70 +
...lect_extension.go => reflect_extension.go} | 269 +-
.../json-iterator/go/reflect_json_number.go | 112 +
.../go/reflect_json_raw_message.go | 60 +
.../json-iterator/go/reflect_map.go | 338 +
.../json-iterator/go/reflect_marshaler.go | 217 +
.../json-iterator/go/reflect_native.go | 453 +
...eflect_optional.go => reflect_optional.go} | 93 +-
.../json-iterator/go/reflect_slice.go | 99 +
...t_decoder.go => reflect_struct_decoder.go} | 450 +-
...ct_object.go => reflect_struct_encoder.go} | 151 +-
.../go/{feature_stream.go => stream.go} | 155 +-
...eature_stream_float.go => stream_float.go} | 31 +-
.../github.com/json-iterator/go/stream_int.go | 190 +
...feature_stream_string.go => stream_str.go} | 40 +-
vendor/github.com/linode/linodego/account.go | 5 +-
.../linode/linodego/account_events.go | 31 +-
.../linode/linodego/account_notifications.go | 42 +-
.../linode/linodego/account_oauth_client.go | 190 +
.../linode/linodego/account_payments.go | 115 +
.../linode/linodego/account_settings.go | 72 +
.../linode/linodego/account_users.go | 164 +
vendor/github.com/linode/linodego/client.go | 131 +-
.../linode/linodego/domain_records.go | 16 -
vendor/github.com/linode/linodego/domains.go | 10 +
vendor/github.com/linode/linodego/errors.go | 4 +-
vendor/github.com/linode/linodego/images.go | 13 +-
.../linode/linodego/instance_disks.go | 50 +-
.../linode/linodego/instance_ips.go | 64 +-
.../linode/linodego/instance_stats.go | 68 +
.../github.com/linode/linodego/instances.go | 103 +-
.../github.com/linode/linodego/network_ips.go | 40 +
.../linode/linodego/nodebalancer.go | 11 +-
.../linode/linodego/nodebalancer_configs.go | 6 +-
.../github.com/linode/linodego/pagination.go | 147 +-
vendor/github.com/linode/linodego/profile.go | 116 +
.../linode/linodego/profile_tokens.go | 195 +
.../github.com/linode/linodego/resources.go | 33 +-
.../linode/linodego/stackscripts.go | 2 +
vendor/github.com/linode/linodego/tags.go | 219 +
vendor/github.com/linode/linodego/template.go | 4 +-
vendor/github.com/linode/linodego/types.go | 9 +-
vendor/github.com/linode/linodego/volumes.go | 59 +-
vendor/github.com/linode/linodego/waitfor.go | 136 +-
.../mitchellh/go-homedir/homedir.go | 66 +-
.../github.com/modern-go/concurrent/LICENSE | 201 +
.../modern-go/concurrent/executor.go | 14 +
.../modern-go/concurrent/go_above_19.go | 15 +
.../modern-go/concurrent/go_below_19.go | 33 +
vendor/github.com/modern-go/concurrent/log.go | 13 +
.../concurrent/unbounded_executor.go | 119 +
vendor/github.com/modern-go/reflect2/LICENSE | 201 +
.../modern-go/reflect2/go_above_17.go | 8 +
.../modern-go/reflect2/go_above_19.go | 14 +
.../modern-go/reflect2/go_below_17.go | 9 +
.../modern-go/reflect2/go_below_19.go | 14 +
.../github.com/modern-go/reflect2/reflect2.go | 298 +
.../modern-go/reflect2/reflect2_amd64.s | 0
.../modern-go/reflect2/reflect2_kind.go | 30 +
.../modern-go/reflect2/relfect2_386.s | 0
.../modern-go/reflect2/relfect2_amd64p32.s | 0
.../modern-go/reflect2/relfect2_arm.s | 0
.../modern-go/reflect2/relfect2_arm64.s | 0
.../modern-go/reflect2/relfect2_mips64x.s | 0
.../modern-go/reflect2/relfect2_mipsx.s | 0
.../modern-go/reflect2/relfect2_ppc64x.s | 0
.../modern-go/reflect2/relfect2_s390x.s | 0
.../modern-go/reflect2/safe_field.go | 58 +
.../github.com/modern-go/reflect2/safe_map.go | 101 +
.../modern-go/reflect2/safe_slice.go | 92 +
.../modern-go/reflect2/safe_struct.go | 29 +
.../modern-go/reflect2/safe_type.go | 78 +
.../github.com/modern-go/reflect2/type_map.go | 103 +
.../modern-go/reflect2/unsafe_array.go | 65 +
.../modern-go/reflect2/unsafe_eface.go | 59 +
.../modern-go/reflect2/unsafe_field.go | 74 +
.../modern-go/reflect2/unsafe_iface.go | 64 +
.../modern-go/reflect2/unsafe_link.go | 70 +
.../modern-go/reflect2/unsafe_map.go | 138 +
.../modern-go/reflect2/unsafe_ptr.go | 46 +
.../modern-go/reflect2/unsafe_slice.go | 177 +
.../modern-go/reflect2/unsafe_struct.go | 59 +
.../modern-go/reflect2/unsafe_type.go | 85 +
vendor/github.com/nrdcg/namesilo/LICENSE | 373 +
vendor/github.com/nrdcg/namesilo/auth.go | 57 +
vendor/github.com/nrdcg/namesilo/model.go | 768 +
vendor/github.com/nrdcg/namesilo/namesilo.go | 60 +
vendor/github.com/nrdcg/namesilo/params.go | 520 +
.../nrdcg/namesilo/zz_gen_client.go | 2192 ++
.../oracle/oci-go-sdk/common/common.go | 15 +-
.../oracle/oci-go-sdk/common/configuration.go | 2 +-
.../oracle/oci-go-sdk/common/errors.go | 2 +-
.../oracle/oci-go-sdk/common/http.go | 18 +-
.../oracle/oci-go-sdk/common/version.go | 6 +-
...nge_steering_policy_compartment_details.go | 26 +
...ing_policy_compartment_request_response.go | 77 +
.../dns/change_zone_compartment_details.go | 26 +
...hange_zone_compartment_request_response.go | 77 +
...eate_steering_policy_attachment_details.go | 14 +-
...ring_policy_attachment_request_response.go | 2 +-
.../dns/create_steering_policy_details.go | 107 +-
...create_steering_policy_request_response.go | 2 +-
.../oci-go-sdk/dns/create_zone_details.go | 19 +-
.../dns/create_zone_request_response.go | 2 +-
.../delete_domain_records_request_response.go | 2 +-
.../dns/delete_r_r_set_request_response.go | 2 +-
...ring_policy_attachment_request_response.go | 2 +-
...delete_steering_policy_request_response.go | 2 +-
.../dns/delete_zone_request_response.go | 2 +-
.../oracle/oci-go-sdk/dns/dns_client.go | 122 +-
.../oracle/oci-go-sdk/dns/external_master.go | 4 +-
.../get_domain_records_request_response.go | 4 +-
.../dns/get_r_r_set_request_response.go | 4 +-
...ring_policy_attachment_request_response.go | 2 +-
.../get_steering_policy_request_response.go | 2 +-
.../dns/get_zone_records_request_response.go | 4 +-
.../dns/get_zone_request_response.go | 2 +-
...list_steering_policies_request_response.go | 10 +-
...ing_policy_attachments_request_response.go | 10 +-
.../dns/list_zones_request_response.go | 4 +-
.../oracle/oci-go-sdk/dns/nameserver.go | 4 +-
.../dns/patch_domain_records_details.go | 4 +-
.../patch_domain_records_request_response.go | 4 +-
.../dns/patch_r_r_set_request_response.go | 4 +-
.../oci-go-sdk/dns/patch_rr_set_details.go | 4 +-
.../dns/patch_zone_records_details.go | 4 +-
.../patch_zone_records_request_response.go | 4 +-
.../oracle/oci-go-sdk/dns/record.go | 9 +-
.../oci-go-sdk/dns/record_collection.go | 4 +-
.../oracle/oci-go-sdk/dns/record_details.go | 6 +-
.../oracle/oci-go-sdk/dns/record_operation.go | 10 +-
.../oracle/oci-go-sdk/dns/rr_set.go | 4 +-
.../oracle/oci-go-sdk/dns/sort_order.go | 27 +-
.../oracle/oci-go-sdk/dns/steering_policy.go | 110 +-
.../oci-go-sdk/dns/steering_policy_answer.go | 61 +-
.../dns/steering_policy_attachment.go | 18 +-
.../dns/steering_policy_attachment_summary.go | 9 +-
.../dns/steering_policy_filter_answer_data.go | 8 +-
.../dns/steering_policy_filter_rule.go | 20 +-
.../dns/steering_policy_filter_rule_case.go | 12 +-
.../dns/steering_policy_health_rule.go | 14 +-
.../dns/steering_policy_health_rule_case.go | 11 +-
.../dns/steering_policy_limit_rule.go | 17 +-
.../dns/steering_policy_limit_rule_case.go | 15 +-
.../steering_policy_priority_answer_data.go | 13 +-
.../dns/steering_policy_priority_rule.go | 18 +-
.../dns/steering_policy_priority_rule_case.go | 12 +-
.../oci-go-sdk/dns/steering_policy_rule.go | 27 +-
.../oci-go-sdk/dns/steering_policy_summary.go | 107 +-
.../steering_policy_weighted_answer_data.go | 12 +-
.../dns/steering_policy_weighted_rule.go | 18 +-
.../dns/steering_policy_weighted_rule_case.go | 12 +-
.../github.com/oracle/oci-go-sdk/dns/tsig.go | 4 +-
.../dns/update_domain_records_details.go | 4 +-
.../update_domain_records_request_response.go | 4 +-
.../dns/update_r_r_set_request_response.go | 4 +-
.../oci-go-sdk/dns/update_rr_set_details.go | 4 +-
...date_steering_policy_attachment_details.go | 8 +-
...ring_policy_attachment_request_response.go | 2 +-
.../dns/update_steering_policy_details.go | 108 +-
...update_steering_policy_request_response.go | 2 +-
.../oci-go-sdk/dns/update_zone_details.go | 19 +-
.../dns/update_zone_records_details.go | 4 +-
.../update_zone_records_request_response.go | 4 +-
.../dns/update_zone_request_response.go | 2 +-
.../github.com/oracle/oci-go-sdk/dns/zone.go | 19 +-
.../oracle/oci-go-sdk/dns/zone_summary.go | 19 +-
.../sacloud/libsacloud/api/archive.go | 41 +-
.../sacloud/libsacloud/api/client.go | 3 +-
.../sacloud/libsacloud/api/product_server.go | 11 +-
.../sacloud/libsacloud/api/proxylb.go | 9 +
.../sacloud/libsacloud/api/server.go | 1 +
.../sacloud/libsacloud/libsacloud.go | 2 +-
.../libsacloud/sacloud/common_types.go | 10 +
.../sacloud/libsacloud/sacloud/database.go | 6 +-
.../sacloud/libsacloud/sacloud/dns.go | 2 +-
.../sacloud/ostype/archive_ostype.go | 30 +-
.../sacloud/ostype/archiveostypes_string.go | 32 +-
.../libsacloud/sacloud/product_server.go | 1 +
.../sacloud/libsacloud/sacloud/proxylb.go | 67 +-
.../sacloud/libsacloud/sacloud/sim.go | 2 +-
vendor/github.com/satori/go.uuid/generator.go | 239 -
.../transip/gotransip/domain/api.go | 109 +-
.../transip/gotransip/domain/domain.go | 111 +-
.../vultr => vultr/govultr}/LICENSE | 5 +-
vendor/github.com/vultr/govultr/account.go | 45 +
vendor/github.com/vultr/govultr/api.go | 44 +
.../github.com/vultr/govultr/application.go | 51 +
vendor/github.com/vultr/govultr/backup.go | 105 +
.../vultr/govultr/bare_metal_server.go | 790 +
.../github.com/vultr/govultr/block_storage.go | 319 +
.../github.com/vultr/govultr/dns_domains.go | 209 +
.../github.com/vultr/govultr/dns_records.go | 150 +
.../vultr/govultr/firewall_group.go | 163 +
.../github.com/vultr/govultr/firewall_rule.go | 265 +
vendor/github.com/vultr/govultr/govultr.go | 222 +
vendor/github.com/vultr/govultr/iso.go | 142 +
vendor/github.com/vultr/govultr/network.go | 120 +
vendor/github.com/vultr/govultr/os.go | 84 +
vendor/github.com/vultr/govultr/plans.go | 199 +
vendor/github.com/vultr/govultr/regions.go | 154 +
.../github.com/vultr/govultr/reserved_ip.go | 273 +
vendor/github.com/vultr/govultr/server.go | 1469 +
vendor/github.com/vultr/govultr/snapshot.go | 168 +
vendor/github.com/vultr/govultr/ssh_key.go | 140 +
.../vultr/govultr/startup_script.go | 172 +
vendor/github.com/vultr/govultr/user.go | 157 +
.../metric/metricdata/exemplar.go | 5 +
.../metric/metricdata/label.go | 7 +
.../metric/metricdata/metric.go | 10 +-
.../go.opencensus.io/plugin/ocgrpc/client.go | 56 +
.../plugin/ocgrpc/client_metrics.go | 107 +
.../plugin/ocgrpc/client_stats_handler.go | 49 +
vendor/go.opencensus.io/plugin/ocgrpc/doc.go | 19 +
.../go.opencensus.io/plugin/ocgrpc/server.go | 80 +
.../plugin/ocgrpc/server_metrics.go | 97 +
.../plugin/ocgrpc/server_stats_handler.go | 63 +
.../plugin/ocgrpc/stats_common.go | 227 +
.../plugin/ocgrpc/trace_common.go | 107 +
.../propagation/tracecontext/propagation.go | 187 +
.../go.opencensus.io/plugin/ochttp/server.go | 9 +
vendor/go.opencensus.io/stats/record.go | 94 +-
.../stats/view/view_to_metric.go | 21 +-
vendor/go.opencensus.io/stats/view/worker.go | 2 +
.../stats/view/worker_commands.go | 4 +
vendor/go.opencensus.io/tag/map.go | 66 +-
vendor/go.opencensus.io/tag/map_codec.go | 12 +-
vendor/go.opencensus.io/tag/metadata.go | 52 +
vendor/go.opencensus.io/tag/profile_19.go | 2 +-
vendor/golang.org/x/sync/LICENSE | 27 +
vendor/golang.org/x/sync/PATENTS | 22 +
.../golang.org/x/sync/semaphore/semaphore.go | 127 +
.../api/support/bundler/bundler.go | 349 +
.../googleapis/api/httpbody/httpbody.pb.go | 114 +
.../protobuf/field_mask/field_mask.pb.go | 267 +
.../resty => gopkg.in/resty.v1}/LICENSE | 2 +-
.../resty => gopkg.in/resty.v1}/client.go | 40 +-
.../resty => gopkg.in/resty.v1}/default.go | 3 +-
.../resty => gopkg.in/resty.v1}/middleware.go | 32 +-
.../resty => gopkg.in/resty.v1}/redirect.go | 2 +-
.../resty => gopkg.in/resty.v1}/request.go | 42 +-
.../resty => gopkg.in/resty.v1}/request16.go | 4 +-
.../resty => gopkg.in/resty.v1}/request17.go | 13 +-
.../resty => gopkg.in/resty.v1}/response.go | 2 +-
vendor/gopkg.in/resty.v1/resty.go | 9 +
.../resty => gopkg.in/resty.v1}/retry.go | 8 +-
.../resty => gopkg.in/resty.v1}/util.go | 42 +-
.../gopkg.in/square/go-jose.v2/asymmetric.go | 35 +-
vendor/gopkg.in/square/go-jose.v2/crypter.go | 31 +-
vendor/gopkg.in/square/go-jose.v2/encoding.go | 3 +-
vendor/gopkg.in/square/go-jose.v2/jwe.go | 9 +-
vendor/gopkg.in/square/go-jose.v2/jwk.go | 82 +-
vendor/gopkg.in/square/go-jose.v2/jws.go | 4 +-
vendor/gopkg.in/square/go-jose.v2/opaque.go | 83 +
vendor/gopkg.in/square/go-jose.v2/shared.go | 88 +-
vendor/gopkg.in/square/go-jose.v2/signing.go | 92 +-
.../gopkg.in/square/go-jose.v2/symmetric.go | 130 +-
782 files changed, 113827 insertions(+), 17222 deletions(-)
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/LICENSE
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/common.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/connection.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/nodeinfo.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/ocagent.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go
create mode 100644 vendor/contrib.go.opencensus.io/exporter/ocagent/version.go
create mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/version.go
create mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go
create mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go
create mode 100644 vendor/github.com/Azure/go-autorest/autorest/validation/error.go
create mode 100644 vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
create mode 100644 vendor/github.com/Azure/go-autorest/logger/logger.go
create mode 100644 vendor/github.com/Azure/go-autorest/tracing/tracing.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/account_info.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/applications.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/block_storage.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/client.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/dns.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/firewall.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/ip.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/iso.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/os.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/plans.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/regions.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/reservedip.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/scripts.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/servers.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/snapshots.go
delete mode 100644 vendor/github.com/JamesClonk/vultr/lib/sshkeys.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go
rename vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/{acs_reqeust.go => acs_request.go} (68%)
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_batch_domain_records.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_access_strategy.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_address_pool.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_monitor.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/apply_for_retrieval_domain_name.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/create_instance.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domain_records.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domains.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_access_strategy.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_address_pool.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_count.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_detail.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_dns_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics_summary.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_whois_info.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategies.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy_available_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_available_alert_group.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pool.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pools.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_status.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_system_cname.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instances.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_logs.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_available_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_history.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_summary.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/operate_batch_domain.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/query_create_instance_price.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/retrieval_domain_name.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_access_mode.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_monitor_status.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pool.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_access_strategy_available_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_instance_address_pools.go
rename vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/{struct_status_list.go => struct_addrs.go} (85%)
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_detail.go
rename vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/{struct_fail_result.go => struct_batch_result_details.go} (79%)
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instance.go
rename vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/{struct_dns_servers_in_describe_domain_whois_info.go => struct_gtm_instances.go} (79%)
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_node.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_available_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_line.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategies.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy_available_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_log.go
rename vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/{struct_fail_results.go => struct_logs.go} (83%)
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rule.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rules.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistic.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_dns_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics_summary.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_history.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_summary.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategies.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategy.go
delete mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_batch_domain_records.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_access_strategy.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_address_pool.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_instance_global_config.go
create mode 100644 vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_monitor.go
rename vendor/github.com/aws/aws-sdk-go/aws/{context.go => context_1_5.go} (58%)
delete mode 100644 vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go
rename vendor/github.com/aws/aws-sdk-go/aws/{context_1_6.go => context_background_1_5.go} (59%)
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/crr/cache.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/crr/endpoint.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map_1_8.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go
delete mode 100644 vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/host.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go
delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go
create mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/LICENSE
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/common.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.gw.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.gw.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/metrics.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go
create mode 100644 vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_application.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_policy.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/account_members.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/account_roles.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/accounts.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/argo.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/auditlogs.go
delete mode 100644 vendor/github.com/cloudflare/cloudflare-go/cpage.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/custom_pages.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/duration.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/filter.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/logpush.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/registrar.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/spectrum.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/workers.go
create mode 100644 vendor/github.com/cloudflare/cloudflare-go/workers_kv.go
create mode 100644 vendor/github.com/go-acme/lego/providers/dns/namesilo/namesilo.go
create mode 100644 vendor/github.com/go-acme/lego/providers/dns/versio/client.go
create mode 100644 vendor/github.com/go-acme/lego/providers/dns/versio/versio.go
delete mode 100644 vendor/github.com/go-resty/resty/resty.go
rename vendor/github.com/{satori/go.uuid => gofrs/uuid}/LICENSE (100%)
rename vendor/github.com/{satori/go.uuid => gofrs/uuid}/codec.go (58%)
create mode 100644 vendor/github.com/gofrs/uuid/fuzz.go
create mode 100644 vendor/github.com/gofrs/uuid/generator.go
rename vendor/github.com/{satori/go.uuid => gofrs/uuid}/sql.go (74%)
rename vendor/github.com/{satori/go.uuid => gofrs/uuid}/uuid.go (58%)
create mode 100644 vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
create mode 100644 vendor/github.com/golang/protobuf/proto/deprecated.go
create mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
create mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
create mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
create mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
create mode 100644 vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
create mode 100644 vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/stream_chunk.pb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/LICENSE
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go
rename vendor/github.com/json-iterator/go/{feature_adapter.go => adapter.go} (74%)
rename vendor/github.com/json-iterator/go/{feature_any.go => any.go} (75%)
rename vendor/github.com/json-iterator/go/{feature_any_array.go => any_array.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_bool.go => any_bool.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_float.go => any_float.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_int32.go => any_int32.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_int64.go => any_int64.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_invalid.go => any_invalid.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_nil.go => any_nil.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_number.go => any_number.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_object.go => any_object.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_string.go => any_str.go} (97%)
rename vendor/github.com/json-iterator/go/{feature_any_uint32.go => any_uint32.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_any_uint64.go => any_uint64.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_config.go => config.go} (57%)
delete mode 100644 vendor/github.com/json-iterator/go/feature_config_with_sync_map.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_config_without_sync_map.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_json_number.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_reflect.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_reflect_array.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_reflect_map.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_reflect_native.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_reflect_slice.go
delete mode 100644 vendor/github.com/json-iterator/go/feature_stream_int.go
rename vendor/github.com/json-iterator/go/{feature_iter.go => iter.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_iter_array.go => iter_array.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_iter_float.go => iter_float.go} (96%)
rename vendor/github.com/json-iterator/go/{feature_iter_int.go => iter_int.go} (98%)
rename vendor/github.com/json-iterator/go/{feature_iter_object.go => iter_object.go} (67%)
rename vendor/github.com/json-iterator/go/{feature_iter_skip.go => iter_skip.go} (87%)
rename vendor/github.com/json-iterator/go/{feature_iter_skip_sloppy.go => iter_skip_sloppy.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_iter_skip_strict.go => iter_skip_strict.go} (89%)
rename vendor/github.com/json-iterator/go/{feature_iter_string.go => iter_str.go} (100%)
rename vendor/github.com/json-iterator/go/{feature_pool.go => pool.go} (64%)
create mode 100644 vendor/github.com/json-iterator/go/reflect.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_array.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_dynamic.go
rename vendor/github.com/json-iterator/go/{feature_reflect_extension.go => reflect_extension.go} (55%)
create mode 100644 vendor/github.com/json-iterator/go/reflect_json_number.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_json_raw_message.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_map.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_marshaler.go
create mode 100644 vendor/github.com/json-iterator/go/reflect_native.go
rename vendor/github.com/json-iterator/go/{feature_reflect_optional.go => reflect_optional.go} (52%)
create mode 100644 vendor/github.com/json-iterator/go/reflect_slice.go
rename vendor/github.com/json-iterator/go/{feature_reflect_struct_decoder.go => reflect_struct_decoder.go} (74%)
rename vendor/github.com/json-iterator/go/{feature_reflect_object.go => reflect_struct_encoder.go} (53%)
rename vendor/github.com/json-iterator/go/{feature_stream.go => stream.go} (62%)
rename vendor/github.com/json-iterator/go/{feature_stream_float.go => stream_float.go} (70%)
create mode 100644 vendor/github.com/json-iterator/go/stream_int.go
rename vendor/github.com/json-iterator/go/{feature_stream_string.go => stream_str.go} (91%)
create mode 100644 vendor/github.com/linode/linodego/account_oauth_client.go
create mode 100644 vendor/github.com/linode/linodego/account_payments.go
create mode 100644 vendor/github.com/linode/linodego/account_settings.go
create mode 100644 vendor/github.com/linode/linodego/account_users.go
create mode 100644 vendor/github.com/linode/linodego/instance_stats.go
create mode 100644 vendor/github.com/linode/linodego/profile_tokens.go
create mode 100644 vendor/github.com/linode/linodego/tags.go
create mode 100644 vendor/github.com/modern-go/concurrent/LICENSE
create mode 100644 vendor/github.com/modern-go/concurrent/executor.go
create mode 100644 vendor/github.com/modern-go/concurrent/go_above_19.go
create mode 100644 vendor/github.com/modern-go/concurrent/go_below_19.go
create mode 100644 vendor/github.com/modern-go/concurrent/log.go
create mode 100644 vendor/github.com/modern-go/concurrent/unbounded_executor.go
create mode 100644 vendor/github.com/modern-go/reflect2/LICENSE
create mode 100644 vendor/github.com/modern-go/reflect2/go_above_17.go
create mode 100644 vendor/github.com/modern-go/reflect2/go_above_19.go
create mode 100644 vendor/github.com/modern-go/reflect2/go_below_17.go
create mode 100644 vendor/github.com/modern-go/reflect2/go_below_19.go
create mode 100644 vendor/github.com/modern-go/reflect2/reflect2.go
create mode 100644 vendor/github.com/modern-go/reflect2/reflect2_amd64.s
create mode 100644 vendor/github.com/modern-go/reflect2/reflect2_kind.go
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_386.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_arm.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_arm64.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_mips64x.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_mipsx.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s
create mode 100644 vendor/github.com/modern-go/reflect2/relfect2_s390x.s
create mode 100644 vendor/github.com/modern-go/reflect2/safe_field.go
create mode 100644 vendor/github.com/modern-go/reflect2/safe_map.go
create mode 100644 vendor/github.com/modern-go/reflect2/safe_slice.go
create mode 100644 vendor/github.com/modern-go/reflect2/safe_struct.go
create mode 100644 vendor/github.com/modern-go/reflect2/safe_type.go
create mode 100644 vendor/github.com/modern-go/reflect2/type_map.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_array.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_eface.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_field.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_iface.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_link.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_map.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_ptr.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_slice.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_struct.go
create mode 100644 vendor/github.com/modern-go/reflect2/unsafe_type.go
create mode 100644 vendor/github.com/nrdcg/namesilo/LICENSE
create mode 100644 vendor/github.com/nrdcg/namesilo/auth.go
create mode 100644 vendor/github.com/nrdcg/namesilo/model.go
create mode 100644 vendor/github.com/nrdcg/namesilo/namesilo.go
create mode 100644 vendor/github.com/nrdcg/namesilo/params.go
create mode 100644 vendor/github.com/nrdcg/namesilo/zz_gen_client.go
create mode 100644 vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_details.go
create mode 100644 vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_request_response.go
create mode 100644 vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_details.go
create mode 100644 vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_request_response.go
delete mode 100644 vendor/github.com/satori/go.uuid/generator.go
rename vendor/github.com/{JamesClonk/vultr => vultr/govultr}/LICENSE (94%)
create mode 100644 vendor/github.com/vultr/govultr/account.go
create mode 100644 vendor/github.com/vultr/govultr/api.go
create mode 100644 vendor/github.com/vultr/govultr/application.go
create mode 100644 vendor/github.com/vultr/govultr/backup.go
create mode 100644 vendor/github.com/vultr/govultr/bare_metal_server.go
create mode 100644 vendor/github.com/vultr/govultr/block_storage.go
create mode 100644 vendor/github.com/vultr/govultr/dns_domains.go
create mode 100644 vendor/github.com/vultr/govultr/dns_records.go
create mode 100644 vendor/github.com/vultr/govultr/firewall_group.go
create mode 100644 vendor/github.com/vultr/govultr/firewall_rule.go
create mode 100644 vendor/github.com/vultr/govultr/govultr.go
create mode 100644 vendor/github.com/vultr/govultr/iso.go
create mode 100644 vendor/github.com/vultr/govultr/network.go
create mode 100644 vendor/github.com/vultr/govultr/os.go
create mode 100644 vendor/github.com/vultr/govultr/plans.go
create mode 100644 vendor/github.com/vultr/govultr/regions.go
create mode 100644 vendor/github.com/vultr/govultr/reserved_ip.go
create mode 100644 vendor/github.com/vultr/govultr/server.go
create mode 100644 vendor/github.com/vultr/govultr/snapshot.go
create mode 100644 vendor/github.com/vultr/govultr/ssh_key.go
create mode 100644 vendor/github.com/vultr/govultr/startup_script.go
create mode 100644 vendor/github.com/vultr/govultr/user.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/doc.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
create mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go
create mode 100644 vendor/go.opencensus.io/plugin/ochttp/propagation/tracecontext/propagation.go
create mode 100644 vendor/go.opencensus.io/tag/metadata.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/semaphore/semaphore.go
create mode 100644 vendor/google.golang.org/api/support/bundler/bundler.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go
create mode 100644 vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/LICENSE (94%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/client.go (95%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/default.go (99%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/middleware.go (92%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/redirect.go (98%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/request.go (92%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/request16.go (93%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/request17.go (86%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/response.go (98%)
create mode 100644 vendor/gopkg.in/resty.v1/resty.go
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/retry.go (92%)
rename vendor/{github.com/go-resty/resty => gopkg.in/resty.v1}/util.go (85%)
create mode 100644 vendor/gopkg.in/square/go-jose.v2/opaque.go
diff --git a/Gopkg.lock b/Gopkg.lock
index df6d0afa6..35466f17a 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -17,6 +17,14 @@
pruneopts = "NUT"
revision = "02e53af36e6c978af692887ed449b74026d76fec"
+[[projects]]
+ digest = "1:3fb854fc35fafced21615a93db3c0e324c8cb1d5a89f39dd1e72db0c4200345a"
+ name = "contrib.go.opencensus.io/exporter/ocagent"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "dcb33c7f3b7cfe67e8a2cea10207ede1b7c40764"
+ version = "v0.4.12"
+
[[projects]]
branch = "master"
digest = "1:24afd6a7be85997c981693ddcc5f7b37fd3ed5cb119901e14737b9635b944cfb"
@@ -34,15 +42,15 @@
revision = "72eebf980f467d3ab3a8b4ddf660f664911ce519"
[[projects]]
- digest = "1:59f6c2fd10ad014d2907eaa48a19070d5e7af35624328a4fbbf93b7b1c4a19e8"
+ digest = "1:1a06fd7e9325a0b2d1b44ff0253afac49857863cb86ba30ea8212690b7c6287e"
name = "github.com/Azure/azure-sdk-for-go"
packages = [
"services/dns/mgmt/2017-09-01/dns",
"version",
]
pruneopts = "NUT"
- revision = "068ec4d616be5b2175509bf1fb3e4c8ea160d5c8"
- version = "v15.0.1"
+ revision = "98f2f9ff6ad63a307bb3438b7631af594b11f32b"
+ version = "v31.2.0"
[[projects]]
branch = "master"
@@ -56,19 +64,23 @@
revision = "d6e3b3328b783f23731bc4d058875b0371ff8109"
[[projects]]
- digest = "1:2526235ff8cae0162b34e8af3779621de71b3a020dead9bcce74d3f43a18c988"
+ digest = "1:847ae8f26c6796f0dbed826b7bc0297eae976fa2b24045e3e2ddb26846378a65"
name = "github.com/Azure/go-autorest"
packages = [
"autorest",
"autorest/adal",
"autorest/azure",
"autorest/azure/auth",
+ "autorest/azure/cli",
"autorest/date",
"autorest/to",
+ "autorest/validation",
+ "logger",
+ "tracing",
]
pruneopts = "NUT"
- revision = "9ad9326b278af8fa5cc67c30c0ce9a58cc0862b2"
- version = "v10.6.0"
+ revision = "ba1147dc57f993013ef255c128ca1cac8a557409"
+ version = "v12.4.1"
[[projects]]
branch = "master"
@@ -89,13 +101,6 @@
pruneopts = "NUT"
revision = "6add9cd6ad42d389d6ead1dde60b4ad71e46fd74"
-[[projects]]
- digest = "1:ab7fee312bbdc8070d0325d841de8704cc78bf032b076200f1458659b74b8ed6"
- name = "github.com/JamesClonk/vultr"
- packages = ["lib"]
- pruneopts = "NUT"
- revision = "2fd0705ce648e602e6c9c57329a174270a4f6688"
-
[[projects]]
digest = "1:25870183293a3fb61cc9afd060a61d63a486f091db72af01a8ea3449f5ca530d"
name = "github.com/Masterminds/goutils"
@@ -215,7 +220,7 @@
revision = "063d875e3c5fd734fa2aa12fac83829f62acfc70"
[[projects]]
- digest = "1:47071ecf8d840dd357ede1b2aed46576bdd0a866adecef3c9e85a00db9672202"
+ digest = "1:dddee1f9ce7caecc95ae089c721a65ed42b35f8cc8a8b8a3ee6e3758ec93ec4b"
name = "github.com/akamai/AkamaiOPEN-edgegrid-golang"
packages = [
"client-v1",
@@ -224,16 +229,17 @@
"jsonhooks-v1",
]
pruneopts = "NUT"
- revision = "1471ce9c14c6d8c007516e129262962a628fecdf"
- version = "v0.7.3"
+ revision = "009960c8b2c7c57a0c5c488a3c8c778c16f3f586"
+ version = "v0.7.4"
[[projects]]
- digest = "1:823e87ae25170339e2bfd1d6f7c2e27554c6bb5655f91c67b37bd5be45bb6b32"
+ digest = "1:cd8348ab7b1ce85f965157e966791bb13514ea933902ecd1c010b5c529657f3d"
name = "github.com/aliyun/alibaba-cloud-sdk-go"
packages = [
"sdk",
"sdk/auth",
"sdk/auth/credentials",
+ "sdk/auth/credentials/provider",
"sdk/auth/signers",
"sdk/endpoints",
"sdk/errors",
@@ -243,8 +249,8 @@
"services/alidns",
]
pruneopts = "NUT"
- revision = "cad214d7d71fba7883fcf3b7e550ba782c15b400"
- version = "1.27.7"
+ revision = "26f0a5c2d5dc6d4a73c62651d146bdd51dc3bdde"
+ version = "1.60.84"
[[projects]]
digest = "1:b39cf81d5f440b9c0757a25058432d33af867e5201109bf53621356d9dab4b73"
@@ -263,7 +269,7 @@
revision = "48572f11356f1843b694f21a290d4f1006bc5e47"
[[projects]]
- digest = "1:bfb036834a43e76abd318f0db39b0bbec6f7865680c1e443475c0297250a89ed"
+ digest = "1:bd56ffde8e12e9faca92f3ac54347c665d931856fba8784007b02e004fbcc30d"
name = "github.com/aws/aws-sdk-go"
packages = [
"aws",
@@ -275,15 +281,20 @@
"aws/credentials",
"aws/credentials/ec2rolecreds",
"aws/credentials/endpointcreds",
+ "aws/credentials/processcreds",
"aws/credentials/stscreds",
+ "aws/crr",
+ "aws/csm",
"aws/defaults",
"aws/ec2metadata",
"aws/endpoints",
"aws/request",
"aws/session",
"aws/signer/v4",
+ "internal/ini",
"internal/sdkio",
"internal/sdkrand",
+ "internal/sdkuri",
"internal/shareddefaults",
"private/protocol",
"private/protocol/ec2query",
@@ -302,10 +313,11 @@
"service/lightsail",
"service/route53",
"service/sts",
+ "service/sts/stsiface",
]
pruneopts = "NUT"
- revision = "fad131ddc707880428615dc8bc1587b55fb46d74"
- version = "v1.13.54"
+ revision = "f3fe96892dc0e8e8e9862456e1455e62e4cb55d4"
+ version = "v1.21.9"
[[projects]]
branch = "master"
@@ -332,12 +344,27 @@
version = "v2.1.1"
[[projects]]
- digest = "1:03cfacdc6bfd46007c15786c1ece3fa074f89e5193a292f0f26d9e98c99c7cc2"
+ digest = "1:8f5acd4d4462b5136af644d25101f0968a7a94ee90fcb2059cec5b7cc42e0b20"
+ name = "github.com/census-instrumentation/opencensus-proto"
+ packages = [
+ "gen-go/agent/common/v1",
+ "gen-go/agent/metrics/v1",
+ "gen-go/agent/trace/v1",
+ "gen-go/metrics/v1",
+ "gen-go/resource/v1",
+ "gen-go/trace/v1",
+ ]
+ pruneopts = "NUT"
+ revision = "d89fa54de508111353cb0b06403c00569be780d8"
+ version = "v0.2.1"
+
+[[projects]]
+ digest = "1:b63319bd1e224704c8a4d7d65c82791ef5ceb168b7c2c028193595064c910f1a"
name = "github.com/cloudflare/cloudflare-go"
packages = ["."]
pruneopts = "NUT"
- revision = "1f9007fbecae20711133c60519338c41cef1ffb4"
- version = "v0.8.5"
+ revision = "b59d4f05eec361422b388c7ed74293ce8a3d5f97"
+ version = "v0.9.4"
[[projects]]
branch = "master"
@@ -450,12 +477,12 @@
version = "v1.1.0"
[[projects]]
- branch = "master"
- digest = "1:d3972abc351cd5578e3281d332ac9e7a04dafc6e5af97c064fe396c4f90ee769"
+ digest = "1:fa62421bd924623ac10a160686cc55d529f7274b2caedf7d2c607d14bc50c118"
name = "github.com/decker502/dnspod-go"
packages = ["."]
pruneopts = "NUT"
- revision = "f33a2c6040fc2550a631de7b3a53bddccdcd73fb"
+ revision = "71fbbdbdf1a7eeac949586de15bf96d416d3dd63"
+ version = "v0.2.0"
[[projects]]
digest = "1:7a6852b35eb5bbc184561443762d225116ae630c26a7c4d90546619f1e7d2ad2"
@@ -466,20 +493,20 @@
version = "v3.2.0"
[[projects]]
- branch = "master"
digest = "1:f9adc21a937e5da643ea14a3488cb7506788876737a5e205394e508627a6eec8"
name = "github.com/dimchansky/utfbom"
packages = ["."]
pruneopts = "NUT"
revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c"
+ version = "v1.1.0"
[[projects]]
- digest = "1:e856fc44ab196970612bdc8c15e65ccf92ed8d4ccb3a2e65b88dc240a2fe5d0b"
+ digest = "1:d9688055094edd046a71ee85204ea97090ecce6f316b739be3a50f5ca6403ebb"
name = "github.com/dnsimple/dnsimple-go"
packages = ["dnsimple"]
pruneopts = "NUT"
- revision = "f5ead9c20763fd925dea1362f2af5d671ed2a459"
- version = "v0.21.0"
+ revision = "7e193cc468a07cdf74d76de1e6736c709c5a3872"
+ version = "v0.30.0"
[[projects]]
digest = "1:cf7cba074c4d2f8e2a5cc2f10b1f6762c86cff2e39917b9f9a6dbd7df57fe9c9"
@@ -690,12 +717,12 @@
revision = "89ef8af493ab468a45a42bb0d89a06fccdd2fb22"
[[projects]]
- digest = "1:6f26e34204ddad638d25456c6443c2763aa38954558226722c253e08e9f491fa"
+ digest = "1:efcc176c5cfbe8421dd3eb2562be91c3272e80f61b181e31d5745b7fee29a669"
name = "github.com/exoscale/egoscale"
packages = ["."]
pruneopts = "NUT"
- revision = "0a91ac8209d6a805f259ff881d0c2654221d0346"
- version = "v0.14.3"
+ revision = "8f608c40ae891e0240bb6e696a72437be7069d83"
+ version = "v0.18.1"
[[projects]]
digest = "1:b0d5e98ac0f0a509eb320f542e748582d637aae09e74538212e9712d1e71064b"
@@ -735,7 +762,7 @@
revision = "73d445a93680fa1a78ae23a5839bad48f32ba1ee"
[[projects]]
- digest = "1:d82b2dc81c551e7c15f31523a2cc8ee9121b39cfbf63174d98a0bc8edf2d3c5e"
+ digest = "1:896402a6d43c4fb1e21512e7473a51e7fd2b03a4e1a420a730a4b712d20e5d6a"
name = "github.com/go-acme/lego"
packages = [
"acme",
@@ -798,6 +825,7 @@
"providers/dns/mydnsjp",
"providers/dns/namecheap",
"providers/dns/namedotcom",
+ "providers/dns/namesilo",
"providers/dns/netcup",
"providers/dns/netcup/internal",
"providers/dns/nifcloud",
@@ -816,6 +844,7 @@
"providers/dns/stackpath",
"providers/dns/transip",
"providers/dns/vegadns",
+ "providers/dns/versio",
"providers/dns/vscale",
"providers/dns/vscale/internal",
"providers/dns/vultr",
@@ -823,8 +852,8 @@
"registration",
]
pruneopts = "NUT"
- revision = "01903cdfb9869df45cf5274c53226823a2532f2d"
- version = "v2.6.0"
+ revision = "295dd66f2aa549685e3d6b95c1813881a7807158"
+ version = "v2.7.2"
[[projects]]
branch = "fork-containous"
@@ -906,14 +935,6 @@
pruneopts = "NUT"
revision = "1d0bd113de87027671077d3c71eb3ac5d7dbba72"
-[[projects]]
- digest = "1:00f1b1d722a012f54670ecc09ee92557d7314bfd9152a085ce91933c1c14b026"
- name = "github.com/go-resty/resty"
- packages = ["."]
- pruneopts = "NUT"
- revision = "d4920dcf5b7689548a6db640278a9b35a5b48ec6"
- version = "v1.9.1"
-
[[projects]]
digest = "1:8cf58169eb0a8c009ed3a4c36486980d602ab4cc4e478130493d6cd0404f889b"
name = "github.com/go-stack/stack"
@@ -922,6 +943,14 @@
revision = "54be5f394ed2c3e19dac9134a40a95ba5a017f7b"
version = "v1.5.4"
+[[projects]]
+ digest = "1:bde9f189072512ba353f3641d4839cb4c9c7edf421e467f2c03f267b402bd16c"
+ name = "github.com/gofrs/uuid"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "6b08a5c5172ba18946672b49749cde22873dd7c2"
+ version = "v3.2.0"
+
[[projects]]
digest = "1:b518b9be1fc76244e246afe09113e3dd6246073b444787d30883877b82a0b90d"
name = "github.com/gogo/protobuf"
@@ -943,18 +972,25 @@
revision = "44145f04b68cf362d9c4df2182967c2275eaefed"
[[projects]]
- digest = "1:03e14cff610a8a58b774e36bd337fa979482be86aab01be81fb8bbd6d0f07fc8"
+ digest = "1:1e21a0bbb10d73b781e87a9a123b96f6ebe08d0451e50f1b97c1213b302af46f"
name = "github.com/golang/protobuf"
packages = [
+ "jsonpb",
"proto",
+ "protoc-gen-go/descriptor",
+ "protoc-gen-go/generator",
+ "protoc-gen-go/generator/internal/remap",
+ "protoc-gen-go/plugin",
"ptypes",
"ptypes/any",
"ptypes/duration",
+ "ptypes/struct",
"ptypes/timestamp",
+ "ptypes/wrappers",
]
pruneopts = "NUT"
- revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265"
- version = "v1.1.0"
+ revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
+ version = "v1.3.2"
[[projects]]
branch = "master"
@@ -1073,6 +1109,18 @@
pruneopts = "NUT"
revision = "2bcd89a1743fd4b373f7370ce8ddc14dfbd18229"
+[[projects]]
+ digest = "1:3107a6ef51bb9f3bc7cf235af0d92303b39afaa841f02dfc87f1d0a5d05a3fca"
+ name = "github.com/grpc-ecosystem/grpc-gateway"
+ packages = [
+ "internal",
+ "runtime",
+ "utilities",
+ ]
+ pruneopts = "NUT"
+ revision = "ad529a448ba494a88058f9e5be0988713174ac86"
+ version = "v1.9.5"
+
[[projects]]
digest = "1:c3f14b698c0f5c5729896489f4b526f519d1d2522e697d63f532901d0e183dff"
name = "github.com/hashicorp/consul"
@@ -1176,11 +1224,11 @@
revision = "8eebe170fa1ba25d3dfb928b3f86a7313b13b9fe"
[[projects]]
- digest = "1:ac6d01547ec4f7f673311b4663909269bfb8249952de3279799289467837c3cc"
+ digest = "1:1f2aebae7e7c856562355ec0198d8ca2fa222fb05e5b1b66632a1fce39631885"
name = "github.com/jmespath/go-jmespath"
packages = ["."]
pruneopts = "NUT"
- revision = "0b12d6b5"
+ revision = "c2b33e84"
[[projects]]
digest = "1:273d270076cfc02c2d481b187203ebb3891825f46fe78b925141a22631c52503"
@@ -1190,12 +1238,12 @@
revision = "72f9bd7c4e0c2a40055ab3d0f09654f730cce982"
[[projects]]
- digest = "1:63d8b364f0768ffda64b8e6e15c10535f3431e3c69d051dbb37f467ada02df98"
+ digest = "1:92f6419f388bd31a433b1388910f15a882c9980e383e89ebf8fb2524583707ac"
name = "github.com/json-iterator/go"
packages = ["."]
pruneopts = "NUT"
- revision = "28452fcdec4e44348d2af0d91d1e9e38da3a9e0a"
- version = "1.0.5"
+ revision = "27518f6661eba504be5a7a9a9f6d9460d892ade3"
+ version = "v1.1.7"
[[projects]]
digest = "1:8b3234b10eacd5edea45bf0c13a585b608749da23f94aaf29b46d9ef8a8babf4"
@@ -1276,12 +1324,12 @@
revision = "1113af38e5916529ad7317b0fe12e273e6e92af5"
[[projects]]
- digest = "1:111ff5a09a32895248270bfaef9b8b6ac163a8cde9cdd603fed64b3e4b59e8ab"
+ digest = "1:7981caf0d67995c0acbd352785f45b177a2d089ed40f2005794c0772d0fbfff9"
name = "github.com/linode/linodego"
packages = ["."]
pruneopts = "NUT"
- revision = "d0d31d8ca62fa3f7e4526ca0ce95de81e4ed001e"
- version = "v0.5.1"
+ revision = "7adba57685c129bcd29a9edc7008ec3b05680240"
+ version = "v0.10.0"
[[projects]]
digest = "1:196b0d7580e898df15a7cc5371cbfe2b8e22904f5c6c883ed5db0130e551c8fb"
@@ -1394,12 +1442,12 @@
revision = "d23ffcb85de31694d6ccaa23ccb4a03e55c1303f"
[[projects]]
- branch = "master"
- digest = "1:b62c4f18ad6eb454ac5253e7791ded3d7867330015ca4b37b6336e57f514585e"
+ digest = "1:f9f72e583aaacf1d1ac5d6121abd4afd3c690baa9e14e1d009df26bf831ba347"
name = "github.com/mitchellh/go-homedir"
packages = ["."]
pruneopts = "NUT"
- revision = "b8bc1bf767474819792c23f32d8286a45736f1c6"
+ revision = "af06845cf3004701891bf4fdb884bfe4920b3727"
+ version = "v1.1.0"
[[projects]]
branch = "master"
@@ -1425,6 +1473,22 @@
pruneopts = "NUT"
revision = "63d60e9d0dbc60cf9164e6510889b0db6683d98c"
+[[projects]]
+ digest = "1:2f42fa12d6911c7b7659738758631bec870b7e9b4c6be5444f963cdcfccc191f"
+ name = "github.com/modern-go/concurrent"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94"
+ version = "1.0.3"
+
+[[projects]]
+ digest = "1:c6aca19413b13dc59c220ad7430329e2ec454cc310bc6d8de2c7e2b93c18a0f6"
+ name = "github.com/modern-go/reflect2"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd"
+ version = "1.0.1"
+
[[projects]]
digest = "1:7bb97a5f80a2429fa605e176e16cf682cbb5ac681f421a06efb4e3b8efae6e5f"
name = "github.com/mvdan/xurls"
@@ -1456,6 +1520,14 @@
revision = "d8152159450570012552f924a0ae6ab3d8c617e0"
version = "v0.6.0"
+[[projects]]
+ digest = "1:a1e8eda841bca324a6b4d88824d625b3ba8d86bf9ec68677d595c02d7502918b"
+ name = "github.com/nrdcg/namesilo"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "1b10d027904464789f889ee4cd76af15c3bf4943"
+ version = "v0.2.1"
+
[[projects]]
branch = "master"
digest = "1:95d27e49401b61dd203a4cf8237037bd6cd49599651f855ac1988c4ae27b090e"
@@ -1527,15 +1599,15 @@
version = "v0.3.5"
[[projects]]
- digest = "1:8a5a270130e940b167027e8c9a07c20d01410bd6053160432351139ddc2cb501"
+ digest = "1:3b8fccf07d5825ca15ec7c14855ea3ff9cb62f565d8b0e1c97e0b37a0bee30b0"
name = "github.com/oracle/oci-go-sdk"
packages = [
"common",
"dns",
]
pruneopts = "NUT"
- revision = "5295b14d42d1417490d318ff91475c5868e0fd8f"
- version = "v4.1.0"
+ revision = "bf9cc5e4c798e1e0b0749ce89c861cb13f37862d"
+ version = "v5.15.0"
[[projects]]
branch = "master"
@@ -1678,7 +1750,7 @@
revision = "256dc444b735e061061cf46c809487313d5b0065"
[[projects]]
- digest = "1:253f275bd72c42f8d234712d1574c8b222fe9b72838bfaca11b21ace9c0e3d0a"
+ digest = "1:09ba8f72048eacb4b5545d81392e594f4e5622cd670e517847c47b5a194bb31c"
name = "github.com/sacloud/libsacloud"
packages = [
".",
@@ -1688,8 +1760,8 @@
"utils/mutexkv",
]
pruneopts = "NUT"
- revision = "41c392dee98a83260abbe0fcd5c13beb7c75d103"
- version = "v1.21.1"
+ revision = "5294ac87ea76a7dffd4fb6b088f3a6ce6c4f91b9"
+ version = "v1.26.1"
[[projects]]
digest = "1:142520cf3c9bb85449dd0000f820b8c604531587ee654793c54909be7dabadac"
@@ -1698,14 +1770,6 @@
pruneopts = "NUT"
revision = "1d7be4effb13d2d908342d349d71a284a7542693"
-[[projects]]
- digest = "1:6bc0652ea6e39e22ccd522458b8bdd8665bf23bdc5a20eec90056e4dc7e273ca"
- name = "github.com/satori/go.uuid"
- packages = ["."]
- pruneopts = "NUT"
- revision = "f58768cc1a7a7e77a3bd49e98cdd21419399b6a3"
- version = "v1.2.0"
-
[[projects]]
digest = "1:01252cd79aac70f16cac02a72a1067dd136e0ad6d5b597d0129cf74c739fd8d1"
name = "github.com/sirupsen/logrus"
@@ -1776,8 +1840,7 @@
version = "1.0.2"
[[projects]]
- branch = "master"
- digest = "1:21ef4b12d6b6c6dfe389caa82f859d1e35eeb24ce61c60d09db57addb6a95781"
+ digest = "1:4da573eeacb95c9452ae7ddc14b06148a99b29bf98522abb221ef9799426187c"
name = "github.com/transip/gotransip"
packages = [
".",
@@ -1785,7 +1848,8 @@
"util",
]
pruneopts = "NUT"
- revision = "c6e2ce0bbb4a601a909e3b7a773358d6b503e663"
+ revision = "efb64632cab7701ec33f1eaeaa738e2207efe68e"
+ version = "v5.14"
[[projects]]
digest = "1:9b2996458a2f7d1f3e0ebf08152acfe8c1106f3fe855d08121c5ee7d801a063f"
@@ -1891,6 +1955,14 @@
revision = "939c094524d124c55fa8afe0e077701db4a865e2"
version = "v1.0.0"
+[[projects]]
+ digest = "1:b1d2c51a689eef501cb5726f8d9997c0ca4415cbfa7105fe6e64b1844eddf1fb"
+ name = "github.com/vultr/govultr"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "ca447e056e08d93aa6e5b09e6ae3565dd1825281"
+ version = "v0.1.4"
+
[[projects]]
branch = "master"
digest = "1:669d39abbe79469bb50e32a26541026fd91326ac0ca56a9ad83be5b9887e5a8c"
@@ -1915,7 +1987,7 @@
revision = "0c8571ac0ce161a5feb57375a9cdf148c98c0f70"
[[projects]]
- digest = "1:045bc0ab96bb83bdffd2606f019003da03d1c139d3cb8aad13596863e4dd37d6"
+ digest = "1:a6f0a3485a3edbe3d66a5036d5dd8be1da89b8e077d98bf8a95ccfdad854d6cf"
name = "go.opencensus.io"
packages = [
".",
@@ -1923,8 +1995,10 @@
"internal/tagencoding",
"metric/metricdata",
"metric/metricproducer",
+ "plugin/ocgrpc",
"plugin/ochttp",
"plugin/ochttp/propagation/b3",
+ "plugin/ochttp/propagation/tracecontext",
"resource",
"stats",
"stats/internal",
@@ -1936,8 +2010,8 @@
"trace/tracestate",
]
pruneopts = "NUT"
- revision = "75c0cca22312e51bfd4fafdbe9197ae399e18b38"
- version = "v0.20.2"
+ revision = "df6e2001952312404b06f5f6f03fcb4aec1648e5"
+ version = "v0.21.0"
[[projects]]
branch = "master"
@@ -2010,6 +2084,14 @@
pruneopts = "NUT"
revision = "ec22f46f877b4505e0117eeaab541714644fdd28"
+[[projects]]
+ branch = "master"
+ digest = "1:382bb5a7fb4034db3b6a2d19e5a4a6bcf52f4750530603c01ca18a172fa3089b"
+ name = "golang.org/x/sync"
+ packages = ["semaphore"]
+ pruneopts = "NUT"
+ revision = "112230192c580c3556b8cee6403af37a4fc5f28c"
+
[[projects]]
branch = "master"
digest = "1:4e67fdd7a13cbdb3c0dff0a7505abbdf4f42b12b27da350d66bffdc700db2899"
@@ -2054,7 +2136,7 @@
[[projects]]
branch = "master"
- digest = "1:70c173b8ecc111dd01dc07f0ada72c076e4ed91618ee559312ef8adf154cc539"
+ digest = "1:87f5f837cf3bee0aedbb43d1eeec6dd7d741a1e382d2f3b488fe8fa6c3486cbc"
name = "google.golang.org/api"
packages = [
"dns/v1",
@@ -2064,6 +2146,7 @@
"googleapi/transport",
"internal",
"option",
+ "support/bundler",
"transport/http",
"transport/http/internal/propagation",
]
@@ -2089,9 +2172,13 @@
revision = "4f7eeb5305a4ba1966344836ba4af9996b7b4e05"
[[projects]]
- digest = "1:93180612a69db36a06d801302b867d53a50a8a5f0943b34db66adc0574ea57df"
+ digest = "1:a9d09c09842a02162edf759a35329c180e8ce82c2c6ae455a3c56d67b549be5b"
name = "google.golang.org/genproto"
- packages = ["googleapis/rpc/status"]
+ packages = [
+ "googleapis/api/httpbody",
+ "googleapis/rpc/status",
+ "protobuf/field_mask",
+ ]
pruneopts = "NUT"
revision = "09f6ed296fc66555a25fe4ce95173148778dfa85"
@@ -2185,7 +2272,15 @@
revision = "a5bcac82d3f637d3928d30476610891935b2d691"
[[projects]]
- digest = "1:85a9c61c8d566fbbb108da8714893e6fc892fdb7a2910612a27f551ce30a0dd3"
+ digest = "1:0942599d1f614d9ca4dfe052db1f60d4547b1b581206006be352f629a8b37d8d"
+ name = "gopkg.in/resty.v1"
+ packages = ["."]
+ pruneopts = "NUT"
+ revision = "fa5875c0caa5c260ab78acec5a244215a730247f"
+ version = "v1.12.0"
+
+[[projects]]
+ digest = "1:a56dc1133e9c449d41d22ffabd6c2343cd25ab31c9cad0e74a144006810d1544"
name = "gopkg.in/square/go-jose.v2"
packages = [
".",
@@ -2193,8 +2288,8 @@
"json",
]
pruneopts = "NUT"
- revision = "6ee92191fea850cdcab9a18867abf5f521cdbadb"
- version = "v2.1.4"
+ revision = "730df5f748271903322feb182be83b43ebbbe27d"
+ version = "v2.3.1"
[[projects]]
digest = "1:302ad18387350c3d9792da66de666f76d2ca8c62c47dd6b9434269c7cfa18971"
diff --git a/Gopkg.toml b/Gopkg.toml
index 6a811257f..59ad69a8b 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -180,7 +180,11 @@
[[constraint]]
name = "github.com/go-acme/lego"
- version = "2.6.0"
+ version = "2.7.2"
+
+[[constraint]]
+ name = "github.com/golang/protobuf"
+ version = "v1.3.0"
[[constraint]]
name = "google.golang.org/grpc"
diff --git a/docs/configuration/acme.md b/docs/configuration/acme.md
index 4079a7a60..a47c7bc22 100644
--- a/docs/configuration/acme.md
+++ b/docs/configuration/acme.md
@@ -309,13 +309,14 @@ For example, `CF_API_EMAIL_FILE=/run/secrets/traefik_cf-api-email` could be used
| HTTP request | `httpreq` | `HTTPREQ_ENDPOINT`, `HTTPREQ_MODE`, `HTTPREQ_USERNAME`, `HTTPREQ_PASSWORD` (1) | YES |
| [IIJ](https://www.iij.ad.jp/) | `iij` | `IIJ_API_ACCESS_KEY`, `IIJ_API_SECRET_KEY`, `IIJ_DO_SERVICE_CODE` | Not tested yet |
| [INWX](https://www.inwx.de/en) | `inwx` | `INWX_USERNAME`, `INWX_PASSWORD` | YES |
-| [Joker.com](https://joker.com) | `joker` | `JOKER_API_KEY` | YES |
+| [Joker.com](https://joker.com) | `joker` | `JOKER_API_KEY` or `JOKER_USERNAME`, `JOKER_PASSWORD` | YES |
| [Lightsail](https://aws.amazon.com/lightsail/) | `lightsail` | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `DNS_ZONE` | Not tested yet |
| [Linode](https://www.linode.com) | `linode` | `LINODE_API_KEY` | Not tested yet |
| [Linode v4](https://www.linode.com) | `linodev4` | `LINODE_TOKEN` | Not tested yet |
| manual | - | none, but you need to run Traefik interactively, turn on `acmeLogging` to see instructions and press Enter. | YES |
| [MyDNS.jp](https://www.mydns.jp/) | `mydnsjp` | `MYDNSJP_MASTER_ID`, `MYDNSJP_PASSWORD` | YES |
| [Namecheap](https://www.namecheap.com) | `namecheap` | `NAMECHEAP_API_USER`, `NAMECHEAP_API_KEY` | YES |
+| [Namesilo](https://www.namesilo.com/) | `namesilo` | `NAMESILO_API_KEY` | YES |
| [name.com](https://www.name.com/) | `namedotcom` | `NAMECOM_USERNAME`, `NAMECOM_API_TOKEN`, `NAMECOM_SERVER` | Not tested yet |
| [Netcup](https://www.netcup.eu/) | `netcup` | `NETCUP_CUSTOMER_NUMBER`, `NETCUP_API_KEY`, `NETCUP_API_PASSWORD` | Not tested yet |
| [NIFCloud](https://cloud.nifty.com/service/dns.htm) | `nifcloud` | `NIFCLOUD_ACCESS_KEY_ID`, `NIFCLOUD_SECRET_ACCESS_KEY` | Not tested yet |
@@ -333,6 +334,7 @@ For example, `CF_API_EMAIL_FILE=/run/secrets/traefik_cf-api-email` could be used
| [Stackpath](https://www.stackpath.com/) | `stackpath` | `STACKPATH_CLIENT_ID`, `STACKPATH_CLIENT_SECRET`, `STACKPATH_STACK_ID` | Not tested yet |
| [TransIP](https://www.transip.nl/) | `transip` | `TRANSIP_ACCOUNT_NAME`, `TRANSIP_PRIVATE_KEY_PATH` | YES |
| [VegaDNS](https://github.com/shupp/VegaDNS-API) | `vegadns` | `SECRET_VEGADNS_KEY`, `SECRET_VEGADNS_SECRET`, `VEGADNS_URL` | Not tested yet |
+| [Versio](https://www.versio.nl/domeinnamen) | `versio` | `VERSIO_USERNAME`, `VERSIO_PASSWORD` | YES |
| [Vscale](https://vscale.io/) | `vscale` | `VSCALE_API_TOKEN` | YES |
| [VULTR](https://www.vultr.com) | `vultr` | `VULTR_API_KEY` | Not tested yet |
| [Zone.ee](https://www.zone.ee) | `zoneee` | `ZONEEE_API_USER`, `ZONEEE_API_KEY` | YES |
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/LICENSE b/vendor/contrib.go.opencensus.io/exporter/ocagent/LICENSE
new file mode 100644
index 000000000..261eeb9e9
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/LICENSE
@@ -0,0 +1,201 @@
+ 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/contrib.go.opencensus.io/exporter/ocagent/common.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/common.go
new file mode 100644
index 000000000..297e44b6e
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/common.go
@@ -0,0 +1,38 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocagent
+
+import (
+ "math/rand"
+ "time"
+)
+
+var randSrc = rand.New(rand.NewSource(time.Now().UnixNano()))
+
+// retries function fn upto n times, if fn returns an error lest it returns nil early.
+// It applies exponential backoff in units of (1< 0 {
+ ctx = metadata.NewOutgoingContext(ctx, metadata.New(ae.headers))
+ }
+ traceExporter, err := traceSvcClient.Export(ctx)
+ if err != nil {
+ return fmt.Errorf("Exporter.Start:: TraceServiceClient: %v", err)
+ }
+
+ firstTraceMessage := &agenttracepb.ExportTraceServiceRequest{
+ Node: node,
+ Resource: ae.resource,
+ }
+ if err := traceExporter.Send(firstTraceMessage); err != nil {
+ return fmt.Errorf("Exporter.Start:: Failed to initiate the Config service: %v", err)
+ }
+
+ ae.mu.Lock()
+ ae.traceExporter = traceExporter
+ ae.mu.Unlock()
+
+ // Initiate the config service by sending over node identifier info.
+ configStream, err := traceSvcClient.Config(context.Background())
+ if err != nil {
+ return fmt.Errorf("Exporter.Start:: ConfigStream: %v", err)
+ }
+ firstCfgMessage := &agenttracepb.CurrentLibraryConfig{Node: node}
+ if err := configStream.Send(firstCfgMessage); err != nil {
+ return fmt.Errorf("Exporter.Start:: Failed to initiate the Config service: %v", err)
+ }
+
+ // In the background, handle trace configurations that are beamed down
+ // by the agent, but also reply to it with the applied configuration.
+ go ae.handleConfigStreaming(configStream)
+
+ return nil
+}
+
+func (ae *Exporter) createMetricsServiceConnection(cc *grpc.ClientConn, node *commonpb.Node) error {
+ metricsSvcClient := agentmetricspb.NewMetricsServiceClient(cc)
+ metricsExporter, err := metricsSvcClient.Export(context.Background())
+ if err != nil {
+ return fmt.Errorf("MetricsExporter: failed to start the service client: %v", err)
+ }
+ // Initiate the metrics service by sending over the first message just containing the Node and Resource.
+ firstMetricsMessage := &agentmetricspb.ExportMetricsServiceRequest{
+ Node: node,
+ Resource: ae.resource,
+ }
+ if err := metricsExporter.Send(firstMetricsMessage); err != nil {
+ return fmt.Errorf("MetricsExporter:: failed to send the first message: %v", err)
+ }
+
+ ae.mu.Lock()
+ ae.metricsExporter = metricsExporter
+ ae.mu.Unlock()
+
+ // With that we are good to go and can start sending metrics
+ return nil
+}
+
+func (ae *Exporter) dialToAgent() (*grpc.ClientConn, error) {
+ addr := ae.prepareAgentAddress()
+ var dialOpts []grpc.DialOption
+ if ae.clientTransportCredentials != nil {
+ dialOpts = append(dialOpts, grpc.WithTransportCredentials(ae.clientTransportCredentials))
+ } else if ae.canDialInsecure {
+ dialOpts = append(dialOpts, grpc.WithInsecure())
+ }
+ if ae.compressor != "" {
+ dialOpts = append(dialOpts, grpc.WithDefaultCallOptions(grpc.UseCompressor(ae.compressor)))
+ }
+ dialOpts = append(dialOpts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{}))
+
+ ctx := context.Background()
+ if len(ae.headers) > 0 {
+ ctx = metadata.NewOutgoingContext(ctx, metadata.New(ae.headers))
+ }
+ return grpc.DialContext(ctx, addr, dialOpts...)
+}
+
+func (ae *Exporter) handleConfigStreaming(configStream agenttracepb.TraceService_ConfigClient) error {
+ // Note: We haven't yet implemented configuration sending so we
+ // should NOT be changing connection states within this function for now.
+ for {
+ recv, err := configStream.Recv()
+ if err != nil {
+ // TODO: Check if this is a transient error or exponential backoff-able.
+ return err
+ }
+ cfg := recv.Config
+ if cfg == nil {
+ continue
+ }
+
+ // Otherwise now apply the trace configuration sent down from the agent
+ if psamp := cfg.GetProbabilitySampler(); psamp != nil {
+ trace.ApplyConfig(trace.Config{DefaultSampler: trace.ProbabilitySampler(psamp.SamplingProbability)})
+ } else if csamp := cfg.GetConstantSampler(); csamp != nil {
+ alwaysSample := csamp.Decision == tracepb.ConstantSampler_ALWAYS_ON
+ if alwaysSample {
+ trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})
+ } else {
+ trace.ApplyConfig(trace.Config{DefaultSampler: trace.NeverSample()})
+ }
+ } else { // TODO: Add the rate limiting sampler here
+ }
+
+ // Then finally send back to upstream the newly applied configuration
+ err = configStream.Send(&agenttracepb.CurrentLibraryConfig{Config: &tracepb.TraceConfig{Sampler: cfg.Sampler}})
+ if err != nil {
+ return err
+ }
+ }
+}
+
+// Stop shuts down all the connections and resources
+// related to the exporter.
+func (ae *Exporter) Stop() error {
+ ae.mu.RLock()
+ cc := ae.grpcClientConn
+ started := ae.started
+ stopped := ae.stopped
+ ae.mu.RUnlock()
+
+ if !started {
+ return errNotStarted
+ }
+ if stopped {
+ // TODO: tell the user that we've already stopped, so perhaps a sentinel error?
+ return nil
+ }
+
+ ae.Flush()
+
+ // Now close the underlying gRPC connection.
+ var err error
+ if cc != nil {
+ err = cc.Close()
+ }
+
+ // At this point we can change the state variables: started and stopped
+ ae.mu.Lock()
+ ae.started = false
+ ae.stopped = true
+ ae.mu.Unlock()
+ close(ae.stopCh)
+
+ // Ensure that the backgroundConnector returns
+ <-ae.backgroundConnectionDoneCh
+
+ return err
+}
+
+func (ae *Exporter) ExportSpan(sd *trace.SpanData) {
+ if sd == nil {
+ return
+ }
+ _ = ae.traceBundler.Add(sd, 1)
+}
+
+func (ae *Exporter) ExportTraceServiceRequest(batch *agenttracepb.ExportTraceServiceRequest) error {
+ if batch == nil || len(batch.Spans) == 0 {
+ return nil
+ }
+
+ select {
+ case <-ae.stopCh:
+ return errStopped
+
+ default:
+ if !ae.connected() {
+ return errNoConnection
+ }
+
+ ae.senderMu.Lock()
+ err := ae.traceExporter.Send(batch)
+ ae.senderMu.Unlock()
+ if err != nil {
+ ae.setStateDisconnected()
+ return err
+ }
+ return nil
+ }
+}
+
+func (ae *Exporter) ExportView(vd *view.Data) {
+ if vd == nil {
+ return
+ }
+ _ = ae.viewDataBundler.Add(vd, 1)
+}
+
+func ocSpanDataToPbSpans(sdl []*trace.SpanData) []*tracepb.Span {
+ if len(sdl) == 0 {
+ return nil
+ }
+ protoSpans := make([]*tracepb.Span, 0, len(sdl))
+ for _, sd := range sdl {
+ if sd != nil {
+ protoSpans = append(protoSpans, ocSpanToProtoSpan(sd))
+ }
+ }
+ return protoSpans
+}
+
+func (ae *Exporter) uploadTraces(sdl []*trace.SpanData) {
+ select {
+ case <-ae.stopCh:
+ return
+
+ default:
+ if !ae.connected() {
+ return
+ }
+
+ protoSpans := ocSpanDataToPbSpans(sdl)
+ if len(protoSpans) == 0 {
+ return
+ }
+ ae.senderMu.Lock()
+ err := ae.traceExporter.Send(&agenttracepb.ExportTraceServiceRequest{
+ Spans: protoSpans,
+ })
+ ae.senderMu.Unlock()
+ if err != nil {
+ ae.setStateDisconnected()
+ }
+ }
+}
+
+func ocViewDataToPbMetrics(vdl []*view.Data) []*metricspb.Metric {
+ if len(vdl) == 0 {
+ return nil
+ }
+ metrics := make([]*metricspb.Metric, 0, len(vdl))
+ for _, vd := range vdl {
+ if vd != nil {
+ vmetric, err := viewDataToMetric(vd)
+ // TODO: (@odeke-em) somehow report this error, if it is non-nil.
+ if err == nil && vmetric != nil {
+ metrics = append(metrics, vmetric)
+ }
+ }
+ }
+ return metrics
+}
+
+func (ae *Exporter) uploadViewData(vdl []*view.Data) {
+ select {
+ case <-ae.stopCh:
+ return
+
+ default:
+ if !ae.connected() {
+ return
+ }
+
+ protoMetrics := ocViewDataToPbMetrics(vdl)
+ if len(protoMetrics) == 0 {
+ return
+ }
+ err := ae.metricsExporter.Send(&agentmetricspb.ExportMetricsServiceRequest{
+ Metrics: protoMetrics,
+ // TODO:(@odeke-em)
+ // a) Figure out how to derive a Node from the environment
+ // b) Figure out how to derive a Resource from the environment
+ // or better letting users of the exporter configure it.
+ })
+ if err != nil {
+ ae.setStateDisconnected()
+ }
+ }
+}
+
+func (ae *Exporter) Flush() {
+ ae.traceBundler.Flush()
+ ae.viewDataBundler.Flush()
+}
+
+func resourceProtoFromEnv() *resourcepb.Resource {
+ rs, _ := resource.FromEnv(context.Background())
+ if rs == nil {
+ return nil
+ }
+
+ rprs := &resourcepb.Resource{
+ Type: rs.Type,
+ }
+ if rs.Labels != nil {
+ rprs.Labels = make(map[string]string)
+ for k, v := range rs.Labels {
+ rprs.Labels[k] = v
+ }
+ }
+ return rprs
+}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
new file mode 100644
index 000000000..3e05ae8b3
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/options.go
@@ -0,0 +1,128 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocagent
+
+import (
+ "time"
+
+ "google.golang.org/grpc/credentials"
+)
+
+const (
+ DefaultAgentPort uint16 = 55678
+ DefaultAgentHost string = "localhost"
+)
+
+type ExporterOption interface {
+ withExporter(e *Exporter)
+}
+
+type insecureGrpcConnection int
+
+var _ ExporterOption = (*insecureGrpcConnection)(nil)
+
+func (igc *insecureGrpcConnection) withExporter(e *Exporter) {
+ e.canDialInsecure = true
+}
+
+// WithInsecure disables client transport security for the exporter's gRPC connection
+// just like grpc.WithInsecure() https://godoc.org/google.golang.org/grpc#WithInsecure
+// does. Note, by default, client security is required unless WithInsecure is used.
+func WithInsecure() ExporterOption { return new(insecureGrpcConnection) }
+
+type addressSetter string
+
+func (as addressSetter) withExporter(e *Exporter) {
+ e.agentAddress = string(as)
+}
+
+var _ ExporterOption = (*addressSetter)(nil)
+
+// WithAddress allows one to set the address that the exporter will
+// connect to the agent on. If unset, it will instead try to use
+// connect to DefaultAgentHost:DefaultAgentPort
+func WithAddress(addr string) ExporterOption {
+ return addressSetter(addr)
+}
+
+type serviceNameSetter string
+
+func (sns serviceNameSetter) withExporter(e *Exporter) {
+ e.serviceName = string(sns)
+}
+
+var _ ExporterOption = (*serviceNameSetter)(nil)
+
+// WithServiceName allows one to set/override the service name
+// that the exporter will report to the agent.
+func WithServiceName(serviceName string) ExporterOption {
+ return serviceNameSetter(serviceName)
+}
+
+type reconnectionPeriod time.Duration
+
+func (rp reconnectionPeriod) withExporter(e *Exporter) {
+ e.reconnectionPeriod = time.Duration(rp)
+}
+
+func WithReconnectionPeriod(rp time.Duration) ExporterOption {
+ return reconnectionPeriod(rp)
+}
+
+type compressorSetter string
+
+func (c compressorSetter) withExporter(e *Exporter) {
+ e.compressor = string(c)
+}
+
+// UseCompressor will set the compressor for the gRPC client to use when sending requests.
+// It is the responsibility of the caller to ensure that the compressor set has been registered
+// with google.golang.org/grpc/encoding. This can be done by encoding.RegisterCompressor. Some
+// compressors auto-register on import, such as gzip, which can be registered by calling
+// `import _ "google.golang.org/grpc/encoding/gzip"`
+func UseCompressor(compressorName string) ExporterOption {
+ return compressorSetter(compressorName)
+}
+
+type headerSetter map[string]string
+
+func (h headerSetter) withExporter(e *Exporter) {
+ e.headers = map[string]string(h)
+}
+
+// WithHeaders will send the provided headers when the gRPC stream connection
+// is instantiated
+func WithHeaders(headers map[string]string) ExporterOption {
+ return headerSetter(headers)
+}
+
+type clientCredentials struct {
+ credentials.TransportCredentials
+}
+
+var _ ExporterOption = (*clientCredentials)(nil)
+
+// WithTLSCredentials allows the connection to use TLS credentials
+// when talking to the server. It takes in grpc.TransportCredentials instead
+// of say a Certificate file or a tls.Certificate, because the retrieving
+// these credentials can be done in many ways e.g. plain file, in code tls.Config
+// or by certificate rotation, so it is up to the caller to decide what to use.
+func WithTLSCredentials(creds credentials.TransportCredentials) ExporterOption {
+ return &clientCredentials{TransportCredentials: creds}
+}
+
+func (cc *clientCredentials) withExporter(e *Exporter) {
+ e.clientTransportCredentials = cc.TransportCredentials
+}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go
new file mode 100644
index 000000000..983ebe7b7
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_spans.go
@@ -0,0 +1,248 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocagent
+
+import (
+ "math"
+ "time"
+
+ "go.opencensus.io/trace"
+ "go.opencensus.io/trace/tracestate"
+
+ tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
+ "github.com/golang/protobuf/ptypes/timestamp"
+)
+
+const (
+ maxAnnotationEventsPerSpan = 32
+ maxMessageEventsPerSpan = 128
+)
+
+func ocSpanToProtoSpan(sd *trace.SpanData) *tracepb.Span {
+ if sd == nil {
+ return nil
+ }
+ var namePtr *tracepb.TruncatableString
+ if sd.Name != "" {
+ namePtr = &tracepb.TruncatableString{Value: sd.Name}
+ }
+ return &tracepb.Span{
+ TraceId: sd.TraceID[:],
+ SpanId: sd.SpanID[:],
+ ParentSpanId: sd.ParentSpanID[:],
+ Status: ocStatusToProtoStatus(sd.Status),
+ StartTime: timeToTimestamp(sd.StartTime),
+ EndTime: timeToTimestamp(sd.EndTime),
+ Links: ocLinksToProtoLinks(sd.Links),
+ Kind: ocSpanKindToProtoSpanKind(sd.SpanKind),
+ Name: namePtr,
+ Attributes: ocAttributesToProtoAttributes(sd.Attributes),
+ TimeEvents: ocTimeEventsToProtoTimeEvents(sd.Annotations, sd.MessageEvents),
+ Tracestate: ocTracestateToProtoTracestate(sd.Tracestate),
+ }
+}
+
+var blankStatus trace.Status
+
+func ocStatusToProtoStatus(status trace.Status) *tracepb.Status {
+ if status == blankStatus {
+ return nil
+ }
+ return &tracepb.Status{
+ Code: status.Code,
+ Message: status.Message,
+ }
+}
+
+func ocLinksToProtoLinks(links []trace.Link) *tracepb.Span_Links {
+ if len(links) == 0 {
+ return nil
+ }
+
+ sl := make([]*tracepb.Span_Link, 0, len(links))
+ for _, ocLink := range links {
+ // This redefinition is necessary to prevent ocLink.*ID[:] copies
+ // being reused -- in short we need a new ocLink per iteration.
+ ocLink := ocLink
+
+ sl = append(sl, &tracepb.Span_Link{
+ TraceId: ocLink.TraceID[:],
+ SpanId: ocLink.SpanID[:],
+ Type: ocLinkTypeToProtoLinkType(ocLink.Type),
+ })
+ }
+
+ return &tracepb.Span_Links{
+ Link: sl,
+ }
+}
+
+func ocLinkTypeToProtoLinkType(oct trace.LinkType) tracepb.Span_Link_Type {
+ switch oct {
+ case trace.LinkTypeChild:
+ return tracepb.Span_Link_CHILD_LINKED_SPAN
+ case trace.LinkTypeParent:
+ return tracepb.Span_Link_PARENT_LINKED_SPAN
+ default:
+ return tracepb.Span_Link_TYPE_UNSPECIFIED
+ }
+}
+
+func ocAttributesToProtoAttributes(attrs map[string]interface{}) *tracepb.Span_Attributes {
+ if len(attrs) == 0 {
+ return nil
+ }
+ outMap := make(map[string]*tracepb.AttributeValue)
+ for k, v := range attrs {
+ switch v := v.(type) {
+ case bool:
+ outMap[k] = &tracepb.AttributeValue{Value: &tracepb.AttributeValue_BoolValue{BoolValue: v}}
+
+ case int:
+ outMap[k] = &tracepb.AttributeValue{Value: &tracepb.AttributeValue_IntValue{IntValue: int64(v)}}
+
+ case int64:
+ outMap[k] = &tracepb.AttributeValue{Value: &tracepb.AttributeValue_IntValue{IntValue: v}}
+
+ case string:
+ outMap[k] = &tracepb.AttributeValue{
+ Value: &tracepb.AttributeValue_StringValue{
+ StringValue: &tracepb.TruncatableString{Value: v},
+ },
+ }
+ }
+ }
+ return &tracepb.Span_Attributes{
+ AttributeMap: outMap,
+ }
+}
+
+// This code is mostly copied from
+// https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/master/trace_proto.go#L46
+func ocTimeEventsToProtoTimeEvents(as []trace.Annotation, es []trace.MessageEvent) *tracepb.Span_TimeEvents {
+ if len(as) == 0 && len(es) == 0 {
+ return nil
+ }
+
+ timeEvents := &tracepb.Span_TimeEvents{}
+ var annotations, droppedAnnotationsCount int
+ var messageEvents, droppedMessageEventsCount int
+
+ // Transform annotations
+ for i, a := range as {
+ if annotations >= maxAnnotationEventsPerSpan {
+ droppedAnnotationsCount = len(as) - i
+ break
+ }
+ annotations++
+ timeEvents.TimeEvent = append(timeEvents.TimeEvent,
+ &tracepb.Span_TimeEvent{
+ Time: timeToTimestamp(a.Time),
+ Value: transformAnnotationToTimeEvent(&a),
+ },
+ )
+ }
+
+ // Transform message events
+ for i, e := range es {
+ if messageEvents >= maxMessageEventsPerSpan {
+ droppedMessageEventsCount = len(es) - i
+ break
+ }
+ messageEvents++
+ timeEvents.TimeEvent = append(timeEvents.TimeEvent,
+ &tracepb.Span_TimeEvent{
+ Time: timeToTimestamp(e.Time),
+ Value: transformMessageEventToTimeEvent(&e),
+ },
+ )
+ }
+
+ // Process dropped counter
+ timeEvents.DroppedAnnotationsCount = clip32(droppedAnnotationsCount)
+ timeEvents.DroppedMessageEventsCount = clip32(droppedMessageEventsCount)
+
+ return timeEvents
+}
+
+func transformAnnotationToTimeEvent(a *trace.Annotation) *tracepb.Span_TimeEvent_Annotation_ {
+ return &tracepb.Span_TimeEvent_Annotation_{
+ Annotation: &tracepb.Span_TimeEvent_Annotation{
+ Description: &tracepb.TruncatableString{Value: a.Message},
+ Attributes: ocAttributesToProtoAttributes(a.Attributes),
+ },
+ }
+}
+
+func transformMessageEventToTimeEvent(e *trace.MessageEvent) *tracepb.Span_TimeEvent_MessageEvent_ {
+ return &tracepb.Span_TimeEvent_MessageEvent_{
+ MessageEvent: &tracepb.Span_TimeEvent_MessageEvent{
+ Type: tracepb.Span_TimeEvent_MessageEvent_Type(e.EventType),
+ Id: uint64(e.MessageID),
+ UncompressedSize: uint64(e.UncompressedByteSize),
+ CompressedSize: uint64(e.CompressedByteSize),
+ },
+ }
+}
+
+// clip32 clips an int to the range of an int32.
+func clip32(x int) int32 {
+ if x < math.MinInt32 {
+ return math.MinInt32
+ }
+ if x > math.MaxInt32 {
+ return math.MaxInt32
+ }
+ return int32(x)
+}
+
+func timeToTimestamp(t time.Time) *timestamp.Timestamp {
+ nanoTime := t.UnixNano()
+ return ×tamp.Timestamp{
+ Seconds: nanoTime / 1e9,
+ Nanos: int32(nanoTime % 1e9),
+ }
+}
+
+func ocSpanKindToProtoSpanKind(kind int) tracepb.Span_SpanKind {
+ switch kind {
+ case trace.SpanKindClient:
+ return tracepb.Span_CLIENT
+ case trace.SpanKindServer:
+ return tracepb.Span_SERVER
+ default:
+ return tracepb.Span_SPAN_KIND_UNSPECIFIED
+ }
+}
+
+func ocTracestateToProtoTracestate(ts *tracestate.Tracestate) *tracepb.Span_Tracestate {
+ if ts == nil {
+ return nil
+ }
+ return &tracepb.Span_Tracestate{
+ Entries: ocTracestateEntriesToProtoTracestateEntries(ts.Entries()),
+ }
+}
+
+func ocTracestateEntriesToProtoTracestateEntries(entries []tracestate.Entry) []*tracepb.Span_Tracestate_Entry {
+ protoEntries := make([]*tracepb.Span_Tracestate_Entry, 0, len(entries))
+ for _, entry := range entries {
+ protoEntries = append(protoEntries, &tracepb.Span_Tracestate_Entry{
+ Key: entry.Key,
+ Value: entry.Value,
+ })
+ }
+ return protoEntries
+}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go
new file mode 100644
index 000000000..43f18dec1
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/transform_stats_to_metrics.go
@@ -0,0 +1,274 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocagent
+
+import (
+ "errors"
+ "time"
+
+ "go.opencensus.io/stats"
+ "go.opencensus.io/stats/view"
+ "go.opencensus.io/tag"
+
+ "github.com/golang/protobuf/ptypes/timestamp"
+
+ metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
+)
+
+var (
+ errNilMeasure = errors.New("expecting a non-nil stats.Measure")
+ errNilView = errors.New("expecting a non-nil view.View")
+ errNilViewData = errors.New("expecting a non-nil view.Data")
+)
+
+func viewDataToMetric(vd *view.Data) (*metricspb.Metric, error) {
+ if vd == nil {
+ return nil, errNilViewData
+ }
+
+ descriptor, err := viewToMetricDescriptor(vd.View)
+ if err != nil {
+ return nil, err
+ }
+
+ timeseries, err := viewDataToTimeseries(vd)
+ if err != nil {
+ return nil, err
+ }
+
+ metric := &metricspb.Metric{
+ MetricDescriptor: descriptor,
+ Timeseries: timeseries,
+ }
+ return metric, nil
+}
+
+func viewToMetricDescriptor(v *view.View) (*metricspb.MetricDescriptor, error) {
+ if v == nil {
+ return nil, errNilView
+ }
+ if v.Measure == nil {
+ return nil, errNilMeasure
+ }
+
+ desc := &metricspb.MetricDescriptor{
+ Name: stringOrCall(v.Name, v.Measure.Name),
+ Description: stringOrCall(v.Description, v.Measure.Description),
+ Unit: v.Measure.Unit(),
+ Type: aggregationToMetricDescriptorType(v),
+ LabelKeys: tagKeysToLabelKeys(v.TagKeys),
+ }
+ return desc, nil
+}
+
+func stringOrCall(first string, call func() string) string {
+ if first != "" {
+ return first
+ }
+ return call()
+}
+
+type measureType uint
+
+const (
+ measureUnknown measureType = iota
+ measureInt64
+ measureFloat64
+)
+
+func measureTypeFromMeasure(m stats.Measure) measureType {
+ switch m.(type) {
+ default:
+ return measureUnknown
+ case *stats.Float64Measure:
+ return measureFloat64
+ case *stats.Int64Measure:
+ return measureInt64
+ }
+}
+
+func aggregationToMetricDescriptorType(v *view.View) metricspb.MetricDescriptor_Type {
+ if v == nil || v.Aggregation == nil {
+ return metricspb.MetricDescriptor_UNSPECIFIED
+ }
+ if v.Measure == nil {
+ return metricspb.MetricDescriptor_UNSPECIFIED
+ }
+
+ switch v.Aggregation.Type {
+ case view.AggTypeCount:
+ // Cumulative on int64
+ return metricspb.MetricDescriptor_CUMULATIVE_INT64
+
+ case view.AggTypeDistribution:
+ // Cumulative types
+ return metricspb.MetricDescriptor_CUMULATIVE_DISTRIBUTION
+
+ case view.AggTypeLastValue:
+ // Gauge types
+ switch measureTypeFromMeasure(v.Measure) {
+ case measureFloat64:
+ return metricspb.MetricDescriptor_GAUGE_DOUBLE
+ case measureInt64:
+ return metricspb.MetricDescriptor_GAUGE_INT64
+ }
+
+ case view.AggTypeSum:
+ // Cumulative types
+ switch measureTypeFromMeasure(v.Measure) {
+ case measureFloat64:
+ return metricspb.MetricDescriptor_CUMULATIVE_DOUBLE
+ case measureInt64:
+ return metricspb.MetricDescriptor_CUMULATIVE_INT64
+ }
+ }
+
+ // For all other cases, return unspecified.
+ return metricspb.MetricDescriptor_UNSPECIFIED
+}
+
+func tagKeysToLabelKeys(tagKeys []tag.Key) []*metricspb.LabelKey {
+ labelKeys := make([]*metricspb.LabelKey, 0, len(tagKeys))
+ for _, tagKey := range tagKeys {
+ labelKeys = append(labelKeys, &metricspb.LabelKey{
+ Key: tagKey.Name(),
+ })
+ }
+ return labelKeys
+}
+
+func viewDataToTimeseries(vd *view.Data) ([]*metricspb.TimeSeries, error) {
+ if vd == nil || len(vd.Rows) == 0 {
+ return nil, nil
+ }
+
+ // Given that view.Data only contains Start, End
+ // the timestamps for all the row data will be the exact same
+ // per aggregation. However, the values will differ.
+ // Each row has its own tags.
+ startTimestamp := timeToProtoTimestamp(vd.Start)
+ endTimestamp := timeToProtoTimestamp(vd.End)
+
+ mType := measureTypeFromMeasure(vd.View.Measure)
+ timeseries := make([]*metricspb.TimeSeries, 0, len(vd.Rows))
+ // It is imperative that the ordering of "LabelValues" matches those
+ // of the Label keys in the metric descriptor.
+ for _, row := range vd.Rows {
+ labelValues := labelValuesFromTags(row.Tags)
+ point := rowToPoint(vd.View, row, endTimestamp, mType)
+ timeseries = append(timeseries, &metricspb.TimeSeries{
+ StartTimestamp: startTimestamp,
+ LabelValues: labelValues,
+ Points: []*metricspb.Point{point},
+ })
+ }
+
+ if len(timeseries) == 0 {
+ return nil, nil
+ }
+
+ return timeseries, nil
+}
+
+func timeToProtoTimestamp(t time.Time) *timestamp.Timestamp {
+ unixNano := t.UnixNano()
+ return ×tamp.Timestamp{
+ Seconds: int64(unixNano / 1e9),
+ Nanos: int32(unixNano % 1e9),
+ }
+}
+
+func rowToPoint(v *view.View, row *view.Row, endTimestamp *timestamp.Timestamp, mType measureType) *metricspb.Point {
+ pt := &metricspb.Point{
+ Timestamp: endTimestamp,
+ }
+
+ switch data := row.Data.(type) {
+ case *view.CountData:
+ pt.Value = &metricspb.Point_Int64Value{Int64Value: data.Value}
+
+ case *view.DistributionData:
+ pt.Value = &metricspb.Point_DistributionValue{
+ DistributionValue: &metricspb.DistributionValue{
+ Count: data.Count,
+ Sum: float64(data.Count) * data.Mean, // because Mean := Sum/Count
+ // TODO: Add Exemplar
+ Buckets: bucketsToProtoBuckets(data.CountPerBucket),
+ BucketOptions: &metricspb.DistributionValue_BucketOptions{
+ Type: &metricspb.DistributionValue_BucketOptions_Explicit_{
+ Explicit: &metricspb.DistributionValue_BucketOptions_Explicit{
+ Bounds: v.Aggregation.Buckets,
+ },
+ },
+ },
+ SumOfSquaredDeviation: data.SumOfSquaredDev,
+ }}
+
+ case *view.LastValueData:
+ setPointValue(pt, data.Value, mType)
+
+ case *view.SumData:
+ setPointValue(pt, data.Value, mType)
+ }
+
+ return pt
+}
+
+// Not returning anything from this function because metricspb.Point.is_Value is an unexported
+// interface hence we just have to set its value by pointer.
+func setPointValue(pt *metricspb.Point, value float64, mType measureType) {
+ if mType == measureInt64 {
+ pt.Value = &metricspb.Point_Int64Value{Int64Value: int64(value)}
+ } else {
+ pt.Value = &metricspb.Point_DoubleValue{DoubleValue: value}
+ }
+}
+
+func bucketsToProtoBuckets(countPerBucket []int64) []*metricspb.DistributionValue_Bucket {
+ distBuckets := make([]*metricspb.DistributionValue_Bucket, len(countPerBucket))
+ for i := 0; i < len(countPerBucket); i++ {
+ count := countPerBucket[i]
+
+ distBuckets[i] = &metricspb.DistributionValue_Bucket{
+ Count: count,
+ }
+ }
+
+ return distBuckets
+}
+
+func labelValuesFromTags(tags []tag.Tag) []*metricspb.LabelValue {
+ if len(tags) == 0 {
+ return nil
+ }
+
+ labelValues := make([]*metricspb.LabelValue, 0, len(tags))
+ for _, tag_ := range tags {
+ labelValues = append(labelValues, &metricspb.LabelValue{
+ Value: tag_.Value,
+
+ // It is imperative that we set the "HasValue" attribute,
+ // in order to distinguish missing a label from the empty string.
+ // https://godoc.org/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1#LabelValue.HasValue
+ //
+ // OpenCensus-Go uses non-pointers for tags as seen by this function's arguments,
+ // so the best case that we can use to distinguish missing labels/tags from the
+ // empty string is by checking if the Tag.Key.Name() != "" to indicate that we have
+ // a value.
+ HasValue: tag_.Key.Name() != "",
+ })
+ }
+ return labelValues
+}
diff --git a/vendor/contrib.go.opencensus.io/exporter/ocagent/version.go b/vendor/contrib.go.opencensus.io/exporter/ocagent/version.go
new file mode 100644
index 000000000..68be4c75b
--- /dev/null
+++ b/vendor/contrib.go.opencensus.io/exporter/ocagent/version.go
@@ -0,0 +1,17 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocagent
+
+const Version = "0.0.1"
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/models.go
index 53d57a6ad..e21c526ce 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/models.go
@@ -18,13 +18,18 @@ package dns
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
+ "context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
+// The package's fully qualified name.
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns"
+
// RecordType enumerates the values for record type.
type RecordType string
@@ -68,6 +73,18 @@ type ARecord struct {
Ipv4Address *string `json:"ipv4Address,omitempty"`
}
+// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag.
+type AzureEntityResource struct {
+ // Etag - READ-ONLY; Resource Etag.
+ Etag *string `json:"etag,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
+ Type *string `json:"type,omitempty"`
+}
+
// CaaRecord a CAA record.
type CaaRecord struct {
// Flags - The flags for this CAA record as an integer between 0 and 255.
@@ -116,6 +133,17 @@ type NsRecord struct {
Nsdname *string `json:"nsdname,omitempty"`
}
+// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
+// required location and tags
+type ProxyResource struct {
+ // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
+ Type *string `json:"type,omitempty"`
+}
+
// PtrRecord a PTR record.
type PtrRecord struct {
// Ptrdname - The PTR target domain name for this PTR record.
@@ -125,11 +153,11 @@ type PtrRecord struct {
// RecordSet describes a DNS record set (a collection of DNS records with the same name and type).
type RecordSet struct {
autorest.Response `json:"-"`
- // ID - The ID of the record set.
+ // ID - READ-ONLY; The ID of the record set.
ID *string `json:"id,omitempty"`
- // Name - The name of the record set.
+ // Name - READ-ONLY; The name of the record set.
Name *string `json:"name,omitempty"`
- // Type - The type of the record set.
+ // Type - READ-ONLY; The type of the record set.
Type *string `json:"type,omitempty"`
// Etag - The etag of the record set.
Etag *string `json:"etag,omitempty"`
@@ -140,15 +168,6 @@ type RecordSet struct {
// MarshalJSON is the custom marshaler for RecordSet.
func (rs RecordSet) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if rs.ID != nil {
- objectMap["id"] = rs.ID
- }
- if rs.Name != nil {
- objectMap["name"] = rs.Name
- }
- if rs.Type != nil {
- objectMap["type"] = rs.Type
- }
if rs.Etag != nil {
objectMap["etag"] = rs.Etag
}
@@ -223,7 +242,7 @@ type RecordSetListResult struct {
autorest.Response `json:"-"`
// Value - Information about the record sets in the response.
Value *[]RecordSet `json:"value,omitempty"`
- // NextLink - The continuation token for the next page of results.
+ // NextLink - READ-ONLY; The continuation token for the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -233,14 +252,24 @@ type RecordSetListResultIterator struct {
page RecordSetListResultPage
}
-// Next advances to the next value. If there was an error making
+// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
-func (iter *RecordSetListResultIterator) Next() error {
+func (iter *RecordSetListResultIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetListResultIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
- err := iter.page.Next()
+ err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
@@ -249,6 +278,13 @@ func (iter *RecordSetListResultIterator) Next() error {
return nil
}
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *RecordSetListResultIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter RecordSetListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
@@ -268,6 +304,11 @@ func (iter RecordSetListResultIterator) Value() RecordSet {
return iter.page.Values()[iter.i]
}
+// Creates a new instance of the RecordSetListResultIterator type.
+func NewRecordSetListResultIterator(page RecordSetListResultPage) RecordSetListResultIterator {
+ return RecordSetListResultIterator{page: page}
+}
+
// IsEmpty returns true if the ListResult contains no values.
func (rslr RecordSetListResult) IsEmpty() bool {
return rslr.Value == nil || len(*rslr.Value) == 0
@@ -275,11 +316,11 @@ func (rslr RecordSetListResult) IsEmpty() bool {
// recordSetListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (rslr RecordSetListResult) recordSetListResultPreparer() (*http.Request, error) {
+func (rslr RecordSetListResult) recordSetListResultPreparer(ctx context.Context) (*http.Request, error) {
if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 {
return nil, nil
}
- return autorest.Prepare(&http.Request{},
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(rslr.NextLink)))
@@ -287,14 +328,24 @@ func (rslr RecordSetListResult) recordSetListResultPreparer() (*http.Request, er
// RecordSetListResultPage contains a page of RecordSet values.
type RecordSetListResultPage struct {
- fn func(RecordSetListResult) (RecordSetListResult, error)
+ fn func(context.Context, RecordSetListResult) (RecordSetListResult, error)
rslr RecordSetListResult
}
-// Next advances to the next page of values. If there was an error making
+// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *RecordSetListResultPage) Next() error {
- next, err := page.fn(page.rslr)
+func (page *RecordSetListResultPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetListResultPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.rslr)
if err != nil {
return err
}
@@ -302,6 +353,13 @@ func (page *RecordSetListResultPage) Next() error {
return nil
}
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *RecordSetListResultPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page RecordSetListResultPage) NotDone() bool {
return !page.rslr.IsEmpty()
@@ -320,13 +378,18 @@ func (page RecordSetListResultPage) Values() []RecordSet {
return *page.rslr.Value
}
+// Creates a new instance of the RecordSetListResultPage type.
+func NewRecordSetListResultPage(getNextPage func(context.Context, RecordSetListResult) (RecordSetListResult, error)) RecordSetListResultPage {
+ return RecordSetListResultPage{fn: getNextPage}
+}
+
// RecordSetProperties represents the properties of the records in the record set.
type RecordSetProperties struct {
// Metadata - The metadata attached to the record set.
Metadata map[string]*string `json:"metadata"`
// TTL - The TTL (time-to-live) of the records in the record set.
TTL *int64 `json:"TTL,omitempty"`
- // Fqdn - Fully qualified domain name of the record set.
+ // Fqdn - READ-ONLY; Fully qualified domain name of the record set.
Fqdn *string `json:"fqdn,omitempty"`
// ARecords - The list of A records in the record set.
ARecords *[]ARecord `json:"ARecords,omitempty"`
@@ -359,9 +422,6 @@ func (rsp RecordSetProperties) MarshalJSON() ([]byte, error) {
if rsp.TTL != nil {
objectMap["TTL"] = rsp.TTL
}
- if rsp.Fqdn != nil {
- objectMap["fqdn"] = rsp.Fqdn
- }
if rsp.ARecords != nil {
objectMap["ARecords"] = rsp.ARecords
}
@@ -401,39 +461,14 @@ type RecordSetUpdateParameters struct {
RecordSet *RecordSet `json:"RecordSet,omitempty"`
}
-// Resource common properties of an Azure Resource Manager resource
+// Resource ...
type Resource struct {
- // ID - Resource ID.
+ // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
ID *string `json:"id,omitempty"`
- // Name - Resource name.
+ // Name - READ-ONLY; The name of the resource
Name *string `json:"name,omitempty"`
- // Type - Resource type.
+ // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
Type *string `json:"type,omitempty"`
- // Location - Resource location.
- Location *string `json:"location,omitempty"`
- // Tags - Resource tags.
- Tags map[string]*string `json:"tags"`
-}
-
-// MarshalJSON is the custom marshaler for Resource.
-func (r Resource) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if r.ID != nil {
- objectMap["id"] = r.ID
- }
- if r.Name != nil {
- objectMap["name"] = r.Name
- }
- if r.Type != nil {
- objectMap["type"] = r.Type
- }
- if r.Location != nil {
- objectMap["location"] = r.Location
- }
- if r.Tags != nil {
- objectMap["tags"] = r.Tags
- }
- return json.Marshal(objectMap)
}
// SoaRecord an SOA record.
@@ -472,6 +507,32 @@ type SubResource struct {
ID *string `json:"id,omitempty"`
}
+// TrackedResource the resource model definition for a ARM tracked top level resource
+type TrackedResource struct {
+ // Tags - Resource tags.
+ Tags map[string]*string `json:"tags"`
+ // Location - The geo-location where the resource lives
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for TrackedResource.
+func (tr TrackedResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if tr.Tags != nil {
+ objectMap["tags"] = tr.Tags
+ }
+ if tr.Location != nil {
+ objectMap["location"] = tr.Location
+ }
+ return json.Marshal(objectMap)
+}
+
// TxtRecord a TXT record.
type TxtRecord struct {
// Value - The text value of this TXT record.
@@ -485,16 +546,16 @@ type Zone struct {
Etag *string `json:"etag,omitempty"`
// ZoneProperties - The properties of the zone.
*ZoneProperties `json:"properties,omitempty"`
- // ID - Resource ID.
- ID *string `json:"id,omitempty"`
- // Name - Resource name.
- Name *string `json:"name,omitempty"`
- // Type - Resource type.
- Type *string `json:"type,omitempty"`
- // Location - Resource location.
- Location *string `json:"location,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
+ // Location - The geo-location where the resource lives
+ Location *string `json:"location,omitempty"`
+ // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; The name of the resource
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
+ Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Zone.
@@ -506,21 +567,12 @@ func (z Zone) MarshalJSON() ([]byte, error) {
if z.ZoneProperties != nil {
objectMap["properties"] = z.ZoneProperties
}
- if z.ID != nil {
- objectMap["id"] = z.ID
- }
- if z.Name != nil {
- objectMap["name"] = z.Name
- }
- if z.Type != nil {
- objectMap["type"] = z.Type
+ if z.Tags != nil {
+ objectMap["tags"] = z.Tags
}
if z.Location != nil {
objectMap["location"] = z.Location
}
- if z.Tags != nil {
- objectMap["tags"] = z.Tags
- }
return json.Marshal(objectMap)
}
@@ -551,6 +603,24 @@ func (z *Zone) UnmarshalJSON(body []byte) error {
}
z.ZoneProperties = &zoneProperties
}
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ z.Tags = tags
+ }
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ z.Location = &location
+ }
case "id":
if v != nil {
var ID string
@@ -578,24 +648,6 @@ func (z *Zone) UnmarshalJSON(body []byte) error {
}
z.Type = &typeVar
}
- case "location":
- if v != nil {
- var location string
- err = json.Unmarshal(*v, &location)
- if err != nil {
- return err
- }
- z.Location = &location
- }
- case "tags":
- if v != nil {
- var tags map[string]*string
- err = json.Unmarshal(*v, &tags)
- if err != nil {
- return err
- }
- z.Tags = tags
- }
}
}
@@ -607,7 +659,7 @@ type ZoneListResult struct {
autorest.Response `json:"-"`
// Value - Information about the DNS zones.
Value *[]Zone `json:"value,omitempty"`
- // NextLink - The continuation token for the next page of results.
+ // NextLink - READ-ONLY; The continuation token for the next page of results.
NextLink *string `json:"nextLink,omitempty"`
}
@@ -617,14 +669,24 @@ type ZoneListResultIterator struct {
page ZoneListResultPage
}
-// Next advances to the next value. If there was an error making
+// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
-func (iter *ZoneListResultIterator) Next() error {
+func (iter *ZoneListResultIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZoneListResultIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
- err := iter.page.Next()
+ err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
@@ -633,6 +695,13 @@ func (iter *ZoneListResultIterator) Next() error {
return nil
}
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *ZoneListResultIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ZoneListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
@@ -652,6 +721,11 @@ func (iter ZoneListResultIterator) Value() Zone {
return iter.page.Values()[iter.i]
}
+// Creates a new instance of the ZoneListResultIterator type.
+func NewZoneListResultIterator(page ZoneListResultPage) ZoneListResultIterator {
+ return ZoneListResultIterator{page: page}
+}
+
// IsEmpty returns true if the ListResult contains no values.
func (zlr ZoneListResult) IsEmpty() bool {
return zlr.Value == nil || len(*zlr.Value) == 0
@@ -659,11 +733,11 @@ func (zlr ZoneListResult) IsEmpty() bool {
// zoneListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (zlr ZoneListResult) zoneListResultPreparer() (*http.Request, error) {
+func (zlr ZoneListResult) zoneListResultPreparer(ctx context.Context) (*http.Request, error) {
if zlr.NextLink == nil || len(to.String(zlr.NextLink)) < 1 {
return nil, nil
}
- return autorest.Prepare(&http.Request{},
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(zlr.NextLink)))
@@ -671,14 +745,24 @@ func (zlr ZoneListResult) zoneListResultPreparer() (*http.Request, error) {
// ZoneListResultPage contains a page of Zone values.
type ZoneListResultPage struct {
- fn func(ZoneListResult) (ZoneListResult, error)
+ fn func(context.Context, ZoneListResult) (ZoneListResult, error)
zlr ZoneListResult
}
-// Next advances to the next page of values. If there was an error making
+// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *ZoneListResultPage) Next() error {
- next, err := page.fn(page.zlr)
+func (page *ZoneListResultPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZoneListResultPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.zlr)
if err != nil {
return err
}
@@ -686,6 +770,13 @@ func (page *ZoneListResultPage) Next() error {
return nil
}
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *ZoneListResultPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ZoneListResultPage) NotDone() bool {
return !page.zlr.IsEmpty()
@@ -704,60 +795,39 @@ func (page ZoneListResultPage) Values() []Zone {
return *page.zlr.Value
}
+// Creates a new instance of the ZoneListResultPage type.
+func NewZoneListResultPage(getNextPage func(context.Context, ZoneListResult) (ZoneListResult, error)) ZoneListResultPage {
+ return ZoneListResultPage{fn: getNextPage}
+}
+
// ZoneProperties represents the properties of the zone.
type ZoneProperties struct {
- // MaxNumberOfRecordSets - The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
+ // MaxNumberOfRecordSets - READ-ONLY; The maximum number of record sets that can be created in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
MaxNumberOfRecordSets *int64 `json:"maxNumberOfRecordSets,omitempty"`
- // NumberOfRecordSets - The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
+ // NumberOfRecordSets - READ-ONLY; The current number of record sets in this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
NumberOfRecordSets *int64 `json:"numberOfRecordSets,omitempty"`
- // NameServers - The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
+ // NameServers - READ-ONLY; The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
NameServers *[]string `json:"nameServers,omitempty"`
}
// ZonesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type ZonesDeleteFuture struct {
azure.Future
- req *http.Request
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
-func (future ZonesDeleteFuture) Result(client ZonesClient) (ar autorest.Response, err error) {
+func (future *ZonesDeleteFuture) Result(client ZonesClient) (ar autorest.Response, err error) {
var done bool
- done, err = future.Done(client)
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- return ar, azure.NewAsyncOpIncompleteError("dns.ZonesDeleteFuture")
- }
- if future.PollingMethod() == azure.PollingLocation {
- ar, err = client.DeleteResponder(future.Response())
- if err != nil {
- err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", future.Response(), "Failure responding to request")
- }
+ err = azure.NewAsyncOpIncompleteError("dns.ZonesDeleteFuture")
return
}
- var req *http.Request
- var resp *http.Response
- if future.PollingURL() != "" {
- req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
- if err != nil {
- return
- }
- } else {
- req = autorest.ChangeToGet(future.req)
- }
- resp, err = autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if err != nil {
- err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", resp, "Failure sending request")
- return
- }
- ar, err = client.DeleteResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", resp, "Failure responding to request")
- }
+ ar.Response = future.Response()
return
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go
index 45ea7a8c8..d26c5e404 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/recordsets.go
@@ -21,6 +21,8 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,15 +42,38 @@ func NewRecordSetsClientWithBaseURI(baseURI string, subscriptionID string) Recor
}
// CreateOrUpdate creates or updates a record set within a DNS zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the
-// type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created
-// when the DNS zone is created). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the
-// etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag
-// value to prevent accidentally overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new
-// record set to be created, but to prevent updating an existing record set. Other values will be ignored.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// relativeRecordSetName - the name of the record set, relative to the name of the zone.
+// recordType - the type of DNS record in this record set. Record sets of type SOA can be updated but not
+// created (they are created when the DNS zone is created).
+// parameters - parameters supplied to the CreateOrUpdate operation.
+// ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify
+// the last-seen etag value to prevent accidentally overwriting any concurrent changes.
+// ifNoneMatch - set to '*' to allow a new record set to be created, but to prevent updating an existing record
+// set. Other values will be ignored.
func (client RecordSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (result RecordSet, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "CreateOrUpdate", err.Error())
+ }
+
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch, ifNoneMatch)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -85,6 +110,9 @@ func (client RecordSetsClient) CreateOrUpdatePreparer(ctx context.Context, resou
"api-version": APIVersion,
}
+ parameters.ID = nil
+ parameters.Name = nil
+ parameters.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
@@ -124,13 +152,35 @@ func (client RecordSetsClient) CreateOrUpdateResponder(resp *http.Response) (res
}
// Delete deletes a record set from a DNS zone. This operation cannot be undone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the
-// type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS
-// zone is deleted). ifMatch is the etag of the record set. Omit this value to always delete the current record
-// set. Specify the last-seen etag value to prevent accidentally deleting any concurrent changes.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// relativeRecordSetName - the name of the record set, relative to the name of the zone.
+// recordType - the type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are
+// deleted when the DNS zone is deleted).
+// ifMatch - the etag of the record set. Omit this value to always delete the current record set. Specify the
+// last-seen etag value to prevent accidentally deleting any concurrent changes.
func (client RecordSetsClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, ifMatch string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "Delete", err.Error())
+ }
+
req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, ifMatch)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Delete", nil, "Failure preparing request")
@@ -199,11 +249,32 @@ func (client RecordSetsClient) DeleteResponder(resp *http.Response) (result auto
}
// Get gets a record set.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the
-// type of DNS record in this record set.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// relativeRecordSetName - the name of the record set, relative to the name of the zone.
+// recordType - the type of DNS record in this record set.
func (client RecordSetsClient) Get(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType) (result RecordSet, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "Get", err.Error())
+ }
+
req, err := client.GetPreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Get", nil, "Failure preparing request")
@@ -269,13 +340,34 @@ func (client RecordSetsClient) GetResponder(resp *http.Response) (result RecordS
}
// ListByDNSZone lists all record sets in a DNS zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). top is the maximum number of record sets to return. If not specified, returns up to 100 record sets.
-// recordsetnamesuffix is the suffix label of the record set name that has to be used to filter the record set
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// top - the maximum number of record sets to return. If not specified, returns up to 100 record sets.
+// recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set
// enumerations. If this parameter is specified, Enumeration will return only records that end with
// .
func (client RecordSetsClient) ListByDNSZone(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.ListByDNSZone")
+ defer func() {
+ sc := -1
+ if result.rslr.Response.Response != nil {
+ sc = result.rslr.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "ListByDNSZone", err.Error())
+ }
+
result.fn = client.listByDNSZoneNextResults
req, err := client.ListByDNSZonePreparer(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix)
if err != nil {
@@ -346,8 +438,8 @@ func (client RecordSetsClient) ListByDNSZoneResponder(resp *http.Response) (resu
}
// listByDNSZoneNextResults retrieves the next set of results, if any.
-func (client RecordSetsClient) listByDNSZoneNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
- req, err := lastResults.recordSetListResultPreparer()
+func (client RecordSetsClient) listByDNSZoneNextResults(ctx context.Context, lastResults RecordSetListResult) (result RecordSetListResult, err error) {
+ req, err := lastResults.recordSetListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listByDNSZoneNextResults", nil, "Failure preparing next results request")
}
@@ -368,18 +460,50 @@ func (client RecordSetsClient) listByDNSZoneNextResults(lastResults RecordSetLis
// ListByDNSZoneComplete enumerates all values, automatically crossing page boundaries as required.
func (client RecordSetsClient) ListByDNSZoneComplete(ctx context.Context, resourceGroupName string, zoneName string, top *int32, recordsetnamesuffix string) (result RecordSetListResultIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.ListByDNSZone")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.ListByDNSZone(ctx, resourceGroupName, zoneName, top, recordsetnamesuffix)
return
}
// ListByType lists the record sets of a specified type in a DNS zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). recordType is the type of record sets to enumerate. top is the maximum number of record sets to return. If
-// not specified, returns up to 100 record sets. recordsetnamesuffix is the suffix label of the record set name
-// that has to be used to filter the record set enumerations. If this parameter is specified, Enumeration will
-// return only records that end with .
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// recordType - the type of record sets to enumerate.
+// top - the maximum number of record sets to return. If not specified, returns up to 100 record sets.
+// recordsetnamesuffix - the suffix label of the record set name that has to be used to filter the record set
+// enumerations. If this parameter is specified, Enumeration will return only records that end with
+// .
func (client RecordSetsClient) ListByType(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.ListByType")
+ defer func() {
+ sc := -1
+ if result.rslr.Response.Response != nil {
+ sc = result.rslr.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "ListByType", err.Error())
+ }
+
result.fn = client.listByTypeNextResults
req, err := client.ListByTypePreparer(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)
if err != nil {
@@ -451,8 +575,8 @@ func (client RecordSetsClient) ListByTypeResponder(resp *http.Response) (result
}
// listByTypeNextResults retrieves the next set of results, if any.
-func (client RecordSetsClient) listByTypeNextResults(lastResults RecordSetListResult) (result RecordSetListResult, err error) {
- req, err := lastResults.recordSetListResultPreparer()
+func (client RecordSetsClient) listByTypeNextResults(ctx context.Context, lastResults RecordSetListResult) (result RecordSetListResult, err error) {
+ req, err := lastResults.recordSetListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "dns.RecordSetsClient", "listByTypeNextResults", nil, "Failure preparing next results request")
}
@@ -473,18 +597,50 @@ func (client RecordSetsClient) listByTypeNextResults(lastResults RecordSetListRe
// ListByTypeComplete enumerates all values, automatically crossing page boundaries as required.
func (client RecordSetsClient) ListByTypeComplete(ctx context.Context, resourceGroupName string, zoneName string, recordType RecordType, top *int32, recordsetnamesuffix string) (result RecordSetListResultIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.ListByType")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.ListByType(ctx, resourceGroupName, zoneName, recordType, top, recordsetnamesuffix)
return
}
// Update updates a record set within a DNS zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). relativeRecordSetName is the name of the record set, relative to the name of the zone. recordType is the
-// type of DNS record in this record set. parameters is parameters supplied to the Update operation. ifMatch is the
-// etag of the record set. Omit this value to always overwrite the current record set. Specify the last-seen etag
-// value to prevent accidentally overwritting concurrent changes.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// relativeRecordSetName - the name of the record set, relative to the name of the zone.
+// recordType - the type of DNS record in this record set.
+// parameters - parameters supplied to the Update operation.
+// ifMatch - the etag of the record set. Omit this value to always overwrite the current record set. Specify
+// the last-seen etag value to prevent accidentally overwriting concurrent changes.
func (client RecordSetsClient) Update(ctx context.Context, resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string) (result RecordSet, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/RecordSetsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.RecordSetsClient", "Update", err.Error())
+ }
+
req, err := client.UpdatePreparer(ctx, resourceGroupName, zoneName, relativeRecordSetName, recordType, parameters, ifMatch)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.RecordSetsClient", "Update", nil, "Failure preparing request")
@@ -521,6 +677,9 @@ func (client RecordSetsClient) UpdatePreparer(ctx context.Context, resourceGroup
"api-version": APIVersion,
}
+ parameters.ID = nil
+ parameters.Name = nil
+ parameters.Type = nil
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go
index 04ac760d0..588d478e4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-09-01/dns/zones.go
@@ -21,6 +21,8 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,13 +42,35 @@ func NewZonesClientWithBaseURI(baseURI string, subscriptionID string) ZonesClien
}
// CreateOrUpdate creates or updates a DNS zone. Does not modify DNS records within the zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). parameters is parameters supplied to the CreateOrUpdate operation. ifMatch is the etag of the DNS zone.
-// Omit this value to always overwrite the current zone. Specify the last-seen etag value to prevent accidentally
-// overwritting any concurrent changes. ifNoneMatch is set to '*' to allow a new DNS zone to be created, but to
-// prevent updating an existing zone. Other values will be ignored.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// parameters - parameters supplied to the CreateOrUpdate operation.
+// ifMatch - the etag of the DNS zone. Omit this value to always overwrite the current zone. Specify the
+// last-seen etag value to prevent accidentally overwriting any concurrent changes.
+// ifNoneMatch - set to '*' to allow a new DNS zone to be created, but to prevent updating an existing zone.
+// Other values will be ignored.
func (client ZonesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, zoneName string, parameters Zone, ifMatch string, ifNoneMatch string) (result Zone, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.ZonesClient", "CreateOrUpdate", err.Error())
+ }
+
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.ZonesClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -121,11 +145,32 @@ func (client ZonesClient) CreateOrUpdateResponder(resp *http.Response) (result Z
// Delete deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be
// undone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot). ifMatch is the etag of the DNS zone. Omit this value to always delete the current zone. Specify the
-// last-seen etag value to prevent accidentally deleting any concurrent changes.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
+// ifMatch - the etag of the DNS zone. Omit this value to always delete the current zone. Specify the last-seen
+// etag value to prevent accidentally deleting any concurrent changes.
func (client ZonesClient) Delete(ctx context.Context, resourceGroupName string, zoneName string, ifMatch string) (result ZonesDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.ZonesClient", "Delete", err.Error())
+ }
+
req, err := client.DeletePreparer(ctx, resourceGroupName, zoneName, ifMatch)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Delete", nil, "Failure preparing request")
@@ -169,15 +214,13 @@ func (client ZonesClient) DeletePreparer(ctx context.Context, resourceGroupName
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ZonesClient) DeleteSender(req *http.Request) (future ZonesDeleteFuture, err error) {
- sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client))
- future.Future = azure.NewFuture(req)
- future.req = req
- _, err = future.Done(sender)
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
- err = autorest.Respond(future.Response(),
- azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
+ future.Future, err = azure.NewFutureFromResponse(resp)
return
}
@@ -194,10 +237,30 @@ func (client ZonesClient) DeleteResponder(resp *http.Response) (result autorest.
}
// Get gets a DNS zone. Retrieves the zone properties, but not the record sets within the zone.
-//
-// resourceGroupName is the name of the resource group. zoneName is the name of the DNS zone (without a terminating
-// dot).
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// zoneName - the name of the DNS zone (without a terminating dot).
func (client ZonesClient) Get(ctx context.Context, resourceGroupName string, zoneName string) (result Zone, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.ZonesClient", "Get", err.Error())
+ }
+
req, err := client.GetPreparer(ctx, resourceGroupName, zoneName)
if err != nil {
err = autorest.NewErrorWithError(err, "dns.ZonesClient", "Get", nil, "Failure preparing request")
@@ -261,9 +324,25 @@ func (client ZonesClient) GetResponder(resp *http.Response) (result Zone, err er
}
// List lists the DNS zones in all resource groups in a subscription.
-//
-// top is the maximum number of DNS zones to return. If not specified, returns up to 100 zones.
+// Parameters:
+// top - the maximum number of DNS zones to return. If not specified, returns up to 100 zones.
func (client ZonesClient) List(ctx context.Context, top *int32) (result ZoneListResultPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.List")
+ defer func() {
+ sc := -1
+ if result.zlr.Response.Response != nil {
+ sc = result.zlr.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.ZonesClient", "List", err.Error())
+ }
+
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, top)
if err != nil {
@@ -329,8 +408,8 @@ func (client ZonesClient) ListResponder(resp *http.Response) (result ZoneListRes
}
// listNextResults retrieves the next set of results, if any.
-func (client ZonesClient) listNextResults(lastResults ZoneListResult) (result ZoneListResult, err error) {
- req, err := lastResults.zoneListResultPreparer()
+func (client ZonesClient) listNextResults(ctx context.Context, lastResults ZoneListResult) (result ZoneListResult, err error) {
+ req, err := lastResults.zoneListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "listNextResults", nil, "Failure preparing next results request")
}
@@ -351,15 +430,45 @@ func (client ZonesClient) listNextResults(lastResults ZoneListResult) (result Zo
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ZonesClient) ListComplete(ctx context.Context, top *int32) (result ZoneListResultIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.List(ctx, top)
return
}
// ListByResourceGroup lists the DNS zones within a resource group.
-//
-// resourceGroupName is the name of the resource group. top is the maximum number of record sets to return. If not
-// specified, returns up to 100 record sets.
+// Parameters:
+// resourceGroupName - the name of the resource group. The name is case insensitive.
+// top - the maximum number of record sets to return. If not specified, returns up to 100 record sets.
func (client ZonesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.zlr.Response.Response != nil {
+ sc = result.zlr.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: resourceGroupName,
+ Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
+ {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
+ {TargetValue: client.SubscriptionID,
+ Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("dns.ZonesClient", "ListByResourceGroup", err.Error())
+ }
+
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, top)
if err != nil {
@@ -426,8 +535,8 @@ func (client ZonesClient) ListByResourceGroupResponder(resp *http.Response) (res
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client ZonesClient) listByResourceGroupNextResults(lastResults ZoneListResult) (result ZoneListResult, err error) {
- req, err := lastResults.zoneListResultPreparer()
+func (client ZonesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ZoneListResult) (result ZoneListResult, err error) {
+ req, err := lastResults.zoneListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "dns.ZonesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
@@ -448,6 +557,16 @@ func (client ZonesClient) listByResourceGroupNextResults(lastResults ZoneListRes
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client ZonesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, top *int32) (result ZoneListResultIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ZonesClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, top)
return
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
index 2cd4c1b1f..6305cdaa4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go
@@ -18,4 +18,4 @@ package version
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
// Number contains the semantic version of this SDK.
-const Number = "v15.0.1"
+const Number = "v31.2.0"
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
index f570d540a..fa5964742 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
@@ -15,21 +15,22 @@ package adal
// limitations under the License.
import (
+ "errors"
"fmt"
"net/url"
)
const (
- activeDirectoryAPIVersion = "1.0"
+ activeDirectoryEndpointTemplate = "%s/oauth2/%s%s"
)
// OAuthConfig represents the endpoints needed
// in OAuth operations
type OAuthConfig struct {
- AuthorityEndpoint url.URL
- AuthorizeEndpoint url.URL
- TokenEndpoint url.URL
- DeviceCodeEndpoint url.URL
+ AuthorityEndpoint url.URL `json:"authorityEndpoint"`
+ AuthorizeEndpoint url.URL `json:"authorizeEndpoint"`
+ TokenEndpoint url.URL `json:"tokenEndpoint"`
+ DeviceCodeEndpoint url.URL `json:"deviceCodeEndpoint"`
}
// IsZero returns true if the OAuthConfig object is zero-initialized.
@@ -46,11 +47,24 @@ func validateStringParam(param, name string) error {
// NewOAuthConfig returns an OAuthConfig with tenant specific urls
func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) {
+ apiVer := "1.0"
+ return NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID, &apiVer)
+}
+
+// NewOAuthConfigWithAPIVersion returns an OAuthConfig with tenant specific urls.
+// If apiVersion is not nil the "api-version" query parameter will be appended to the endpoint URLs with the specified value.
+func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiVersion *string) (*OAuthConfig, error) {
if err := validateStringParam(activeDirectoryEndpoint, "activeDirectoryEndpoint"); err != nil {
return nil, err
}
+ api := ""
// it's legal for tenantID to be empty so don't validate it
- const activeDirectoryEndpointTemplate = "%s/oauth2/%s?api-version=%s"
+ if apiVersion != nil {
+ if err := validateStringParam(*apiVersion, "apiVersion"); err != nil {
+ return nil, err
+ }
+ api = fmt.Sprintf("?api-version=%s", *apiVersion)
+ }
u, err := url.Parse(activeDirectoryEndpoint)
if err != nil {
return nil, err
@@ -59,15 +73,15 @@ func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, err
if err != nil {
return nil, err
}
- authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", activeDirectoryAPIVersion))
+ authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", api))
if err != nil {
return nil, err
}
- tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", activeDirectoryAPIVersion))
+ tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", api))
if err != nil {
return nil, err
}
- deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", activeDirectoryAPIVersion))
+ deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", api))
if err != nil {
return nil, err
}
@@ -79,3 +93,59 @@ func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, err
DeviceCodeEndpoint: *deviceCodeURL,
}, nil
}
+
+// MultiTenantOAuthConfig provides endpoints for primary and aulixiary tenant IDs.
+type MultiTenantOAuthConfig interface {
+ PrimaryTenant() *OAuthConfig
+ AuxiliaryTenants() []*OAuthConfig
+}
+
+// OAuthOptions contains optional OAuthConfig creation arguments.
+type OAuthOptions struct {
+ APIVersion string
+}
+
+func (c OAuthOptions) apiVersion() string {
+ if c.APIVersion != "" {
+ return fmt.Sprintf("?api-version=%s", c.APIVersion)
+ }
+ return "1.0"
+}
+
+// NewMultiTenantOAuthConfig creates an object that support multitenant OAuth configuration.
+// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/authenticate-multi-tenant for more information.
+func NewMultiTenantOAuthConfig(activeDirectoryEndpoint, primaryTenantID string, auxiliaryTenantIDs []string, options OAuthOptions) (MultiTenantOAuthConfig, error) {
+ if len(auxiliaryTenantIDs) == 0 || len(auxiliaryTenantIDs) > 3 {
+ return nil, errors.New("must specify one to three auxiliary tenants")
+ }
+ mtCfg := multiTenantOAuthConfig{
+ cfgs: make([]*OAuthConfig, len(auxiliaryTenantIDs)+1),
+ }
+ apiVer := options.apiVersion()
+ pri, err := NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, primaryTenantID, &apiVer)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create OAuthConfig for primary tenant: %v", err)
+ }
+ mtCfg.cfgs[0] = pri
+ for i := range auxiliaryTenantIDs {
+ aux, err := NewOAuthConfig(activeDirectoryEndpoint, auxiliaryTenantIDs[i])
+ if err != nil {
+ return nil, fmt.Errorf("failed to create OAuthConfig for tenant '%s': %v", auxiliaryTenantIDs[i], err)
+ }
+ mtCfg.cfgs[i+1] = aux
+ }
+ return mtCfg, nil
+}
+
+type multiTenantOAuthConfig struct {
+ // first config in the slice is the primary tenant
+ cfgs []*OAuthConfig
+}
+
+func (m multiTenantOAuthConfig) PrimaryTenant() *OAuthConfig {
+ return m.cfgs[0]
+}
+
+func (m multiTenantOAuthConfig) AuxiliaryTenants() []*OAuthConfig {
+ return m.cfgs[1:]
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
index 0e5ad14d3..834401e00 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
@@ -38,7 +38,7 @@ func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
return sf(r)
}
-// SendDecorator takes and possibily decorates, by wrapping, a Sender. Decorators may affect the
+// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
// http.Request and pass it along or, first, pass the http.Request along then react to the
// http.Response result.
type SendDecorator func(Sender) Sender
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
index b61b3eb8e..4083e76e6 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
@@ -15,22 +15,26 @@ package adal
// limitations under the License.
import (
+ "context"
"crypto/rand"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"encoding/json"
+ "errors"
"fmt"
"io/ioutil"
+ "math"
+ "net"
"net/http"
"net/url"
- "strconv"
"strings"
"sync"
"time"
"github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/tracing"
"github.com/dgrijalva/jwt-go"
)
@@ -57,6 +61,9 @@ const (
// msiEndpoint is the well known endpoint for getting MSI authentications tokens
msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
+
+ // the default number of attempts to refresh an MSI authentication token
+ defaultMaxMSIRefreshAttempts = 5
)
// OAuthTokenProvider is an interface which should be implemented by an access token retriever
@@ -64,6 +71,12 @@ type OAuthTokenProvider interface {
OAuthToken() string
}
+// MultitenantOAuthTokenProvider provides tokens used for multi-tenant authorization.
+type MultitenantOAuthTokenProvider interface {
+ PrimaryOAuthToken() string
+ AuxiliaryOAuthTokens() []string
+}
+
// TokenRefreshError is an interface used by errors returned during token refresh.
type TokenRefreshError interface {
error
@@ -77,23 +90,39 @@ type Refresher interface {
EnsureFresh() error
}
+// RefresherWithContext is an interface for token refresh functionality
+type RefresherWithContext interface {
+ RefreshWithContext(ctx context.Context) error
+ RefreshExchangeWithContext(ctx context.Context, resource string) error
+ EnsureFreshWithContext(ctx context.Context) error
+}
+
// TokenRefreshCallback is the type representing callbacks that will be called after
// a successful token refresh
type TokenRefreshCallback func(Token) error
// Token encapsulates the access token used to authorize Azure requests.
+// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
- ExpiresIn string `json:"expires_in"`
- ExpiresOn string `json:"expires_on"`
- NotBefore string `json:"not_before"`
+ ExpiresIn json.Number `json:"expires_in"`
+ ExpiresOn json.Number `json:"expires_on"`
+ NotBefore json.Number `json:"not_before"`
Resource string `json:"resource"`
Type string `json:"token_type"`
}
+func newToken() Token {
+ return Token{
+ ExpiresIn: "0",
+ ExpiresOn: "0",
+ NotBefore: "0",
+ }
+}
+
// IsZero returns true if the token object is zero-initialized.
func (t Token) IsZero() bool {
return t == Token{}
@@ -101,12 +130,12 @@ func (t Token) IsZero() bool {
// Expires returns the time.Time when the Token expires.
func (t Token) Expires() time.Time {
- s, err := strconv.Atoi(t.ExpiresOn)
+ s, err := t.ExpiresOn.Float64()
if err != nil {
s = -3600
}
- expiration := date.NewUnixTimeFromSeconds(float64(s))
+ expiration := date.NewUnixTimeFromSeconds(s)
return time.Time(expiration).UTC()
}
@@ -127,6 +156,12 @@ func (t *Token) OAuthToken() string {
return t.AccessToken
}
+// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form
+// that is submitted when acquiring an oAuth token.
+type ServicePrincipalSecret interface {
+ SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error
+}
+
// ServicePrincipalNoSecret represents a secret type that contains no secret
// meaning it is not valid for fetching a fresh token. This is used by Manual
type ServicePrincipalNoSecret struct {
@@ -138,15 +173,19 @@ func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePr
return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token")
}
-// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form
-// that is submitted when acquiring an oAuth token.
-type ServicePrincipalSecret interface {
- SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error
+// MarshalJSON implements the json.Marshaler interface.
+func (noSecret ServicePrincipalNoSecret) MarshalJSON() ([]byte, error) {
+ type tokenType struct {
+ Type string `json:"type"`
+ }
+ return json.Marshal(tokenType{
+ Type: "ServicePrincipalNoSecret",
+ })
}
// ServicePrincipalTokenSecret implements ServicePrincipalSecret for client_secret type authorization.
type ServicePrincipalTokenSecret struct {
- ClientSecret string
+ ClientSecret string `json:"value"`
}
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
@@ -156,49 +195,24 @@ func (tokenSecret *ServicePrincipalTokenSecret) SetAuthenticationValues(spt *Ser
return nil
}
+// MarshalJSON implements the json.Marshaler interface.
+func (tokenSecret ServicePrincipalTokenSecret) MarshalJSON() ([]byte, error) {
+ type tokenType struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+ }
+ return json.Marshal(tokenType{
+ Type: "ServicePrincipalTokenSecret",
+ Value: tokenSecret.ClientSecret,
+ })
+}
+
// ServicePrincipalCertificateSecret implements ServicePrincipalSecret for generic RSA cert auth with signed JWTs.
type ServicePrincipalCertificateSecret struct {
Certificate *x509.Certificate
PrivateKey *rsa.PrivateKey
}
-// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
-type ServicePrincipalMSISecret struct {
-}
-
-// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth.
-type ServicePrincipalUsernamePasswordSecret struct {
- Username string
- Password string
-}
-
-// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth.
-type ServicePrincipalAuthorizationCodeSecret struct {
- ClientSecret string
- AuthorizationCode string
- RedirectURI string
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- v.Set("code", secret.AuthorizationCode)
- v.Set("client_secret", secret.ClientSecret)
- v.Set("redirect_uri", secret.RedirectURI)
- return nil
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- v.Set("username", secret.Username)
- v.Set("password", secret.Password)
- return nil
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- return nil
-}
-
// SignJwt returns the JWT signed with the certificate's private key.
func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalToken) (string, error) {
hasher := sha1.New()
@@ -218,10 +232,12 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo
token := jwt.New(jwt.SigningMethodRS256)
token.Header["x5t"] = thumbprint
+ x5c := []string{base64.StdEncoding.EncodeToString(secret.Certificate.Raw)}
+ token.Header["x5c"] = x5c
token.Claims = jwt.MapClaims{
- "aud": spt.oauthConfig.TokenEndpoint.String(),
- "iss": spt.clientID,
- "sub": spt.clientID,
+ "aud": spt.inner.OauthConfig.TokenEndpoint.String(),
+ "iss": spt.inner.ClientID,
+ "sub": spt.inner.ClientID,
"jti": base64.URLEncoding.EncodeToString(jti),
"nbf": time.Now().Unix(),
"exp": time.Now().Add(time.Hour * 24).Unix(),
@@ -244,19 +260,156 @@ func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *Se
return nil
}
+// MarshalJSON implements the json.Marshaler interface.
+func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) {
+ return nil, errors.New("marshalling ServicePrincipalCertificateSecret is not supported")
+}
+
+// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
+type ServicePrincipalMSISecret struct {
+}
+
+// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
+func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (msiSecret ServicePrincipalMSISecret) MarshalJSON() ([]byte, error) {
+ return nil, errors.New("marshalling ServicePrincipalMSISecret is not supported")
+}
+
+// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth.
+type ServicePrincipalUsernamePasswordSecret struct {
+ Username string `json:"username"`
+ Password string `json:"password"`
+}
+
+// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
+func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
+ v.Set("username", secret.Username)
+ v.Set("password", secret.Password)
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (secret ServicePrincipalUsernamePasswordSecret) MarshalJSON() ([]byte, error) {
+ type tokenType struct {
+ Type string `json:"type"`
+ Username string `json:"username"`
+ Password string `json:"password"`
+ }
+ return json.Marshal(tokenType{
+ Type: "ServicePrincipalUsernamePasswordSecret",
+ Username: secret.Username,
+ Password: secret.Password,
+ })
+}
+
+// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth.
+type ServicePrincipalAuthorizationCodeSecret struct {
+ ClientSecret string `json:"value"`
+ AuthorizationCode string `json:"authCode"`
+ RedirectURI string `json:"redirect"`
+}
+
+// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
+func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
+ v.Set("code", secret.AuthorizationCode)
+ v.Set("client_secret", secret.ClientSecret)
+ v.Set("redirect_uri", secret.RedirectURI)
+ return nil
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, error) {
+ type tokenType struct {
+ Type string `json:"type"`
+ Value string `json:"value"`
+ AuthCode string `json:"authCode"`
+ Redirect string `json:"redirect"`
+ }
+ return json.Marshal(tokenType{
+ Type: "ServicePrincipalAuthorizationCodeSecret",
+ Value: secret.ClientSecret,
+ AuthCode: secret.AuthorizationCode,
+ Redirect: secret.RedirectURI,
+ })
+}
+
// ServicePrincipalToken encapsulates a Token created for a Service Principal.
type ServicePrincipalToken struct {
- token Token
- secret ServicePrincipalSecret
- oauthConfig OAuthConfig
- clientID string
- resource string
- autoRefresh bool
- refreshLock *sync.RWMutex
- refreshWithin time.Duration
- sender Sender
-
+ inner servicePrincipalToken
+ refreshLock *sync.RWMutex
+ sender Sender
refreshCallbacks []TokenRefreshCallback
+ // MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token.
+ MaxMSIRefreshAttempts int
+}
+
+// MarshalTokenJSON returns the marshalled inner token.
+func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) {
+ return json.Marshal(spt.inner.Token)
+}
+
+// SetRefreshCallbacks replaces any existing refresh callbacks with the specified callbacks.
+func (spt *ServicePrincipalToken) SetRefreshCallbacks(callbacks []TokenRefreshCallback) {
+ spt.refreshCallbacks = callbacks
+}
+
+// MarshalJSON implements the json.Marshaler interface.
+func (spt ServicePrincipalToken) MarshalJSON() ([]byte, error) {
+ return json.Marshal(spt.inner)
+}
+
+// UnmarshalJSON implements the json.Unmarshaler interface.
+func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error {
+ // need to determine the token type
+ raw := map[string]interface{}{}
+ err := json.Unmarshal(data, &raw)
+ if err != nil {
+ return err
+ }
+ secret := raw["secret"].(map[string]interface{})
+ switch secret["type"] {
+ case "ServicePrincipalNoSecret":
+ spt.inner.Secret = &ServicePrincipalNoSecret{}
+ case "ServicePrincipalTokenSecret":
+ spt.inner.Secret = &ServicePrincipalTokenSecret{}
+ case "ServicePrincipalCertificateSecret":
+ return errors.New("unmarshalling ServicePrincipalCertificateSecret is not supported")
+ case "ServicePrincipalMSISecret":
+ return errors.New("unmarshalling ServicePrincipalMSISecret is not supported")
+ case "ServicePrincipalUsernamePasswordSecret":
+ spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{}
+ case "ServicePrincipalAuthorizationCodeSecret":
+ spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{}
+ default:
+ return fmt.Errorf("unrecognized token type '%s'", secret["type"])
+ }
+ err = json.Unmarshal(data, &spt.inner)
+ if err != nil {
+ return err
+ }
+ // Don't override the refreshLock or the sender if those have been already set.
+ if spt.refreshLock == nil {
+ spt.refreshLock = &sync.RWMutex{}
+ }
+ if spt.sender == nil {
+ spt.sender = &http.Client{Transport: tracing.Transport}
+ }
+ return nil
+}
+
+// internal type used for marshalling/unmarshalling
+type servicePrincipalToken struct {
+ Token Token `json:"token"`
+ Secret ServicePrincipalSecret `json:"secret"`
+ OauthConfig OAuthConfig `json:"oauth"`
+ ClientID string `json:"clientID"`
+ Resource string `json:"resource"`
+ AutoRefresh bool `json:"autoRefresh"`
+ RefreshWithin time.Duration `json:"refreshWithin"`
}
func validateOAuthConfig(oac OAuthConfig) error {
@@ -281,14 +434,17 @@ func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, reso
return nil, fmt.Errorf("parameter 'secret' cannot be nil")
}
spt := &ServicePrincipalToken{
- oauthConfig: oauthConfig,
- secret: secret,
- clientID: id,
- resource: resource,
- autoRefresh: true,
+ inner: servicePrincipalToken{
+ Token: newToken(),
+ OauthConfig: oauthConfig,
+ Secret: secret,
+ ClientID: id,
+ Resource: resource,
+ AutoRefresh: true,
+ RefreshWithin: defaultRefresh,
+ },
refreshLock: &sync.RWMutex{},
- refreshWithin: defaultRefresh,
- sender: &http.Client{},
+ sender: &http.Client{Transport: tracing.Transport},
refreshCallbacks: callbacks,
}
return spt, nil
@@ -318,7 +474,39 @@ func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID s
return nil, err
}
- spt.token = token
+ spt.inner.Token = token
+
+ return spt, nil
+}
+
+// NewServicePrincipalTokenFromManualTokenSecret creates a ServicePrincipalToken using the supplied token and secret
+func NewServicePrincipalTokenFromManualTokenSecret(oauthConfig OAuthConfig, clientID string, resource string, token Token, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
+ if err := validateOAuthConfig(oauthConfig); err != nil {
+ return nil, err
+ }
+ if err := validateStringParam(clientID, "clientID"); err != nil {
+ return nil, err
+ }
+ if err := validateStringParam(resource, "resource"); err != nil {
+ return nil, err
+ }
+ if secret == nil {
+ return nil, fmt.Errorf("parameter 'secret' cannot be nil")
+ }
+ if token.IsZero() {
+ return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized")
+ }
+ spt, err := NewServicePrincipalTokenWithSecret(
+ oauthConfig,
+ clientID,
+ resource,
+ secret,
+ callbacks...)
+ if err != nil {
+ return nil, err
+ }
+
+ spt.inner.Token = token
return spt, nil
}
@@ -486,20 +674,24 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
msiEndpointURL.RawQuery = v.Encode()
spt := &ServicePrincipalToken{
- oauthConfig: OAuthConfig{
- TokenEndpoint: *msiEndpointURL,
+ inner: servicePrincipalToken{
+ Token: newToken(),
+ OauthConfig: OAuthConfig{
+ TokenEndpoint: *msiEndpointURL,
+ },
+ Secret: &ServicePrincipalMSISecret{},
+ Resource: resource,
+ AutoRefresh: true,
+ RefreshWithin: defaultRefresh,
},
- secret: &ServicePrincipalMSISecret{},
- resource: resource,
- autoRefresh: true,
- refreshLock: &sync.RWMutex{},
- refreshWithin: defaultRefresh,
- sender: &http.Client{},
- refreshCallbacks: callbacks,
+ refreshLock: &sync.RWMutex{},
+ sender: &http.Client{Transport: tracing.Transport},
+ refreshCallbacks: callbacks,
+ MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts,
}
if userAssignedID != nil {
- spt.clientID = *userAssignedID
+ spt.inner.ClientID = *userAssignedID
}
return spt, nil
@@ -528,12 +720,18 @@ func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError
// EnsureFresh will refresh the token if it will expire within the refresh window (as set by
// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
func (spt *ServicePrincipalToken) EnsureFresh() error {
- if spt.autoRefresh && spt.token.WillExpireIn(spt.refreshWithin) {
+ return spt.EnsureFreshWithContext(context.Background())
+}
+
+// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
+// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
+func (spt *ServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
+ if spt.inner.AutoRefresh && spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) {
// take the write lock then check to see if the token was already refreshed
spt.refreshLock.Lock()
defer spt.refreshLock.Unlock()
- if spt.token.WillExpireIn(spt.refreshWithin) {
- return spt.refreshInternal(spt.resource)
+ if spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) {
+ return spt.refreshInternal(ctx, spt.inner.Resource)
}
}
return nil
@@ -543,7 +741,7 @@ func (spt *ServicePrincipalToken) EnsureFresh() error {
func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error {
if spt.refreshCallbacks != nil {
for _, callback := range spt.refreshCallbacks {
- err := callback(spt.token)
+ err := callback(spt.inner.Token)
if err != nil {
return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err)
}
@@ -555,21 +753,33 @@ func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error {
// Refresh obtains a fresh token for the Service Principal.
// This method is not safe for concurrent use and should be syncrhonized.
func (spt *ServicePrincipalToken) Refresh() error {
+ return spt.RefreshWithContext(context.Background())
+}
+
+// RefreshWithContext obtains a fresh token for the Service Principal.
+// This method is not safe for concurrent use and should be syncrhonized.
+func (spt *ServicePrincipalToken) RefreshWithContext(ctx context.Context) error {
spt.refreshLock.Lock()
defer spt.refreshLock.Unlock()
- return spt.refreshInternal(spt.resource)
+ return spt.refreshInternal(ctx, spt.inner.Resource)
}
// RefreshExchange refreshes the token, but for a different resource.
// This method is not safe for concurrent use and should be syncrhonized.
func (spt *ServicePrincipalToken) RefreshExchange(resource string) error {
+ return spt.RefreshExchangeWithContext(context.Background(), resource)
+}
+
+// RefreshExchangeWithContext refreshes the token, but for a different resource.
+// This method is not safe for concurrent use and should be syncrhonized.
+func (spt *ServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error {
spt.refreshLock.Lock()
defer spt.refreshLock.Unlock()
- return spt.refreshInternal(resource)
+ return spt.refreshInternal(ctx, resource)
}
func (spt *ServicePrincipalToken) getGrantType() string {
- switch spt.secret.(type) {
+ switch spt.inner.Secret.(type) {
case *ServicePrincipalUsernamePasswordSecret:
return OAuthGrantTypeUserPass
case *ServicePrincipalAuthorizationCodeSecret:
@@ -587,23 +797,32 @@ func isIMDS(u url.URL) bool {
return u.Host == imds.Host && u.Path == imds.Path
}
-func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
- req, err := http.NewRequest(http.MethodPost, spt.oauthConfig.TokenEndpoint.String(), nil)
+func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error {
+ req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil)
if err != nil {
return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
}
-
- if !isIMDS(spt.oauthConfig.TokenEndpoint) {
+ req.Header.Add("User-Agent", UserAgent())
+ req = req.WithContext(ctx)
+ if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
v := url.Values{}
- v.Set("client_id", spt.clientID)
+ v.Set("client_id", spt.inner.ClientID)
v.Set("resource", resource)
- if spt.token.RefreshToken != "" {
+ if spt.inner.Token.RefreshToken != "" {
v.Set("grant_type", OAuthGrantTypeRefreshToken)
- v.Set("refresh_token", spt.token.RefreshToken)
+ v.Set("refresh_token", spt.inner.Token.RefreshToken)
+ // web apps must specify client_secret when refreshing tokens
+ // see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#refreshing-the-access-tokens
+ if spt.getGrantType() == OAuthGrantTypeAuthorizationCode {
+ err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
+ if err != nil {
+ return err
+ }
+ }
} else {
v.Set("grant_type", spt.getGrantType())
- err := spt.secret.SetAuthenticationValues(spt, &v)
+ err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
if err != nil {
return err
}
@@ -616,14 +835,19 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
req.Body = body
}
- if _, ok := spt.secret.(*ServicePrincipalMSISecret); ok {
+ if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok {
req.Method = http.MethodGet
req.Header.Set(metadataHeader, "true")
}
- resp, err := spt.sender.Do(req)
+ var resp *http.Response
+ if isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
+ resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts)
+ } else {
+ resp, err = spt.sender.Do(req)
+ }
if err != nil {
- return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err)
+ return newTokenRefreshError(fmt.Sprintf("adal: Failed to execute the refresh request. Error = '%v'", err), nil)
}
defer resp.Body.Close()
@@ -631,11 +855,15 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
if resp.StatusCode != http.StatusOK {
if err != nil {
- return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body", resp.StatusCode), resp)
+ return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v", resp.StatusCode, err), resp)
}
return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s", resp.StatusCode, string(rb)), resp)
}
+ // for the following error cases don't return a TokenRefreshError. the operation succeeded
+ // but some transient failure happened during deserialization. by returning a generic error
+ // the retry logic will kick in (we don't retry on TokenRefreshError).
+
if err != nil {
return fmt.Errorf("adal: Failed to read a new service principal token during refresh. Error = '%v'", err)
}
@@ -648,20 +876,99 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
return fmt.Errorf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb))
}
- spt.token = token
+ spt.inner.Token = token
return spt.InvokeRefreshCallbacks(token)
}
+// retry logic specific to retrieving a token from the IMDS endpoint
+func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) {
+ // copied from client.go due to circular dependency
+ retries := []int{
+ http.StatusRequestTimeout, // 408
+ http.StatusTooManyRequests, // 429
+ http.StatusInternalServerError, // 500
+ http.StatusBadGateway, // 502
+ http.StatusServiceUnavailable, // 503
+ http.StatusGatewayTimeout, // 504
+ }
+ // extra retry status codes specific to IMDS
+ retries = append(retries,
+ http.StatusNotFound,
+ http.StatusGone,
+ // all remaining 5xx
+ http.StatusNotImplemented,
+ http.StatusHTTPVersionNotSupported,
+ http.StatusVariantAlsoNegotiates,
+ http.StatusInsufficientStorage,
+ http.StatusLoopDetected,
+ http.StatusNotExtended,
+ http.StatusNetworkAuthenticationRequired)
+
+ // see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance
+
+ const maxDelay time.Duration = 60 * time.Second
+
+ attempt := 0
+ delay := time.Duration(0)
+
+ for attempt < maxAttempts {
+ resp, err = sender.Do(req)
+ // retry on temporary network errors, e.g. transient network failures.
+ // if we don't receive a response then assume we can't connect to the
+ // endpoint so we're likely not running on an Azure VM so don't retry.
+ if (err != nil && !isTemporaryNetworkError(err)) || resp == nil || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) {
+ return
+ }
+
+ // perform exponential backoff with a cap.
+ // must increment attempt before calculating delay.
+ attempt++
+ // the base value of 2 is the "delta backoff" as specified in the guidance doc
+ delay += (time.Duration(math.Pow(2, float64(attempt))) * time.Second)
+ if delay > maxDelay {
+ delay = maxDelay
+ }
+
+ select {
+ case <-time.After(delay):
+ // intentionally left blank
+ case <-req.Context().Done():
+ err = req.Context().Err()
+ return
+ }
+ }
+ return
+}
+
+// returns true if the specified error is a temporary network error or false if it's not.
+// if the error doesn't implement the net.Error interface the return value is true.
+func isTemporaryNetworkError(err error) bool {
+ if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
+ return true
+ }
+ return false
+}
+
+// returns true if slice ints contains the value n
+func containsInt(ints []int, n int) bool {
+ for _, i := range ints {
+ if i == n {
+ return true
+ }
+ }
+ return false
+}
+
// SetAutoRefresh enables or disables automatic refreshing of stale tokens.
func (spt *ServicePrincipalToken) SetAutoRefresh(autoRefresh bool) {
- spt.autoRefresh = autoRefresh
+ spt.inner.AutoRefresh = autoRefresh
}
// SetRefreshWithin sets the interval within which if the token will expire, EnsureFresh will
// refresh the token.
func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) {
- spt.refreshWithin = d
+ spt.inner.RefreshWithin = d
return
}
@@ -673,12 +980,76 @@ func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s }
func (spt *ServicePrincipalToken) OAuthToken() string {
spt.refreshLock.RLock()
defer spt.refreshLock.RUnlock()
- return spt.token.OAuthToken()
+ return spt.inner.Token.OAuthToken()
}
// Token returns a copy of the current token.
func (spt *ServicePrincipalToken) Token() Token {
spt.refreshLock.RLock()
defer spt.refreshLock.RUnlock()
- return spt.token
+ return spt.inner.Token
+}
+
+// MultiTenantServicePrincipalToken contains tokens for multi-tenant authorization.
+type MultiTenantServicePrincipalToken struct {
+ PrimaryToken *ServicePrincipalToken
+ AuxiliaryTokens []*ServicePrincipalToken
+}
+
+// PrimaryOAuthToken returns the primary authorization token.
+func (mt *MultiTenantServicePrincipalToken) PrimaryOAuthToken() string {
+ return mt.PrimaryToken.OAuthToken()
+}
+
+// AuxiliaryOAuthTokens returns one to three auxiliary authorization tokens.
+func (mt *MultiTenantServicePrincipalToken) AuxiliaryOAuthTokens() []string {
+ tokens := make([]string, len(mt.AuxiliaryTokens))
+ for i := range mt.AuxiliaryTokens {
+ tokens[i] = mt.AuxiliaryTokens[i].OAuthToken()
+ }
+ return tokens
+}
+
+// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
+// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
+func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
+ if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil {
+ return fmt.Errorf("failed to refresh primary token: %v", err)
+ }
+ for _, aux := range mt.AuxiliaryTokens {
+ if err := aux.EnsureFreshWithContext(ctx); err != nil {
+ return fmt.Errorf("failed to refresh auxiliary token: %v", err)
+ }
+ }
+ return nil
+}
+
+// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource.
+func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) {
+ if err := validateStringParam(clientID, "clientID"); err != nil {
+ return nil, err
+ }
+ if err := validateStringParam(secret, "secret"); err != nil {
+ return nil, err
+ }
+ if err := validateStringParam(resource, "resource"); err != nil {
+ return nil, err
+ }
+ auxTenants := multiTenantCfg.AuxiliaryTenants()
+ m := MultiTenantServicePrincipalToken{
+ AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)),
+ }
+ primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err)
+ }
+ m.PrimaryToken = primary
+ for i := range auxTenants {
+ aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err)
+ }
+ m.AuxiliaryTokens[i] = aux
+ }
+ return &m, nil
}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
new file mode 100644
index 000000000..c867b3484
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
@@ -0,0 +1,45 @@
+package adal
+
+import (
+ "fmt"
+ "runtime"
+)
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+const number = "v1.0.0"
+
+var (
+ ua = fmt.Sprintf("Go/%s (%s-%s) go-autorest/adal/%s",
+ runtime.Version(),
+ runtime.GOARCH,
+ runtime.GOOS,
+ number,
+ )
+)
+
+// UserAgent returns a string containing the Go version, system architecture and OS, and the adal version.
+func UserAgent() string {
+ return ua
+}
+
+// AddToUserAgent adds an extension to the current user agent
+func AddToUserAgent(extension string) error {
+ if extension != "" {
+ ua = fmt.Sprintf("%s %s", ua, extension)
+ return nil
+ }
+ return fmt.Errorf("Extension was empty, User Agent remained as '%s'", ua)
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go
index c51eac0a7..380865cd6 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/authorization.go
@@ -15,12 +15,14 @@ package autorest
// limitations under the License.
import (
+ "encoding/base64"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/Azure/go-autorest/autorest/adal"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -30,6 +32,8 @@ const (
apiKeyAuthorizerHeader = "Ocp-Apim-Subscription-Key"
bingAPISdkHeader = "X-BingApis-SDK-Client"
golangBingAPISdkHeaderValue = "Go-SDK"
+ authorization = "Authorization"
+ basic = "Basic"
)
// Authorizer is the interface that provides a PrepareDecorator used to supply request
@@ -68,7 +72,7 @@ func NewAPIKeyAuthorizer(headers map[string]interface{}, queryParameters map[str
return &APIKeyAuthorizer{headers: headers, queryParameters: queryParameters}
}
-// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Paramaters
+// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Parameters.
func (aka *APIKeyAuthorizer) WithAuthorization() PrepareDecorator {
return func(p Preparer) Preparer {
return DecoratePreparer(p, WithHeaders(aka.headers), WithQueryParameters(aka.queryParameters))
@@ -113,17 +117,19 @@ func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator {
return PreparerFunc(func(r *http.Request) (*http.Request, error) {
r, err := p.Prepare(r)
if err == nil {
- refresher, ok := ba.tokenProvider.(adal.Refresher)
- if ok {
- err := refresher.EnsureFresh()
- if err != nil {
- var resp *http.Response
- if tokError, ok := err.(adal.TokenRefreshError); ok {
- resp = tokError.Response()
- }
- return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp,
- "Failed to refresh the Token for request to %s", r.URL)
+ // the ordering is important here, prefer RefresherWithContext if available
+ if refresher, ok := ba.tokenProvider.(adal.RefresherWithContext); ok {
+ err = refresher.EnsureFreshWithContext(r.Context())
+ } else if refresher, ok := ba.tokenProvider.(adal.Refresher); ok {
+ err = refresher.EnsureFresh()
+ }
+ if err != nil {
+ var resp *http.Response
+ if tokError, ok := err.(adal.TokenRefreshError); ok {
+ resp = tokError.Response()
}
+ return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp,
+ "Failed to refresh the Token for request to %s", r.URL)
}
return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken())))
}
@@ -145,7 +151,7 @@ type BearerAuthorizerCallback struct {
// is invoked when the HTTP request is submitted.
func NewBearerAuthorizerCallback(sender Sender, callback BearerAuthorizerCallbackFunc) *BearerAuthorizerCallback {
if sender == nil {
- sender = &http.Client{}
+ sender = &http.Client{Transport: tracing.Transport}
}
return &BearerAuthorizerCallback{sender: sender, callback: callback}
}
@@ -255,3 +261,76 @@ func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator {
}
return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
}
+
+// BasicAuthorizer implements basic HTTP authorization by adding the Authorization HTTP header
+// with the value "Basic " where is a base64-encoded username:password tuple.
+type BasicAuthorizer struct {
+ userName string
+ password string
+}
+
+// NewBasicAuthorizer creates a new BasicAuthorizer with the specified username and password.
+func NewBasicAuthorizer(userName, password string) *BasicAuthorizer {
+ return &BasicAuthorizer{
+ userName: userName,
+ password: password,
+ }
+}
+
+// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
+// value is "Basic " followed by the base64-encoded username:password tuple.
+func (ba *BasicAuthorizer) WithAuthorization() PrepareDecorator {
+ headers := make(map[string]interface{})
+ headers[authorization] = basic + " " + base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", ba.userName, ba.password)))
+
+ return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
+}
+
+// MultiTenantServicePrincipalTokenAuthorizer provides authentication across tenants.
+type MultiTenantServicePrincipalTokenAuthorizer interface {
+ WithAuthorization() PrepareDecorator
+}
+
+// NewMultiTenantServicePrincipalTokenAuthorizer crates a BearerAuthorizer using the given token provider
+func NewMultiTenantServicePrincipalTokenAuthorizer(tp adal.MultitenantOAuthTokenProvider) MultiTenantServicePrincipalTokenAuthorizer {
+ return &multiTenantSPTAuthorizer{tp: tp}
+}
+
+type multiTenantSPTAuthorizer struct {
+ tp adal.MultitenantOAuthTokenProvider
+}
+
+// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header using the
+// primary token along with the auxiliary authorization header using the auxiliary tokens.
+//
+// By default, the token will be automatically refreshed through the Refresher interface.
+func (mt multiTenantSPTAuthorizer) WithAuthorization() PrepareDecorator {
+ return func(p Preparer) Preparer {
+ return PreparerFunc(func(r *http.Request) (*http.Request, error) {
+ r, err := p.Prepare(r)
+ if err != nil {
+ return r, err
+ }
+ if refresher, ok := mt.tp.(adal.RefresherWithContext); ok {
+ err = refresher.EnsureFreshWithContext(r.Context())
+ if err != nil {
+ var resp *http.Response
+ if tokError, ok := err.(adal.TokenRefreshError); ok {
+ resp = tokError.Response()
+ }
+ return r, NewErrorWithError(err, "azure.multiTenantSPTAuthorizer", "WithAuthorization", resp,
+ "Failed to refresh one or more Tokens for request to %s", r.URL)
+ }
+ }
+ r, err = Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", mt.tp.PrimaryOAuthToken())))
+ if err != nil {
+ return r, err
+ }
+ auxTokens := mt.tp.AuxiliaryOAuthTokens()
+ for i := range auxTokens {
+ auxTokens[i] = fmt.Sprintf("Bearer %s", auxTokens[i])
+ }
+ return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, "; ")))
+ })
+ }
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
index a58e5ef3f..1cb41cbeb 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
@@ -21,11 +21,12 @@ import (
"fmt"
"io/ioutil"
"net/http"
+ "net/url"
"strings"
"time"
"github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/date"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -44,84 +45,74 @@ var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.Stat
// Future provides a mechanism to access the status and results of an asynchronous request.
// Since futures are stateful they should be passed by value to avoid race conditions.
type Future struct {
- req *http.Request
- resp *http.Response
- ps pollingState
+ pt pollingTracker
}
-// NewFuture returns a new Future object initialized with the specified request.
-func NewFuture(req *http.Request) Future {
- return Future{req: req}
+// NewFutureFromResponse returns a new Future object initialized
+// with the initial response from an asynchronous operation.
+func NewFutureFromResponse(resp *http.Response) (Future, error) {
+ pt, err := createPollingTracker(resp)
+ return Future{pt: pt}, err
}
-// Response returns the last HTTP response or nil if there isn't one.
+// Response returns the last HTTP response.
func (f Future) Response() *http.Response {
- return f.resp
+ if f.pt == nil {
+ return nil
+ }
+ return f.pt.latestResponse()
}
// Status returns the last status message of the operation.
func (f Future) Status() string {
- if f.ps.State == "" {
- return "Unknown"
+ if f.pt == nil {
+ return ""
}
- return f.ps.State
+ return f.pt.pollingStatus()
}
// PollingMethod returns the method used to monitor the status of the asynchronous operation.
func (f Future) PollingMethod() PollingMethodType {
- return f.ps.PollingMethod
+ if f.pt == nil {
+ return PollingUnknown
+ }
+ return f.pt.pollingMethod()
}
-// Done queries the service to see if the operation has completed.
-func (f *Future) Done(sender autorest.Sender) (bool, error) {
- // exit early if this future has terminated
- if f.ps.hasTerminated() {
- return true, f.errorInfo()
+// DoneWithContext queries the service to see if the operation has completed.
+func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) {
+ ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.DoneWithContext")
+ defer func() {
+ sc := -1
+ resp := f.Response()
+ if resp != nil {
+ sc = resp.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+
+ if f.pt == nil {
+ return false, autorest.NewError("Future", "Done", "future is not initialized")
}
- resp, err := sender.Do(f.req)
- f.resp = resp
- if err != nil {
+ if f.pt.hasTerminated() {
+ return true, f.pt.pollingError()
+ }
+ if err := f.pt.pollForStatus(ctx, sender); err != nil {
return false, err
}
-
- if !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) {
- // check response body for error content
- if resp.Body != nil {
- type respErr struct {
- ServiceError ServiceError `json:"error"`
- }
- re := respErr{}
-
- defer resp.Body.Close()
- b, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return false, err
- }
- err = json.Unmarshal(b, &re)
- if err != nil {
- return false, err
- }
- return false, re.ServiceError
- }
-
- // try to return something meaningful
- return false, ServiceError{
- Code: fmt.Sprintf("%v", resp.StatusCode),
- Message: resp.Status,
- }
+ if err := f.pt.checkForErrors(); err != nil {
+ return f.pt.hasTerminated(), err
}
-
- err = updatePollingState(resp, &f.ps)
- if err != nil {
+ if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil {
return false, err
}
-
- if f.ps.hasTerminated() {
- return true, f.errorInfo()
+ if err := f.pt.initPollingMethod(); err != nil {
+ return false, err
}
-
- f.req, err = newPollingRequest(f.ps)
- return false, err
+ if err := f.pt.updatePollingMethod(); err != nil {
+ return false, err
+ }
+ return f.pt.hasTerminated(), f.pt.pollingError()
}
// GetPollingDelay returns a duration the application should wait before checking
@@ -129,11 +120,15 @@ func (f *Future) Done(sender autorest.Sender) (bool, error) {
// the service via the Retry-After response header. If the header wasn't returned
// then the function returns the zero-value time.Duration and false.
func (f Future) GetPollingDelay() (time.Duration, bool) {
- if f.resp == nil {
+ if f.pt == nil {
+ return 0, false
+ }
+ resp := f.pt.latestResponse()
+ if resp == nil {
return 0, false
}
- retry := f.resp.Header.Get(autorest.HeaderRetryAfter)
+ retry := resp.Header.Get(autorest.HeaderRetryAfter)
if retry == "" {
return 0, false
}
@@ -146,18 +141,37 @@ func (f Future) GetPollingDelay() (time.Duration, bool) {
return d, true
}
-// WaitForCompletion will return when one of the following conditions is met: the long
+// WaitForCompletionRef will return when one of the following conditions is met: the long
// running operation has completed, the provided context is cancelled, or the client's
// polling duration has been exceeded. It will retry failed polling attempts based on
// the retry value defined in the client up to the maximum retry attempts.
-func (f Future) WaitForCompletion(ctx context.Context, client autorest.Client) error {
- ctx, cancel := context.WithTimeout(ctx, client.PollingDuration)
- defer cancel()
+// If no deadline is specified in the context then the client.PollingDuration will be
+// used to determine if a default deadline should be used.
+// If PollingDuration is greater than zero the value will be used as the context's timeout.
+// If PollingDuration is zero then no default deadline will be used.
+func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) (err error) {
+ ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.WaitForCompletionRef")
+ defer func() {
+ sc := -1
+ resp := f.Response()
+ if resp != nil {
+ sc = resp.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ cancelCtx := ctx
+ // if the provided context already has a deadline don't override it
+ _, hasDeadline := ctx.Deadline()
+ if d := client.PollingDuration; !hasDeadline && d != 0 {
+ var cancel context.CancelFunc
+ cancelCtx, cancel = context.WithTimeout(ctx, d)
+ defer cancel()
+ }
- done, err := f.Done(client)
- for attempts := 0; !done; done, err = f.Done(client) {
+ done, err := f.DoneWithContext(ctx, client)
+ for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) {
if attempts >= client.RetryAttempts {
- return autorest.NewErrorWithError(err, "azure", "WaitForCompletion", f.resp, "the number of retries has been exceeded")
+ return autorest.NewErrorWithError(err, "Future", "WaitForCompletion", f.pt.latestResponse(), "the number of retries has been exceeded")
}
// we want delayAttempt to be zero in the non-error case so
// that DelayForBackoff doesn't perform exponential back-off
@@ -179,162 +193,699 @@ func (f Future) WaitForCompletion(ctx context.Context, client autorest.Client) e
attempts++
}
// wait until the delay elapses or the context is cancelled
- delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, ctx.Done())
+ delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, cancelCtx.Done())
if !delayElapsed {
- return autorest.NewErrorWithError(ctx.Err(), "azure", "WaitForCompletion", f.resp, "context has been cancelled")
+ return autorest.NewErrorWithError(cancelCtx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled")
}
}
- return err
-}
-
-// if the operation failed the polling state will contain
-// error information and implements the error interface
-func (f *Future) errorInfo() error {
- if !f.ps.hasSucceeded() {
- return f.ps
- }
- return nil
+ return
}
// MarshalJSON implements the json.Marshaler interface.
func (f Future) MarshalJSON() ([]byte, error) {
- return json.Marshal(&f.ps)
+ return json.Marshal(f.pt)
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (f *Future) UnmarshalJSON(data []byte) error {
- err := json.Unmarshal(data, &f.ps)
+ // unmarshal into JSON object to determine the tracker type
+ obj := map[string]interface{}{}
+ err := json.Unmarshal(data, &obj)
if err != nil {
return err
}
- f.req, err = newPollingRequest(f.ps)
- return err
+ if obj["method"] == nil {
+ return autorest.NewError("Future", "UnmarshalJSON", "missing 'method' property")
+ }
+ method := obj["method"].(string)
+ switch strings.ToUpper(method) {
+ case http.MethodDelete:
+ f.pt = &pollingTrackerDelete{}
+ case http.MethodPatch:
+ f.pt = &pollingTrackerPatch{}
+ case http.MethodPost:
+ f.pt = &pollingTrackerPost{}
+ case http.MethodPut:
+ f.pt = &pollingTrackerPut{}
+ default:
+ return autorest.NewError("Future", "UnmarshalJSON", "unsupoorted method '%s'", method)
+ }
+ // now unmarshal into the tracker
+ return json.Unmarshal(data, &f.pt)
}
// PollingURL returns the URL used for retrieving the status of the long-running operation.
-// For LROs that use the Location header the final URL value is used to retrieve the result.
func (f Future) PollingURL() string {
- return f.ps.URI
-}
-
-// DoPollForAsynchronous returns a SendDecorator that polls if the http.Response is for an Azure
-// long-running operation. It will delay between requests for the duration specified in the
-// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled by
-// closing the optional channel on the http.Request.
-func DoPollForAsynchronous(delay time.Duration) autorest.SendDecorator {
- return func(s autorest.Sender) autorest.Sender {
- return autorest.SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- resp, err = s.Do(r)
- if err != nil {
- return resp, err
- }
- if !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) {
- return resp, nil
- }
-
- ps := pollingState{}
- for err == nil {
- err = updatePollingState(resp, &ps)
- if err != nil {
- break
- }
- if ps.hasTerminated() {
- if !ps.hasSucceeded() {
- err = ps
- }
- break
- }
-
- r, err = newPollingRequest(ps)
- if err != nil {
- return resp, err
- }
- r = r.WithContext(resp.Request.Context())
-
- delay = autorest.GetRetryAfter(resp, delay)
- resp, err = autorest.SendWithSender(s, r,
- autorest.AfterDelay(delay))
- }
-
- return resp, err
- })
+ if f.pt == nil {
+ return ""
}
+ return f.pt.pollingURL()
}
-func getAsyncOperation(resp *http.Response) string {
- return resp.Header.Get(http.CanonicalHeaderKey(headerAsyncOperation))
+// GetResult should be called once polling has completed successfully.
+// It makes the final GET call to retrieve the resultant payload.
+func (f Future) GetResult(sender autorest.Sender) (*http.Response, error) {
+ if f.pt.finalGetURL() == "" {
+ // we can end up in this situation if the async operation returns a 200
+ // with no polling URLs. in that case return the response which should
+ // contain the JSON payload (only do this for successful terminal cases).
+ if lr := f.pt.latestResponse(); lr != nil && f.pt.hasSucceeded() {
+ return lr, nil
+ }
+ return nil, autorest.NewError("Future", "GetResult", "missing URL for retrieving result")
+ }
+ req, err := http.NewRequest(http.MethodGet, f.pt.finalGetURL(), nil)
+ if err != nil {
+ return nil, err
+ }
+ return sender.Do(req)
}
-func hasSucceeded(state string) bool {
- return strings.EqualFold(state, operationSucceeded)
-}
+type pollingTracker interface {
+ // these methods can differ per tracker
-func hasTerminated(state string) bool {
- return strings.EqualFold(state, operationCanceled) || strings.EqualFold(state, operationFailed) || strings.EqualFold(state, operationSucceeded)
-}
+ // checks the response headers and status code to determine the polling mechanism
+ updatePollingMethod() error
-func hasFailed(state string) bool {
- return strings.EqualFold(state, operationFailed)
-}
+ // checks the response for tracker-specific error conditions
+ checkForErrors() error
-type provisioningTracker interface {
- state() string
- hasSucceeded() bool
+ // returns true if provisioning state should be checked
+ provisioningStateApplicable() bool
+
+ // methods common to all trackers
+
+ // initializes a tracker's polling URL and method, called for each iteration.
+ // these values can be overridden by each polling tracker as required.
+ initPollingMethod() error
+
+ // initializes the tracker's internal state, call this when the tracker is created
+ initializeState() error
+
+ // makes an HTTP request to check the status of the LRO
+ pollForStatus(ctx context.Context, sender autorest.Sender) error
+
+ // updates internal tracker state, call this after each call to pollForStatus
+ updatePollingState(provStateApl bool) error
+
+ // returns the error response from the service, can be nil
+ pollingError() error
+
+ // returns the polling method being used
+ pollingMethod() PollingMethodType
+
+ // returns the state of the LRO as returned from the service
+ pollingStatus() string
+
+ // returns the URL used for polling status
+ pollingURL() string
+
+ // returns the URL used for the final GET to retrieve the resource
+ finalGetURL() string
+
+ // returns true if the LRO is in a terminal state
hasTerminated() bool
+
+ // returns true if the LRO is in a failed terminal state
+ hasFailed() bool
+
+ // returns true if the LRO is in a successful terminal state
+ hasSucceeded() bool
+
+ // returns the cached HTTP response after a call to pollForStatus(), can be nil
+ latestResponse() *http.Response
}
-type operationResource struct {
- // Note:
- // The specification states services should return the "id" field. However some return it as
- // "operationId".
- ID string `json:"id"`
- OperationID string `json:"operationId"`
- Name string `json:"name"`
- Status string `json:"status"`
- Properties map[string]interface{} `json:"properties"`
- OperationError ServiceError `json:"error"`
- StartTime date.Time `json:"startTime"`
- EndTime date.Time `json:"endTime"`
- PercentComplete float64 `json:"percentComplete"`
+type pollingTrackerBase struct {
+ // resp is the last response, either from the submission of the LRO or from polling
+ resp *http.Response
+
+ // method is the HTTP verb, this is needed for deserialization
+ Method string `json:"method"`
+
+ // rawBody is the raw JSON response body
+ rawBody map[string]interface{}
+
+ // denotes if polling is using async-operation or location header
+ Pm PollingMethodType `json:"pollingMethod"`
+
+ // the URL to poll for status
+ URI string `json:"pollingURI"`
+
+ // the state of the LRO as returned from the service
+ State string `json:"lroState"`
+
+ // the URL to GET for the final result
+ FinalGetURI string `json:"resultURI"`
+
+ // used to hold an error object returned from the service
+ Err *ServiceError `json:"error,omitempty"`
}
-func (or operationResource) state() string {
- return or.Status
+func (pt *pollingTrackerBase) initializeState() error {
+ // determine the initial polling state based on response body and/or HTTP status
+ // code. this is applicable to the initial LRO response, not polling responses!
+ pt.Method = pt.resp.Request.Method
+ if err := pt.updateRawBody(); err != nil {
+ return err
+ }
+ switch pt.resp.StatusCode {
+ case http.StatusOK:
+ if ps := pt.getProvisioningState(); ps != nil {
+ pt.State = *ps
+ if pt.hasFailed() {
+ pt.updateErrorFromResponse()
+ return pt.pollingError()
+ }
+ } else {
+ pt.State = operationSucceeded
+ }
+ case http.StatusCreated:
+ if ps := pt.getProvisioningState(); ps != nil {
+ pt.State = *ps
+ } else {
+ pt.State = operationInProgress
+ }
+ case http.StatusAccepted:
+ pt.State = operationInProgress
+ case http.StatusNoContent:
+ pt.State = operationSucceeded
+ default:
+ pt.State = operationFailed
+ pt.updateErrorFromResponse()
+ return pt.pollingError()
+ }
+ return pt.initPollingMethod()
}
-func (or operationResource) hasSucceeded() bool {
- return hasSucceeded(or.state())
+func (pt pollingTrackerBase) getProvisioningState() *string {
+ if pt.rawBody != nil && pt.rawBody["properties"] != nil {
+ p := pt.rawBody["properties"].(map[string]interface{})
+ if ps := p["provisioningState"]; ps != nil {
+ s := ps.(string)
+ return &s
+ }
+ }
+ return nil
}
-func (or operationResource) hasTerminated() bool {
- return hasTerminated(or.state())
+func (pt *pollingTrackerBase) updateRawBody() error {
+ pt.rawBody = map[string]interface{}{}
+ if pt.resp.ContentLength != 0 {
+ defer pt.resp.Body.Close()
+ b, err := ioutil.ReadAll(pt.resp.Body)
+ if err != nil {
+ return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to read response body")
+ }
+ // observed in 204 responses over HTTP/2.0; the content length is -1 but body is empty
+ if len(b) == 0 {
+ return nil
+ }
+ // put the body back so it's available to other callers
+ pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b))
+ if err = json.Unmarshal(b, &pt.rawBody); err != nil {
+ return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to unmarshal response body")
+ }
+ }
+ return nil
}
-type provisioningProperties struct {
- ProvisioningState string `json:"provisioningState"`
+func (pt *pollingTrackerBase) pollForStatus(ctx context.Context, sender autorest.Sender) error {
+ req, err := http.NewRequest(http.MethodGet, pt.URI, nil)
+ if err != nil {
+ return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to create HTTP request")
+ }
+
+ req = req.WithContext(ctx)
+ preparer := autorest.CreatePreparer(autorest.GetPrepareDecorators(ctx)...)
+ req, err = preparer.Prepare(req)
+ if err != nil {
+ return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed preparing HTTP request")
+ }
+ pt.resp, err = sender.Do(req)
+ if err != nil {
+ return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to send HTTP request")
+ }
+ if autorest.ResponseHasStatusCode(pt.resp, pollingCodes[:]...) {
+ // reset the service error on success case
+ pt.Err = nil
+ err = pt.updateRawBody()
+ } else {
+ // check response body for error content
+ pt.updateErrorFromResponse()
+ err = pt.pollingError()
+ }
+ return err
}
-type provisioningStatus struct {
- Properties provisioningProperties `json:"properties,omitempty"`
- ProvisioningError ServiceError `json:"error,omitempty"`
+// attempts to unmarshal a ServiceError type from the response body.
+// if that fails then make a best attempt at creating something meaningful.
+// NOTE: this assumes that the async operation has failed.
+func (pt *pollingTrackerBase) updateErrorFromResponse() {
+ var err error
+ if pt.resp.ContentLength != 0 {
+ type respErr struct {
+ ServiceError *ServiceError `json:"error"`
+ }
+ re := respErr{}
+ defer pt.resp.Body.Close()
+ var b []byte
+ if b, err = ioutil.ReadAll(pt.resp.Body); err != nil || len(b) == 0 {
+ goto Default
+ }
+ if err = json.Unmarshal(b, &re); err != nil {
+ goto Default
+ }
+ // unmarshalling the error didn't yield anything, try unwrapped error
+ if re.ServiceError == nil {
+ err = json.Unmarshal(b, &re.ServiceError)
+ if err != nil {
+ goto Default
+ }
+ }
+ // the unmarshaller will ensure re.ServiceError is non-nil
+ // even if there was no content unmarshalled so check the code.
+ if re.ServiceError.Code != "" {
+ pt.Err = re.ServiceError
+ return
+ }
+ }
+Default:
+ se := &ServiceError{
+ Code: pt.pollingStatus(),
+ Message: "The async operation failed.",
+ }
+ if err != nil {
+ se.InnerError = make(map[string]interface{})
+ se.InnerError["unmarshalError"] = err.Error()
+ }
+ // stick the response body into the error object in hopes
+ // it contains something useful to help diagnose the failure.
+ if len(pt.rawBody) > 0 {
+ se.AdditionalInfo = []map[string]interface{}{
+ pt.rawBody,
+ }
+ }
+ pt.Err = se
}
-func (ps provisioningStatus) state() string {
- return ps.Properties.ProvisioningState
+func (pt *pollingTrackerBase) updatePollingState(provStateApl bool) error {
+ if pt.Pm == PollingAsyncOperation && pt.rawBody["status"] != nil {
+ pt.State = pt.rawBody["status"].(string)
+ } else {
+ if pt.resp.StatusCode == http.StatusAccepted {
+ pt.State = operationInProgress
+ } else if provStateApl {
+ if ps := pt.getProvisioningState(); ps != nil {
+ pt.State = *ps
+ } else {
+ pt.State = operationSucceeded
+ }
+ } else {
+ return autorest.NewError("pollingTrackerBase", "updatePollingState", "the response from the async operation has an invalid status code")
+ }
+ }
+ // if the operation has failed update the error state
+ if pt.hasFailed() {
+ pt.updateErrorFromResponse()
+ }
+ return nil
}
-func (ps provisioningStatus) hasSucceeded() bool {
- return hasSucceeded(ps.state())
+func (pt pollingTrackerBase) pollingError() error {
+ if pt.Err == nil {
+ return nil
+ }
+ return pt.Err
}
-func (ps provisioningStatus) hasTerminated() bool {
- return hasTerminated(ps.state())
+func (pt pollingTrackerBase) pollingMethod() PollingMethodType {
+ return pt.Pm
}
-func (ps provisioningStatus) hasProvisioningError() bool {
- // code and message are required fields so only check them
- return len(ps.ProvisioningError.Code) > 0 ||
- len(ps.ProvisioningError.Message) > 0
+func (pt pollingTrackerBase) pollingStatus() string {
+ return pt.State
+}
+
+func (pt pollingTrackerBase) pollingURL() string {
+ return pt.URI
+}
+
+func (pt pollingTrackerBase) finalGetURL() string {
+ return pt.FinalGetURI
+}
+
+func (pt pollingTrackerBase) hasTerminated() bool {
+ return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) || strings.EqualFold(pt.State, operationSucceeded)
+}
+
+func (pt pollingTrackerBase) hasFailed() bool {
+ return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed)
+}
+
+func (pt pollingTrackerBase) hasSucceeded() bool {
+ return strings.EqualFold(pt.State, operationSucceeded)
+}
+
+func (pt pollingTrackerBase) latestResponse() *http.Response {
+ return pt.resp
+}
+
+// error checking common to all trackers
+func (pt pollingTrackerBase) baseCheckForErrors() error {
+ // for Azure-AsyncOperations the response body cannot be nil or empty
+ if pt.Pm == PollingAsyncOperation {
+ if pt.resp.Body == nil || pt.resp.ContentLength == 0 {
+ return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "for Azure-AsyncOperation response body cannot be nil")
+ }
+ if pt.rawBody["status"] == nil {
+ return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "missing status property in Azure-AsyncOperation response body")
+ }
+ }
+ return nil
+}
+
+// default initialization of polling URL/method. each verb tracker will update this as required.
+func (pt *pollingTrackerBase) initPollingMethod() error {
+ if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ return nil
+ }
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
+ return err
+ } else if lh != "" {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ return nil
+ }
+ // it's ok if we didn't find a polling header, this will be handled elsewhere
+ return nil
+}
+
+// DELETE
+
+type pollingTrackerDelete struct {
+ pollingTrackerBase
+}
+
+func (pt *pollingTrackerDelete) updatePollingMethod() error {
+ // for 201 the Location header is required
+ if pt.resp.StatusCode == http.StatusCreated {
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
+ return err
+ } else if lh == "" {
+ return autorest.NewError("pollingTrackerDelete", "updateHeaders", "missing Location header in 201 response")
+ } else {
+ pt.URI = lh
+ }
+ pt.Pm = PollingLocation
+ pt.FinalGetURI = pt.URI
+ }
+ // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
+ if pt.resp.StatusCode == http.StatusAccepted {
+ ao, err := getURLFromAsyncOpHeader(pt.resp)
+ if err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ // if the Location header is invalid and we already have a polling URL
+ // then we don't care if the Location header URL is malformed.
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
+ return err
+ } else if lh != "" {
+ if ao == "" {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ }
+ // when both headers are returned we use the value in the Location header for the final GET
+ pt.FinalGetURI = lh
+ }
+ // make sure a polling URL was found
+ if pt.URI == "" {
+ return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
+ }
+ }
+ return nil
+}
+
+func (pt pollingTrackerDelete) checkForErrors() error {
+ return pt.baseCheckForErrors()
+}
+
+func (pt pollingTrackerDelete) provisioningStateApplicable() bool {
+ return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent
+}
+
+// PATCH
+
+type pollingTrackerPatch struct {
+ pollingTrackerBase
+}
+
+func (pt *pollingTrackerPatch) updatePollingMethod() error {
+ // by default we can use the original URL for polling and final GET
+ if pt.URI == "" {
+ pt.URI = pt.resp.Request.URL.String()
+ }
+ if pt.FinalGetURI == "" {
+ pt.FinalGetURI = pt.resp.Request.URL.String()
+ }
+ if pt.Pm == PollingUnknown {
+ pt.Pm = PollingRequestURI
+ }
+ // for 201 it's permissible for no headers to be returned
+ if pt.resp.StatusCode == http.StatusCreated {
+ if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ }
+ // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
+ // note the absence of the "final GET" mechanism for PATCH
+ if pt.resp.StatusCode == http.StatusAccepted {
+ ao, err := getURLFromAsyncOpHeader(pt.resp)
+ if err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ if ao == "" {
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
+ return err
+ } else if lh == "" {
+ return autorest.NewError("pollingTrackerPatch", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
+ } else {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ }
+ }
+ }
+ return nil
+}
+
+func (pt pollingTrackerPatch) checkForErrors() error {
+ return pt.baseCheckForErrors()
+}
+
+func (pt pollingTrackerPatch) provisioningStateApplicable() bool {
+ return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated
+}
+
+// POST
+
+type pollingTrackerPost struct {
+ pollingTrackerBase
+}
+
+func (pt *pollingTrackerPost) updatePollingMethod() error {
+ // 201 requires Location header
+ if pt.resp.StatusCode == http.StatusCreated {
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
+ return err
+ } else if lh == "" {
+ return autorest.NewError("pollingTrackerPost", "updateHeaders", "missing Location header in 201 response")
+ } else {
+ pt.URI = lh
+ pt.FinalGetURI = lh
+ pt.Pm = PollingLocation
+ }
+ }
+ // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
+ if pt.resp.StatusCode == http.StatusAccepted {
+ ao, err := getURLFromAsyncOpHeader(pt.resp)
+ if err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ // if the Location header is invalid and we already have a polling URL
+ // then we don't care if the Location header URL is malformed.
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
+ return err
+ } else if lh != "" {
+ if ao == "" {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ }
+ // when both headers are returned we use the value in the Location header for the final GET
+ pt.FinalGetURI = lh
+ }
+ // make sure a polling URL was found
+ if pt.URI == "" {
+ return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
+ }
+ }
+ return nil
+}
+
+func (pt pollingTrackerPost) checkForErrors() error {
+ return pt.baseCheckForErrors()
+}
+
+func (pt pollingTrackerPost) provisioningStateApplicable() bool {
+ return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent
+}
+
+// PUT
+
+type pollingTrackerPut struct {
+ pollingTrackerBase
+}
+
+func (pt *pollingTrackerPut) updatePollingMethod() error {
+ // by default we can use the original URL for polling and final GET
+ if pt.URI == "" {
+ pt.URI = pt.resp.Request.URL.String()
+ }
+ if pt.FinalGetURI == "" {
+ pt.FinalGetURI = pt.resp.Request.URL.String()
+ }
+ if pt.Pm == PollingUnknown {
+ pt.Pm = PollingRequestURI
+ }
+ // for 201 it's permissible for no headers to be returned
+ if pt.resp.StatusCode == http.StatusCreated {
+ if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ }
+ // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
+ if pt.resp.StatusCode == http.StatusAccepted {
+ ao, err := getURLFromAsyncOpHeader(pt.resp)
+ if err != nil {
+ return err
+ } else if ao != "" {
+ pt.URI = ao
+ pt.Pm = PollingAsyncOperation
+ }
+ // if the Location header is invalid and we already have a polling URL
+ // then we don't care if the Location header URL is malformed.
+ if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
+ return err
+ } else if lh != "" {
+ if ao == "" {
+ pt.URI = lh
+ pt.Pm = PollingLocation
+ }
+ }
+ // make sure a polling URL was found
+ if pt.URI == "" {
+ return autorest.NewError("pollingTrackerPut", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
+ }
+ }
+ return nil
+}
+
+func (pt pollingTrackerPut) checkForErrors() error {
+ err := pt.baseCheckForErrors()
+ if err != nil {
+ return err
+ }
+ // if there are no LRO headers then the body cannot be empty
+ ao, err := getURLFromAsyncOpHeader(pt.resp)
+ if err != nil {
+ return err
+ }
+ lh, err := getURLFromLocationHeader(pt.resp)
+ if err != nil {
+ return err
+ }
+ if ao == "" && lh == "" && len(pt.rawBody) == 0 {
+ return autorest.NewError("pollingTrackerPut", "checkForErrors", "the response did not contain a body")
+ }
+ return nil
+}
+
+func (pt pollingTrackerPut) provisioningStateApplicable() bool {
+ return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated
+}
+
+// creates a polling tracker based on the verb of the original request
+func createPollingTracker(resp *http.Response) (pollingTracker, error) {
+ var pt pollingTracker
+ switch strings.ToUpper(resp.Request.Method) {
+ case http.MethodDelete:
+ pt = &pollingTrackerDelete{pollingTrackerBase: pollingTrackerBase{resp: resp}}
+ case http.MethodPatch:
+ pt = &pollingTrackerPatch{pollingTrackerBase: pollingTrackerBase{resp: resp}}
+ case http.MethodPost:
+ pt = &pollingTrackerPost{pollingTrackerBase: pollingTrackerBase{resp: resp}}
+ case http.MethodPut:
+ pt = &pollingTrackerPut{pollingTrackerBase: pollingTrackerBase{resp: resp}}
+ default:
+ return nil, autorest.NewError("azure", "createPollingTracker", "unsupported HTTP method %s", resp.Request.Method)
+ }
+ if err := pt.initializeState(); err != nil {
+ return pt, err
+ }
+ // this initializes the polling header values, we do this during creation in case the
+ // initial response send us invalid values; this way the API call will return a non-nil
+ // error (not doing this means the error shows up in Future.Done)
+ return pt, pt.updatePollingMethod()
+}
+
+// gets the polling URL from the Azure-AsyncOperation header.
+// ensures the URL is well-formed and absolute.
+func getURLFromAsyncOpHeader(resp *http.Response) (string, error) {
+ s := resp.Header.Get(http.CanonicalHeaderKey(headerAsyncOperation))
+ if s == "" {
+ return "", nil
+ }
+ if !isValidURL(s) {
+ return "", autorest.NewError("azure", "getURLFromAsyncOpHeader", "invalid polling URL '%s'", s)
+ }
+ return s, nil
+}
+
+// gets the polling URL from the Location header.
+// ensures the URL is well-formed and absolute.
+func getURLFromLocationHeader(resp *http.Response) (string, error) {
+ s := resp.Header.Get(http.CanonicalHeaderKey(autorest.HeaderLocation))
+ if s == "" {
+ return "", nil
+ }
+ if !isValidURL(s) {
+ return "", autorest.NewError("azure", "getURLFromLocationHeader", "invalid polling URL '%s'", s)
+ }
+ return s, nil
+}
+
+// verify that the URL is valid and absolute
+func isValidURL(s string) bool {
+ u, err := url.Parse(s)
+ return err == nil && u.IsAbs()
}
// PollingMethodType defines a type used for enumerating polling mechanisms.
@@ -347,151 +898,13 @@ const (
// PollingLocation indicates the polling method uses the Location header.
PollingLocation PollingMethodType = "Location"
+ // PollingRequestURI indicates the polling method uses the original request URI.
+ PollingRequestURI PollingMethodType = "RequestURI"
+
// PollingUnknown indicates an unknown polling method and is the default value.
PollingUnknown PollingMethodType = ""
)
-type pollingState struct {
- PollingMethod PollingMethodType `json:"pollingMethod"`
- URI string `json:"uri"`
- State string `json:"state"`
- ServiceError *ServiceError `json:"error,omitempty"`
-}
-
-func (ps pollingState) hasSucceeded() bool {
- return hasSucceeded(ps.State)
-}
-
-func (ps pollingState) hasTerminated() bool {
- return hasTerminated(ps.State)
-}
-
-func (ps pollingState) hasFailed() bool {
- return hasFailed(ps.State)
-}
-
-func (ps pollingState) Error() string {
- s := fmt.Sprintf("Long running operation terminated with status '%s'", ps.State)
- if ps.ServiceError != nil {
- s = fmt.Sprintf("%s: %+v", s, *ps.ServiceError)
- }
- return s
-}
-
-// updatePollingState maps the operation status -- retrieved from either a provisioningState
-// field, the status field of an OperationResource, or inferred from the HTTP status code --
-// into a well-known states. Since the process begins from the initial request, the state
-// always comes from either a the provisioningState returned or is inferred from the HTTP
-// status code. Subsequent requests will read an Azure OperationResource object if the
-// service initially returned the Azure-AsyncOperation header. The responseFormat field notes
-// the expected response format.
-func updatePollingState(resp *http.Response, ps *pollingState) error {
- // Determine the response shape
- // -- The first response will always be a provisioningStatus response; only the polling requests,
- // depending on the header returned, may be something otherwise.
- var pt provisioningTracker
- if ps.PollingMethod == PollingAsyncOperation {
- pt = &operationResource{}
- } else {
- pt = &provisioningStatus{}
- }
-
- // If this is the first request (that is, the polling response shape is unknown), determine how
- // to poll and what to expect
- if ps.PollingMethod == PollingUnknown {
- req := resp.Request
- if req == nil {
- return autorest.NewError("azure", "updatePollingState", "Azure Polling Error - Original HTTP request is missing")
- }
-
- // Prefer the Azure-AsyncOperation header
- ps.URI = getAsyncOperation(resp)
- if ps.URI != "" {
- ps.PollingMethod = PollingAsyncOperation
- } else {
- ps.PollingMethod = PollingLocation
- }
-
- // Else, use the Location header
- if ps.URI == "" {
- ps.URI = autorest.GetLocation(resp)
- }
-
- // Lastly, requests against an existing resource, use the last request URI
- if ps.URI == "" {
- m := strings.ToUpper(req.Method)
- if m == http.MethodPatch || m == http.MethodPut || m == http.MethodGet {
- ps.URI = req.URL.String()
- }
- }
- }
-
- // Read and interpret the response (saving the Body in case no polling is necessary)
- b := &bytes.Buffer{}
- err := autorest.Respond(resp,
- autorest.ByCopying(b),
- autorest.ByUnmarshallingJSON(pt),
- autorest.ByClosing())
- resp.Body = ioutil.NopCloser(b)
- if err != nil {
- return err
- }
-
- // Interpret the results
- // -- Terminal states apply regardless
- // -- Unknown states are per-service inprogress states
- // -- Otherwise, infer state from HTTP status code
- if pt.hasTerminated() {
- ps.State = pt.state()
- } else if pt.state() != "" {
- ps.State = operationInProgress
- } else {
- switch resp.StatusCode {
- case http.StatusAccepted:
- ps.State = operationInProgress
-
- case http.StatusNoContent, http.StatusCreated, http.StatusOK:
- ps.State = operationSucceeded
-
- default:
- ps.State = operationFailed
- }
- }
-
- if strings.EqualFold(ps.State, operationInProgress) && ps.URI == "" {
- return autorest.NewError("azure", "updatePollingState", "Azure Polling Error - Unable to obtain polling URI for %s %s", resp.Request.Method, resp.Request.URL)
- }
-
- // For failed operation, check for error code and message in
- // -- Operation resource
- // -- Response
- // -- Otherwise, Unknown
- if ps.hasFailed() {
- if or, ok := pt.(*operationResource); ok {
- ps.ServiceError = &or.OperationError
- } else if p, ok := pt.(*provisioningStatus); ok && p.hasProvisioningError() {
- ps.ServiceError = &p.ProvisioningError
- } else {
- ps.ServiceError = &ServiceError{
- Code: "Unknown",
- Message: "None",
- }
- }
- }
- return nil
-}
-
-func newPollingRequest(ps pollingState) (*http.Request, error) {
- reqPoll, err := autorest.Prepare(&http.Request{},
- autorest.AsGet(),
- autorest.WithBaseURL(ps.URI))
- if err != nil {
- return nil, autorest.NewErrorWithError(err, "azure", "newPollingRequest", nil, "Failure creating poll request to %s", ps.URI)
- }
-
- return reqPoll, nil
-}
-
// AsyncOpIncompleteError is the type that's returned from a future that has not completed.
type AsyncOpIncompleteError struct {
// FutureType is the name of the type composed of a azure.Future.
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go
index dd89d9c9d..b6ef12839 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go
@@ -31,126 +31,416 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/azure/cli"
"github.com/dimchansky/utfbom"
"golang.org/x/crypto/pkcs12"
)
+// The possible keys in the Values map.
+const (
+ SubscriptionID = "AZURE_SUBSCRIPTION_ID"
+ TenantID = "AZURE_TENANT_ID"
+ AuxiliaryTenantIDs = "AZURE_AUXILIARY_TENANT_IDS"
+ ClientID = "AZURE_CLIENT_ID"
+ ClientSecret = "AZURE_CLIENT_SECRET"
+ CertificatePath = "AZURE_CERTIFICATE_PATH"
+ CertificatePassword = "AZURE_CERTIFICATE_PASSWORD"
+ Username = "AZURE_USERNAME"
+ Password = "AZURE_PASSWORD"
+ EnvironmentName = "AZURE_ENVIRONMENT"
+ Resource = "AZURE_AD_RESOURCE"
+ ActiveDirectoryEndpoint = "ActiveDirectoryEndpoint"
+ ResourceManagerEndpoint = "ResourceManagerEndpoint"
+ GraphResourceID = "GraphResourceID"
+ SQLManagementEndpoint = "SQLManagementEndpoint"
+ GalleryEndpoint = "GalleryEndpoint"
+ ManagementEndpoint = "ManagementEndpoint"
+)
+
// NewAuthorizerFromEnvironment creates an Authorizer configured from environment variables in the order:
// 1. Client credentials
// 2. Client certificate
// 3. Username password
// 4. MSI
func NewAuthorizerFromEnvironment() (autorest.Authorizer, error) {
- tenantID := os.Getenv("AZURE_TENANT_ID")
- clientID := os.Getenv("AZURE_CLIENT_ID")
- clientSecret := os.Getenv("AZURE_CLIENT_SECRET")
- certificatePath := os.Getenv("AZURE_CERTIFICATE_PATH")
- certificatePassword := os.Getenv("AZURE_CERTIFICATE_PASSWORD")
- username := os.Getenv("AZURE_USERNAME")
- password := os.Getenv("AZURE_PASSWORD")
- envName := os.Getenv("AZURE_ENVIRONMENT")
- resource := os.Getenv("AZURE_AD_RESOURCE")
+ settings, err := GetSettingsFromEnvironment()
+ if err != nil {
+ return nil, err
+ }
+ return settings.GetAuthorizer()
+}
- var env azure.Environment
- if envName == "" {
- env = azure.PublicCloud
+// NewAuthorizerFromEnvironmentWithResource creates an Authorizer configured from environment variables in the order:
+// 1. Client credentials
+// 2. Client certificate
+// 3. Username password
+// 4. MSI
+func NewAuthorizerFromEnvironmentWithResource(resource string) (autorest.Authorizer, error) {
+ settings, err := GetSettingsFromEnvironment()
+ if err != nil {
+ return nil, err
+ }
+ settings.Values[Resource] = resource
+ return settings.GetAuthorizer()
+}
+
+// EnvironmentSettings contains the available authentication settings.
+type EnvironmentSettings struct {
+ Values map[string]string
+ Environment azure.Environment
+}
+
+// GetSettingsFromEnvironment returns the available authentication settings from the environment.
+func GetSettingsFromEnvironment() (s EnvironmentSettings, err error) {
+ s = EnvironmentSettings{
+ Values: map[string]string{},
+ }
+ s.setValue(SubscriptionID)
+ s.setValue(TenantID)
+ s.setValue(AuxiliaryTenantIDs)
+ s.setValue(ClientID)
+ s.setValue(ClientSecret)
+ s.setValue(CertificatePath)
+ s.setValue(CertificatePassword)
+ s.setValue(Username)
+ s.setValue(Password)
+ s.setValue(EnvironmentName)
+ s.setValue(Resource)
+ if v := s.Values[EnvironmentName]; v == "" {
+ s.Environment = azure.PublicCloud
} else {
- var err error
- env, err = azure.EnvironmentFromName(envName)
- if err != nil {
- return nil, err
+ s.Environment, err = azure.EnvironmentFromName(v)
+ }
+ if s.Values[Resource] == "" {
+ s.Values[Resource] = s.Environment.ResourceManagerEndpoint
+ }
+ return
+}
+
+// GetSubscriptionID returns the available subscription ID or an empty string.
+func (settings EnvironmentSettings) GetSubscriptionID() string {
+ return settings.Values[SubscriptionID]
+}
+
+// adds the specified environment variable value to the Values map if it exists
+func (settings EnvironmentSettings) setValue(key string) {
+ if v := os.Getenv(key); v != "" {
+ settings.Values[key] = v
+ }
+}
+
+// helper to return client and tenant IDs
+func (settings EnvironmentSettings) getClientAndTenant() (string, string) {
+ clientID := settings.Values[ClientID]
+ tenantID := settings.Values[TenantID]
+ return clientID, tenantID
+}
+
+// GetClientCredentials creates a config object from the available client credentials.
+// An error is returned if no client credentials are available.
+func (settings EnvironmentSettings) GetClientCredentials() (ClientCredentialsConfig, error) {
+ secret := settings.Values[ClientSecret]
+ if secret == "" {
+ return ClientCredentialsConfig{}, errors.New("missing client secret")
+ }
+ clientID, tenantID := settings.getClientAndTenant()
+ config := NewClientCredentialsConfig(clientID, secret, tenantID)
+ config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint
+ config.Resource = settings.Values[Resource]
+ if auxTenants, ok := settings.Values[AuxiliaryTenantIDs]; ok {
+ config.AuxTenants = strings.Split(auxTenants, ";")
+ for i := range config.AuxTenants {
+ config.AuxTenants[i] = strings.TrimSpace(config.AuxTenants[i])
}
}
+ return config, nil
+}
- if resource == "" {
- resource = env.ResourceManagerEndpoint
+// GetClientCertificate creates a config object from the available certificate credentials.
+// An error is returned if no certificate credentials are available.
+func (settings EnvironmentSettings) GetClientCertificate() (ClientCertificateConfig, error) {
+ certPath := settings.Values[CertificatePath]
+ if certPath == "" {
+ return ClientCertificateConfig{}, errors.New("missing certificate path")
}
+ certPwd := settings.Values[CertificatePassword]
+ clientID, tenantID := settings.getClientAndTenant()
+ config := NewClientCertificateConfig(certPath, certPwd, clientID, tenantID)
+ config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint
+ config.Resource = settings.Values[Resource]
+ return config, nil
+}
+// GetUsernamePassword creates a config object from the available username/password credentials.
+// An error is returned if no username/password credentials are available.
+func (settings EnvironmentSettings) GetUsernamePassword() (UsernamePasswordConfig, error) {
+ username := settings.Values[Username]
+ password := settings.Values[Password]
+ if username == "" || password == "" {
+ return UsernamePasswordConfig{}, errors.New("missing username/password")
+ }
+ clientID, tenantID := settings.getClientAndTenant()
+ config := NewUsernamePasswordConfig(username, password, clientID, tenantID)
+ config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint
+ config.Resource = settings.Values[Resource]
+ return config, nil
+}
+
+// GetMSI creates a MSI config object from the available client ID.
+func (settings EnvironmentSettings) GetMSI() MSIConfig {
+ config := NewMSIConfig()
+ config.Resource = settings.Values[Resource]
+ config.ClientID = settings.Values[ClientID]
+ return config
+}
+
+// GetDeviceFlow creates a device-flow config object from the available client and tenant IDs.
+func (settings EnvironmentSettings) GetDeviceFlow() DeviceFlowConfig {
+ clientID, tenantID := settings.getClientAndTenant()
+ config := NewDeviceFlowConfig(clientID, tenantID)
+ config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint
+ config.Resource = settings.Values[Resource]
+ return config
+}
+
+// GetAuthorizer creates an Authorizer configured from environment variables in the order:
+// 1. Client credentials
+// 2. Client certificate
+// 3. Username password
+// 4. MSI
+func (settings EnvironmentSettings) GetAuthorizer() (autorest.Authorizer, error) {
//1.Client Credentials
- if clientSecret != "" {
- config := NewClientCredentialsConfig(clientID, clientSecret, tenantID)
- config.AADEndpoint = env.ActiveDirectoryEndpoint
- config.Resource = resource
- return config.Authorizer()
+ if c, e := settings.GetClientCredentials(); e == nil {
+ return c.Authorizer()
}
//2. Client Certificate
- if certificatePath != "" {
- config := NewClientCertificateConfig(certificatePath, certificatePassword, clientID, tenantID)
- config.AADEndpoint = env.ActiveDirectoryEndpoint
- config.Resource = resource
- return config.Authorizer()
+ if c, e := settings.GetClientCertificate(); e == nil {
+ return c.Authorizer()
}
//3. Username Password
- if username != "" && password != "" {
- config := NewUsernamePasswordConfig(username, password, clientID, tenantID)
- config.AADEndpoint = env.ActiveDirectoryEndpoint
- config.Resource = resource
- return config.Authorizer()
+ if c, e := settings.GetUsernamePassword(); e == nil {
+ return c.Authorizer()
}
// 4. MSI
- config := NewMSIConfig()
- config.Resource = resource
- config.ClientID = clientID
- return config.Authorizer()
+ return settings.GetMSI().Authorizer()
}
-// NewAuthorizerFromFile creates an Authorizer configured from a configuration file.
+// NewAuthorizerFromFile creates an Authorizer configured from a configuration file in the following order.
+// 1. Client credentials
+// 2. Client certificate
func NewAuthorizerFromFile(baseURI string) (autorest.Authorizer, error) {
+ settings, err := GetSettingsFromFile()
+ if err != nil {
+ return nil, err
+ }
+ if a, err := settings.ClientCredentialsAuthorizer(baseURI); err == nil {
+ return a, err
+ }
+ if a, err := settings.ClientCertificateAuthorizer(baseURI); err == nil {
+ return a, err
+ }
+ return nil, errors.New("auth file missing client and certificate credentials")
+}
+
+// NewAuthorizerFromFileWithResource creates an Authorizer configured from a configuration file in the following order.
+// 1. Client credentials
+// 2. Client certificate
+func NewAuthorizerFromFileWithResource(resource string) (autorest.Authorizer, error) {
+ s, err := GetSettingsFromFile()
+ if err != nil {
+ return nil, err
+ }
+ if a, err := s.ClientCredentialsAuthorizerWithResource(resource); err == nil {
+ return a, err
+ }
+ if a, err := s.ClientCertificateAuthorizerWithResource(resource); err == nil {
+ return a, err
+ }
+ return nil, errors.New("auth file missing client and certificate credentials")
+}
+
+// NewAuthorizerFromCLI creates an Authorizer configured from Azure CLI 2.0 for local development scenarios.
+func NewAuthorizerFromCLI() (autorest.Authorizer, error) {
+ settings, err := GetSettingsFromEnvironment()
+ if err != nil {
+ return nil, err
+ }
+
+ if settings.Values[Resource] == "" {
+ settings.Values[Resource] = settings.Environment.ResourceManagerEndpoint
+ }
+
+ return NewAuthorizerFromCLIWithResource(settings.Values[Resource])
+}
+
+// NewAuthorizerFromCLIWithResource creates an Authorizer configured from Azure CLI 2.0 for local development scenarios.
+func NewAuthorizerFromCLIWithResource(resource string) (autorest.Authorizer, error) {
+ token, err := cli.GetTokenFromCLI(resource)
+ if err != nil {
+ return nil, err
+ }
+
+ adalToken, err := token.ToADALToken()
+ if err != nil {
+ return nil, err
+ }
+
+ return autorest.NewBearerAuthorizer(&adalToken), nil
+}
+
+// GetSettingsFromFile returns the available authentication settings from an Azure CLI authentication file.
+func GetSettingsFromFile() (FileSettings, error) {
+ s := FileSettings{}
fileLocation := os.Getenv("AZURE_AUTH_LOCATION")
if fileLocation == "" {
- return nil, errors.New("auth file not found. Environment variable AZURE_AUTH_LOCATION is not set")
+ return s, errors.New("environment variable AZURE_AUTH_LOCATION is not set")
}
contents, err := ioutil.ReadFile(fileLocation)
if err != nil {
- return nil, err
+ return s, err
}
// Auth file might be encoded
decoded, err := decode(contents)
if err != nil {
- return nil, err
+ return s, err
}
- file := file{}
- err = json.Unmarshal(decoded, &file)
+ authFile := map[string]interface{}{}
+ err = json.Unmarshal(decoded, &authFile)
+ if err != nil {
+ return s, err
+ }
+
+ s.Values = map[string]string{}
+ s.setKeyValue(ClientID, authFile["clientId"])
+ s.setKeyValue(ClientSecret, authFile["clientSecret"])
+ s.setKeyValue(CertificatePath, authFile["clientCertificate"])
+ s.setKeyValue(CertificatePassword, authFile["clientCertificatePassword"])
+ s.setKeyValue(SubscriptionID, authFile["subscriptionId"])
+ s.setKeyValue(TenantID, authFile["tenantId"])
+ s.setKeyValue(ActiveDirectoryEndpoint, authFile["activeDirectoryEndpointUrl"])
+ s.setKeyValue(ResourceManagerEndpoint, authFile["resourceManagerEndpointUrl"])
+ s.setKeyValue(GraphResourceID, authFile["activeDirectoryGraphResourceId"])
+ s.setKeyValue(SQLManagementEndpoint, authFile["sqlManagementEndpointUrl"])
+ s.setKeyValue(GalleryEndpoint, authFile["galleryEndpointUrl"])
+ s.setKeyValue(ManagementEndpoint, authFile["managementEndpointUrl"])
+ return s, nil
+}
+
+// FileSettings contains the available authentication settings.
+type FileSettings struct {
+ Values map[string]string
+}
+
+// GetSubscriptionID returns the available subscription ID or an empty string.
+func (settings FileSettings) GetSubscriptionID() string {
+ return settings.Values[SubscriptionID]
+}
+
+// adds the specified value to the Values map if it isn't nil
+func (settings FileSettings) setKeyValue(key string, val interface{}) {
+ if val != nil {
+ settings.Values[key] = val.(string)
+ }
+}
+
+// returns the specified AAD endpoint or the public cloud endpoint if unspecified
+func (settings FileSettings) getAADEndpoint() string {
+ if v, ok := settings.Values[ActiveDirectoryEndpoint]; ok {
+ return v
+ }
+ return azure.PublicCloud.ActiveDirectoryEndpoint
+}
+
+// ServicePrincipalTokenFromClientCredentials creates a ServicePrincipalToken from the available client credentials.
+func (settings FileSettings) ServicePrincipalTokenFromClientCredentials(baseURI string) (*adal.ServicePrincipalToken, error) {
+ resource, err := settings.getResourceForToken(baseURI)
if err != nil {
return nil, err
}
+ return settings.ServicePrincipalTokenFromClientCredentialsWithResource(resource)
+}
- resource, err := getResourceForToken(file, baseURI)
+// ClientCredentialsAuthorizer creates an authorizer from the available client credentials.
+func (settings FileSettings) ClientCredentialsAuthorizer(baseURI string) (autorest.Authorizer, error) {
+ resource, err := settings.getResourceForToken(baseURI)
if err != nil {
return nil, err
}
+ return settings.ClientCredentialsAuthorizerWithResource(resource)
+}
- config, err := adal.NewOAuthConfig(file.ActiveDirectoryEndpoint, file.TenantID)
+// ServicePrincipalTokenFromClientCredentialsWithResource creates a ServicePrincipalToken
+// from the available client credentials and the specified resource.
+func (settings FileSettings) ServicePrincipalTokenFromClientCredentialsWithResource(resource string) (*adal.ServicePrincipalToken, error) {
+ if _, ok := settings.Values[ClientSecret]; !ok {
+ return nil, errors.New("missing client secret")
+ }
+ config, err := adal.NewOAuthConfig(settings.getAADEndpoint(), settings.Values[TenantID])
if err != nil {
return nil, err
}
+ return adal.NewServicePrincipalToken(*config, settings.Values[ClientID], settings.Values[ClientSecret], resource)
+}
- spToken, err := adal.NewServicePrincipalToken(*config, file.ClientID, file.ClientSecret, resource)
+func (settings FileSettings) clientCertificateConfigWithResource(resource string) (ClientCertificateConfig, error) {
+ if _, ok := settings.Values[CertificatePath]; !ok {
+ return ClientCertificateConfig{}, errors.New("missing certificate path")
+ }
+ cfg := NewClientCertificateConfig(settings.Values[CertificatePath], settings.Values[CertificatePassword], settings.Values[ClientID], settings.Values[TenantID])
+ cfg.AADEndpoint = settings.getAADEndpoint()
+ cfg.Resource = resource
+ return cfg, nil
+}
+
+// ClientCredentialsAuthorizerWithResource creates an authorizer from the available client credentials and the specified resource.
+func (settings FileSettings) ClientCredentialsAuthorizerWithResource(resource string) (autorest.Authorizer, error) {
+ spToken, err := settings.ServicePrincipalTokenFromClientCredentialsWithResource(resource)
if err != nil {
return nil, err
}
-
return autorest.NewBearerAuthorizer(spToken), nil
}
-// File represents the authentication file
-type file struct {
- ClientID string `json:"clientId,omitempty"`
- ClientSecret string `json:"clientSecret,omitempty"`
- SubscriptionID string `json:"subscriptionId,omitempty"`
- TenantID string `json:"tenantId,omitempty"`
- ActiveDirectoryEndpoint string `json:"activeDirectoryEndpointUrl,omitempty"`
- ResourceManagerEndpoint string `json:"resourceManagerEndpointUrl,omitempty"`
- GraphResourceID string `json:"activeDirectoryGraphResourceId,omitempty"`
- SQLManagementEndpoint string `json:"sqlManagementEndpointUrl,omitempty"`
- GalleryEndpoint string `json:"galleryEndpointUrl,omitempty"`
- ManagementEndpoint string `json:"managementEndpointUrl,omitempty"`
+// ServicePrincipalTokenFromClientCertificate creates a ServicePrincipalToken from the available certificate credentials.
+func (settings FileSettings) ServicePrincipalTokenFromClientCertificate(baseURI string) (*adal.ServicePrincipalToken, error) {
+ resource, err := settings.getResourceForToken(baseURI)
+ if err != nil {
+ return nil, err
+ }
+ return settings.ServicePrincipalTokenFromClientCertificateWithResource(resource)
+}
+
+// ClientCertificateAuthorizer creates an authorizer from the available certificate credentials.
+func (settings FileSettings) ClientCertificateAuthorizer(baseURI string) (autorest.Authorizer, error) {
+ resource, err := settings.getResourceForToken(baseURI)
+ if err != nil {
+ return nil, err
+ }
+ return settings.ClientCertificateAuthorizerWithResource(resource)
+}
+
+// ServicePrincipalTokenFromClientCertificateWithResource creates a ServicePrincipalToken from the available certificate credentials.
+func (settings FileSettings) ServicePrincipalTokenFromClientCertificateWithResource(resource string) (*adal.ServicePrincipalToken, error) {
+ cfg, err := settings.clientCertificateConfigWithResource(resource)
+ if err != nil {
+ return nil, err
+ }
+ return cfg.ServicePrincipalToken()
+}
+
+// ClientCertificateAuthorizerWithResource creates an authorizer from the available certificate credentials and the specified resource.
+func (settings FileSettings) ClientCertificateAuthorizerWithResource(resource string) (autorest.Authorizer, error) {
+ cfg, err := settings.clientCertificateConfigWithResource(resource)
+ if err != nil {
+ return nil, err
+ }
+ return cfg.Authorizer()
}
func decode(b []byte) ([]byte, error) {
@@ -175,7 +465,7 @@ func decode(b []byte) ([]byte, error) {
return ioutil.ReadAll(reader)
}
-func getResourceForToken(f file, baseURI string) (string, error) {
+func (settings FileSettings) getResourceForToken(baseURI string) (string, error) {
// Compare dafault base URI from the SDK to the endpoints from the public cloud
// Base URI and token resource are the same string. This func finds the authentication
// file field that matches the SDK base URI. The SDK defines the public cloud
@@ -185,15 +475,15 @@ func getResourceForToken(f file, baseURI string) (string, error) {
}
switch baseURI {
case azure.PublicCloud.ServiceManagementEndpoint:
- return f.ManagementEndpoint, nil
+ return settings.Values[ManagementEndpoint], nil
case azure.PublicCloud.ResourceManagerEndpoint:
- return f.ResourceManagerEndpoint, nil
+ return settings.Values[ResourceManagerEndpoint], nil
case azure.PublicCloud.ActiveDirectoryEndpoint:
- return f.ActiveDirectoryEndpoint, nil
+ return settings.Values[ActiveDirectoryEndpoint], nil
case azure.PublicCloud.GalleryEndpoint:
- return f.GalleryEndpoint, nil
+ return settings.Values[GalleryEndpoint], nil
case azure.PublicCloud.GraphEndpoint:
- return f.GraphResourceID, nil
+ return settings.Values[GraphResourceID], nil
}
return "", fmt.Errorf("auth: base URI not found in endpoints")
}
@@ -264,23 +554,43 @@ type ClientCredentialsConfig struct {
ClientID string
ClientSecret string
TenantID string
+ AuxTenants []string
AADEndpoint string
Resource string
}
-// Authorizer gets the authorizer from client credentials.
-func (ccc ClientCredentialsConfig) Authorizer() (autorest.Authorizer, error) {
+// ServicePrincipalToken creates a ServicePrincipalToken from client credentials.
+func (ccc ClientCredentialsConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) {
oauthConfig, err := adal.NewOAuthConfig(ccc.AADEndpoint, ccc.TenantID)
if err != nil {
return nil, err
}
+ return adal.NewServicePrincipalToken(*oauthConfig, ccc.ClientID, ccc.ClientSecret, ccc.Resource)
+}
- spToken, err := adal.NewServicePrincipalToken(*oauthConfig, ccc.ClientID, ccc.ClientSecret, ccc.Resource)
+// MultiTenantServicePrincipalToken creates a MultiTenantServicePrincipalToken from client credentials.
+func (ccc ClientCredentialsConfig) MultiTenantServicePrincipalToken() (*adal.MultiTenantServicePrincipalToken, error) {
+ oauthConfig, err := adal.NewMultiTenantOAuthConfig(ccc.AADEndpoint, ccc.TenantID, ccc.AuxTenants, adal.OAuthOptions{})
if err != nil {
- return nil, fmt.Errorf("failed to get oauth token from client credentials: %v", err)
+ return nil, err
}
+ return adal.NewMultiTenantServicePrincipalToken(oauthConfig, ccc.ClientID, ccc.ClientSecret, ccc.Resource)
+}
- return autorest.NewBearerAuthorizer(spToken), nil
+// Authorizer gets the authorizer from client credentials.
+func (ccc ClientCredentialsConfig) Authorizer() (autorest.Authorizer, error) {
+ if len(ccc.AuxTenants) == 0 {
+ spToken, err := ccc.ServicePrincipalToken()
+ if err != nil {
+ return nil, fmt.Errorf("failed to get SPT from client credentials: %v", err)
+ }
+ return autorest.NewBearerAuthorizer(spToken), nil
+ }
+ mtSPT, err := ccc.MultiTenantServicePrincipalToken()
+ if err != nil {
+ return nil, fmt.Errorf("failed to get multitenant SPT from client credentials: %v", err)
+ }
+ return autorest.NewMultiTenantServicePrincipalTokenAuthorizer(mtSPT), nil
}
// ClientCertificateConfig provides the options to get a bearer authorizer from a client certificate.
@@ -293,26 +603,29 @@ type ClientCertificateConfig struct {
Resource string
}
-// Authorizer gets an authorizer object from client certificate.
-func (ccc ClientCertificateConfig) Authorizer() (autorest.Authorizer, error) {
+// ServicePrincipalToken creates a ServicePrincipalToken from client certificate.
+func (ccc ClientCertificateConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) {
oauthConfig, err := adal.NewOAuthConfig(ccc.AADEndpoint, ccc.TenantID)
-
+ if err != nil {
+ return nil, err
+ }
certData, err := ioutil.ReadFile(ccc.CertificatePath)
if err != nil {
return nil, fmt.Errorf("failed to read the certificate file (%s): %v", ccc.CertificatePath, err)
}
-
certificate, rsaPrivateKey, err := decodePkcs12(certData, ccc.CertificatePassword)
if err != nil {
return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err)
}
+ return adal.NewServicePrincipalTokenFromCertificate(*oauthConfig, ccc.ClientID, certificate, rsaPrivateKey, ccc.Resource)
+}
- spToken, err := adal.NewServicePrincipalTokenFromCertificate(*oauthConfig, ccc.ClientID, certificate, rsaPrivateKey, ccc.Resource)
-
+// Authorizer gets an authorizer object from client certificate.
+func (ccc ClientCertificateConfig) Authorizer() (autorest.Authorizer, error) {
+ spToken, err := ccc.ServicePrincipalToken()
if err != nil {
return nil, fmt.Errorf("failed to get oauth token from certificate auth: %v", err)
}
-
return autorest.NewBearerAuthorizer(spToken), nil
}
@@ -326,26 +639,30 @@ type DeviceFlowConfig struct {
// Authorizer gets the authorizer from device flow.
func (dfc DeviceFlowConfig) Authorizer() (autorest.Authorizer, error) {
- oauthClient := &autorest.Client{}
+ spToken, err := dfc.ServicePrincipalToken()
+ if err != nil {
+ return nil, fmt.Errorf("failed to get oauth token from device flow: %v", err)
+ }
+ return autorest.NewBearerAuthorizer(spToken), nil
+}
+
+// ServicePrincipalToken gets the service principal token from device flow.
+func (dfc DeviceFlowConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) {
oauthConfig, err := adal.NewOAuthConfig(dfc.AADEndpoint, dfc.TenantID)
- deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthConfig, dfc.ClientID, dfc.AADEndpoint)
+ if err != nil {
+ return nil, err
+ }
+ oauthClient := &autorest.Client{}
+ deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthConfig, dfc.ClientID, dfc.Resource)
if err != nil {
return nil, fmt.Errorf("failed to start device auth flow: %s", err)
}
-
log.Println(*deviceCode.Message)
-
token, err := adal.WaitForUserCompletion(oauthClient, deviceCode)
if err != nil {
return nil, fmt.Errorf("failed to finish device auth flow: %s", err)
}
-
- spToken, err := adal.NewServicePrincipalTokenFromManualToken(*oauthConfig, dfc.ClientID, dfc.Resource, *token)
- if err != nil {
- return nil, fmt.Errorf("failed to get oauth token from device flow: %v", err)
- }
-
- return autorest.NewBearerAuthorizer(spToken), nil
+ return adal.NewServicePrincipalTokenFromManualToken(*oauthConfig, dfc.ClientID, dfc.Resource, *token)
}
func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) {
@@ -372,17 +689,21 @@ type UsernamePasswordConfig struct {
Resource string
}
+// ServicePrincipalToken creates a ServicePrincipalToken from username and password.
+func (ups UsernamePasswordConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) {
+ oauthConfig, err := adal.NewOAuthConfig(ups.AADEndpoint, ups.TenantID)
+ if err != nil {
+ return nil, err
+ }
+ return adal.NewServicePrincipalTokenFromUsernamePassword(*oauthConfig, ups.ClientID, ups.Username, ups.Password, ups.Resource)
+}
+
// Authorizer gets the authorizer from a username and a password.
func (ups UsernamePasswordConfig) Authorizer() (autorest.Authorizer, error) {
-
- oauthConfig, err := adal.NewOAuthConfig(ups.AADEndpoint, ups.TenantID)
-
- spToken, err := adal.NewServicePrincipalTokenFromUsernamePassword(*oauthConfig, ups.ClientID, ups.Username, ups.Password, ups.Resource)
-
+ spToken, err := ups.ServicePrincipalToken()
if err != nil {
return nil, fmt.Errorf("failed to get oauth token from username and password auth: %v", err)
}
-
return autorest.NewBearerAuthorizer(spToken), nil
}
@@ -399,9 +720,17 @@ func (mc MSIConfig) Authorizer() (autorest.Authorizer, error) {
return nil, err
}
- spToken, err := adal.NewServicePrincipalTokenFromMSI(msiEndpoint, mc.Resource)
- if err != nil {
- return nil, fmt.Errorf("failed to get oauth token from MSI: %v", err)
+ var spToken *adal.ServicePrincipalToken
+ if mc.ClientID == "" {
+ spToken, err = adal.NewServicePrincipalTokenFromMSI(msiEndpoint, mc.Resource)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get oauth token from MSI: %v", err)
+ }
+ } else {
+ spToken, err = adal.NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, mc.Resource, mc.ClientID)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get oauth token from MSI for user assigned identity: %v", err)
+ }
}
return autorest.NewBearerAuthorizer(spToken), nil
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
index 18d029526..3a0a439ff 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
@@ -44,11 +44,12 @@ const (
// ServiceError encapsulates the error response from an Azure service.
// It adhears to the OData v4 specification for error responses.
type ServiceError struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details []map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details []map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
func (se ServiceError) Error() string {
@@ -74,6 +75,14 @@ func (se ServiceError) Error() string {
result += fmt.Sprintf(" InnerError=%v", string(d))
}
+ if se.AdditionalInfo != nil {
+ d, err := json.Marshal(se.AdditionalInfo)
+ if err != nil {
+ result += fmt.Sprintf(" AdditionalInfo=%v", se.AdditionalInfo)
+ }
+ result += fmt.Sprintf(" AdditionalInfo=%v", string(d))
+ }
+
return result
}
@@ -86,44 +95,47 @@ func (se *ServiceError) UnmarshalJSON(b []byte) error {
// http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
type serviceError1 struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details []map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details []map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
type serviceError2 struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
+ Code string `json:"code"`
+ Message string `json:"message"`
+ Target *string `json:"target"`
+ Details map[string]interface{} `json:"details"`
+ InnerError map[string]interface{} `json:"innererror"`
+ AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
}
se1 := serviceError1{}
err := json.Unmarshal(b, &se1)
if err == nil {
- se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError)
+ se.populate(se1.Code, se1.Message, se1.Target, se1.Details, se1.InnerError, se1.AdditionalInfo)
return nil
}
se2 := serviceError2{}
err = json.Unmarshal(b, &se2)
if err == nil {
- se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError)
+ se.populate(se2.Code, se2.Message, se2.Target, nil, se2.InnerError, se2.AdditionalInfo)
se.Details = append(se.Details, se2.Details)
return nil
}
return err
}
-func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}) {
+func (se *ServiceError) populate(code, message string, target *string, details []map[string]interface{}, inner map[string]interface{}, additional []map[string]interface{}) {
se.Code = code
se.Message = message
se.Target = target
se.Details = details
se.InnerError = inner
+ se.AdditionalInfo = additional
}
// RequestError describes an error response returned by Azure service.
@@ -279,16 +291,29 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator {
resp.Body = ioutil.NopCloser(&b)
if decodeErr != nil {
return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), decodeErr)
- } else if e.ServiceError == nil {
+ }
+ if e.ServiceError == nil {
// Check if error is unwrapped ServiceError
- if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil || e.ServiceError.Message == "" {
- e.ServiceError = &ServiceError{
- Code: "Unknown",
- Message: "Unknown service error",
- }
+ if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil {
+ return err
}
}
-
+ if e.ServiceError.Message == "" {
+ // if we're here it means the returned error wasn't OData v4 compliant.
+ // try to unmarshal the body as raw JSON in hopes of getting something.
+ rawBody := map[string]interface{}{}
+ if err := json.Unmarshal(b.Bytes(), &rawBody); err != nil {
+ return err
+ }
+ e.ServiceError = &ServiceError{
+ Code: "Unknown",
+ Message: "Unknown service error",
+ }
+ if len(rawBody) > 0 {
+ e.ServiceError.Details = []map[string]interface{}{rawBody}
+ }
+ }
+ e.Response = resp
e.RequestID = ExtractRequestID(resp)
if e.StatusCode == nil {
e.StatusCode = resp.StatusCode
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go
new file mode 100644
index 000000000..a336b958d
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go
@@ -0,0 +1,79 @@
+package cli
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io/ioutil"
+ "os"
+ "path/filepath"
+
+ "github.com/dimchansky/utfbom"
+ "github.com/mitchellh/go-homedir"
+)
+
+// Profile represents a Profile from the Azure CLI
+type Profile struct {
+ InstallationID string `json:"installationId"`
+ Subscriptions []Subscription `json:"subscriptions"`
+}
+
+// Subscription represents a Subscription from the Azure CLI
+type Subscription struct {
+ EnvironmentName string `json:"environmentName"`
+ ID string `json:"id"`
+ IsDefault bool `json:"isDefault"`
+ Name string `json:"name"`
+ State string `json:"state"`
+ TenantID string `json:"tenantId"`
+ User *User `json:"user"`
+}
+
+// User represents a User from the Azure CLI
+type User struct {
+ Name string `json:"name"`
+ Type string `json:"type"`
+}
+
+const azureProfileJSON = "azureProfile.json"
+
+// ProfilePath returns the path where the Azure Profile is stored from the Azure CLI
+func ProfilePath() (string, error) {
+ if cfgDir := os.Getenv("AZURE_CONFIG_DIR"); cfgDir != "" {
+ return filepath.Join(cfgDir, azureProfileJSON), nil
+ }
+ return homedir.Expand("~/.azure/" + azureProfileJSON)
+}
+
+// LoadProfile restores a Profile object from a file located at 'path'.
+func LoadProfile(path string) (result Profile, err error) {
+ var contents []byte
+ contents, err = ioutil.ReadFile(path)
+ if err != nil {
+ err = fmt.Errorf("failed to open file (%s) while loading token: %v", path, err)
+ return
+ }
+ reader := utfbom.SkipOnly(bytes.NewReader(contents))
+
+ dec := json.NewDecoder(reader)
+ if err = dec.Decode(&result); err != nil {
+ err = fmt.Errorf("failed to decode contents of file (%s) into a Profile representation: %v", path, err)
+ return
+ }
+
+ return
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go
new file mode 100644
index 000000000..810075ba6
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go
@@ -0,0 +1,170 @@
+package cli
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "os"
+ "os/exec"
+ "regexp"
+ "runtime"
+ "strconv"
+ "time"
+
+ "github.com/Azure/go-autorest/autorest/adal"
+ "github.com/Azure/go-autorest/autorest/date"
+ "github.com/mitchellh/go-homedir"
+)
+
+// Token represents an AccessToken from the Azure CLI
+type Token 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"`
+}
+
+// ToADALToken converts an Azure CLI `Token`` to an `adal.Token``
+func (t Token) ToADALToken() (converted adal.Token, err error) {
+ tokenExpirationDate, err := ParseExpirationDate(t.ExpiresOn)
+ if err != nil {
+ err = fmt.Errorf("Error parsing Token Expiration Date %q: %+v", t.ExpiresOn, err)
+ return
+ }
+
+ difference := tokenExpirationDate.Sub(date.UnixEpoch())
+
+ converted = adal.Token{
+ AccessToken: t.AccessToken,
+ Type: t.TokenType,
+ ExpiresIn: "3600",
+ ExpiresOn: json.Number(strconv.Itoa(int(difference.Seconds()))),
+ RefreshToken: t.RefreshToken,
+ Resource: t.Resource,
+ }
+ return
+}
+
+// AccessTokensPath returns the path where access tokens are stored from the Azure CLI
+// TODO(#199): add unit test.
+func AccessTokensPath() (string, error) {
+ // Azure-CLI allows user to customize the path of access tokens thorugh environment variable.
+ var accessTokenPath = os.Getenv("AZURE_ACCESS_TOKEN_FILE")
+ var err error
+
+ // Fallback logic to default path on non-cloud-shell environment.
+ // TODO(#200): remove the dependency on hard-coding path.
+ if accessTokenPath == "" {
+ accessTokenPath, err = homedir.Expand("~/.azure/accessTokens.json")
+ }
+
+ return accessTokenPath, err
+}
+
+// ParseExpirationDate parses either a Azure CLI or CloudShell date into a time object
+func ParseExpirationDate(input string) (*time.Time, error) {
+ // CloudShell (and potentially the Azure CLI in future)
+ expirationDate, cloudShellErr := time.Parse(time.RFC3339, input)
+ if cloudShellErr != nil {
+ // Azure CLI (Python) e.g. 2017-08-31 19:48:57.998857 (plus the local timezone)
+ const cliFormat = "2006-01-02 15:04:05.999999"
+ expirationDate, cliErr := time.ParseInLocation(cliFormat, input, time.Local)
+ if cliErr == nil {
+ return &expirationDate, nil
+ }
+
+ return nil, fmt.Errorf("Error parsing expiration date %q.\n\nCloudShell Error: \n%+v\n\nCLI Error:\n%+v", input, cloudShellErr, cliErr)
+ }
+
+ return &expirationDate, nil
+}
+
+// LoadTokens restores a set of Token objects from a file located at 'path'.
+func LoadTokens(path string) ([]Token, error) {
+ file, err := os.Open(path)
+ if err != nil {
+ return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err)
+ }
+ defer file.Close()
+
+ var tokens []Token
+
+ dec := json.NewDecoder(file)
+ if err = dec.Decode(&tokens); err != nil {
+ return nil, fmt.Errorf("failed to decode contents of file (%s) into a `cli.Token` representation: %v", path, err)
+ }
+
+ return tokens, nil
+}
+
+// GetTokenFromCLI gets a token using Azure CLI 2.0 for local development scenarios.
+func GetTokenFromCLI(resource string) (*Token, error) {
+ // This is the path that a developer can set to tell this class what the install path for Azure CLI is.
+ const azureCLIPath = "AzureCLIPath"
+
+ // The default install paths are used to find Azure CLI. This is for security, so that any path in the calling program's Path environment is not used to execute Azure CLI.
+ azureCLIDefaultPathWindows := fmt.Sprintf("%s\\Microsoft SDKs\\Azure\\CLI2\\wbin; %s\\Microsoft SDKs\\Azure\\CLI2\\wbin", os.Getenv("ProgramFiles(x86)"), os.Getenv("ProgramFiles"))
+
+ // Default path for non-Windows.
+ const azureCLIDefaultPath = "/bin:/sbin:/usr/bin:/usr/local/bin"
+
+ // Validate resource, since it gets sent as a command line argument to Azure CLI
+ const invalidResourceErrorTemplate = "Resource %s is not in expected format. Only alphanumeric characters, [dot], [colon], [hyphen], and [forward slash] are allowed."
+ match, err := regexp.MatchString("^[0-9a-zA-Z-.:/]+$", resource)
+ if err != nil {
+ return nil, err
+ }
+ if !match {
+ return nil, fmt.Errorf(invalidResourceErrorTemplate, resource)
+ }
+
+ // Execute Azure CLI to get token
+ var cliCmd *exec.Cmd
+ if runtime.GOOS == "windows" {
+ cliCmd = exec.Command(fmt.Sprintf("%s\\system32\\cmd.exe", os.Getenv("windir")))
+ cliCmd.Env = os.Environ()
+ cliCmd.Env = append(cliCmd.Env, fmt.Sprintf("PATH=%s;%s", os.Getenv(azureCLIPath), azureCLIDefaultPathWindows))
+ cliCmd.Args = append(cliCmd.Args, "/c", "az")
+ } else {
+ cliCmd = exec.Command("az")
+ cliCmd.Env = os.Environ()
+ cliCmd.Env = append(cliCmd.Env, fmt.Sprintf("PATH=%s:%s", os.Getenv(azureCLIPath), azureCLIDefaultPath))
+ }
+ cliCmd.Args = append(cliCmd.Args, "account", "get-access-token", "-o", "json", "--resource", resource)
+
+ var stderr bytes.Buffer
+ cliCmd.Stderr = &stderr
+
+ output, err := cliCmd.Output()
+ if err != nil {
+ return nil, fmt.Errorf("Invoking Azure CLI failed with the following error: %s", stderr.String())
+ }
+
+ tokenResponse := Token{}
+ err = json.Unmarshal(output, &tokenResponse)
+ if err != nil {
+ return nil, err
+ }
+
+ return &tokenResponse, err
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
index 7e41f7fd9..6c20b8179 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
@@ -22,9 +22,14 @@ import (
"strings"
)
-// EnvironmentFilepathName captures the name of the environment variable containing the path to the file
-// to be used while populating the Azure Environment.
-const EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH"
+const (
+ // EnvironmentFilepathName captures the name of the environment variable containing the path to the file
+ // to be used while populating the Azure Environment.
+ EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH"
+
+ // NotAvailable is used for endpoints and resource IDs that are not available for a given cloud.
+ NotAvailable = "N/A"
+)
var environments = map[string]Environment{
"AZURECHINACLOUD": ChinaCloud,
@@ -33,28 +38,40 @@ var environments = map[string]Environment{
"AZUREUSGOVERNMENTCLOUD": USGovernmentCloud,
}
+// ResourceIdentifier contains a set of Azure resource IDs.
+type ResourceIdentifier struct {
+ Graph string `json:"graph"`
+ KeyVault string `json:"keyVault"`
+ Datalake string `json:"datalake"`
+ Batch string `json:"batch"`
+ OperationalInsights string `json:"operationalInsights"`
+ Storage string `json:"storage"`
+}
+
// Environment represents a set of endpoints for each of Azure's Clouds.
type Environment struct {
- Name string `json:"name"`
- ManagementPortalURL string `json:"managementPortalURL"`
- PublishSettingsURL string `json:"publishSettingsURL"`
- ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
- ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
- ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
- GalleryEndpoint string `json:"galleryEndpoint"`
- KeyVaultEndpoint string `json:"keyVaultEndpoint"`
- GraphEndpoint string `json:"graphEndpoint"`
- ServiceBusEndpoint string `json:"serviceBusEndpoint"`
- BatchManagementEndpoint string `json:"batchManagementEndpoint"`
- StorageEndpointSuffix string `json:"storageEndpointSuffix"`
- SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
- TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
- KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
- ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
- ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"`
- ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"`
- ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"`
- TokenAudience string `json:"tokenAudience"`
+ Name string `json:"name"`
+ ManagementPortalURL string `json:"managementPortalURL"`
+ PublishSettingsURL string `json:"publishSettingsURL"`
+ ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
+ ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
+ ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
+ GalleryEndpoint string `json:"galleryEndpoint"`
+ KeyVaultEndpoint string `json:"keyVaultEndpoint"`
+ GraphEndpoint string `json:"graphEndpoint"`
+ ServiceBusEndpoint string `json:"serviceBusEndpoint"`
+ BatchManagementEndpoint string `json:"batchManagementEndpoint"`
+ StorageEndpointSuffix string `json:"storageEndpointSuffix"`
+ SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
+ TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
+ KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
+ ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
+ ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"`
+ ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"`
+ ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"`
+ CosmosDBDNSSuffix string `json:"cosmosDBDNSSuffix"`
+ TokenAudience string `json:"tokenAudience"`
+ ResourceIdentifiers ResourceIdentifier `json:"resourceIdentifiers"`
}
var (
@@ -79,7 +96,16 @@ var (
ServiceManagementVMDNSSuffix: "cloudapp.net",
ResourceManagerVMDNSSuffix: "cloudapp.azure.com",
ContainerRegistryDNSSuffix: "azurecr.io",
+ CosmosDBDNSSuffix: "documents.azure.com",
TokenAudience: "https://management.azure.com/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.windows.net/",
+ KeyVault: "https://vault.azure.net",
+ Datalake: "https://datalake.azure.net/",
+ Batch: "https://batch.core.windows.net/",
+ OperationalInsights: "https://api.loganalytics.io",
+ Storage: "https://storage.azure.com/",
+ },
}
// USGovernmentCloud is the cloud environment for the US Government
@@ -102,8 +128,17 @@ var (
ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net",
ServiceManagementVMDNSSuffix: "usgovcloudapp.net",
ResourceManagerVMDNSSuffix: "cloudapp.windowsazure.us",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: "azurecr.us",
+ CosmosDBDNSSuffix: "documents.azure.us",
TokenAudience: "https://management.usgovcloudapi.net/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.windows.net/",
+ KeyVault: "https://vault.usgovcloudapi.net",
+ Datalake: NotAvailable,
+ Batch: "https://batch.core.usgovcloudapi.net/",
+ OperationalInsights: "https://api.loganalytics.us",
+ Storage: "https://storage.azure.com/",
+ },
}
// ChinaCloud is the cloud environment operated in China
@@ -126,8 +161,17 @@ var (
ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn",
ServiceManagementVMDNSSuffix: "chinacloudapp.cn",
ResourceManagerVMDNSSuffix: "cloudapp.azure.cn",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: "azurecr.cn",
+ CosmosDBDNSSuffix: "documents.azure.cn",
TokenAudience: "https://management.chinacloudapi.cn/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.chinacloudapi.cn/",
+ KeyVault: "https://vault.azure.cn",
+ Datalake: NotAvailable,
+ Batch: "https://batch.chinacloudapi.cn/",
+ OperationalInsights: NotAvailable,
+ Storage: "https://storage.azure.com/",
+ },
}
// GermanCloud is the cloud environment operated in Germany
@@ -150,8 +194,17 @@ var (
ServiceBusEndpointSuffix: "servicebus.cloudapi.de",
ServiceManagementVMDNSSuffix: "azurecloudapp.de",
ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de",
- ContainerRegistryDNSSuffix: "azurecr.io",
+ ContainerRegistryDNSSuffix: NotAvailable,
+ CosmosDBDNSSuffix: "documents.microsoftazure.de",
TokenAudience: "https://management.microsoftazure.de/",
+ ResourceIdentifiers: ResourceIdentifier{
+ Graph: "https://graph.cloudapi.de/",
+ KeyVault: "https://vault.microsoftazure.de",
+ Datalake: NotAvailable,
+ Batch: "https://batch.cloudapi.de/",
+ OperationalInsights: NotAvailable,
+ Storage: "https://storage.azure.com/",
+ },
}
)
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
index 65ad0afc8..86ce9f2b5 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
@@ -64,7 +64,7 @@ func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator {
}
}
}
- return resp, fmt.Errorf("failed request: %s", err)
+ return resp, err
})
}
}
@@ -140,8 +140,8 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
}
// poll for registered provisioning state
- now := time.Now()
- for err == nil && time.Since(now) < client.PollingDuration {
+ registrationStartTime := time.Now()
+ for err == nil && (client.PollingDuration == 0 || (client.PollingDuration != 0 && time.Since(registrationStartTime) < client.PollingDuration)) {
// taken from the resources SDK
// https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45
preparer := autorest.CreatePreparer(
@@ -183,7 +183,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
return originalReq.Context().Err()
}
}
- if !(time.Since(now) < client.PollingDuration) {
+ if client.PollingDuration != 0 && !(time.Since(registrationStartTime) < client.PollingDuration) {
return errors.New("polling for resource provider registration has exceeded the polling duration")
}
return err
diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go
index 4e92dcad0..92da6adb2 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/client.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/client.go
@@ -16,14 +16,18 @@ package autorest
import (
"bytes"
+ "crypto/tls"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
- "runtime"
+ "strings"
"time"
+
+ "github.com/Azure/go-autorest/logger"
+ "github.com/Azure/go-autorest/tracing"
)
const (
@@ -41,15 +45,6 @@ const (
)
var (
- // defaultUserAgent builds a string containing the Go version, system archityecture and OS,
- // and the go-autorest version.
- defaultUserAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
- runtime.Version(),
- runtime.GOARCH,
- runtime.GOOS,
- Version(),
- )
-
// StatusCodesForRetry are a defined group of status code for which the client will retry
StatusCodesForRetry = []int{
http.StatusRequestTimeout, // 408
@@ -78,6 +73,22 @@ type Response struct {
*http.Response `json:"-"`
}
+// IsHTTPStatus returns true if the returned HTTP status code matches the provided status code.
+// If there was no response (i.e. the underlying http.Response is nil) the return value is false.
+func (r Response) IsHTTPStatus(statusCode int) bool {
+ if r.Response == nil {
+ return false
+ }
+ return r.Response.StatusCode == statusCode
+}
+
+// HasHTTPStatus returns true if the returned HTTP status code matches one of the provided status codes.
+// If there was no response (i.e. the underlying http.Response is nil) or not status codes are provided
+// the return value is false.
+func (r Response) HasHTTPStatus(statusCodes ...int) bool {
+ return ResponseHasStatusCode(r.Response, statusCodes...)
+}
+
// LoggingInspector implements request and response inspectors that log the full request and
// response to a supplied log.
type LoggingInspector struct {
@@ -153,6 +164,7 @@ type Client struct {
PollingDelay time.Duration
// PollingDuration sets the maximum polling time after which an error is returned.
+ // Setting this to zero will use the provided context to control the duration.
PollingDuration time.Duration
// RetryAttempts sets the default number of retry attempts for client.
@@ -174,14 +186,32 @@ type Client struct {
// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed
// string.
func NewClientWithUserAgent(ua string) Client {
+ return newClient(ua, tls.RenegotiateNever)
+}
+
+// ClientOptions contains various Client configuration options.
+type ClientOptions struct {
+ // UserAgent is an optional user-agent string to append to the default user agent.
+ UserAgent string
+
+ // Renegotiation is an optional setting to control client-side TLS renegotiation.
+ Renegotiation tls.RenegotiationSupport
+}
+
+// NewClientWithOptions returns an instance of a Client with the specified values.
+func NewClientWithOptions(options ClientOptions) Client {
+ return newClient(options.UserAgent, options.Renegotiation)
+}
+
+func newClient(ua string, renegotiation tls.RenegotiationSupport) Client {
c := Client{
PollingDelay: DefaultPollingDelay,
PollingDuration: DefaultPollingDuration,
RetryAttempts: DefaultRetryAttempts,
RetryDuration: DefaultRetryDuration,
- UserAgent: defaultUserAgent,
+ UserAgent: UserAgent(),
}
- c.Sender = c.sender()
+ c.Sender = c.sender(renegotiation)
c.AddToUserAgent(ua)
return c
}
@@ -216,18 +246,48 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
}
return resp, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed")
}
-
- resp, err := SendWithSender(c.sender(), r)
+ logger.Instance.WriteRequest(r, logger.Filter{
+ Header: func(k string, v []string) (bool, []string) {
+ // remove the auth token from the log
+ if strings.EqualFold(k, "Authorization") || strings.EqualFold(k, "Ocp-Apim-Subscription-Key") {
+ v = []string{"**REDACTED**"}
+ }
+ return true, v
+ },
+ })
+ resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r)
+ logger.Instance.WriteResponse(resp, logger.Filter{})
Respond(resp, c.ByInspecting())
return resp, err
}
// sender returns the Sender to which to send requests.
-func (c Client) sender() Sender {
+func (c Client) sender(renengotiation tls.RenegotiationSupport) Sender {
if c.Sender == nil {
+ // Use behaviour compatible with DefaultTransport, but require TLS minimum version.
+ var defaultTransport = http.DefaultTransport.(*http.Transport)
+ transport := tracing.Transport
+ // for non-default values of TLS renegotiation create a new tracing transport.
+ // updating tracing.Transport affects all clients which is not what we want.
+ if renengotiation != tls.RenegotiateNever {
+ transport = tracing.NewTransport()
+ }
+ transport.Base = &http.Transport{
+ Proxy: defaultTransport.Proxy,
+ DialContext: defaultTransport.DialContext,
+ MaxIdleConns: defaultTransport.MaxIdleConns,
+ IdleConnTimeout: defaultTransport.IdleConnTimeout,
+ TLSHandshakeTimeout: defaultTransport.TLSHandshakeTimeout,
+ ExpectContinueTimeout: defaultTransport.ExpectContinueTimeout,
+ TLSClientConfig: &tls.Config{
+ MinVersion: tls.VersionTLS12,
+ Renegotiation: renengotiation,
+ },
+ }
j, _ := cookiejar.New(nil)
- return &http.Client{Jar: j}
+ return &http.Client{Jar: j, Transport: transport}
}
+
return c.Sender
}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go
index 6d67bd733..9f864ab1a 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/preparer.go
@@ -16,7 +16,9 @@ package autorest
import (
"bytes"
+ "context"
"encoding/json"
+ "encoding/xml"
"fmt"
"io"
"io/ioutil"
@@ -31,11 +33,33 @@ const (
mimeTypeOctetStream = "application/octet-stream"
mimeTypeFormPost = "application/x-www-form-urlencoded"
- headerAuthorization = "Authorization"
- headerContentType = "Content-Type"
- headerUserAgent = "User-Agent"
+ headerAuthorization = "Authorization"
+ headerAuxAuthorization = "x-ms-authorization-auxiliary"
+ headerContentType = "Content-Type"
+ headerUserAgent = "User-Agent"
)
+// used as a key type in context.WithValue()
+type ctxPrepareDecorators struct{}
+
+// WithPrepareDecorators adds the specified PrepareDecorators to the provided context.
+// If no PrepareDecorators are provided the context is unchanged.
+func WithPrepareDecorators(ctx context.Context, prepareDecorator []PrepareDecorator) context.Context {
+ if len(prepareDecorator) == 0 {
+ return ctx
+ }
+ return context.WithValue(ctx, ctxPrepareDecorators{}, prepareDecorator)
+}
+
+// GetPrepareDecorators returns the PrepareDecorators in the provided context or the provided default PrepareDecorators.
+func GetPrepareDecorators(ctx context.Context, defaultPrepareDecorators ...PrepareDecorator) []PrepareDecorator {
+ inCtx := ctx.Value(ctxPrepareDecorators{})
+ if pd, ok := inCtx.([]PrepareDecorator); ok {
+ return pd
+ }
+ return defaultPrepareDecorators
+}
+
// Preparer is the interface that wraps the Prepare method.
//
// Prepare accepts and possibly modifies an http.Request (e.g., adding Headers). Implementations
@@ -190,6 +214,9 @@ func AsGet() PrepareDecorator { return WithMethod("GET") }
// AsHead returns a PrepareDecorator that sets the HTTP method to HEAD.
func AsHead() PrepareDecorator { return WithMethod("HEAD") }
+// AsMerge returns a PrepareDecorator that sets the HTTP method to MERGE.
+func AsMerge() PrepareDecorator { return WithMethod("MERGE") }
+
// AsOptions returns a PrepareDecorator that sets the HTTP method to OPTIONS.
func AsOptions() PrepareDecorator { return WithMethod("OPTIONS") }
@@ -225,6 +252,25 @@ func WithBaseURL(baseURL string) PrepareDecorator {
}
}
+// WithBytes returns a PrepareDecorator that takes a list of bytes
+// which passes the bytes directly to the body
+func WithBytes(input *[]byte) PrepareDecorator {
+ return func(p Preparer) Preparer {
+ return PreparerFunc(func(r *http.Request) (*http.Request, error) {
+ r, err := p.Prepare(r)
+ if err == nil {
+ if input == nil {
+ return r, fmt.Errorf("Input Bytes was nil")
+ }
+
+ r.ContentLength = int64(len(*input))
+ r.Body = ioutil.NopCloser(bytes.NewReader(*input))
+ }
+ return r, err
+ })
+ }
+}
+
// WithCustomBaseURL returns a PrepareDecorator that replaces brace-enclosed keys within the
// request base URL (i.e., http.Request.URL) with the corresponding values from the passed map.
func WithCustomBaseURL(baseURL string, urlParameters map[string]interface{}) PrepareDecorator {
@@ -377,6 +423,28 @@ func WithJSON(v interface{}) PrepareDecorator {
}
}
+// WithXML returns a PrepareDecorator that encodes the data passed as XML into the body of the
+// request and sets the Content-Length header.
+func WithXML(v interface{}) PrepareDecorator {
+ return func(p Preparer) Preparer {
+ return PreparerFunc(func(r *http.Request) (*http.Request, error) {
+ r, err := p.Prepare(r)
+ if err == nil {
+ b, err := xml.Marshal(v)
+ if err == nil {
+ // we have to tack on an XML header
+ withHeader := xml.Header + string(b)
+ bytesWithHeader := []byte(withHeader)
+
+ r.ContentLength = int64(len(bytesWithHeader))
+ r.Body = ioutil.NopCloser(bytes.NewReader(bytesWithHeader))
+ }
+ }
+ return r, err
+ })
+ }
+}
+
// WithPath returns a PrepareDecorator that adds the supplied path to the request URL. If the path
// is absolute (that is, it begins with a "/"), it replaces the existing path.
func WithPath(path string) PrepareDecorator {
diff --git a/vendor/github.com/Azure/go-autorest/autorest/responder.go b/vendor/github.com/Azure/go-autorest/autorest/responder.go
index a908a0adb..349e1963a 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/responder.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/responder.go
@@ -153,6 +153,25 @@ func ByClosingIfError() RespondDecorator {
}
}
+// ByUnmarshallingBytes returns a RespondDecorator that copies the Bytes returned in the
+// response Body into the value pointed to by v.
+func ByUnmarshallingBytes(v *[]byte) RespondDecorator {
+ return func(r Responder) Responder {
+ return ResponderFunc(func(resp *http.Response) error {
+ err := r.Respond(resp)
+ if err == nil {
+ bytes, errInner := ioutil.ReadAll(resp.Body)
+ if errInner != nil {
+ err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
+ } else {
+ *v = bytes
+ }
+ }
+ return err
+ })
+ }
+}
+
// ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the
// response Body into the value pointed to by v.
func ByUnmarshallingJSON(v interface{}) RespondDecorator {
diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go
index b4f762325..92a55404a 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/sender.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/sender.go
@@ -15,14 +15,38 @@ package autorest
// limitations under the License.
import (
+ "context"
"fmt"
"log"
"math"
"net/http"
"strconv"
"time"
+
+ "github.com/Azure/go-autorest/tracing"
)
+// used as a key type in context.WithValue()
+type ctxSendDecorators struct{}
+
+// WithSendDecorators adds the specified SendDecorators to the provided context.
+// If no SendDecorators are provided the context is unchanged.
+func WithSendDecorators(ctx context.Context, sendDecorator []SendDecorator) context.Context {
+ if len(sendDecorator) == 0 {
+ return ctx
+ }
+ return context.WithValue(ctx, ctxSendDecorators{}, sendDecorator)
+}
+
+// GetSendDecorators returns the SendDecorators in the provided context or the provided default SendDecorators.
+func GetSendDecorators(ctx context.Context, defaultSendDecorators ...SendDecorator) []SendDecorator {
+ inCtx := ctx.Value(ctxSendDecorators{})
+ if sd, ok := inCtx.([]SendDecorator); ok {
+ return sd
+ }
+ return defaultSendDecorators
+}
+
// Sender is the interface that wraps the Do method to send HTTP requests.
//
// The standard http.Client conforms to this interface.
@@ -38,7 +62,7 @@ func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
return sf(r)
}
-// SendDecorator takes and possibily decorates, by wrapping, a Sender. Decorators may affect the
+// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
// http.Request and pass it along or, first, pass the http.Request along then react to the
// http.Response result.
type SendDecorator func(Sender) Sender
@@ -68,7 +92,7 @@ func DecorateSender(s Sender, decorators ...SendDecorator) Sender {
//
// Send will not poll or retry requests.
func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
- return SendWithSender(&http.Client{}, r, decorators...)
+ return SendWithSender(&http.Client{Transport: tracing.Transport}, r, decorators...)
}
// SendWithSender sends the passed http.Request, through the provided Sender, returning the
@@ -209,50 +233,77 @@ func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator {
// DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified
// number of attempts, exponentially backing off between requests using the supplied backoff
-// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on
-// the http.Request.
+// time.Duration (which may be zero). Retrying may be canceled by cancelling the context on the http.Request.
+// NOTE: Code http.StatusTooManyRequests (429) will *not* be counted against the number of attempts.
func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator {
return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- rr := NewRetriableRequest(r)
- // Increment to add the first call (attempts denotes number of retries)
- attempts++
- for attempt := 0; attempt < attempts; {
- err = rr.Prepare()
- if err != nil {
- return resp, err
- }
- resp, err = s.Do(rr.Request())
- // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication
- // resp and err will both have a value, so in this case we don't want to retry as it will never succeed.
- if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) {
- return resp, err
- }
- delayed := DelayWithRetryAfter(resp, r.Context().Done())
- if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) {
- return nil, r.Context().Err()
- }
- // don't count a 429 against the number of attempts
- // so that we continue to retry until it succeeds
- if resp == nil || resp.StatusCode != http.StatusTooManyRequests {
- attempt++
- }
- }
- return resp, err
+ return SenderFunc(func(r *http.Request) (*http.Response, error) {
+ return doRetryForStatusCodesImpl(s, r, false, attempts, backoff, 0, codes...)
})
}
}
-// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header in
-// responses with status code 429
+// DoRetryForStatusCodesWithCap returns a SendDecorator that retries for specified statusCodes for up to the
+// specified number of attempts, exponentially backing off between requests using the supplied backoff
+// time.Duration (which may be zero). To cap the maximum possible delay between iterations specify a value greater
+// than zero for cap. Retrying may be canceled by cancelling the context on the http.Request.
+func DoRetryForStatusCodesWithCap(attempts int, backoff, cap time.Duration, codes ...int) SendDecorator {
+ return func(s Sender) Sender {
+ return SenderFunc(func(r *http.Request) (*http.Response, error) {
+ return doRetryForStatusCodesImpl(s, r, true, attempts, backoff, cap, codes...)
+ })
+ }
+}
+
+func doRetryForStatusCodesImpl(s Sender, r *http.Request, count429 bool, attempts int, backoff, cap time.Duration, codes ...int) (resp *http.Response, err error) {
+ rr := NewRetriableRequest(r)
+ // Increment to add the first call (attempts denotes number of retries)
+ for attempt := 0; attempt < attempts+1; {
+ err = rr.Prepare()
+ if err != nil {
+ return
+ }
+ resp, err = s.Do(rr.Request())
+ // if the error isn't temporary don't bother retrying
+ if err != nil && !IsTemporaryNetworkError(err) {
+ return
+ }
+ // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication
+ // resp and err will both have a value, so in this case we don't want to retry as it will never succeed.
+ if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) {
+ return resp, err
+ }
+ delayed := DelayWithRetryAfter(resp, r.Context().Done())
+ if !delayed && !DelayForBackoffWithCap(backoff, cap, attempt, r.Context().Done()) {
+ return resp, r.Context().Err()
+ }
+ // when count429 == false don't count a 429 against the number
+ // of attempts so that we continue to retry until it succeeds
+ if count429 || (resp == nil || resp.StatusCode != http.StatusTooManyRequests) {
+ attempt++
+ }
+ }
+ return resp, err
+}
+
+// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header.
+// The value of Retry-After can be either the number of seconds or a date in RFC1123 format.
+// The function returns true after successfully waiting for the specified duration. If there is
+// no Retry-After header or the wait is cancelled the return value is false.
func DelayWithRetryAfter(resp *http.Response, cancel <-chan struct{}) bool {
if resp == nil {
return false
}
- retryAfter, _ := strconv.Atoi(resp.Header.Get("Retry-After"))
- if resp.StatusCode == http.StatusTooManyRequests && retryAfter > 0 {
+ var dur time.Duration
+ ra := resp.Header.Get("Retry-After")
+ if retryAfter, _ := strconv.Atoi(ra); retryAfter > 0 {
+ dur = time.Duration(retryAfter) * time.Second
+ } else if t, err := time.Parse(time.RFC1123, ra); err == nil {
+ dur = t.Sub(time.Now())
+ }
+ if dur > 0 {
select {
- case <-time.After(time.Duration(retryAfter) * time.Second):
+ case <-time.After(dur):
return true
case <-cancel:
return false
@@ -312,8 +363,22 @@ func WithLogging(logger *log.Logger) SendDecorator {
// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt
// count.
func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool {
+ return DelayForBackoffWithCap(backoff, 0, attempt, cancel)
+}
+
+// DelayForBackoffWithCap invokes time.After for the supplied backoff duration raised to the power of
+// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set
+// to zero for no delay. To cap the maximum possible delay specify a value greater than zero for cap.
+// The delay may be canceled by closing the passed channel. If terminated early, returns false.
+// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt
+// count.
+func DelayForBackoffWithCap(backoff, cap time.Duration, attempt int, cancel <-chan struct{}) bool {
+ d := time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second
+ if cap > 0 && d > cap {
+ d = cap
+ }
select {
- case <-time.After(time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second):
+ case <-time.After(d):
return true
case <-cancel:
return false
diff --git a/vendor/github.com/Azure/go-autorest/autorest/to/convert.go b/vendor/github.com/Azure/go-autorest/autorest/to/convert.go
index fdda2ce1a..86694bd25 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/to/convert.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/to/convert.go
@@ -145,3 +145,8 @@ func Float64(i *float64) float64 {
func Float64Ptr(i float64) *float64 {
return &i
}
+
+// ByteSlicePtr returns a pointer to the passed byte slice.
+func ByteSlicePtr(b []byte) *[]byte {
+ return &b
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go
index afb3e4e16..08cf11c11 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/utility.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/utility.go
@@ -20,6 +20,7 @@ import (
"encoding/xml"
"fmt"
"io"
+ "net"
"net/http"
"net/url"
"reflect"
@@ -156,7 +157,7 @@ func AsStringSlice(s interface{}) ([]string, error) {
}
// String method converts interface v to string. If interface is a list, it
-// joins list elements using the seperator. Note that only sep[0] will be used for
+// joins list elements using the separator. Note that only sep[0] will be used for
// joining if any separator is specified.
func String(v interface{}, sep ...string) string {
if len(sep) == 0 {
@@ -216,3 +217,12 @@ func IsTokenRefreshError(err error) bool {
}
return false
}
+
+// IsTemporaryNetworkError returns true if the specified error is a temporary network error or false
+// if it's not. If the error doesn't implement the net.Error interface the return value is true.
+func IsTemporaryNetworkError(err error) bool {
+ if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
+ return true
+ }
+ return false
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/error.go b/vendor/github.com/Azure/go-autorest/autorest/validation/error.go
new file mode 100644
index 000000000..fed156dbf
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/validation/error.go
@@ -0,0 +1,48 @@
+package validation
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "fmt"
+)
+
+// Error is the type that's returned when the validation of an APIs arguments constraints fails.
+type Error struct {
+ // PackageType is the package type of the object emitting the error. For types, the value
+ // matches that produced the the '%T' format specifier of the fmt package. For other elements,
+ // such as functions, it is just the package name (e.g., "autorest").
+ PackageType string
+
+ // Method is the name of the method raising the error.
+ Method string
+
+ // Message is the error message.
+ Message string
+}
+
+// Error returns a string containing the details of the validation failure.
+func (e Error) Error() string {
+ return fmt.Sprintf("%s#%s: Invalid input: %s", e.PackageType, e.Method, e.Message)
+}
+
+// NewError creates a new Error object with the specified parameters.
+// message is treated as a format string to which the optional args apply.
+func NewError(packageType string, method string, message string, args ...interface{}) Error {
+ return Error{
+ PackageType: packageType,
+ Method: method,
+ Message: fmt.Sprintf(message, args...),
+ }
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
new file mode 100644
index 000000000..65899b69b
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/autorest/validation/validation.go
@@ -0,0 +1,400 @@
+/*
+Package validation provides methods for validating parameter value using reflection.
+*/
+package validation
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "fmt"
+ "reflect"
+ "regexp"
+ "strings"
+)
+
+// Constraint stores constraint name, target field name
+// Rule and chain validations.
+type Constraint struct {
+
+ // Target field name for validation.
+ Target string
+
+ // Constraint name e.g. minLength, MaxLength, Pattern, etc.
+ Name string
+
+ // Rule for constraint e.g. greater than 10, less than 5 etc.
+ Rule interface{}
+
+ // Chain Validations for struct type
+ Chain []Constraint
+}
+
+// Validation stores parameter-wise validation.
+type Validation struct {
+ TargetValue interface{}
+ Constraints []Constraint
+}
+
+// Constraint list
+const (
+ Empty = "Empty"
+ Null = "Null"
+ ReadOnly = "ReadOnly"
+ Pattern = "Pattern"
+ MaxLength = "MaxLength"
+ MinLength = "MinLength"
+ MaxItems = "MaxItems"
+ MinItems = "MinItems"
+ MultipleOf = "MultipleOf"
+ UniqueItems = "UniqueItems"
+ InclusiveMaximum = "InclusiveMaximum"
+ ExclusiveMaximum = "ExclusiveMaximum"
+ ExclusiveMinimum = "ExclusiveMinimum"
+ InclusiveMinimum = "InclusiveMinimum"
+)
+
+// Validate method validates constraints on parameter
+// passed in validation array.
+func Validate(m []Validation) error {
+ for _, item := range m {
+ v := reflect.ValueOf(item.TargetValue)
+ for _, constraint := range item.Constraints {
+ var err error
+ switch v.Kind() {
+ case reflect.Ptr:
+ err = validatePtr(v, constraint)
+ case reflect.String:
+ err = validateString(v, constraint)
+ case reflect.Struct:
+ err = validateStruct(v, constraint)
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+ err = validateInt(v, constraint)
+ case reflect.Float32, reflect.Float64:
+ err = validateFloat(v, constraint)
+ case reflect.Array, reflect.Slice, reflect.Map:
+ err = validateArrayMap(v, constraint)
+ default:
+ err = createError(v, constraint, fmt.Sprintf("unknown type %v", v.Kind()))
+ }
+
+ if err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+}
+
+func validateStruct(x reflect.Value, v Constraint, name ...string) error {
+ //Get field name from target name which is in format a.b.c
+ s := strings.Split(v.Target, ".")
+ f := x.FieldByName(s[len(s)-1])
+ if isZero(f) {
+ return createError(x, v, fmt.Sprintf("field %q doesn't exist", v.Target))
+ }
+
+ return Validate([]Validation{
+ {
+ TargetValue: getInterfaceValue(f),
+ Constraints: []Constraint{v},
+ },
+ })
+}
+
+func validatePtr(x reflect.Value, v Constraint) error {
+ if v.Name == ReadOnly {
+ if !x.IsNil() {
+ return createError(x.Elem(), v, "readonly parameter; must send as nil or empty in request")
+ }
+ return nil
+ }
+ if x.IsNil() {
+ return checkNil(x, v)
+ }
+ if v.Chain != nil {
+ return Validate([]Validation{
+ {
+ TargetValue: getInterfaceValue(x.Elem()),
+ Constraints: v.Chain,
+ },
+ })
+ }
+ return nil
+}
+
+func validateInt(x reflect.Value, v Constraint) error {
+ i := x.Int()
+ r, ok := toInt64(v.Rule)
+ if !ok {
+ return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ switch v.Name {
+ case MultipleOf:
+ if i%r != 0 {
+ return createError(x, v, fmt.Sprintf("value must be a multiple of %v", r))
+ }
+ case ExclusiveMinimum:
+ if i <= r {
+ return createError(x, v, fmt.Sprintf("value must be greater than %v", r))
+ }
+ case ExclusiveMaximum:
+ if i >= r {
+ return createError(x, v, fmt.Sprintf("value must be less than %v", r))
+ }
+ case InclusiveMinimum:
+ if i < r {
+ return createError(x, v, fmt.Sprintf("value must be greater than or equal to %v", r))
+ }
+ case InclusiveMaximum:
+ if i > r {
+ return createError(x, v, fmt.Sprintf("value must be less than or equal to %v", r))
+ }
+ default:
+ return createError(x, v, fmt.Sprintf("constraint %v is not applicable for type integer", v.Name))
+ }
+ return nil
+}
+
+func validateFloat(x reflect.Value, v Constraint) error {
+ f := x.Float()
+ r, ok := v.Rule.(float64)
+ if !ok {
+ return createError(x, v, fmt.Sprintf("rule must be float value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ switch v.Name {
+ case ExclusiveMinimum:
+ if f <= r {
+ return createError(x, v, fmt.Sprintf("value must be greater than %v", r))
+ }
+ case ExclusiveMaximum:
+ if f >= r {
+ return createError(x, v, fmt.Sprintf("value must be less than %v", r))
+ }
+ case InclusiveMinimum:
+ if f < r {
+ return createError(x, v, fmt.Sprintf("value must be greater than or equal to %v", r))
+ }
+ case InclusiveMaximum:
+ if f > r {
+ return createError(x, v, fmt.Sprintf("value must be less than or equal to %v", r))
+ }
+ default:
+ return createError(x, v, fmt.Sprintf("constraint %s is not applicable for type float", v.Name))
+ }
+ return nil
+}
+
+func validateString(x reflect.Value, v Constraint) error {
+ s := x.String()
+ switch v.Name {
+ case Empty:
+ if len(s) == 0 {
+ return checkEmpty(x, v)
+ }
+ case Pattern:
+ reg, err := regexp.Compile(v.Rule.(string))
+ if err != nil {
+ return createError(x, v, err.Error())
+ }
+ if !reg.MatchString(s) {
+ return createError(x, v, fmt.Sprintf("value doesn't match pattern %v", v.Rule))
+ }
+ case MaxLength:
+ if _, ok := v.Rule.(int); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ if len(s) > v.Rule.(int) {
+ return createError(x, v, fmt.Sprintf("value length must be less than or equal to %v", v.Rule))
+ }
+ case MinLength:
+ if _, ok := v.Rule.(int); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be integer value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ if len(s) < v.Rule.(int) {
+ return createError(x, v, fmt.Sprintf("value length must be greater than or equal to %v", v.Rule))
+ }
+ case ReadOnly:
+ if len(s) > 0 {
+ return createError(reflect.ValueOf(s), v, "readonly parameter; must send as nil or empty in request")
+ }
+ default:
+ return createError(x, v, fmt.Sprintf("constraint %s is not applicable to string type", v.Name))
+ }
+
+ if v.Chain != nil {
+ return Validate([]Validation{
+ {
+ TargetValue: getInterfaceValue(x),
+ Constraints: v.Chain,
+ },
+ })
+ }
+ return nil
+}
+
+func validateArrayMap(x reflect.Value, v Constraint) error {
+ switch v.Name {
+ case Null:
+ if x.IsNil() {
+ return checkNil(x, v)
+ }
+ case Empty:
+ if x.IsNil() || x.Len() == 0 {
+ return checkEmpty(x, v)
+ }
+ case MaxItems:
+ if _, ok := v.Rule.(int); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be integer for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ if x.Len() > v.Rule.(int) {
+ return createError(x, v, fmt.Sprintf("maximum item limit is %v; got: %v", v.Rule, x.Len()))
+ }
+ case MinItems:
+ if _, ok := v.Rule.(int); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be integer for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ if x.Len() < v.Rule.(int) {
+ return createError(x, v, fmt.Sprintf("minimum item limit is %v; got: %v", v.Rule, x.Len()))
+ }
+ case UniqueItems:
+ if x.Kind() == reflect.Array || x.Kind() == reflect.Slice {
+ if !checkForUniqueInArray(x) {
+ return createError(x, v, fmt.Sprintf("all items in parameter %q must be unique; got:%v", v.Target, x))
+ }
+ } else if x.Kind() == reflect.Map {
+ if !checkForUniqueInMap(x) {
+ return createError(x, v, fmt.Sprintf("all items in parameter %q must be unique; got:%v", v.Target, x))
+ }
+ } else {
+ return createError(x, v, fmt.Sprintf("type must be array, slice or map for constraint %v; got: %v", v.Name, x.Kind()))
+ }
+ case ReadOnly:
+ if x.Len() != 0 {
+ return createError(x, v, "readonly parameter; must send as nil or empty in request")
+ }
+ case Pattern:
+ reg, err := regexp.Compile(v.Rule.(string))
+ if err != nil {
+ return createError(x, v, err.Error())
+ }
+ keys := x.MapKeys()
+ for _, k := range keys {
+ if !reg.MatchString(k.String()) {
+ return createError(k, v, fmt.Sprintf("map key doesn't match pattern %v", v.Rule))
+ }
+ }
+ default:
+ return createError(x, v, fmt.Sprintf("constraint %v is not applicable to array, slice and map type", v.Name))
+ }
+
+ if v.Chain != nil {
+ return Validate([]Validation{
+ {
+ TargetValue: getInterfaceValue(x),
+ Constraints: v.Chain,
+ },
+ })
+ }
+ return nil
+}
+
+func checkNil(x reflect.Value, v Constraint) error {
+ if _, ok := v.Rule.(bool); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be bool value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+ if v.Rule.(bool) {
+ return createError(x, v, "value can not be null; required parameter")
+ }
+ return nil
+}
+
+func checkEmpty(x reflect.Value, v Constraint) error {
+ if _, ok := v.Rule.(bool); !ok {
+ return createError(x, v, fmt.Sprintf("rule must be bool value for %v constraint; got: %v", v.Name, v.Rule))
+ }
+
+ if v.Rule.(bool) {
+ return createError(x, v, "value can not be null or empty; required parameter")
+ }
+ return nil
+}
+
+func checkForUniqueInArray(x reflect.Value) bool {
+ if x == reflect.Zero(reflect.TypeOf(x)) || x.Len() == 0 {
+ return false
+ }
+ arrOfInterface := make([]interface{}, x.Len())
+
+ for i := 0; i < x.Len(); i++ {
+ arrOfInterface[i] = x.Index(i).Interface()
+ }
+
+ m := make(map[interface{}]bool)
+ for _, val := range arrOfInterface {
+ if m[val] {
+ return false
+ }
+ m[val] = true
+ }
+ return true
+}
+
+func checkForUniqueInMap(x reflect.Value) bool {
+ if x == reflect.Zero(reflect.TypeOf(x)) || x.Len() == 0 {
+ return false
+ }
+ mapOfInterface := make(map[interface{}]interface{}, x.Len())
+
+ keys := x.MapKeys()
+ for _, k := range keys {
+ mapOfInterface[k.Interface()] = x.MapIndex(k).Interface()
+ }
+
+ m := make(map[interface{}]bool)
+ for _, val := range mapOfInterface {
+ if m[val] {
+ return false
+ }
+ m[val] = true
+ }
+ return true
+}
+
+func getInterfaceValue(x reflect.Value) interface{} {
+ if x.Kind() == reflect.Invalid {
+ return nil
+ }
+ return x.Interface()
+}
+
+func isZero(x interface{}) bool {
+ return x == reflect.Zero(reflect.TypeOf(x)).Interface()
+}
+
+func createError(x reflect.Value, v Constraint, err string) error {
+ return fmt.Errorf("autorest/validation: validation failed: parameter=%s constraint=%s value=%#v details: %s",
+ v.Target, v.Name, getInterfaceValue(x), err)
+}
+
+func toInt64(v interface{}) (int64, bool) {
+ if i64, ok := v.(int64); ok {
+ return i64, true
+ }
+ // older generators emit max constants as int, so if int64 fails fall back to int
+ if i32, ok := v.(int); ok {
+ return int64(i32), true
+ }
+ return 0, false
+}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go
index 4ad7754ad..c44651696 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/version.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/version.go
@@ -14,7 +14,28 @@ package autorest
// See the License for the specific language governing permissions and
// limitations under the License.
+import (
+ "fmt"
+ "runtime"
+)
+
+const number = "v12.4.1"
+
+var (
+ userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
+ runtime.Version(),
+ runtime.GOARCH,
+ runtime.GOOS,
+ number,
+ )
+)
+
+// UserAgent returns a string containing the Go version, system architecture and OS, and the go-autorest version.
+func UserAgent() string {
+ return userAgent
+}
+
// Version returns the semantic version (see http://semver.org).
func Version() string {
- return "v10.5.0"
+ return number
}
diff --git a/vendor/github.com/Azure/go-autorest/logger/logger.go b/vendor/github.com/Azure/go-autorest/logger/logger.go
new file mode 100644
index 000000000..da09f394c
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/logger/logger.go
@@ -0,0 +1,328 @@
+package logger
+
+// Copyright 2017 Microsoft Corporation
+//
+// 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.
+
+import (
+ "bytes"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "net/url"
+ "os"
+ "strings"
+ "sync"
+ "time"
+)
+
+// LevelType tells a logger the minimum level to log. When code reports a log entry,
+// the LogLevel indicates the level of the log entry. The logger only records entries
+// whose level is at least the level it was told to log. See the Log* constants.
+// For example, if a logger is configured with LogError, then LogError, LogPanic,
+// and LogFatal entries will be logged; lower level entries are ignored.
+type LevelType uint32
+
+const (
+ // LogNone tells a logger not to log any entries passed to it.
+ LogNone LevelType = iota
+
+ // LogFatal tells a logger to log all LogFatal entries passed to it.
+ LogFatal
+
+ // LogPanic tells a logger to log all LogPanic and LogFatal entries passed to it.
+ LogPanic
+
+ // LogError tells a logger to log all LogError, LogPanic and LogFatal entries passed to it.
+ LogError
+
+ // LogWarning tells a logger to log all LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogWarning
+
+ // LogInfo tells a logger to log all LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogInfo
+
+ // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
+ LogDebug
+)
+
+const (
+ logNone = "NONE"
+ logFatal = "FATAL"
+ logPanic = "PANIC"
+ logError = "ERROR"
+ logWarning = "WARNING"
+ logInfo = "INFO"
+ logDebug = "DEBUG"
+ logUnknown = "UNKNOWN"
+)
+
+// ParseLevel converts the specified string into the corresponding LevelType.
+func ParseLevel(s string) (lt LevelType, err error) {
+ switch strings.ToUpper(s) {
+ case logFatal:
+ lt = LogFatal
+ case logPanic:
+ lt = LogPanic
+ case logError:
+ lt = LogError
+ case logWarning:
+ lt = LogWarning
+ case logInfo:
+ lt = LogInfo
+ case logDebug:
+ lt = LogDebug
+ default:
+ err = fmt.Errorf("bad log level '%s'", s)
+ }
+ return
+}
+
+// String implements the stringer interface for LevelType.
+func (lt LevelType) String() string {
+ switch lt {
+ case LogNone:
+ return logNone
+ case LogFatal:
+ return logFatal
+ case LogPanic:
+ return logPanic
+ case LogError:
+ return logError
+ case LogWarning:
+ return logWarning
+ case LogInfo:
+ return logInfo
+ case LogDebug:
+ return logDebug
+ default:
+ return logUnknown
+ }
+}
+
+// Filter defines functions for filtering HTTP request/response content.
+type Filter struct {
+ // URL returns a potentially modified string representation of a request URL.
+ URL func(u *url.URL) string
+
+ // Header returns a potentially modified set of values for the specified key.
+ // To completely exclude the header key/values return false.
+ Header func(key string, val []string) (bool, []string)
+
+ // Body returns a potentially modified request/response body.
+ Body func(b []byte) []byte
+}
+
+func (f Filter) processURL(u *url.URL) string {
+ if f.URL == nil {
+ return u.String()
+ }
+ return f.URL(u)
+}
+
+func (f Filter) processHeader(k string, val []string) (bool, []string) {
+ if f.Header == nil {
+ return true, val
+ }
+ return f.Header(k, val)
+}
+
+func (f Filter) processBody(b []byte) []byte {
+ if f.Body == nil {
+ return b
+ }
+ return f.Body(b)
+}
+
+// Writer defines methods for writing to a logging facility.
+type Writer interface {
+ // Writeln writes the specified message with the standard log entry header and new-line character.
+ Writeln(level LevelType, message string)
+
+ // Writef writes the specified format specifier with the standard log entry header and no new-line character.
+ Writef(level LevelType, format string, a ...interface{})
+
+ // WriteRequest writes the specified HTTP request to the logger if the log level is greater than
+ // or equal to LogInfo. The request body, if set, is logged at level LogDebug or higher.
+ // Custom filters can be specified to exclude URL, header, and/or body content from the log.
+ // By default no request content is excluded.
+ WriteRequest(req *http.Request, filter Filter)
+
+ // WriteResponse writes the specified HTTP response to the logger if the log level is greater than
+ // or equal to LogInfo. The response body, if set, is logged at level LogDebug or higher.
+ // Custom filters can be specified to exclude URL, header, and/or body content from the log.
+ // By default no response content is excluded.
+ WriteResponse(resp *http.Response, filter Filter)
+}
+
+// Instance is the default log writer initialized during package init.
+// This can be replaced with a custom implementation as required.
+var Instance Writer
+
+// default log level
+var logLevel = LogNone
+
+// Level returns the value specified in AZURE_GO_AUTOREST_LOG_LEVEL.
+// If no value was specified the default value is LogNone.
+// Custom loggers can call this to retrieve the configured log level.
+func Level() LevelType {
+ return logLevel
+}
+
+func init() {
+ // separated for testing purposes
+ initDefaultLogger()
+}
+
+func initDefaultLogger() {
+ // init with nilLogger so callers don't have to do a nil check on Default
+ Instance = nilLogger{}
+ llStr := strings.ToLower(os.Getenv("AZURE_GO_SDK_LOG_LEVEL"))
+ if llStr == "" {
+ return
+ }
+ var err error
+ logLevel, err = ParseLevel(llStr)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "go-autorest: failed to parse log level: %s\n", err.Error())
+ return
+ }
+ if logLevel == LogNone {
+ return
+ }
+ // default to stderr
+ dest := os.Stderr
+ lfStr := os.Getenv("AZURE_GO_SDK_LOG_FILE")
+ if strings.EqualFold(lfStr, "stdout") {
+ dest = os.Stdout
+ } else if lfStr != "" {
+ lf, err := os.Create(lfStr)
+ if err == nil {
+ dest = lf
+ } else {
+ fmt.Fprintf(os.Stderr, "go-autorest: failed to create log file, using stderr: %s\n", err.Error())
+ }
+ }
+ Instance = fileLogger{
+ logLevel: logLevel,
+ mu: &sync.Mutex{},
+ logFile: dest,
+ }
+}
+
+// the nil logger does nothing
+type nilLogger struct{}
+
+func (nilLogger) Writeln(LevelType, string) {}
+
+func (nilLogger) Writef(LevelType, string, ...interface{}) {}
+
+func (nilLogger) WriteRequest(*http.Request, Filter) {}
+
+func (nilLogger) WriteResponse(*http.Response, Filter) {}
+
+// A File is used instead of a Logger so the stream can be flushed after every write.
+type fileLogger struct {
+ logLevel LevelType
+ mu *sync.Mutex // for synchronizing writes to logFile
+ logFile *os.File
+}
+
+func (fl fileLogger) Writeln(level LevelType, message string) {
+ fl.Writef(level, "%s\n", message)
+}
+
+func (fl fileLogger) Writef(level LevelType, format string, a ...interface{}) {
+ if fl.logLevel >= level {
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprintf(fl.logFile, "%s %s", entryHeader(level), fmt.Sprintf(format, a...))
+ fl.logFile.Sync()
+ }
+}
+
+func (fl fileLogger) WriteRequest(req *http.Request, filter Filter) {
+ if req == nil || fl.logLevel < LogInfo {
+ return
+ }
+ b := &bytes.Buffer{}
+ fmt.Fprintf(b, "%s REQUEST: %s %s\n", entryHeader(LogInfo), req.Method, filter.processURL(req.URL))
+ // dump headers
+ for k, v := range req.Header {
+ if ok, mv := filter.processHeader(k, v); ok {
+ fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
+ }
+ }
+ if fl.shouldLogBody(req.Header, req.Body) {
+ // dump body
+ body, err := ioutil.ReadAll(req.Body)
+ if err == nil {
+ fmt.Fprintln(b, string(filter.processBody(body)))
+ if nc, ok := req.Body.(io.Seeker); ok {
+ // rewind to the beginning
+ nc.Seek(0, io.SeekStart)
+ } else {
+ // recreate the body
+ req.Body = ioutil.NopCloser(bytes.NewReader(body))
+ }
+ } else {
+ fmt.Fprintf(b, "failed to read body: %v\n", err)
+ }
+ }
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprint(fl.logFile, b.String())
+ fl.logFile.Sync()
+}
+
+func (fl fileLogger) WriteResponse(resp *http.Response, filter Filter) {
+ if resp == nil || fl.logLevel < LogInfo {
+ return
+ }
+ b := &bytes.Buffer{}
+ fmt.Fprintf(b, "%s RESPONSE: %d %s\n", entryHeader(LogInfo), resp.StatusCode, filter.processURL(resp.Request.URL))
+ // dump headers
+ for k, v := range resp.Header {
+ if ok, mv := filter.processHeader(k, v); ok {
+ fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
+ }
+ }
+ if fl.shouldLogBody(resp.Header, resp.Body) {
+ // dump body
+ defer resp.Body.Close()
+ body, err := ioutil.ReadAll(resp.Body)
+ if err == nil {
+ fmt.Fprintln(b, string(filter.processBody(body)))
+ resp.Body = ioutil.NopCloser(bytes.NewReader(body))
+ } else {
+ fmt.Fprintf(b, "failed to read body: %v\n", err)
+ }
+ }
+ fl.mu.Lock()
+ defer fl.mu.Unlock()
+ fmt.Fprint(fl.logFile, b.String())
+ fl.logFile.Sync()
+}
+
+// returns true if the provided body should be included in the log
+func (fl fileLogger) shouldLogBody(header http.Header, body io.ReadCloser) bool {
+ ct := header.Get("Content-Type")
+ return fl.logLevel >= LogDebug && body != nil && !strings.Contains(ct, "application/octet-stream")
+}
+
+// creates standard header for log entries, it contains a timestamp and the log level
+func entryHeader(level LevelType) string {
+ // this format provides a fixed number of digits so the size of the timestamp is constant
+ return fmt.Sprintf("(%s) %s:", time.Now().Format("2006-01-02T15:04:05.0000000Z07:00"), level.String())
+}
diff --git a/vendor/github.com/Azure/go-autorest/tracing/tracing.go b/vendor/github.com/Azure/go-autorest/tracing/tracing.go
new file mode 100644
index 000000000..28951c284
--- /dev/null
+++ b/vendor/github.com/Azure/go-autorest/tracing/tracing.go
@@ -0,0 +1,195 @@
+package tracing
+
+// Copyright 2018 Microsoft Corporation
+//
+// 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.
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "os"
+
+ "contrib.go.opencensus.io/exporter/ocagent"
+ "go.opencensus.io/plugin/ochttp"
+ "go.opencensus.io/plugin/ochttp/propagation/tracecontext"
+ "go.opencensus.io/stats/view"
+ "go.opencensus.io/trace"
+)
+
+var (
+ // Transport is the default tracing RoundTripper. The custom options setter will control
+ // if traces are being emitted or not.
+ Transport = NewTransport()
+
+ // enabled is the flag for marking if tracing is enabled.
+ enabled = false
+
+ // Sampler is the tracing sampler. If tracing is disabled it will never sample. Otherwise
+ // it will be using the parent sampler or the default.
+ sampler = trace.NeverSample()
+
+ // Views for metric instrumentation.
+ views = map[string]*view.View{}
+
+ // the trace exporter
+ traceExporter trace.Exporter
+)
+
+func init() {
+ enableFromEnv()
+}
+
+func enableFromEnv() {
+ _, ok := os.LookupEnv("AZURE_SDK_TRACING_ENABLED")
+ _, legacyOk := os.LookupEnv("AZURE_SDK_TRACING_ENABELD")
+ if ok || legacyOk {
+ agentEndpoint, ok := os.LookupEnv("OCAGENT_TRACE_EXPORTER_ENDPOINT")
+
+ if ok {
+ EnableWithAIForwarding(agentEndpoint)
+ } else {
+ Enable()
+ }
+ }
+}
+
+// NewTransport returns a new instance of a tracing-aware RoundTripper.
+func NewTransport() *ochttp.Transport {
+ return &ochttp.Transport{
+ Propagation: &tracecontext.HTTPFormat{},
+ GetStartOptions: getStartOptions,
+ }
+}
+
+// IsEnabled returns true if monitoring is enabled for the sdk.
+func IsEnabled() bool {
+ return enabled
+}
+
+// Enable will start instrumentation for metrics and traces.
+func Enable() error {
+ enabled = true
+ sampler = nil
+
+ err := initStats()
+ return err
+}
+
+// Disable will disable instrumentation for metrics and traces.
+func Disable() {
+ disableStats()
+ sampler = trace.NeverSample()
+ if traceExporter != nil {
+ trace.UnregisterExporter(traceExporter)
+ }
+ enabled = false
+}
+
+// EnableWithAIForwarding will start instrumentation and will connect to app insights forwarder
+// exporter making the metrics and traces available in app insights.
+func EnableWithAIForwarding(agentEndpoint string) (err error) {
+ err = Enable()
+ if err != nil {
+ return err
+ }
+
+ traceExporter, err := ocagent.NewExporter(ocagent.WithInsecure(), ocagent.WithAddress(agentEndpoint))
+ if err != nil {
+ return err
+ }
+ trace.RegisterExporter(traceExporter)
+ return
+}
+
+// getStartOptions is the custom options setter for the ochttp package.
+func getStartOptions(*http.Request) trace.StartOptions {
+ return trace.StartOptions{
+ Sampler: sampler,
+ }
+}
+
+// initStats registers the views for the http metrics
+func initStats() (err error) {
+ clientViews := []*view.View{
+ ochttp.ClientCompletedCount,
+ ochttp.ClientRoundtripLatencyDistribution,
+ ochttp.ClientReceivedBytesDistribution,
+ ochttp.ClientSentBytesDistribution,
+ }
+ for _, cv := range clientViews {
+ vn := fmt.Sprintf("Azure/go-autorest/tracing-%s", cv.Name)
+ views[vn] = cv.WithName(vn)
+ err = view.Register(views[vn])
+ if err != nil {
+ return err
+ }
+ }
+ return
+}
+
+// disableStats will unregister the previously registered metrics
+func disableStats() {
+ for _, v := range views {
+ view.Unregister(v)
+ }
+}
+
+// StartSpan starts a trace span
+func StartSpan(ctx context.Context, name string) context.Context {
+ ctx, _ = trace.StartSpan(ctx, name, trace.WithSampler(sampler))
+ return ctx
+}
+
+// EndSpan ends a previously started span stored in the context
+func EndSpan(ctx context.Context, httpStatusCode int, err error) {
+ span := trace.FromContext(ctx)
+
+ if span == nil {
+ return
+ }
+
+ if err != nil {
+ span.SetStatus(trace.Status{Message: err.Error(), Code: toTraceStatusCode(httpStatusCode)})
+ }
+ span.End()
+}
+
+// toTraceStatusCode converts HTTP Codes to OpenCensus codes as defined
+// at https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md#status
+func toTraceStatusCode(httpStatusCode int) int32 {
+ switch {
+ case http.StatusOK <= httpStatusCode && httpStatusCode < http.StatusBadRequest:
+ return trace.StatusCodeOK
+ case httpStatusCode == http.StatusBadRequest:
+ return trace.StatusCodeInvalidArgument
+ case httpStatusCode == http.StatusUnauthorized: // 401 is actually unauthenticated.
+ return trace.StatusCodeUnauthenticated
+ case httpStatusCode == http.StatusForbidden:
+ return trace.StatusCodePermissionDenied
+ case httpStatusCode == http.StatusNotFound:
+ return trace.StatusCodeNotFound
+ case httpStatusCode == http.StatusTooManyRequests:
+ return trace.StatusCodeResourceExhausted
+ case httpStatusCode == 499:
+ return trace.StatusCodeCancelled
+ case httpStatusCode == http.StatusNotImplemented:
+ return trace.StatusCodeUnimplemented
+ case httpStatusCode == http.StatusServiceUnavailable:
+ return trace.StatusCodeUnavailable
+ case httpStatusCode == http.StatusGatewayTimeout:
+ return trace.StatusCodeDeadlineExceeded
+ default:
+ return trace.StatusCodeUnknown
+ }
+}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/account_info.go b/vendor/github.com/JamesClonk/vultr/lib/account_info.go
deleted file mode 100644
index f994f9242..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/account_info.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package lib
-
-import (
- "encoding/json"
- "fmt"
- "strconv"
-)
-
-// AccountInfo of Vultr account
-type AccountInfo struct {
- Balance float64 `json:"balance"`
- PendingCharges float64 `json:"pending_charges"`
- LastPaymentDate string `json:"last_payment_date"`
- LastPaymentAmount float64 `json:"last_payment_amount"`
-}
-
-// GetAccountInfo retrieves the Vultr account information about current balance, pending charges, etc..
-func (c *Client) GetAccountInfo() (info AccountInfo, err error) {
- if err := c.get(`account/info`, &info); err != nil {
- return AccountInfo{}, err
- }
- return
-}
-
-// UnmarshalJSON implements json.Unmarshaller on AccountInfo.
-// This is needed because the Vultr API is inconsistent in it's JSON responses for account info.
-// Some fields can change type, from JSON number to JSON string and vice-versa.
-func (a *AccountInfo) UnmarshalJSON(data []byte) (err error) {
- if a == nil {
- *a = AccountInfo{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- value := fmt.Sprintf("%v", fields["balance"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- b, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- a.Balance = b
-
- value = fmt.Sprintf("%v", fields["pending_charges"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- pc, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- a.PendingCharges = pc
-
- value = fmt.Sprintf("%v", fields["last_payment_amount"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- lpa, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- a.LastPaymentAmount = lpa
-
- a.LastPaymentDate = fmt.Sprintf("%v", fields["last_payment_date"])
-
- return
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/applications.go b/vendor/github.com/JamesClonk/vultr/lib/applications.go
deleted file mode 100644
index f44d8c81e..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/applications.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package lib
-
-import (
- "sort"
- "strings"
-)
-
-// Application on Vultr
-type Application struct {
- ID string `json:"APPID"`
- Name string `json:"name"`
- ShortName string `json:"short_name"`
- DeployName string `json:"deploy_name"`
- Surcharge float64 `json:"surcharge"`
-}
-
-type applications []Application
-
-func (s applications) Len() int { return len(s) }
-func (s applications) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s applications) Less(i, j int) bool {
- return strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name)
-}
-
-// GetApplications returns a list of all available applications on Vultr
-func (c *Client) GetApplications() ([]Application, error) {
- var appMap map[string]Application
- if err := c.get(`app/list`, &appMap); err != nil {
- return nil, err
- }
-
- var appList []Application
- for _, app := range appMap {
- appList = append(appList, app)
- }
- sort.Sort(applications(appList))
- return appList, nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/block_storage.go b/vendor/github.com/JamesClonk/vultr/lib/block_storage.go
deleted file mode 100644
index e9e8e115d..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/block_storage.go
+++ /dev/null
@@ -1,210 +0,0 @@
-package lib
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "sort"
- "strconv"
- "strings"
-)
-
-// BlockStorage on Vultr account
-type BlockStorage struct {
- ID string `json:"SUBID,string"`
- Name string `json:"label"`
- RegionID int `json:"DCID,string"`
- SizeGB int `json:"size_gb,string"`
- Created string `json:"date_created"`
- Cost string `json:"cost_per_month"`
- Status string `json:"status"`
- AttachedTo string `json:"attached_to_SUBID"`
-}
-
-type blockstorages []BlockStorage
-
-func (b blockstorages) Len() int { return len(b) }
-func (b blockstorages) Swap(i, j int) { b[i], b[j] = b[j], b[i] }
-func (b blockstorages) Less(i, j int) bool {
- // sort order: name, size, status
- if strings.ToLower(b[i].Name) < strings.ToLower(b[j].Name) {
- return true
- } else if strings.ToLower(b[i].Name) > strings.ToLower(b[j].Name) {
- return false
- }
- if b[i].SizeGB < b[j].SizeGB {
- return true
- } else if b[i].SizeGB > b[j].SizeGB {
- return false
- }
- return b[i].Status < b[j].Status
-}
-
-// UnmarshalJSON implements json.Unmarshaller on BlockStorage.
-// This is needed because the Vultr API is inconsistent in it's JSON responses.
-// Some fields can change type, from JSON number to JSON string and vice-versa.
-func (b *BlockStorage) UnmarshalJSON(data []byte) (err error) {
- if b == nil {
- *b = BlockStorage{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- value := fmt.Sprintf("%v", fields["SUBID"])
- if len(value) == 0 || value == "" || value == "0" {
- b.ID = ""
- } else {
- id, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- b.ID = strconv.FormatFloat(id, 'f', -1, 64)
- }
-
- value = fmt.Sprintf("%v", fields["DCID"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- region, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- b.RegionID = int(region)
-
- value = fmt.Sprintf("%v", fields["size_gb"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- size, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- b.SizeGB = int(size)
-
- value = fmt.Sprintf("%v", fields["attached_to_SUBID"])
- if len(value) == 0 || value == "" || value == "0" {
- b.AttachedTo = ""
- } else {
- attached, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- b.AttachedTo = strconv.FormatFloat(attached, 'f', -1, 64)
- }
-
- b.Name = fmt.Sprintf("%v", fields["label"])
- b.Created = fmt.Sprintf("%v", fields["date_created"])
- b.Status = fmt.Sprintf("%v", fields["status"])
- b.Cost = fmt.Sprintf("%v", fields["cost_per_month"])
-
- return
-}
-
-// GetBlockStorages returns a list of all active block storages on Vultr account
-func (c *Client) GetBlockStorages() (storages []BlockStorage, err error) {
- if err := c.get(`block/list`, &storages); err != nil {
- return nil, err
- }
- sort.Sort(blockstorages(storages))
- return storages, nil
-}
-
-// GetBlockStorage returns block storage with given ID
-func (c *Client) GetBlockStorage(id string) (BlockStorage, error) {
- storages, err := c.GetBlockStorages()
- if err != nil {
- return BlockStorage{}, err
- }
-
- for _, s := range storages {
- if s.ID == id {
- return s, nil
- }
- }
- return BlockStorage{}, fmt.Errorf("BlockStorage with ID %v not found", id)
-}
-
-// CreateBlockStorage creates a new block storage on Vultr account
-func (c *Client) CreateBlockStorage(name string, regionID, size int) (BlockStorage, error) {
- values := url.Values{
- "label": {name},
- "DCID": {fmt.Sprintf("%v", regionID)},
- "size_gb": {fmt.Sprintf("%v", size)},
- }
-
- var storage BlockStorage
- if err := c.post(`block/create`, values, &storage); err != nil {
- return BlockStorage{}, err
- }
- storage.RegionID = regionID
- storage.Name = name
- storage.SizeGB = size
-
- return storage, nil
-}
-
-// ResizeBlockStorage resizes an existing block storage
-func (c *Client) ResizeBlockStorage(id string, size int) error {
- values := url.Values{
- "SUBID": {id},
- "size_gb": {fmt.Sprintf("%v", size)},
- }
-
- if err := c.post(`block/resize`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// LabelBlockStorage changes the label on an existing block storage
-func (c *Client) LabelBlockStorage(id, name string) error {
- values := url.Values{
- "SUBID": {id},
- "label": {name},
- }
-
- if err := c.post(`block/label_set`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// AttachBlockStorage attaches block storage to an existing virtual machine
-func (c *Client) AttachBlockStorage(id, serverID string) error {
- values := url.Values{
- "SUBID": {id},
- "attach_to_SUBID": {serverID},
- }
-
- if err := c.post(`block/attach`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DetachBlockStorage detaches block storage from virtual machine
-func (c *Client) DetachBlockStorage(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`block/detach`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteBlockStorage deletes an existing block storage
-func (c *Client) DeleteBlockStorage(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`block/delete`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/client.go b/vendor/github.com/JamesClonk/vultr/lib/client.go
deleted file mode 100644
index 0f805a10c..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/client.go
+++ /dev/null
@@ -1,249 +0,0 @@
-package lib
-
-import (
- "bytes"
- "crypto/tls"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "math/rand"
- "net/http"
- "net/url"
- "strings"
- "time"
-
- "github.com/juju/ratelimit"
-)
-
-const (
- // Version of this libary
- Version = "1.13.0"
-
- // APIVersion of Vultr
- APIVersion = "v1"
-
- // DefaultEndpoint to be used
- DefaultEndpoint = "https://api.vultr.com/"
-
- mediaType = "application/json"
-)
-
-// retryableStatusCodes are API response status codes that indicate that
-// the failed request can be retried without further actions.
-var retryableStatusCodes = map[int]struct{}{
- 503: {}, // Rate limit hit
- 500: {}, // Internal server error. Try again at a later time.
-}
-
-// Client represents the Vultr API client
-type Client struct {
- // HTTP client for communication with the Vultr API
- client *http.Client
-
- // User agent for HTTP client
- UserAgent string
-
- // Endpoint URL for API requests
- Endpoint *url.URL
-
- // API key for accessing the Vultr API
- APIKey string
-
- // Max. number of request attempts
- MaxAttempts int
-
- // Throttling struct
- bucket *ratelimit.Bucket
-}
-
-// Options represents optional settings and flags that can be passed to NewClient
-type Options struct {
- // HTTP client for communication with the Vultr API
- HTTPClient *http.Client
-
- // User agent for HTTP client
- UserAgent string
-
- // Endpoint URL for API requests
- Endpoint string
-
- // API rate limitation, calls per duration
- RateLimitation time.Duration
-
- // Max. number of times to retry API calls
- MaxRetries int
-}
-
-// NewClient creates new Vultr API client. Options are optional and can be nil.
-func NewClient(apiKey string, options *Options) *Client {
- userAgent := "vultr-go/" + Version
- transport := &http.Transport{
- TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper),
- }
- client := http.DefaultClient
- client.Transport = transport
- endpoint, _ := url.Parse(DefaultEndpoint)
- rate := 505 * time.Millisecond
- attempts := 1
-
- if options != nil {
- if options.HTTPClient != nil {
- client = options.HTTPClient
- }
- if options.UserAgent != "" {
- userAgent = options.UserAgent
- }
- if options.Endpoint != "" {
- endpoint, _ = url.Parse(options.Endpoint)
- }
- if options.RateLimitation != 0 {
- rate = options.RateLimitation
- }
- if options.MaxRetries != 0 {
- attempts = options.MaxRetries + 1
- }
- }
-
- return &Client{
- UserAgent: userAgent,
- client: client,
- Endpoint: endpoint,
- APIKey: apiKey,
- MaxAttempts: attempts,
- bucket: ratelimit.NewBucket(rate, 1),
- }
-}
-
-func apiPath(path string) string {
- return fmt.Sprintf("/%s/%s", APIVersion, path)
-}
-
-func apiKeyPath(path, apiKey string) string {
- if strings.Contains(path, "?") {
- return path + "&api_key=" + apiKey
- }
- return path + "?api_key=" + apiKey
-}
-
-func (c *Client) get(path string, data interface{}) error {
- req, err := c.newRequest("GET", apiPath(path), nil)
- if err != nil {
- return err
- }
- return c.do(req, data)
-}
-
-func (c *Client) post(path string, values url.Values, data interface{}) error {
- req, err := c.newRequest("POST", apiPath(path), strings.NewReader(values.Encode()))
- if err != nil {
- return err
- }
- return c.do(req, data)
-}
-
-func (c *Client) newRequest(method string, path string, body io.Reader) (*http.Request, error) {
- relPath, err := url.Parse(apiKeyPath(path, c.APIKey))
- if err != nil {
- return nil, err
- }
-
- url := c.Endpoint.ResolveReference(relPath)
-
- req, err := http.NewRequest(method, url.String(), body)
- if err != nil {
- return nil, err
- }
-
- req.Header.Add("User-Agent", c.UserAgent)
- req.Header.Add("Accept", mediaType)
-
- if req.Method == "POST" {
- req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
- }
- return req, nil
-}
-
-func (c *Client) do(req *http.Request, data interface{}) error {
- // Throttle http requests to avoid hitting Vultr's API rate-limit
- c.bucket.Wait(1)
-
- // Request body gets drained on each read so we
- // need to save it's content for retrying requests
- var err error
- var requestBody []byte
- if req.Body != nil {
- requestBody, err = ioutil.ReadAll(req.Body)
- if err != nil {
- return fmt.Errorf("Error reading request body: %v", err)
- }
- req.Body.Close()
- }
-
- var apiError error
- for tryCount := 1; tryCount <= c.MaxAttempts; tryCount++ {
- // Restore request body to the original state
- if requestBody != nil {
- req.Body = ioutil.NopCloser(bytes.NewBuffer(requestBody))
- }
-
- resp, err := c.client.Do(req)
- if err != nil {
- return err
- }
-
- body, err := ioutil.ReadAll(resp.Body)
- resp.Body.Close()
- if err != nil {
- return err
- }
-
- if resp.StatusCode == http.StatusOK {
- if data != nil {
- // avoid unmarshalling problem because Vultr API returns
- // empty array instead of empty map when it shouldn't!
- if string(body) == `[]` {
- data = nil
- } else {
- if err := json.Unmarshal(body, data); err != nil {
- return err
- }
- }
- }
- return nil
- }
-
- apiError = errors.New(string(body))
- if !isCodeRetryable(resp.StatusCode) {
- break
- }
-
- delay := backoffDuration(tryCount)
- time.Sleep(delay)
- }
-
- return apiError
-}
-
-// backoffDuration returns the duration to wait before retrying the request.
-// Duration is an exponential function of the retry count with a jitter of ~0-30%.
-func backoffDuration(retryCount int) time.Duration {
- // Upper limit of delay at ~1 minute
- if retryCount > 7 {
- retryCount = 7
- }
-
- rand.Seed(time.Now().UnixNano())
- delay := (1 << uint(retryCount)) * (rand.Intn(150) + 500)
- return time.Duration(delay) * time.Millisecond
-}
-
-// isCodeRetryable returns true if the given status code means that we should retry.
-func isCodeRetryable(statusCode int) bool {
- if _, ok := retryableStatusCodes[statusCode]; ok {
- return true
- }
-
- return false
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/dns.go b/vendor/github.com/JamesClonk/vultr/lib/dns.go
deleted file mode 100644
index e66275b68..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/dns.go
+++ /dev/null
@@ -1,150 +0,0 @@
-package lib
-
-import (
- "fmt"
- "net/url"
- "sort"
- "strings"
-)
-
-// DNSDomain represents a DNS domain on Vultr
-type DNSDomain struct {
- Domain string `json:"domain"`
- Created string `json:"date_created"`
-}
-
-type dnsdomains []DNSDomain
-
-func (d dnsdomains) Len() int { return len(d) }
-func (d dnsdomains) Swap(i, j int) { d[i], d[j] = d[j], d[i] }
-func (d dnsdomains) Less(i, j int) bool {
- return strings.ToLower(d[i].Domain) < strings.ToLower(d[j].Domain)
-}
-
-// DNSRecord represents a DNS record on Vultr
-type DNSRecord struct {
- RecordID int `json:"RECORDID"`
- Type string `json:"type"`
- Name string `json:"name"`
- Data string `json:"data"`
- Priority int `json:"priority"`
- TTL int `json:"ttl"`
-}
-
-type dnsrecords []DNSRecord
-
-func (d dnsrecords) Len() int { return len(d) }
-func (d dnsrecords) Swap(i, j int) { d[i], d[j] = d[j], d[i] }
-func (d dnsrecords) Less(i, j int) bool {
- // sort order: type, data, name
- if d[i].Type < d[j].Type {
- return true
- } else if d[i].Type > d[j].Type {
- return false
- }
- if d[i].Data < d[j].Data {
- return true
- } else if d[i].Data > d[j].Data {
- return false
- }
- return strings.ToLower(d[i].Name) < strings.ToLower(d[j].Name)
-}
-
-// GetDNSDomains returns a list of available domains on Vultr account
-func (c *Client) GetDNSDomains() (domains []DNSDomain, err error) {
- if err := c.get(`dns/list`, &domains); err != nil {
- return nil, err
- }
- sort.Sort(dnsdomains(domains))
- return domains, nil
-}
-
-// GetDNSRecords returns a list of all DNS records of a particular domain
-func (c *Client) GetDNSRecords(domain string) (records []DNSRecord, err error) {
- if err := c.get(`dns/records?domain=`+domain, &records); err != nil {
- return nil, err
- }
- sort.Sort(dnsrecords(records))
- return records, nil
-}
-
-// CreateDNSDomain creates a new DNS domain name on Vultr
-func (c *Client) CreateDNSDomain(domain, serverIP string) error {
- values := url.Values{
- "domain": {domain},
- "serverip": {serverIP},
- }
-
- if err := c.post(`dns/create_domain`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteDNSDomain deletes an existing DNS domain name
-func (c *Client) DeleteDNSDomain(domain string) error {
- values := url.Values{
- "domain": {domain},
- }
-
- if err := c.post(`dns/delete_domain`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// CreateDNSRecord creates a new DNS record
-func (c *Client) CreateDNSRecord(domain, name, rtype, data string, priority, ttl int) error {
- values := url.Values{
- "domain": {domain},
- "name": {name},
- "type": {rtype},
- "data": {data},
- "priority": {fmt.Sprintf("%v", priority)},
- "ttl": {fmt.Sprintf("%v", ttl)},
- }
-
- if err := c.post(`dns/create_record`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// UpdateDNSRecord updates an existing DNS record
-func (c *Client) UpdateDNSRecord(domain string, dnsrecord DNSRecord) error {
- values := url.Values{
- "domain": {domain},
- "RECORDID": {fmt.Sprintf("%v", dnsrecord.RecordID)},
- }
-
- if dnsrecord.Name != "" {
- values.Add("name", dnsrecord.Name)
- }
- if dnsrecord.Data != "" {
- values.Add("data", dnsrecord.Data)
- }
- if dnsrecord.Priority != 0 {
- values.Add("priority", fmt.Sprintf("%v", dnsrecord.Priority))
- }
- if dnsrecord.TTL != 0 {
- values.Add("ttl", fmt.Sprintf("%v", dnsrecord.TTL))
- }
-
- if err := c.post(`dns/update_record`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteDNSRecord deletes an existing DNS record
-func (c *Client) DeleteDNSRecord(domain string, recordID int) error {
- values := url.Values{
- "domain": {domain},
- "RECORDID": {fmt.Sprintf("%v", recordID)},
- }
-
- if err := c.post(`dns/delete_record`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/firewall.go b/vendor/github.com/JamesClonk/vultr/lib/firewall.go
deleted file mode 100644
index c9c54e9d5..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/firewall.go
+++ /dev/null
@@ -1,248 +0,0 @@
-package lib
-
-import (
- "encoding/json"
- "fmt"
- "net"
- "net/url"
- "sort"
- "strconv"
- "strings"
-)
-
-// FirewallGroup represents a firewall group on Vultr
-type FirewallGroup struct {
- ID string `json:"FIREWALLGROUPID"`
- Description string `json:"description"`
- Created string `json:"date_created"`
- Modified string `json:"date_modified"`
- InstanceCount int `json:"instance_count"`
- RuleCount int `json:"rule_count"`
- MaxRuleCount int `json:"max_rule_count"`
-}
-
-// FirewallRule represents a firewall rule on Vultr
-type FirewallRule struct {
- RuleNumber int `json:"rulenumber"`
- Action string `json:"action"`
- Protocol string `json:"protocol"`
- Port string `json:"port"`
- Network *net.IPNet
-}
-
-type firewallGroups []FirewallGroup
-
-func (f firewallGroups) Len() int { return len(f) }
-func (f firewallGroups) Swap(i, j int) { f[i], f[j] = f[j], f[i] }
-func (f firewallGroups) Less(i, j int) bool {
- // sort order: description
- return strings.ToLower(f[i].Description) < strings.ToLower(f[j].Description)
-}
-
-type firewallRules []FirewallRule
-
-func (r firewallRules) Len() int { return len(r) }
-func (r firewallRules) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
-func (r firewallRules) Less(i, j int) bool {
- // sort order: rule number
- return r[i].RuleNumber < r[j].RuleNumber
-}
-
-// UnmarshalJSON implements json.Unmarshaller on FirewallRule.
-// This is needed because the Vultr API is inconsistent in it's JSON responses.
-// Some fields can change type, from JSON number to JSON string and vice-versa.
-func (r *FirewallRule) UnmarshalJSON(data []byte) (err error) {
- if r == nil {
- *r = FirewallRule{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- value := fmt.Sprintf("%v", fields["rulenumber"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- number, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- r.RuleNumber = int(number)
-
- value = fmt.Sprintf("%v", fields["subnet_size"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- subnetSize, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
-
- r.Action = fmt.Sprintf("%v", fields["action"])
- r.Protocol = fmt.Sprintf("%v", fields["protocol"])
- r.Port = fmt.Sprintf("%v", fields["port"])
- subnet := fmt.Sprintf("%v", fields["subnet"])
-
- if subnetSize > 0 && len(subnet) > 0 {
- _, r.Network, err = net.ParseCIDR(fmt.Sprintf("%s/%d", subnet, subnetSize))
- if err != nil {
- return fmt.Errorf("Failed to parse subnet from Vultr API")
- }
- } else {
- _, r.Network, _ = net.ParseCIDR("0.0.0.0/0")
- }
-
- return
-}
-
-// GetFirewallGroups returns a list of all available firewall groups on Vultr
-func (c *Client) GetFirewallGroups() ([]FirewallGroup, error) {
- var groupMap map[string]FirewallGroup
- if err := c.get(`firewall/group_list`, &groupMap); err != nil {
- return nil, err
- }
-
- var groupList []FirewallGroup
- for _, g := range groupMap {
- groupList = append(groupList, g)
- }
- sort.Sort(firewallGroups(groupList))
- return groupList, nil
-}
-
-// GetFirewallGroup returns the firewall group with given ID
-func (c *Client) GetFirewallGroup(id string) (FirewallGroup, error) {
- groups, err := c.GetFirewallGroups()
- if err != nil {
- return FirewallGroup{}, err
- }
-
- for _, g := range groups {
- if g.ID == id {
- return g, nil
- }
- }
- return FirewallGroup{}, fmt.Errorf("Firewall group with ID %v not found", id)
-}
-
-// CreateFirewallGroup creates a new firewall group in Vultr account
-func (c *Client) CreateFirewallGroup(description string) (string, error) {
- values := url.Values{}
-
- // Optional description
- if len(description) > 0 {
- values.Add("description", description)
- }
-
- var result FirewallGroup
- err := c.post(`firewall/group_create`, values, &result)
- if err != nil {
- return "", err
- }
- return result.ID, nil
-}
-
-// DeleteFirewallGroup deletes an existing firewall group
-func (c *Client) DeleteFirewallGroup(groupID string) error {
- values := url.Values{
- "FIREWALLGROUPID": {groupID},
- }
-
- if err := c.post(`firewall/group_delete`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// SetFirewallGroupDescription sets the description of an existing firewall group
-func (c *Client) SetFirewallGroupDescription(groupID, description string) error {
- values := url.Values{
- "FIREWALLGROUPID": {groupID},
- "description": {description},
- }
-
- if err := c.post(`firewall/group_set_description`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// GetFirewallRules returns a list of rules for the given firewall group
-func (c *Client) GetFirewallRules(groupID string) ([]FirewallRule, error) {
- var ruleMap map[string]FirewallRule
- ipTypes := []string{"v4", "v6"}
- for _, ipType := range ipTypes {
- args := fmt.Sprintf("direction=in&FIREWALLGROUPID=%s&ip_type=%s",
- groupID, ipType)
- if err := c.get(`firewall/rule_list?`+args, &ruleMap); err != nil {
- return nil, err
- }
- }
-
- var ruleList []FirewallRule
- for _, r := range ruleMap {
- ruleList = append(ruleList, r)
- }
- sort.Sort(firewallRules(ruleList))
- return ruleList, nil
-}
-
-// CreateFirewallRule creates a new firewall rule in Vultr account.
-// groupID is the ID of the firewall group to create the rule in
-// protocol must be one of: "icmp", "tcp", "udp", "gre"
-// port can be a port number or colon separated port range (TCP/UDP only)
-func (c *Client) CreateFirewallRule(groupID, protocol, port string,
- network *net.IPNet) (int, error) {
- ip := network.IP.String()
- maskBits, _ := network.Mask.Size()
- if ip == "" {
- return 0, fmt.Errorf("Invalid network")
- }
-
- var ipType string
- if network.IP.To4() != nil {
- ipType = "v4"
- } else {
- ipType = "v6"
- }
-
- values := url.Values{
- "FIREWALLGROUPID": {groupID},
- // possible values: "in"
- "direction": {"in"},
- // possible values: "icmp", "tcp", "udp", "gre"
- "protocol": {protocol},
- // possible values: "v4", "v6"
- "ip_type": {ipType},
- // IP address representing a subnet
- "subnet": {ip},
- // IP prefix size in bits
- "subnet_size": {fmt.Sprintf("%v", maskBits)},
- }
-
- if len(port) > 0 {
- values.Add("port", port)
- }
-
- var result FirewallRule
- err := c.post(`firewall/rule_create`, values, &result)
- if err != nil {
- return 0, err
- }
- return result.RuleNumber, nil
-}
-
-// DeleteFirewallRule deletes an existing firewall rule
-func (c *Client) DeleteFirewallRule(ruleNumber int, groupID string) error {
- values := url.Values{
- "FIREWALLGROUPID": {groupID},
- "rulenumber": {fmt.Sprintf("%v", ruleNumber)},
- }
-
- if err := c.post(`firewall/rule_delete`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/ip.go b/vendor/github.com/JamesClonk/vultr/lib/ip.go
deleted file mode 100644
index 4d169cb3f..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/ip.go
+++ /dev/null
@@ -1,192 +0,0 @@
-package lib
-
-import (
- "fmt"
- "net/url"
- "sort"
-)
-
-// IPv4 information of a virtual machine
-type IPv4 struct {
- IP string `json:"ip"`
- Netmask string `json:"netmask"`
- Gateway string `json:"gateway"`
- Type string `json:"type"`
- ReverseDNS string `json:"reverse"`
-}
-
-type ipv4s []IPv4
-
-func (s ipv4s) Len() int { return len(s) }
-func (s ipv4s) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s ipv4s) Less(i, j int) bool {
- // sort order: type, ip
- if s[i].Type < s[j].Type {
- return true
- } else if s[i].Type > s[j].Type {
- return false
- }
- return s[i].IP < s[j].IP
-}
-
-// IPv6 information of a virtual machine
-type IPv6 struct {
- IP string `json:"ip"`
- Network string `json:"network"`
- NetworkSize string `json:"network_size"`
- Type string `json:"type"`
-}
-
-type ipv6s []IPv6
-
-func (s ipv6s) Len() int { return len(s) }
-func (s ipv6s) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s ipv6s) Less(i, j int) bool {
- // sort order: type, ip
- if s[i].Type < s[j].Type {
- return true
- } else if s[i].Type > s[j].Type {
- return false
- }
- return s[i].IP < s[j].IP
-}
-
-// ReverseDNSIPv6 information of a virtual machine
-type ReverseDNSIPv6 struct {
- IP string `json:"ip"`
- ReverseDNS string `json:"reverse"`
-}
-
-type reverseDNSIPv6s []ReverseDNSIPv6
-
-func (s reverseDNSIPv6s) Len() int { return len(s) }
-func (s reverseDNSIPv6s) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s reverseDNSIPv6s) Less(i, j int) bool { return s[i].IP < s[j].IP }
-
-// ListIPv4 lists the IPv4 information of a virtual machine
-func (c *Client) ListIPv4(id string) (list []IPv4, err error) {
- var ipMap map[string][]IPv4
- if err := c.get(`server/list_ipv4?SUBID=`+id, &ipMap); err != nil {
- return nil, err
- }
-
- for _, iplist := range ipMap {
- for _, ip := range iplist {
- list = append(list, ip)
- }
- }
- sort.Sort(ipv4s(list))
- return list, nil
-}
-
-// CreateIPv4 creates an IPv4 address and attaches it to a virtual machine
-func (c *Client) CreateIPv4(id string, reboot bool) error {
- values := url.Values{
- "SUBID": {id},
- "reboot": {fmt.Sprintf("%t", reboot)},
- }
-
- if err := c.post(`server/create_ipv4`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteIPv4 deletes an IPv4 address and detaches it from a virtual machine
-func (c *Client) DeleteIPv4(id, ip string) error {
- values := url.Values{
- "SUBID": {id},
- "ip": {ip},
- }
-
- if err := c.post(`server/destroy_ipv4`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// ListIPv6 lists the IPv4 information of a virtual machine
-func (c *Client) ListIPv6(id string) (list []IPv6, err error) {
- var ipMap map[string][]IPv6
- if err := c.get(`server/list_ipv6?SUBID=`+id, &ipMap); err != nil {
- return nil, err
- }
-
- for _, iplist := range ipMap {
- for _, ip := range iplist {
- list = append(list, ip)
- }
- }
- sort.Sort(ipv6s(list))
- return list, nil
-}
-
-// ListIPv6ReverseDNS lists the IPv6 reverse DNS entries of a virtual machine
-func (c *Client) ListIPv6ReverseDNS(id string) (list []ReverseDNSIPv6, err error) {
- var ipMap map[string][]ReverseDNSIPv6
- if err := c.get(`server/reverse_list_ipv6?SUBID=`+id, &ipMap); err != nil {
- return nil, err
- }
-
- for _, iplist := range ipMap {
- for _, ip := range iplist {
- list = append(list, ip)
- }
- }
- sort.Sort(reverseDNSIPv6s(list))
- return list, nil
-}
-
-// DeleteIPv6ReverseDNS removes a reverse DNS entry for an IPv6 address of a virtual machine
-func (c *Client) DeleteIPv6ReverseDNS(id string, ip string) error {
- values := url.Values{
- "SUBID": {id},
- "ip": {ip},
- }
-
- if err := c.post(`server/reverse_delete_ipv6`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// SetIPv6ReverseDNS sets a reverse DNS entry for an IPv6 address of a virtual machine
-func (c *Client) SetIPv6ReverseDNS(id, ip, entry string) error {
- values := url.Values{
- "SUBID": {id},
- "ip": {ip},
- "entry": {entry},
- }
-
- if err := c.post(`server/reverse_set_ipv6`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DefaultIPv4ReverseDNS sets a reverse DNS entry for an IPv4 address of a virtual machine to the original setting
-func (c *Client) DefaultIPv4ReverseDNS(id, ip string) error {
- values := url.Values{
- "SUBID": {id},
- "ip": {ip},
- }
-
- if err := c.post(`server/reverse_default_ipv4`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// SetIPv4ReverseDNS sets a reverse DNS entry for an IPv4 address of a virtual machine
-func (c *Client) SetIPv4ReverseDNS(id, ip, entry string) error {
- values := url.Values{
- "SUBID": {id},
- "ip": {ip},
- "entry": {entry},
- }
-
- if err := c.post(`server/reverse_set_ipv4`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/iso.go b/vendor/github.com/JamesClonk/vultr/lib/iso.go
deleted file mode 100644
index a9e1880e4..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/iso.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package lib
-
-import (
- "sort"
- "strings"
-)
-
-// ISO image on Vultr
-type ISO struct {
- ID int `json:"ISOID"`
- Created string `json:"date_created"`
- Filename string `json:"filename"`
- Size int `json:"size"`
- MD5sum string `json:"md5sum"`
-}
-
-type isos []ISO
-
-func (s isos) Len() int { return len(s) }
-func (s isos) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s isos) Less(i, j int) bool {
- // sort order: filename, created
- if strings.ToLower(s[i].Filename) < strings.ToLower(s[j].Filename) {
- return true
- } else if strings.ToLower(s[i].Filename) > strings.ToLower(s[j].Filename) {
- return false
- }
- return s[i].Created < s[j].Created
-}
-
-// GetISO returns a list of all ISO images on Vultr account
-func (c *Client) GetISO() ([]ISO, error) {
- var isoMap map[string]ISO
- if err := c.get(`iso/list`, &isoMap); err != nil {
- return nil, err
- }
-
- var isoList []ISO
- for _, iso := range isoMap {
- isoList = append(isoList, iso)
- }
- sort.Sort(isos(isoList))
- return isoList, nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/os.go b/vendor/github.com/JamesClonk/vultr/lib/os.go
deleted file mode 100644
index 647d253f8..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/os.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package lib
-
-import (
- "sort"
- "strings"
-)
-
-// OS image on Vultr
-type OS struct {
- ID int `json:"OSID"`
- Name string `json:"name"`
- Arch string `json:"arch"`
- Family string `json:"family"`
- Windows bool `json:"windows"`
- Surcharge string `json:"surcharge"`
-}
-
-type oses []OS
-
-func (s oses) Len() int { return len(s) }
-func (s oses) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s oses) Less(i, j int) bool { return strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name) }
-
-// GetOS returns a list of all available operating systems on Vultr
-func (c *Client) GetOS() ([]OS, error) {
- var osMap map[string]OS
- if err := c.get(`os/list`, &osMap); err != nil {
- return nil, err
- }
-
- var osList []OS
- for _, os := range osMap {
- osList = append(osList, os)
- }
- sort.Sort(oses(osList))
- return osList, nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/plans.go b/vendor/github.com/JamesClonk/vultr/lib/plans.go
deleted file mode 100644
index b3bef4eff..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/plans.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package lib
-
-import (
- "fmt"
- "sort"
- "strconv"
- "strings"
-)
-
-// Plan on Vultr
-type Plan struct {
- ID int `json:"VPSPLANID,string"`
- Name string `json:"name"`
- VCpus int `json:"vcpu_count,string"`
- RAM string `json:"ram"`
- Disk string `json:"disk"`
- Bandwidth string `json:"bandwidth"`
- Price string `json:"price_per_month"`
- Regions []int `json:"available_locations"`
-}
-
-type plans []Plan
-
-func (p plans) Len() int { return len(p) }
-func (p plans) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-func (p plans) Less(i, j int) bool {
- pa, _ := strconv.ParseFloat(strings.TrimSpace(p[i].Price), 64)
- pb, _ := strconv.ParseFloat(strings.TrimSpace(p[j].Price), 64)
- ra, _ := strconv.ParseInt(strings.TrimSpace(p[i].RAM), 10, 64)
- rb, _ := strconv.ParseInt(strings.TrimSpace(p[j].RAM), 10, 64)
- da, _ := strconv.ParseInt(strings.TrimSpace(p[i].Disk), 10, 64)
- db, _ := strconv.ParseInt(strings.TrimSpace(p[j].Disk), 10, 64)
-
- // sort order: price, vcpu, ram, disk
- if pa < pb {
- return true
- } else if pa > pb {
- return false
- }
-
- if p[i].VCpus < p[j].VCpus {
- return true
- } else if p[i].VCpus > p[j].VCpus {
- return false
- }
-
- if ra < rb {
- return true
- } else if ra > rb {
- return false
- }
-
- return da < db
-}
-
-// GetPlans returns a list of all available plans on Vultr account
-func (c *Client) GetPlans() ([]Plan, error) {
- var planMap map[string]Plan
- if err := c.get(`plans/list`, &planMap); err != nil {
- return nil, err
- }
-
- var p plans
- for _, plan := range planMap {
- p = append(p, plan)
- }
-
- sort.Sort(plans(p))
- return p, nil
-}
-
-// GetAvailablePlansForRegion returns available plans for specified region
-func (c *Client) GetAvailablePlansForRegion(id int) (planIDs []int, err error) {
- if err := c.get(fmt.Sprintf(`regions/availability?DCID=%v`, id), &planIDs); err != nil {
- return nil, err
- }
- return
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/regions.go b/vendor/github.com/JamesClonk/vultr/lib/regions.go
deleted file mode 100644
index 70ceb2ede..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/regions.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package lib
-
-import "sort"
-
-// Region on Vultr
-type Region struct {
- ID int `json:"DCID,string"`
- Name string `json:"name"`
- Country string `json:"country"`
- Continent string `json:"continent"`
- State string `json:"state"`
- Ddos bool `json:"ddos_protection"`
- BlockStorage bool `json:"block_storage"`
- Code string `json:"regioncode"`
-}
-
-type regions []Region
-
-func (s regions) Len() int { return len(s) }
-func (s regions) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s regions) Less(i, j int) bool {
- // sort order: continent, name
- if s[i].Continent < s[j].Continent {
- return true
- } else if s[i].Continent > s[j].Continent {
- return false
- }
- return s[i].Name < s[j].Name
-}
-
-// GetRegions returns a list of all available Vultr regions
-func (c *Client) GetRegions() ([]Region, error) {
- var regionMap map[string]Region
- if err := c.get(`regions/list`, ®ionMap); err != nil {
- return nil, err
- }
-
- var regionList []Region
- for _, os := range regionMap {
- regionList = append(regionList, os)
- }
- sort.Sort(regions(regionList))
- return regionList, nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/reservedip.go b/vendor/github.com/JamesClonk/vultr/lib/reservedip.go
deleted file mode 100644
index 22097cf7d..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/reservedip.go
+++ /dev/null
@@ -1,192 +0,0 @@
-package lib
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "sort"
- "strconv"
- "strings"
-)
-
-// IP on Vultr
-type IP struct {
- ID string `json:"SUBID,string"`
- RegionID int `json:"DCID,string"`
- IPType string `json:"ip_type"`
- Subnet string `json:"subnet"`
- SubnetSize int `json:"subnet_size"`
- Label string `json:"label"`
- AttachedTo string `json:"attached_SUBID,string"`
-}
-
-type ips []IP
-
-func (s ips) Len() int { return len(s) }
-func (s ips) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s ips) Less(i, j int) bool {
- // sort order: label, iptype, subnet
- if strings.ToLower(s[i].Label) < strings.ToLower(s[j].Label) {
- return true
- } else if strings.ToLower(s[i].Label) > strings.ToLower(s[j].Label) {
- return false
- }
- if s[i].IPType < s[j].IPType {
- return true
- } else if s[i].IPType > s[j].IPType {
- return false
- }
- return s[i].Subnet < s[j].Subnet
-}
-
-// UnmarshalJSON implements json.Unmarshaller on IP.
-// This is needed because the Vultr API is inconsistent in it's JSON responses.
-// Some fields can change type, from JSON number to JSON string and vice-versa.
-func (i *IP) UnmarshalJSON(data []byte) (err error) {
- if i == nil {
- *i = IP{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- value := fmt.Sprintf("%v", fields["SUBID"])
- if len(value) == 0 || value == "" || value == "0" {
- i.ID = ""
- } else {
- id, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- i.ID = strconv.FormatFloat(id, 'f', -1, 64)
- }
-
- value = fmt.Sprintf("%v", fields["DCID"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- region, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- i.RegionID = int(region)
-
- value = fmt.Sprintf("%v", fields["attached_SUBID"])
- if len(value) == 0 || value == "" || value == "0" || value == "false" {
- i.AttachedTo = ""
- } else {
- attached, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- i.AttachedTo = strconv.FormatFloat(attached, 'f', -1, 64)
- }
-
- value = fmt.Sprintf("%v", fields["subnet_size"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- size, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- i.SubnetSize = int(size)
-
- i.IPType = fmt.Sprintf("%v", fields["ip_type"])
- i.Subnet = fmt.Sprintf("%v", fields["subnet"])
- i.Label = fmt.Sprintf("%v", fields["label"])
-
- return
-}
-
-// ListReservedIP returns a list of all available reserved IPs on Vultr account
-func (c *Client) ListReservedIP() ([]IP, error) {
- var ipMap map[string]IP
-
- err := c.get(`reservedip/list`, &ipMap)
- if err != nil {
- return nil, err
- }
-
- ipList := make([]IP, 0)
- for _, ip := range ipMap {
- ipList = append(ipList, ip)
- }
- sort.Sort(ips(ipList))
- return ipList, nil
-}
-
-// GetReservedIP returns reserved IP with given ID
-func (c *Client) GetReservedIP(id string) (IP, error) {
- var ipMap map[string]IP
-
- err := c.get(`reservedip/list`, &ipMap)
- if err != nil {
- return IP{}, err
- }
- if ip, ok := ipMap[id]; ok {
- return ip, nil
- }
- return IP{}, fmt.Errorf("IP with ID %v not found", id)
-}
-
-// CreateReservedIP creates a new reserved IP on Vultr account
-func (c *Client) CreateReservedIP(regionID int, ipType string, label string) (string, error) {
- values := url.Values{
- "DCID": {fmt.Sprintf("%v", regionID)},
- "ip_type": {ipType},
- }
- if len(label) > 0 {
- values.Add("label", label)
- }
-
- result := IP{}
- err := c.post(`reservedip/create`, values, &result)
- if err != nil {
- return "", err
- }
- return result.ID, nil
-}
-
-// DestroyReservedIP deletes an existing reserved IP
-func (c *Client) DestroyReservedIP(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
- return c.post(`reservedip/destroy`, values, nil)
-}
-
-// AttachReservedIP attaches a reserved IP to a virtual machine
-func (c *Client) AttachReservedIP(ip string, serverID string) error {
- values := url.Values{
- "ip_address": {ip},
- "attach_SUBID": {serverID},
- }
- return c.post(`reservedip/attach`, values, nil)
-}
-
-// DetachReservedIP detaches a reserved IP from an existing virtual machine
-func (c *Client) DetachReservedIP(serverID string, ip string) error {
- values := url.Values{
- "ip_address": {ip},
- "detach_SUBID": {serverID},
- }
- return c.post(`reservedip/detach`, values, nil)
-}
-
-// ConvertReservedIP converts an existing virtual machines IP to a reserved IP
-func (c *Client) ConvertReservedIP(serverID string, ip string) (string, error) {
- values := url.Values{
- "SUBID": {serverID},
- "ip_address": {ip},
- }
-
- result := IP{}
- err := c.post(`reservedip/convert`, values, &result)
- if err != nil {
- return "", err
- }
- return result.ID, err
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/scripts.go b/vendor/github.com/JamesClonk/vultr/lib/scripts.go
deleted file mode 100644
index d6639cf1e..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/scripts.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package lib
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "sort"
- "strings"
-)
-
-// StartupScript on Vultr account
-type StartupScript struct {
- ID string `json:"SCRIPTID"`
- Name string `json:"name"`
- Type string `json:"type"`
- Content string `json:"script"`
-}
-
-type startupscripts []StartupScript
-
-func (s startupscripts) Len() int { return len(s) }
-func (s startupscripts) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s startupscripts) Less(i, j int) bool {
- return strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name)
-}
-
-// UnmarshalJSON implements json.Unmarshaller on StartupScript.
-// Necessary because the SCRIPTID field has inconsistent types.
-func (s *StartupScript) UnmarshalJSON(data []byte) (err error) {
- if s == nil {
- *s = StartupScript{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- s.ID = fmt.Sprintf("%v", fields["SCRIPTID"])
- s.Name = fmt.Sprintf("%v", fields["name"])
- s.Type = fmt.Sprintf("%v", fields["type"])
- s.Content = fmt.Sprintf("%v", fields["script"])
-
- return
-}
-
-// GetStartupScripts returns a list of all startup scripts on the current Vultr account
-func (c *Client) GetStartupScripts() (scripts []StartupScript, err error) {
- var scriptMap map[string]StartupScript
- if err := c.get(`startupscript/list`, &scriptMap); err != nil {
- return nil, err
- }
-
- for _, script := range scriptMap {
- if script.Type == "" {
- script.Type = "boot" // set default script type
- }
- scripts = append(scripts, script)
- }
- sort.Sort(startupscripts(scripts))
- return scripts, nil
-}
-
-// GetStartupScript returns the startup script with the given ID
-func (c *Client) GetStartupScript(id string) (StartupScript, error) {
- scripts, err := c.GetStartupScripts()
- if err != nil {
- return StartupScript{}, err
- }
-
- for _, s := range scripts {
- if s.ID == id {
- return s, nil
- }
- }
- return StartupScript{}, nil
-}
-
-// CreateStartupScript creates a new startup script
-func (c *Client) CreateStartupScript(name, content, scriptType string) (StartupScript, error) {
- values := url.Values{
- "name": {name},
- "script": {content},
- "type": {scriptType},
- }
-
- var script StartupScript
- if err := c.post(`startupscript/create`, values, &script); err != nil {
- return StartupScript{}, err
- }
- script.Name = name
- script.Content = content
- script.Type = scriptType
-
- return script, nil
-}
-
-// UpdateStartupScript updates an existing startup script
-func (c *Client) UpdateStartupScript(script StartupScript) error {
- values := url.Values{
- "SCRIPTID": {script.ID},
- }
- if script.Name != "" {
- values.Add("name", script.Name)
- }
- if script.Content != "" {
- values.Add("script", script.Content)
- }
-
- if err := c.post(`startupscript/update`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteStartupScript deletes an existing startup script from Vultr account
-func (c *Client) DeleteStartupScript(id string) error {
- values := url.Values{
- "SCRIPTID": {id},
- }
-
- if err := c.post(`startupscript/destroy`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/servers.go b/vendor/github.com/JamesClonk/vultr/lib/servers.go
deleted file mode 100644
index 418198a71..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/servers.go
+++ /dev/null
@@ -1,561 +0,0 @@
-package lib
-
-import (
- "encoding/base64"
- "encoding/json"
- "fmt"
- "net/url"
- "sort"
- "strconv"
- "strings"
-)
-
-// Server (virtual machine) on Vultr account
-type Server struct {
- ID string `json:"SUBID"`
- Name string `json:"label"`
- OS string `json:"os"`
- RAM string `json:"ram"`
- Disk string `json:"disk"`
- MainIP string `json:"main_ip"`
- VCpus int `json:"vcpu_count,string"`
- Location string `json:"location"`
- RegionID int `json:"DCID,string"`
- DefaultPassword string `json:"default_password"`
- Created string `json:"date_created"`
- PendingCharges float64 `json:"pending_charges"`
- Status string `json:"status"`
- Cost string `json:"cost_per_month"`
- CurrentBandwidth float64 `json:"current_bandwidth_gb"`
- AllowedBandwidth float64 `json:"allowed_bandwidth_gb,string"`
- NetmaskV4 string `json:"netmask_v4"`
- GatewayV4 string `json:"gateway_v4"`
- PowerStatus string `json:"power_status"`
- ServerState string `json:"server_state"`
- PlanID int `json:"VPSPLANID,string"`
- V6Networks []V6Network `json:"v6_networks"`
- InternalIP string `json:"internal_ip"`
- KVMUrl string `json:"kvm_url"`
- AutoBackups string `json:"auto_backups"`
- Tag string `json:"tag"`
- OSID string `json:"OSID"`
- AppID string `json:"APPID"`
- FirewallGroupID string `json:"FIREWALLGROUPID"`
-}
-
-// ServerOptions are optional parameters to be used during server creation
-type ServerOptions struct {
- IPXEChainURL string
- ISO int
- Script int
- UserData string
- Snapshot string
- SSHKey string
- ReservedIP string
- IPV6 bool
- PrivateNetworking bool
- AutoBackups bool
- DontNotifyOnActivate bool
- Hostname string
- Tag string
- AppID string
- FirewallGroupID string
-}
-
-type servers []Server
-
-func (s servers) Len() int { return len(s) }
-func (s servers) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s servers) Less(i, j int) bool {
- // sort order: name, ip
- if strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name) {
- return true
- } else if strings.ToLower(s[i].Name) > strings.ToLower(s[j].Name) {
- return false
- }
- return s[i].MainIP < s[j].MainIP
-}
-
-// V6Network represents a IPv6 network of a Vultr server
-type V6Network struct {
- Network string `json:"v6_network"`
- MainIP string `json:"v6_main_ip"`
- NetworkSize string `json:"v6_network_size"`
-}
-
-// ISOStatus represents an ISO image attached to a Vultr server
-type ISOStatus struct {
- State string `json:"state"`
- ISOID string `json:"ISOID"`
-}
-
-// UnmarshalJSON implements json.Unmarshaller on Server.
-// This is needed because the Vultr API is inconsistent in it's JSON responses for servers.
-// Some fields can change type, from JSON number to JSON string and vice-versa.
-func (s *Server) UnmarshalJSON(data []byte) (err error) {
- if s == nil {
- *s = Server{}
- }
-
- var fields map[string]interface{}
- if err := json.Unmarshal(data, &fields); err != nil {
- return err
- }
-
- value := fmt.Sprintf("%v", fields["vcpu_count"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- vcpu, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- s.VCpus = int(vcpu)
-
- value = fmt.Sprintf("%v", fields["DCID"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- region, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- s.RegionID = int(region)
-
- value = fmt.Sprintf("%v", fields["VPSPLANID"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- plan, err := strconv.ParseInt(value, 10, 64)
- if err != nil {
- return err
- }
- s.PlanID = int(plan)
-
- value = fmt.Sprintf("%v", fields["pending_charges"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- pc, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- s.PendingCharges = pc
-
- value = fmt.Sprintf("%v", fields["current_bandwidth_gb"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- cb, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- s.CurrentBandwidth = cb
-
- value = fmt.Sprintf("%v", fields["allowed_bandwidth_gb"])
- if len(value) == 0 || value == "" {
- value = "0"
- }
- ab, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return err
- }
- s.AllowedBandwidth = ab
-
- value = fmt.Sprintf("%v", fields["OSID"])
- if value == "" {
- value = ""
- }
- s.OSID = value
-
- value = fmt.Sprintf("%v", fields["APPID"])
- if value == "" || value == "0" {
- value = ""
- }
- s.AppID = value
-
- value = fmt.Sprintf("%v", fields["FIREWALLGROUPID"])
- if value == "" || value == "0" {
- value = ""
- }
- s.FirewallGroupID = value
-
- s.ID = fmt.Sprintf("%v", fields["SUBID"])
- s.Name = fmt.Sprintf("%v", fields["label"])
- s.OS = fmt.Sprintf("%v", fields["os"])
- s.RAM = fmt.Sprintf("%v", fields["ram"])
- s.Disk = fmt.Sprintf("%v", fields["disk"])
- s.MainIP = fmt.Sprintf("%v", fields["main_ip"])
- s.Location = fmt.Sprintf("%v", fields["location"])
- s.DefaultPassword = fmt.Sprintf("%v", fields["default_password"])
- s.Created = fmt.Sprintf("%v", fields["date_created"])
- s.Status = fmt.Sprintf("%v", fields["status"])
- s.Cost = fmt.Sprintf("%v", fields["cost_per_month"])
- s.NetmaskV4 = fmt.Sprintf("%v", fields["netmask_v4"])
- s.GatewayV4 = fmt.Sprintf("%v", fields["gateway_v4"])
- s.PowerStatus = fmt.Sprintf("%v", fields["power_status"])
- s.ServerState = fmt.Sprintf("%v", fields["server_state"])
-
- v6networks := make([]V6Network, 0)
- if networks, ok := fields["v6_networks"].([]interface{}); ok {
- for _, network := range networks {
- if network, ok := network.(map[string]interface{}); ok {
- v6network := V6Network{
- Network: fmt.Sprintf("%v", network["v6_network"]),
- MainIP: fmt.Sprintf("%v", network["v6_main_ip"]),
- NetworkSize: fmt.Sprintf("%v", network["v6_network_size"]),
- }
- v6networks = append(v6networks, v6network)
- }
- }
- s.V6Networks = v6networks
- }
-
- s.InternalIP = fmt.Sprintf("%v", fields["internal_ip"])
- s.KVMUrl = fmt.Sprintf("%v", fields["kvm_url"])
- s.AutoBackups = fmt.Sprintf("%v", fields["auto_backups"])
- s.Tag = fmt.Sprintf("%v", fields["tag"])
-
- return
-}
-
-// GetServers returns a list of current virtual machines on Vultr account
-func (c *Client) GetServers() (serverList []Server, err error) {
- var serverMap map[string]Server
- if err := c.get(`server/list`, &serverMap); err != nil {
- return nil, err
- }
-
- for _, server := range serverMap {
- serverList = append(serverList, server)
- }
- sort.Sort(servers(serverList))
- return serverList, nil
-}
-
-// GetServersByTag returns a list of all virtual machines matching by tag
-func (c *Client) GetServersByTag(tag string) (serverList []Server, err error) {
- var serverMap map[string]Server
- if err := c.get(`server/list?tag=`+tag, &serverMap); err != nil {
- return nil, err
- }
-
- for _, server := range serverMap {
- serverList = append(serverList, server)
- }
- sort.Sort(servers(serverList))
- return serverList, nil
-}
-
-// GetServer returns the virtual machine with the given ID
-func (c *Client) GetServer(id string) (server Server, err error) {
- if err := c.get(`server/list?SUBID=`+id, &server); err != nil {
- return Server{}, err
- }
- return server, nil
-}
-
-// CreateServer creates a new virtual machine on Vultr. ServerOptions are optional settings.
-func (c *Client) CreateServer(name string, regionID, planID, osID int, options *ServerOptions) (Server, error) {
- values := url.Values{
- "label": {name},
- "DCID": {fmt.Sprintf("%v", regionID)},
- "VPSPLANID": {fmt.Sprintf("%v", planID)},
- "OSID": {fmt.Sprintf("%v", osID)},
- }
-
- if options != nil {
- if options.IPXEChainURL != "" {
- values.Add("ipxe_chain_url", options.IPXEChainURL)
- }
-
- if options.ISO != 0 {
- values.Add("ISOID", fmt.Sprintf("%v", options.ISO))
- }
-
- if options.Script != 0 {
- values.Add("SCRIPTID", fmt.Sprintf("%v", options.Script))
- }
-
- if options.UserData != "" {
- values.Add("userdata", base64.StdEncoding.EncodeToString([]byte(options.UserData)))
- }
-
- if options.Snapshot != "" {
- values.Add("SNAPSHOTID", options.Snapshot)
- }
-
- if options.SSHKey != "" {
- values.Add("SSHKEYID", options.SSHKey)
- }
-
- if options.ReservedIP != "" {
- values.Add("reserved_ip_v4", options.ReservedIP)
- }
-
- values.Add("enable_ipv6", "no")
- if options.IPV6 {
- values.Set("enable_ipv6", "yes")
- }
-
- values.Add("enable_private_network", "no")
- if options.PrivateNetworking {
- values.Set("enable_private_network", "yes")
- }
-
- values.Add("auto_backups", "no")
- if options.AutoBackups {
- values.Set("auto_backups", "yes")
- }
-
- values.Add("notify_activate", "yes")
- if options.DontNotifyOnActivate {
- values.Set("notify_activate", "no")
- }
-
- if options.Hostname != "" {
- values.Add("hostname", options.Hostname)
- }
-
- if options.Tag != "" {
- values.Add("tag", options.Tag)
- }
-
- if options.AppID != "" {
- values.Add("APPID", options.AppID)
- }
-
- if options.FirewallGroupID != "" {
- values.Add("FIREWALLGROUPID", options.FirewallGroupID)
- }
- }
-
- var server Server
- if err := c.post(`server/create`, values, &server); err != nil {
- return Server{}, err
- }
- server.Name = name
- server.RegionID = regionID
- server.PlanID = planID
-
- return server, nil
-}
-
-// RenameServer renames an existing virtual machine
-func (c *Client) RenameServer(id, name string) error {
- values := url.Values{
- "SUBID": {id},
- "label": {name},
- }
-
- if err := c.post(`server/label_set`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// TagServer replaces the tag on an existing virtual machine
-func (c *Client) TagServer(id, tag string) error {
- values := url.Values{
- "SUBID": {id},
- "tag": {tag},
- }
-
- if err := c.post(`server/tag_set`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// StartServer starts an existing virtual machine
-func (c *Client) StartServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/start`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// HaltServer stops an existing virtual machine
-func (c *Client) HaltServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/halt`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// RebootServer reboots an existing virtual machine
-func (c *Client) RebootServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/reboot`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// ReinstallServer reinstalls the operating system on an existing virtual machine
-func (c *Client) ReinstallServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/reinstall`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// ChangeOSofServer changes the virtual machine to a different operating system
-func (c *Client) ChangeOSofServer(id string, osID int) error {
- values := url.Values{
- "SUBID": {id},
- "OSID": {fmt.Sprintf("%v", osID)},
- }
-
- if err := c.post(`server/os_change`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// ListOSforServer lists all available operating systems to which an existing virtual machine can be changed
-func (c *Client) ListOSforServer(id string) (os []OS, err error) {
- var osMap map[string]OS
- if err := c.get(`server/os_change_list?SUBID=`+id, &osMap); err != nil {
- return nil, err
- }
-
- for _, o := range osMap {
- os = append(os, o)
- }
- sort.Sort(oses(os))
- return os, nil
-}
-
-// AttachISOtoServer attaches an ISO image to an existing virtual machine and reboots it
-func (c *Client) AttachISOtoServer(id string, isoID int) error {
- values := url.Values{
- "SUBID": {id},
- "ISOID": {fmt.Sprintf("%v", isoID)},
- }
-
- if err := c.post(`server/iso_attach`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DetachISOfromServer detaches the currently mounted ISO image from the virtual machine and reboots it
-func (c *Client) DetachISOfromServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/iso_detach`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// GetISOStatusofServer retrieves the current ISO image state of an existing virtual machine
-func (c *Client) GetISOStatusofServer(id string) (isoStatus ISOStatus, err error) {
- if err := c.get(`server/iso_status?SUBID=`+id, &isoStatus); err != nil {
- return ISOStatus{}, err
- }
- return isoStatus, nil
-}
-
-// DeleteServer deletes an existing virtual machine
-func (c *Client) DeleteServer(id string) error {
- values := url.Values{
- "SUBID": {id},
- }
-
- if err := c.post(`server/destroy`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// SetFirewallGroup adds a virtual machine to a firewall group
-func (c *Client) SetFirewallGroup(id, firewallgroup string) error {
- values := url.Values{
- "SUBID": {id},
- "FIREWALLGROUPID": {firewallgroup},
- }
-
- if err := c.post(`server/firewall_group_set`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// UnsetFirewallGroup removes a virtual machine from a firewall group
-func (c *Client) UnsetFirewallGroup(id string) error {
- return c.SetFirewallGroup(id, "0")
-}
-
-// BandwidthOfServer retrieves the bandwidth used by a virtual machine
-func (c *Client) BandwidthOfServer(id string) (bandwidth []map[string]string, err error) {
- var bandwidthMap map[string][][]string
- if err := c.get(`server/bandwidth?SUBID=`+id, &bandwidthMap); err != nil {
- return nil, err
- }
-
- // parse incoming bytes
- for _, b := range bandwidthMap["incoming_bytes"] {
- bMap := make(map[string]string)
- bMap["date"] = b[0]
- bMap["incoming"] = b[1]
- bandwidth = append(bandwidth, bMap)
- }
-
- // parse outgoing bytes (we'll assume that incoming and outgoing dates are always a match)
- for _, b := range bandwidthMap["outgoing_bytes"] {
- for i := range bandwidth {
- if bandwidth[i]["date"] == b[0] {
- bandwidth[i]["outgoing"] = b[1]
- break
- }
- }
- }
-
- return bandwidth, nil
-}
-
-// ChangeApplicationofServer changes the virtual machine to a different application
-func (c *Client) ChangeApplicationofServer(id string, appID string) error {
- values := url.Values{
- "SUBID": {id},
- "APPID": {appID},
- }
-
- if err := c.post(`server/app_change`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// ListApplicationsforServer lists all available operating systems to which an existing virtual machine can be changed
-func (c *Client) ListApplicationsforServer(id string) (apps []Application, err error) {
- var appMap map[string]Application
- if err := c.get(`server/app_change_list?SUBID=`+id, &appMap); err != nil {
- return nil, err
- }
-
- for _, app := range appMap {
- apps = append(apps, app)
- }
- sort.Sort(applications(apps))
- return apps, nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/snapshots.go b/vendor/github.com/JamesClonk/vultr/lib/snapshots.go
deleted file mode 100644
index 7e9969306..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/snapshots.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package lib
-
-import (
- "net/url"
- "sort"
- "strings"
-)
-
-// Snapshot of a virtual machine on Vultr account
-type Snapshot struct {
- ID string `json:"SNAPSHOTID"`
- Description string `json:"description"`
- Size string `json:"size"`
- Status string `json:"status"`
- Created string `json:"date_created"`
-}
-
-type snapshots []Snapshot
-
-func (s snapshots) Len() int { return len(s) }
-func (s snapshots) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s snapshots) Less(i, j int) bool {
- // sort order: description, created
- if strings.ToLower(s[i].Description) < strings.ToLower(s[j].Description) {
- return true
- } else if strings.ToLower(s[i].Description) > strings.ToLower(s[j].Description) {
- return false
- }
- return s[i].Created < s[j].Created
-}
-
-// GetSnapshots retrieves a list of all snapshots on Vultr account
-func (c *Client) GetSnapshots() (snapshotList []Snapshot, err error) {
- var snapshotMap map[string]Snapshot
- if err := c.get(`snapshot/list`, &snapshotMap); err != nil {
- return nil, err
- }
-
- for _, snapshot := range snapshotMap {
- snapshotList = append(snapshotList, snapshot)
- }
- sort.Sort(snapshots(snapshotList))
- return snapshotList, nil
-}
-
-// CreateSnapshot creates a new virtual machine snapshot
-func (c *Client) CreateSnapshot(id, description string) (Snapshot, error) {
- values := url.Values{
- "SUBID": {id},
- "description": {description},
- }
-
- var snapshot Snapshot
- if err := c.post(`snapshot/create`, values, &snapshot); err != nil {
- return Snapshot{}, err
- }
- snapshot.Description = description
-
- return snapshot, nil
-}
-
-// DeleteSnapshot deletes an existing virtual machine snapshot
-func (c *Client) DeleteSnapshot(id string) error {
- values := url.Values{
- "SNAPSHOTID": {id},
- }
-
- if err := c.post(`snapshot/destroy`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go b/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go
deleted file mode 100644
index 006e16f2d..000000000
--- a/vendor/github.com/JamesClonk/vultr/lib/sshkeys.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package lib
-
-import (
- "net/url"
- "sort"
- "strings"
-)
-
-// SSHKey on Vultr account
-type SSHKey struct {
- ID string `json:"SSHKEYID"`
- Name string `json:"name"`
- Key string `json:"ssh_key"`
- Created string `json:"date_created"`
-}
-
-type sshkeys []SSHKey
-
-func (s sshkeys) Len() int { return len(s) }
-func (s sshkeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s sshkeys) Less(i, j int) bool { return strings.ToLower(s[i].Name) < strings.ToLower(s[j].Name) }
-
-// GetSSHKeys returns a list of SSHKeys from Vultr account
-func (c *Client) GetSSHKeys() (keys []SSHKey, err error) {
- var keyMap map[string]SSHKey
- if err := c.get(`sshkey/list`, &keyMap); err != nil {
- return nil, err
- }
-
- for _, key := range keyMap {
- keys = append(keys, key)
- }
- sort.Sort(sshkeys(keys))
- return keys, nil
-}
-
-// CreateSSHKey creates new SSHKey on Vultr
-func (c *Client) CreateSSHKey(name, key string) (SSHKey, error) {
- values := url.Values{
- "name": {name},
- "ssh_key": {key},
- }
-
- var sshKey SSHKey
- if err := c.post(`sshkey/create`, values, &sshKey); err != nil {
- return SSHKey{}, err
- }
- sshKey.Name = name
- sshKey.Key = key
-
- return sshKey, nil
-}
-
-// UpdateSSHKey updates an existing SSHKey entry
-func (c *Client) UpdateSSHKey(key SSHKey) error {
- values := url.Values{
- "SSHKEYID": {key.ID},
- }
- if key.Name != "" {
- values.Add("name", key.Name)
- }
- if key.Key != "" {
- values.Add("ssh_key", key.Key)
- }
-
- if err := c.post(`sshkey/update`, values, nil); err != nil {
- return err
- }
- return nil
-}
-
-// DeleteSSHKey deletes an existing SSHKey from Vultr account
-func (c *Client) DeleteSSHKey(id string) error {
- values := url.Values{
- "SSHKEYID": {id},
- }
-
- if err := c.post(`sshkey/destroy`, values, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/akamai/AkamaiOPEN-edgegrid-golang/edgegrid/signer.go b/vendor/github.com/akamai/AkamaiOPEN-edgegrid-golang/edgegrid/signer.go
index 27e6d0659..9f0c1e7c4 100644
--- a/vendor/github.com/akamai/AkamaiOPEN-edgegrid-golang/edgegrid/signer.go
+++ b/vendor/github.com/akamai/AkamaiOPEN-edgegrid-golang/edgegrid/signer.go
@@ -9,6 +9,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
+ "os"
"sort"
"strings"
"time"
@@ -32,6 +33,26 @@ func AddRequestHeader(config Config, req *http.Request) *http.Request {
req.Header.Set("Content-Type", "application/json")
}
+ _, AkamaiCliEnvOK := os.LookupEnv("AKAMAI_CLI")
+ AkamaiCliVersionEnv, AkamaiCliVersionEnvOK := os.LookupEnv("AKAMAI_CLI_VERSION")
+ AkamaiCliCommandEnv, AkamaiCliCommandEnvOK := os.LookupEnv("AKAMAI_CLI_COMMAND")
+ AkamaiCliCommandVersionEnv, AkamaiCliCommandVersionEnvOK := os.LookupEnv("AKAMAI_CLI_COMMAND_VERSION")
+
+ if AkamaiCliEnvOK && AkamaiCliVersionEnvOK {
+ if req.Header.Get("User-Agent") != "" {
+ req.Header.Set("User-Agent", req.Header.Get("User-Agent")+" AkamaiCLI/"+AkamaiCliVersionEnv)
+ } else {
+ req.Header.Set("User-Agent", "AkamaiCLI/"+AkamaiCliVersionEnv)
+ }
+ }
+ if AkamaiCliCommandEnvOK && AkamaiCliCommandVersionEnvOK {
+ if req.Header.Get("User-Agent") != "" {
+ req.Header.Set("User-Agent", req.Header.Get("User-Agent")+" AkamaiCLI-"+AkamaiCliCommandEnv+"/"+AkamaiCliCommandVersionEnv)
+ } else {
+ req.Header.Set("User-Agent", "AkamaiCLI-"+AkamaiCliCommandEnv+"/"+AkamaiCliCommandVersionEnv)
+ }
+ }
+
req.Header.Set("Authorization", createAuthHeader(config, req, timestamp, nonce))
return req
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go
new file mode 100644
index 000000000..d7968dab7
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/api_timeout.go
@@ -0,0 +1,249 @@
+package sdk
+
+import (
+ "encoding/json"
+ "strings"
+ "time"
+)
+
+var apiTimeouts = `{
+ "ecs": {
+ "ActivateRouterInterface": 10,
+ "AddTags": 61,
+ "AllocateDedicatedHosts": 10,
+ "AllocateEipAddress": 17,
+ "AllocatePublicIpAddress": 36,
+ "ApplyAutoSnapshotPolicy": 10,
+ "AssignIpv6Addresses": 10,
+ "AssignPrivateIpAddresses": 10,
+ "AssociateEipAddress": 17,
+ "AttachClassicLinkVpc": 14,
+ "AttachDisk": 36,
+ "AttachInstanceRamRole": 11,
+ "AttachKeyPair": 16,
+ "AttachNetworkInterface": 16,
+ "AuthorizeSecurityGroupEgress": 16,
+ "AuthorizeSecurityGroup": 16,
+ "CancelAutoSnapshotPolicy": 10,
+ "CancelCopyImage": 10,
+ "CancelPhysicalConnection": 10,
+ "CancelSimulatedSystemEvents": 10,
+ "CancelTask": 10,
+ "ConnectRouterInterface": 10,
+ "ConvertNatPublicIpToEip": 12,
+ "CopyImage": 10,
+ "CreateAutoSnapshotPolicy": 10,
+ "CreateCommand": 16,
+ "CreateDeploymentSet": 16,
+ "CreateDisk": 36,
+ "CreateHpcCluster": 10,
+ "CreateImage": 36,
+ "CreateInstance": 86,
+ "CreateKeyPair": 10,
+ "CreateLaunchTemplate": 10,
+ "CreateLaunchTemplateVersion": 10,
+ "CreateNatGateway": 36,
+ "CreateNetworkInterfacePermission": 13,
+ "CreateNetworkInterface": 16,
+ "CreatePhysicalConnection": 10,
+ "CreateRouteEntry": 17,
+ "CreateRouterInterface": 10,
+ "CreateSecurityGroup": 86,
+ "CreateSimulatedSystemEvents": 10,
+ "CreateSnapshot": 86,
+ "CreateVirtualBorderRouter": 10,
+ "CreateVpc": 16,
+ "CreateVSwitch": 17,
+ "DeactivateRouterInterface": 10,
+ "DeleteAutoSnapshotPolicy": 10,
+ "DeleteBandwidthPackage": 10,
+ "DeleteCommand": 16,
+ "DeleteDeploymentSet": 12,
+ "DeleteDisk": 16,
+ "DeleteHpcCluster": 10,
+ "DeleteImage": 36,
+ "DeleteInstance": 66,
+ "DeleteKeyPairs": 10,
+ "DeleteLaunchTemplate": 10,
+ "DeleteLaunchTemplateVersion": 10,
+ "DeleteNatGateway": 10,
+ "DeleteNetworkInterfacePermission": 10,
+ "DeleteNetworkInterface": 16,
+ "DeletePhysicalConnection": 10,
+ "DeleteRouteEntry": 16,
+ "DeleteRouterInterface": 10,
+ "DeleteSecurityGroup": 87,
+ "DeleteSnapshot": 17,
+ "DeleteVirtualBorderRouter": 10,
+ "DeleteVpc": 17,
+ "DeleteVSwitch": 17,
+ "DescribeAccessPoints": 10,
+ "DescribeAccountAttributes": 10,
+ "DescribeAutoSnapshotPolicyEx": 16,
+ "DescribeAvailableResource": 10,
+ "DescribeBandwidthLimitation": 16,
+ "DescribeBandwidthPackages": 10,
+ "DescribeClassicLinkInstances": 15,
+ "DescribeCloudAssistantStatus": 16,
+ "DescribeClusters": 10,
+ "DescribeCommands": 16,
+ "DescribeDedicatedHosts": 10,
+ "DescribeDedicatedHostTypes": 10,
+ "DescribeDeploymentSets": 26,
+ "DescribeDiskMonitorData": 16,
+ "DescribeDisksFullStatus": 14,
+ "DescribeDisks": 19,
+ "DescribeEipAddresses": 16,
+ "DescribeEipMonitorData": 16,
+ "DescribeEniMonitorData": 10,
+ "DescribeHaVips": 10,
+ "DescribeHpcClusters": 16,
+ "DescribeImageSharePermission": 10,
+ "DescribeImages": 38,
+ "DescribeImageSupportInstanceTypes": 16,
+ "DescribeInstanceAttribute": 36,
+ "DescribeInstanceAutoRenewAttribute": 17,
+ "DescribeInstanceHistoryEvents": 19,
+ "DescribeInstanceMonitorData": 19,
+ "DescribeInstancePhysicalAttribute": 10,
+ "DescribeInstanceRamRole": 11,
+ "DescribeInstancesFullStatus": 14,
+ "DescribeInstances": 10,
+ "DescribeInstanceStatus": 26,
+ "DescribeInstanceTopology": 12,
+ "DescribeInstanceTypeFamilies": 17,
+ "DescribeInstanceTypes": 17,
+ "DescribeInstanceVncPasswd": 10,
+ "DescribeInstanceVncUrl": 36,
+ "DescribeInvocationResults": 16,
+ "DescribeInvocations": 16,
+ "DescribeKeyPairs": 12,
+ "DescribeLaunchTemplates": 16,
+ "DescribeLaunchTemplateVersions": 16,
+ "DescribeLimitation": 36,
+ "DescribeNatGateways": 10,
+ "DescribeNetworkInterfacePermissions": 13,
+ "DescribeNetworkInterfaces": 16,
+ "DescribeNewProjectEipMonitorData": 16,
+ "DescribePhysicalConnections": 10,
+ "DescribePrice": 16,
+ "DescribeRecommendInstanceType": 10,
+ "DescribeRegions": 19,
+ "DescribeRenewalPrice": 16,
+ "DescribeResourceByTags": 10,
+ "DescribeResourcesModification": 17,
+ "DescribeRouterInterfaces": 10,
+ "DescribeRouteTables": 17,
+ "DescribeSecurityGroupAttribute": 133,
+ "DescribeSecurityGroupReferences": 16,
+ "DescribeSecurityGroups": 25,
+ "DescribeSnapshotLinks": 17,
+ "DescribeSnapshotMonitorData": 12,
+ "DescribeSnapshotPackage": 10,
+ "DescribeSnapshots": 26,
+ "DescribeSnapshotsUsage": 26,
+ "DescribeSpotPriceHistory": 22,
+ "DescribeTags": 17,
+ "DescribeTaskAttribute": 10,
+ "DescribeTasks": 11,
+ "DescribeUserBusinessBehavior": 13,
+ "DescribeUserData": 10,
+ "DescribeVirtualBorderRoutersForPhysicalConnection": 10,
+ "DescribeVirtualBorderRouters": 10,
+ "DescribeVpcs": 41,
+ "DescribeVRouters": 17,
+ "DescribeVSwitches": 17,
+ "DescribeZones": 103,
+ "DetachClassicLinkVpc": 14,
+ "DetachDisk": 17,
+ "DetachInstanceRamRole": 10,
+ "DetachKeyPair": 10,
+ "DetachNetworkInterface": 16,
+ "EipFillParams": 19,
+ "EipFillProduct": 13,
+ "EipNotifyPaid": 10,
+ "EnablePhysicalConnection": 10,
+ "ExportImage": 10,
+ "GetInstanceConsoleOutput": 14,
+ "GetInstanceScreenshot": 14,
+ "ImportImage": 29,
+ "ImportKeyPair": 10,
+ "InstallCloudAssistant": 10,
+ "InvokeCommand": 16,
+ "JoinResourceGroup": 10,
+ "JoinSecurityGroup": 66,
+ "LeaveSecurityGroup": 66,
+ "ModifyAutoSnapshotPolicyEx": 10,
+ "ModifyBandwidthPackageSpec": 11,
+ "ModifyCommand": 10,
+ "ModifyDeploymentSetAttribute": 10,
+ "ModifyDiskAttribute": 16,
+ "ModifyDiskChargeType": 13,
+ "ModifyEipAddressAttribute": 14,
+ "ModifyImageAttribute": 10,
+ "ModifyImageSharePermission": 16,
+ "ModifyInstanceAttribute": 22,
+ "ModifyInstanceAutoReleaseTime": 15,
+ "ModifyInstanceAutoRenewAttribute": 16,
+ "ModifyInstanceChargeType": 22,
+ "ModifyInstanceDeployment": 10,
+ "ModifyInstanceNetworkSpec": 36,
+ "ModifyInstanceSpec": 62,
+ "ModifyInstanceVncPasswd": 35,
+ "ModifyInstanceVpcAttribute": 15,
+ "ModifyLaunchTemplateDefaultVersion": 10,
+ "ModifyNetworkInterfaceAttribute": 10,
+ "ModifyPhysicalConnectionAttribute": 10,
+ "ModifyPrepayInstanceSpec": 13,
+ "ModifyRouterInterfaceAttribute": 10,
+ "ModifySecurityGroupAttribute": 10,
+ "ModifySecurityGroupEgressRule": 10,
+ "ModifySecurityGroupPolicy": 10,
+ "ModifySecurityGroupRule": 16,
+ "ModifySnapshotAttribute": 10,
+ "ModifyUserBusinessBehavior": 10,
+ "ModifyVirtualBorderRouterAttribute": 10,
+ "ModifyVpcAttribute": 10,
+ "ModifyVRouterAttribute": 10,
+ "ModifyVSwitchAttribute": 10,
+ "ReActivateInstances": 10,
+ "RebootInstance": 27,
+ "RedeployInstance": 14,
+ "ReInitDisk": 16,
+ "ReleaseDedicatedHost": 10,
+ "ReleaseEipAddress": 16,
+ "ReleasePublicIpAddress": 10,
+ "RemoveTags": 10,
+ "RenewInstance": 19,
+ "ReplaceSystemDisk": 36,
+ "ResetDisk": 36,
+ "ResizeDisk": 11,
+ "RevokeSecurityGroupEgress": 13,
+ "RevokeSecurityGroup": 16,
+ "RunInstances": 86,
+ "StartInstance": 46,
+ "StopInstance": 27,
+ "StopInvocation": 10,
+ "TerminatePhysicalConnection": 10,
+ "TerminateVirtualBorderRouter": 10,
+ "UnassignIpv6Addresses": 10,
+ "UnassignPrivateIpAddresses": 10,
+ "UnassociateEipAddress": 16
+ }
+}
+`
+
+func getAPIMaxTimeout(product, actionName string) (time.Duration, bool) {
+ timeout := make(map[string]map[string]int)
+ err := json.Unmarshal([]byte(apiTimeouts), &timeout)
+ if err != nil {
+ return 0 * time.Millisecond, false
+ }
+
+ obj := timeout[strings.ToLower(product)]
+ if obj != nil && obj[actionName] != 0 {
+ return time.Duration(obj[actionName]) * time.Second, true
+ }
+
+ return 0 * time.Millisecond, false
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go
new file mode 100644
index 000000000..6d4763e66
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/bearer_token_credential.go
@@ -0,0 +1,12 @@
+package credentials
+
+type BearerTokenCredential struct {
+ BearerToken string
+}
+
+// NewBearerTokenCredential return a BearerTokenCredential object
+func NewBearerTokenCredential(token string) *BearerTokenCredential {
+ return &BearerTokenCredential{
+ BearerToken: token,
+ }
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go
index 1e1f73ae4..55a5c2da0 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go
@@ -1,17 +1,5 @@
package credentials
-// Deprecated: Use EcsRamRoleCredential in this package instead.
-type StsRoleNameOnEcsCredential struct {
- RoleName string
-}
-
-// Deprecated: Use NewEcsRamRoleCredential in this package instead.
-func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential {
- return &StsRoleNameOnEcsCredential{
- RoleName: roleName,
- }
-}
-
func (oldCred *StsRoleNameOnEcsCredential) ToEcsRamRoleCredential() *EcsRamRoleCredential {
return &EcsRamRoleCredential{
RoleName: oldCred.RoleName,
@@ -27,3 +15,15 @@ func NewEcsRamRoleCredential(roleName string) *EcsRamRoleCredential {
RoleName: roleName,
}
}
+
+// Deprecated: Use EcsRamRoleCredential in this package instead.
+type StsRoleNameOnEcsCredential struct {
+ RoleName string
+}
+
+// Deprecated: Use NewEcsRamRoleCredential in this package instead.
+func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential {
+ return &StsRoleNameOnEcsCredential{
+ RoleName: roleName,
+ }
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go
new file mode 100644
index 000000000..3cd0d020a
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go
@@ -0,0 +1,30 @@
+package provider
+
+import (
+ "errors"
+ "os"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type EnvProvider struct{}
+
+var ProviderEnv = new(EnvProvider)
+
+func NewEnvProvider() Provider {
+ return &EnvProvider{}
+}
+
+func (p *EnvProvider) Resolve() (auth.Credential, error) {
+ accessKeyID, ok1 := os.LookupEnv(ENVAccessKeyID)
+ accessKeySecret, ok2 := os.LookupEnv(ENVAccessKeySecret)
+ if !ok1 || !ok2 {
+ return nil, nil
+ }
+ if accessKeyID == "" || accessKeySecret == "" {
+ return nil, errors.New("Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty")
+ }
+ return credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret), nil
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go
new file mode 100644
index 000000000..1906d21f6
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/instance_credentials.go
@@ -0,0 +1,92 @@
+package provider
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+ "os"
+ "time"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"
+
+type InstanceCredentialsProvider struct{}
+
+var ProviderInstance = new(InstanceCredentialsProvider)
+
+var HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) {
+ return fn
+}
+
+func NewInstanceCredentialsProvider() Provider {
+ return &InstanceCredentialsProvider{}
+}
+
+func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) {
+ roleName, ok := os.LookupEnv(ENVEcsMetadata)
+ if !ok {
+ return nil, nil
+ }
+ if roleName == "" {
+ return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty")
+ }
+ status, content, err := HookGet(get)(securityCredURL + roleName)
+ if err != nil {
+ return nil, err
+ }
+ if status != 200 {
+ if status == 404 {
+ return nil, fmt.Errorf("The role was not found in the instance")
+ }
+ return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName)
+ }
+ body := make(map[string]interface{})
+
+ if err := json.Unmarshal(content, &body); err != nil {
+ return nil, err
+ }
+
+ accessKeyID, err := extractString(body, "AccessKeyId")
+ if err != nil {
+ return nil, err
+ }
+ accessKeySecret, err := extractString(body, "AccessKeySecret")
+ if err != nil {
+ return nil, err
+ }
+ securityToken, err := extractString(body, "SecurityToken")
+ if err != nil {
+ return nil, err
+ }
+
+ return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil
+}
+
+func get(url string) (status int, content []byte, err error) {
+ httpClient := http.DefaultClient
+ httpClient.Timeout = time.Second * 1
+ resp, err := httpClient.Get(url)
+ if err != nil {
+ return
+ }
+ defer resp.Body.Close()
+ content, err = ioutil.ReadAll(resp.Body)
+ return resp.StatusCode, content, err
+}
+
+func extractString(m map[string]interface{}, key string) (string, error) {
+ raw, ok := m[key]
+ if !ok {
+ return "", fmt.Errorf("%s not in map", key)
+ }
+ str, ok := raw.(string)
+ if !ok {
+ return "", fmt.Errorf("%s is not a string in map", key)
+ }
+ return str, nil
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go
new file mode 100644
index 000000000..8d525c37a
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/profile_credentials.go
@@ -0,0 +1,158 @@
+package provider
+
+import (
+ "bufio"
+ "errors"
+ "os"
+ "runtime"
+ "strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+
+ ini "gopkg.in/ini.v1"
+)
+
+type ProfileProvider struct {
+ Profile string
+}
+
+var ProviderProfile = NewProfileProvider()
+
+// NewProfileProvider receive zero or more parameters,
+// when length of name is 0, the value of field Profile will be "default",
+// and when there are multiple inputs, the function will take the
+// first one and discard the other values.
+func NewProfileProvider(name ...string) Provider {
+ p := new(ProfileProvider)
+ if len(name) == 0 {
+ p.Profile = "default"
+ } else {
+ p.Profile = name[0]
+ }
+ return p
+}
+
+// Resolve implements the Provider interface
+// when credential type is rsa_key_pair, the content of private_key file
+// must be able to be parsed directly into the required string
+// that NewRsaKeyPairCredential function needed
+func (p *ProfileProvider) Resolve() (auth.Credential, error) {
+ path, ok := os.LookupEnv(ENVCredentialFile)
+ if !ok {
+ path, err := checkDefaultPath()
+ if err != nil {
+ return nil, err
+ }
+ if path == "" {
+ return nil, nil
+ }
+ } else if path == "" {
+ return nil, errors.New("Environment variable '" + ENVCredentialFile + "' cannot be empty")
+ }
+
+ ini, err := ini.Load(path)
+ if err != nil {
+ return nil, errors.New("ERROR: Can not open file" + err.Error())
+ }
+
+ section, err := ini.GetSection(p.Profile)
+ if err != nil {
+ return nil, errors.New("ERROR: Can not load section" + err.Error())
+ }
+
+ value, err := section.GetKey("type")
+ if err != nil {
+ return nil, errors.New("ERROR: Can not find credential type" + err.Error())
+ }
+
+ switch value.String() {
+ case "access_key":
+ value1, err1 := section.GetKey("access_key_id")
+ value2, err2 := section.GetKey("access_key_secret")
+ if err1 != nil || err2 != nil {
+ return nil, errors.New("ERROR: Failed to get value")
+ }
+ if value1.String() == "" || value2.String() == "" {
+ return nil, errors.New("ERROR: Value can't be empty")
+ }
+ return credentials.NewAccessKeyCredential(value1.String(), value2.String()), nil
+ case "ecs_ram_role":
+ value1, err1 := section.GetKey("role_name")
+ if err1 != nil {
+ return nil, errors.New("ERROR: Failed to get value")
+ }
+ if value1.String() == "" {
+ return nil, errors.New("ERROR: Value can't be empty")
+ }
+ return credentials.NewEcsRamRoleCredential(value1.String()), nil
+ case "ram_role_arn":
+ value1, err1 := section.GetKey("access_key_id")
+ value2, err2 := section.GetKey("access_key_secret")
+ value3, err3 := section.GetKey("role_arn")
+ value4, err4 := section.GetKey("role_session_name")
+ if err1 != nil || err2 != nil || err3 != nil || err4 != nil {
+ return nil, errors.New("ERROR: Failed to get value")
+ }
+ if value1.String() == "" || value2.String() == "" || value3.String() == "" || value4.String() == "" {
+ return nil, errors.New("ERROR: Value can't be empty")
+ }
+ return credentials.NewRamRoleArnCredential(value1.String(), value2.String(), value3.String(), value4.String(), 3600), nil
+ case "rsa_key_pair":
+ value1, err1 := section.GetKey("public_key_id")
+ value2, err2 := section.GetKey("private_key_file")
+ if err1 != nil || err2 != nil {
+ return nil, errors.New("ERROR: Failed to get value")
+ }
+ if value1.String() == "" || value2.String() == "" {
+ return nil, errors.New("ERROR: Value can't be empty")
+ }
+ file, err := os.Open(value2.String())
+ if err != nil {
+ return nil, errors.New("ERROR: Can not get private_key")
+ }
+ defer file.Close()
+ var privateKey string
+ scan := bufio.NewScanner(file)
+ var data string
+ for scan.Scan() {
+ if strings.HasPrefix(scan.Text(), "----") {
+ continue
+ }
+ data += scan.Text() + "\n"
+ }
+ return credentials.NewRsaKeyPairCredential(privateKey, value1.String(), 3600), nil
+ default:
+ return nil, errors.New("ERROR: Failed to get credential")
+ }
+}
+
+// GetHomePath return home directory according to the system.
+// if the environmental virables does not exist, will return empty
+func GetHomePath() string {
+ if runtime.GOOS == "windows" {
+ path, ok := os.LookupEnv("USERPROFILE")
+ if !ok {
+ return ""
+ }
+ return path
+ }
+ path, ok := os.LookupEnv("HOME")
+ if !ok {
+ return ""
+ }
+ return path
+}
+
+func checkDefaultPath() (path string, err error) {
+ path = GetHomePath()
+ if path == "" {
+ return "", errors.New("The default credential file path is invalid")
+ }
+ path = strings.Replace("~/.alibabacloud/credentials", "~", path, 1)
+ _, err = os.Stat(path)
+ if err != nil {
+ return "", nil
+ }
+ return path, nil
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go
new file mode 100644
index 000000000..ae4e168eb
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider.go
@@ -0,0 +1,19 @@
+package provider
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+//Environmental virables that may be used by the provider
+const (
+ ENVAccessKeyID = "ALIBABA_CLOUD_ACCESS_KEY_ID"
+ ENVAccessKeySecret = "ALIBABA_CLOUD_ACCESS_KEY_SECRET"
+ ENVCredentialFile = "ALIBABA_CLOUD_CREDENTIALS_FILE"
+ ENVEcsMetadata = "ALIBABA_CLOUD_ECS_METADATA"
+ PATHCredentialFile = "~/.alibabacloud/credentials"
+)
+
+// When you want to customize the provider, you only need to implement the method of the interface.
+type Provider interface {
+ Resolve() (auth.Credential, error)
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go
new file mode 100644
index 000000000..3f9315d13
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/provider_chain.go
@@ -0,0 +1,34 @@
+package provider
+
+import (
+ "errors"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+type ProviderChain struct {
+ Providers []Provider
+}
+
+var defaultproviders = []Provider{ProviderEnv, ProviderProfile, ProviderInstance}
+var DefaultChain = NewProviderChain(defaultproviders)
+
+func NewProviderChain(providers []Provider) Provider {
+ return &ProviderChain{
+ Providers: providers,
+ }
+}
+
+func (p *ProviderChain) Resolve() (auth.Credential, error) {
+ for _, provider := range p.Providers {
+ creds, err := provider.Resolve()
+ if err != nil {
+ return nil, err
+ } else if err == nil && creds == nil {
+ continue
+ }
+ return creds, err
+ }
+ return nil, errors.New("No credential found")
+
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go
index 7a9db75d2..27602fd74 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/sts_role_arn_credential.go
@@ -15,6 +15,7 @@ type RamRoleArnCredential struct {
RoleArn string
RoleSessionName string
RoleSessionExpiration int
+ Policy string
}
// Deprecated: Use RamRoleArnCredential in this package instead.
@@ -47,3 +48,14 @@ func NewRamRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionN
RoleSessionExpiration: roleSessionExpiration,
}
}
+
+func NewRamRoleArnWithPolicyCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string, roleSessionExpiration int) *RamRoleArnCredential {
+ return &RamRoleArnCredential{
+ AccessKeyId: accessKeyId,
+ AccessKeySecret: accessKeySecret,
+ RoleArn: roleArn,
+ RoleSessionName: roleSessionName,
+ RoleSessionExpiration: roleSessionExpiration,
+ Policy: policy,
+ }
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go
index 8666dd064..8b4037a00 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go
@@ -16,22 +16,33 @@ package auth
import (
"bytes"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
"sort"
"strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
+var debug utils.Debug
+
+var hookGetDate = func(fn func() string) string {
+ return fn()
+}
+
+func init() {
+ debug = utils.Init("sdk")
+}
+
func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) {
completeROASignParams(request, signer, regionId)
stringToSign := buildRoaStringToSign(request)
request.SetStringToSign(stringToSign)
- signature := signer.Sign(stringToSign, "")
accessKeyId, err := signer.GetAccessKeyId()
if err != nil {
- return nil
+ return err
}
+ signature := signer.Sign(stringToSign, "")
request.GetHeaders()["Authorization"] = "acs " + accessKeyId + ":" + signature
return
@@ -51,13 +62,16 @@ func completeROASignParams(request requests.AcsRequest, signer Signer, regionId
headerParams["x-acs-security-token"] = value
continue
}
-
+ if key == "BearerToken" {
+ headerParams["x-acs-bearer-token"] = value
+ continue
+ }
queryParams[key] = value
}
}
// complete header params
- headerParams["Date"] = utils.GetTimeInFormatRFC2616()
+ headerParams["Date"] = hookGetDate(utils.GetTimeInFormatRFC2616)
headerParams["x-acs-signature-method"] = signer.GetName()
headerParams["x-acs-signature-version"] = signer.GetVersion()
if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 {
@@ -110,6 +124,7 @@ func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) {
// append query params
stringToSignBuilder.WriteString(request.BuildQueries())
stringToSign = stringToSignBuilder.String()
+ debug("stringToSign: %s", stringToSign)
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go
index 0c6f6d111..33967b9ef 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go
@@ -15,13 +15,17 @@
package auth
import (
+ "net/url"
+ "strings"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
- "net/url"
- "sort"
- "strings"
)
+var hookGetNonce = func(fn func() string) string {
+ return fn()
+}
+
func signRpcRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) {
err = completeRpcSignParams(request, signer, regionId)
if err != nil {
@@ -44,11 +48,11 @@ func completeRpcSignParams(request requests.AcsRequest, signer Signer, regionId
queryParams["Version"] = request.GetVersion()
queryParams["Action"] = request.GetActionName()
queryParams["Format"] = request.GetAcceptFormat()
- queryParams["Timestamp"] = utils.GetTimeInFormatISO8601()
+ queryParams["Timestamp"] = hookGetDate(utils.GetTimeInFormatISO8601)
queryParams["SignatureMethod"] = signer.GetName()
queryParams["SignatureType"] = signer.GetType()
queryParams["SignatureVersion"] = signer.GetVersion()
- queryParams["SignatureNonce"] = utils.GetUUIDV4()
+ queryParams["SignatureNonce"] = hookGetNonce(utils.GetUUID)
queryParams["AccessKeyId"], err = signer.GetAccessKeyId()
if err != nil {
@@ -80,12 +84,6 @@ func buildRpcStringToSign(request requests.AcsRequest) (stringToSign string) {
signParams[key] = value
}
- // sort params by key
- var paramKeySlice []string
- for key := range signParams {
- paramKeySlice = append(paramKeySlice, key)
- }
- sort.Strings(paramKeySlice)
stringToSign = utils.GetUrlFormedMap(signParams)
stringToSign = strings.Replace(stringToSign, "+", "%20", -1)
stringToSign = strings.Replace(stringToSign, "*", "%2A", -1)
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go
index ba946d0fd..cbbc3cef7 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go
@@ -16,12 +16,13 @@ package auth
import (
"fmt"
+ "reflect"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "reflect"
)
type Signer interface {
@@ -31,20 +32,22 @@ type Signer interface {
GetAccessKeyId() (string, error)
GetExtraParam() map[string]string
Sign(stringToSign, secretSuffix string) string
- Shutdown()
}
func NewSignerWithCredential(credential Credential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer Signer, err error) {
switch instance := credential.(type) {
case *credentials.AccessKeyCredential:
{
- signer, err = signers.NewAccessKeySigner(instance)
+ signer = signers.NewAccessKeySigner(instance)
}
case *credentials.StsTokenCredential:
{
- signer, err = signers.NewStsTokenSigner(instance)
+ signer = signers.NewStsTokenSigner(instance)
+ }
+ case *credentials.BearerTokenCredential:
+ {
+ signer = signers.NewBearerTokenSigner(instance)
}
-
case *credentials.RamRoleArnCredential:
{
signer, err = signers.NewRamRoleArnSigner(instance, commonApi)
@@ -55,11 +58,11 @@ func NewSignerWithCredential(credential Credential, commonApi func(request *requ
}
case *credentials.EcsRamRoleCredential:
{
- signer, err = signers.NewEcsRamRoleSigner(instance, commonApi)
+ signer = signers.NewEcsRamRoleSigner(instance, commonApi)
}
case *credentials.BaseCredential: // deprecated user interface
{
- signer, err = signers.NewAccessKeySigner(instance.ToAccessKeyCredential())
+ signer = signers.NewAccessKeySigner(instance.ToAccessKeyCredential())
}
case *credentials.StsRoleArnCredential: // deprecated user interface
{
@@ -67,7 +70,7 @@ func NewSignerWithCredential(credential Credential, commonApi func(request *requ
}
case *credentials.StsRoleNameOnEcsCredential: // deprecated user interface
{
- signer, err = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi)
+ signer = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi)
}
default:
message := fmt.Sprintf(errors.UnsupportedCredentialErrorMessage, reflect.TypeOf(credential))
@@ -80,7 +83,7 @@ func Sign(request requests.AcsRequest, signer Signer, regionId string) (err erro
switch request.GetStyle() {
case requests.ROA:
{
- signRoaRequest(request, signer, regionId)
+ err = signRoaRequest(request, signer, regionId)
}
case requests.RPC:
{
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go
index 975e985b9..887f50209 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go
@@ -22,11 +22,7 @@ import (
"crypto/sha1"
"crypto/x509"
"encoding/base64"
- "fmt"
- /*"encoding/pem"
- "io/ioutil"
- "os/user"
- "crypto/sha256"*/)
+)
func ShaHmac1(source, secret string) string {
key := []byte(secret)
@@ -38,13 +34,14 @@ func ShaHmac1(source, secret string) string {
}
func Sha256WithRsa(source, secret string) string {
+ // block, _ := pem.Decode([]byte(secret))
decodeString, err := base64.StdEncoding.DecodeString(secret)
if err != nil {
- fmt.Println("DecodeString err", err)
+ panic(err)
}
private, err := x509.ParsePKCS8PrivateKey(decodeString)
if err != nil {
- fmt.Println("ParsePKCS8PrivateKey err", err)
+ panic(err)
}
h := crypto.Hash.New(crypto.SHA256)
@@ -53,11 +50,8 @@ func Sha256WithRsa(source, secret string) string {
signature, err := rsa.SignPKCS1v15(rand.Reader, private.(*rsa.PrivateKey),
crypto.SHA256, hashed)
if err != nil {
- fmt.Println("Error from signing:", err)
- return ""
+ panic(err)
}
- signedString := base64.StdEncoding.EncodeToString(signature)
- //fmt.Printf("Encoded: %v\n", signedString)
- return signedString
+ return base64.StdEncoding.EncodeToString(signature)
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go
index bb73d2441..ba291a41e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/credential_updater.go
@@ -15,12 +15,13 @@
package signers
import (
+ "time"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "time"
)
-const defaultInAdvanceScale = 0.8
+const defaultInAdvanceScale = 0.95
type credentialUpdater struct {
credentialExpiration int
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go
index 92466ea55..bc4f35b85 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go
@@ -26,10 +26,10 @@ func (signer *AccessKeySigner) GetExtraParam() map[string]string {
return nil
}
-func NewAccessKeySigner(credential *credentials.AccessKeyCredential) (*AccessKeySigner, error) {
+func NewAccessKeySigner(credential *credentials.AccessKeyCredential) *AccessKeySigner {
return &AccessKeySigner{
credential: credential,
- }, nil
+ }
}
func (*AccessKeySigner) GetName() string {
@@ -52,7 +52,3 @@ func (signer *AccessKeySigner) Sign(stringToSign, secretSuffix string) string {
secret := signer.credential.AccessKeySecret + secretSuffix
return ShaHmac1(stringToSign, secret)
}
-
-func (signer *AccessKeySigner) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go
new file mode 100644
index 000000000..75b78433a
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_bearer_token.go
@@ -0,0 +1,35 @@
+package signers
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+)
+
+type BearerTokenSigner struct {
+ credential *credentials.BearerTokenCredential
+}
+
+func NewBearerTokenSigner(credential *credentials.BearerTokenCredential) *BearerTokenSigner {
+ return &BearerTokenSigner{
+ credential: credential,
+ }
+}
+
+func (signer *BearerTokenSigner) GetExtraParam() map[string]string {
+ return map[string]string{"BearerToken": signer.credential.BearerToken}
+}
+
+func (*BearerTokenSigner) GetName() string {
+ return ""
+}
+func (*BearerTokenSigner) GetType() string {
+ return "BEARERTOKEN"
+}
+func (*BearerTokenSigner) GetVersion() string {
+ return "1.0"
+}
+func (signer *BearerTokenSigner) GetAccessKeyId() (accessKeyId string, err error) {
+ return "", nil
+}
+func (signer *BearerTokenSigner) Sign(stringToSign, secretSuffix string) string {
+ return ""
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go
index 6cacc140d..73788429e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ecs_ram_role.go
@@ -17,15 +17,18 @@ package signers
import (
"encoding/json"
"fmt"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "github.com/jmespath/go-jmespath"
"net/http"
"strings"
"time"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+ jmespath "github.com/jmespath/go-jmespath"
)
+var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"
+
type EcsRamRoleSigner struct {
*credentialUpdater
sessionCredential *SessionCredential
@@ -33,7 +36,7 @@ type EcsRamRoleSigner struct {
commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
}
-func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner, err error) {
+func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner) {
signer = &EcsRamRoleSigner{
credential: credential,
commonApi: commonApi,
@@ -46,7 +49,7 @@ func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi
refreshApi: signer.refreshApi,
}
- return
+ return signer
}
func (*EcsRamRoleSigner) GetName() string {
@@ -64,9 +67,12 @@ func (*EcsRamRoleSigner) GetVersion() string {
func (signer *EcsRamRoleSigner) GetAccessKeyId() (accessKeyId string, err error) {
if signer.sessionCredential == nil || signer.needUpdateCredential() {
err = signer.updateCredential()
+ if err != nil {
+ return
+ }
}
- if err != nil && (signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0) {
- return "", err
+ if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
+ return "", nil
}
return signer.sessionCredential.AccessKeyId, nil
}
@@ -82,76 +88,66 @@ func (signer *EcsRamRoleSigner) GetExtraParam() map[string]string {
}
func (signer *EcsRamRoleSigner) Sign(stringToSign, secretSuffix string) string {
- secret := signer.sessionCredential.AccessKeyId + secretSuffix
+ secret := signer.sessionCredential.AccessKeySecret + secretSuffix
return ShaHmac1(stringToSign, secret)
}
func (signer *EcsRamRoleSigner) buildCommonRequest() (request *requests.CommonRequest, err error) {
- request = requests.NewCommonRequest()
return
}
func (signer *EcsRamRoleSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
- requestUrl := "http://100.100.100.200/latest/meta-data/ram/security-credentials/" + signer.credential.RoleName
+ requestUrl := securityCredURL + signer.credential.RoleName
httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader(""))
if err != nil {
- fmt.Println("refresh Ecs sts token err", err)
+ err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
return
}
httpClient := &http.Client{}
httpResponse, err := httpClient.Do(httpRequest)
if err != nil {
- fmt.Println("refresh Ecs sts token err", err)
+ err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error())
return
}
response = responses.NewCommonResponse()
err = responses.Unmarshal(response, httpResponse, "")
-
return
}
func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResponse) (err error) {
if response.GetHttpStatus() != http.StatusOK {
- fmt.Println("refresh Ecs sts token err, httpStatus: " + string(response.GetHttpStatus()) + ", message = " + response.GetHttpContentString())
- return
+ return fmt.Errorf("refresh Ecs sts token err, httpStatus: %d, message = %s", response.GetHttpStatus(), response.GetHttpContentString())
}
var data interface{}
err = json.Unmarshal(response.GetHttpContentBytes(), &data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, json.Unmarshal fail", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, json.Unmarshal fail: %s", err.Error())
}
code, err := jmespath.Search("Code", data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, fail to get Code", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, fail to get Code: %s", err.Error())
}
if code.(string) != "Success" {
- fmt.Println("refresh Ecs sts token err, Code is not Success", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, Code is not Success")
}
accessKeyId, err := jmespath.Search("AccessKeyId", data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, fail to get AccessKeyId", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeyId: %s", err.Error())
}
accessKeySecret, err := jmespath.Search("AccessKeySecret", data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, fail to get AccessKeySecret", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeySecret: %s", err.Error())
}
securityToken, err := jmespath.Search("SecurityToken", data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, fail to get SecurityToken", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, fail to get SecurityToken: %s", err.Error())
}
expiration, err := jmespath.Search("Expiration", data)
if err != nil {
- fmt.Println("refresh Ecs sts token err, fail to get Expiration", err)
- return
+ return fmt.Errorf("refresh Ecs sts token err, fail to get Expiration: %s", err.Error())
}
- if accessKeyId == nil || accessKeySecret == nil || securityToken == nil {
+ if accessKeyId == nil || accessKeySecret == nil || securityToken == nil || expiration == nil {
return
}
@@ -169,7 +165,3 @@ func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResp
func (signer *EcsRamRoleSigner) GetSessionCredential() *SessionCredential {
return signer.sessionCredential
}
-
-func (signer *EcsRamRoleSigner) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go
index c5fe39456..19273d5a6 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go
@@ -17,13 +17,14 @@ package signers
import (
"encoding/json"
"fmt"
+ "net/http"
+ "strconv"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "github.com/jmespath/go-jmespath"
- "net/http"
- "strconv"
+ jmespath "github.com/jmespath/go-jmespath"
)
type SignerKeyPair struct {
@@ -70,28 +71,33 @@ func (*SignerKeyPair) GetVersion() string {
return "1.0"
}
-func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) {
+func (signer *SignerKeyPair) ensureCredential() error {
if signer.sessionCredential == nil || signer.needUpdateCredential() {
- err = signer.updateCredential()
+ return signer.updateCredential()
}
- if err != nil && (signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0) {
- return "", err
+ return nil
+}
+
+func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) {
+ err = signer.ensureCredential()
+ if err != nil {
+ return
}
- return signer.sessionCredential.AccessKeyId, err
+ if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
+ accessKeyId = ""
+ return
+ }
+
+ accessKeyId = signer.sessionCredential.AccessKeyId
+ return
}
func (signer *SignerKeyPair) GetExtraParam() map[string]string {
- if signer.sessionCredential == nil || signer.needUpdateCredential() {
- signer.updateCredential()
- }
- if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
- return make(map[string]string)
- }
return make(map[string]string)
}
func (signer *SignerKeyPair) Sign(stringToSign, secretSuffix string) string {
- secret := signer.sessionCredential.AccessKeyId + secretSuffix
+ secret := signer.sessionCredential.AccessKeySecret + secretSuffix
return ShaHmac1(stringToSign, secret)
}
@@ -101,14 +107,15 @@ func (signer *SignerKeyPair) buildCommonRequest() (request *requests.CommonReque
request.Version = "2015-04-01"
request.ApiName = "GenerateSessionAccessKey"
request.Scheme = requests.HTTPS
+ request.SetDomain("sts.ap-northeast-1.aliyuncs.com")
request.QueryParams["PublicKeyId"] = signer.credential.PublicKeyId
request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration)
return
}
-func (signerKeyPair *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
- signerV2, err := NewSignerV2(signerKeyPair.credential)
- return signerKeyPair.commonApi(request, signerV2)
+func (signer *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
+ signerV2 := NewSignerV2(signer.credential)
+ return signer.commonApi(request, signerV2)
}
func (signer *SignerKeyPair) refreshCredential(response *responses.CommonResponse) (err error) {
@@ -120,18 +127,15 @@ func (signer *SignerKeyPair) refreshCredential(response *responses.CommonRespons
var data interface{}
err = json.Unmarshal(response.GetHttpContentBytes(), &data)
if err != nil {
- fmt.Println("refresh KeyPair err, json.Unmarshal fail", err)
- return
+ return fmt.Errorf("refresh KeyPair err, json.Unmarshal fail: %s", err.Error())
}
accessKeyId, err := jmespath.Search("SessionAccessKey.SessionAccessKeyId", data)
if err != nil {
- fmt.Println("refresh KeyPair err, fail to get SessionAccessKeyId", err)
- return
+ return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeyId: %s", err.Error())
}
accessKeySecret, err := jmespath.Search("SessionAccessKey.SessionAccessKeySecret", data)
if err != nil {
- fmt.Println("refresh KeyPair err, fail to get SessionAccessKeySecret", err)
- return
+ return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeySecret: %s", err.Error())
}
if accessKeyId == nil || accessKeySecret == nil {
return
@@ -142,7 +146,3 @@ func (signer *SignerKeyPair) refreshCredential(response *responses.CommonRespons
}
return
}
-
-func (signer *SignerKeyPair) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go
index bfcaa9573..c945c8aeb 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_ram_role_arn.go
@@ -17,14 +17,15 @@ package signers
import (
"encoding/json"
"fmt"
+ "net/http"
+ "strconv"
+ "time"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "github.com/jmespath/go-jmespath"
- "net/http"
- "strconv"
- "time"
+ jmespath "github.com/jmespath/go-jmespath"
)
const (
@@ -84,10 +85,15 @@ func (*RamRoleArnSigner) GetVersion() string {
func (signer *RamRoleArnSigner) GetAccessKeyId() (accessKeyId string, err error) {
if signer.sessionCredential == nil || signer.needUpdateCredential() {
err = signer.updateCredential()
+ if err != nil {
+ return
+ }
}
- if err != nil && (signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0) {
+
+ if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 {
return "", err
}
+
return signer.sessionCredential.AccessKeyId, nil
}
@@ -113,6 +119,9 @@ func (signer *RamRoleArnSigner) buildCommonRequest() (request *requests.CommonRe
request.ApiName = "AssumeRole"
request.Scheme = requests.HTTPS
request.QueryParams["RoleArn"] = signer.credential.RoleArn
+ if signer.credential.Policy != "" {
+ request.QueryParams["Policy"] = signer.credential.Policy
+ }
request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName
request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration)
return
@@ -123,7 +132,7 @@ func (signer *RamRoleArnSigner) refreshApi(request *requests.CommonRequest) (res
AccessKeyId: signer.credential.AccessKeyId,
AccessKeySecret: signer.credential.AccessKeySecret,
}
- signerV1, err := NewAccessKeySigner(credential)
+ signerV1 := NewAccessKeySigner(credential)
return signer.commonApi(request, signerV1)
}
@@ -136,23 +145,19 @@ func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResp
var data interface{}
err = json.Unmarshal(response.GetHttpContentBytes(), &data)
if err != nil {
- fmt.Println("refresh RoleArn sts token err, json.Unmarshal fail", err)
- return
+ return fmt.Errorf("refresh RoleArn sts token err, json.Unmarshal fail: %s", err.Error())
}
accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data)
if err != nil {
- fmt.Println("refresh RoleArn sts token err, fail to get AccessKeyId", err)
- return
+ return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeyId: %s", err.Error())
}
accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data)
if err != nil {
- fmt.Println("refresh RoleArn sts token err, fail to get AccessKeySecret", err)
- return
+ return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeySecret: %s", err.Error())
}
securityToken, err := jmespath.Search("Credentials.SecurityToken", data)
if err != nil {
- fmt.Println("refresh RoleArn sts token err, fail to get SecurityToken", err)
- return
+ return fmt.Errorf("refresh RoleArn sts token err, fail to get SecurityToken: %s", err.Error())
}
if accessKeyId == nil || accessKeySecret == nil || securityToken == nil {
return
@@ -168,7 +173,3 @@ func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResp
func (signer *RamRoleArnSigner) GetSessionCredential() *SessionCredential {
return signer.sessionCredential
}
-
-func (signer *RamRoleArnSigner) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go
index 9e178d0fb..d0ce36c38 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go
@@ -22,10 +22,10 @@ type StsTokenSigner struct {
credential *credentials.StsTokenCredential
}
-func NewStsTokenSigner(credential *credentials.StsTokenCredential) (*StsTokenSigner, error) {
+func NewStsTokenSigner(credential *credentials.StsTokenCredential) *StsTokenSigner {
return &StsTokenSigner{
credential: credential,
- }, nil
+ }
}
func (*StsTokenSigner) GetName() string {
@@ -52,7 +52,3 @@ func (signer *StsTokenSigner) Sign(stringToSign, secretSuffix string) string {
secret := signer.credential.AccessKeySecret + secretSuffix
return ShaHmac1(stringToSign, secret)
}
-
-func (signer *StsTokenSigner) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go
index 1814fe7bd..973485298 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go
@@ -26,10 +26,10 @@ func (signer *SignerV2) GetExtraParam() map[string]string {
return nil
}
-func NewSignerV2(credential *credentials.RsaKeyPairCredential) (*SignerV2, error) {
+func NewSignerV2(credential *credentials.RsaKeyPairCredential) *SignerV2 {
return &SignerV2{
credential: credential,
- }, nil
+ }
}
func (*SignerV2) GetName() string {
@@ -52,7 +52,3 @@ func (signer *SignerV2) Sign(stringToSign, secretSuffix string) string {
secret := signer.credential.PrivateKey
return Sha256WithRsa(stringToSign, secret)
}
-
-func (signer *SignerV2) Shutdown() {
-
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go
index e204676ba..aef8bdc05 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go
@@ -15,28 +15,64 @@
package sdk
import (
+ "context"
+ "crypto/tls"
"fmt"
+ "net"
+ "net/http"
+ "net/url"
+ "os"
+ "runtime"
+ "strconv"
+ "strings"
+ "sync"
+ "time"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "net"
- "net/http"
- "strconv"
- "sync"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
-// this value will be replaced while build: -ldflags="-X sdk.version=x.x.x"
-var Version = "0.0.1"
+var debug utils.Debug
+func init() {
+ debug = utils.Init("sdk")
+}
+
+// Version this value will be replaced while build: -ldflags="-X sdk.version=x.x.x"
+var Version = "0.0.1"
+var defaultConnectTimeout = 5 * time.Second
+var defaultReadTimeout = 10 * time.Second
+
+var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version)
+
+var hookDo = func(fn func(req *http.Request) (*http.Response, error)) func(req *http.Request) (*http.Response, error) {
+ return fn
+}
+
+// Client the type Client
type Client struct {
+ isInsecure bool
regionId string
config *Config
+ httpProxy string
+ httpsProxy string
+ noProxy string
+ logger *Logger
+ userAgent map[string]string
signer auth.Signer
httpClient *http.Client
asyncTaskQueue chan func()
+ readTimeout time.Duration
+ connectTimeout time.Duration
+ EndpointMap map[string]string
+ EndpointType string
+ Network string
debug bool
isRunning bool
@@ -48,14 +84,62 @@ func (client *Client) Init() (err error) {
panic("not support yet")
}
+func (client *Client) SetEndpointRules(endpointMap map[string]string, endpointType string, netWork string) {
+ client.EndpointMap = endpointMap
+ client.Network = netWork
+ client.EndpointType = endpointType
+}
+
+func (client *Client) SetHTTPSInsecure(isInsecure bool) {
+ client.isInsecure = isInsecure
+}
+
+func (client *Client) GetHTTPSInsecure() bool {
+ return client.isInsecure
+}
+
+func (client *Client) SetHttpsProxy(httpsProxy string) {
+ client.httpsProxy = httpsProxy
+}
+
+func (client *Client) GetHttpsProxy() string {
+ return client.httpsProxy
+}
+
+func (client *Client) SetHttpProxy(httpProxy string) {
+ client.httpProxy = httpProxy
+}
+
+func (client *Client) GetHttpProxy() string {
+ return client.httpProxy
+}
+
+func (client *Client) SetNoProxy(noProxy string) {
+ client.noProxy = noProxy
+}
+
+func (client *Client) GetNoProxy() string {
+ return client.noProxy
+}
+
+// InitWithProviderChain will get credential from the providerChain,
+// the RsaKeyPairCredential Only applicable to regionID `ap-northeast-1`,
+// if your providerChain may return a credential type with RsaKeyPairCredential,
+// please ensure your regionID is `ap-northeast-1`.
+func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error) {
+ config := client.InitClientConfig()
+ credential, err := provider.Resolve()
+ if err != nil {
+ return
+ }
+ return client.InitWithOptions(regionId, config, credential)
+}
+
func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error) {
client.isRunning = true
client.asyncChanLock = new(sync.RWMutex)
client.regionId = regionId
client.config = config
- if err != nil {
- return
- }
client.httpClient = &http.Client{}
if config.HttpTransport != nil {
@@ -75,6 +159,58 @@ func (client *Client) InitWithOptions(regionId string, config *Config, credentia
return
}
+func (client *Client) SetReadTimeout(readTimeout time.Duration) {
+ client.readTimeout = readTimeout
+}
+
+func (client *Client) SetConnectTimeout(connectTimeout time.Duration) {
+ client.connectTimeout = connectTimeout
+}
+
+func (client *Client) GetReadTimeout() time.Duration {
+ return client.readTimeout
+}
+
+func (client *Client) GetConnectTimeout() time.Duration {
+ return client.connectTimeout
+}
+
+func (client *Client) getHttpProxy(scheme string) (proxy *url.URL, err error) {
+ if scheme == "https" {
+ if client.GetHttpsProxy() != "" {
+ proxy, err = url.Parse(client.httpsProxy)
+ } else if rawurl := os.Getenv("HTTPS_PROXY"); rawurl != "" {
+ proxy, err = url.Parse(rawurl)
+ } else if rawurl := os.Getenv("https_proxy"); rawurl != "" {
+ proxy, err = url.Parse(rawurl)
+ }
+ } else {
+ if client.GetHttpProxy() != "" {
+ proxy, err = url.Parse(client.httpProxy)
+ } else if rawurl := os.Getenv("HTTP_PROXY"); rawurl != "" {
+ proxy, err = url.Parse(rawurl)
+ } else if rawurl := os.Getenv("http_proxy"); rawurl != "" {
+ proxy, err = url.Parse(rawurl)
+ }
+ }
+
+ return proxy, err
+}
+
+func (client *Client) getNoProxy(scheme string) []string {
+ var urls []string
+ if client.GetNoProxy() != "" {
+ urls = strings.Split(client.noProxy, ",")
+ } else if rawurl := os.Getenv("NO_PROXY"); rawurl != "" {
+ urls = strings.Split(rawurl, ",")
+ } else if rawurl := os.Getenv("no_proxy"); rawurl != "" {
+ urls = strings.Split(rawurl, ",")
+ }
+
+ return urls
+}
+
+// EnableAsync enable the async task queue
func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int) {
client.asyncTaskQueue = make(chan func(), maxTaskQueueSize)
for i := 0; i < routinePoolSize; i++ {
@@ -121,6 +257,18 @@ func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret,
return client.InitWithOptions(regionId, config, credential)
}
+func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error) {
+ config := client.InitClientConfig()
+ credential := &credentials.RamRoleArnCredential{
+ AccessKeyId: accessKeyId,
+ AccessKeySecret: accessKeySecret,
+ RoleArn: roleArn,
+ RoleSessionName: roleSessionName,
+ Policy: policy,
+ }
+ return client.InitWithOptions(regionId, config, credential)
+}
+
func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) {
config := client.InitClientConfig()
credential := &credentials.RsaKeyPairCredential{
@@ -139,6 +287,14 @@ func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error)
return client.InitWithOptions(regionId, config, credential)
}
+func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error) {
+ config := client.InitClientConfig()
+ credential := &credentials.BearerTokenCredential{
+ BearerToken: bearerToken,
+ }
+ return client.InitWithOptions(regionId, config, credential)
+}
+
func (client *Client) InitClientConfig() (config *Config) {
if client.config != nil {
return client.config
@@ -151,52 +307,22 @@ func (client *Client) DoAction(request requests.AcsRequest, response responses.A
return client.DoActionWithSigner(request, response, nil)
}
-func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error) {
- // add clientVersion
- request.GetHeaders()["x-sdk-core-version"] = Version
-
- regionId := client.regionId
- if len(request.GetRegionId()) > 0 {
- regionId = request.GetRegionId()
- }
-
- // resolve endpoint
- resolveParam := &endpoints.ResolveParam{
- Domain: request.GetDomain(),
- Product: request.GetProduct(),
- RegionId: regionId,
- LocationProduct: request.GetLocationServiceCode(),
- LocationEndpointType: request.GetLocationEndpointType(),
- CommonApi: client.ProcessCommonRequest,
- }
- endpoint, err := endpoints.Resolve(resolveParam)
- if err != nil {
- return
- }
- request.SetDomain(endpoint)
-
- // init request params
- err = requests.InitParams(request)
- if err != nil {
- return
- }
-
- // signature
- var finalSigner auth.Signer
- if signer != nil {
- finalSigner = signer
+func (client *Client) GetEndpointRules(regionId string, product string) (endpointRaw string) {
+ if client.EndpointType == "regional" {
+ endpointRaw = strings.Replace("..aliyuncs.com", "", regionId, 1)
} else {
- finalSigner = client.signer
+ endpointRaw = ".aliyuncs.com"
}
- httpRequest, err := buildHttpRequest(request, finalSigner, regionId)
- if client.config.UserAgent != "" {
- httpRequest.Header.Set("User-Agent", client.config.UserAgent)
+ endpointRaw = strings.Replace(endpointRaw, "", strings.ToLower(product), 1)
+ if client.Network == "" || client.Network == "public" {
+ endpointRaw = strings.Replace(endpointRaw, "", "", 1)
+ } else {
+ endpointRaw = strings.Replace(endpointRaw, "", "-"+client.Network, 1)
}
- return err
+ return endpointRaw
}
-func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error) {
-
+func (client *Client) buildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (httpRequest *http.Request, err error) {
// add clientVersion
request.GetHeaders()["x-sdk-core-version"] = Version
@@ -206,20 +332,33 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
}
// resolve endpoint
- resolveParam := &endpoints.ResolveParam{
- Domain: request.GetDomain(),
- Product: request.GetProduct(),
- RegionId: regionId,
- LocationProduct: request.GetLocationServiceCode(),
- LocationEndpointType: request.GetLocationEndpointType(),
- CommonApi: client.ProcessCommonRequest,
- }
- endpoint, err := endpoints.Resolve(resolveParam)
- if err != nil {
- return
- }
- request.SetDomain(endpoint)
+ endpoint := request.GetDomain()
+ if endpoint == "" && client.EndpointType != "" {
+ if client.EndpointMap != nil && client.Network == "" || client.Network == "public" {
+ endpoint = client.EndpointMap[regionId]
+ }
+ if endpoint == "" {
+ endpoint = client.GetEndpointRules(regionId, request.GetProduct())
+ }
+ }
+
+ if endpoint == "" {
+ resolveParam := &endpoints.ResolveParam{
+ Domain: request.GetDomain(),
+ Product: request.GetProduct(),
+ RegionId: regionId,
+ LocationProduct: request.GetLocationServiceCode(),
+ LocationEndpointType: request.GetLocationEndpointType(),
+ CommonApi: client.ProcessCommonRequest,
+ }
+ endpoint, err = endpoints.Resolve(resolveParam)
+ if err != nil {
+ return
+ }
+ }
+
+ request.SetDomain(endpoint)
if request.GetScheme() == "" {
request.SetScheme(client.config.Scheme)
}
@@ -236,36 +375,213 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
} else {
finalSigner = client.signer
}
- httpRequest, err := buildHttpRequest(request, finalSigner, regionId)
- if client.config.UserAgent != "" {
- httpRequest.Header.Set("User-Agent", client.config.UserAgent)
+ httpRequest, err = buildHttpRequest(request, finalSigner, regionId)
+ if err == nil {
+ userAgent := DefaultUserAgent + getSendUserAgent(client.config.UserAgent, client.userAgent, request.GetUserAgent())
+ httpRequest.Header.Set("User-Agent", userAgent)
}
+
+ return
+}
+
+func getSendUserAgent(configUserAgent string, clientUserAgent, requestUserAgent map[string]string) string {
+ realUserAgent := ""
+ for key1, value1 := range clientUserAgent {
+ for key2, _ := range requestUserAgent {
+ if key1 == key2 {
+ key1 = ""
+ }
+ }
+ if key1 != "" {
+ realUserAgent += fmt.Sprintf(" %s/%s", key1, value1)
+
+ }
+ }
+ for key, value := range requestUserAgent {
+ realUserAgent += fmt.Sprintf(" %s/%s", key, value)
+ }
+ if configUserAgent != "" {
+ return realUserAgent + fmt.Sprintf(" Extra/%s", configUserAgent)
+ }
+ return realUserAgent
+}
+
+func (client *Client) AppendUserAgent(key, value string) {
+ newkey := true
+
+ if client.userAgent == nil {
+ client.userAgent = make(map[string]string)
+ }
+ if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" {
+ for tag, _ := range client.userAgent {
+ if tag == key {
+ client.userAgent[tag] = value
+ newkey = false
+ }
+ }
+ if newkey {
+ client.userAgent[key] = value
+ }
+ }
+}
+
+func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error) {
+ _, err = client.buildRequestWithSigner(request, signer)
+ return
+}
+
+func (client *Client) getTimeout(request requests.AcsRequest) (time.Duration, time.Duration) {
+ readTimeout := defaultReadTimeout
+ connectTimeout := defaultConnectTimeout
+
+ reqReadTimeout := request.GetReadTimeout()
+ reqConnectTimeout := request.GetConnectTimeout()
+ if reqReadTimeout != 0*time.Millisecond {
+ readTimeout = reqReadTimeout
+ } else if client.readTimeout != 0*time.Millisecond {
+ readTimeout = client.readTimeout
+ } else if client.httpClient.Timeout != 0 {
+ readTimeout = client.httpClient.Timeout
+ } else if timeout, ok := getAPIMaxTimeout(request.GetProduct(), request.GetActionName()); ok {
+ readTimeout = timeout
+ }
+
+ if reqConnectTimeout != 0*time.Millisecond {
+ connectTimeout = reqConnectTimeout
+ } else if client.connectTimeout != 0*time.Millisecond {
+ connectTimeout = client.connectTimeout
+ }
+ return readTimeout, connectTimeout
+}
+
+func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) {
+ return func(ctx context.Context, network, address string) (net.Conn, error) {
+ return (&net.Dialer{
+ Timeout: connectTimeout,
+ DualStack: true,
+ }).DialContext(ctx, network, address)
+ }
+}
+
+func (client *Client) setTimeout(request requests.AcsRequest) {
+ readTimeout, connectTimeout := client.getTimeout(request)
+ client.httpClient.Timeout = readTimeout
+ if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil {
+ trans.DialContext = Timeout(connectTimeout)
+ client.httpClient.Transport = trans
+ } else {
+ client.httpClient.Transport = &http.Transport{
+ DialContext: Timeout(connectTimeout),
+ }
+ }
+}
+
+func (client *Client) getHTTPSInsecure(request requests.AcsRequest) (insecure bool) {
+ if request.GetHTTPSInsecure() != nil {
+ insecure = *request.GetHTTPSInsecure()
+ } else {
+ insecure = client.GetHTTPSInsecure()
+ }
+ return insecure
+}
+
+func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error) {
+
+ fieldMap := make(map[string]string)
+ initLogMsg(fieldMap)
+ defer func() {
+ client.printLog(fieldMap, err)
+ }()
+ httpRequest, err := client.buildRequestWithSigner(request, signer)
if err != nil {
return
}
+
+ client.setTimeout(request)
+ proxy, err := client.getHttpProxy(httpRequest.URL.Scheme)
+ if err != nil {
+ return err
+ }
+
+ noProxy := client.getNoProxy(httpRequest.URL.Scheme)
+
+ var flag bool
+ for _, value := range noProxy {
+ if value == httpRequest.Host {
+ flag = true
+ break
+ }
+ }
+
+ // Set whether to ignore certificate validation.
+ // Default InsecureSkipVerify is false.
+ if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil {
+ trans.TLSClientConfig = &tls.Config{
+ InsecureSkipVerify: client.getHTTPSInsecure(request),
+ }
+ if proxy != nil && !flag {
+ trans.Proxy = http.ProxyURL(proxy)
+ }
+ client.httpClient.Transport = trans
+ }
+
var httpResponse *http.Response
for retryTimes := 0; retryTimes <= client.config.MaxRetryTime; retryTimes++ {
- httpResponse, err = client.httpClient.Do(httpRequest)
+ if proxy != nil && proxy.User != nil {
+ if password, passwordSet := proxy.User.Password(); passwordSet {
+ httpRequest.SetBasicAuth(proxy.User.Username(), password)
+ }
+ }
+ if retryTimes > 0 {
+ client.printLog(fieldMap, err)
+ initLogMsg(fieldMap)
+ }
+ putMsgToMap(fieldMap, httpRequest)
+ debug("> %s %s %s", httpRequest.Method, httpRequest.URL.RequestURI(), httpRequest.Proto)
+ debug("> Host: %s", httpRequest.Host)
+ for key, value := range httpRequest.Header {
+ debug("> %s: %v", key, strings.Join(value, ""))
+ }
+ debug(">")
+ debug(" Retry Times: %d.", retryTimes)
- var timeout bool
+ startTime := time.Now()
+ fieldMap["{start_time}"] = startTime.Format("2006-01-02 15:04:05")
+ httpResponse, err = hookDo(client.httpClient.Do)(httpRequest)
+ fieldMap["{cost}"] = time.Now().Sub(startTime).String()
+ if err == nil {
+ fieldMap["{code}"] = strconv.Itoa(httpResponse.StatusCode)
+ fieldMap["{res_headers}"] = TransToString(httpResponse.Header)
+ debug("< %s %s", httpResponse.Proto, httpResponse.Status)
+ for key, value := range httpResponse.Header {
+ debug("< %s: %v", key, strings.Join(value, ""))
+ }
+ }
+ debug("<")
// receive error
if err != nil {
+ debug(" Error: %s.", err.Error())
if !client.config.AutoRetry {
return
- } else if timeout = isTimeout(err); !timeout {
- // if not timeout error, return
- return
} else if retryTimes >= client.config.MaxRetryTime {
// timeout but reached the max retry times, return
- timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, strconv.Itoa(retryTimes+1), strconv.Itoa(retryTimes+1))
+ times := strconv.Itoa(retryTimes + 1)
+ timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, times, times)
+ if strings.Contains(err.Error(), "Client.Timeout") {
+ timeoutErrorMsg += " Read timeout. Please set a valid ReadTimeout."
+ } else {
+ timeoutErrorMsg += " Connect timeout. Please set a valid ConnectTimeout."
+ }
err = errors.NewClientError(errors.TimeoutErrorCode, timeoutErrorMsg, err)
return
}
}
// if status code >= 500 or timeout, will trigger retry
- if client.config.AutoRetry && (timeout || isServerError(httpResponse)) {
+ if client.config.AutoRetry && (err != nil || isServerError(httpResponse)) {
+ client.setTimeout(request)
// rewrite signatureNonce and signature
- httpRequest, err = buildHttpRequest(request, finalSigner, regionId)
+ httpRequest, err = client.buildRequestWithSigner(request, signer)
+ // buildHttpRequest(request, finalSigner, regionId)
if err != nil {
return
}
@@ -273,7 +589,10 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
}
break
}
+
err = responses.Unmarshal(response, httpResponse, request.GetAcceptFormat())
+ fieldMap["{res_body}"] = response.GetHttpContentString()
+ debug("%s", response.GetHttpContentString())
// wrap server errors
if serverErr, ok := err.(*errors.ServerError); ok {
var wrapInfo = map[string]string{}
@@ -283,6 +602,18 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
return
}
+func putMsgToMap(fieldMap map[string]string, request *http.Request) {
+ fieldMap["{host}"] = request.Host
+ fieldMap["{method}"] = request.Method
+ fieldMap["{uri}"] = request.URL.RequestURI()
+ fieldMap["{pid}"] = strconv.Itoa(os.Getpid())
+ fieldMap["{version}"] = strings.Split(request.Proto, "/")[1]
+ hostname, _ := os.Hostname()
+ fieldMap["{hostname}"] = hostname
+ fieldMap["{req_headers}"] = TransToString(request.Header)
+ fieldMap["{target}"] = request.URL.Path + request.URL.RawQuery
+}
+
func buildHttpRequest(request requests.AcsRequest, singer auth.Signer, regionId string) (httpRequest *http.Request, err error) {
err = auth.Sign(request, singer, regionId)
if err != nil {
@@ -305,14 +636,6 @@ func buildHttpRequest(request requests.AcsRequest, singer auth.Signer, regionId
return
}
-func isTimeout(err error) bool {
- if err == nil {
- return false
- }
- netErr, isNetError := err.(net.Error)
- return isNetError && netErr.Timeout()
-}
-
func isServerError(httpResponse *http.Response) bool {
return httpResponse.StatusCode >= http.StatusInternalServerError
}
@@ -345,6 +668,18 @@ func NewClient() (client *Client, err error) {
return
}
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+ client = &Client{}
+ var pc provider.Provider
+ if len(providers) == 0 {
+ pc = provider.DefaultChain
+ } else {
+ pc = provider.NewProviderChain(providers)
+ }
+ err = client.InitWithProviderChain(regionId, pc)
+ return
+}
+
func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error) {
client = &Client{}
err = client.InitWithOptions(regionId, config, credential)
@@ -369,6 +704,12 @@ func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, role
return
}
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
+ client = &Client{}
+ err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+ return
+}
+
func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
client = &Client{}
err = client.InitWithEcsRamRole(regionId, roleName)
@@ -381,14 +722,10 @@ func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, se
return
}
-// Deprecated: Use NewClientWithRamRoleArn in this package instead.
-func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
- return NewClientWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
-}
-
-// Deprecated: Use NewClientWithEcsRamRole in this package instead.
-func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error) {
- return NewClientWithEcsRamRole(regionId, roleName)
+func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error) {
+ client = &Client{}
+ err = client.InitWithBearerToken(regionId, bearerToken)
+ return
}
func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error) {
@@ -404,16 +741,26 @@ func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonReq
response = responses.NewCommonResponse()
err = client.DoActionWithSigner(request, response, signer)
return
- } else {
- panic("should not be here")
}
+ panic("should not be here")
}
func (client *Client) Shutdown() {
- client.signer.Shutdown()
// lock the addAsync()
client.asyncChanLock.Lock()
defer client.asyncChanLock.Unlock()
+ if client.asyncTaskQueue != nil {
+ close(client.asyncTaskQueue)
+ }
client.isRunning = false
- close(client.asyncTaskQueue)
+}
+
+// Deprecated: Use NewClientWithRamRoleArn in this package instead.
+func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+ return NewClientWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+}
+
+// Deprecated: Use NewClientWithEcsRamRole in this package instead.
+func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error) {
+ return NewClientWithEcsRamRole(regionId, roleName)
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go
index c67c2ad09..5e50166fc 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go
@@ -15,9 +15,10 @@
package sdk
import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
"net/http"
"time"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
type Config struct {
@@ -25,12 +26,12 @@ type Config struct {
MaxRetryTime int `default:"3"`
UserAgent string `default:""`
Debug bool `default:"false"`
- Timeout time.Duration `default:"10000000000"`
HttpTransport *http.Transport `default:""`
EnableAsync bool `default:"false"`
MaxTaskQueueSize int `default:"1000"`
GoRoutinePoolSize int `default:"5"`
Scheme string `default:"HTTP"`
+ Timeout time.Duration
}
func NewConfig() (config *Config) {
@@ -39,11 +40,6 @@ func NewConfig() (config *Config) {
return
}
-func (c *Config) WithTimeout(timeout time.Duration) *Config {
- c.Timeout = timeout
- return c
-}
-
func (c *Config) WithAutoRetry(isAutoRetry bool) *Config {
c.AutoRetry = isAutoRetry
return c
@@ -59,6 +55,16 @@ func (c *Config) WithUserAgent(userAgent string) *Config {
return c
}
+func (c *Config) WithDebug(isDebug bool) *Config {
+ c.Debug = isDebug
+ return c
+}
+
+func (c *Config) WithTimeout(timeout time.Duration) *Config {
+ c.Timeout = timeout
+ return c
+}
+
func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config {
c.HttpTransport = httpTransport
return c
@@ -79,7 +85,7 @@ func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config {
return c
}
-func (c *Config) WithDebug(isDebug bool) *Config {
- c.Debug = isDebug
+func (c *Config) WithScheme(scheme string) *Config {
+ c.Scheme = scheme
return c
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go
index ec0d56f60..a4fc47098 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go
@@ -1,3 +1,4 @@
+
package endpoints
import (
@@ -6,491 +7,4111 @@ import (
"sync"
)
-const endpointsJson = "{" +
- " \"products\":[" +
- " {" +
- " \"code\": \"aegis\"," +
- " \"document_id\": \"28449\"," +
- " \"location_service_code\": \"vipaegis\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"aegis.cn-hangzhou.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"alidns\"," +
- " \"document_id\": \"29739\"," +
- " \"location_service_code\": \"alidns\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"alidns.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"arms\"," +
- " \"document_id\": \"42924\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"ap-southeast-1\"," +
- " \"endpoint\": \"arms.ap-southeast-1.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-beijing\"," +
- " \"endpoint\": \"arms.cn-beijing.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"arms.cn-hangzhou.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hongkong\"," +
- " \"endpoint\": \"arms.cn-hongkong.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-qingdao\"," +
- " \"endpoint\": \"arms.cn-qingdao.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shanghai\"," +
- " \"endpoint\": \"arms.cn-shanghai.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shenzhen\"," +
- " \"endpoint\": \"arms.cn-shenzhen.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"arms.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"batchcompute\"," +
- " \"document_id\": \"44717\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"ap-southeast-1\"," +
- " \"endpoint\": \"batchcompute.ap-southeast-1.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-beijing\"," +
- " \"endpoint\": \"batchcompute.cn-beijing.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"batchcompute.cn-hangzhou.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-huhehaote\"," +
- " \"endpoint\": \"batchcompute.cn-huhehaote.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-qingdao\"," +
- " \"endpoint\": \"batchcompute.cn-qingdao.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shanghai\"," +
- " \"endpoint\": \"batchcompute.cn-shanghai.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shenzhen\"," +
- " \"endpoint\": \"batchcompute.cn-shenzhen.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-zhangjiakou\"," +
- " \"endpoint\": \"batchcompute.cn-zhangjiakou.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"us-west-1\"," +
- " \"endpoint\": \"batchcompute.us-west-1.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"batchcompute.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"ccc\"," +
- " \"document_id\": \"63027\"," +
- " \"location_service_code\": \"ccc\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"ccc.cn-hangzhou.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shanghai\"," +
- " \"endpoint\": \"ccc.cn-shanghai.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"ccc.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"cdn\"," +
- " \"document_id\": \"27148\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cdn.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"cds\"," +
- " \"document_id\": \"62887\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cds.cn-beijing.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"chatbot\"," +
- " \"document_id\": \"60760\"," +
- " \"location_service_code\": \"beebot\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"chatbot.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"cloudapi\"," +
- " \"document_id\": \"43590\"," +
- " \"location_service_code\": \"apigateway\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"ap-northeast-1\"," +
- " \"endpoint\": \"apigateway.ap-northeast-1.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"us-west-1\"," +
- " \"endpoint\": \"apigateway.us-west-1.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"apigateway.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"cloudauth\"," +
- " \"document_id\": \"60687\"," +
- " \"location_service_code\": \"cloudauth\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cloudauth.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"cloudphoto\"," +
- " \"document_id\": \"59902\"," +
- " \"location_service_code\": \"cloudphoto\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"cloudphoto.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"cloudwf\"," +
- " \"document_id\": \"58111\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cloudwf.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"cms\"," +
- " \"document_id\": \"28615\"," +
- " \"location_service_code\": \"cms\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"cr\"," +
- " \"document_id\": \"60716\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cr.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"cs\"," +
- " \"document_id\": \"26043\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cs.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"csb\"," +
- " \"document_id\": \"64837\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"cn-beijing\"," +
- " \"endpoint\": \"csb.cn-beijing.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"csb.cn-hangzhou.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"csb.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"dds\"," +
- " \"document_id\": \"61715\"," +
- " \"location_service_code\": \"dds\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"mongodb.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"mongodb.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"dm\"," +
- " \"document_id\": \"29434\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"ap-southeast-1\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"ap-southeast-2\"," +
- " \"endpoint\": \"dm.ap-southeast-2.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-beijing\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-hongkong\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-qingdao\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shanghai\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"cn-shenzhen\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"us-east-1\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"us-west-1\"," +
- " \"endpoint\": \"dm.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"dm.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"dm.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"domain\"," +
- " \"document_id\": \"42875\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"domain.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"domain.aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"domain-intl\"," +
- " \"document_id\": \"\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"domain-intl.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"domain-intl.aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"drds\"," +
- " \"document_id\": \"51111\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"drds.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"drds.aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"ecs\"," +
- " \"document_id\": \"25484\"," +
- " \"location_service_code\": \"ecs\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"emr\"," +
- " \"document_id\": \"28140\"," +
- " \"location_service_code\": \"emr\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"emr.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"ess\"," +
- " \"document_id\": \"25925\"," +
- " \"location_service_code\": \"ess\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"ess.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"green\"," +
- " \"document_id\": \"28427\"," +
- " \"location_service_code\": \"green\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"green.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"hpc\"," +
- " \"document_id\": \"35201\"," +
- " \"location_service_code\": \"hpc\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"hpc.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"httpdns\"," +
- " \"document_id\": \"52679\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"httpdns-api.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"iot\"," +
- " \"document_id\": \"30557\"," +
- " \"location_service_code\": \"iot\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"iot.[RegionId].aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"itaas\"," +
- " \"document_id\": \"55759\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"itaas.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"jaq\"," +
- " \"document_id\": \"35037\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"jaq.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"live\"," +
- " \"document_id\": \"48207\"," +
- " \"location_service_code\": \"live\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"live.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"mts\"," +
- " \"document_id\": \"29212\"," +
- " \"location_service_code\": \"mts\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"nas\"," +
- " \"document_id\": \"62598\"," +
- " \"location_service_code\": \"nas\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"ons\"," +
- " \"document_id\": \"44416\"," +
- " \"location_service_code\": \"ons\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"polardb\"," +
- " \"document_id\": \"58764\"," +
- " \"location_service_code\": \"polardb\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"ap-south-1\"," +
- " \"endpoint\": \"polardb.ap-south-1.aliyuncs.com\"" +
- " }, {" +
- " \"region\": \"ap-southeast-5\"," +
- " \"endpoint\": \"polardb.ap-southeast-5.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"polardb.aliyuncs.com\"" +
- " }," +
- " {" +
- " \"code\": \"push\"," +
- " \"document_id\": \"30074\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"cloudpush.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"qualitycheck\"," +
- " \"document_id\": \"50807\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": [ {" +
- " \"region\": \"cn-hangzhou\"," +
- " \"endpoint\": \"qualitycheck.cn-hangzhou.aliyuncs.com\"" +
- " }]," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"r-kvstore\"," +
- " \"document_id\": \"60831\"," +
- " \"location_service_code\": \"redisa\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"ram\"," +
- " \"document_id\": \"28672\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"ram.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"rds\"," +
- " \"document_id\": \"26223\"," +
- " \"location_service_code\": \"rds\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"ros\"," +
- " \"document_id\": \"28899\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"ros.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"sas-api\"," +
- " \"document_id\": \"28498\"," +
- " \"location_service_code\": \"sas\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"slb\"," +
- " \"document_id\": \"27565\"," +
- " \"location_service_code\": \"slb\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"sts\"," +
- " \"document_id\": \"28756\"," +
- " \"location_service_code\": \"\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"sts.aliyuncs.com\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"vod\"," +
- " \"document_id\": \"60574\"," +
- " \"location_service_code\": \"vod\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"vpc\"," +
- " \"document_id\": \"34962\"," +
- " \"location_service_code\": \"vpc\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }," +
- " {" +
- " \"code\": \"waf\"," +
- " \"document_id\": \"62847\"," +
- " \"location_service_code\": \"waf\"," +
- " \"regional_endpoints\": []," +
- " \"global_endpoint\": \"\"," +
- " \"regional_endpoint_pattern\": \"\"" +
- " }]" +
- "}"
-
+const endpointsJson =`{
+ "products": [
+ {
+ "code": "emr",
+ "document_id": "28140",
+ "location_service_code": "emr",
+ "regional_endpoints": [
+ {
+ "region": "cn-qingdao",
+ "endpoint": "emr.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "emr.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "emr.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "emr.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "emr.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "emr.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "emr.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "emr.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "emr.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "emr.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "emr.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "emr.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "emr.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "emr.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "emr.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "emr.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "emr.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "emr.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "emr.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "emr.aliyuncs.com",
+ "regional_endpoint_pattern": "emr.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "petadata",
+ "document_id": "",
+ "location_service_code": "petadata",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "petadata.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "petadata.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "petadata.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "petadata.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "petadata.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "petadata.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "petadata.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "petadata.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "petadata.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dbs",
+ "document_id": "",
+ "location_service_code": "dbs",
+ "regional_endpoints": [
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "dbs-api.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "dbs-api.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "dbs-api.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "alidnsgtm",
+ "document_id": "",
+ "location_service_code": "alidnsgtm",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "alidns.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "alidns.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "elasticsearch",
+ "document_id": "",
+ "location_service_code": "elasticsearch",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "elasticsearch.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "elasticsearch.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "elasticsearch.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "elasticsearch.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "elasticsearch.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "elasticsearch.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "elasticsearch.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "elasticsearch.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "elasticsearch.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "elasticsearch.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "elasticsearch.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "elasticsearch.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "elasticsearch.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "elasticsearch.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "elasticsearch.ap-northeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "baas",
+ "document_id": "",
+ "location_service_code": "baas",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "baas.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "baas.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "baas.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "baas.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "baas.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "baas.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cr",
+ "document_id": "60716",
+ "location_service_code": "cr",
+ "regional_endpoints": null,
+ "global_endpoint": "cr.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudap",
+ "document_id": "",
+ "location_service_code": "cloudap",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cloudwf.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "imagesearch",
+ "document_id": "",
+ "location_service_code": "imagesearch",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "imagesearch.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "imagesearch.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "imagesearch.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "imagesearch.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "pts",
+ "document_id": "",
+ "location_service_code": "pts",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "pts.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ehs",
+ "document_id": "",
+ "location_service_code": "ehs",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "ehpc.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ehpc.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ehpc.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ehpc.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "ehpc.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ehpc.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ehpc.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ehpc.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ehpc.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ehpc.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ehpc.ap-southeast-2.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "polardb",
+ "document_id": "58764",
+ "location_service_code": "polardb",
+ "regional_endpoints": [
+ {
+ "region": "ap-south-1",
+ "endpoint": "polardb.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "polardb.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "polardb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "polardb.ap-southeast-5.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "polardb.aliyuncs.com"
+ },
+ {
+ "code": "r-kvstore",
+ "document_id": "60831",
+ "location_service_code": "redisa",
+ "regional_endpoints": [
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "r-kvstore.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "r-kvstore.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "r-kvstore.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "r-kvstore.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "r-kvstore.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "r-kvstore.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "r-kvstore.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "r-kvstore.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "r-kvstore.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "r-kvstore.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "r-kvstore.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "r-kvstore.ap-southeast-5.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "r-kvstore.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "xianzhi",
+ "document_id": "",
+ "location_service_code": "xianzhi",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "xianzhi.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "pcdn",
+ "document_id": "",
+ "location_service_code": "pcdn",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "pcdn.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cdn",
+ "document_id": "27148",
+ "location_service_code": "cdn",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cdn.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "cdn.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudauth",
+ "document_id": "60687",
+ "location_service_code": "cloudauth",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cloudauth.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "cloudauth.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "nas",
+ "document_id": "62598",
+ "location_service_code": "nas",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "nas.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "nas.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "nas.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "nas.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "nas.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "nas.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "nas.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "nas.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "nas.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "nas.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "nas.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "nas.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "nas.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "nas.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "nas.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "nas.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "nas.ap-southeast-3.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "alidns",
+ "document_id": "29739",
+ "location_service_code": "alidns",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "alidns.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "alidns.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dts",
+ "document_id": "",
+ "location_service_code": "dts",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "dts.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "dts.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "emas",
+ "document_id": "",
+ "location_service_code": "emas",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "mhub.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "mhub.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dysmsapi",
+ "document_id": "",
+ "location_service_code": "dysmsapi",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-chengdu",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "dysmsapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dysmsapi.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudwf",
+ "document_id": "58111",
+ "location_service_code": "cloudwf",
+ "regional_endpoints": null,
+ "global_endpoint": "cloudwf.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "fc",
+ "document_id": "",
+ "location_service_code": "fc",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "cn-beijing.fc.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ap-southeast-2.fc.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "cn-huhehaote.fc.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "cn-shanghai.fc.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cn-hangzhou.fc.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "cn-shenzhen.fc.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "saf",
+ "document_id": "",
+ "location_service_code": "saf",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "saf.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "saf.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "saf.cn-shenzhen.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "rds",
+ "document_id": "26223",
+ "location_service_code": "rds",
+ "regional_endpoints": [
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "rds.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "rds.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "rds.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "rds.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "rds.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "rds.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "rds.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "rds.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "rds.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "rds.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "rds.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "rds.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "rds.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "vpc",
+ "document_id": "34962",
+ "location_service_code": "vpc",
+ "regional_endpoints": [
+ {
+ "region": "ap-south-1",
+ "endpoint": "vpc.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "vpc.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "vpc.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "vpc.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "vpc.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "vpc.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "vpc.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "vpc.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "vpc.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "vpc.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "vpc.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "vpc.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "vpc.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "gpdb",
+ "document_id": "",
+ "location_service_code": "gpdb",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "gpdb.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "gpdb.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "gpdb.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "gpdb.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "gpdb.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "gpdb.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "gpdb.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "gpdb.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "gpdb.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "gpdb.ap-south-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "gpdb.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "yunmarket",
+ "document_id": "",
+ "location_service_code": "yunmarket",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "market.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "pvtz",
+ "document_id": "",
+ "location_service_code": "pvtz",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "pvtz.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "pvtz.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "oss",
+ "document_id": "",
+ "location_service_code": "oss",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "oss-cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "oss-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "oss-cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "oss-cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "oss-cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "oss-ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "oss-us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "oss-cn-qingdao.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "foas",
+ "document_id": "",
+ "location_service_code": "foas",
+ "regional_endpoints": [
+ {
+ "region": "cn-qingdao",
+ "endpoint": "foas.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "foas.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "foas.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "foas.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "foas.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "foas.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "foas.ap-northeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddos",
+ "document_id": "",
+ "location_service_code": "ddos",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ddospro.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ddospro.cn-hongkong.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cbn",
+ "document_id": "",
+ "location_service_code": "cbn",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "cbn.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "cbn.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "cbn.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "nlp",
+ "document_id": "",
+ "location_service_code": "nlp",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "nlp.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hsm",
+ "document_id": "",
+ "location_service_code": "hsm",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "hsm.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "hsm.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "hsm.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "hsm.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "hsm.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "hsm.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ons",
+ "document_id": "44416",
+ "location_service_code": "ons",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ons.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ons.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "ons.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ons.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ons.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "ons.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ons.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ons.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ons.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "ons.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "ons.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ons.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "ons.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "ons.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "ons.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "ons.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ons.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ons.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "kms",
+ "document_id": "",
+ "location_service_code": "kms",
+ "regional_endpoints": [
+ {
+ "region": "cn-hongkong",
+ "endpoint": "kms.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "kms.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "kms.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "kms.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "kms.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "kms.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "kms.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "kms.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "kms.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "kms.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "kms.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "kms.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "kms.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "kms.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "kms.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "kms.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "kms.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "kms.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "kms.ap-northeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cps",
+ "document_id": "",
+ "location_service_code": "cps",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cloudpush.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ensdisk",
+ "document_id": "",
+ "location_service_code": "ensdisk",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ens.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudapi",
+ "document_id": "43590",
+ "location_service_code": "apigateway",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "apigateway.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "apigateway.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "apigateway.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "apigateway.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "apigateway.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "apigateway.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "apigateway.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "apigateway.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "apigateway.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "apigateway.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "apigateway.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "apigateway.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "apigateway.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "apigateway.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "apigateway.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "apigateway.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "apigateway.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "apigateway.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "apigateway.cn-hongkong.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "apigateway.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "eci",
+ "document_id": "",
+ "location_service_code": "eci",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "eci.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "eci.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "eci.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "eci.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "eci.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "eci.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "onsvip",
+ "document_id": "",
+ "location_service_code": "onsvip",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "ons.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ons.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ons.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ons.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ons.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ons.cn-qingdao.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "linkwan",
+ "document_id": "",
+ "location_service_code": "linkwan",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "linkwan.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "linkwan.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddosdip",
+ "document_id": "",
+ "location_service_code": "ddosdip",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ddosdip.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "batchcompute",
+ "document_id": "44717",
+ "location_service_code": "batchcompute",
+ "regional_endpoints": [
+ {
+ "region": "us-west-1",
+ "endpoint": "batchcompute.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "batchcompute.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "batchcompute.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "batchcompute.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "batchcompute.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "batchcompute.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "batchcompute.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "batchcompute.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "batchcompute.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "batchcompute.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "aegis",
+ "document_id": "28449",
+ "location_service_code": "vipaegis",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "aegis.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "aegis.ap-southeast-3.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "aegis.cn-hangzhou.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "arms",
+ "document_id": "42924",
+ "location_service_code": "arms",
+ "regional_endpoints": [
+ {
+ "region": "cn-hongkong",
+ "endpoint": "arms.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "arms.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "arms.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "arms.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "arms.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "arms.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "arms.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "arms.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "live",
+ "document_id": "48207",
+ "location_service_code": "live",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "live.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "live.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "live.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "alimt",
+ "document_id": "",
+ "location_service_code": "alimt",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "mt.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "actiontrail",
+ "document_id": "",
+ "location_service_code": "actiontrail",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "actiontrail.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "actiontrail.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "actiontrail.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "actiontrail.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "actiontrail.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "actiontrail.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "actiontrail.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "actiontrail.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "actiontrail.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "actiontrail.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "actiontrail.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "actiontrail.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "actiontrail.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "actiontrail.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "actiontrail.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "actiontrail.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "actiontrail.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "actiontrail.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "actiontrail.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "smartag",
+ "document_id": "",
+ "location_service_code": "smartag",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "smartag.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "smartag.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "smartag.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "smartag.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "smartag.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "smartag.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "smartag.ap-southeast-2.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "vod",
+ "document_id": "60574",
+ "location_service_code": "vod",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "vod.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "vod.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "vod.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "vod.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "vod.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "vod.eu-central-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "domain",
+ "document_id": "42875",
+ "location_service_code": "domain",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "domain-intl.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "domain.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "domain.aliyuncs.com",
+ "regional_endpoint_pattern": "domain.aliyuncs.com"
+ },
+ {
+ "code": "ros",
+ "document_id": "28899",
+ "location_service_code": "ros",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ros.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "ros.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudphoto",
+ "document_id": "59902",
+ "location_service_code": "cloudphoto",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "cloudphoto.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "cloudphoto.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "rtc",
+ "document_id": "",
+ "location_service_code": "rtc",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "rtc.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "odpsmayi",
+ "document_id": "",
+ "location_service_code": "odpsmayi",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "bsb.cloud.alipay.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "bsb.cloud.alipay.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ims",
+ "document_id": "",
+ "location_service_code": "ims",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ims.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "csb",
+ "document_id": "64837",
+ "location_service_code": "csb",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "csb.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "csb.cn-beijing.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "csb.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "cds",
+ "document_id": "62887",
+ "location_service_code": "codepipeline",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "cds.cn-beijing.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "cds.cn-beijing.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddosbgp",
+ "document_id": "",
+ "location_service_code": "ddosbgp",
+ "regional_endpoints": [
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ddosbgp.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "ddosbgp.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ddosbgp.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dybaseapi",
+ "document_id": "",
+ "location_service_code": "dybaseapi",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-chengdu",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "dybaseapi.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "dybaseapi.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ecs",
+ "document_id": "25484",
+ "location_service_code": "ecs",
+ "regional_endpoints": [
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ecs.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "ecs.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ecs.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "ecs.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "ecs.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "ecs.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ecs.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "ecs.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "ecs.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "ecs.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ecs-cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "ecs-cn-hangzhou.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ccc",
+ "document_id": "63027",
+ "location_service_code": "ccc",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ccc.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ccc.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "ccc.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "cs",
+ "document_id": "26043",
+ "location_service_code": "cs",
+ "regional_endpoints": null,
+ "global_endpoint": "cs.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "drdspre",
+ "document_id": "",
+ "location_service_code": "drdspre",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "drds.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "drds.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "drds.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "drds.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "drds.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "drds.cn-qingdao.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "drds.cn-beijing.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dcdn",
+ "document_id": "",
+ "location_service_code": "dcdn",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dcdn.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "dcdn.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "linkedmall",
+ "document_id": "",
+ "location_service_code": "linkedmall",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "linkedmall.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "linkedmall.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "trademark",
+ "document_id": "",
+ "location_service_code": "trademark",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "trademark.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "openanalytics",
+ "document_id": "",
+ "location_service_code": "openanalytics",
+ "regional_endpoints": [
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "openanalytics.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "openanalytics.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "openanalytics.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "openanalytics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "openanalytics.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "openanalytics.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "openanalytics.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "openanalytics.cn-zhangjiakou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "sts",
+ "document_id": "28756",
+ "location_service_code": "sts",
+ "regional_endpoints": null,
+ "global_endpoint": "sts.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "waf",
+ "document_id": "62847",
+ "location_service_code": "waf",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "wafopenapi.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ots",
+ "document_id": "",
+ "location_service_code": "ots",
+ "regional_endpoints": [
+ {
+ "region": "me-east-1",
+ "endpoint": "ots.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "ots.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "ots.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ots.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ots.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ots.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "ots.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "ots.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "ots.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "ots.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ots.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ots.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "ots.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ots.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ots.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "ots.ap-southeast-3.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cloudfirewall",
+ "document_id": "",
+ "location_service_code": "cloudfirewall",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cloudfw.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dm",
+ "document_id": "29434",
+ "location_service_code": "dm",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "dm.ap-southeast-2.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "dm.aliyuncs.com",
+ "regional_endpoint_pattern": "dm.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "oas",
+ "document_id": "",
+ "location_service_code": "oas",
+ "regional_endpoints": [
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "cn-shenzhen.oas.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "cn-beijing.oas.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cn-hangzhou.oas.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddoscoo",
+ "document_id": "",
+ "location_service_code": "ddoscoo",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ddoscoo.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "jaq",
+ "document_id": "35037",
+ "location_service_code": "jaq",
+ "regional_endpoints": null,
+ "global_endpoint": "jaq.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "iovcc",
+ "document_id": "",
+ "location_service_code": "iovcc",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "iovcc.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "sas-api",
+ "document_id": "28498",
+ "location_service_code": "sas",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "sas.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "chatbot",
+ "document_id": "60760",
+ "location_service_code": "beebot",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "chatbot.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "chatbot.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "chatbot.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "airec",
+ "document_id": "",
+ "location_service_code": "airec",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "airec.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "airec.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "airec.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "dmsenterprise",
+ "document_id": "",
+ "location_service_code": "dmsenterprise",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "dms-enterprise.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ivision",
+ "document_id": "",
+ "location_service_code": "ivision",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ivision.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ivision.cn-beijing.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "odpsplusmayi",
+ "document_id": "",
+ "location_service_code": "odpsplusmayi",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "bsb.cloud.alipay.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "bsb.cloud.alipay.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "bsb.cloud.alipay.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "gameshield",
+ "document_id": "",
+ "location_service_code": "gameshield",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "gameshield.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "gameshield.cn-zhangjiakou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "scdn",
+ "document_id": "",
+ "location_service_code": "scdn",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "scdn.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hitsdb",
+ "document_id": "",
+ "location_service_code": "hitsdb",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "hitsdb.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hdm",
+ "document_id": "",
+ "location_service_code": "hdm",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "hdm-api.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "slb",
+ "document_id": "27565",
+ "location_service_code": "slb",
+ "regional_endpoints": [
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "slb.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "slb.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "slb.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "slb.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "slb.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "slb.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "slb.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "slb.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "slb.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "slb.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "slb.cn-zhangjiakou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "slb.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "green",
+ "document_id": "28427",
+ "location_service_code": "green",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "green.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "green.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "green.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "green.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "green.us-west-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "green.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cccvn",
+ "document_id": "",
+ "location_service_code": "cccvn",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "voicenavigator.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddosrewards",
+ "document_id": "",
+ "location_service_code": "ddosrewards",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ddosright.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "iot",
+ "document_id": "30557",
+ "location_service_code": "iot",
+ "regional_endpoints": [
+ {
+ "region": "us-east-1",
+ "endpoint": "iot.us-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "iot.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "iot.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "iot.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "iot.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "iot.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": "iot.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "bssopenapi",
+ "document_id": "",
+ "location_service_code": "bssopenapi",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "business.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "business.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "sca",
+ "document_id": "",
+ "location_service_code": "sca",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "luban",
+ "document_id": "",
+ "location_service_code": "luban",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "luban.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "luban.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "drdspost",
+ "document_id": "",
+ "location_service_code": "drdspost",
+ "regional_endpoints": [
+ {
+ "region": "cn-shanghai",
+ "endpoint": "drds.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "drds.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "drds.ap-southeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "drds",
+ "document_id": "51111",
+ "location_service_code": "drds",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "drds.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "drds.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "drds.aliyuncs.com",
+ "regional_endpoint_pattern": "drds.aliyuncs.com"
+ },
+ {
+ "code": "httpdns",
+ "document_id": "52679",
+ "location_service_code": "httpdns",
+ "regional_endpoints": null,
+ "global_endpoint": "httpdns-api.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cas",
+ "document_id": "",
+ "location_service_code": "cas",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "cas.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "cas.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "cas.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "cas.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "cas.me-east-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hpc",
+ "document_id": "35201",
+ "location_service_code": "hpc",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "hpc.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "hpc.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "hpc.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ddosbasic",
+ "document_id": "",
+ "location_service_code": "ddosbasic",
+ "regional_endpoints": [
+ {
+ "region": "ap-south-1",
+ "endpoint": "antiddos-openapi.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "antiddos-openapi.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "antiddos-openapi.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "antiddos-openapi.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "antiddos-openapi.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "antiddos-openapi.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "antiddos-openapi.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "antiddos-openapi.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "antiddos-openapi.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "antiddos.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "antiddos-openapi.ap-northeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "antiddos.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "clouddesktop",
+ "document_id": "",
+ "location_service_code": "clouddesktop",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "clouddesktop.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "clouddesktop.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "clouddesktop.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "clouddesktop.cn-shenzhen.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "uis",
+ "document_id": "",
+ "location_service_code": "uis",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "uis.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "imm",
+ "document_id": "",
+ "location_service_code": "imm",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "imm.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "imm.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "imm.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "imm.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "imm.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "imm.cn-shenzhen.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ens",
+ "document_id": "",
+ "location_service_code": "ens",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ens.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ram",
+ "document_id": "28672",
+ "location_service_code": "ram",
+ "regional_endpoints": null,
+ "global_endpoint": "ram.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hcs_mgw",
+ "document_id": "",
+ "location_service_code": "hcs_mgw",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "mgw.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "mgw.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "mgw.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "itaas",
+ "document_id": "55759",
+ "location_service_code": "itaas",
+ "regional_endpoints": null,
+ "global_endpoint": "itaas.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "qualitycheck",
+ "document_id": "50807",
+ "location_service_code": "qualitycheck",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "alikafka",
+ "document_id": "",
+ "location_service_code": "alikafka",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "alikafka.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "alikafka.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "alikafka.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "alikafka.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "alikafka.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "alikafka.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "alikafka.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "alikafka.cn-qingdao.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "faas",
+ "document_id": "",
+ "location_service_code": "faas",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "faas.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "faas.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "faas.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "faas.cn-beijing.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "alidfs",
+ "document_id": "",
+ "location_service_code": "alidfs",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "dfs.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "dfs.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "cms",
+ "document_id": "28615",
+ "location_service_code": "cms",
+ "regional_endpoints": [
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "metrics.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "metrics.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "metrics.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "metrics.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "metrics.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "metrics.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "metrics.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "metrics.cn-hangzhou.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "domain-intl",
+ "document_id": "",
+ "location_service_code": "domain-intl",
+ "regional_endpoints": null,
+ "global_endpoint": "domain-intl.aliyuncs.com",
+ "regional_endpoint_pattern": "domain-intl.aliyuncs.com"
+ },
+ {
+ "code": "kvstore",
+ "document_id": "",
+ "location_service_code": "kvstore",
+ "regional_endpoints": [
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ccs",
+ "document_id": "",
+ "location_service_code": "ccs",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ccs.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "ess",
+ "document_id": "25925",
+ "location_service_code": "ess",
+ "regional_endpoints": [
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "ess.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "ess.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "ess.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "ess.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "ess.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "ess.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "ess.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "ess.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "ess.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "ess.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "ess.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "ess.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "ess.aliyuncs.com",
+ "regional_endpoint_pattern": "ess.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "dds",
+ "document_id": "61715",
+ "location_service_code": "dds",
+ "regional_endpoints": [
+ {
+ "region": "me-east-1",
+ "endpoint": "mongodb.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "mongodb.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "mongodb.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "mongodb.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "mongodb.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "mongodb.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "mongodb.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "mongodb.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "mongodb.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "mongodb.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "mongodb.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "mongodb.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "mongodb.aliyuncs.com",
+ "regional_endpoint_pattern": "mongodb.[RegionId].aliyuncs.com"
+ },
+ {
+ "code": "mts",
+ "document_id": "29212",
+ "location_service_code": "mts",
+ "regional_endpoints": [
+ {
+ "region": "cn-beijing",
+ "endpoint": "mts.cn-beijing.aliyuncs.com"
+ },
+ {
+ "region": "ap-northeast-1",
+ "endpoint": "mts.ap-northeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "mts.cn-hongkong.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "mts.cn-shenzhen.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "mts.cn-zhangjiakou.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "mts.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "mts.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "mts.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "mts.us-west-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "mts.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-west-1",
+ "endpoint": "mts.eu-west-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "mts.cn-hangzhou.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "push",
+ "document_id": "30074",
+ "location_service_code": "push",
+ "regional_endpoints": null,
+ "global_endpoint": "cloudpush.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hcs_sgw",
+ "document_id": "",
+ "location_service_code": "hcs_sgw",
+ "regional_endpoints": [
+ {
+ "region": "eu-central-1",
+ "endpoint": "sgw.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-zhangjiakou",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "sgw.ap-southeast-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-hongkong",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "sgw.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "sgw.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "hbase",
+ "document_id": "",
+ "location_service_code": "hbase",
+ "regional_endpoints": [
+ {
+ "region": "cn-huhehaote",
+ "endpoint": "hbase.cn-huhehaote.aliyuncs.com"
+ },
+ {
+ "region": "ap-south-1",
+ "endpoint": "hbase.ap-south-1.aliyuncs.com"
+ },
+ {
+ "region": "us-west-1",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "me-east-1",
+ "endpoint": "hbase.me-east-1.aliyuncs.com"
+ },
+ {
+ "region": "eu-central-1",
+ "endpoint": "hbase.eu-central-1.aliyuncs.com"
+ },
+ {
+ "region": "cn-qingdao",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "cn-shenzhen",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-2",
+ "endpoint": "hbase.ap-southeast-2.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-3",
+ "endpoint": "hbase.ap-southeast-3.aliyuncs.com"
+ },
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "us-east-1",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-5",
+ "endpoint": "hbase.ap-southeast-5.aliyuncs.com"
+ },
+ {
+ "region": "cn-beijing",
+ "endpoint": "hbase.aliyuncs.com"
+ },
+ {
+ "region": "ap-southeast-1",
+ "endpoint": "hbase.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "hbase.aliyuncs.com",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "bastionhost",
+ "document_id": "",
+ "location_service_code": "bastionhost",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "yundun-bastionhost.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ },
+ {
+ "code": "vs",
+ "document_id": "",
+ "location_service_code": "vs",
+ "regional_endpoints": [
+ {
+ "region": "cn-hangzhou",
+ "endpoint": "vs.cn-hangzhou.aliyuncs.com"
+ },
+ {
+ "region": "cn-shanghai",
+ "endpoint": "vs.cn-shanghai.aliyuncs.com"
+ }
+ ],
+ "global_endpoint": "",
+ "regional_endpoint_pattern": ""
+ }
+ ]
+}`
var initOnce sync.Once
var data interface{}
@@ -498,7 +4119,7 @@ func getEndpointConfigData() interface{} {
initOnce.Do(func() {
err := json.Unmarshal([]byte(endpointsJson), &data)
if err != nil {
- fmt.Println("init endpoint config data failed.", err)
+ panic(fmt.Sprintf("init endpoint config data failed. %s", err))
}
})
return data
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go
index 864b7cc4c..160e62cb6 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_global_resolver.go
@@ -16,13 +16,19 @@ package endpoints
import (
"fmt"
- "github.com/jmespath/go-jmespath"
"strings"
+
+ "github.com/jmespath/go-jmespath"
)
type LocalGlobalResolver struct {
}
+func (resolver *LocalGlobalResolver) GetName() (name string) {
+ name = "local global resolver"
+ return
+}
+
func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
// get the global endpoints configs
endpointExpression := fmt.Sprintf("products[?code=='%s'].global_endpoint", strings.ToLower(param.Product))
@@ -30,7 +36,7 @@ func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint s
if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 {
endpoint = endpointData.([]interface{})[0].(string)
support = len(endpoint) > 0
- return endpoint, support, nil
+ return
}
support = false
return
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go
index f8aa0f92a..7fee64d42 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/local_regional_resolver.go
@@ -16,24 +16,31 @@ package endpoints
import (
"fmt"
- "github.com/jmespath/go-jmespath"
"strings"
+
+ "github.com/jmespath/go-jmespath"
)
type LocalRegionalResolver struct {
}
+func (resolver *LocalRegionalResolver) GetName() (name string) {
+ name = "local regional resolver"
+ return
+}
+
func (resolver *LocalRegionalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
// get the regional endpoints configs
regionalExpression := fmt.Sprintf("products[?code=='%s'].regional_endpoints", strings.ToLower(param.Product))
regionalData, err := jmespath.Search(regionalExpression, getEndpointConfigData())
if err == nil && regionalData != nil && len(regionalData.([]interface{})) > 0 {
endpointExpression := fmt.Sprintf("[0][?region=='%s'].endpoint", strings.ToLower(param.RegionId))
- endpointData, err := jmespath.Search(endpointExpression, regionalData)
+ var endpointData interface{}
+ endpointData, err = jmespath.Search(endpointExpression, regionalData)
if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 {
endpoint = endpointData.([]interface{})[0].(string)
support = len(endpoint) > 0
- return endpoint, support, nil
+ return
}
}
support = false
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go
index 803bc57d5..cc354cc4d 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go
@@ -15,28 +15,51 @@ package endpoints
import (
"encoding/json"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"sync"
"time"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
const (
+ // EndpointCacheExpireTime ...
EndpointCacheExpireTime = 3600 //Seconds
)
-var lastClearTimePerProduct = struct {
+// Cache caches endpoint for specific product and region
+type Cache struct {
sync.RWMutex
- cache map[string]int64
-}{cache: make(map[string]int64)}
+ cache map[string]interface{}
+}
-var endpointCache = struct {
- sync.RWMutex
- cache map[string]string
-}{cache: make(map[string]string)}
+// Get ...
+func (c *Cache) Get(k string) (v interface{}) {
+ c.RLock()
+ v = c.cache[k]
+ c.RUnlock()
+ return
+}
+// Set ...
+func (c *Cache) Set(k string, v interface{}) {
+ c.Lock()
+ c.cache[k] = v
+ c.Unlock()
+}
+
+var lastClearTimePerProduct = &Cache{cache: make(map[string]interface{})}
+var endpointCache = &Cache{cache: make(map[string]interface{})}
+
+// LocationResolver ...
type LocationResolver struct {
}
+func (resolver *LocationResolver) GetName() (name string) {
+ name = "location resolver"
+ return
+}
+
+// TryResolve resolves endpoint giving product and region
func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
if len(param.LocationProduct) <= 0 {
support = false
@@ -45,8 +68,10 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
//get from cache
cacheKey := param.Product + "#" + param.RegionId
- if endpointCache.cache != nil && len(endpointCache.cache[cacheKey]) > 0 && !CheckCacheIsExpire(cacheKey) {
- endpoint = endpointCache.cache[cacheKey]
+ var ok bool
+ endpoint, ok = endpointCache.Get(cacheKey).(string)
+
+ if ok && len(endpoint) > 0 && !CheckCacheIsExpire(cacheKey) {
support = true
return
}
@@ -57,7 +82,7 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
getEndpointRequest.Product = "Location"
getEndpointRequest.Version = "2015-06-12"
getEndpointRequest.ApiName = "DescribeEndpoints"
- getEndpointRequest.Domain = "location.aliyuncs.com"
+ getEndpointRequest.Domain = "location-readonly.aliyuncs.com"
getEndpointRequest.Method = "GET"
getEndpointRequest.Scheme = requests.HTTPS
@@ -70,13 +95,23 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
}
response, err := param.CommonApi(getEndpointRequest)
- var getEndpointResponse GetEndpointResponse
+ if err != nil {
+ support = false
+ return
+ }
+
if !response.IsSuccess() {
support = false
return
}
- json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse)
+ var getEndpointResponse GetEndpointResponse
+ err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse)
+ if err != nil {
+ support = false
+ return
+ }
+
if !getEndpointResponse.Success || getEndpointResponse.Endpoints == nil {
support = false
return
@@ -87,12 +122,8 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
}
if len(getEndpointResponse.Endpoints.Endpoint[0].Endpoint) > 0 {
endpoint = getEndpointResponse.Endpoints.Endpoint[0].Endpoint
- endpointCache.Lock()
- endpointCache.cache[cacheKey] = endpoint
- endpointCache.Unlock()
- lastClearTimePerProduct.Lock()
- lastClearTimePerProduct.cache[cacheKey] = time.Now().Unix()
- lastClearTimePerProduct.Unlock()
+ endpointCache.Set(cacheKey, endpoint)
+ lastClearTimePerProduct.Set(cacheKey, time.Now().Unix())
support = true
return
}
@@ -101,13 +132,16 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
return
}
+// CheckCacheIsExpire ...
func CheckCacheIsExpire(cacheKey string) bool {
- lastClearTime := lastClearTimePerProduct.cache[cacheKey]
+ lastClearTime, ok := lastClearTimePerProduct.Get(cacheKey).(int64)
+ if !ok {
+ return true
+ }
+
if lastClearTime <= 0 {
lastClearTime = time.Now().Unix()
- lastClearTimePerProduct.Lock()
- lastClearTimePerProduct.cache[cacheKey] = lastClearTime
- lastClearTimePerProduct.Unlock()
+ lastClearTimePerProduct.Set(cacheKey, lastClearTime)
}
now := time.Now().Unix()
@@ -119,18 +153,21 @@ func CheckCacheIsExpire(cacheKey string) bool {
return false
}
+// GetEndpointResponse ...
type GetEndpointResponse struct {
Endpoints *EndpointsObj
RequestId string
Success bool
}
+// EndpointsObj ...
type EndpointsObj struct {
Endpoint []EndpointObj
}
+// EndpointObj ...
type EndpointObj struct {
- Protocols map[string]string
+ // Protocols map[string]string
Type string
Namespace string
Id string
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go
index f7b5a1aa2..e39f53367 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go
@@ -23,15 +23,24 @@ const keyFormatter = "%s::%s"
var endpointMapping = make(map[string]string)
+// AddEndpointMapping Use product id and region id as key to store the endpoint into inner map
func AddEndpointMapping(regionId, productId, endpoint string) (err error) {
key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId))
endpointMapping[key] = endpoint
return nil
}
+// MappingResolver the mapping resolver type
type MappingResolver struct {
}
+// GetName get the resolver name: "mapping resolver"
+func (resolver *MappingResolver) GetName() (name string) {
+ name = "mapping resolver"
+ return
+}
+
+// TryResolve use Product and RegionId as key to find endpoint from inner map
func (resolver *MappingResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
key := fmt.Sprintf(keyFormatter, strings.ToLower(param.RegionId), strings.ToLower(param.Product))
endpoint, contains := endpointMapping[key]
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go
index e58cfbf28..5e1e30530 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go
@@ -17,12 +17,20 @@ package endpoints
import (
"encoding/json"
"fmt"
+ "sync"
+
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- "sync"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
+var debug utils.Debug
+
+func init() {
+ debug = utils.Init("sdk")
+}
+
const (
ResolveEndpointUserGuideLink = ""
)
@@ -32,20 +40,30 @@ var resolvers []Resolver
type Resolver interface {
TryResolve(param *ResolveParam) (endpoint string, support bool, err error)
+ GetName() (name string)
}
+// Resolve resolve endpoint with params
+// It will resolve with each supported resolver until anyone resolved
func Resolve(param *ResolveParam) (endpoint string, err error) {
supportedResolvers := getAllResolvers()
+ var lastErr error
for _, resolver := range supportedResolvers {
- endpoint, supported, err := resolver.TryResolve(param)
+ endpoint, supported, resolveErr := resolver.TryResolve(param)
+ if resolveErr != nil {
+ lastErr = resolveErr
+ }
+
if supported {
- return endpoint, err
+ debug("resolve endpoint with %s\n", param)
+ debug("\t%s by resolver(%s)\n", endpoint, resolver.GetName())
+ return endpoint, nil
}
}
// not support
errorMsg := fmt.Sprintf(errors.CanNotResolveEndpointErrorMessage, param, ResolveEndpointUserGuideLink)
- err = errors.NewClientError(errors.CanNotResolveEndpointErrorCode, errorMsg, nil)
+ err = errors.NewClientError(errors.CanNotResolveEndpointErrorCode, errorMsg, lastErr)
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go
index 3e2e731ea..9ba2346c6 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go
@@ -14,9 +14,17 @@
package endpoints
+// SimpleHostResolver the simple host resolver type
type SimpleHostResolver struct {
}
+// GetName get the resolver name: "simple host resolver"
+func (resolver *SimpleHostResolver) GetName() (name string) {
+ name = "simple host resolver"
+ return
+}
+
+// TryResolve if the Domain exist in param, use it as endpoint
func (resolver *SimpleHostResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) {
if support = len(param.Domain) > 0; support {
endpoint = param.Domain
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go
index 3d4048b4e..1e2d9c004 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go
@@ -60,7 +60,7 @@ func NewClientError(errorCode, message string, originErr error) Error {
}
func (err *ClientError) Error() string {
- clientErrMsg := fmt.Sprintf("[%s] %s", err.errorCode, err.message)
+ clientErrMsg := fmt.Sprintf("[%s] %s", err.ErrorCode(), err.message)
if err.originError != nil {
return clientErrMsg + "\ncaused by:\n" + err.originError.Error()
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go
index d90638c0a..1b7810414 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go
@@ -17,6 +17,7 @@ package errors
import (
"encoding/json"
"fmt"
+
"github.com/jmespath/go-jmespath"
)
@@ -35,7 +36,7 @@ type ServerError struct {
}
type ServerErrorWrapper interface {
- tryWrap(error *ServerError, wrapInfo map[string]string) (bool, *ServerError)
+ tryWrap(error *ServerError, wrapInfo map[string]string) bool
}
func (err *ServerError) Error() string {
@@ -81,9 +82,9 @@ func NewServerError(httpStatus int, responseContent, comment string) Error {
func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError {
for _, wrapper := range wrapperList {
- ok, newError := wrapper.tryWrap(originError, wrapInfo)
+ ok := wrapper.tryWrap(originError, wrapInfo)
if ok {
- return newError
+ return originError
}
}
return originError
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go
index 33b3e4c44..4b09d7d71 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/signature_does_not_match_wrapper.go
@@ -1,29 +1,45 @@
package errors
-import "strings"
+import (
+ "strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+)
const SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch"
-const MessagePrefix = "Specified signature is not matched with our calculation. server string to sign is:"
+const IncompleteSignatureErrorCode = "IncompleteSignature"
+const MessageContain = "server string to sign is:"
+
+var debug utils.Debug
+
+func init() {
+ debug = utils.Init("sdk")
+}
type SignatureDostNotMatchWrapper struct {
}
-func (*SignatureDostNotMatchWrapper) tryWrap(error *ServerError, wrapInfo map[string]string) (bool, *ServerError) {
+func (*SignatureDostNotMatchWrapper) tryWrap(error *ServerError, wrapInfo map[string]string) (ok bool) {
clientStringToSign := wrapInfo["StringToSign"]
- if error.errorCode == SignatureDostNotMatchErrorCode && clientStringToSign != "" {
+ if (error.errorCode == SignatureDostNotMatchErrorCode || error.errorCode == IncompleteSignatureErrorCode) && clientStringToSign != "" {
message := error.message
- if strings.HasPrefix(message, MessagePrefix) {
- serverStringToSign := message[len(MessagePrefix):]
+ if strings.Contains(message, MessageContain) {
+ str := strings.Split(message, MessageContain)
+ serverStringToSign := str[1]
+
if clientStringToSign == serverStringToSign {
// user secret is error
- error.recommend = "Please check you AccessKeySecret"
+ error.recommend = "InvalidAccessKeySecret: Please check you AccessKeySecret"
} else {
+ debug("Client StringToSign: %s", clientStringToSign)
+ debug("Server StringToSign: %s", serverStringToSign)
error.recommend = "This may be a bug with the SDK and we hope you can submit this question in the " +
"github issue(https://github.com/aliyun/alibaba-cloud-sdk-go/issues), thanks very much"
}
}
- return true, error
- } else {
- return false, nil
+ ok = true
+ return
}
+ ok = false
+ return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go
new file mode 100644
index 000000000..a01a7bbc9
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go
@@ -0,0 +1,116 @@
+package sdk
+
+import (
+ "encoding/json"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+ "io"
+ "log"
+ "os"
+ "strings"
+ "time"
+)
+
+var logChannel string
+var defaultChannel = "AlibabaCloud"
+
+type Logger struct {
+ *log.Logger
+ formatTemplate string
+ isOpen bool
+ lastLogMsg string
+}
+
+var defaultLoggerTemplate = `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}`
+var loggerParam = []string{"{time}", "{start_time}", "{ts}", "{channel}", "{pid}", "{host}", "{method}", "{uri}", "{version}", "{target}", "{hostname}", "{code}", "{error}", "{req_headers}", "{res_body}", "{res_headers}", "{cost}"}
+
+func initLogMsg(fieldMap map[string]string) {
+ for _, value := range loggerParam {
+ fieldMap[value] = ""
+ }
+}
+
+func (client *Client) GetLogger() *Logger {
+ return client.logger
+}
+
+func (client *Client) GetLoggerMsg() string {
+ if client.logger == nil {
+ client.SetLogger("", "", os.Stdout, "")
+ }
+ return client.logger.lastLogMsg
+}
+
+func (client *Client) SetLogger(level string, channel string, out io.Writer, template string) {
+ if level == "" {
+ level = "info"
+ }
+
+ logChannel = "AlibabaCloud"
+ if channel != "" {
+ logChannel = channel
+ }
+ log := log.New(out, "["+strings.ToUpper(level)+"]", log.Lshortfile)
+ if template == "" {
+ template = defaultLoggerTemplate
+ }
+
+ client.logger = &Logger{
+ Logger: log,
+ formatTemplate: template,
+ isOpen: true,
+ }
+}
+
+func (client *Client) OpenLogger() {
+ if client.logger == nil {
+ client.SetLogger("", "", os.Stdout, "")
+ }
+ client.logger.isOpen = true
+}
+
+func (client *Client) CloseLogger() {
+ if client.logger != nil {
+ client.logger.isOpen = false
+ }
+}
+
+func (client *Client) SetTemplate(template string) {
+ if client.logger == nil {
+ client.SetLogger("", "", os.Stdout, "")
+ }
+ client.logger.formatTemplate = template
+}
+
+func (client *Client) GetTemplate() string {
+ if client.logger == nil {
+ client.SetLogger("", "", os.Stdout, "")
+ }
+ return client.logger.formatTemplate
+}
+
+func TransToString(object interface{}) string {
+ byt, err := json.Marshal(object)
+ if err != nil {
+ return ""
+ }
+ return string(byt)
+}
+
+func (client *Client) printLog(fieldMap map[string]string, err error) {
+ if err != nil {
+ fieldMap["{error}"] = err.Error()
+ }
+ fieldMap["{time}"] = time.Now().Format("2006-01-02 15:04:05")
+ fieldMap["{ts}"] = utils.GetTimeInFormatISO8601()
+ fieldMap["{channel}"] = logChannel
+ if client.logger != nil {
+ logMsg := client.logger.formatTemplate
+ for key, value := range fieldMap {
+ logMsg = strings.Replace(logMsg, key, value, -1)
+ }
+ client.logger.lastLogMsg = logMsg
+ if client.logger.isOpen == true {
+ client.logger.Output(2, logMsg)
+ }
+ }
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_reqeust.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go
similarity index 68%
rename from vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_reqeust.go
rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go
index 5f4a42bb4..846d448f2 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_reqeust.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go
@@ -15,11 +15,15 @@
package requests
import (
+ "encoding/json"
"fmt"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"io"
"reflect"
"strconv"
+ "strings"
+ "time"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
)
const (
@@ -58,8 +62,6 @@ type AcsRequest interface {
GetDomain() string
GetPort() string
GetRegionId() string
- GetUrl() string
- GetQueries() string
GetHeaders() map[string]string
GetQueryParams() map[string]string
GetFormParams() map[string]string
@@ -68,10 +70,19 @@ type AcsRequest interface {
GetStyle() string
GetProduct() string
GetVersion() string
+ SetVersion(version string)
GetActionName() string
GetAcceptFormat() string
GetLocationServiceCode() string
GetLocationEndpointType() string
+ GetReadTimeout() time.Duration
+ GetConnectTimeout() time.Duration
+ SetReadTimeout(readTimeout time.Duration)
+ SetConnectTimeout(connectTimeout time.Duration)
+ SetHTTPSInsecure(isInsecure bool)
+ GetHTTPSInsecure() *bool
+
+ GetUserAgent() map[string]string
SetStringToSign(stringToSign string)
GetStringToSign() string
@@ -90,14 +101,18 @@ type AcsRequest interface {
// base class
type baseRequest struct {
- Scheme string
- Method string
- Domain string
- Port string
- RegionId string
+ Scheme string
+ Method string
+ Domain string
+ Port string
+ RegionId string
+ ReadTimeout time.Duration
+ ConnectTimeout time.Duration
+ isInsecure *bool
- product string
- version string
+ userAgent map[string]string
+ product string
+ version string
actionName string
@@ -124,10 +139,38 @@ func (request *baseRequest) GetFormParams() map[string]string {
return request.FormParams
}
+func (request *baseRequest) GetReadTimeout() time.Duration {
+ return request.ReadTimeout
+}
+
+func (request *baseRequest) GetConnectTimeout() time.Duration {
+ return request.ConnectTimeout
+}
+
+func (request *baseRequest) SetReadTimeout(readTimeout time.Duration) {
+ request.ReadTimeout = readTimeout
+}
+
+func (request *baseRequest) SetConnectTimeout(connectTimeout time.Duration) {
+ request.ConnectTimeout = connectTimeout
+}
+
+func (request *baseRequest) GetHTTPSInsecure() *bool {
+ return request.isInsecure
+}
+
+func (request *baseRequest) SetHTTPSInsecure(isInsecure bool) {
+ request.isInsecure = &isInsecure
+}
+
func (request *baseRequest) GetContent() []byte {
return request.Content
}
+func (request *baseRequest) SetVersion(version string) {
+ request.version = version
+}
+
func (request *baseRequest) GetVersion() string {
return request.version
}
@@ -140,6 +183,28 @@ func (request *baseRequest) SetContent(content []byte) {
request.Content = content
}
+func (request *baseRequest) GetUserAgent() map[string]string {
+ return request.userAgent
+}
+
+func (request *baseRequest) AppendUserAgent(key, value string) {
+ newkey := true
+ if request.userAgent == nil {
+ request.userAgent = make(map[string]string)
+ }
+ if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" {
+ for tag, _ := range request.userAgent {
+ if tag == key {
+ request.userAgent[tag] = value
+ newkey = false
+ }
+ }
+ if newkey {
+ request.userAgent[key] = value
+ }
+ }
+}
+
func (request *baseRequest) addHeaderParam(key, value string) {
request.Headers[key] = value
}
@@ -201,7 +266,7 @@ func (request *baseRequest) GetHeaders() map[string]string {
}
func (request *baseRequest) SetContentType(contentType string) {
- request.Headers["Content-Type"] = contentType
+ request.addHeaderParam("Content-Type", contentType)
}
func (request *baseRequest) GetContentType() (contentType string, contains bool) {
@@ -226,7 +291,7 @@ func defaultBaseRequest() (request *baseRequest) {
Headers: map[string]string{
"x-sdk-client": "golang/1.0.0",
"x-sdk-invoke-type": "normal",
- "Accept-Encoding": "identity",
+ "Accept-Encoding": "identity",
},
FormParams: make(map[string]string),
}
@@ -254,6 +319,10 @@ func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, pre
// simple param
key := prefix + name
value := dataValue.Field(i).String()
+ if dataValue.Field(i).Kind().String() == "map" {
+ byt, _ := json.Marshal(dataValue.Field(i).Interface())
+ value = string(byt)
+ }
err = addParam(request, fieldPosition, key, value)
if err != nil {
return
@@ -269,7 +338,7 @@ func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, pre
for m := 0; m < repeatedFieldValue.Len(); m++ {
elementValue := repeatedFieldValue.Index(m)
key := prefix + name + "." + strconv.Itoa(m+1)
- if elementValue.Type().String() == "string" {
+ if elementValue.Type().Kind().String() == "string" {
value := elementValue.String()
err = addParam(request, fieldPosition, key, value)
if err != nil {
@@ -283,6 +352,38 @@ func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, pre
}
}
}
+ } else if typeTag == "Struct" {
+ valueField := dataValue.Field(i)
+ if valueField.Kind() == reflect.Struct {
+ if valueField.IsValid() && valueField.String() != "" {
+ valueFieldType := valueField.Type()
+ for m := 0; m < valueFieldType.NumField(); m++ {
+ fieldName := valueFieldType.Field(m).Name
+ elementValue := valueField.FieldByName(fieldName)
+ key := prefix + name + "." + fieldName
+ if elementValue.Type().String() == "[]string" {
+ for j := 0; j < elementValue.Len(); j++ {
+ err = addParam(request, fieldPosition, key+"."+strconv.Itoa(j+1), elementValue.Index(j).String())
+ if err != nil {
+ return
+ }
+ }
+ } else {
+ // value := elementValue.String()
+ // err = addParam(request, fieldPosition, key, value)
+ // if err != nil {
+ // return
+ // }
+ // } else {
+ // err = flatRepeatedList(elementValue, request, fieldPosition, key+".")
+ // if err != nil {
+ // return
+ // }
+ // }
+ }
+ }
+ }
+ }
}
}
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go
index d5d841b42..80c170097 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go
@@ -3,17 +3,18 @@ package requests
import (
"bytes"
"fmt"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"io"
+ "sort"
"strings"
)
type CommonRequest struct {
*baseRequest
- Version string
- ApiName string
- Product string
+ Version string
+ ApiName string
+ Product string
+ ServiceCode string
// roa params
PathPattern string
@@ -33,22 +34,27 @@ func NewCommonRequest() (request *CommonRequest) {
func (request *CommonRequest) String() string {
request.TransToAcsRequest()
- request.BuildQueries()
- request.BuildUrl()
resultBuilder := bytes.Buffer{}
mapOutput := func(m map[string]string) {
if len(m) > 0 {
- for key, value := range m {
- resultBuilder.WriteString(key + ": " + value + "\n")
+ sortedKeys := make([]string, 0)
+ for k := range m {
+ sortedKeys = append(sortedKeys, k)
+ }
+
+ // sort 'string' key in increasing order
+ sort.Strings(sortedKeys)
+
+ for _, key := range sortedKeys {
+ resultBuilder.WriteString(key + ": " + m[key] + "\n")
}
}
}
// Request Line
- resultBuilder.WriteString("\n")
- resultBuilder.WriteString(fmt.Sprintf("%s %s %s/1.1\n", request.Method, request.GetQueries(), strings.ToUpper(request.Scheme)))
+ resultBuilder.WriteString(fmt.Sprintf("%s %s %s/1.1\n", request.Method, request.BuildQueries(), strings.ToUpper(request.Scheme)))
// Headers
resultBuilder.WriteString("Host" + ": " + request.Domain + "\n")
@@ -66,16 +72,6 @@ func (request *CommonRequest) String() string {
}
func (request *CommonRequest) TransToAcsRequest() {
- if len(request.Version) == 0 {
- errors.NewClientError(errors.MissingParamErrorCode, "Common request [version] is required", nil)
- }
- if len(request.ApiName) == 0 && len(request.PathPattern) == 0 {
- errors.NewClientError(errors.MissingParamErrorCode, "At least one of [ApiName] and [PathPattern] should has a value", nil)
- }
- if len(request.Domain) == 0 && len(request.Product) == 0 {
- errors.NewClientError(errors.MissingParamErrorCode, "At least one of [Domain] and [Product] should has a value", nil)
- }
-
if len(request.PathPattern) > 0 {
roaRequest := &RoaRequest{}
roaRequest.initWithCommonRequest(request)
@@ -85,36 +81,20 @@ func (request *CommonRequest) TransToAcsRequest() {
rpcRequest.baseRequest = request.baseRequest
rpcRequest.product = request.Product
rpcRequest.version = request.Version
+ rpcRequest.locationServiceCode = request.ServiceCode
rpcRequest.actionName = request.ApiName
request.Ontology = rpcRequest
}
-
}
func (request *CommonRequest) BuildUrl() string {
- if len(request.Port) > 0 {
- return strings.ToLower(request.Scheme) + "://" + request.Domain + ":" + request.Port + request.BuildQueries()
- }
-
- return strings.ToLower(request.Scheme) + "://" + request.Domain + request.BuildQueries()
+ return request.Ontology.BuildUrl()
}
func (request *CommonRequest) BuildQueries() string {
return request.Ontology.BuildQueries()
}
-func (request *CommonRequest) GetUrl() string {
- if len(request.Port) > 0 {
- return strings.ToLower(request.Scheme) + "://" + request.Domain + ":" + request.Port + request.GetQueries()
- }
-
- return strings.ToLower(request.Scheme) + "://" + request.Domain + request.GetQueries()
-}
-
-func (request *CommonRequest) GetQueries() string {
- return request.Ontology.GetQueries()
-}
-
func (request *CommonRequest) GetBodyReader() io.Reader {
return request.Ontology.GetBodyReader()
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go
index cd1ab178f..70b856e3c 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go
@@ -16,11 +16,13 @@ package requests
import (
"bytes"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+ "fmt"
"io"
"net/url"
"sort"
"strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
type RoaRequest struct {
@@ -44,29 +46,23 @@ func (request *RoaRequest) GetBodyReader() io.Reader {
}
}
-func (request *RoaRequest) GetQueries() string {
- return request.queries
-}
-
// for sign method, need not url encoded
func (request *RoaRequest) BuildQueries() string {
- return request.buildQueries(false)
+ return request.buildQueries()
}
-func (request *RoaRequest) buildQueries(needParamEncode bool) string {
- // replace path params with value
+func (request *RoaRequest) buildPath() string {
path := request.pathPattern
for key, value := range request.PathParams {
path = strings.Replace(path, "["+key+"]", value, 1)
}
+ return path
+}
+func (request *RoaRequest) buildQueries() string {
+ // replace path params with value
+ path := request.buildPath()
queryParams := request.QueryParams
- // check if path contains params
- splitArray := strings.Split(path, "?")
- path = splitArray[0]
- if len(splitArray) > 1 && len(splitArray[1]) > 0 {
- queryParams[splitArray[1]] = ""
- }
// sort QueryParams by key
var queryKeys []string
for key := range queryParams {
@@ -85,11 +81,7 @@ func (request *RoaRequest) buildQueries(needParamEncode bool) string {
urlBuilder.WriteString(queryKey)
if value := queryParams[queryKey]; len(value) > 0 {
urlBuilder.WriteString("=")
- if needParamEncode {
- urlBuilder.WriteString(url.QueryEscape(value))
- } else {
- urlBuilder.WriteString(value)
- }
+ urlBuilder.WriteString(value)
}
if i < len(queryKeys)-1 {
urlBuilder.WriteString("&")
@@ -97,8 +89,17 @@ func (request *RoaRequest) buildQueries(needParamEncode bool) string {
}
result := urlBuilder.String()
result = popStandardUrlencode(result)
- request.queries = result
- return request.queries
+ return result
+}
+
+func (request *RoaRequest) buildQueryString() string {
+ queryParams := request.QueryParams
+ // sort QueryParams by key
+ q := url.Values{}
+ for key, value := range queryParams {
+ q.Add(key, value)
+ }
+ return q.Encode()
}
func popStandardUrlencode(stringToSign string) (result string) {
@@ -108,13 +109,18 @@ func popStandardUrlencode(stringToSign string) (result string) {
return
}
-func (request *RoaRequest) GetUrl() string {
- return strings.ToLower(request.Scheme) + "://" + request.Domain + ":" + request.Port + request.GetQueries()
-}
-
func (request *RoaRequest) BuildUrl() string {
// for network trans, need url encoded
- return strings.ToLower(request.Scheme) + "://" + request.Domain + ":" + request.Port + request.buildQueries(true)
+ scheme := strings.ToLower(request.Scheme)
+ domain := request.Domain
+ port := request.Port
+ path := request.buildPath()
+ url := fmt.Sprintf("%s://%s:%s%s", scheme, domain, port, path)
+ querystring := request.buildQueryString()
+ if len(querystring) > 0 {
+ url = fmt.Sprintf("%s?%s", url, querystring)
+ }
+ return url
}
func (request *RoaRequest) addPathParam(key, value string) {
@@ -128,19 +134,19 @@ func (request *RoaRequest) InitWithApiInfo(product, version, action, uriPattern,
request.pathPattern = uriPattern
request.locationServiceCode = serviceCode
request.locationEndpointType = endpointType
- //request.product = product
+ request.product = product
//request.version = version
- //request.actionName = action
+ request.actionName = action
}
func (request *RoaRequest) initWithCommonRequest(commonRequest *CommonRequest) {
request.baseRequest = commonRequest.baseRequest
request.PathParams = commonRequest.PathParams
- //request.product = commonRequest.Product
+ request.product = commonRequest.Product
//request.version = commonRequest.Version
request.Headers["x-acs-version"] = commonRequest.Version
- //request.actionName = commonRequest.ApiName
+ request.actionName = commonRequest.ApiName
request.pathPattern = commonRequest.PathPattern
- request.locationServiceCode = ""
+ request.locationServiceCode = commonRequest.ServiceCode
request.locationEndpointType = ""
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go
index 7a61c19f4..01be6fd04 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go
@@ -15,9 +15,11 @@
package requests
import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+ "fmt"
"io"
"strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
)
type RpcRequest struct {
@@ -47,16 +49,12 @@ func (request *RpcRequest) BuildQueries() string {
return request.queries
}
-func (request *RpcRequest) GetQueries() string {
- return request.queries
-}
-
func (request *RpcRequest) BuildUrl() string {
- return strings.ToLower(request.Scheme) + "://" + request.Domain + ":" + request.Port + request.BuildQueries()
-}
-
-func (request *RpcRequest) GetUrl() string {
- return strings.ToLower(request.Scheme) + "://" + request.Domain + request.GetQueries()
+ url := fmt.Sprintf("%s://%s", strings.ToLower(request.Scheme), request.Domain)
+ if len(request.Port) > 0 {
+ url = fmt.Sprintf("%s:%s", url, request.Port)
+ }
+ return url + request.BuildQueries()
}
func (request *RpcRequest) GetVersion() string {
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go
index 43ba6fc26..36604fe80 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go
@@ -2,13 +2,13 @@ package responses
import (
"encoding/json"
- "github.com/json-iterator/go"
"io"
"math"
"strconv"
"strings"
- "sync"
"unsafe"
+
+ jsoniter "github.com/json-iterator/go"
)
const maxUint = ^uint(0)
@@ -16,13 +16,15 @@ const maxInt = int(maxUint >> 1)
const minInt = -maxInt - 1
var jsonParser jsoniter.API
-var initJson = &sync.Once{}
-func initJsonParserOnce() {
- initJson.Do(func() {
- registerBetterFuzzyDecoder()
- jsonParser = jsoniter.ConfigCompatibleWithStandardLibrary
- })
+func init() {
+ registerBetterFuzzyDecoder()
+ jsonParser = jsoniter.Config{
+ EscapeHTML: true,
+ SortMapKeys: true,
+ ValidateJsonRawMessage: true,
+ CaseSensitive: true,
+ }.Froze()
}
func registerBetterFuzzyDecoder() {
@@ -211,21 +213,6 @@ func (decoder *fuzzyBoolDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Itera
}
}
-type tolerateEmptyArrayDecoder struct {
- valDecoder jsoniter.ValDecoder
-}
-
-func (decoder *tolerateEmptyArrayDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) {
- if iter.WhatIsNext() == jsoniter.ArrayValue {
- iter.Skip()
- newIter := iter.Pool().BorrowIterator([]byte("{}"))
- defer iter.Pool().ReturnIterator(newIter)
- decoder.valDecoder.Decode(ptr, newIter)
- } else {
- decoder.valDecoder.Decode(ptr, iter)
- }
-}
-
type nullableFuzzyIntegerDecoder struct {
fun func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator)
}
@@ -336,6 +323,6 @@ func (decoder *nullableFuzzyFloat64Decoder) Decode(ptr unsafe.Pointer, iter *jso
iter.ReadNil()
*((*float64)(ptr)) = 0
default:
- iter.ReportError("nullableFuzzyFloat32Decoder", "not number or string")
+ iter.ReportError("nullableFuzzyFloat64Decoder", "not number or string")
}
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go
index 8780f26f2..53a156b71 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go
@@ -18,10 +18,11 @@ import (
"bytes"
"encoding/xml"
"fmt"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
"io/ioutil"
"net/http"
"strings"
+
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
)
type AcsResponse interface {
@@ -34,6 +35,7 @@ type AcsResponse interface {
parseFromHttpResponse(httpResponse *http.Response) error
}
+// Unmarshal object from http response body to target Response
func Unmarshal(response AcsResponse, httpResponse *http.Response, format string) (err error) {
err = response.parseFromHttpResponse(httpResponse)
if err != nil {
@@ -43,7 +45,8 @@ func Unmarshal(response AcsResponse, httpResponse *http.Response, format string)
err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), "")
return
}
- if _, isCommonResponse := response.(CommonResponse); isCommonResponse {
+
+ if _, isCommonResponse := response.(*CommonResponse); isCommonResponse {
// common response need not unmarshal
return
}
@@ -53,7 +56,6 @@ func Unmarshal(response AcsResponse, httpResponse *http.Response, format string)
}
if strings.ToUpper(format) == "JSON" {
- initJsonParserOnce()
err = jsonParser.Unmarshal(response.GetHttpContentBytes(), response)
if err != nil {
err = errors.NewClientError(errors.JsonUnmarshalErrorCode, errors.JsonUnmarshalErrorMessage, err)
@@ -117,7 +119,7 @@ func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Respo
func (baseResponse *BaseResponse) String() string {
resultBuilder := bytes.Buffer{}
// statusCode
- resultBuilder.WriteString("\n")
+ // resultBuilder.WriteString("\n")
resultBuilder.WriteString(fmt.Sprintf("%s %s\n", baseResponse.originHttpResponse.Proto, baseResponse.originHttpResponse.Status))
// httpHeaders
//resultBuilder.WriteString("Headers:\n")
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go
new file mode 100644
index 000000000..09440d27b
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go
@@ -0,0 +1,36 @@
+package utils
+
+import (
+ "fmt"
+ "os"
+ "strings"
+)
+
+type Debug func(format string, v ...interface{})
+
+var hookGetEnv = func() string {
+ return os.Getenv("DEBUG")
+}
+
+var hookPrint = func(input string) {
+ fmt.Println(input)
+}
+
+func Init(flag string) Debug {
+ enable := false
+
+ env := hookGetEnv()
+ parts := strings.Split(env, ",")
+ for _, part := range parts {
+ if part == flag {
+ enable = true
+ break
+ }
+ }
+
+ return func(format string, v ...interface{}) {
+ if enable {
+ hookPrint(fmt.Sprintf(format, v...))
+ }
+ }
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go
index a00c775c2..f8a3ad384 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go
@@ -16,27 +16,35 @@ package utils
import (
"crypto/md5"
+ "crypto/rand"
"encoding/base64"
"encoding/hex"
- "encoding/json"
- "fmt"
- "github.com/satori/go.uuid"
+ "hash"
+ rand2 "math/rand"
"net/url"
"reflect"
"strconv"
"time"
)
-// if you use go 1.10 or higher, you can hack this util by these to avoid "TimeZone.zip not found" on Windows
-var LoadLocationFromTZData func(name string, data []byte) (*time.Location, error) = nil
-var TZData []byte = nil
+type UUID [16]byte
-func GetUUIDV4() (uuidHex string) {
- uuidV4 := uuid.NewV4()
- uuidHex = hex.EncodeToString(uuidV4.Bytes())
+const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
+func GetUUID() (uuidHex string) {
+ uuid := NewUUID()
+ uuidHex = hex.EncodeToString(uuid[:])
return
}
+func RandStringBytes(n int) string {
+ b := make([]byte, n)
+ for i := range b {
+ b[i] = letterBytes[rand2.Intn(len(letterBytes))]
+ }
+ return string(b)
+}
+
func GetMD5Base64(bytes []byte) (base64Value string) {
md5Ctx := md5.New()
md5Ctx.Write(bytes)
@@ -45,29 +53,15 @@ func GetMD5Base64(bytes []byte) (base64Value string) {
return
}
-func GetGMTLocation() (*time.Location, error) {
- if LoadLocationFromTZData != nil && TZData != nil {
- return LoadLocationFromTZData("GMT", TZData)
- } else {
- return time.LoadLocation("GMT")
- }
-}
-
func GetTimeInFormatISO8601() (timeStr string) {
- gmt, err := GetGMTLocation()
+ gmt := time.FixedZone("GMT", 0)
- if err != nil {
- panic(err)
- }
return time.Now().In(gmt).Format("2006-01-02T15:04:05Z")
}
func GetTimeInFormatRFC2616() (timeStr string) {
- gmt, err := GetGMTLocation()
+ gmt := time.FixedZone("GMT", 0)
- if err != nil {
- panic(err)
- }
return time.Now().In(gmt).Format("Mon, 02 Jan 2006 15:04:05 GMT")
}
@@ -80,17 +74,6 @@ func GetUrlFormedMap(source map[string]string) (urlEncoded string) {
return
}
-func GetFromJsonString(jsonString, key string) (result string, err error) {
- var responseMap map[string]*json.RawMessage
- err = json.Unmarshal([]byte(jsonString), &responseMap)
- if err != nil {
- return
- }
- fmt.Println(string(*responseMap[key]))
- err = json.Unmarshal(*responseMap[key], &result)
- return
-}
-
func InitStructWithDefaultTag(bean interface{}) {
configType := reflect.TypeOf(bean)
for i := 0; i < configType.Elem().NumField(); i++ {
@@ -115,3 +98,44 @@ func InitStructWithDefaultTag(bean interface{}) {
}
}
}
+
+func NewUUID() UUID {
+ ns := UUID{}
+ safeRandom(ns[:])
+ u := newFromHash(md5.New(), ns, RandStringBytes(16))
+ u[6] = (u[6] & 0x0f) | (byte(2) << 4)
+ u[8] = (u[8]&(0xff>>2) | (0x02 << 6))
+
+ return u
+}
+
+func newFromHash(h hash.Hash, ns UUID, name string) UUID {
+ u := UUID{}
+ h.Write(ns[:])
+ h.Write([]byte(name))
+ copy(u[:], h.Sum(nil))
+
+ return u
+}
+
+func safeRandom(dest []byte) {
+ if _, err := rand.Read(dest); err != nil {
+ panic(err)
+ }
+}
+
+func (u UUID) String() string {
+ buf := make([]byte, 36)
+
+ hex.Encode(buf[0:8], u[0:4])
+ buf[8] = '-'
+ hex.Encode(buf[9:13], u[4:6])
+ buf[13] = '-'
+ hex.Encode(buf[14:18], u[6:8])
+ buf[18] = '-'
+ hex.Encode(buf[19:23], u[8:10])
+ buf[23] = '-'
+ hex.Encode(buf[24:], u[10:])
+
+ return string(buf)
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_batch_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_batch_domain_records.go
deleted file mode 100644
index 30e1dea47..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_batch_domain_records.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// AddBatchDomainRecords invokes the alidns.AddBatchDomainRecords API synchronously
-// api document: https://help.aliyun.com/api/alidns/addbatchdomainrecords.html
-func (client *Client) AddBatchDomainRecords(request *AddBatchDomainRecordsRequest) (response *AddBatchDomainRecordsResponse, err error) {
- response = CreateAddBatchDomainRecordsResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// AddBatchDomainRecordsWithChan invokes the alidns.AddBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/addbatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) AddBatchDomainRecordsWithChan(request *AddBatchDomainRecordsRequest) (<-chan *AddBatchDomainRecordsResponse, <-chan error) {
- responseChan := make(chan *AddBatchDomainRecordsResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.AddBatchDomainRecords(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// AddBatchDomainRecordsWithCallback invokes the alidns.AddBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/addbatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) AddBatchDomainRecordsWithCallback(request *AddBatchDomainRecordsRequest, callback func(response *AddBatchDomainRecordsResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *AddBatchDomainRecordsResponse
- var err error
- defer close(result)
- response, err = client.AddBatchDomainRecords(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// AddBatchDomainRecordsRequest is the request struct for api AddBatchDomainRecords
-type AddBatchDomainRecordsRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- Records string `position:"Query" name:"Records"`
-}
-
-// AddBatchDomainRecordsResponse is the response struct for api AddBatchDomainRecords
-type AddBatchDomainRecordsResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- TraceId string `json:"TraceId" xml:"TraceId"`
-}
-
-// CreateAddBatchDomainRecordsRequest creates a request to invoke AddBatchDomainRecords API
-func CreateAddBatchDomainRecordsRequest() (request *AddBatchDomainRecordsRequest) {
- request = &AddBatchDomainRecordsRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "AddBatchDomainRecords", "", "")
- return
-}
-
-// CreateAddBatchDomainRecordsResponse creates a response to parse from AddBatchDomainRecords response
-func CreateAddBatchDomainRecordsResponse() (response *AddBatchDomainRecordsResponse) {
- response = &AddBatchDomainRecordsResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain.go
index 1b2249e29..4e535c3ed 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain.go
@@ -76,10 +76,11 @@ func (client *Client) AddDomainWithCallback(request *AddDomainRequest, callback
// AddDomainRequest is the request struct for api AddDomain
type AddDomainRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- DomainName string `position:"Query" name:"DomainName"`
- GroupId string `position:"Query" name:"GroupId"`
+ ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
+ GroupId string `position:"Query" name:"GroupId"`
+ DomainName string `position:"Query" name:"DomainName"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// AddDomainResponse is the response struct for api AddDomain
@@ -99,7 +100,7 @@ func CreateAddDomainRequest() (request *AddDomainRequest) {
request = &AddDomainRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomain", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomain", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_group.go
index a1c7cd4c0..e977e0436 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_group.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_group.go
@@ -76,8 +76,8 @@ func (client *Client) AddDomainGroupWithCallback(request *AddDomainGroupRequest,
// AddDomainGroupRequest is the request struct for api AddDomainGroup
type AddDomainGroupRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
GroupName string `position:"Query" name:"GroupName"`
}
@@ -94,7 +94,7 @@ func CreateAddDomainGroupRequest() (request *AddDomainGroupRequest) {
request = &AddDomainGroupRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomainGroup", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomainGroup", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_record.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_record.go
index 1da602453..5346079f3 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_record.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_domain_record.go
@@ -76,15 +76,15 @@ func (client *Client) AddDomainRecordWithCallback(request *AddDomainRecordReques
// AddDomainRecordRequest is the request struct for api AddDomainRecord
type AddDomainRecordRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ RR string `position:"Query" name:"RR"`
+ Line string `position:"Query" name:"Line"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- RR string `position:"Query" name:"RR"`
+ Lang string `position:"Query" name:"Lang"`
Type string `position:"Query" name:"Type"`
+ Priority requests.Integer `position:"Query" name:"Priority"`
Value string `position:"Query" name:"Value"`
TTL requests.Integer `position:"Query" name:"TTL"`
- Priority requests.Integer `position:"Query" name:"Priority"`
- Line string `position:"Query" name:"Line"`
}
// AddDomainRecordResponse is the response struct for api AddDomainRecord
@@ -99,7 +99,7 @@ func CreateAddDomainRecordRequest() (request *AddDomainRecordRequest) {
request = &AddDomainRecordRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomainRecord", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddDomainRecord", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_access_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_access_strategy.go
new file mode 100644
index 000000000..37d9d0d44
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_access_strategy.go
@@ -0,0 +1,110 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// AddGtmAccessStrategy invokes the alidns.AddGtmAccessStrategy API synchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaccessstrategy.html
+func (client *Client) AddGtmAccessStrategy(request *AddGtmAccessStrategyRequest) (response *AddGtmAccessStrategyResponse, err error) {
+ response = CreateAddGtmAccessStrategyResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// AddGtmAccessStrategyWithChan invokes the alidns.AddGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmAccessStrategyWithChan(request *AddGtmAccessStrategyRequest) (<-chan *AddGtmAccessStrategyResponse, <-chan error) {
+ responseChan := make(chan *AddGtmAccessStrategyResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.AddGtmAccessStrategy(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// AddGtmAccessStrategyWithCallback invokes the alidns.AddGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmAccessStrategyWithCallback(request *AddGtmAccessStrategyRequest, callback func(response *AddGtmAccessStrategyResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *AddGtmAccessStrategyResponse
+ var err error
+ defer close(result)
+ response, err = client.AddGtmAccessStrategy(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// AddGtmAccessStrategyRequest is the request struct for api AddGtmAccessStrategy
+type AddGtmAccessStrategyRequest struct {
+ *requests.RpcRequest
+ StrategyName string `position:"Query" name:"StrategyName"`
+ DefaultAddrPoolId string `position:"Query" name:"DefaultAddrPoolId"`
+ AccessLines string `position:"Query" name:"AccessLines"`
+ InstanceId string `position:"Query" name:"InstanceId"`
+ FailoverAddrPoolId string `position:"Query" name:"FailoverAddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// AddGtmAccessStrategyResponse is the response struct for api AddGtmAccessStrategy
+type AddGtmAccessStrategyResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ StrategyId string `json:"StrategyId" xml:"StrategyId"`
+}
+
+// CreateAddGtmAccessStrategyRequest creates a request to invoke AddGtmAccessStrategy API
+func CreateAddGtmAccessStrategyRequest() (request *AddGtmAccessStrategyRequest) {
+ request = &AddGtmAccessStrategyRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddGtmAccessStrategy", "Alidns", "openAPI")
+ return
+}
+
+// CreateAddGtmAccessStrategyResponse creates a response to parse from AddGtmAccessStrategy response
+func CreateAddGtmAccessStrategyResponse() (response *AddGtmAccessStrategyResponse) {
+ response = &AddGtmAccessStrategyResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_address_pool.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_address_pool.go
new file mode 100644
index 000000000..5856bd626
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_address_pool.go
@@ -0,0 +1,117 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// AddGtmAddressPool invokes the alidns.AddGtmAddressPool API synchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaddresspool.html
+func (client *Client) AddGtmAddressPool(request *AddGtmAddressPoolRequest) (response *AddGtmAddressPoolResponse, err error) {
+ response = CreateAddGtmAddressPoolResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// AddGtmAddressPoolWithChan invokes the alidns.AddGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmAddressPoolWithChan(request *AddGtmAddressPoolRequest) (<-chan *AddGtmAddressPoolResponse, <-chan error) {
+ responseChan := make(chan *AddGtmAddressPoolResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.AddGtmAddressPool(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// AddGtmAddressPoolWithCallback invokes the alidns.AddGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmAddressPoolWithCallback(request *AddGtmAddressPoolRequest, callback func(response *AddGtmAddressPoolResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *AddGtmAddressPoolResponse
+ var err error
+ defer close(result)
+ response, err = client.AddGtmAddressPool(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// AddGtmAddressPoolRequest is the request struct for api AddGtmAddressPool
+type AddGtmAddressPoolRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Name string `position:"Query" name:"Name"`
+ Lang string `position:"Query" name:"Lang"`
+ Type string `position:"Query" name:"Type"`
+ Addr *[]AddGtmAddressPoolAddr `position:"Query" name:"Addr" type:"Repeated"`
+ MinAvailableAddrNum requests.Integer `position:"Query" name:"MinAvailableAddrNum"`
+}
+
+// AddGtmAddressPoolAddr is a repeated param struct in AddGtmAddressPoolRequest
+type AddGtmAddressPoolAddr struct {
+ Mode string `name:"Mode"`
+ LbaWeight string `name:"LbaWeight"`
+ Value string `name:"Value"`
+}
+
+// AddGtmAddressPoolResponse is the response struct for api AddGtmAddressPool
+type AddGtmAddressPoolResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ AddrPoolId string `json:"AddrPoolId" xml:"AddrPoolId"`
+}
+
+// CreateAddGtmAddressPoolRequest creates a request to invoke AddGtmAddressPool API
+func CreateAddGtmAddressPoolRequest() (request *AddGtmAddressPoolRequest) {
+ request = &AddGtmAddressPoolRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddGtmAddressPool", "Alidns", "openAPI")
+ return
+}
+
+// CreateAddGtmAddressPoolResponse creates a response to parse from AddGtmAddressPool response
+func CreateAddGtmAddressPoolResponse() (response *AddGtmAddressPoolResponse) {
+ response = &AddGtmAddressPoolResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_monitor.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_monitor.go
new file mode 100644
index 000000000..259787062
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/add_gtm_monitor.go
@@ -0,0 +1,119 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// AddGtmMonitor invokes the alidns.AddGtmMonitor API synchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmmonitor.html
+func (client *Client) AddGtmMonitor(request *AddGtmMonitorRequest) (response *AddGtmMonitorResponse, err error) {
+ response = CreateAddGtmMonitorResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// AddGtmMonitorWithChan invokes the alidns.AddGtmMonitor API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmmonitor.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmMonitorWithChan(request *AddGtmMonitorRequest) (<-chan *AddGtmMonitorResponse, <-chan error) {
+ responseChan := make(chan *AddGtmMonitorResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.AddGtmMonitor(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// AddGtmMonitorWithCallback invokes the alidns.AddGtmMonitor API asynchronously
+// api document: https://help.aliyun.com/api/alidns/addgtmmonitor.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) AddGtmMonitorWithCallback(request *AddGtmMonitorRequest, callback func(response *AddGtmMonitorResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *AddGtmMonitorResponse
+ var err error
+ defer close(result)
+ response, err = client.AddGtmMonitor(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// AddGtmMonitorRequest is the request struct for api AddGtmMonitor
+type AddGtmMonitorRequest struct {
+ *requests.RpcRequest
+ MonitorExtendInfo string `position:"Query" name:"MonitorExtendInfo"`
+ AddrPoolId string `position:"Query" name:"AddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Name string `position:"Query" name:"Name"`
+ EvaluationCount requests.Integer `position:"Query" name:"EvaluationCount"`
+ ProtocolType string `position:"Query" name:"ProtocolType"`
+ Interval requests.Integer `position:"Query" name:"Interval"`
+ Lang string `position:"Query" name:"Lang"`
+ Timeout requests.Integer `position:"Query" name:"Timeout"`
+ IspCityNode *[]AddGtmMonitorIspCityNode `position:"Query" name:"IspCityNode" type:"Repeated"`
+}
+
+// AddGtmMonitorIspCityNode is a repeated param struct in AddGtmMonitorRequest
+type AddGtmMonitorIspCityNode struct {
+ CityCode string `name:"CityCode"`
+ IspCode string `name:"IspCode"`
+}
+
+// AddGtmMonitorResponse is the response struct for api AddGtmMonitor
+type AddGtmMonitorResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ MonitorConfigId string `json:"MonitorConfigId" xml:"MonitorConfigId"`
+}
+
+// CreateAddGtmMonitorRequest creates a request to invoke AddGtmMonitor API
+func CreateAddGtmMonitorRequest() (request *AddGtmMonitorRequest) {
+ request = &AddGtmMonitorRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "AddGtmMonitor", "Alidns", "openAPI")
+ return
+}
+
+// CreateAddGtmMonitorResponse creates a response to parse from AddGtmMonitor response
+func CreateAddGtmMonitorResponse() (response *AddGtmMonitorResponse) {
+ response = &AddGtmMonitorResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/apply_for_retrieval_domain_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/apply_for_retrieval_domain_name.go
deleted file mode 100644
index 86b68e7b9..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/apply_for_retrieval_domain_name.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// ApplyForRetrievalDomainName invokes the alidns.ApplyForRetrievalDomainName API synchronously
-// api document: https://help.aliyun.com/api/alidns/applyforretrievaldomainname.html
-func (client *Client) ApplyForRetrievalDomainName(request *ApplyForRetrievalDomainNameRequest) (response *ApplyForRetrievalDomainNameResponse, err error) {
- response = CreateApplyForRetrievalDomainNameResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// ApplyForRetrievalDomainNameWithChan invokes the alidns.ApplyForRetrievalDomainName API asynchronously
-// api document: https://help.aliyun.com/api/alidns/applyforretrievaldomainname.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) ApplyForRetrievalDomainNameWithChan(request *ApplyForRetrievalDomainNameRequest) (<-chan *ApplyForRetrievalDomainNameResponse, <-chan error) {
- responseChan := make(chan *ApplyForRetrievalDomainNameResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.ApplyForRetrievalDomainName(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// ApplyForRetrievalDomainNameWithCallback invokes the alidns.ApplyForRetrievalDomainName API asynchronously
-// api document: https://help.aliyun.com/api/alidns/applyforretrievaldomainname.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) ApplyForRetrievalDomainNameWithCallback(request *ApplyForRetrievalDomainNameRequest, callback func(response *ApplyForRetrievalDomainNameResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *ApplyForRetrievalDomainNameResponse
- var err error
- defer close(result)
- response, err = client.ApplyForRetrievalDomainName(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// ApplyForRetrievalDomainNameRequest is the request struct for api ApplyForRetrievalDomainName
-type ApplyForRetrievalDomainNameRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- DomainName string `position:"Query" name:"DomainName"`
-}
-
-// ApplyForRetrievalDomainNameResponse is the response struct for api ApplyForRetrievalDomainName
-type ApplyForRetrievalDomainNameResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- DomainName string `json:"DomainName" xml:"DomainName"`
-}
-
-// CreateApplyForRetrievalDomainNameRequest creates a request to invoke ApplyForRetrievalDomainName API
-func CreateApplyForRetrievalDomainNameRequest() (request *ApplyForRetrievalDomainNameRequest) {
- request = &ApplyForRetrievalDomainNameRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "ApplyForRetrievalDomainName", "", "")
- return
-}
-
-// CreateApplyForRetrievalDomainNameResponse creates a response to parse from ApplyForRetrievalDomainName response
-func CreateApplyForRetrievalDomainNameResponse() (response *ApplyForRetrievalDomainNameResponse) {
- response = &ApplyForRetrievalDomainNameResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_group.go
index 61fed5be8..ae9aa3d2e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_group.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_group.go
@@ -76,10 +76,10 @@ func (client *Client) ChangeDomainGroupWithCallback(request *ChangeDomainGroupRe
// ChangeDomainGroupRequest is the request struct for api ChangeDomainGroup
type ChangeDomainGroupRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ GroupId string `position:"Query" name:"GroupId"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- GroupId string `position:"Query" name:"GroupId"`
+ Lang string `position:"Query" name:"Lang"`
}
// ChangeDomainGroupResponse is the response struct for api ChangeDomainGroup
@@ -95,7 +95,7 @@ func CreateChangeDomainGroupRequest() (request *ChangeDomainGroupRequest) {
request = &ChangeDomainGroupRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "ChangeDomainGroup", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "ChangeDomainGroup", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_of_dns_product.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_of_dns_product.go
index 04f329e49..9098327ce 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_of_dns_product.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/change_domain_of_dns_product.go
@@ -76,11 +76,11 @@ func (client *Client) ChangeDomainOfDnsProductWithCallback(request *ChangeDomain
// ChangeDomainOfDnsProductRequest is the request struct for api ChangeDomainOfDnsProduct
type ChangeDomainOfDnsProductRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
InstanceId string `position:"Query" name:"InstanceId"`
NewDomain string `position:"Query" name:"NewDomain"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
Force requests.Boolean `position:"Query" name:"Force"`
+ Lang string `position:"Query" name:"Lang"`
}
// ChangeDomainOfDnsProductResponse is the response struct for api ChangeDomainOfDnsProduct
@@ -95,7 +95,7 @@ func CreateChangeDomainOfDnsProductRequest() (request *ChangeDomainOfDnsProductR
request = &ChangeDomainOfDnsProductRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "ChangeDomainOfDnsProduct", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "ChangeDomainOfDnsProduct", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/check_domain_record.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/check_domain_record.go
index 876e4deb7..898af6d7e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/check_domain_record.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/check_domain_record.go
@@ -76,10 +76,10 @@ func (client *Client) CheckDomainRecordWithCallback(request *CheckDomainRecordRe
// CheckDomainRecordRequest is the request struct for api CheckDomainRecord
type CheckDomainRecordRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ RR string `position:"Query" name:"RR"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- RR string `position:"Query" name:"RR"`
+ Lang string `position:"Query" name:"Lang"`
Type string `position:"Query" name:"Type"`
Value string `position:"Query" name:"Value"`
}
@@ -96,7 +96,7 @@ func CreateCheckDomainRecordRequest() (request *CheckDomainRecordRequest) {
request = &CheckDomainRecordRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "CheckDomainRecord", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "CheckDomainRecord", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/client.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/client.go
index bd92fdd31..e3fe04992 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/client.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/client.go
@@ -18,6 +18,7 @@ package alidns
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
)
// Client is the sdk client struct, each func corresponds to an OpenAPI
@@ -32,6 +33,20 @@ func NewClient() (client *Client, err error) {
return
}
+// NewClientWithProvider creates a sdk client with providers
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+ client = &Client{}
+ var pc provider.Provider
+ if len(providers) == 0 {
+ pc = provider.DefaultChain
+ } else {
+ pc = provider.NewProviderChain(providers)
+ }
+ err = client.InitWithProviderChain(regionId, pc)
+ return
+}
+
// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
// this is the common api to create a sdk client
func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
@@ -41,7 +56,7 @@ func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.C
}
// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
-// usage: https://help.aliyun.com/document_detail/66217.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
client = &Client{}
err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
@@ -49,7 +64,7 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
}
// NewClientWithStsToken is a shortcut to create sdk client with sts token
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
client = &Client{}
err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
@@ -57,15 +72,23 @@ func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToke
}
// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
client = &Client{}
err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
return
}
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
+ client = &Client{}
+ err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+ return
+}
+
// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
-// usage: https://help.aliyun.com/document_detail/66223.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
client = &Client{}
err = client.InitWithEcsRamRole(regionId, roleName)
@@ -73,7 +96,7 @@ func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client,
}
// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
-// attention: rsa key pair auth is only Japan regions available
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
client = &Client{}
err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/create_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/create_instance.go
new file mode 100644
index 000000000..c90b6bb83
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/create_instance.go
@@ -0,0 +1,111 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// CreateInstance invokes the alidns.CreateInstance API synchronously
+// api document: https://help.aliyun.com/api/alidns/createinstance.html
+func (client *Client) CreateInstance(request *CreateInstanceRequest) (response *CreateInstanceResponse, err error) {
+ response = CreateCreateInstanceResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// CreateInstanceWithChan invokes the alidns.CreateInstance API asynchronously
+// api document: https://help.aliyun.com/api/alidns/createinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateInstanceWithChan(request *CreateInstanceRequest) (<-chan *CreateInstanceResponse, <-chan error) {
+ responseChan := make(chan *CreateInstanceResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.CreateInstance(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// CreateInstanceWithCallback invokes the alidns.CreateInstance API asynchronously
+// api document: https://help.aliyun.com/api/alidns/createinstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateInstanceWithCallback(request *CreateInstanceRequest, callback func(response *CreateInstanceResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *CreateInstanceResponse
+ var err error
+ defer close(result)
+ response, err = client.CreateInstance(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// CreateInstanceRequest is the request struct for api CreateInstance
+type CreateInstanceRequest struct {
+ *requests.RpcRequest
+ Month requests.Integer `position:"Query" name:"Month"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
+ InstanceVersion string `position:"Query" name:"InstanceVersion"`
+ OwnerId requests.Integer `position:"Query" name:"OwnerId"`
+ Token string `position:"Query" name:"Token"`
+}
+
+// CreateInstanceResponse is the response struct for api CreateInstance
+type CreateInstanceResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ OrderId string `json:"OrderId" xml:"OrderId"`
+ InstanceId string `json:"InstanceId" xml:"InstanceId"`
+}
+
+// CreateCreateInstanceRequest creates a request to invoke CreateInstance API
+func CreateCreateInstanceRequest() (request *CreateInstanceRequest) {
+ request = &CreateInstanceRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "CreateInstance", "Alidns", "openAPI")
+ return
+}
+
+// CreateCreateInstanceResponse creates a response to parse from CreateInstance response
+func CreateCreateInstanceResponse() (response *CreateInstanceResponse) {
+ response = &CreateInstanceResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domain_records.go
deleted file mode 100644
index 8c973f766..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domain_records.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// DeleteBatchDomainRecords invokes the alidns.DeleteBatchDomainRecords API synchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomainrecords.html
-func (client *Client) DeleteBatchDomainRecords(request *DeleteBatchDomainRecordsRequest) (response *DeleteBatchDomainRecordsResponse, err error) {
- response = CreateDeleteBatchDomainRecordsResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// DeleteBatchDomainRecordsWithChan invokes the alidns.DeleteBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DeleteBatchDomainRecordsWithChan(request *DeleteBatchDomainRecordsRequest) (<-chan *DeleteBatchDomainRecordsResponse, <-chan error) {
- responseChan := make(chan *DeleteBatchDomainRecordsResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.DeleteBatchDomainRecords(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// DeleteBatchDomainRecordsWithCallback invokes the alidns.DeleteBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DeleteBatchDomainRecordsWithCallback(request *DeleteBatchDomainRecordsRequest, callback func(response *DeleteBatchDomainRecordsResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *DeleteBatchDomainRecordsResponse
- var err error
- defer close(result)
- response, err = client.DeleteBatchDomainRecords(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// DeleteBatchDomainRecordsRequest is the request struct for api DeleteBatchDomainRecords
-type DeleteBatchDomainRecordsRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- Records string `position:"Query" name:"Records"`
-}
-
-// DeleteBatchDomainRecordsResponse is the response struct for api DeleteBatchDomainRecords
-type DeleteBatchDomainRecordsResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- TraceId string `json:"TraceId" xml:"TraceId"`
-}
-
-// CreateDeleteBatchDomainRecordsRequest creates a request to invoke DeleteBatchDomainRecords API
-func CreateDeleteBatchDomainRecordsRequest() (request *DeleteBatchDomainRecordsRequest) {
- request = &DeleteBatchDomainRecordsRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteBatchDomainRecords", "", "")
- return
-}
-
-// CreateDeleteBatchDomainRecordsResponse creates a response to parse from DeleteBatchDomainRecords response
-func CreateDeleteBatchDomainRecordsResponse() (response *DeleteBatchDomainRecordsResponse) {
- response = &DeleteBatchDomainRecordsResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domains.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domains.go
deleted file mode 100644
index fbbac4cec..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_batch_domains.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// DeleteBatchDomains invokes the alidns.DeleteBatchDomains API synchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomains.html
-func (client *Client) DeleteBatchDomains(request *DeleteBatchDomainsRequest) (response *DeleteBatchDomainsResponse, err error) {
- response = CreateDeleteBatchDomainsResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// DeleteBatchDomainsWithChan invokes the alidns.DeleteBatchDomains API asynchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomains.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DeleteBatchDomainsWithChan(request *DeleteBatchDomainsRequest) (<-chan *DeleteBatchDomainsResponse, <-chan error) {
- responseChan := make(chan *DeleteBatchDomainsResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.DeleteBatchDomains(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// DeleteBatchDomainsWithCallback invokes the alidns.DeleteBatchDomains API asynchronously
-// api document: https://help.aliyun.com/api/alidns/deletebatchdomains.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DeleteBatchDomainsWithCallback(request *DeleteBatchDomainsRequest, callback func(response *DeleteBatchDomainsResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *DeleteBatchDomainsResponse
- var err error
- defer close(result)
- response, err = client.DeleteBatchDomains(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// DeleteBatchDomainsRequest is the request struct for api DeleteBatchDomains
-type DeleteBatchDomainsRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- Domains string `position:"Query" name:"Domains"`
-}
-
-// DeleteBatchDomainsResponse is the response struct for api DeleteBatchDomains
-type DeleteBatchDomainsResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- TraceId string `json:"TraceId" xml:"TraceId"`
-}
-
-// CreateDeleteBatchDomainsRequest creates a request to invoke DeleteBatchDomains API
-func CreateDeleteBatchDomainsRequest() (request *DeleteBatchDomainsRequest) {
- request = &DeleteBatchDomainsRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteBatchDomains", "", "")
- return
-}
-
-// CreateDeleteBatchDomainsResponse creates a response to parse from DeleteBatchDomains response
-func CreateDeleteBatchDomainsResponse() (response *DeleteBatchDomainsResponse) {
- response = &DeleteBatchDomainsResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain.go
index 097f37f9a..67d471525 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain.go
@@ -76,9 +76,9 @@ func (client *Client) DeleteDomainWithCallback(request *DeleteDomainRequest, cal
// DeleteDomainRequest is the request struct for api DeleteDomain
type DeleteDomainRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
}
// DeleteDomainResponse is the response struct for api DeleteDomain
@@ -93,7 +93,7 @@ func CreateDeleteDomainRequest() (request *DeleteDomainRequest) {
request = &DeleteDomainRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomain", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomain", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_group.go
index 341b91227..d3395e6c6 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_group.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_group.go
@@ -76,9 +76,9 @@ func (client *Client) DeleteDomainGroupWithCallback(request *DeleteDomainGroupRe
// DeleteDomainGroupRequest is the request struct for api DeleteDomainGroup
type DeleteDomainGroupRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
GroupId string `position:"Query" name:"GroupId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// DeleteDomainGroupResponse is the response struct for api DeleteDomainGroup
@@ -93,7 +93,7 @@ func CreateDeleteDomainGroupRequest() (request *DeleteDomainGroupRequest) {
request = &DeleteDomainGroupRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomainGroup", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomainGroup", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_record.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_record.go
index 73f2b08fc..cd97d6503 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_record.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_domain_record.go
@@ -76,9 +76,9 @@ func (client *Client) DeleteDomainRecordWithCallback(request *DeleteDomainRecord
// DeleteDomainRecordRequest is the request struct for api DeleteDomainRecord
type DeleteDomainRecordRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
RecordId string `position:"Query" name:"RecordId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// DeleteDomainRecordResponse is the response struct for api DeleteDomainRecord
@@ -93,7 +93,7 @@ func CreateDeleteDomainRecordRequest() (request *DeleteDomainRecordRequest) {
request = &DeleteDomainRecordRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomainRecord", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteDomainRecord", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_access_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_access_strategy.go
new file mode 100644
index 000000000..69cc60493
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_access_strategy.go
@@ -0,0 +1,105 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DeleteGtmAccessStrategy invokes the alidns.DeleteGtmAccessStrategy API synchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaccessstrategy.html
+func (client *Client) DeleteGtmAccessStrategy(request *DeleteGtmAccessStrategyRequest) (response *DeleteGtmAccessStrategyResponse, err error) {
+ response = CreateDeleteGtmAccessStrategyResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DeleteGtmAccessStrategyWithChan invokes the alidns.DeleteGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteGtmAccessStrategyWithChan(request *DeleteGtmAccessStrategyRequest) (<-chan *DeleteGtmAccessStrategyResponse, <-chan error) {
+ responseChan := make(chan *DeleteGtmAccessStrategyResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DeleteGtmAccessStrategy(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DeleteGtmAccessStrategyWithCallback invokes the alidns.DeleteGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteGtmAccessStrategyWithCallback(request *DeleteGtmAccessStrategyRequest, callback func(response *DeleteGtmAccessStrategyResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DeleteGtmAccessStrategyResponse
+ var err error
+ defer close(result)
+ response, err = client.DeleteGtmAccessStrategy(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DeleteGtmAccessStrategyRequest is the request struct for api DeleteGtmAccessStrategy
+type DeleteGtmAccessStrategyRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ StrategyId string `position:"Query" name:"StrategyId"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DeleteGtmAccessStrategyResponse is the response struct for api DeleteGtmAccessStrategy
+type DeleteGtmAccessStrategyResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteGtmAccessStrategyRequest creates a request to invoke DeleteGtmAccessStrategy API
+func CreateDeleteGtmAccessStrategyRequest() (request *DeleteGtmAccessStrategyRequest) {
+ request = &DeleteGtmAccessStrategyRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteGtmAccessStrategy", "Alidns", "openAPI")
+ return
+}
+
+// CreateDeleteGtmAccessStrategyResponse creates a response to parse from DeleteGtmAccessStrategy response
+func CreateDeleteGtmAccessStrategyResponse() (response *DeleteGtmAccessStrategyResponse) {
+ response = &DeleteGtmAccessStrategyResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_address_pool.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_address_pool.go
new file mode 100644
index 000000000..4ca0aad95
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_gtm_address_pool.go
@@ -0,0 +1,105 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DeleteGtmAddressPool invokes the alidns.DeleteGtmAddressPool API synchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaddresspool.html
+func (client *Client) DeleteGtmAddressPool(request *DeleteGtmAddressPoolRequest) (response *DeleteGtmAddressPoolResponse, err error) {
+ response = CreateDeleteGtmAddressPoolResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DeleteGtmAddressPoolWithChan invokes the alidns.DeleteGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteGtmAddressPoolWithChan(request *DeleteGtmAddressPoolRequest) (<-chan *DeleteGtmAddressPoolResponse, <-chan error) {
+ responseChan := make(chan *DeleteGtmAddressPoolResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DeleteGtmAddressPool(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DeleteGtmAddressPoolWithCallback invokes the alidns.DeleteGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/deletegtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteGtmAddressPoolWithCallback(request *DeleteGtmAddressPoolRequest, callback func(response *DeleteGtmAddressPoolResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DeleteGtmAddressPoolResponse
+ var err error
+ defer close(result)
+ response, err = client.DeleteGtmAddressPool(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DeleteGtmAddressPoolRequest is the request struct for api DeleteGtmAddressPool
+type DeleteGtmAddressPoolRequest struct {
+ *requests.RpcRequest
+ AddrPoolId string `position:"Query" name:"AddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DeleteGtmAddressPoolResponse is the response struct for api DeleteGtmAddressPool
+type DeleteGtmAddressPoolResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteGtmAddressPoolRequest creates a request to invoke DeleteGtmAddressPool API
+func CreateDeleteGtmAddressPoolRequest() (request *DeleteGtmAddressPoolRequest) {
+ request = &DeleteGtmAddressPoolRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteGtmAddressPool", "Alidns", "openAPI")
+ return
+}
+
+// CreateDeleteGtmAddressPoolResponse creates a response to parse from DeleteGtmAddressPool response
+func CreateDeleteGtmAddressPoolResponse() (response *DeleteGtmAddressPoolResponse) {
+ response = &DeleteGtmAddressPoolResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_sub_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_sub_domain_records.go
index 06bb0fd72..9de84703b 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_sub_domain_records.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/delete_sub_domain_records.go
@@ -76,10 +76,10 @@ func (client *Client) DeleteSubDomainRecordsWithCallback(request *DeleteSubDomai
// DeleteSubDomainRecordsRequest is the request struct for api DeleteSubDomainRecords
type DeleteSubDomainRecordsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ RR string `position:"Query" name:"RR"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- RR string `position:"Query" name:"RR"`
+ Lang string `position:"Query" name:"Lang"`
Type string `position:"Query" name:"Type"`
}
@@ -96,7 +96,7 @@ func CreateDeleteSubDomainRecordsRequest() (request *DeleteSubDomainRecordsReque
request = &DeleteSubDomainRecordsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteSubDomainRecords", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DeleteSubDomainRecords", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result.go
deleted file mode 100644
index 67590cb8b..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// DescribeBatchResult invokes the alidns.DescribeBatchResult API synchronously
-// api document: https://help.aliyun.com/api/alidns/describebatchresult.html
-func (client *Client) DescribeBatchResult(request *DescribeBatchResultRequest) (response *DescribeBatchResultResponse, err error) {
- response = CreateDescribeBatchResultResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// DescribeBatchResultWithChan invokes the alidns.DescribeBatchResult API asynchronously
-// api document: https://help.aliyun.com/api/alidns/describebatchresult.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DescribeBatchResultWithChan(request *DescribeBatchResultRequest) (<-chan *DescribeBatchResultResponse, <-chan error) {
- responseChan := make(chan *DescribeBatchResultResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.DescribeBatchResult(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// DescribeBatchResultWithCallback invokes the alidns.DescribeBatchResult API asynchronously
-// api document: https://help.aliyun.com/api/alidns/describebatchresult.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DescribeBatchResultWithCallback(request *DescribeBatchResultRequest, callback func(response *DescribeBatchResultResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *DescribeBatchResultResponse
- var err error
- defer close(result)
- response, err = client.DescribeBatchResult(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// DescribeBatchResultRequest is the request struct for api DescribeBatchResult
-type DescribeBatchResultRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- TraceId string `position:"Query" name:"TraceId"`
-}
-
-// DescribeBatchResultResponse is the response struct for api DescribeBatchResult
-type DescribeBatchResultResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- TraceId string `json:"TraceId" xml:"TraceId"`
- Status int `json:"Status" xml:"Status"`
- BatchCount int `json:"BatchCount" xml:"BatchCount"`
- SuccessNumber int `json:"SuccessNumber" xml:"SuccessNumber"`
- FailResults FailResults `json:"FailResults" xml:"FailResults"`
-}
-
-// CreateDescribeBatchResultRequest creates a request to invoke DescribeBatchResult API
-func CreateDescribeBatchResultRequest() (request *DescribeBatchResultRequest) {
- request = &DescribeBatchResultRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeBatchResult", "", "")
- return
-}
-
-// CreateDescribeBatchResultResponse creates a response to parse from DescribeBatchResult response
-func CreateDescribeBatchResultResponse() (response *DescribeBatchResultResponse) {
- response = &DescribeBatchResultResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_count.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_count.go
new file mode 100644
index 000000000..a1100ed82
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_count.go
@@ -0,0 +1,113 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeBatchResultCount invokes the alidns.DescribeBatchResultCount API synchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultcount.html
+func (client *Client) DescribeBatchResultCount(request *DescribeBatchResultCountRequest) (response *DescribeBatchResultCountResponse, err error) {
+ response = CreateDescribeBatchResultCountResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeBatchResultCountWithChan invokes the alidns.DescribeBatchResultCount API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultcount.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeBatchResultCountWithChan(request *DescribeBatchResultCountRequest) (<-chan *DescribeBatchResultCountResponse, <-chan error) {
+ responseChan := make(chan *DescribeBatchResultCountResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeBatchResultCount(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeBatchResultCountWithCallback invokes the alidns.DescribeBatchResultCount API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultcount.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeBatchResultCountWithCallback(request *DescribeBatchResultCountRequest, callback func(response *DescribeBatchResultCountResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeBatchResultCountResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeBatchResultCount(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeBatchResultCountRequest is the request struct for api DescribeBatchResultCount
+type DescribeBatchResultCountRequest struct {
+ *requests.RpcRequest
+ BatchType string `position:"Query" name:"BatchType"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+ TaskId requests.Integer `position:"Query" name:"TaskId"`
+}
+
+// DescribeBatchResultCountResponse is the response struct for api DescribeBatchResultCount
+type DescribeBatchResultCountResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Status int `json:"Status" xml:"Status"`
+ TotalCount int `json:"TotalCount" xml:"TotalCount"`
+ SuccessCount int `json:"SuccessCount" xml:"SuccessCount"`
+ FailedCount int `json:"FailedCount" xml:"FailedCount"`
+ Reason string `json:"Reason" xml:"Reason"`
+ BatchType string `json:"BatchType" xml:"BatchType"`
+ TaskId int64 `json:"TaskId" xml:"TaskId"`
+}
+
+// CreateDescribeBatchResultCountRequest creates a request to invoke DescribeBatchResultCount API
+func CreateDescribeBatchResultCountRequest() (request *DescribeBatchResultCountRequest) {
+ request = &DescribeBatchResultCountRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeBatchResultCount", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeBatchResultCountResponse creates a response to parse from DescribeBatchResultCount response
+func CreateDescribeBatchResultCountResponse() (response *DescribeBatchResultCountResponse) {
+ response = &DescribeBatchResultCountResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_detail.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_detail.go
new file mode 100644
index 000000000..8baa5b8fc
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_batch_result_detail.go
@@ -0,0 +1,112 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeBatchResultDetail invokes the alidns.DescribeBatchResultDetail API synchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultdetail.html
+func (client *Client) DescribeBatchResultDetail(request *DescribeBatchResultDetailRequest) (response *DescribeBatchResultDetailResponse, err error) {
+ response = CreateDescribeBatchResultDetailResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeBatchResultDetailWithChan invokes the alidns.DescribeBatchResultDetail API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultdetail.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeBatchResultDetailWithChan(request *DescribeBatchResultDetailRequest) (<-chan *DescribeBatchResultDetailResponse, <-chan error) {
+ responseChan := make(chan *DescribeBatchResultDetailResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeBatchResultDetail(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeBatchResultDetailWithCallback invokes the alidns.DescribeBatchResultDetail API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describebatchresultdetail.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeBatchResultDetailWithCallback(request *DescribeBatchResultDetailRequest, callback func(response *DescribeBatchResultDetailResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeBatchResultDetailResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeBatchResultDetail(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeBatchResultDetailRequest is the request struct for api DescribeBatchResultDetail
+type DescribeBatchResultDetailRequest struct {
+ *requests.RpcRequest
+ BatchType string `position:"Query" name:"BatchType"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+ TaskId requests.Integer `position:"Query" name:"TaskId"`
+}
+
+// DescribeBatchResultDetailResponse is the response struct for api DescribeBatchResultDetail
+type DescribeBatchResultDetailResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
+ BatchResultDetails BatchResultDetails `json:"BatchResultDetails" xml:"BatchResultDetails"`
+}
+
+// CreateDescribeBatchResultDetailRequest creates a request to invoke DescribeBatchResultDetail API
+func CreateDescribeBatchResultDetailRequest() (request *DescribeBatchResultDetailRequest) {
+ request = &DescribeBatchResultDetailRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeBatchResultDetail", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeBatchResultDetailResponse creates a response to parse from DescribeBatchResultDetail response
+func CreateDescribeBatchResultDetailResponse() (response *DescribeBatchResultDetailResponse) {
+ response = &DescribeBatchResultDetailResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instance.go
index b92bf7830..74f23ce6c 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instance.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instance.go
@@ -76,9 +76,9 @@ func (client *Client) DescribeDnsProductInstanceWithCallback(request *DescribeDn
// DescribeDnsProductInstanceRequest is the request struct for api DescribeDnsProductInstance
type DescribeDnsProductInstanceRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// DescribeDnsProductInstanceResponse is the response struct for api DescribeDnsProductInstance
@@ -89,30 +89,33 @@ type DescribeDnsProductInstanceResponse struct {
VersionCode string `json:"VersionCode" xml:"VersionCode"`
VersionName string `json:"VersionName" xml:"VersionName"`
StartTime string `json:"StartTime" xml:"StartTime"`
- StartTimestamp int `json:"StartTimestamp" xml:"StartTimestamp"`
+ StartTimestamp int64 `json:"StartTimestamp" xml:"StartTimestamp"`
EndTime string `json:"EndTime" xml:"EndTime"`
- EndTimestamp int `json:"EndTimestamp" xml:"EndTimestamp"`
+ EndTimestamp int64 `json:"EndTimestamp" xml:"EndTimestamp"`
Domain string `json:"Domain" xml:"Domain"`
- BindCount int `json:"BindCount" xml:"BindCount"`
- BindUsedCount int `json:"BindUsedCount" xml:"BindUsedCount"`
- TTLMinValue int `json:"TTLMinValue" xml:"TTLMinValue"`
- SubDomainLevel int `json:"SubDomainLevel" xml:"SubDomainLevel"`
- DnsSLBCount int `json:"DnsSLBCount" xml:"DnsSLBCount"`
- URLForwardCount int `json:"URLForwardCount" xml:"URLForwardCount"`
- DDosDefendFlow int `json:"DDosDefendFlow" xml:"DDosDefendFlow"`
- DDosDefendQuery int `json:"DDosDefendQuery" xml:"DDosDefendQuery"`
- OverseaDDosDefendFlow int `json:"OverseaDDosDefendFlow" xml:"OverseaDDosDefendFlow"`
+ BindCount int64 `json:"BindCount" xml:"BindCount"`
+ BindUsedCount int64 `json:"BindUsedCount" xml:"BindUsedCount"`
+ TTLMinValue int64 `json:"TTLMinValue" xml:"TTLMinValue"`
+ SubDomainLevel int64 `json:"SubDomainLevel" xml:"SubDomainLevel"`
+ DnsSLBCount int64 `json:"DnsSLBCount" xml:"DnsSLBCount"`
+ URLForwardCount int64 `json:"URLForwardCount" xml:"URLForwardCount"`
+ DDosDefendFlow int64 `json:"DDosDefendFlow" xml:"DDosDefendFlow"`
+ DDosDefendQuery int64 `json:"DDosDefendQuery" xml:"DDosDefendQuery"`
+ OverseaDDosDefendFlow int64 `json:"OverseaDDosDefendFlow" xml:"OverseaDDosDefendFlow"`
SearchEngineLines string `json:"SearchEngineLines" xml:"SearchEngineLines"`
ISPLines string `json:"ISPLines" xml:"ISPLines"`
ISPRegionLines string `json:"ISPRegionLines" xml:"ISPRegionLines"`
OverseaLine string `json:"OverseaLine" xml:"OverseaLine"`
- MonitorNodeCount int `json:"MonitorNodeCount" xml:"MonitorNodeCount"`
- MonitorFrequency int `json:"MonitorFrequency" xml:"MonitorFrequency"`
- MonitorTaskCount int `json:"MonitorTaskCount" xml:"MonitorTaskCount"`
+ MonitorNodeCount int64 `json:"MonitorNodeCount" xml:"MonitorNodeCount"`
+ MonitorFrequency int64 `json:"MonitorFrequency" xml:"MonitorFrequency"`
+ MonitorTaskCount int64 `json:"MonitorTaskCount" xml:"MonitorTaskCount"`
RegionLines bool `json:"RegionLines" xml:"RegionLines"`
Gslb bool `json:"Gslb" xml:"Gslb"`
InClean bool `json:"InClean" xml:"InClean"`
InBlackHole bool `json:"InBlackHole" xml:"InBlackHole"`
+ BindDomainCount int64 `json:"BindDomainCount" xml:"BindDomainCount"`
+ BindDomainUsedCount int64 `json:"BindDomainUsedCount" xml:"BindDomainUsedCount"`
+ DnsSecurity string `json:"DnsSecurity" xml:"DnsSecurity"`
DnsServers DnsServersInDescribeDnsProductInstance `json:"DnsServers" xml:"DnsServers"`
}
@@ -121,7 +124,7 @@ func CreateDescribeDnsProductInstanceRequest() (request *DescribeDnsProductInsta
request = &DescribeDnsProductInstanceRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDnsProductInstance", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDnsProductInstance", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instances.go
index ae17278e8..c7c5c2e67 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instances.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dns_product_instances.go
@@ -76,20 +76,20 @@ func (client *Client) DescribeDnsProductInstancesWithCallback(request *DescribeD
// DescribeDnsProductInstancesRequest is the request struct for api DescribeDnsProductInstances
type DescribeDnsProductInstancesRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
VersionCode string `position:"Query" name:"VersionCode"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeDnsProductInstancesResponse is the response struct for api DescribeDnsProductInstances
type DescribeDnsProductInstancesResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
DnsProducts DnsProducts `json:"DnsProducts" xml:"DnsProducts"`
}
@@ -98,7 +98,7 @@ func CreateDescribeDnsProductInstancesRequest() (request *DescribeDnsProductInst
request = &DescribeDnsProductInstancesRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDnsProductInstances", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDnsProductInstances", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dnsslb_sub_domains.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dnsslb_sub_domains.go
index b545f411a..818ca1ef9 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dnsslb_sub_domains.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_dnsslb_sub_domains.go
@@ -76,20 +76,20 @@ func (client *Client) DescribeDNSSLBSubDomainsWithCallback(request *DescribeDNSS
// DescribeDNSSLBSubDomainsRequest is the request struct for api DescribeDNSSLBSubDomains
type DescribeDNSSLBSubDomainsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeDNSSLBSubDomainsResponse is the response struct for api DescribeDNSSLBSubDomains
type DescribeDNSSLBSubDomainsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
SlbSubDomains SlbSubDomains `json:"SlbSubDomains" xml:"SlbSubDomains"`
}
@@ -98,7 +98,7 @@ func CreateDescribeDNSSLBSubDomainsRequest() (request *DescribeDNSSLBSubDomainsR
request = &DescribeDNSSLBSubDomainsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDNSSLBSubDomains", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDNSSLBSubDomains", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_dns_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_dns_statistics.go
new file mode 100644
index 000000000..f3942fdd2
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_dns_statistics.go
@@ -0,0 +1,108 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeDomainDnsStatistics invokes the alidns.DescribeDomainDnsStatistics API synchronously
+// api document: https://help.aliyun.com/api/alidns/describedomaindnsstatistics.html
+func (client *Client) DescribeDomainDnsStatistics(request *DescribeDomainDnsStatisticsRequest) (response *DescribeDomainDnsStatisticsResponse, err error) {
+ response = CreateDescribeDomainDnsStatisticsResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeDomainDnsStatisticsWithChan invokes the alidns.DescribeDomainDnsStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomaindnsstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainDnsStatisticsWithChan(request *DescribeDomainDnsStatisticsRequest) (<-chan *DescribeDomainDnsStatisticsResponse, <-chan error) {
+ responseChan := make(chan *DescribeDomainDnsStatisticsResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeDomainDnsStatistics(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeDomainDnsStatisticsWithCallback invokes the alidns.DescribeDomainDnsStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomaindnsstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainDnsStatisticsWithCallback(request *DescribeDomainDnsStatisticsRequest, callback func(response *DescribeDomainDnsStatisticsResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeDomainDnsStatisticsResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeDomainDnsStatistics(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeDomainDnsStatisticsRequest is the request struct for api DescribeDomainDnsStatistics
+type DescribeDomainDnsStatisticsRequest struct {
+ *requests.RpcRequest
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+}
+
+// DescribeDomainDnsStatisticsResponse is the response struct for api DescribeDomainDnsStatistics
+type DescribeDomainDnsStatisticsResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Statistics StatisticsInDescribeDomainDnsStatistics `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeDomainDnsStatisticsRequest creates a request to invoke DescribeDomainDnsStatistics API
+func CreateDescribeDomainDnsStatisticsRequest() (request *DescribeDomainDnsStatisticsRequest) {
+ request = &DescribeDomainDnsStatisticsRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainDnsStatistics", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeDomainDnsStatisticsResponse creates a response to parse from DescribeDomainDnsStatistics response
+func CreateDescribeDomainDnsStatisticsResponse() (response *DescribeDomainDnsStatisticsResponse) {
+ response = &DescribeDomainDnsStatisticsResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_groups.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_groups.go
index ffe1f1f37..081887393 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_groups.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_groups.go
@@ -76,20 +76,20 @@ func (client *Client) DescribeDomainGroupsWithCallback(request *DescribeDomainGr
// DescribeDomainGroupsRequest is the request struct for api DescribeDomainGroups
type DescribeDomainGroupsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
KeyWord string `position:"Query" name:"KeyWord"`
PageNumber requests.Integer `position:"Query" name:"PageNumber"`
- PageSize requests.Integer `position:"Query" name:"PageSize"`
}
// DescribeDomainGroupsResponse is the response struct for api DescribeDomainGroups
type DescribeDomainGroupsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
DomainGroups DomainGroups `json:"DomainGroups" xml:"DomainGroups"`
}
@@ -98,7 +98,7 @@ func CreateDescribeDomainGroupsRequest() (request *DescribeDomainGroupsRequest)
request = &DescribeDomainGroupsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainGroups", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainGroups", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_info.go
index 0f6f3e08b..5cd55af72 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_info.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_info.go
@@ -76,9 +76,9 @@ func (client *Client) DescribeDomainInfoWithCallback(request *DescribeDomainInfo
// DescribeDomainInfoRequest is the request struct for api DescribeDomainInfo
type DescribeDomainInfoRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
NeedDetailAttributes requests.Boolean `position:"Query" name:"NeedDetailAttributes"`
}
@@ -96,10 +96,13 @@ type DescribeDomainInfoResponse struct {
InstanceId string `json:"InstanceId" xml:"InstanceId"`
VersionCode string `json:"VersionCode" xml:"VersionCode"`
VersionName string `json:"VersionName" xml:"VersionName"`
- MinTtl int `json:"MinTtl" xml:"MinTtl"`
+ MinTtl int64 `json:"MinTtl" xml:"MinTtl"`
RecordLineTreeJson string `json:"RecordLineTreeJson" xml:"RecordLineTreeJson"`
LineType string `json:"LineType" xml:"LineType"`
RegionLines bool `json:"RegionLines" xml:"RegionLines"`
+ InBlackHole bool `json:"InBlackHole" xml:"InBlackHole"`
+ InClean bool `json:"InClean" xml:"InClean"`
+ SlaveDns bool `json:"SlaveDns" xml:"SlaveDns"`
DnsServers DnsServersInDescribeDomainInfo `json:"DnsServers" xml:"DnsServers"`
AvailableTtls AvailableTtls `json:"AvailableTtls" xml:"AvailableTtls"`
RecordLines RecordLinesInDescribeDomainInfo `json:"RecordLines" xml:"RecordLines"`
@@ -110,7 +113,7 @@ func CreateDescribeDomainInfoRequest() (request *DescribeDomainInfoRequest) {
request = &DescribeDomainInfoRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainInfo", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainInfo", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_logs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_logs.go
index 39e18ce87..035c56053 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_logs.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_logs.go
@@ -76,23 +76,24 @@ func (client *Client) DescribeDomainLogsWithCallback(request *DescribeDomainLogs
// DescribeDomainLogsRequest is the request struct for api DescribeDomainLogs
type DescribeDomainLogsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- KeyWord string `position:"Query" name:"KeyWord"`
- GroupId string `position:"Query" name:"GroupId"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
- PageSize requests.Integer `position:"Query" name:"PageSize"`
- StartDate string `position:"Query" name:"StartDate"`
EndDate string `position:"Query" name:"endDate"`
+ GroupId string `position:"Query" name:"GroupId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ KeyWord string `position:"Query" name:"KeyWord"`
+ StartDate string `position:"Query" name:"StartDate"`
+ Type string `position:"Query" name:"Type"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeDomainLogsResponse is the response struct for api DescribeDomainLogs
type DescribeDomainLogsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
DomainLogs DomainLogs `json:"DomainLogs" xml:"DomainLogs"`
}
@@ -101,7 +102,7 @@ func CreateDescribeDomainLogsRequest() (request *DescribeDomainLogsRequest) {
request = &DescribeDomainLogsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainLogs", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainLogs", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_ns.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_ns.go
index 51c86a95c..e88cc864f 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_ns.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_ns.go
@@ -76,9 +76,9 @@ func (client *Client) DescribeDomainNsWithCallback(request *DescribeDomainNsRequ
// DescribeDomainNsRequest is the request struct for api DescribeDomainNs
type DescribeDomainNsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
}
// DescribeDomainNsResponse is the response struct for api DescribeDomainNs
@@ -96,7 +96,7 @@ func CreateDescribeDomainNsRequest() (request *DescribeDomainNsRequest) {
request = &DescribeDomainNsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainNs", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainNs", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_record_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_record_info.go
index c59a7c528..efe7c76e4 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_record_info.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_record_info.go
@@ -76,9 +76,9 @@ func (client *Client) DescribeDomainRecordInfoWithCallback(request *DescribeDoma
// DescribeDomainRecordInfoRequest is the request struct for api DescribeDomainRecordInfo
type DescribeDomainRecordInfoRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
RecordId string `position:"Query" name:"RecordId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// DescribeDomainRecordInfoResponse is the response struct for api DescribeDomainRecordInfo
@@ -94,8 +94,8 @@ type DescribeDomainRecordInfoResponse struct {
RR string `json:"RR" xml:"RR"`
Type string `json:"Type" xml:"Type"`
Value string `json:"Value" xml:"Value"`
- TTL int `json:"TTL" xml:"TTL"`
- Priority int `json:"Priority" xml:"Priority"`
+ TTL int64 `json:"TTL" xml:"TTL"`
+ Priority int64 `json:"Priority" xml:"Priority"`
Line string `json:"Line" xml:"Line"`
Status string `json:"Status" xml:"Status"`
Locked bool `json:"Locked" xml:"Locked"`
@@ -106,7 +106,7 @@ func CreateDescribeDomainRecordInfoRequest() (request *DescribeDomainRecordInfoR
request = &DescribeDomainRecordInfoRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainRecordInfo", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainRecordInfo", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_records.go
index bc905384a..d7ef1f7f1 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_records.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_records.go
@@ -76,26 +76,31 @@ func (client *Client) DescribeDomainRecordsWithCallback(request *DescribeDomainR
// DescribeDomainRecordsRequest is the request struct for api DescribeDomainRecords
type DescribeDomainRecordsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- DomainName string `position:"Query" name:"DomainName"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
- PageSize requests.Integer `position:"Query" name:"PageSize"`
- KeyWord string `position:"Query" name:"KeyWord"`
- RRKeyWord string `position:"Query" name:"RRKeyWord"`
- TypeKeyWord string `position:"Query" name:"TypeKeyWord"`
ValueKeyWord string `position:"Query" name:"ValueKeyWord"`
+ Line string `position:"Query" name:"Line"`
+ GroupId requests.Integer `position:"Query" name:"GroupId"`
+ DomainName string `position:"Query" name:"DomainName"`
OrderBy string `position:"Query" name:"OrderBy"`
+ Type string `position:"Query" name:"Type"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ SearchMode string `position:"Query" name:"SearchMode"`
+ Lang string `position:"Query" name:"Lang"`
+ KeyWord string `position:"Query" name:"KeyWord"`
+ TypeKeyWord string `position:"Query" name:"TypeKeyWord"`
+ RRKeyWord string `position:"Query" name:"RRKeyWord"`
Direction string `position:"Query" name:"Direction"`
+ Status string `position:"Query" name:"Status"`
}
// DescribeDomainRecordsResponse is the response struct for api DescribeDomainRecords
type DescribeDomainRecordsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
DomainRecords DomainRecordsInDescribeDomainRecords `json:"DomainRecords" xml:"DomainRecords"`
}
@@ -104,7 +109,7 @@ func CreateDescribeDomainRecordsRequest() (request *DescribeDomainRecordsRequest
request = &DescribeDomainRecordsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainRecords", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainRecords", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics.go
new file mode 100644
index 000000000..15881be3d
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics.go
@@ -0,0 +1,108 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeDomainStatistics invokes the alidns.DescribeDomainStatistics API synchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatistics.html
+func (client *Client) DescribeDomainStatistics(request *DescribeDomainStatisticsRequest) (response *DescribeDomainStatisticsResponse, err error) {
+ response = CreateDescribeDomainStatisticsResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeDomainStatisticsWithChan invokes the alidns.DescribeDomainStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainStatisticsWithChan(request *DescribeDomainStatisticsRequest) (<-chan *DescribeDomainStatisticsResponse, <-chan error) {
+ responseChan := make(chan *DescribeDomainStatisticsResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeDomainStatistics(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeDomainStatisticsWithCallback invokes the alidns.DescribeDomainStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainStatisticsWithCallback(request *DescribeDomainStatisticsRequest, callback func(response *DescribeDomainStatisticsResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeDomainStatisticsResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeDomainStatistics(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeDomainStatisticsRequest is the request struct for api DescribeDomainStatistics
+type DescribeDomainStatisticsRequest struct {
+ *requests.RpcRequest
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+}
+
+// DescribeDomainStatisticsResponse is the response struct for api DescribeDomainStatistics
+type DescribeDomainStatisticsResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Statistics StatisticsInDescribeDomainStatistics `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeDomainStatisticsRequest creates a request to invoke DescribeDomainStatistics API
+func CreateDescribeDomainStatisticsRequest() (request *DescribeDomainStatisticsRequest) {
+ request = &DescribeDomainStatisticsRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainStatistics", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeDomainStatisticsResponse creates a response to parse from DescribeDomainStatistics response
+func CreateDescribeDomainStatisticsResponse() (response *DescribeDomainStatisticsResponse) {
+ response = &DescribeDomainStatisticsResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics_summary.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics_summary.go
new file mode 100644
index 000000000..74251a724
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_statistics_summary.go
@@ -0,0 +1,118 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeDomainStatisticsSummary invokes the alidns.DescribeDomainStatisticsSummary API synchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatisticssummary.html
+func (client *Client) DescribeDomainStatisticsSummary(request *DescribeDomainStatisticsSummaryRequest) (response *DescribeDomainStatisticsSummaryResponse, err error) {
+ response = CreateDescribeDomainStatisticsSummaryResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeDomainStatisticsSummaryWithChan invokes the alidns.DescribeDomainStatisticsSummary API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatisticssummary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainStatisticsSummaryWithChan(request *DescribeDomainStatisticsSummaryRequest) (<-chan *DescribeDomainStatisticsSummaryResponse, <-chan error) {
+ responseChan := make(chan *DescribeDomainStatisticsSummaryResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeDomainStatisticsSummary(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeDomainStatisticsSummaryWithCallback invokes the alidns.DescribeDomainStatisticsSummary API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describedomainstatisticssummary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeDomainStatisticsSummaryWithCallback(request *DescribeDomainStatisticsSummaryRequest, callback func(response *DescribeDomainStatisticsSummaryResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeDomainStatisticsSummaryResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeDomainStatisticsSummary(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeDomainStatisticsSummaryRequest is the request struct for api DescribeDomainStatisticsSummary
+type DescribeDomainStatisticsSummaryRequest struct {
+ *requests.RpcRequest
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ OrderBy string `position:"Query" name:"OrderBy"`
+ SearchMode string `position:"Query" name:"SearchMode"`
+ Threshold requests.Integer `position:"Query" name:"Threshold"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+ Keyword string `position:"Query" name:"Keyword"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+ Direction string `position:"Query" name:"Direction"`
+}
+
+// DescribeDomainStatisticsSummaryResponse is the response struct for api DescribeDomainStatisticsSummary
+type DescribeDomainStatisticsSummaryResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ Statistics StatisticsInDescribeDomainStatisticsSummary `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeDomainStatisticsSummaryRequest creates a request to invoke DescribeDomainStatisticsSummary API
+func CreateDescribeDomainStatisticsSummaryRequest() (request *DescribeDomainStatisticsSummaryRequest) {
+ request = &DescribeDomainStatisticsSummaryRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainStatisticsSummary", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeDomainStatisticsSummaryResponse creates a response to parse from DescribeDomainStatisticsSummary response
+func CreateDescribeDomainStatisticsSummaryResponse() (response *DescribeDomainStatisticsSummaryResponse) {
+ response = &DescribeDomainStatisticsSummaryResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_whois_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_whois_info.go
deleted file mode 100644
index 9984f6dfc..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domain_whois_info.go
+++ /dev/null
@@ -1,113 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// DescribeDomainWhoisInfo invokes the alidns.DescribeDomainWhoisInfo API synchronously
-// api document: https://help.aliyun.com/api/alidns/describedomainwhoisinfo.html
-func (client *Client) DescribeDomainWhoisInfo(request *DescribeDomainWhoisInfoRequest) (response *DescribeDomainWhoisInfoResponse, err error) {
- response = CreateDescribeDomainWhoisInfoResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// DescribeDomainWhoisInfoWithChan invokes the alidns.DescribeDomainWhoisInfo API asynchronously
-// api document: https://help.aliyun.com/api/alidns/describedomainwhoisinfo.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DescribeDomainWhoisInfoWithChan(request *DescribeDomainWhoisInfoRequest) (<-chan *DescribeDomainWhoisInfoResponse, <-chan error) {
- responseChan := make(chan *DescribeDomainWhoisInfoResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.DescribeDomainWhoisInfo(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// DescribeDomainWhoisInfoWithCallback invokes the alidns.DescribeDomainWhoisInfo API asynchronously
-// api document: https://help.aliyun.com/api/alidns/describedomainwhoisinfo.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) DescribeDomainWhoisInfoWithCallback(request *DescribeDomainWhoisInfoRequest, callback func(response *DescribeDomainWhoisInfoResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *DescribeDomainWhoisInfoResponse
- var err error
- defer close(result)
- response, err = client.DescribeDomainWhoisInfo(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// DescribeDomainWhoisInfoRequest is the request struct for api DescribeDomainWhoisInfo
-type DescribeDomainWhoisInfoRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- DomainName string `position:"Query" name:"DomainName"`
- GroupId string `position:"Query" name:"GroupId"`
-}
-
-// DescribeDomainWhoisInfoResponse is the response struct for api DescribeDomainWhoisInfo
-type DescribeDomainWhoisInfoResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- RegistrantName string `json:"RegistrantName" xml:"RegistrantName"`
- RegistrantEmail string `json:"RegistrantEmail" xml:"RegistrantEmail"`
- Registrar string `json:"Registrar" xml:"Registrar"`
- RegistrationDate string `json:"RegistrationDate" xml:"RegistrationDate"`
- ExpirationDate string `json:"ExpirationDate" xml:"ExpirationDate"`
- StatusList StatusList `json:"StatusList" xml:"StatusList"`
- DnsServers DnsServersInDescribeDomainWhoisInfo `json:"DnsServers" xml:"DnsServers"`
-}
-
-// CreateDescribeDomainWhoisInfoRequest creates a request to invoke DescribeDomainWhoisInfo API
-func CreateDescribeDomainWhoisInfoRequest() (request *DescribeDomainWhoisInfoRequest) {
- request = &DescribeDomainWhoisInfoRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomainWhoisInfo", "", "")
- return
-}
-
-// CreateDescribeDomainWhoisInfoResponse creates a response to parse from DescribeDomainWhoisInfo response
-func CreateDescribeDomainWhoisInfoResponse() (response *DescribeDomainWhoisInfoResponse) {
- response = &DescribeDomainWhoisInfoResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domains.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domains.go
index a49982b7b..652347f9e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domains.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_domains.go
@@ -76,21 +76,23 @@ func (client *Client) DescribeDomainsWithCallback(request *DescribeDomainsReques
// DescribeDomainsRequest is the request struct for api DescribeDomains
type DescribeDomainsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- KeyWord string `position:"Query" name:"KeyWord"`
- GroupId string `position:"Query" name:"GroupId"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
- PageSize requests.Integer `position:"Query" name:"PageSize"`
+ ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
+ GroupId string `position:"Query" name:"GroupId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ SearchMode string `position:"Query" name:"SearchMode"`
+ Lang string `position:"Query" name:"Lang"`
+ KeyWord string `position:"Query" name:"KeyWord"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeDomainsResponse is the response struct for api DescribeDomains
type DescribeDomainsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
Domains Domains `json:"Domains" xml:"Domains"`
}
@@ -99,7 +101,7 @@ func CreateDescribeDomainsRequest() (request *DescribeDomainsRequest) {
request = &DescribeDomainsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomains", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeDomains", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategies.go
new file mode 100644
index 000000000..ef3528ab0
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategies.go
@@ -0,0 +1,112 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmAccessStrategies invokes the alidns.DescribeGtmAccessStrategies API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategies.html
+func (client *Client) DescribeGtmAccessStrategies(request *DescribeGtmAccessStrategiesRequest) (response *DescribeGtmAccessStrategiesResponse, err error) {
+ response = CreateDescribeGtmAccessStrategiesResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmAccessStrategiesWithChan invokes the alidns.DescribeGtmAccessStrategies API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategies.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategiesWithChan(request *DescribeGtmAccessStrategiesRequest) (<-chan *DescribeGtmAccessStrategiesResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmAccessStrategiesResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmAccessStrategies(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmAccessStrategiesWithCallback invokes the alidns.DescribeGtmAccessStrategies API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategies.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategiesWithCallback(request *DescribeGtmAccessStrategiesRequest, callback func(response *DescribeGtmAccessStrategiesResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmAccessStrategiesResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmAccessStrategies(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmAccessStrategiesRequest is the request struct for api DescribeGtmAccessStrategies
+type DescribeGtmAccessStrategiesRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+}
+
+// DescribeGtmAccessStrategiesResponse is the response struct for api DescribeGtmAccessStrategies
+type DescribeGtmAccessStrategiesResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ Strategies Strategies `json:"Strategies" xml:"Strategies"`
+}
+
+// CreateDescribeGtmAccessStrategiesRequest creates a request to invoke DescribeGtmAccessStrategies API
+func CreateDescribeGtmAccessStrategiesRequest() (request *DescribeGtmAccessStrategiesRequest) {
+ request = &DescribeGtmAccessStrategiesRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmAccessStrategies", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmAccessStrategiesResponse creates a response to parse from DescribeGtmAccessStrategies response
+func CreateDescribeGtmAccessStrategiesResponse() (response *DescribeGtmAccessStrategiesResponse) {
+ response = &DescribeGtmAccessStrategiesResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy.go
new file mode 100644
index 000000000..d1851d6ce
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy.go
@@ -0,0 +1,116 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmAccessStrategy invokes the alidns.DescribeGtmAccessStrategy API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategy.html
+func (client *Client) DescribeGtmAccessStrategy(request *DescribeGtmAccessStrategyRequest) (response *DescribeGtmAccessStrategyResponse, err error) {
+ response = CreateDescribeGtmAccessStrategyResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmAccessStrategyWithChan invokes the alidns.DescribeGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategyWithChan(request *DescribeGtmAccessStrategyRequest) (<-chan *DescribeGtmAccessStrategyResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmAccessStrategyResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmAccessStrategy(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmAccessStrategyWithCallback invokes the alidns.DescribeGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategyWithCallback(request *DescribeGtmAccessStrategyRequest, callback func(response *DescribeGtmAccessStrategyResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmAccessStrategyResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmAccessStrategy(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmAccessStrategyRequest is the request struct for api DescribeGtmAccessStrategy
+type DescribeGtmAccessStrategyRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ StrategyId string `position:"Query" name:"StrategyId"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmAccessStrategyResponse is the response struct for api DescribeGtmAccessStrategy
+type DescribeGtmAccessStrategyResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ StrategyId string `json:"StrategyId" xml:"StrategyId"`
+ StrategyName string `json:"StrategyName" xml:"StrategyName"`
+ DefultAddrPoolId string `json:"DefultAddrPoolId" xml:"DefultAddrPoolId"`
+ DefaultAddrPoolName string `json:"DefaultAddrPoolName" xml:"DefaultAddrPoolName"`
+ FailoverAddrPoolId string `json:"FailoverAddrPoolId" xml:"FailoverAddrPoolId"`
+ FailoverAddrPoolName string `json:"FailoverAddrPoolName" xml:"FailoverAddrPoolName"`
+ StrategyMode string `json:"StrategyMode" xml:"StrategyMode"`
+ AccessMode string `json:"AccessMode" xml:"AccessMode"`
+ AccessStatus string `json:"AccessStatus" xml:"AccessStatus"`
+ InstanceId string `json:"InstanceId" xml:"InstanceId"`
+ Lines LinesInDescribeGtmAccessStrategy `json:"Lines" xml:"Lines"`
+}
+
+// CreateDescribeGtmAccessStrategyRequest creates a request to invoke DescribeGtmAccessStrategy API
+func CreateDescribeGtmAccessStrategyRequest() (request *DescribeGtmAccessStrategyRequest) {
+ request = &DescribeGtmAccessStrategyRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmAccessStrategy", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmAccessStrategyResponse creates a response to parse from DescribeGtmAccessStrategy response
+func CreateDescribeGtmAccessStrategyResponse() (response *DescribeGtmAccessStrategyResponse) {
+ response = &DescribeGtmAccessStrategyResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy_available_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy_available_config.go
new file mode 100644
index 000000000..f25d27f8a
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_access_strategy_available_config.go
@@ -0,0 +1,107 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmAccessStrategyAvailableConfig invokes the alidns.DescribeGtmAccessStrategyAvailableConfig API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategyavailableconfig.html
+func (client *Client) DescribeGtmAccessStrategyAvailableConfig(request *DescribeGtmAccessStrategyAvailableConfigRequest) (response *DescribeGtmAccessStrategyAvailableConfigResponse, err error) {
+ response = CreateDescribeGtmAccessStrategyAvailableConfigResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmAccessStrategyAvailableConfigWithChan invokes the alidns.DescribeGtmAccessStrategyAvailableConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategyavailableconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategyAvailableConfigWithChan(request *DescribeGtmAccessStrategyAvailableConfigRequest) (<-chan *DescribeGtmAccessStrategyAvailableConfigResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmAccessStrategyAvailableConfigResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmAccessStrategyAvailableConfig(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmAccessStrategyAvailableConfigWithCallback invokes the alidns.DescribeGtmAccessStrategyAvailableConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmaccessstrategyavailableconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAccessStrategyAvailableConfigWithCallback(request *DescribeGtmAccessStrategyAvailableConfigRequest, callback func(response *DescribeGtmAccessStrategyAvailableConfigResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmAccessStrategyAvailableConfigResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmAccessStrategyAvailableConfig(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmAccessStrategyAvailableConfigRequest is the request struct for api DescribeGtmAccessStrategyAvailableConfig
+type DescribeGtmAccessStrategyAvailableConfigRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmAccessStrategyAvailableConfigResponse is the response struct for api DescribeGtmAccessStrategyAvailableConfig
+type DescribeGtmAccessStrategyAvailableConfigResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ AddrPools AddrPoolsInDescribeGtmAccessStrategyAvailableConfig `json:"AddrPools" xml:"AddrPools"`
+ Lines LinesInDescribeGtmAccessStrategyAvailableConfig `json:"Lines" xml:"Lines"`
+}
+
+// CreateDescribeGtmAccessStrategyAvailableConfigRequest creates a request to invoke DescribeGtmAccessStrategyAvailableConfig API
+func CreateDescribeGtmAccessStrategyAvailableConfigRequest() (request *DescribeGtmAccessStrategyAvailableConfigRequest) {
+ request = &DescribeGtmAccessStrategyAvailableConfigRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmAccessStrategyAvailableConfig", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmAccessStrategyAvailableConfigResponse creates a response to parse from DescribeGtmAccessStrategyAvailableConfig response
+func CreateDescribeGtmAccessStrategyAvailableConfigResponse() (response *DescribeGtmAccessStrategyAvailableConfigResponse) {
+ response = &DescribeGtmAccessStrategyAvailableConfigResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_available_alert_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_available_alert_group.go
new file mode 100644
index 000000000..b79265dd7
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_available_alert_group.go
@@ -0,0 +1,105 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmAvailableAlertGroup invokes the alidns.DescribeGtmAvailableAlertGroup API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmavailablealertgroup.html
+func (client *Client) DescribeGtmAvailableAlertGroup(request *DescribeGtmAvailableAlertGroupRequest) (response *DescribeGtmAvailableAlertGroupResponse, err error) {
+ response = CreateDescribeGtmAvailableAlertGroupResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmAvailableAlertGroupWithChan invokes the alidns.DescribeGtmAvailableAlertGroup API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmavailablealertgroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAvailableAlertGroupWithChan(request *DescribeGtmAvailableAlertGroupRequest) (<-chan *DescribeGtmAvailableAlertGroupResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmAvailableAlertGroupResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmAvailableAlertGroup(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmAvailableAlertGroupWithCallback invokes the alidns.DescribeGtmAvailableAlertGroup API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmavailablealertgroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmAvailableAlertGroupWithCallback(request *DescribeGtmAvailableAlertGroupRequest, callback func(response *DescribeGtmAvailableAlertGroupResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmAvailableAlertGroupResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmAvailableAlertGroup(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmAvailableAlertGroupRequest is the request struct for api DescribeGtmAvailableAlertGroup
+type DescribeGtmAvailableAlertGroupRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmAvailableAlertGroupResponse is the response struct for api DescribeGtmAvailableAlertGroup
+type DescribeGtmAvailableAlertGroupResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ AvailableAlertGroup string `json:"AvailableAlertGroup" xml:"AvailableAlertGroup"`
+}
+
+// CreateDescribeGtmAvailableAlertGroupRequest creates a request to invoke DescribeGtmAvailableAlertGroup API
+func CreateDescribeGtmAvailableAlertGroupRequest() (request *DescribeGtmAvailableAlertGroupRequest) {
+ request = &DescribeGtmAvailableAlertGroupRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmAvailableAlertGroup", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmAvailableAlertGroupResponse creates a response to parse from DescribeGtmAvailableAlertGroup response
+func CreateDescribeGtmAvailableAlertGroupResponse() (response *DescribeGtmAvailableAlertGroupResponse) {
+ response = &DescribeGtmAvailableAlertGroupResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance.go
new file mode 100644
index 000000000..faa7663ca
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance.go
@@ -0,0 +1,118 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstance invokes the alidns.DescribeGtmInstance API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstance.html
+func (client *Client) DescribeGtmInstance(request *DescribeGtmInstanceRequest) (response *DescribeGtmInstanceResponse, err error) {
+ response = CreateDescribeGtmInstanceResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstanceWithChan invokes the alidns.DescribeGtmInstance API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceWithChan(request *DescribeGtmInstanceRequest) (<-chan *DescribeGtmInstanceResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstanceResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstance(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstanceWithCallback invokes the alidns.DescribeGtmInstance API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstance.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceWithCallback(request *DescribeGtmInstanceRequest, callback func(response *DescribeGtmInstanceResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstanceResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstance(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstanceRequest is the request struct for api DescribeGtmInstance
+type DescribeGtmInstanceRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmInstanceResponse is the response struct for api DescribeGtmInstance
+type DescribeGtmInstanceResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ InstanceId string `json:"InstanceId" xml:"InstanceId"`
+ InstanceName string `json:"InstanceName" xml:"InstanceName"`
+ VersionCode string `json:"VersionCode" xml:"VersionCode"`
+ ExpireTime string `json:"ExpireTime" xml:"ExpireTime"`
+ ExpireTimestamp int64 `json:"ExpireTimestamp" xml:"ExpireTimestamp"`
+ Cname string `json:"Cname" xml:"Cname"`
+ UserDomainName string `json:"UserDomainName" xml:"UserDomainName"`
+ Ttl int `json:"Ttl" xml:"Ttl"`
+ LbaStrategy string `json:"LbaStrategy" xml:"LbaStrategy"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ AlertGroup string `json:"AlertGroup" xml:"AlertGroup"`
+ CnameMode string `json:"CnameMode" xml:"CnameMode"`
+}
+
+// CreateDescribeGtmInstanceRequest creates a request to invoke DescribeGtmInstance API
+func CreateDescribeGtmInstanceRequest() (request *DescribeGtmInstanceRequest) {
+ request = &DescribeGtmInstanceRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstance", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstanceResponse creates a response to parse from DescribeGtmInstance response
+func CreateDescribeGtmInstanceResponse() (response *DescribeGtmInstanceResponse) {
+ response = &DescribeGtmInstanceResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pool.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pool.go
new file mode 100644
index 000000000..fc518b6d8
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pool.go
@@ -0,0 +1,118 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstanceAddressPool invokes the alidns.DescribeGtmInstanceAddressPool API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspool.html
+func (client *Client) DescribeGtmInstanceAddressPool(request *DescribeGtmInstanceAddressPoolRequest) (response *DescribeGtmInstanceAddressPoolResponse, err error) {
+ response = CreateDescribeGtmInstanceAddressPoolResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstanceAddressPoolWithChan invokes the alidns.DescribeGtmInstanceAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceAddressPoolWithChan(request *DescribeGtmInstanceAddressPoolRequest) (<-chan *DescribeGtmInstanceAddressPoolResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstanceAddressPoolResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstanceAddressPool(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstanceAddressPoolWithCallback invokes the alidns.DescribeGtmInstanceAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceAddressPoolWithCallback(request *DescribeGtmInstanceAddressPoolRequest, callback func(response *DescribeGtmInstanceAddressPoolResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstanceAddressPoolResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstanceAddressPool(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstanceAddressPoolRequest is the request struct for api DescribeGtmInstanceAddressPool
+type DescribeGtmInstanceAddressPoolRequest struct {
+ *requests.RpcRequest
+ AddrPoolId string `position:"Query" name:"AddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmInstanceAddressPoolResponse is the response struct for api DescribeGtmInstanceAddressPool
+type DescribeGtmInstanceAddressPoolResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ AddrPoolId string `json:"AddrPoolId" xml:"AddrPoolId"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ UpdateTime string `json:"UpdateTime" xml:"UpdateTime"`
+ UpdateTimestamp int64 `json:"UpdateTimestamp" xml:"UpdateTimestamp"`
+ AddrCount int `json:"AddrCount" xml:"AddrCount"`
+ MinAvailableAddrNum int `json:"MinAvailableAddrNum" xml:"MinAvailableAddrNum"`
+ MonitorConfigId string `json:"MonitorConfigId" xml:"MonitorConfigId"`
+ MonitorStatus string `json:"MonitorStatus" xml:"MonitorStatus"`
+ Name string `json:"Name" xml:"Name"`
+ Status string `json:"Status" xml:"Status"`
+ Type string `json:"Type" xml:"Type"`
+ Addrs Addrs `json:"Addrs" xml:"Addrs"`
+}
+
+// CreateDescribeGtmInstanceAddressPoolRequest creates a request to invoke DescribeGtmInstanceAddressPool API
+func CreateDescribeGtmInstanceAddressPoolRequest() (request *DescribeGtmInstanceAddressPoolRequest) {
+ request = &DescribeGtmInstanceAddressPoolRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstanceAddressPool", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstanceAddressPoolResponse creates a response to parse from DescribeGtmInstanceAddressPool response
+func CreateDescribeGtmInstanceAddressPoolResponse() (response *DescribeGtmInstanceAddressPoolResponse) {
+ response = &DescribeGtmInstanceAddressPoolResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pools.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pools.go
new file mode 100644
index 000000000..0bc65ed8c
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_address_pools.go
@@ -0,0 +1,112 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstanceAddressPools invokes the alidns.DescribeGtmInstanceAddressPools API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspools.html
+func (client *Client) DescribeGtmInstanceAddressPools(request *DescribeGtmInstanceAddressPoolsRequest) (response *DescribeGtmInstanceAddressPoolsResponse, err error) {
+ response = CreateDescribeGtmInstanceAddressPoolsResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstanceAddressPoolsWithChan invokes the alidns.DescribeGtmInstanceAddressPools API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspools.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceAddressPoolsWithChan(request *DescribeGtmInstanceAddressPoolsRequest) (<-chan *DescribeGtmInstanceAddressPoolsResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstanceAddressPoolsResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstanceAddressPools(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstanceAddressPoolsWithCallback invokes the alidns.DescribeGtmInstanceAddressPools API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstanceaddresspools.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceAddressPoolsWithCallback(request *DescribeGtmInstanceAddressPoolsRequest, callback func(response *DescribeGtmInstanceAddressPoolsResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstanceAddressPoolsResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstanceAddressPools(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstanceAddressPoolsRequest is the request struct for api DescribeGtmInstanceAddressPools
+type DescribeGtmInstanceAddressPoolsRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+}
+
+// DescribeGtmInstanceAddressPoolsResponse is the response struct for api DescribeGtmInstanceAddressPools
+type DescribeGtmInstanceAddressPoolsResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ AddrPools AddrPoolsInDescribeGtmInstanceAddressPools `json:"AddrPools" xml:"AddrPools"`
+}
+
+// CreateDescribeGtmInstanceAddressPoolsRequest creates a request to invoke DescribeGtmInstanceAddressPools API
+func CreateDescribeGtmInstanceAddressPoolsRequest() (request *DescribeGtmInstanceAddressPoolsRequest) {
+ request = &DescribeGtmInstanceAddressPoolsRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstanceAddressPools", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstanceAddressPoolsResponse creates a response to parse from DescribeGtmInstanceAddressPools response
+func CreateDescribeGtmInstanceAddressPoolsResponse() (response *DescribeGtmInstanceAddressPoolsResponse) {
+ response = &DescribeGtmInstanceAddressPoolsResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_status.go
new file mode 100644
index 000000000..f65b578b5
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_status.go
@@ -0,0 +1,107 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstanceStatus invokes the alidns.DescribeGtmInstanceStatus API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancestatus.html
+func (client *Client) DescribeGtmInstanceStatus(request *DescribeGtmInstanceStatusRequest) (response *DescribeGtmInstanceStatusResponse, err error) {
+ response = CreateDescribeGtmInstanceStatusResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstanceStatusWithChan invokes the alidns.DescribeGtmInstanceStatus API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancestatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceStatusWithChan(request *DescribeGtmInstanceStatusRequest) (<-chan *DescribeGtmInstanceStatusResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstanceStatusResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstanceStatus(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstanceStatusWithCallback invokes the alidns.DescribeGtmInstanceStatus API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancestatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceStatusWithCallback(request *DescribeGtmInstanceStatusRequest, callback func(response *DescribeGtmInstanceStatusResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstanceStatusResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstanceStatus(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstanceStatusRequest is the request struct for api DescribeGtmInstanceStatus
+type DescribeGtmInstanceStatusRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmInstanceStatusResponse is the response struct for api DescribeGtmInstanceStatus
+type DescribeGtmInstanceStatusResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ AccessStatus string `json:"AccessStatus" xml:"AccessStatus"`
+ AlertStatus string `json:"AlertStatus" xml:"AlertStatus"`
+}
+
+// CreateDescribeGtmInstanceStatusRequest creates a request to invoke DescribeGtmInstanceStatus API
+func CreateDescribeGtmInstanceStatusRequest() (request *DescribeGtmInstanceStatusRequest) {
+ request = &DescribeGtmInstanceStatusRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstanceStatus", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstanceStatusResponse creates a response to parse from DescribeGtmInstanceStatus response
+func CreateDescribeGtmInstanceStatusResponse() (response *DescribeGtmInstanceStatusResponse) {
+ response = &DescribeGtmInstanceStatusResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_system_cname.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_system_cname.go
new file mode 100644
index 000000000..e94512809
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instance_system_cname.go
@@ -0,0 +1,106 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstanceSystemCname invokes the alidns.DescribeGtmInstanceSystemCname API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancesystemcname.html
+func (client *Client) DescribeGtmInstanceSystemCname(request *DescribeGtmInstanceSystemCnameRequest) (response *DescribeGtmInstanceSystemCnameResponse, err error) {
+ response = CreateDescribeGtmInstanceSystemCnameResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstanceSystemCnameWithChan invokes the alidns.DescribeGtmInstanceSystemCname API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancesystemcname.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceSystemCnameWithChan(request *DescribeGtmInstanceSystemCnameRequest) (<-chan *DescribeGtmInstanceSystemCnameResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstanceSystemCnameResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstanceSystemCname(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstanceSystemCnameWithCallback invokes the alidns.DescribeGtmInstanceSystemCname API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstancesystemcname.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstanceSystemCnameWithCallback(request *DescribeGtmInstanceSystemCnameRequest, callback func(response *DescribeGtmInstanceSystemCnameResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstanceSystemCnameResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstanceSystemCname(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstanceSystemCnameRequest is the request struct for api DescribeGtmInstanceSystemCname
+type DescribeGtmInstanceSystemCnameRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmInstanceSystemCnameResponse is the response struct for api DescribeGtmInstanceSystemCname
+type DescribeGtmInstanceSystemCnameResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ SystemCname string `json:"SystemCname" xml:"SystemCname"`
+}
+
+// CreateDescribeGtmInstanceSystemCnameRequest creates a request to invoke DescribeGtmInstanceSystemCname API
+func CreateDescribeGtmInstanceSystemCnameRequest() (request *DescribeGtmInstanceSystemCnameRequest) {
+ request = &DescribeGtmInstanceSystemCnameRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstanceSystemCname", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstanceSystemCnameResponse creates a response to parse from DescribeGtmInstanceSystemCname response
+func CreateDescribeGtmInstanceSystemCnameResponse() (response *DescribeGtmInstanceSystemCnameResponse) {
+ response = &DescribeGtmInstanceSystemCnameResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instances.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instances.go
new file mode 100644
index 000000000..8ac4c101d
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_instances.go
@@ -0,0 +1,113 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmInstances invokes the alidns.DescribeGtmInstances API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstances.html
+func (client *Client) DescribeGtmInstances(request *DescribeGtmInstancesRequest) (response *DescribeGtmInstancesResponse, err error) {
+ response = CreateDescribeGtmInstancesResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmInstancesWithChan invokes the alidns.DescribeGtmInstances API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstancesWithChan(request *DescribeGtmInstancesRequest) (<-chan *DescribeGtmInstancesResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmInstancesResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmInstances(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmInstancesWithCallback invokes the alidns.DescribeGtmInstances API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtminstances.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmInstancesWithCallback(request *DescribeGtmInstancesRequest, callback func(response *DescribeGtmInstancesResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmInstancesResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmInstances(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmInstancesRequest is the request struct for api DescribeGtmInstances
+type DescribeGtmInstancesRequest struct {
+ *requests.RpcRequest
+ ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ Keyword string `position:"Query" name:"Keyword"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+}
+
+// DescribeGtmInstancesResponse is the response struct for api DescribeGtmInstances
+type DescribeGtmInstancesResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ GtmInstances GtmInstances `json:"GtmInstances" xml:"GtmInstances"`
+}
+
+// CreateDescribeGtmInstancesRequest creates a request to invoke DescribeGtmInstances API
+func CreateDescribeGtmInstancesRequest() (request *DescribeGtmInstancesRequest) {
+ request = &DescribeGtmInstancesRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmInstances", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmInstancesResponse creates a response to parse from DescribeGtmInstances response
+func CreateDescribeGtmInstancesResponse() (response *DescribeGtmInstancesResponse) {
+ response = &DescribeGtmInstancesResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_logs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_logs.go
new file mode 100644
index 000000000..51452503d
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_logs.go
@@ -0,0 +1,115 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmLogs invokes the alidns.DescribeGtmLogs API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmlogs.html
+func (client *Client) DescribeGtmLogs(request *DescribeGtmLogsRequest) (response *DescribeGtmLogsResponse, err error) {
+ response = CreateDescribeGtmLogsResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmLogsWithChan invokes the alidns.DescribeGtmLogs API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmlogs.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmLogsWithChan(request *DescribeGtmLogsRequest) (<-chan *DescribeGtmLogsResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmLogsResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmLogs(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmLogsWithCallback invokes the alidns.DescribeGtmLogs API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmlogs.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmLogsWithCallback(request *DescribeGtmLogsRequest, callback func(response *DescribeGtmLogsResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmLogsResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmLogs(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmLogsRequest is the request struct for api DescribeGtmLogs
+type DescribeGtmLogsRequest struct {
+ *requests.RpcRequest
+ InstanceId string `position:"Query" name:"InstanceId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
+ Keyword string `position:"Query" name:"Keyword"`
+ StartTimestamp requests.Integer `position:"Query" name:"StartTimestamp"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+ EndTimestamp requests.Integer `position:"Query" name:"EndTimestamp"`
+}
+
+// DescribeGtmLogsResponse is the response struct for api DescribeGtmLogs
+type DescribeGtmLogsResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ Logs Logs `json:"Logs" xml:"Logs"`
+}
+
+// CreateDescribeGtmLogsRequest creates a request to invoke DescribeGtmLogs API
+func CreateDescribeGtmLogsRequest() (request *DescribeGtmLogsRequest) {
+ request = &DescribeGtmLogsRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmLogs", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmLogsResponse creates a response to parse from DescribeGtmLogs response
+func CreateDescribeGtmLogsResponse() (response *DescribeGtmLogsResponse) {
+ response = &DescribeGtmLogsResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_available_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_available_config.go
new file mode 100644
index 000000000..1e36ed259
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_available_config.go
@@ -0,0 +1,105 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmMonitorAvailableConfig invokes the alidns.DescribeGtmMonitorAvailableConfig API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitoravailableconfig.html
+func (client *Client) DescribeGtmMonitorAvailableConfig(request *DescribeGtmMonitorAvailableConfigRequest) (response *DescribeGtmMonitorAvailableConfigResponse, err error) {
+ response = CreateDescribeGtmMonitorAvailableConfigResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmMonitorAvailableConfigWithChan invokes the alidns.DescribeGtmMonitorAvailableConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitoravailableconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmMonitorAvailableConfigWithChan(request *DescribeGtmMonitorAvailableConfigRequest) (<-chan *DescribeGtmMonitorAvailableConfigResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmMonitorAvailableConfigResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmMonitorAvailableConfig(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmMonitorAvailableConfigWithCallback invokes the alidns.DescribeGtmMonitorAvailableConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitoravailableconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmMonitorAvailableConfigWithCallback(request *DescribeGtmMonitorAvailableConfigRequest, callback func(response *DescribeGtmMonitorAvailableConfigResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmMonitorAvailableConfigResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmMonitorAvailableConfig(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmMonitorAvailableConfigRequest is the request struct for api DescribeGtmMonitorAvailableConfig
+type DescribeGtmMonitorAvailableConfigRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmMonitorAvailableConfigResponse is the response struct for api DescribeGtmMonitorAvailableConfig
+type DescribeGtmMonitorAvailableConfigResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ IspCityNodes IspCityNodesInDescribeGtmMonitorAvailableConfig `json:"IspCityNodes" xml:"IspCityNodes"`
+}
+
+// CreateDescribeGtmMonitorAvailableConfigRequest creates a request to invoke DescribeGtmMonitorAvailableConfig API
+func CreateDescribeGtmMonitorAvailableConfigRequest() (request *DescribeGtmMonitorAvailableConfigRequest) {
+ request = &DescribeGtmMonitorAvailableConfigRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmMonitorAvailableConfig", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmMonitorAvailableConfigResponse creates a response to parse from DescribeGtmMonitorAvailableConfig response
+func CreateDescribeGtmMonitorAvailableConfigResponse() (response *DescribeGtmMonitorAvailableConfigResponse) {
+ response = &DescribeGtmMonitorAvailableConfigResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_config.go
new file mode 100644
index 000000000..0455ed8b9
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_gtm_monitor_config.go
@@ -0,0 +1,117 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeGtmMonitorConfig invokes the alidns.DescribeGtmMonitorConfig API synchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitorconfig.html
+func (client *Client) DescribeGtmMonitorConfig(request *DescribeGtmMonitorConfigRequest) (response *DescribeGtmMonitorConfigResponse, err error) {
+ response = CreateDescribeGtmMonitorConfigResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeGtmMonitorConfigWithChan invokes the alidns.DescribeGtmMonitorConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitorconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmMonitorConfigWithChan(request *DescribeGtmMonitorConfigRequest) (<-chan *DescribeGtmMonitorConfigResponse, <-chan error) {
+ responseChan := make(chan *DescribeGtmMonitorConfigResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeGtmMonitorConfig(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeGtmMonitorConfigWithCallback invokes the alidns.DescribeGtmMonitorConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describegtmmonitorconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeGtmMonitorConfigWithCallback(request *DescribeGtmMonitorConfigRequest, callback func(response *DescribeGtmMonitorConfigResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeGtmMonitorConfigResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeGtmMonitorConfig(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeGtmMonitorConfigRequest is the request struct for api DescribeGtmMonitorConfig
+type DescribeGtmMonitorConfigRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ MonitorConfigId string `position:"Query" name:"MonitorConfigId"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// DescribeGtmMonitorConfigResponse is the response struct for api DescribeGtmMonitorConfig
+type DescribeGtmMonitorConfigResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ MonitorConfigId string `json:"MonitorConfigId" xml:"MonitorConfigId"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ UpdateTime string `json:"UpdateTime" xml:"UpdateTime"`
+ UpdateTimestamp int64 `json:"UpdateTimestamp" xml:"UpdateTimestamp"`
+ Name string `json:"Name" xml:"Name"`
+ ProtocolType string `json:"ProtocolType" xml:"ProtocolType"`
+ Interval int `json:"Interval" xml:"Interval"`
+ EvaluationCount int `json:"EvaluationCount" xml:"EvaluationCount"`
+ Timeout int `json:"Timeout" xml:"Timeout"`
+ MonitorExtendInfo string `json:"MonitorExtendInfo" xml:"MonitorExtendInfo"`
+ IspCityNodes IspCityNodesInDescribeGtmMonitorConfig `json:"IspCityNodes" xml:"IspCityNodes"`
+}
+
+// CreateDescribeGtmMonitorConfigRequest creates a request to invoke DescribeGtmMonitorConfig API
+func CreateDescribeGtmMonitorConfigRequest() (request *DescribeGtmMonitorConfigRequest) {
+ request = &DescribeGtmMonitorConfigRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeGtmMonitorConfig", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeGtmMonitorConfigResponse creates a response to parse from DescribeGtmMonitorConfig response
+func CreateDescribeGtmMonitorConfigResponse() (response *DescribeGtmMonitorConfigResponse) {
+ response = &DescribeGtmMonitorConfigResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_logs.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_logs.go
index d9cd3e626..316715917 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_logs.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_logs.go
@@ -76,23 +76,23 @@ func (client *Client) DescribeRecordLogsWithCallback(request *DescribeRecordLogs
// DescribeRecordLogsRequest is the request struct for api DescribeRecordLogs
type DescribeRecordLogsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ EndDate string `position:"Query" name:"endDate"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
PageSize requests.Integer `position:"Query" name:"PageSize"`
+ Lang string `position:"Query" name:"Lang"`
KeyWord string `position:"Query" name:"KeyWord"`
StartDate string `position:"Query" name:"StartDate"`
- EndDate string `position:"Query" name:"endDate"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeRecordLogsResponse is the response struct for api DescribeRecordLogs
type DescribeRecordLogsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
RecordLogs RecordLogs `json:"RecordLogs" xml:"RecordLogs"`
}
@@ -101,7 +101,7 @@ func CreateDescribeRecordLogsRequest() (request *DescribeRecordLogsRequest) {
request = &DescribeRecordLogsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeRecordLogs", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeRecordLogs", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics.go
new file mode 100644
index 000000000..63173f006
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics.go
@@ -0,0 +1,109 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeRecordStatistics invokes the alidns.DescribeRecordStatistics API synchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatistics.html
+func (client *Client) DescribeRecordStatistics(request *DescribeRecordStatisticsRequest) (response *DescribeRecordStatisticsResponse, err error) {
+ response = CreateDescribeRecordStatisticsResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeRecordStatisticsWithChan invokes the alidns.DescribeRecordStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsWithChan(request *DescribeRecordStatisticsRequest) (<-chan *DescribeRecordStatisticsResponse, <-chan error) {
+ responseChan := make(chan *DescribeRecordStatisticsResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeRecordStatistics(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeRecordStatisticsWithCallback invokes the alidns.DescribeRecordStatistics API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatistics.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsWithCallback(request *DescribeRecordStatisticsRequest, callback func(response *DescribeRecordStatisticsResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeRecordStatisticsResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeRecordStatistics(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeRecordStatisticsRequest is the request struct for api DescribeRecordStatistics
+type DescribeRecordStatisticsRequest struct {
+ *requests.RpcRequest
+ Rr string `position:"Query" name:"Rr"`
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+}
+
+// DescribeRecordStatisticsResponse is the response struct for api DescribeRecordStatistics
+type DescribeRecordStatisticsResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Statistics StatisticsInDescribeRecordStatistics `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeRecordStatisticsRequest creates a request to invoke DescribeRecordStatistics API
+func CreateDescribeRecordStatisticsRequest() (request *DescribeRecordStatisticsRequest) {
+ request = &DescribeRecordStatisticsRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeRecordStatistics", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeRecordStatisticsResponse creates a response to parse from DescribeRecordStatistics response
+func CreateDescribeRecordStatisticsResponse() (response *DescribeRecordStatisticsResponse) {
+ response = &DescribeRecordStatisticsResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_history.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_history.go
new file mode 100644
index 000000000..505449326
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_history.go
@@ -0,0 +1,109 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeRecordStatisticsHistory invokes the alidns.DescribeRecordStatisticsHistory API synchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticshistory.html
+func (client *Client) DescribeRecordStatisticsHistory(request *DescribeRecordStatisticsHistoryRequest) (response *DescribeRecordStatisticsHistoryResponse, err error) {
+ response = CreateDescribeRecordStatisticsHistoryResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeRecordStatisticsHistoryWithChan invokes the alidns.DescribeRecordStatisticsHistory API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticshistory.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsHistoryWithChan(request *DescribeRecordStatisticsHistoryRequest) (<-chan *DescribeRecordStatisticsHistoryResponse, <-chan error) {
+ responseChan := make(chan *DescribeRecordStatisticsHistoryResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeRecordStatisticsHistory(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeRecordStatisticsHistoryWithCallback invokes the alidns.DescribeRecordStatisticsHistory API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticshistory.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsHistoryWithCallback(request *DescribeRecordStatisticsHistoryRequest, callback func(response *DescribeRecordStatisticsHistoryResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeRecordStatisticsHistoryResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeRecordStatisticsHistory(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeRecordStatisticsHistoryRequest is the request struct for api DescribeRecordStatisticsHistory
+type DescribeRecordStatisticsHistoryRequest struct {
+ *requests.RpcRequest
+ Rr string `position:"Query" name:"Rr"`
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+}
+
+// DescribeRecordStatisticsHistoryResponse is the response struct for api DescribeRecordStatisticsHistory
+type DescribeRecordStatisticsHistoryResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Statistics StatisticsInDescribeRecordStatisticsHistory `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeRecordStatisticsHistoryRequest creates a request to invoke DescribeRecordStatisticsHistory API
+func CreateDescribeRecordStatisticsHistoryRequest() (request *DescribeRecordStatisticsHistoryRequest) {
+ request = &DescribeRecordStatisticsHistoryRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeRecordStatisticsHistory", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeRecordStatisticsHistoryResponse creates a response to parse from DescribeRecordStatisticsHistory response
+func CreateDescribeRecordStatisticsHistoryResponse() (response *DescribeRecordStatisticsHistoryResponse) {
+ response = &DescribeRecordStatisticsHistoryResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_summary.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_summary.go
new file mode 100644
index 000000000..c7e814437
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_record_statistics_summary.go
@@ -0,0 +1,119 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// DescribeRecordStatisticsSummary invokes the alidns.DescribeRecordStatisticsSummary API synchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticssummary.html
+func (client *Client) DescribeRecordStatisticsSummary(request *DescribeRecordStatisticsSummaryRequest) (response *DescribeRecordStatisticsSummaryResponse, err error) {
+ response = CreateDescribeRecordStatisticsSummaryResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// DescribeRecordStatisticsSummaryWithChan invokes the alidns.DescribeRecordStatisticsSummary API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticssummary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsSummaryWithChan(request *DescribeRecordStatisticsSummaryRequest) (<-chan *DescribeRecordStatisticsSummaryResponse, <-chan error) {
+ responseChan := make(chan *DescribeRecordStatisticsSummaryResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.DescribeRecordStatisticsSummary(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// DescribeRecordStatisticsSummaryWithCallback invokes the alidns.DescribeRecordStatisticsSummary API asynchronously
+// api document: https://help.aliyun.com/api/alidns/describerecordstatisticssummary.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeRecordStatisticsSummaryWithCallback(request *DescribeRecordStatisticsSummaryRequest, callback func(response *DescribeRecordStatisticsSummaryResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *DescribeRecordStatisticsSummaryResponse
+ var err error
+ defer close(result)
+ response, err = client.DescribeRecordStatisticsSummary(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// DescribeRecordStatisticsSummaryRequest is the request struct for api DescribeRecordStatisticsSummary
+type DescribeRecordStatisticsSummaryRequest struct {
+ *requests.RpcRequest
+ EndDate string `position:"Query" name:"EndDate"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ PageSize requests.Integer `position:"Query" name:"PageSize"`
+ DomainName string `position:"Query" name:"DomainName"`
+ OrderBy string `position:"Query" name:"OrderBy"`
+ SearchMode string `position:"Query" name:"SearchMode"`
+ Threshold requests.Integer `position:"Query" name:"Threshold"`
+ Lang string `position:"Query" name:"Lang"`
+ StartDate string `position:"Query" name:"StartDate"`
+ Keyword string `position:"Query" name:"Keyword"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
+ Direction string `position:"Query" name:"Direction"`
+}
+
+// DescribeRecordStatisticsSummaryResponse is the response struct for api DescribeRecordStatisticsSummary
+type DescribeRecordStatisticsSummaryResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TotalItems int `json:"TotalItems" xml:"TotalItems"`
+ TotalPages int `json:"TotalPages" xml:"TotalPages"`
+ PageSize int `json:"PageSize" xml:"PageSize"`
+ PageNumber int `json:"PageNumber" xml:"PageNumber"`
+ Statistics StatisticsInDescribeRecordStatisticsSummary `json:"Statistics" xml:"Statistics"`
+}
+
+// CreateDescribeRecordStatisticsSummaryRequest creates a request to invoke DescribeRecordStatisticsSummary API
+func CreateDescribeRecordStatisticsSummaryRequest() (request *DescribeRecordStatisticsSummaryRequest) {
+ request = &DescribeRecordStatisticsSummaryRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeRecordStatisticsSummary", "Alidns", "openAPI")
+ return
+}
+
+// CreateDescribeRecordStatisticsSummaryResponse creates a response to parse from DescribeRecordStatisticsSummary response
+func CreateDescribeRecordStatisticsSummaryResponse() (response *DescribeRecordStatisticsSummaryResponse) {
+ response = &DescribeRecordStatisticsSummaryResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_sub_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_sub_domain_records.go
index 2b4ae7d94..4e342a46b 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_sub_domain_records.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_sub_domain_records.go
@@ -76,21 +76,22 @@ func (client *Client) DescribeSubDomainRecordsWithCallback(request *DescribeSubD
// DescribeSubDomainRecordsRequest is the request struct for api DescribeSubDomainRecords
type DescribeSubDomainRecordsRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
+ Line string `position:"Query" name:"Line"`
UserClientIp string `position:"Query" name:"UserClientIp"`
- SubDomain string `position:"Query" name:"SubDomain"`
- PageNumber requests.Integer `position:"Query" name:"PageNumber"`
PageSize requests.Integer `position:"Query" name:"PageSize"`
+ SubDomain string `position:"Query" name:"SubDomain"`
+ Lang string `position:"Query" name:"Lang"`
Type string `position:"Query" name:"Type"`
+ PageNumber requests.Integer `position:"Query" name:"PageNumber"`
}
// DescribeSubDomainRecordsResponse is the response struct for api DescribeSubDomainRecords
type DescribeSubDomainRecordsResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- PageNumber int `json:"PageNumber" xml:"PageNumber"`
- PageSize int `json:"PageSize" xml:"PageSize"`
+ TotalCount int64 `json:"TotalCount" xml:"TotalCount"`
+ PageNumber int64 `json:"PageNumber" xml:"PageNumber"`
+ PageSize int64 `json:"PageSize" xml:"PageSize"`
DomainRecords DomainRecordsInDescribeSubDomainRecords `json:"DomainRecords" xml:"DomainRecords"`
}
@@ -99,7 +100,7 @@ func CreateDescribeSubDomainRecordsRequest() (request *DescribeSubDomainRecordsR
request = &DescribeSubDomainRecordsRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeSubDomainRecords", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeSubDomainRecords", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_support_lines.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_support_lines.go
index 3738c3cb2..00b262151 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_support_lines.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/describe_support_lines.go
@@ -76,8 +76,9 @@ func (client *Client) DescribeSupportLinesWithCallback(request *DescribeSupportL
// DescribeSupportLinesRequest is the request struct for api DescribeSupportLines
type DescribeSupportLinesRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
}
// DescribeSupportLinesResponse is the response struct for api DescribeSupportLines
@@ -92,7 +93,7 @@ func CreateDescribeSupportLinesRequest() (request *DescribeSupportLinesRequest)
request = &DescribeSupportLinesRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeSupportLines", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "DescribeSupportLines", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/get_main_domain_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/get_main_domain_name.go
index e5199878c..e7ea6658a 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/get_main_domain_name.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/get_main_domain_name.go
@@ -76,9 +76,9 @@ func (client *Client) GetMainDomainNameWithCallback(request *GetMainDomainNameRe
// GetMainDomainNameRequest is the request struct for api GetMainDomainName
type GetMainDomainNameRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
InputString string `position:"Query" name:"InputString"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
}
// GetMainDomainNameResponse is the response struct for api GetMainDomainName
@@ -87,7 +87,7 @@ type GetMainDomainNameResponse struct {
RequestId string `json:"RequestId" xml:"RequestId"`
DomainName string `json:"DomainName" xml:"DomainName"`
RR string `json:"RR" xml:"RR"`
- DomainLevel int `json:"DomainLevel" xml:"DomainLevel"`
+ DomainLevel int64 `json:"DomainLevel" xml:"DomainLevel"`
}
// CreateGetMainDomainNameRequest creates a request to invoke GetMainDomainName API
@@ -95,7 +95,7 @@ func CreateGetMainDomainNameRequest() (request *GetMainDomainNameRequest) {
request = &GetMainDomainNameRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "GetMainDomainName", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "GetMainDomainName", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/modify_hichina_domain_dns.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/modify_hichina_domain_dns.go
index 3b452cdf7..1934d3ee1 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/modify_hichina_domain_dns.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/modify_hichina_domain_dns.go
@@ -76,9 +76,9 @@ func (client *Client) ModifyHichinaDomainDNSWithCallback(request *ModifyHichinaD
// ModifyHichinaDomainDNSRequest is the request struct for api ModifyHichinaDomainDNS
type ModifyHichinaDomainDNSRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
DomainName string `position:"Query" name:"DomainName"`
+ Lang string `position:"Query" name:"Lang"`
}
// ModifyHichinaDomainDNSResponse is the response struct for api ModifyHichinaDomainDNS
@@ -94,7 +94,7 @@ func CreateModifyHichinaDomainDNSRequest() (request *ModifyHichinaDomainDNSReque
request = &ModifyHichinaDomainDNSRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "ModifyHichinaDomainDNS", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "ModifyHichinaDomainDNS", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/operate_batch_domain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/operate_batch_domain.go
new file mode 100644
index 000000000..7a496fbc8
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/operate_batch_domain.go
@@ -0,0 +1,121 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// OperateBatchDomain invokes the alidns.OperateBatchDomain API synchronously
+// api document: https://help.aliyun.com/api/alidns/operatebatchdomain.html
+func (client *Client) OperateBatchDomain(request *OperateBatchDomainRequest) (response *OperateBatchDomainResponse, err error) {
+ response = CreateOperateBatchDomainResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// OperateBatchDomainWithChan invokes the alidns.OperateBatchDomain API asynchronously
+// api document: https://help.aliyun.com/api/alidns/operatebatchdomain.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) OperateBatchDomainWithChan(request *OperateBatchDomainRequest) (<-chan *OperateBatchDomainResponse, <-chan error) {
+ responseChan := make(chan *OperateBatchDomainResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.OperateBatchDomain(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// OperateBatchDomainWithCallback invokes the alidns.OperateBatchDomain API asynchronously
+// api document: https://help.aliyun.com/api/alidns/operatebatchdomain.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) OperateBatchDomainWithCallback(request *OperateBatchDomainRequest, callback func(response *OperateBatchDomainResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *OperateBatchDomainResponse
+ var err error
+ defer close(result)
+ response, err = client.OperateBatchDomain(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// OperateBatchDomainRequest is the request struct for api OperateBatchDomain
+type OperateBatchDomainRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ DomainRecordInfo *[]OperateBatchDomainDomainRecordInfo `position:"Query" name:"DomainRecordInfo" type:"Repeated"`
+ Lang string `position:"Query" name:"Lang"`
+ Type string `position:"Query" name:"Type"`
+}
+
+// OperateBatchDomainDomainRecordInfo is a repeated param struct in OperateBatchDomainRequest
+type OperateBatchDomainDomainRecordInfo struct {
+ Rr string `name:"Rr"`
+ NewType string `name:"NewType"`
+ NewValue string `name:"NewValue"`
+ Line string `name:"Line"`
+ Domain string `name:"Domain"`
+ Type string `name:"Type"`
+ Priority string `name:"Priority"`
+ Value string `name:"Value"`
+ Ttl string `name:"Ttl"`
+ NewRr string `name:"NewRr"`
+}
+
+// OperateBatchDomainResponse is the response struct for api OperateBatchDomain
+type OperateBatchDomainResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ TaskId int64 `json:"TaskId" xml:"TaskId"`
+}
+
+// CreateOperateBatchDomainRequest creates a request to invoke OperateBatchDomain API
+func CreateOperateBatchDomainRequest() (request *OperateBatchDomainRequest) {
+ request = &OperateBatchDomainRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "OperateBatchDomain", "Alidns", "openAPI")
+ return
+}
+
+// CreateOperateBatchDomainResponse creates a response to parse from OperateBatchDomain response
+func CreateOperateBatchDomainResponse() (response *OperateBatchDomainResponse) {
+ response = &OperateBatchDomainResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/query_create_instance_price.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/query_create_instance_price.go
new file mode 100644
index 000000000..c96be9074
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/query_create_instance_price.go
@@ -0,0 +1,112 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// QueryCreateInstancePrice invokes the alidns.QueryCreateInstancePrice API synchronously
+// api document: https://help.aliyun.com/api/alidns/querycreateinstanceprice.html
+func (client *Client) QueryCreateInstancePrice(request *QueryCreateInstancePriceRequest) (response *QueryCreateInstancePriceResponse, err error) {
+ response = CreateQueryCreateInstancePriceResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// QueryCreateInstancePriceWithChan invokes the alidns.QueryCreateInstancePrice API asynchronously
+// api document: https://help.aliyun.com/api/alidns/querycreateinstanceprice.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryCreateInstancePriceWithChan(request *QueryCreateInstancePriceRequest) (<-chan *QueryCreateInstancePriceResponse, <-chan error) {
+ responseChan := make(chan *QueryCreateInstancePriceResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.QueryCreateInstancePrice(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// QueryCreateInstancePriceWithCallback invokes the alidns.QueryCreateInstancePrice API asynchronously
+// api document: https://help.aliyun.com/api/alidns/querycreateinstanceprice.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryCreateInstancePriceWithCallback(request *QueryCreateInstancePriceRequest, callback func(response *QueryCreateInstancePriceResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *QueryCreateInstancePriceResponse
+ var err error
+ defer close(result)
+ response, err = client.QueryCreateInstancePrice(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// QueryCreateInstancePriceRequest is the request struct for api QueryCreateInstancePrice
+type QueryCreateInstancePriceRequest struct {
+ *requests.RpcRequest
+ Month requests.Integer `position:"Query" name:"Month"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
+ InstanceVersion string `position:"Query" name:"InstanceVersion"`
+ OwnerId requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// QueryCreateInstancePriceResponse is the response struct for api QueryCreateInstancePrice
+type QueryCreateInstancePriceResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+ Origin string `json:"Origin" xml:"Origin"`
+ Discount string `json:"Discount" xml:"Discount"`
+ Amount string `json:"Amount" xml:"Amount"`
+ Currency string `json:"Currency" xml:"Currency"`
+ Rules Rules `json:"Rules" xml:"Rules"`
+}
+
+// CreateQueryCreateInstancePriceRequest creates a request to invoke QueryCreateInstancePrice API
+func CreateQueryCreateInstancePriceRequest() (request *QueryCreateInstancePriceRequest) {
+ request = &QueryCreateInstancePriceRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "QueryCreateInstancePrice", "Alidns", "openAPI")
+ return
+}
+
+// CreateQueryCreateInstancePriceResponse creates a response to parse from QueryCreateInstancePrice response
+func CreateQueryCreateInstancePriceResponse() (response *QueryCreateInstancePriceResponse) {
+ response = &QueryCreateInstancePriceResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/retrieval_domain_name.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/retrieval_domain_name.go
deleted file mode 100644
index 753b85df5..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/retrieval_domain_name.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// RetrievalDomainName invokes the alidns.RetrievalDomainName API synchronously
-// api document: https://help.aliyun.com/api/alidns/retrievaldomainname.html
-func (client *Client) RetrievalDomainName(request *RetrievalDomainNameRequest) (response *RetrievalDomainNameResponse, err error) {
- response = CreateRetrievalDomainNameResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// RetrievalDomainNameWithChan invokes the alidns.RetrievalDomainName API asynchronously
-// api document: https://help.aliyun.com/api/alidns/retrievaldomainname.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) RetrievalDomainNameWithChan(request *RetrievalDomainNameRequest) (<-chan *RetrievalDomainNameResponse, <-chan error) {
- responseChan := make(chan *RetrievalDomainNameResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.RetrievalDomainName(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// RetrievalDomainNameWithCallback invokes the alidns.RetrievalDomainName API asynchronously
-// api document: https://help.aliyun.com/api/alidns/retrievaldomainname.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) RetrievalDomainNameWithCallback(request *RetrievalDomainNameRequest, callback func(response *RetrievalDomainNameResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *RetrievalDomainNameResponse
- var err error
- defer close(result)
- response, err = client.RetrievalDomainName(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// RetrievalDomainNameRequest is the request struct for api RetrievalDomainName
-type RetrievalDomainNameRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- DomainName string `position:"Query" name:"DomainName"`
-}
-
-// RetrievalDomainNameResponse is the response struct for api RetrievalDomainName
-type RetrievalDomainNameResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- DomainName string `json:"DomainName" xml:"DomainName"`
- WhoisEmail string `json:"WhoisEmail" xml:"WhoisEmail"`
-}
-
-// CreateRetrievalDomainNameRequest creates a request to invoke RetrievalDomainName API
-func CreateRetrievalDomainNameRequest() (request *RetrievalDomainNameRequest) {
- request = &RetrievalDomainNameRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "RetrievalDomainName", "", "")
- return
-}
-
-// CreateRetrievalDomainNameResponse creates a response to parse from RetrievalDomainName response
-func CreateRetrievalDomainNameResponse() (response *RetrievalDomainNameResponse) {
- response = &RetrievalDomainNameResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_dnsslb_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_dnsslb_status.go
index 858d6fe67..ea212bbc1 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_dnsslb_status.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_dnsslb_status.go
@@ -76,9 +76,9 @@ func (client *Client) SetDNSSLBStatusWithCallback(request *SetDNSSLBStatusReques
// SetDNSSLBStatusRequest is the request struct for api SetDNSSLBStatus
type SetDNSSLBStatusRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
UserClientIp string `position:"Query" name:"UserClientIp"`
SubDomain string `position:"Query" name:"SubDomain"`
+ Lang string `position:"Query" name:"Lang"`
Open requests.Boolean `position:"Query" name:"Open"`
}
@@ -86,7 +86,7 @@ type SetDNSSLBStatusRequest struct {
type SetDNSSLBStatusResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
- RecordCount int `json:"RecordCount" xml:"RecordCount"`
+ RecordCount int64 `json:"RecordCount" xml:"RecordCount"`
Open bool `json:"Open" xml:"Open"`
}
@@ -95,7 +95,7 @@ func CreateSetDNSSLBStatusRequest() (request *SetDNSSLBStatusRequest) {
request = &SetDNSSLBStatusRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "SetDNSSLBStatus", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "SetDNSSLBStatus", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_domain_record_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_domain_record_status.go
index 29ba5f727..1dd08dd16 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_domain_record_status.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_domain_record_status.go
@@ -76,9 +76,9 @@ func (client *Client) SetDomainRecordStatusWithCallback(request *SetDomainRecord
// SetDomainRecordStatusRequest is the request struct for api SetDomainRecordStatus
type SetDomainRecordStatusRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
RecordId string `position:"Query" name:"RecordId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
Status string `position:"Query" name:"Status"`
}
@@ -95,7 +95,7 @@ func CreateSetDomainRecordStatusRequest() (request *SetDomainRecordStatusRequest
request = &SetDomainRecordStatusRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "SetDomainRecordStatus", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "SetDomainRecordStatus", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_access_mode.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_access_mode.go
new file mode 100644
index 000000000..f318455a1
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_access_mode.go
@@ -0,0 +1,106 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// SetGtmAccessMode invokes the alidns.SetGtmAccessMode API synchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmaccessmode.html
+func (client *Client) SetGtmAccessMode(request *SetGtmAccessModeRequest) (response *SetGtmAccessModeResponse, err error) {
+ response = CreateSetGtmAccessModeResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// SetGtmAccessModeWithChan invokes the alidns.SetGtmAccessMode API asynchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmaccessmode.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SetGtmAccessModeWithChan(request *SetGtmAccessModeRequest) (<-chan *SetGtmAccessModeResponse, <-chan error) {
+ responseChan := make(chan *SetGtmAccessModeResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.SetGtmAccessMode(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// SetGtmAccessModeWithCallback invokes the alidns.SetGtmAccessMode API asynchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmaccessmode.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SetGtmAccessModeWithCallback(request *SetGtmAccessModeRequest, callback func(response *SetGtmAccessModeResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *SetGtmAccessModeResponse
+ var err error
+ defer close(result)
+ response, err = client.SetGtmAccessMode(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// SetGtmAccessModeRequest is the request struct for api SetGtmAccessMode
+type SetGtmAccessModeRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ StrategyId string `position:"Query" name:"StrategyId"`
+ Lang string `position:"Query" name:"Lang"`
+ AccessMode string `position:"Query" name:"AccessMode"`
+}
+
+// SetGtmAccessModeResponse is the response struct for api SetGtmAccessMode
+type SetGtmAccessModeResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateSetGtmAccessModeRequest creates a request to invoke SetGtmAccessMode API
+func CreateSetGtmAccessModeRequest() (request *SetGtmAccessModeRequest) {
+ request = &SetGtmAccessModeRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "SetGtmAccessMode", "Alidns", "openAPI")
+ return
+}
+
+// CreateSetGtmAccessModeResponse creates a response to parse from SetGtmAccessMode response
+func CreateSetGtmAccessModeResponse() (response *SetGtmAccessModeResponse) {
+ response = &SetGtmAccessModeResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_monitor_status.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_monitor_status.go
new file mode 100644
index 000000000..15a86ba70
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/set_gtm_monitor_status.go
@@ -0,0 +1,106 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// SetGtmMonitorStatus invokes the alidns.SetGtmMonitorStatus API synchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmmonitorstatus.html
+func (client *Client) SetGtmMonitorStatus(request *SetGtmMonitorStatusRequest) (response *SetGtmMonitorStatusResponse, err error) {
+ response = CreateSetGtmMonitorStatusResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// SetGtmMonitorStatusWithChan invokes the alidns.SetGtmMonitorStatus API asynchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmmonitorstatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SetGtmMonitorStatusWithChan(request *SetGtmMonitorStatusRequest) (<-chan *SetGtmMonitorStatusResponse, <-chan error) {
+ responseChan := make(chan *SetGtmMonitorStatusResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.SetGtmMonitorStatus(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// SetGtmMonitorStatusWithCallback invokes the alidns.SetGtmMonitorStatus API asynchronously
+// api document: https://help.aliyun.com/api/alidns/setgtmmonitorstatus.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) SetGtmMonitorStatusWithCallback(request *SetGtmMonitorStatusRequest, callback func(response *SetGtmMonitorStatusResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *SetGtmMonitorStatusResponse
+ var err error
+ defer close(result)
+ response, err = client.SetGtmMonitorStatus(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// SetGtmMonitorStatusRequest is the request struct for api SetGtmMonitorStatus
+type SetGtmMonitorStatusRequest struct {
+ *requests.RpcRequest
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ MonitorConfigId string `position:"Query" name:"MonitorConfigId"`
+ Lang string `position:"Query" name:"Lang"`
+ Status string `position:"Query" name:"Status"`
+}
+
+// SetGtmMonitorStatusResponse is the response struct for api SetGtmMonitorStatus
+type SetGtmMonitorStatusResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateSetGtmMonitorStatusRequest creates a request to invoke SetGtmMonitorStatus API
+func CreateSetGtmMonitorStatusRequest() (request *SetGtmMonitorStatusRequest) {
+ request = &SetGtmMonitorStatusRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "SetGtmMonitorStatus", "Alidns", "openAPI")
+ return
+}
+
+// CreateSetGtmMonitorStatusResponse creates a response to parse from SetGtmMonitorStatus response
+func CreateSetGtmMonitorStatusResponse() (response *SetGtmMonitorStatusResponse) {
+ response = &SetGtmMonitorStatusResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr.go
new file mode 100644
index 000000000..649662bba
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr.go
@@ -0,0 +1,29 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Addr is a nested struct in alidns response
+type Addr struct {
+ AddrId int64 `json:"AddrId" xml:"AddrId"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ UpdateTime string `json:"UpdateTime" xml:"UpdateTime"`
+ UpdateTimestamp int64 `json:"UpdateTimestamp" xml:"UpdateTimestamp"`
+ Value string `json:"Value" xml:"Value"`
+ LbaWeight int `json:"LbaWeight" xml:"LbaWeight"`
+ Mode string `json:"Mode" xml:"Mode"`
+ AlertStatus string `json:"AlertStatus" xml:"AlertStatus"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pool.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pool.go
new file mode 100644
index 000000000..185c79ff1
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pool.go
@@ -0,0 +1,33 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// AddrPool is a nested struct in alidns response
+type AddrPool struct {
+ AddrCount int `json:"AddrCount" xml:"AddrCount"`
+ Name string `json:"Name" xml:"Name"`
+ MinAvailableAddrNum int `json:"MinAvailableAddrNum" xml:"MinAvailableAddrNum"`
+ UpdateTime string `json:"UpdateTime" xml:"UpdateTime"`
+ MonitorConfigId string `json:"MonitorConfigId" xml:"MonitorConfigId"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ AddrPoolName string `json:"AddrPoolName" xml:"AddrPoolName"`
+ AddrPoolId string `json:"AddrPoolId" xml:"AddrPoolId"`
+ UpdateTimestamp int64 `json:"UpdateTimestamp" xml:"UpdateTimestamp"`
+ Status string `json:"Status" xml:"Status"`
+ MonitorStatus string `json:"MonitorStatus" xml:"MonitorStatus"`
+ Type string `json:"Type" xml:"Type"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_access_strategy_available_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_access_strategy_available_config.go
new file mode 100644
index 000000000..dddb2fe6e
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_access_strategy_available_config.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// AddrPoolsInDescribeGtmAccessStrategyAvailableConfig is a nested struct in alidns response
+type AddrPoolsInDescribeGtmAccessStrategyAvailableConfig struct {
+ AddrPool []AddrPool `json:"AddrPool" xml:"AddrPool"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_instance_address_pools.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_instance_address_pools.go
new file mode 100644
index 000000000..2d340d818
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addr_pools_in_describe_gtm_instance_address_pools.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// AddrPoolsInDescribeGtmInstanceAddressPools is a nested struct in alidns response
+type AddrPoolsInDescribeGtmInstanceAddressPools struct {
+ AddrPool []AddrPool `json:"AddrPool" xml:"AddrPool"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_status_list.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addrs.go
similarity index 85%
rename from vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_status_list.go
rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addrs.go
index 341e43d03..66bf0836e 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_status_list.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_addrs.go
@@ -15,7 +15,7 @@ package alidns
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// StatusList is a nested struct in alidns response
-type StatusList struct {
- Status []string `json:"Status" xml:"Status"`
+// Addrs is a nested struct in alidns response
+type Addrs struct {
+ Addr []Addr `json:"Addr" xml:"Addr"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_detail.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_detail.go
new file mode 100644
index 000000000..fdad37292
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_detail.go
@@ -0,0 +1,36 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// BatchResultDetail is a nested struct in alidns response
+type BatchResultDetail struct {
+ Domain string `json:"Domain" xml:"Domain"`
+ Type string `json:"Type" xml:"Type"`
+ Rr string `json:"Rr" xml:"Rr"`
+ Value string `json:"Value" xml:"Value"`
+ Status bool `json:"Status" xml:"Status"`
+ Reason string `json:"Reason" xml:"Reason"`
+ NewRr string `json:"NewRr" xml:"NewRr"`
+ NewValue string `json:"NewValue" xml:"NewValue"`
+ BatchType string `json:"BatchType" xml:"BatchType"`
+ OperateDateStr string `json:"OperateDateStr" xml:"OperateDateStr"`
+ Line string `json:"Line" xml:"Line"`
+ Priority string `json:"Priority" xml:"Priority"`
+ Ttl string `json:"Ttl" xml:"Ttl"`
+ RecordId string `json:"RecordId" xml:"RecordId"`
+ Remark string `json:"Remark" xml:"Remark"`
+ RrStatus string `json:"RrStatus" xml:"RrStatus"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_result.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_details.go
similarity index 79%
rename from vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_result.go
rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_details.go
index 0fc2d3051..b2655d454 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_result.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_batch_result_details.go
@@ -15,8 +15,7 @@ package alidns
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// FailResult is a nested struct in alidns response
-type FailResult struct {
- BatchIndex string `json:"BatchIndex" xml:"BatchIndex"`
- ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
+// BatchResultDetails is a nested struct in alidns response
+type BatchResultDetails struct {
+ BatchResultDetail []BatchResultDetail `json:"BatchResultDetail" xml:"BatchResultDetail"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_product.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_product.go
index 50a2e8678..2f5390f0c 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_product.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_product.go
@@ -22,27 +22,30 @@ type DnsProduct struct {
VersionName string `json:"VersionName" xml:"VersionName"`
StartTime string `json:"StartTime" xml:"StartTime"`
EndTime string `json:"EndTime" xml:"EndTime"`
- StartTimestamp int `json:"StartTimestamp" xml:"StartTimestamp"`
- EndTimestamp int `json:"EndTimestamp" xml:"EndTimestamp"`
+ StartTimestamp int64 `json:"StartTimestamp" xml:"StartTimestamp"`
+ EndTimestamp int64 `json:"EndTimestamp" xml:"EndTimestamp"`
Domain string `json:"Domain" xml:"Domain"`
- BindCount int `json:"BindCount" xml:"BindCount"`
- BindUsedCount int `json:"BindUsedCount" xml:"BindUsedCount"`
- TTLMinValue int `json:"TTLMinValue" xml:"TTLMinValue"`
- SubDomainLevel int `json:"SubDomainLevel" xml:"SubDomainLevel"`
- DnsSLBCount int `json:"DnsSLBCount" xml:"DnsSLBCount"`
- URLForwardCount int `json:"URLForwardCount" xml:"URLForwardCount"`
- DDosDefendFlow int `json:"DDosDefendFlow" xml:"DDosDefendFlow"`
- DDosDefendQuery int `json:"DDosDefendQuery" xml:"DDosDefendQuery"`
- OverseaDDosDefendFlow int `json:"OverseaDDosDefendFlow" xml:"OverseaDDosDefendFlow"`
+ BindCount int64 `json:"BindCount" xml:"BindCount"`
+ BindUsedCount int64 `json:"BindUsedCount" xml:"BindUsedCount"`
+ TTLMinValue int64 `json:"TTLMinValue" xml:"TTLMinValue"`
+ SubDomainLevel int64 `json:"SubDomainLevel" xml:"SubDomainLevel"`
+ DnsSLBCount int64 `json:"DnsSLBCount" xml:"DnsSLBCount"`
+ URLForwardCount int64 `json:"URLForwardCount" xml:"URLForwardCount"`
+ DDosDefendFlow int64 `json:"DDosDefendFlow" xml:"DDosDefendFlow"`
+ DDosDefendQuery int64 `json:"DDosDefendQuery" xml:"DDosDefendQuery"`
+ OverseaDDosDefendFlow int64 `json:"OverseaDDosDefendFlow" xml:"OverseaDDosDefendFlow"`
SearchEngineLines string `json:"SearchEngineLines" xml:"SearchEngineLines"`
ISPLines string `json:"ISPLines" xml:"ISPLines"`
ISPRegionLines string `json:"ISPRegionLines" xml:"ISPRegionLines"`
OverseaLine string `json:"OverseaLine" xml:"OverseaLine"`
- MonitorNodeCount int `json:"MonitorNodeCount" xml:"MonitorNodeCount"`
- MonitorFrequency int `json:"MonitorFrequency" xml:"MonitorFrequency"`
- MonitorTaskCount int `json:"MonitorTaskCount" xml:"MonitorTaskCount"`
+ MonitorNodeCount int64 `json:"MonitorNodeCount" xml:"MonitorNodeCount"`
+ MonitorFrequency int64 `json:"MonitorFrequency" xml:"MonitorFrequency"`
+ MonitorTaskCount int64 `json:"MonitorTaskCount" xml:"MonitorTaskCount"`
RegionLines bool `json:"RegionLines" xml:"RegionLines"`
Gslb bool `json:"Gslb" xml:"Gslb"`
InClean bool `json:"InClean" xml:"InClean"`
InBlackHole bool `json:"InBlackHole" xml:"InBlackHole"`
+ BindDomainCount int64 `json:"BindDomainCount" xml:"BindDomainCount"`
+ BindDomainUsedCount int64 `json:"BindDomainUsedCount" xml:"BindDomainUsedCount"`
+ DnsSecurity string `json:"DnsSecurity" xml:"DnsSecurity"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain.go
index 0dd46e6f3..5068d39fa 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain.go
@@ -21,7 +21,7 @@ type Domain struct {
DomainName string `json:"DomainName" xml:"DomainName"`
PunyCode string `json:"PunyCode" xml:"PunyCode"`
AliDomain bool `json:"AliDomain" xml:"AliDomain"`
- RecordCount int `json:"RecordCount" xml:"RecordCount"`
+ RecordCount int64 `json:"RecordCount" xml:"RecordCount"`
RegistrantEmail string `json:"RegistrantEmail" xml:"RegistrantEmail"`
Remark string `json:"Remark" xml:"Remark"`
GroupId string `json:"GroupId" xml:"GroupId"`
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_group.go
index 89646e8a2..f0e644aba 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_group.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_group.go
@@ -19,5 +19,5 @@ package alidns
type DomainGroup struct {
GroupId string `json:"GroupId" xml:"GroupId"`
GroupName string `json:"GroupName" xml:"GroupName"`
- DomainCount int `json:"DomainCount" xml:"DomainCount"`
+ DomainCount int64 `json:"DomainCount" xml:"DomainCount"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_log.go
index 40128f6b9..f0bc25354 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_log.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_domain_log.go
@@ -18,9 +18,10 @@ package alidns
// DomainLog is a nested struct in alidns response
type DomainLog struct {
ActionTime string `json:"ActionTime" xml:"ActionTime"`
- ActionTimestamp int `json:"ActionTimestamp" xml:"ActionTimestamp"`
+ ActionTimestamp int64 `json:"ActionTimestamp" xml:"ActionTimestamp"`
DomainName string `json:"DomainName" xml:"DomainName"`
Action string `json:"Action" xml:"Action"`
Message string `json:"Message" xml:"Message"`
ClientIp string `json:"ClientIp" xml:"ClientIp"`
+ ZoneId string `json:"ZoneId" xml:"ZoneId"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instance.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instance.go
new file mode 100644
index 000000000..8ba998c10
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instance.go
@@ -0,0 +1,33 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// GtmInstance is a nested struct in alidns response
+type GtmInstance struct {
+ InstanceId string `json:"InstanceId" xml:"InstanceId"`
+ InstanceName string `json:"InstanceName" xml:"InstanceName"`
+ Cname string `json:"Cname" xml:"Cname"`
+ UserDomainName string `json:"UserDomainName" xml:"UserDomainName"`
+ VersionCode string `json:"VersionCode" xml:"VersionCode"`
+ Ttl int `json:"Ttl" xml:"Ttl"`
+ LbaStrategy string `json:"LbaStrategy" xml:"LbaStrategy"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ ExpireTime string `json:"ExpireTime" xml:"ExpireTime"`
+ ExpireTimestamp int64 `json:"ExpireTimestamp" xml:"ExpireTimestamp"`
+ AlertGroup string `json:"AlertGroup" xml:"AlertGroup"`
+ CnameMode string `json:"CnameMode" xml:"CnameMode"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_servers_in_describe_domain_whois_info.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instances.go
similarity index 79%
rename from vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_servers_in_describe_domain_whois_info.go
rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instances.go
index fc03ed41a..0609ce251 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_dns_servers_in_describe_domain_whois_info.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_gtm_instances.go
@@ -15,7 +15,7 @@ package alidns
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// DnsServersInDescribeDomainWhoisInfo is a nested struct in alidns response
-type DnsServersInDescribeDomainWhoisInfo struct {
- DnsServer []string `json:"DnsServer" xml:"DnsServer"`
+// GtmInstances is a nested struct in alidns response
+type GtmInstances struct {
+ GtmInstance []GtmInstance `json:"GtmInstance" xml:"GtmInstance"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_node.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_node.go
new file mode 100644
index 000000000..5549e2d96
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_node.go
@@ -0,0 +1,28 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// IspCityNode is a nested struct in alidns response
+type IspCityNode struct {
+ CityCode string `json:"CityCode" xml:"CityCode"`
+ DefaultSelected bool `json:"DefaultSelected" xml:"DefaultSelected"`
+ IspName string `json:"IspName" xml:"IspName"`
+ CountryName string `json:"CountryName" xml:"CountryName"`
+ CityName string `json:"CityName" xml:"CityName"`
+ Mainland bool `json:"Mainland" xml:"Mainland"`
+ CountryCode string `json:"CountryCode" xml:"CountryCode"`
+ IspCode string `json:"IspCode" xml:"IspCode"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_available_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_available_config.go
new file mode 100644
index 000000000..82c86e997
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_available_config.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// IspCityNodesInDescribeGtmMonitorAvailableConfig is a nested struct in alidns response
+type IspCityNodesInDescribeGtmMonitorAvailableConfig struct {
+ IspCityNode []IspCityNode `json:"IspCityNode" xml:"IspCityNode"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_config.go
new file mode 100644
index 000000000..7f531d449
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_isp_city_nodes_in_describe_gtm_monitor_config.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// IspCityNodesInDescribeGtmMonitorConfig is a nested struct in alidns response
+type IspCityNodesInDescribeGtmMonitorConfig struct {
+ IspCityNode []IspCityNode `json:"IspCityNode" xml:"IspCityNode"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_line.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_line.go
new file mode 100644
index 000000000..76487a7d2
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_line.go
@@ -0,0 +1,25 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Line is a nested struct in alidns response
+type Line struct {
+ GroupCode string `json:"GroupCode" xml:"GroupCode"`
+ LineCode string `json:"LineCode" xml:"LineCode"`
+ LineName string `json:"LineName" xml:"LineName"`
+ GroupName string `json:"GroupName" xml:"GroupName"`
+ Status string `json:"Status" xml:"Status"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategies.go
new file mode 100644
index 000000000..75defbd04
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategies.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// LinesInDescribeGtmAccessStrategies is a nested struct in alidns response
+type LinesInDescribeGtmAccessStrategies struct {
+ Line []Line `json:"Line" xml:"Line"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy.go
new file mode 100644
index 000000000..86d10f668
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// LinesInDescribeGtmAccessStrategy is a nested struct in alidns response
+type LinesInDescribeGtmAccessStrategy struct {
+ Line []Line `json:"Line" xml:"Line"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy_available_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy_available_config.go
new file mode 100644
index 000000000..7289ff376
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_lines_in_describe_gtm_access_strategy_available_config.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// LinesInDescribeGtmAccessStrategyAvailableConfig is a nested struct in alidns response
+type LinesInDescribeGtmAccessStrategyAvailableConfig struct {
+ Line []Line `json:"Line" xml:"Line"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_log.go
new file mode 100644
index 000000000..489378f47
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_log.go
@@ -0,0 +1,29 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Log is a nested struct in alidns response
+type Log struct {
+ OperTime string `json:"OperTime" xml:"OperTime"`
+ OperAction string `json:"OperAction" xml:"OperAction"`
+ EntityType string `json:"EntityType" xml:"EntityType"`
+ EntityId string `json:"EntityId" xml:"EntityId"`
+ EntityName string `json:"EntityName" xml:"EntityName"`
+ OperIp string `json:"OperIp" xml:"OperIp"`
+ OperTimestamp int64 `json:"OperTimestamp" xml:"OperTimestamp"`
+ Id int64 `json:"Id" xml:"Id"`
+ Content string `json:"Content" xml:"Content"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_results.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_logs.go
similarity index 83%
rename from vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_results.go
rename to vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_logs.go
index 54ee4d18d..9ae457176 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_fail_results.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_logs.go
@@ -15,7 +15,7 @@ package alidns
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-// FailResults is a nested struct in alidns response
-type FailResults struct {
- FailResult []FailResult `json:"FailResult" xml:"FailResult"`
+// Logs is a nested struct in alidns response
+type Logs struct {
+ Log []Log `json:"Log" xml:"Log"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record.go
index b4f0f1913..59df2f74b 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record.go
@@ -17,16 +17,16 @@ package alidns
// Record is a nested struct in alidns response
type Record struct {
- Locked bool `json:"Locked" xml:"Locked"`
- Type string `json:"Type" xml:"Type"`
- Line string `json:"Line" xml:"Line"`
- RR string `json:"RR" xml:"RR"`
- Remark string `json:"Remark" xml:"Remark"`
- Priority int `json:"Priority" xml:"Priority"`
- RecordId string `json:"RecordId" xml:"RecordId"`
Value string `json:"Value" xml:"Value"`
+ TTL int64 `json:"TTL" xml:"TTL"`
+ Remark string `json:"Remark" xml:"Remark"`
DomainName string `json:"DomainName" xml:"DomainName"`
- Weight int `json:"Weight" xml:"Weight"`
+ RR string `json:"RR" xml:"RR"`
+ Priority int64 `json:"Priority" xml:"Priority"`
+ RecordId string `json:"RecordId" xml:"RecordId"`
Status string `json:"Status" xml:"Status"`
- TTL int `json:"TTL" xml:"TTL"`
+ Locked bool `json:"Locked" xml:"Locked"`
+ Weight int `json:"Weight" xml:"Weight"`
+ Line string `json:"Line" xml:"Line"`
+ Type string `json:"Type" xml:"Type"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_line.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_line.go
index 2219c2d16..d4db70380 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_line.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_line.go
@@ -17,8 +17,8 @@ package alidns
// RecordLine is a nested struct in alidns response
type RecordLine struct {
- LineName string `json:"LineName" xml:"LineName"`
- FatherCode string `json:"FatherCode" xml:"FatherCode"`
LineDisplayName string `json:"LineDisplayName" xml:"LineDisplayName"`
LineCode string `json:"LineCode" xml:"LineCode"`
+ LineName string `json:"LineName" xml:"LineName"`
+ FatherCode string `json:"FatherCode" xml:"FatherCode"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_log.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_log.go
index ee4583520..e6bf34f33 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_log.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_record_log.go
@@ -18,7 +18,7 @@ package alidns
// RecordLog is a nested struct in alidns response
type RecordLog struct {
ActionTime string `json:"ActionTime" xml:"ActionTime"`
- ActionTimestamp int `json:"ActionTimestamp" xml:"ActionTimestamp"`
+ ActionTimestamp int64 `json:"ActionTimestamp" xml:"ActionTimestamp"`
Action string `json:"Action" xml:"Action"`
Message string `json:"Message" xml:"Message"`
ClientIp string `json:"ClientIp" xml:"ClientIp"`
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rule.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rule.go
new file mode 100644
index 000000000..e7dcc83e8
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rule.go
@@ -0,0 +1,23 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Rule is a nested struct in alidns response
+type Rule struct {
+ RuleId int64 `json:"RuleId" xml:"RuleId"`
+ Name string `json:"Name" xml:"Name"`
+ Title string `json:"Title" xml:"Title"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rules.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rules.go
new file mode 100644
index 000000000..067a95886
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_rules.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Rules is a nested struct in alidns response
+type Rules struct {
+ Rule []Rule `json:"Rule" xml:"Rule"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_slb_sub_domain.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_slb_sub_domain.go
index 043a44718..d16fb9ad9 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_slb_sub_domain.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_slb_sub_domain.go
@@ -18,7 +18,7 @@ package alidns
// SlbSubDomain is a nested struct in alidns response
type SlbSubDomain struct {
SubDomain string `json:"SubDomain" xml:"SubDomain"`
- RecordCount int `json:"RecordCount" xml:"RecordCount"`
+ RecordCount int64 `json:"RecordCount" xml:"RecordCount"`
Open bool `json:"Open" xml:"Open"`
Type string `json:"Type" xml:"Type"`
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistic.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistic.go
new file mode 100644
index 000000000..7aaa95a8e
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistic.go
@@ -0,0 +1,24 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Statistic is a nested struct in alidns response
+type Statistic struct {
+ Timestamp int64 `json:"Timestamp" xml:"Timestamp"`
+ Count int64 `json:"Count" xml:"Count"`
+ DomainName string `json:"DomainName" xml:"DomainName"`
+ SubDomain string `json:"SubDomain" xml:"SubDomain"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_dns_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_dns_statistics.go
new file mode 100644
index 000000000..0fb034ffd
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_dns_statistics.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeDomainDnsStatistics is a nested struct in alidns response
+type StatisticsInDescribeDomainDnsStatistics struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics.go
new file mode 100644
index 000000000..462322d75
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeDomainStatistics is a nested struct in alidns response
+type StatisticsInDescribeDomainStatistics struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics_summary.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics_summary.go
new file mode 100644
index 000000000..27418d0ba
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_domain_statistics_summary.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeDomainStatisticsSummary is a nested struct in alidns response
+type StatisticsInDescribeDomainStatisticsSummary struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics.go
new file mode 100644
index 000000000..7303c1a39
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeRecordStatistics is a nested struct in alidns response
+type StatisticsInDescribeRecordStatistics struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_history.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_history.go
new file mode 100644
index 000000000..b0660050e
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_history.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeRecordStatisticsHistory is a nested struct in alidns response
+type StatisticsInDescribeRecordStatisticsHistory struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_summary.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_summary.go
new file mode 100644
index 000000000..fcda10250
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_statistics_in_describe_record_statistics_summary.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// StatisticsInDescribeRecordStatisticsSummary is a nested struct in alidns response
+type StatisticsInDescribeRecordStatisticsSummary struct {
+ Statistic []Statistic `json:"Statistic" xml:"Statistic"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategies.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategies.go
new file mode 100644
index 000000000..abe9988f5
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategies.go
@@ -0,0 +1,21 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Strategies is a nested struct in alidns response
+type Strategies struct {
+ Strategy []Strategy `json:"Strategy" xml:"Strategy"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategy.go
new file mode 100644
index 000000000..62318749c
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/struct_strategy.go
@@ -0,0 +1,33 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// Strategy is a nested struct in alidns response
+type Strategy struct {
+ StrategyId string `json:"StrategyId" xml:"StrategyId"`
+ StrategyName string `json:"StrategyName" xml:"StrategyName"`
+ CreateTime string `json:"CreateTime" xml:"CreateTime"`
+ CreateTimestamp int64 `json:"CreateTimestamp" xml:"CreateTimestamp"`
+ DefaultAddrPoolId string `json:"DefaultAddrPoolId" xml:"DefaultAddrPoolId"`
+ DefaultAddrPoolName string `json:"DefaultAddrPoolName" xml:"DefaultAddrPoolName"`
+ FailoverAddrPoolId string `json:"FailoverAddrPoolId" xml:"FailoverAddrPoolId"`
+ FailoverAddrPoolName string `json:"FailoverAddrPoolName" xml:"FailoverAddrPoolName"`
+ AccessMode string `json:"AccessMode" xml:"AccessMode"`
+ AccessStatus string `json:"AccessStatus" xml:"AccessStatus"`
+ StrategyMode string `json:"StrategyMode" xml:"StrategyMode"`
+ InstanceId string `json:"InstanceId" xml:"InstanceId"`
+ Lines LinesInDescribeGtmAccessStrategies `json:"Lines" xml:"Lines"`
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_batch_domain_records.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_batch_domain_records.go
deleted file mode 100644
index c90e20455..000000000
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_batch_domain_records.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package alidns
-
-//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.
-//
-// Code generated by Alibaba Cloud SDK Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
-)
-
-// UpdateBatchDomainRecords invokes the alidns.UpdateBatchDomainRecords API synchronously
-// api document: https://help.aliyun.com/api/alidns/updatebatchdomainrecords.html
-func (client *Client) UpdateBatchDomainRecords(request *UpdateBatchDomainRecordsRequest) (response *UpdateBatchDomainRecordsResponse, err error) {
- response = CreateUpdateBatchDomainRecordsResponse()
- err = client.DoAction(request, response)
- return
-}
-
-// UpdateBatchDomainRecordsWithChan invokes the alidns.UpdateBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/updatebatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) UpdateBatchDomainRecordsWithChan(request *UpdateBatchDomainRecordsRequest) (<-chan *UpdateBatchDomainRecordsResponse, <-chan error) {
- responseChan := make(chan *UpdateBatchDomainRecordsResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.UpdateBatchDomainRecords(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
-}
-
-// UpdateBatchDomainRecordsWithCallback invokes the alidns.UpdateBatchDomainRecords API asynchronously
-// api document: https://help.aliyun.com/api/alidns/updatebatchdomainrecords.html
-// asynchronous document: https://help.aliyun.com/document_detail/66220.html
-func (client *Client) UpdateBatchDomainRecordsWithCallback(request *UpdateBatchDomainRecordsRequest, callback func(response *UpdateBatchDomainRecordsResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *UpdateBatchDomainRecordsResponse
- var err error
- defer close(result)
- response, err = client.UpdateBatchDomainRecords(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
-}
-
-// UpdateBatchDomainRecordsRequest is the request struct for api UpdateBatchDomainRecords
-type UpdateBatchDomainRecordsRequest struct {
- *requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
- Records string `position:"Query" name:"Records"`
-}
-
-// UpdateBatchDomainRecordsResponse is the response struct for api UpdateBatchDomainRecords
-type UpdateBatchDomainRecordsResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- TraceId string `json:"TraceId" xml:"TraceId"`
-}
-
-// CreateUpdateBatchDomainRecordsRequest creates a request to invoke UpdateBatchDomainRecords API
-func CreateUpdateBatchDomainRecordsRequest() (request *UpdateBatchDomainRecordsRequest) {
- request = &UpdateBatchDomainRecordsRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateBatchDomainRecords", "", "")
- return
-}
-
-// CreateUpdateBatchDomainRecordsResponse creates a response to parse from UpdateBatchDomainRecords response
-func CreateUpdateBatchDomainRecordsResponse() (response *UpdateBatchDomainRecordsResponse) {
- response = &UpdateBatchDomainRecordsResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
-}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_dnsslb_weight.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_dnsslb_weight.go
index ec372a215..49df52fe4 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_dnsslb_weight.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_dnsslb_weight.go
@@ -76,10 +76,10 @@ func (client *Client) UpdateDNSSLBWeightWithCallback(request *UpdateDNSSLBWeight
// UpdateDNSSLBWeightRequest is the request struct for api UpdateDNSSLBWeight
type UpdateDNSSLBWeightRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
RecordId string `position:"Query" name:"RecordId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
Weight requests.Integer `position:"Query" name:"Weight"`
+ Lang string `position:"Query" name:"Lang"`
}
// UpdateDNSSLBWeightResponse is the response struct for api UpdateDNSSLBWeight
@@ -95,7 +95,7 @@ func CreateUpdateDNSSLBWeightRequest() (request *UpdateDNSSLBWeightRequest) {
request = &UpdateDNSSLBWeightRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDNSSLBWeight", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDNSSLBWeight", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_group.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_group.go
index 61f1fb1d2..7d95763d0 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_group.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_group.go
@@ -76,9 +76,9 @@ func (client *Client) UpdateDomainGroupWithCallback(request *UpdateDomainGroupRe
// UpdateDomainGroupRequest is the request struct for api UpdateDomainGroup
type UpdateDomainGroupRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
GroupId string `position:"Query" name:"GroupId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
GroupName string `position:"Query" name:"GroupName"`
}
@@ -95,7 +95,7 @@ func CreateUpdateDomainGroupRequest() (request *UpdateDomainGroupRequest) {
request = &UpdateDomainGroupRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDomainGroup", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDomainGroup", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_record.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_record.go
index 1e9c0daf1..3371e6870 100644
--- a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_record.go
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_domain_record.go
@@ -76,15 +76,15 @@ func (client *Client) UpdateDomainRecordWithCallback(request *UpdateDomainRecord
// UpdateDomainRecordRequest is the request struct for api UpdateDomainRecord
type UpdateDomainRecordRequest struct {
*requests.RpcRequest
- Lang string `position:"Query" name:"Lang"`
- UserClientIp string `position:"Query" name:"UserClientIp"`
RecordId string `position:"Query" name:"RecordId"`
RR string `position:"Query" name:"RR"`
+ Line string `position:"Query" name:"Line"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Lang string `position:"Query" name:"Lang"`
Type string `position:"Query" name:"Type"`
+ Priority requests.Integer `position:"Query" name:"Priority"`
Value string `position:"Query" name:"Value"`
TTL requests.Integer `position:"Query" name:"TTL"`
- Priority requests.Integer `position:"Query" name:"Priority"`
- Line string `position:"Query" name:"Line"`
}
// UpdateDomainRecordResponse is the response struct for api UpdateDomainRecord
@@ -99,7 +99,7 @@ func CreateUpdateDomainRecordRequest() (request *UpdateDomainRecordRequest) {
request = &UpdateDomainRecordRequest{
RpcRequest: &requests.RpcRequest{},
}
- request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDomainRecord", "", "")
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateDomainRecord", "Alidns", "openAPI")
return
}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_access_strategy.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_access_strategy.go
new file mode 100644
index 000000000..e0437eb57
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_access_strategy.go
@@ -0,0 +1,109 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateGtmAccessStrategy invokes the alidns.UpdateGtmAccessStrategy API synchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaccessstrategy.html
+func (client *Client) UpdateGtmAccessStrategy(request *UpdateGtmAccessStrategyRequest) (response *UpdateGtmAccessStrategyResponse, err error) {
+ response = CreateUpdateGtmAccessStrategyResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// UpdateGtmAccessStrategyWithChan invokes the alidns.UpdateGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmAccessStrategyWithChan(request *UpdateGtmAccessStrategyRequest) (<-chan *UpdateGtmAccessStrategyResponse, <-chan error) {
+ responseChan := make(chan *UpdateGtmAccessStrategyResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.UpdateGtmAccessStrategy(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// UpdateGtmAccessStrategyWithCallback invokes the alidns.UpdateGtmAccessStrategy API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaccessstrategy.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmAccessStrategyWithCallback(request *UpdateGtmAccessStrategyRequest, callback func(response *UpdateGtmAccessStrategyResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *UpdateGtmAccessStrategyResponse
+ var err error
+ defer close(result)
+ response, err = client.UpdateGtmAccessStrategy(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// UpdateGtmAccessStrategyRequest is the request struct for api UpdateGtmAccessStrategy
+type UpdateGtmAccessStrategyRequest struct {
+ *requests.RpcRequest
+ StrategyName string `position:"Query" name:"StrategyName"`
+ DefaultAddrPoolId string `position:"Query" name:"DefaultAddrPoolId"`
+ AccessLines string `position:"Query" name:"AccessLines"`
+ FailoverAddrPoolId string `position:"Query" name:"FailoverAddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ StrategyId string `position:"Query" name:"StrategyId"`
+ Lang string `position:"Query" name:"Lang"`
+}
+
+// UpdateGtmAccessStrategyResponse is the response struct for api UpdateGtmAccessStrategy
+type UpdateGtmAccessStrategyResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateGtmAccessStrategyRequest creates a request to invoke UpdateGtmAccessStrategy API
+func CreateUpdateGtmAccessStrategyRequest() (request *UpdateGtmAccessStrategyRequest) {
+ request = &UpdateGtmAccessStrategyRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateGtmAccessStrategy", "Alidns", "openAPI")
+ return
+}
+
+// CreateUpdateGtmAccessStrategyResponse creates a response to parse from UpdateGtmAccessStrategy response
+func CreateUpdateGtmAccessStrategyResponse() (response *UpdateGtmAccessStrategyResponse) {
+ response = &UpdateGtmAccessStrategyResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_address_pool.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_address_pool.go
new file mode 100644
index 000000000..cdbd6fc45
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_address_pool.go
@@ -0,0 +1,116 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateGtmAddressPool invokes the alidns.UpdateGtmAddressPool API synchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaddresspool.html
+func (client *Client) UpdateGtmAddressPool(request *UpdateGtmAddressPoolRequest) (response *UpdateGtmAddressPoolResponse, err error) {
+ response = CreateUpdateGtmAddressPoolResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// UpdateGtmAddressPoolWithChan invokes the alidns.UpdateGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmAddressPoolWithChan(request *UpdateGtmAddressPoolRequest) (<-chan *UpdateGtmAddressPoolResponse, <-chan error) {
+ responseChan := make(chan *UpdateGtmAddressPoolResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.UpdateGtmAddressPool(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// UpdateGtmAddressPoolWithCallback invokes the alidns.UpdateGtmAddressPool API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmaddresspool.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmAddressPoolWithCallback(request *UpdateGtmAddressPoolRequest, callback func(response *UpdateGtmAddressPoolResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *UpdateGtmAddressPoolResponse
+ var err error
+ defer close(result)
+ response, err = client.UpdateGtmAddressPool(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// UpdateGtmAddressPoolRequest is the request struct for api UpdateGtmAddressPool
+type UpdateGtmAddressPoolRequest struct {
+ *requests.RpcRequest
+ AddrPoolId string `position:"Query" name:"AddrPoolId"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Name string `position:"Query" name:"Name"`
+ Lang string `position:"Query" name:"Lang"`
+ Type string `position:"Query" name:"Type"`
+ Addr *[]UpdateGtmAddressPoolAddr `position:"Query" name:"Addr" type:"Repeated"`
+ MinAvailableAddrNum requests.Integer `position:"Query" name:"MinAvailableAddrNum"`
+}
+
+// UpdateGtmAddressPoolAddr is a repeated param struct in UpdateGtmAddressPoolRequest
+type UpdateGtmAddressPoolAddr struct {
+ Mode string `name:"Mode"`
+ LbaWeight string `name:"LbaWeight"`
+ Value string `name:"Value"`
+}
+
+// UpdateGtmAddressPoolResponse is the response struct for api UpdateGtmAddressPool
+type UpdateGtmAddressPoolResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateGtmAddressPoolRequest creates a request to invoke UpdateGtmAddressPool API
+func CreateUpdateGtmAddressPoolRequest() (request *UpdateGtmAddressPoolRequest) {
+ request = &UpdateGtmAddressPoolRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateGtmAddressPool", "Alidns", "openAPI")
+ return
+}
+
+// CreateUpdateGtmAddressPoolResponse creates a response to parse from UpdateGtmAddressPool response
+func CreateUpdateGtmAddressPoolResponse() (response *UpdateGtmAddressPoolResponse) {
+ response = &UpdateGtmAddressPoolResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_instance_global_config.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_instance_global_config.go
new file mode 100644
index 000000000..38a857230
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_instance_global_config.go
@@ -0,0 +1,112 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateGtmInstanceGlobalConfig invokes the alidns.UpdateGtmInstanceGlobalConfig API synchronously
+// api document: https://help.aliyun.com/api/alidns/updategtminstanceglobalconfig.html
+func (client *Client) UpdateGtmInstanceGlobalConfig(request *UpdateGtmInstanceGlobalConfigRequest) (response *UpdateGtmInstanceGlobalConfigResponse, err error) {
+ response = CreateUpdateGtmInstanceGlobalConfigResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// UpdateGtmInstanceGlobalConfigWithChan invokes the alidns.UpdateGtmInstanceGlobalConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtminstanceglobalconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmInstanceGlobalConfigWithChan(request *UpdateGtmInstanceGlobalConfigRequest) (<-chan *UpdateGtmInstanceGlobalConfigResponse, <-chan error) {
+ responseChan := make(chan *UpdateGtmInstanceGlobalConfigResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.UpdateGtmInstanceGlobalConfig(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// UpdateGtmInstanceGlobalConfigWithCallback invokes the alidns.UpdateGtmInstanceGlobalConfig API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtminstanceglobalconfig.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmInstanceGlobalConfigWithCallback(request *UpdateGtmInstanceGlobalConfigRequest, callback func(response *UpdateGtmInstanceGlobalConfigResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *UpdateGtmInstanceGlobalConfigResponse
+ var err error
+ defer close(result)
+ response, err = client.UpdateGtmInstanceGlobalConfig(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// UpdateGtmInstanceGlobalConfigRequest is the request struct for api UpdateGtmInstanceGlobalConfig
+type UpdateGtmInstanceGlobalConfigRequest struct {
+ *requests.RpcRequest
+ AlertGroup string `position:"Query" name:"AlertGroup"`
+ InstanceId string `position:"Query" name:"InstanceId"`
+ InstanceName string `position:"Query" name:"InstanceName"`
+ UserDomainName string `position:"Query" name:"UserDomainName"`
+ CnameMode string `position:"Query" name:"CnameMode"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ LbaStrategy string `position:"Query" name:"LbaStrategy"`
+ Lang string `position:"Query" name:"Lang"`
+ Ttl requests.Integer `position:"Query" name:"Ttl"`
+ CnameCustomDomainName string `position:"Query" name:"CnameCustomDomainName"`
+}
+
+// UpdateGtmInstanceGlobalConfigResponse is the response struct for api UpdateGtmInstanceGlobalConfig
+type UpdateGtmInstanceGlobalConfigResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateGtmInstanceGlobalConfigRequest creates a request to invoke UpdateGtmInstanceGlobalConfig API
+func CreateUpdateGtmInstanceGlobalConfigRequest() (request *UpdateGtmInstanceGlobalConfigRequest) {
+ request = &UpdateGtmInstanceGlobalConfigRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateGtmInstanceGlobalConfig", "Alidns", "openAPI")
+ return
+}
+
+// CreateUpdateGtmInstanceGlobalConfigResponse creates a response to parse from UpdateGtmInstanceGlobalConfig response
+func CreateUpdateGtmInstanceGlobalConfigResponse() (response *UpdateGtmInstanceGlobalConfigResponse) {
+ response = &UpdateGtmInstanceGlobalConfigResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_monitor.go b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_monitor.go
new file mode 100644
index 000000000..c6280f269
--- /dev/null
+++ b/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/alidns/update_gtm_monitor.go
@@ -0,0 +1,118 @@
+package alidns
+
+//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.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+ "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// UpdateGtmMonitor invokes the alidns.UpdateGtmMonitor API synchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmmonitor.html
+func (client *Client) UpdateGtmMonitor(request *UpdateGtmMonitorRequest) (response *UpdateGtmMonitorResponse, err error) {
+ response = CreateUpdateGtmMonitorResponse()
+ err = client.DoAction(request, response)
+ return
+}
+
+// UpdateGtmMonitorWithChan invokes the alidns.UpdateGtmMonitor API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmmonitor.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmMonitorWithChan(request *UpdateGtmMonitorRequest) (<-chan *UpdateGtmMonitorResponse, <-chan error) {
+ responseChan := make(chan *UpdateGtmMonitorResponse, 1)
+ errChan := make(chan error, 1)
+ err := client.AddAsyncTask(func() {
+ defer close(responseChan)
+ defer close(errChan)
+ response, err := client.UpdateGtmMonitor(request)
+ if err != nil {
+ errChan <- err
+ } else {
+ responseChan <- response
+ }
+ })
+ if err != nil {
+ errChan <- err
+ close(responseChan)
+ close(errChan)
+ }
+ return responseChan, errChan
+}
+
+// UpdateGtmMonitorWithCallback invokes the alidns.UpdateGtmMonitor API asynchronously
+// api document: https://help.aliyun.com/api/alidns/updategtmmonitor.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) UpdateGtmMonitorWithCallback(request *UpdateGtmMonitorRequest, callback func(response *UpdateGtmMonitorResponse, err error)) <-chan int {
+ result := make(chan int, 1)
+ err := client.AddAsyncTask(func() {
+ var response *UpdateGtmMonitorResponse
+ var err error
+ defer close(result)
+ response, err = client.UpdateGtmMonitor(request)
+ callback(response, err)
+ result <- 1
+ })
+ if err != nil {
+ defer close(result)
+ callback(nil, err)
+ result <- 0
+ }
+ return result
+}
+
+// UpdateGtmMonitorRequest is the request struct for api UpdateGtmMonitor
+type UpdateGtmMonitorRequest struct {
+ *requests.RpcRequest
+ MonitorExtendInfo string `position:"Query" name:"MonitorExtendInfo"`
+ UserClientIp string `position:"Query" name:"UserClientIp"`
+ Name string `position:"Query" name:"Name"`
+ MonitorConfigId string `position:"Query" name:"MonitorConfigId"`
+ EvaluationCount requests.Integer `position:"Query" name:"EvaluationCount"`
+ ProtocolType string `position:"Query" name:"ProtocolType"`
+ Interval requests.Integer `position:"Query" name:"Interval"`
+ Lang string `position:"Query" name:"Lang"`
+ Timeout requests.Integer `position:"Query" name:"Timeout"`
+ IspCityNode *[]UpdateGtmMonitorIspCityNode `position:"Query" name:"IspCityNode" type:"Repeated"`
+}
+
+// UpdateGtmMonitorIspCityNode is a repeated param struct in UpdateGtmMonitorRequest
+type UpdateGtmMonitorIspCityNode struct {
+ CityCode string `name:"CityCode"`
+ IspCode string `name:"IspCode"`
+}
+
+// UpdateGtmMonitorResponse is the response struct for api UpdateGtmMonitor
+type UpdateGtmMonitorResponse struct {
+ *responses.BaseResponse
+ RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateUpdateGtmMonitorRequest creates a request to invoke UpdateGtmMonitor API
+func CreateUpdateGtmMonitorRequest() (request *UpdateGtmMonitorRequest) {
+ request = &UpdateGtmMonitorRequest{
+ RpcRequest: &requests.RpcRequest{},
+ }
+ request.InitWithApiInfo("Alidns", "2015-01-09", "UpdateGtmMonitor", "Alidns", "openAPI")
+ return
+}
+
+// CreateUpdateGtmMonitorResponse creates a response to parse from UpdateGtmMonitor response
+func CreateUpdateGtmMonitorResponse() (response *UpdateGtmMonitorResponse) {
+ response = &UpdateGtmMonitorResponse{
+ BaseResponse: &responses.BaseResponse{},
+ }
+ return
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt
index 5f14d1162..899129ecc 100644
--- a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt
+++ b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt
@@ -1,3 +1,3 @@
AWS SDK for Go
-Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2014-2015 Stripe, Inc.
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
index 56fdfc2bf..99849c0e1 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
@@ -138,8 +138,27 @@ type RequestFailure interface {
RequestID() string
}
-// NewRequestFailure returns a new request error wrapper for the given Error
-// provided.
+// NewRequestFailure returns a wrapped error with additional information for
+// request status code, and service requestID.
+//
+// Should be used to wrap all request which involve service requests. Even if
+// the request failed without a service response, but had an HTTP status code
+// that may be meaningful.
func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure {
return newRequestError(err, statusCode, reqID)
}
+
+// UnmarshalError provides the interface for the SDK failing to unmarshal data.
+type UnmarshalError interface {
+ awsError
+ Bytes() []byte
+}
+
+// NewUnmarshalError returns an initialized UnmarshalError error wrapper adding
+// the bytes that fail to unmarshal to the error.
+func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError {
+ return &unmarshalError{
+ awsError: New("UnmarshalError", msg, err),
+ bytes: bytes,
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
index 0202a008f..9cf7eaf40 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
@@ -1,6 +1,9 @@
package awserr
-import "fmt"
+import (
+ "encoding/hex"
+ "fmt"
+)
// SprintError returns a string of the formatted error code.
//
@@ -119,6 +122,7 @@ type requestError struct {
awsError
statusCode int
requestID string
+ bytes []byte
}
// newRequestError returns a wrapped error with additional information for
@@ -170,6 +174,29 @@ func (r requestError) OrigErrs() []error {
return []error{r.OrigErr()}
}
+type unmarshalError struct {
+ awsError
+ bytes []byte
+}
+
+// Error returns the string representation of the error.
+// Satisfies the error interface.
+func (e unmarshalError) Error() string {
+ extra := hex.Dump(e.bytes)
+ return SprintError(e.Code(), e.Message(), extra, e.OrigErr())
+}
+
+// String returns the string representation of the error.
+// Alias for Error to satisfy the stringer interface.
+func (e unmarshalError) String() string {
+ return e.Error()
+}
+
+// Bytes returns the bytes that failed to unmarshal.
+func (e unmarshalError) Bytes() []byte {
+ return e.bytes
+}
+
// An error list that satisfies the golang interface
type errorList []error
@@ -181,7 +208,7 @@ func (e errorList) Error() string {
// How do we want to handle the array size being zero
if size := len(e); size > 0 {
for i := 0; i < size; i++ {
- msg += fmt.Sprintf("%s", e[i].Error())
+ msg += e[i].Error()
// We check the next index to see if it is within the slice.
// If it is, then we append a newline. We do this, because unit tests
// could be broken with the additional '\n'
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
index 59fa4a558..142a7a01c 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
@@ -15,7 +15,7 @@ func DeepEqual(a, b interface{}) bool {
rb := reflect.Indirect(reflect.ValueOf(b))
if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid {
- // If the elements are both nil, and of the same type the are equal
+ // If the elements are both nil, and of the same type they are equal
// If they are of different types they are not equal
return reflect.TypeOf(a) == reflect.TypeOf(b)
} else if raValid != rbValid {
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
index 11c52c389..285e54d67 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
@@ -185,13 +185,12 @@ func ValuesAtPath(i interface{}, path string) ([]interface{}, error) {
// SetValueAtPath sets a value at the case insensitive lexical path inside
// of a structure.
func SetValueAtPath(i interface{}, path string, v interface{}) {
- if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil {
- for _, rval := range rvals {
- if rval.Kind() == reflect.Ptr && rval.IsNil() {
- continue
- }
- setValue(rval, v)
+ rvals := rValuesAtPath(i, path, true, false, v == nil)
+ for _, rval := range rvals {
+ if rval.Kind() == reflect.Ptr && rval.IsNil() {
+ continue
}
+ setValue(rval, v)
}
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
index b6432f1a1..645df2450 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
@@ -23,28 +23,27 @@ func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) {
case reflect.Struct:
buf.WriteString("{\n")
- names := []string{}
for i := 0; i < v.Type().NumField(); i++ {
- name := v.Type().Field(i).Name
- f := v.Field(i)
- if name[0:1] == strings.ToLower(name[0:1]) {
+ ft := v.Type().Field(i)
+ fv := v.Field(i)
+
+ if ft.Name[0:1] == strings.ToLower(ft.Name[0:1]) {
continue // ignore unexported fields
}
- if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() {
+ if (fv.Kind() == reflect.Ptr || fv.Kind() == reflect.Slice) && fv.IsNil() {
continue // ignore unset fields
}
- names = append(names, name)
- }
- for i, n := range names {
- val := v.FieldByName(n)
buf.WriteString(strings.Repeat(" ", indent+2))
- buf.WriteString(n + ": ")
- stringValue(val, indent+2, buf)
+ buf.WriteString(ft.Name + ": ")
- if i < len(names)-1 {
- buf.WriteString(",\n")
+ if tag := ft.Tag.Get("sensitive"); tag == "true" {
+ buf.WriteString("")
+ } else {
+ stringValue(fv, indent+2, buf)
}
+
+ buf.WriteString(",\n")
}
buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
index 3271a18e8..709605384 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go
@@ -18,7 +18,7 @@ type Config struct {
// States that the signing name did not come from a modeled source but
// was derived based on other data. Used by service client constructors
- // to determine if the signin name can be overriden based on metadata the
+ // to determine if the signin name can be overridden based on metadata the
// service has.
SigningNameDerived bool
}
@@ -91,6 +91,6 @@ func (c *Client) AddDebugHandlers() {
return
}
- c.Handlers.Send.PushFrontNamed(request.NamedHandler{Name: "awssdk.client.LogRequest", Fn: logRequest})
- c.Handlers.Send.PushBackNamed(request.NamedHandler{Name: "awssdk.client.LogResponse", Fn: logResponse})
+ c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler)
+ c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler)
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go
index e223c54cc..8958c32d4 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go
@@ -44,12 +44,22 @@ func (reader *teeReaderCloser) Close() error {
return reader.Source.Close()
}
+// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent
+// to a service. Will include the HTTP request body if the LogLevel of the
+// request matches LogDebugWithHTTPBody.
+var LogHTTPRequestHandler = request.NamedHandler{
+ Name: "awssdk.client.LogRequest",
+ Fn: logRequest,
+}
+
func logRequest(r *request.Request) {
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
bodySeekable := aws.IsReaderSeekable(r.Body)
- dumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
+
+ b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
if err != nil {
- r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err))
+ r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, err))
return
}
@@ -57,13 +67,38 @@ func logRequest(r *request.Request) {
if !bodySeekable {
r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body))
}
- // Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
- // Body as a NoOpCloser and will not be reset after read by the HTTP
- // client reader.
- r.ResetBody()
+ // Reset the request body because dumpRequest will re-wrap the
+ // r.HTTPRequest's Body as a NoOpCloser and will not be reset after
+ // read by the HTTP client reader.
+ if err := r.Error; err != nil {
+ r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, err))
+ return
+ }
}
- r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))
+ r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
+}
+
+// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent
+// to a service. Will only log the HTTP request's headers. The request payload
+// will not be read.
+var LogHTTPRequestHeaderHandler = request.NamedHandler{
+ Name: "awssdk.client.LogRequestHeader",
+ Fn: logRequestHeader,
+}
+
+func logRequestHeader(r *request.Request) {
+ b, err := httputil.DumpRequestOut(r.HTTPRequest, false)
+ if err != nil {
+ r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, err))
+ return
+ }
+
+ r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
}
const logRespMsg = `DEBUG: Response %s/%s Details:
@@ -76,27 +111,50 @@ const logRespErrMsg = `DEBUG ERROR: Response %s/%s:
%s
-----------------------------------------------------`
+// LogHTTPResponseHandler is a SDK request handler to log the HTTP response
+// received from a service. Will include the HTTP response body if the LogLevel
+// of the request matches LogDebugWithHTTPBody.
+var LogHTTPResponseHandler = request.NamedHandler{
+ Name: "awssdk.client.LogResponse",
+ Fn: logResponse,
+}
+
func logResponse(r *request.Request) {
lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)}
- r.HTTPResponse.Body = &teeReaderCloser{
- Reader: io.TeeReader(r.HTTPResponse.Body, lw),
- Source: r.HTTPResponse.Body,
+
+ if r.HTTPResponse == nil {
+ lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, "request's HTTPResponse is nil"))
+ return
+ }
+
+ logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
+ if logBody {
+ r.HTTPResponse.Body = &teeReaderCloser{
+ Reader: io.TeeReader(r.HTTPResponse.Body, lw),
+ Source: r.HTTPResponse.Body,
+ }
}
handlerFn := func(req *request.Request) {
- body, err := httputil.DumpResponse(req.HTTPResponse, false)
+ b, err := httputil.DumpResponse(req.HTTPResponse, false)
if err != nil {
- lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
+ lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
+ req.ClientInfo.ServiceName, req.Operation.Name, err))
return
}
- b, err := ioutil.ReadAll(lw.buf)
- if err != nil {
- lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
- return
- }
- lw.Logger.Log(fmt.Sprintf(logRespMsg, req.ClientInfo.ServiceName, req.Operation.Name, string(body)))
- if req.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) {
+ lw.Logger.Log(fmt.Sprintf(logRespMsg,
+ req.ClientInfo.ServiceName, req.Operation.Name, string(b)))
+
+ if logBody {
+ b, err := ioutil.ReadAll(lw.buf)
+ if err != nil {
+ lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
+ req.ClientInfo.ServiceName, req.Operation.Name, err))
+ return
+ }
+
lw.Logger.Log(string(b))
}
}
@@ -110,3 +168,27 @@ func logResponse(r *request.Request) {
Name: handlerName, Fn: handlerFn,
})
}
+
+// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP
+// response received from a service. Will only log the HTTP response's headers.
+// The response payload will not be read.
+var LogHTTPResponseHeaderHandler = request.NamedHandler{
+ Name: "awssdk.client.LogResponseHeader",
+ Fn: logResponseHeader,
+}
+
+func logResponseHeader(r *request.Request) {
+ if r.Config.Logger == nil {
+ return
+ }
+
+ b, err := httputil.DumpResponse(r.HTTPResponse, false)
+ if err != nil {
+ r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, err))
+ return
+ }
+
+ r.Config.Logger.Log(fmt.Sprintf(logRespMsg,
+ r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
index 4778056dd..920e9fddf 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
@@ -3,6 +3,7 @@ package metadata
// ClientInfo wraps immutable data from the client.Client structure.
type ClientInfo struct {
ServiceName string
+ ServiceID string
APIVersion string
Endpoint string
SigningName string
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go
index 5421b5d4e..10634d173 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/config.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go
@@ -18,7 +18,7 @@ const UseServiceDefaultRetries = -1
type RequestRetryer interface{}
// A Config provides service configuration for service clients. By default,
-// all clients will use the defaults.DefaultConfig tructure.
+// all clients will use the defaults.DefaultConfig structure.
//
// // Create Session with MaxRetry configuration to be shared by multiple
// // service clients.
@@ -45,8 +45,8 @@ type Config struct {
// that overrides the default generated endpoint for a client. Set this
// to `""` to use the default generated endpoint.
//
- // @note You must still provide a `Region` value when specifying an
- // endpoint for a client.
+ // Note: You must still provide a `Region` value when specifying an
+ // endpoint for a client.
Endpoint *string
// The resolver to use for looking up endpoints for AWS service clients
@@ -65,8 +65,8 @@ type Config struct {
// noted. A full list of regions is found in the "Regions and Endpoints"
// document.
//
- // @see http://docs.aws.amazon.com/general/latest/gr/rande.html
- // AWS Regions and Endpoints
+ // See http://docs.aws.amazon.com/general/latest/gr/rande.html for AWS
+ // Regions and Endpoints.
Region *string
// Set this to `true` to disable SSL when sending requests. Defaults
@@ -120,9 +120,10 @@ type Config struct {
// will use virtual hosted bucket addressing when possible
// (`http://BUCKET.s3.amazonaws.com/KEY`).
//
- // @note This configuration option is specific to the Amazon S3 service.
- // @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
- // Amazon S3: Virtual Hosting of Buckets
+ // Note: This configuration option is specific to the Amazon S3 service.
+ //
+ // See http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
+ // for Amazon S3: Virtual Hosting of Buckets
S3ForcePathStyle *bool
// Set this to `true` to disable the SDK adding the `Expect: 100-Continue`
@@ -223,6 +224,28 @@ type Config struct {
// Key: aws.String("//foo//bar//moo"),
// })
DisableRestProtocolURICleaning *bool
+
+ // EnableEndpointDiscovery will allow for endpoint discovery on operations that
+ // have the definition in its model. By default, endpoint discovery is off.
+ //
+ // Example:
+ // sess := session.Must(session.NewSession(&aws.Config{
+ // EnableEndpointDiscovery: aws.Bool(true),
+ // }))
+ //
+ // svc := s3.New(sess)
+ // out, err := svc.GetObject(&s3.GetObjectInput {
+ // Bucket: aws.String("bucketname"),
+ // Key: aws.String("/foo/bar/moo"),
+ // })
+ EnableEndpointDiscovery *bool
+
+ // DisableEndpointHostPrefix will disable the SDK's behavior of prefixing
+ // request endpoint hosts with modeled information.
+ //
+ // Disabling this feature is useful when you want to use local endpoints
+ // for testing that do not support the modeled host prefix pattern.
+ DisableEndpointHostPrefix *bool
}
// NewConfig returns a new Config pointer that can be chained with builder
@@ -377,6 +400,19 @@ func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
return c
}
+// WithEndpointDiscovery will set whether or not to use endpoint discovery.
+func (c *Config) WithEndpointDiscovery(t bool) *Config {
+ c.EnableEndpointDiscovery = &t
+ return c
+}
+
+// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix
+// when making requests.
+func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config {
+ c.DisableEndpointHostPrefix = &t
+ return c
+}
+
// MergeIn merges the passed in configs into the existing config object.
func (c *Config) MergeIn(cfgs ...*Config) {
for _, other := range cfgs {
@@ -476,6 +512,14 @@ func mergeInConfig(dst *Config, other *Config) {
if other.EnforceShouldRetryCheck != nil {
dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck
}
+
+ if other.EnableEndpointDiscovery != nil {
+ dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery
+ }
+
+ if other.DisableEndpointHostPrefix != nil {
+ dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix
+ }
}
// Copy will return a shallow copy of the Config object. If any additional
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go
similarity index 58%
rename from vendor/github.com/aws/aws-sdk-go/aws/context.go
rename to vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go
index 79f426853..2866f9a7f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/context.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_5.go
@@ -1,8 +1,8 @@
+// +build !go1.9
+
package aws
-import (
- "time"
-)
+import "time"
// Context is an copy of the Go v1.7 stdlib's context.Context interface.
// It is represented as a SDK interface to enable you to use the "WithContext"
@@ -35,37 +35,3 @@ type Context interface {
// functions.
Value(key interface{}) interface{}
}
-
-// BackgroundContext returns a context that will never be canceled, has no
-// values, and no deadline. This context is used by the SDK to provide
-// backwards compatibility with non-context API operations and functionality.
-//
-// Go 1.6 and before:
-// This context function is equivalent to context.Background in the Go stdlib.
-//
-// Go 1.7 and later:
-// The context returned will be the value returned by context.Background()
-//
-// See https://golang.org/pkg/context for more information on Contexts.
-func BackgroundContext() Context {
- return backgroundCtx
-}
-
-// SleepWithContext will wait for the timer duration to expire, or the context
-// is canceled. Which ever happens first. If the context is canceled the Context's
-// error will be returned.
-//
-// Expects Context to always return a non-nil error if the Done channel is closed.
-func SleepWithContext(ctx Context, dur time.Duration) error {
- t := time.NewTimer(dur)
- defer t.Stop()
-
- select {
- case <-t.C:
- break
- case <-ctx.Done():
- return ctx.Err()
- }
-
- return nil
-}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go
deleted file mode 100644
index 064f75c92..000000000
--- a/vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// +build go1.7
-
-package aws
-
-import "context"
-
-var (
- backgroundCtx = context.Background()
-)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go b/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go
new file mode 100644
index 000000000..3718b26e1
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/context_1_9.go
@@ -0,0 +1,11 @@
+// +build go1.9
+
+package aws
+
+import "context"
+
+// Context is an alias of the Go stdlib's context.Context interface.
+// It can be used within the SDK's API operation "WithContext" methods.
+//
+// See https://golang.org/pkg/context on how to use contexts.
+type Context = context.Context
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go
similarity index 59%
rename from vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go
rename to vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go
index 8fdda5303..66c5945db 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go
@@ -39,3 +39,18 @@ func (e *emptyCtx) String() string {
var (
backgroundCtx = new(emptyCtx)
)
+
+// BackgroundContext returns a context that will never be canceled, has no
+// values, and no deadline. This context is used by the SDK to provide
+// backwards compatibility with non-context API operations and functionality.
+//
+// Go 1.6 and before:
+// This context function is equivalent to context.Background in the Go stdlib.
+//
+// Go 1.7 and later:
+// The context returned will be the value returned by context.Background()
+//
+// See https://golang.org/pkg/context for more information on Contexts.
+func BackgroundContext() Context {
+ return backgroundCtx
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go
new file mode 100644
index 000000000..9c29f29af
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_7.go
@@ -0,0 +1,20 @@
+// +build go1.7
+
+package aws
+
+import "context"
+
+// BackgroundContext returns a context that will never be canceled, has no
+// values, and no deadline. This context is used by the SDK to provide
+// backwards compatibility with non-context API operations and functionality.
+//
+// Go 1.6 and before:
+// This context function is equivalent to context.Background in the Go stdlib.
+//
+// Go 1.7 and later:
+// The context returned will be the value returned by context.Background()
+//
+// See https://golang.org/pkg/context for more information on Contexts.
+func BackgroundContext() Context {
+ return context.Background()
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go b/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go
new file mode 100644
index 000000000..304fd1561
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/context_sleep.go
@@ -0,0 +1,24 @@
+package aws
+
+import (
+ "time"
+)
+
+// SleepWithContext will wait for the timer duration to expire, or the context
+// is canceled. Which ever happens first. If the context is canceled the Context's
+// error will be returned.
+//
+// Expects Context to always return a non-nil error if the Done channel is closed.
+func SleepWithContext(ctx Context, dur time.Duration) error {
+ t := time.NewTimer(dur)
+ defer t.Stop()
+
+ select {
+ case <-t.C:
+ break
+ case <-ctx.Done():
+ return ctx.Err()
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
index cfcddf3dc..f8853d78a 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
@@ -72,9 +72,9 @@ var ValidateReqSigHandler = request.NamedHandler{
signedTime = r.LastSignedAt
}
- // 10 minutes to allow for some clock skew/delays in transmission.
+ // 5 minutes to allow for some clock skew/delays in transmission.
// Would be improved with aws/aws-sdk-go#423
- if signedTime.Add(10 * time.Minute).After(time.Now()) {
+ if signedTime.Add(5 * time.Minute).After(time.Now()) {
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go
index a15f496bc..ab69c7a6f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go
@@ -17,7 +17,7 @@ var SDKVersionUserAgentHandler = request.NamedHandler{
}
const execEnvVar = `AWS_EXECUTION_ENV`
-const execEnvUAKey = `exec_env`
+const execEnvUAKey = `exec-env`
// AddHostExecEnvUserAgentHander is a request handler appending the SDK's
// execution environment to the user agent.
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go
index f298d6596..3ad1e798d 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go
@@ -9,9 +9,7 @@ var (
// providers in the ChainProvider.
//
// This has been deprecated. For verbose error messaging set
- // aws.Config.CredentialsChainVerboseErrors to true
- //
- // @readonly
+ // aws.Config.CredentialsChainVerboseErrors to true.
ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders",
`no valid providers in chain. Deprecated.
For verbose messaging see aws.Config.CredentialsChainVerboseErrors`,
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
index 42416fc2f..4af592158 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
@@ -49,8 +49,11 @@
package credentials
import (
+ "fmt"
"sync"
"time"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
)
// AnonymousCredentials is an empty Credential object that can be used as
@@ -64,8 +67,6 @@ import (
// Credentials: credentials.AnonymousCredentials,
// })))
// // Access public S3 buckets.
-//
-// @readonly
var AnonymousCredentials = NewStaticCredentials("", "", "")
// A Value is the AWS credentials value for individual credential fields.
@@ -83,6 +84,12 @@ type Value struct {
ProviderName string
}
+// HasKeys returns if the credentials Value has both AccessKeyID and
+// SecretAccessKey value set.
+func (v Value) HasKeys() bool {
+ return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0
+}
+
// A Provider is the interface for any component which will provide credentials
// Value. A provider is required to manage its own Expired state, and what to
// be expired means.
@@ -99,6 +106,14 @@ type Provider interface {
IsExpired() bool
}
+// An Expirer is an interface that Providers can implement to expose the expiration
+// time, if known. If the Provider cannot accurately provide this info,
+// it should not implement this interface.
+type Expirer interface {
+ // The time at which the credentials are no longer valid
+ ExpiresAt() time.Time
+}
+
// An ErrorProvider is a stub credentials provider that always returns an error
// this is used by the SDK when construction a known provider is not possible
// due to an error.
@@ -158,13 +173,19 @@ func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) {
// IsExpired returns if the credentials are expired.
func (e *Expiry) IsExpired() bool {
- if e.CurrentTime == nil {
- e.CurrentTime = time.Now
+ curTime := e.CurrentTime
+ if curTime == nil {
+ curTime = time.Now
}
- return e.expiration.Before(e.CurrentTime())
+ return e.expiration.Before(curTime())
}
-// A Credentials provides synchronous safe retrieval of AWS credentials Value.
+// ExpiresAt returns the expiration time of the credential
+func (e *Expiry) ExpiresAt() time.Time {
+ return e.expiration
+}
+
+// A Credentials provides concurrency safe retrieval of AWS credentials Value.
// Credentials will cache the credentials value until they expire. Once the value
// expires the next Get will attempt to retrieve valid credentials.
//
@@ -178,7 +199,8 @@ func (e *Expiry) IsExpired() bool {
type Credentials struct {
creds Value
forceRefresh bool
- m sync.Mutex
+
+ m sync.RWMutex
provider Provider
}
@@ -201,6 +223,17 @@ func NewCredentials(provider Provider) *Credentials {
// If Credentials.Expire() was called the credentials Value will be force
// expired, and the next call to Get() will cause them to be refreshed.
func (c *Credentials) Get() (Value, error) {
+ // Check the cached credentials first with just the read lock.
+ c.m.RLock()
+ if !c.isExpired() {
+ creds := c.creds
+ c.m.RUnlock()
+ return creds, nil
+ }
+ c.m.RUnlock()
+
+ // Credentials are expired need to retrieve the credentials taking the full
+ // lock.
c.m.Lock()
defer c.m.Unlock()
@@ -234,8 +267,8 @@ func (c *Credentials) Expire() {
// If the Credentials were forced to be expired with Expire() this will
// reflect that override.
func (c *Credentials) IsExpired() bool {
- c.m.Lock()
- defer c.m.Unlock()
+ c.m.RLock()
+ defer c.m.RUnlock()
return c.isExpired()
}
@@ -244,3 +277,23 @@ func (c *Credentials) IsExpired() bool {
func (c *Credentials) isExpired() bool {
return c.forceRefresh || c.provider.IsExpired()
}
+
+// ExpiresAt provides access to the functionality of the Expirer interface of
+// the underlying Provider, if it supports that interface. Otherwise, it returns
+// an error.
+func (c *Credentials) ExpiresAt() (time.Time, error) {
+ c.m.RLock()
+ defer c.m.RUnlock()
+
+ expirer, ok := c.provider.(Expirer)
+ if !ok {
+ return time.Time{}, awserr.New("ProviderNotExpirer",
+ fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName),
+ nil)
+ }
+ if c.forceRefresh {
+ // set expiration time to the distant past
+ return time.Time{}, nil
+ }
+ return expirer.ExpiresAt(), nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
index c39749524..43d4ed386 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
@@ -4,7 +4,6 @@ import (
"bufio"
"encoding/json"
"fmt"
- "path"
"strings"
"time"
@@ -12,6 +11,8 @@ import (
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/internal/sdkuri"
)
// ProviderName provides a name of EC2Role provider
@@ -125,7 +126,7 @@ type ec2RoleCredRespBody struct {
Message string
}
-const iamSecurityCredsPath = "/iam/security-credentials"
+const iamSecurityCredsPath = "iam/security-credentials/"
// requestCredList requests a list of credentials from the EC2 service.
// If there are no credentials, or there is an error making or receiving the request
@@ -142,7 +143,8 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
}
if err := s.Err(); err != nil {
- return nil, awserr.New("SerializationError", "failed to read EC2 instance role from metadata service", err)
+ return nil, awserr.New(request.ErrCodeSerialization,
+ "failed to read EC2 instance role from metadata service", err)
}
return credsList, nil
@@ -153,7 +155,7 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
// If the credentials cannot be found, or there is an error reading the response
// and error will be returned.
func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
- resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName))
+ resp, err := client.GetMetadata(sdkuri.PathJoin(iamSecurityCredsPath, credsName))
if err != nil {
return ec2RoleCredRespBody{},
awserr.New("EC2RoleRequestError",
@@ -164,7 +166,7 @@ func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCred
respCreds := ec2RoleCredRespBody{}
if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil {
return ec2RoleCredRespBody{},
- awserr.New("SerializationError",
+ awserr.New(request.ErrCodeSerialization,
fmt.Sprintf("failed to decode %s EC2 instance role credentials", credsName),
err)
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go
index a4cec5c55..c2b2c5d65 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/endpointcreds/provider.go
@@ -39,6 +39,7 @@ import (
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil"
)
// ProviderName is the name of the credentials provider.
@@ -65,6 +66,10 @@ type Provider struct {
//
// If ExpiryWindow is 0 or less it will be ignored.
ExpiryWindow time.Duration
+
+ // Optional authorization token value if set will be used as the value of
+ // the Authorization header of the endpoint credential request.
+ AuthorizationToken string
}
// NewProviderClient returns a credentials Provider for retrieving AWS credentials
@@ -152,6 +157,9 @@ func (p *Provider) getCredentials() (*getCredentialsOutput, error) {
out := &getCredentialsOutput{}
req := p.Client.NewRequest(op, nil, out)
req.HTTPRequest.Header.Set("Accept", "application/json")
+ if authToken := p.AuthorizationToken; len(authToken) != 0 {
+ req.HTTPRequest.Header.Set("Authorization", authToken)
+ }
return out, req.Send()
}
@@ -167,7 +175,7 @@ func unmarshalHandler(r *request.Request) {
out := r.Data.(*getCredentialsOutput)
if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil {
- r.Error = awserr.New("SerializationError",
+ r.Error = awserr.New(request.ErrCodeSerialization,
"failed to decode endpoint credentials",
err,
)
@@ -178,11 +186,15 @@ func unmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
var errOut errorOutput
- if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&errOut); err != nil {
- r.Error = awserr.New("SerializationError",
- "failed to decode endpoint credentials",
- err,
+ err := jsonutil.UnmarshalJSONError(&errOut, r.HTTPResponse.Body)
+ if err != nil {
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed to decode error message", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
)
+ return
}
// Response body format is not consistent between metadata endpoints.
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go
index c14231a16..54c5cf733 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go
@@ -12,14 +12,10 @@ const EnvProviderName = "EnvProvider"
var (
// ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be
// found in the process's environment.
- //
- // @readonly
ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil)
// ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key
// can't be found in the process's environment.
- //
- // @readonly
ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil)
)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go
new file mode 100644
index 000000000..1980c8c14
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go
@@ -0,0 +1,425 @@
+/*
+Package processcreds is a credential Provider to retrieve `credential_process`
+credentials.
+
+WARNING: The following describes a method of sourcing credentials from an external
+process. This can potentially be dangerous, so proceed with caution. Other
+credential providers should be preferred if at all possible. If using this
+option, you should make sure that the config file is as locked down as possible
+using security best practices for your operating system.
+
+You can use credentials from a `credential_process` in a variety of ways.
+
+One way is to setup your shared config file, located in the default
+location, with the `credential_process` key and the command you want to be
+called. You also need to set the AWS_SDK_LOAD_CONFIG environment variable
+(e.g., `export AWS_SDK_LOAD_CONFIG=1`) to use the shared config file.
+
+ [default]
+ credential_process = /command/to/call
+
+Creating a new session will use the credential process to retrieve credentials.
+NOTE: If there are credentials in the profile you are using, the credential
+process will not be used.
+
+ // Initialize a session to load credentials.
+ sess, _ := session.NewSession(&aws.Config{
+ Region: aws.String("us-east-1")},
+ )
+
+ // Create S3 service client to use the credentials.
+ svc := s3.New(sess)
+
+Another way to use the `credential_process` method is by using
+`credentials.NewCredentials()` and providing a command to be executed to
+retrieve credentials:
+
+ // Create credentials using the ProcessProvider.
+ creds := processcreds.NewCredentials("/path/to/command")
+
+ // Create service client value configured for credentials.
+ svc := s3.New(sess, &aws.Config{Credentials: creds})
+
+You can set a non-default timeout for the `credential_process` with another
+constructor, `credentials.NewCredentialsTimeout()`, providing the timeout. To
+set a one minute timeout:
+
+ // Create credentials using the ProcessProvider.
+ creds := processcreds.NewCredentialsTimeout(
+ "/path/to/command",
+ time.Duration(500) * time.Millisecond)
+
+If you need more control, you can set any configurable options in the
+credentials using one or more option functions. For example, you can set a two
+minute timeout, a credential duration of 60 minutes, and a maximum stdout
+buffer size of 2k.
+
+ creds := processcreds.NewCredentials(
+ "/path/to/command",
+ func(opt *ProcessProvider) {
+ opt.Timeout = time.Duration(2) * time.Minute
+ opt.Duration = time.Duration(60) * time.Minute
+ opt.MaxBufSize = 2048
+ })
+
+You can also use your own `exec.Cmd`:
+
+ // Create an exec.Cmd
+ myCommand := exec.Command("/path/to/command")
+
+ // Create credentials using your exec.Cmd and custom timeout
+ creds := processcreds.NewCredentialsCommand(
+ myCommand,
+ func(opt *processcreds.ProcessProvider) {
+ opt.Timeout = time.Duration(1) * time.Second
+ })
+*/
+package processcreds
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "os"
+ "os/exec"
+ "runtime"
+ "strings"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/credentials"
+)
+
+const (
+ // ProviderName is the name this credentials provider will label any
+ // returned credentials Value with.
+ ProviderName = `ProcessProvider`
+
+ // ErrCodeProcessProviderParse error parsing process output
+ ErrCodeProcessProviderParse = "ProcessProviderParseError"
+
+ // ErrCodeProcessProviderVersion version error in output
+ ErrCodeProcessProviderVersion = "ProcessProviderVersionError"
+
+ // ErrCodeProcessProviderRequired required attribute missing in output
+ ErrCodeProcessProviderRequired = "ProcessProviderRequiredError"
+
+ // ErrCodeProcessProviderExecution execution of command failed
+ ErrCodeProcessProviderExecution = "ProcessProviderExecutionError"
+
+ // errMsgProcessProviderTimeout process took longer than allowed
+ errMsgProcessProviderTimeout = "credential process timed out"
+
+ // errMsgProcessProviderProcess process error
+ errMsgProcessProviderProcess = "error in credential_process"
+
+ // errMsgProcessProviderParse problem parsing output
+ errMsgProcessProviderParse = "parse failed of credential_process output"
+
+ // errMsgProcessProviderVersion version error in output
+ errMsgProcessProviderVersion = "wrong version in process output (not 1)"
+
+ // errMsgProcessProviderMissKey missing access key id in output
+ errMsgProcessProviderMissKey = "missing AccessKeyId in process output"
+
+ // errMsgProcessProviderMissSecret missing secret acess key in output
+ errMsgProcessProviderMissSecret = "missing SecretAccessKey in process output"
+
+ // errMsgProcessProviderPrepareCmd prepare of command failed
+ errMsgProcessProviderPrepareCmd = "failed to prepare command"
+
+ // errMsgProcessProviderEmptyCmd command must not be empty
+ errMsgProcessProviderEmptyCmd = "command must not be empty"
+
+ // errMsgProcessProviderPipe failed to initialize pipe
+ errMsgProcessProviderPipe = "failed to initialize pipe"
+
+ // DefaultDuration is the default amount of time in minutes that the
+ // credentials will be valid for.
+ DefaultDuration = time.Duration(15) * time.Minute
+
+ // DefaultBufSize limits buffer size from growing to an enormous
+ // amount due to a faulty process.
+ DefaultBufSize = 1024
+
+ // DefaultTimeout default limit on time a process can run.
+ DefaultTimeout = time.Duration(1) * time.Minute
+)
+
+// ProcessProvider satisfies the credentials.Provider interface, and is a
+// client to retrieve credentials from a process.
+type ProcessProvider struct {
+ staticCreds bool
+ credentials.Expiry
+ originalCommand []string
+
+ // Expiry duration of the credentials. Defaults to 15 minutes if not set.
+ Duration time.Duration
+
+ // ExpiryWindow will allow the credentials to trigger refreshing prior to
+ // the credentials actually expiring. This is beneficial so race conditions
+ // with expiring credentials do not cause request to fail unexpectedly
+ // due to ExpiredTokenException exceptions.
+ //
+ // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
+ // 10 seconds before the credentials are actually expired.
+ //
+ // If ExpiryWindow is 0 or less it will be ignored.
+ ExpiryWindow time.Duration
+
+ // A string representing an os command that should return a JSON with
+ // credential information.
+ command *exec.Cmd
+
+ // MaxBufSize limits memory usage from growing to an enormous
+ // amount due to a faulty process.
+ MaxBufSize int
+
+ // Timeout limits the time a process can run.
+ Timeout time.Duration
+}
+
+// NewCredentials returns a pointer to a new Credentials object wrapping the
+// ProcessProvider. The credentials will expire every 15 minutes by default.
+func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials {
+ p := &ProcessProvider{
+ command: exec.Command(command),
+ Duration: DefaultDuration,
+ Timeout: DefaultTimeout,
+ MaxBufSize: DefaultBufSize,
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
+}
+
+// NewCredentialsTimeout returns a pointer to a new Credentials object with
+// the specified command and timeout, and default duration and max buffer size.
+func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials {
+ p := NewCredentials(command, func(opt *ProcessProvider) {
+ opt.Timeout = timeout
+ })
+
+ return p
+}
+
+// NewCredentialsCommand returns a pointer to a new Credentials object with
+// the specified command, and default timeout, duration and max buffer size.
+func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials {
+ p := &ProcessProvider{
+ command: command,
+ Duration: DefaultDuration,
+ Timeout: DefaultTimeout,
+ MaxBufSize: DefaultBufSize,
+ }
+
+ for _, option := range options {
+ option(p)
+ }
+
+ return credentials.NewCredentials(p)
+}
+
+type credentialProcessResponse struct {
+ Version int
+ AccessKeyID string `json:"AccessKeyId"`
+ SecretAccessKey string
+ SessionToken string
+ Expiration *time.Time
+}
+
+// Retrieve executes the 'credential_process' and returns the credentials.
+func (p *ProcessProvider) Retrieve() (credentials.Value, error) {
+ out, err := p.executeCredentialProcess()
+ if err != nil {
+ return credentials.Value{ProviderName: ProviderName}, err
+ }
+
+ // Serialize and validate response
+ resp := &credentialProcessResponse{}
+ if err = json.Unmarshal(out, resp); err != nil {
+ return credentials.Value{ProviderName: ProviderName}, awserr.New(
+ ErrCodeProcessProviderParse,
+ fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)),
+ err)
+ }
+
+ if resp.Version != 1 {
+ return credentials.Value{ProviderName: ProviderName}, awserr.New(
+ ErrCodeProcessProviderVersion,
+ errMsgProcessProviderVersion,
+ nil)
+ }
+
+ if len(resp.AccessKeyID) == 0 {
+ return credentials.Value{ProviderName: ProviderName}, awserr.New(
+ ErrCodeProcessProviderRequired,
+ errMsgProcessProviderMissKey,
+ nil)
+ }
+
+ if len(resp.SecretAccessKey) == 0 {
+ return credentials.Value{ProviderName: ProviderName}, awserr.New(
+ ErrCodeProcessProviderRequired,
+ errMsgProcessProviderMissSecret,
+ nil)
+ }
+
+ // Handle expiration
+ p.staticCreds = resp.Expiration == nil
+ if resp.Expiration != nil {
+ p.SetExpiration(*resp.Expiration, p.ExpiryWindow)
+ }
+
+ return credentials.Value{
+ ProviderName: ProviderName,
+ AccessKeyID: resp.AccessKeyID,
+ SecretAccessKey: resp.SecretAccessKey,
+ SessionToken: resp.SessionToken,
+ }, nil
+}
+
+// IsExpired returns true if the credentials retrieved are expired, or not yet
+// retrieved.
+func (p *ProcessProvider) IsExpired() bool {
+ if p.staticCreds {
+ return false
+ }
+ return p.Expiry.IsExpired()
+}
+
+// prepareCommand prepares the command to be executed.
+func (p *ProcessProvider) prepareCommand() error {
+
+ var cmdArgs []string
+ if runtime.GOOS == "windows" {
+ cmdArgs = []string{"cmd.exe", "/C"}
+ } else {
+ cmdArgs = []string{"sh", "-c"}
+ }
+
+ if len(p.originalCommand) == 0 {
+ p.originalCommand = make([]string, len(p.command.Args))
+ copy(p.originalCommand, p.command.Args)
+
+ // check for empty command because it succeeds
+ if len(strings.TrimSpace(p.originalCommand[0])) < 1 {
+ return awserr.New(
+ ErrCodeProcessProviderExecution,
+ fmt.Sprintf(
+ "%s: %s",
+ errMsgProcessProviderPrepareCmd,
+ errMsgProcessProviderEmptyCmd),
+ nil)
+ }
+ }
+
+ cmdArgs = append(cmdArgs, p.originalCommand...)
+ p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...)
+ p.command.Env = os.Environ()
+
+ return nil
+}
+
+// executeCredentialProcess starts the credential process on the OS and
+// returns the results or an error.
+func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) {
+
+ if err := p.prepareCommand(); err != nil {
+ return nil, err
+ }
+
+ // Setup the pipes
+ outReadPipe, outWritePipe, err := os.Pipe()
+ if err != nil {
+ return nil, awserr.New(
+ ErrCodeProcessProviderExecution,
+ errMsgProcessProviderPipe,
+ err)
+ }
+
+ p.command.Stderr = os.Stderr // display stderr on console for MFA
+ p.command.Stdout = outWritePipe // get creds json on process's stdout
+ p.command.Stdin = os.Stdin // enable stdin for MFA
+
+ output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize))
+
+ stdoutCh := make(chan error, 1)
+ go readInput(
+ io.LimitReader(outReadPipe, int64(p.MaxBufSize)),
+ output,
+ stdoutCh)
+
+ execCh := make(chan error, 1)
+ go executeCommand(*p.command, execCh)
+
+ finished := false
+ var errors []error
+ for !finished {
+ select {
+ case readError := <-stdoutCh:
+ errors = appendError(errors, readError)
+ finished = true
+ case execError := <-execCh:
+ err := outWritePipe.Close()
+ errors = appendError(errors, err)
+ errors = appendError(errors, execError)
+ if errors != nil {
+ return output.Bytes(), awserr.NewBatchError(
+ ErrCodeProcessProviderExecution,
+ errMsgProcessProviderProcess,
+ errors)
+ }
+ case <-time.After(p.Timeout):
+ finished = true
+ return output.Bytes(), awserr.NewBatchError(
+ ErrCodeProcessProviderExecution,
+ errMsgProcessProviderTimeout,
+ errors) // errors can be nil
+ }
+ }
+
+ out := output.Bytes()
+
+ if runtime.GOOS == "windows" {
+ // windows adds slashes to quotes
+ out = []byte(strings.Replace(string(out), `\"`, `"`, -1))
+ }
+
+ return out, nil
+}
+
+// appendError conveniently checks for nil before appending slice
+func appendError(errors []error, err error) []error {
+ if err != nil {
+ return append(errors, err)
+ }
+ return errors
+}
+
+func executeCommand(cmd exec.Cmd, exec chan error) {
+ // Start the command
+ err := cmd.Start()
+ if err == nil {
+ err = cmd.Wait()
+ }
+
+ exec <- err
+}
+
+func readInput(r io.Reader, w io.Writer, read chan error) {
+ tee := io.TeeReader(r, w)
+
+ _, err := ioutil.ReadAll(tee)
+
+ if err == io.EOF {
+ err = nil
+ }
+
+ read <- err // will only arrive here when write end of pipe is closed
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
index 51e21e0f3..e15514958 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
@@ -4,9 +4,8 @@ import (
"fmt"
"os"
- "github.com/go-ini/ini"
-
"github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/internal/ini"
"github.com/aws/aws-sdk-go/internal/shareddefaults"
)
@@ -77,36 +76,37 @@ func (p *SharedCredentialsProvider) IsExpired() bool {
// The credentials retrieved from the profile will be returned or error. Error will be
// returned if it fails to read from the file, or the data is invalid.
func loadProfile(filename, profile string) (Value, error) {
- config, err := ini.Load(filename)
+ config, err := ini.OpenFile(filename)
if err != nil {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err)
}
- iniProfile, err := config.GetSection(profile)
- if err != nil {
- return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", err)
+
+ iniProfile, ok := config.GetSection(profile)
+ if !ok {
+ return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsLoad", "failed to get profile", nil)
}
- id, err := iniProfile.GetKey("aws_access_key_id")
- if err != nil {
+ id := iniProfile.String("aws_access_key_id")
+ if len(id) == 0 {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsAccessKey",
fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename),
- err)
+ nil)
}
- secret, err := iniProfile.GetKey("aws_secret_access_key")
- if err != nil {
+ secret := iniProfile.String("aws_secret_access_key")
+ if len(secret) == 0 {
return Value{ProviderName: SharedCredsProviderName}, awserr.New("SharedCredsSecret",
fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename),
nil)
}
// Default to empty string if not found
- token := iniProfile.Key("aws_session_token")
+ token := iniProfile.String("aws_session_token")
return Value{
- AccessKeyID: id.String(),
- SecretAccessKey: secret.String(),
- SessionToken: token.String(),
+ AccessKeyID: id,
+ SecretAccessKey: secret,
+ SessionToken: token,
ProviderName: SharedCredsProviderName,
}, nil
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go
index 4f5dab3fc..531139e39 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go
@@ -9,8 +9,6 @@ const StaticProviderName = "StaticProvider"
var (
// ErrStaticCredentialsEmpty is emitted when static credentials are empty.
- //
- // @readonly
ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil)
)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
index 4108e433e..2e528d130 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
@@ -80,16 +80,18 @@ package stscreds
import (
"fmt"
+ "os"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
+ "github.com/aws/aws-sdk-go/internal/sdkrand"
"github.com/aws/aws-sdk-go/service/sts"
)
-// StdinTokenProvider will prompt on stdout and read from stdin for a string value.
+// StdinTokenProvider will prompt on stderr and read from stdin for a string value.
// An error is returned if reading from stdin fails.
//
// Use this function go read MFA tokens from stdin. The function makes no attempt
@@ -102,7 +104,7 @@ import (
// Will wait forever until something is provided on the stdin.
func StdinTokenProvider() (string, error) {
var v string
- fmt.Printf("Assume Role MFA token code: ")
+ fmt.Fprintf(os.Stderr, "Assume Role MFA token code: ")
_, err := fmt.Scanln(&v)
return v, err
@@ -193,6 +195,18 @@ type AssumeRoleProvider struct {
//
// If ExpiryWindow is 0 or less it will be ignored.
ExpiryWindow time.Duration
+
+ // MaxJitterFrac reduces the effective Duration of each credential requested
+ // by a random percentage between 0 and MaxJitterFraction. MaxJitterFrac must
+ // have a value between 0 and 1. Any other value may lead to expected behavior.
+ // With a MaxJitterFrac value of 0, default) will no jitter will be used.
+ //
+ // For example, with a Duration of 30m and a MaxJitterFrac of 0.1, the
+ // AssumeRole call will be made with an arbitrary Duration between 27m and
+ // 30m.
+ //
+ // MaxJitterFrac should not be negative.
+ MaxJitterFrac float64
}
// NewCredentials returns a pointer to a new Credentials object wrapping the
@@ -244,7 +258,6 @@ func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*
// Retrieve generates a new set of temporary credentials using STS.
func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
-
// Apply defaults where parameters are not set.
if p.RoleSessionName == "" {
// Try to work out a role name that will hopefully end up unique.
@@ -254,8 +267,9 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
// Expire as often as AWS permits.
p.Duration = DefaultDuration
}
+ jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration))
input := &sts.AssumeRoleInput{
- DurationSeconds: aws.Int64(int64(p.Duration / time.Second)),
+ DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)),
RoleArn: aws.String(p.RoleARN),
RoleSessionName: aws.String(p.RoleSessionName),
ExternalId: p.ExternalID,
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go
new file mode 100644
index 000000000..20510d9ae
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go
@@ -0,0 +1,97 @@
+package stscreds
+
+import (
+ "fmt"
+ "io/ioutil"
+ "strconv"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/client"
+ "github.com/aws/aws-sdk-go/aws/credentials"
+ "github.com/aws/aws-sdk-go/service/sts"
+ "github.com/aws/aws-sdk-go/service/sts/stsiface"
+)
+
+const (
+ // ErrCodeWebIdentity will be used as an error code when constructing
+ // a new error to be returned during session creation or retrieval.
+ ErrCodeWebIdentity = "WebIdentityErr"
+
+ // WebIdentityProviderName is the web identity provider name
+ WebIdentityProviderName = "WebIdentityCredentials"
+)
+
+// now is used to return a time.Time object representing
+// the current time. This can be used to easily test and
+// compare test values.
+var now = time.Now
+
+// WebIdentityRoleProvider is used to retrieve credentials using
+// an OIDC token.
+type WebIdentityRoleProvider struct {
+ credentials.Expiry
+
+ client stsiface.STSAPI
+ ExpiryWindow time.Duration
+
+ tokenFilePath string
+ roleARN string
+ roleSessionName string
+}
+
+// NewWebIdentityCredentials will return a new set of credentials with a given
+// configuration, role arn, and token file path.
+func NewWebIdentityCredentials(c client.ConfigProvider, roleARN, roleSessionName, path string) *credentials.Credentials {
+ svc := sts.New(c)
+ p := NewWebIdentityRoleProvider(svc, roleARN, roleSessionName, path)
+ return credentials.NewCredentials(p)
+}
+
+// NewWebIdentityRoleProvider will return a new WebIdentityRoleProvider with the
+// provided stsiface.STSAPI
+func NewWebIdentityRoleProvider(svc stsiface.STSAPI, roleARN, roleSessionName, path string) *WebIdentityRoleProvider {
+ return &WebIdentityRoleProvider{
+ client: svc,
+ tokenFilePath: path,
+ roleARN: roleARN,
+ roleSessionName: roleSessionName,
+ }
+}
+
+// Retrieve will attempt to assume a role from a token which is located at
+// 'WebIdentityTokenFilePath' specified destination and if that is empty an
+// error will be returned.
+func (p *WebIdentityRoleProvider) Retrieve() (credentials.Value, error) {
+ b, err := ioutil.ReadFile(p.tokenFilePath)
+ if err != nil {
+ errMsg := fmt.Sprintf("unable to read file at %s", p.tokenFilePath)
+ return credentials.Value{}, awserr.New(ErrCodeWebIdentity, errMsg, err)
+ }
+
+ sessionName := p.roleSessionName
+ if len(sessionName) == 0 {
+ // session name is used to uniquely identify a session. This simply
+ // uses unix time in nanoseconds to uniquely identify sessions.
+ sessionName = strconv.FormatInt(now().UnixNano(), 10)
+ }
+ resp, err := p.client.AssumeRoleWithWebIdentity(&sts.AssumeRoleWithWebIdentityInput{
+ RoleArn: &p.roleARN,
+ RoleSessionName: &sessionName,
+ WebIdentityToken: aws.String(string(b)),
+ })
+ if err != nil {
+ return credentials.Value{}, awserr.New(ErrCodeWebIdentity, "failed to retrieve credentials", err)
+ }
+
+ p.SetExpiration(aws.TimeValue(resp.Credentials.Expiration), p.ExpiryWindow)
+
+ value := credentials.Value{
+ AccessKeyID: aws.StringValue(resp.Credentials.AccessKeyId),
+ SecretAccessKey: aws.StringValue(resp.Credentials.SecretAccessKey),
+ SessionToken: aws.StringValue(resp.Credentials.SessionToken),
+ ProviderName: WebIdentityProviderName,
+ }
+ return value, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/crr/cache.go b/vendor/github.com/aws/aws-sdk-go/aws/crr/cache.go
new file mode 100644
index 000000000..a00ab6c67
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/crr/cache.go
@@ -0,0 +1,119 @@
+package crr
+
+import (
+ "sync/atomic"
+)
+
+// EndpointCache is an LRU cache that holds a series of endpoints
+// based on some key. The datastructure makes use of a read write
+// mutex to enable asynchronous use.
+type EndpointCache struct {
+ endpoints syncMap
+ endpointLimit int64
+ // size is used to count the number elements in the cache.
+ // The atomic package is used to ensure this size is accurate when
+ // using multiple goroutines.
+ size int64
+}
+
+// NewEndpointCache will return a newly initialized cache with a limit
+// of endpointLimit entries.
+func NewEndpointCache(endpointLimit int64) *EndpointCache {
+ return &EndpointCache{
+ endpointLimit: endpointLimit,
+ endpoints: newSyncMap(),
+ }
+}
+
+// get is a concurrent safe get operation that will retrieve an endpoint
+// based on endpointKey. A boolean will also be returned to illustrate whether
+// or not the endpoint had been found.
+func (c *EndpointCache) get(endpointKey string) (Endpoint, bool) {
+ endpoint, ok := c.endpoints.Load(endpointKey)
+ if !ok {
+ return Endpoint{}, false
+ }
+
+ c.endpoints.Store(endpointKey, endpoint)
+ return endpoint.(Endpoint), true
+}
+
+// Has returns if the enpoint cache contains a valid entry for the endpoint key
+// provided.
+func (c *EndpointCache) Has(endpointKey string) bool {
+ endpoint, ok := c.get(endpointKey)
+ _, found := endpoint.GetValidAddress()
+
+ return ok && found
+}
+
+// Get will retrieve a weighted address based off of the endpoint key. If an endpoint
+// should be retrieved, due to not existing or the current endpoint has expired
+// the Discoverer object that was passed in will attempt to discover a new endpoint
+// and add that to the cache.
+func (c *EndpointCache) Get(d Discoverer, endpointKey string, required bool) (WeightedAddress, error) {
+ var err error
+ endpoint, ok := c.get(endpointKey)
+ weighted, found := endpoint.GetValidAddress()
+ shouldGet := !ok || !found
+
+ if required && shouldGet {
+ if endpoint, err = c.discover(d, endpointKey); err != nil {
+ return WeightedAddress{}, err
+ }
+
+ weighted, _ = endpoint.GetValidAddress()
+ } else if shouldGet {
+ go c.discover(d, endpointKey)
+ }
+
+ return weighted, nil
+}
+
+// Add is a concurrent safe operation that will allow new endpoints to be added
+// to the cache. If the cache is full, the number of endpoints equal endpointLimit,
+// then this will remove the oldest entry before adding the new endpoint.
+func (c *EndpointCache) Add(endpoint Endpoint) {
+ // de-dups multiple adds of an endpoint with a pre-existing key
+ if iface, ok := c.endpoints.Load(endpoint.Key); ok {
+ e := iface.(Endpoint)
+ if e.Len() > 0 {
+ return
+ }
+ }
+ c.endpoints.Store(endpoint.Key, endpoint)
+
+ size := atomic.AddInt64(&c.size, 1)
+ if size > 0 && size > c.endpointLimit {
+ c.deleteRandomKey()
+ }
+}
+
+// deleteRandomKey will delete a random key from the cache. If
+// no key was deleted false will be returned.
+func (c *EndpointCache) deleteRandomKey() bool {
+ atomic.AddInt64(&c.size, -1)
+ found := false
+
+ c.endpoints.Range(func(key, value interface{}) bool {
+ found = true
+ c.endpoints.Delete(key)
+
+ return false
+ })
+
+ return found
+}
+
+// discover will get and store and endpoint using the Discoverer.
+func (c *EndpointCache) discover(d Discoverer, endpointKey string) (Endpoint, error) {
+ endpoint, err := d.Discover()
+ if err != nil {
+ return Endpoint{}, err
+ }
+
+ endpoint.Key = endpointKey
+ c.Add(endpoint)
+
+ return endpoint, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/crr/endpoint.go b/vendor/github.com/aws/aws-sdk-go/aws/crr/endpoint.go
new file mode 100644
index 000000000..d5599188e
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/crr/endpoint.go
@@ -0,0 +1,99 @@
+package crr
+
+import (
+ "net/url"
+ "sort"
+ "strings"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws"
+)
+
+// Endpoint represents an endpoint used in endpoint discovery.
+type Endpoint struct {
+ Key string
+ Addresses WeightedAddresses
+}
+
+// WeightedAddresses represents a list of WeightedAddress.
+type WeightedAddresses []WeightedAddress
+
+// WeightedAddress represents an address with a given weight.
+type WeightedAddress struct {
+ URL *url.URL
+ Expired time.Time
+}
+
+// HasExpired will return whether or not the endpoint has expired with
+// the exception of a zero expiry meaning does not expire.
+func (e WeightedAddress) HasExpired() bool {
+ return e.Expired.Before(time.Now())
+}
+
+// Add will add a given WeightedAddress to the address list of Endpoint.
+func (e *Endpoint) Add(addr WeightedAddress) {
+ e.Addresses = append(e.Addresses, addr)
+}
+
+// Len returns the number of valid endpoints where valid means the endpoint
+// has not expired.
+func (e *Endpoint) Len() int {
+ validEndpoints := 0
+ for _, endpoint := range e.Addresses {
+ if endpoint.HasExpired() {
+ continue
+ }
+
+ validEndpoints++
+ }
+ return validEndpoints
+}
+
+// GetValidAddress will return a non-expired weight endpoint
+func (e *Endpoint) GetValidAddress() (WeightedAddress, bool) {
+ for i := 0; i < len(e.Addresses); i++ {
+ we := e.Addresses[i]
+
+ if we.HasExpired() {
+ e.Addresses = append(e.Addresses[:i], e.Addresses[i+1:]...)
+ i--
+ continue
+ }
+
+ return we, true
+ }
+
+ return WeightedAddress{}, false
+}
+
+// Discoverer is an interface used to discovery which endpoint hit. This
+// allows for specifics about what parameters need to be used to be contained
+// in the Discoverer implementor.
+type Discoverer interface {
+ Discover() (Endpoint, error)
+}
+
+// BuildEndpointKey will sort the keys in alphabetical order and then retrieve
+// the values in that order. Those values are then concatenated together to form
+// the endpoint key.
+func BuildEndpointKey(params map[string]*string) string {
+ keys := make([]string, len(params))
+ i := 0
+
+ for k := range params {
+ keys[i] = k
+ i++
+ }
+ sort.Strings(keys)
+
+ values := make([]string, len(params))
+ for i, k := range keys {
+ if params[k] == nil {
+ continue
+ }
+
+ values[i] = aws.StringValue(params[k])
+ }
+
+ return strings.Join(values, ".")
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map.go b/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map.go
new file mode 100644
index 000000000..e414eaace
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map.go
@@ -0,0 +1,29 @@
+// +build go1.9
+
+package crr
+
+import (
+ "sync"
+)
+
+type syncMap sync.Map
+
+func newSyncMap() syncMap {
+ return syncMap{}
+}
+
+func (m *syncMap) Load(key interface{}) (interface{}, bool) {
+ return (*sync.Map)(m).Load(key)
+}
+
+func (m *syncMap) Store(key interface{}, value interface{}) {
+ (*sync.Map)(m).Store(key, value)
+}
+
+func (m *syncMap) Delete(key interface{}) {
+ (*sync.Map)(m).Delete(key)
+}
+
+func (m *syncMap) Range(f func(interface{}, interface{}) bool) {
+ (*sync.Map)(m).Range(f)
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map_1_8.go b/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map_1_8.go
new file mode 100644
index 000000000..e0b122008
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/crr/sync_map_1_8.go
@@ -0,0 +1,48 @@
+// +build !go1.9
+
+package crr
+
+import (
+ "sync"
+)
+
+type syncMap struct {
+ container map[interface{}]interface{}
+ lock sync.RWMutex
+}
+
+func newSyncMap() syncMap {
+ return syncMap{
+ container: map[interface{}]interface{}{},
+ }
+}
+
+func (m *syncMap) Load(key interface{}) (interface{}, bool) {
+ m.lock.RLock()
+ defer m.lock.RUnlock()
+
+ v, ok := m.container[key]
+ return v, ok
+}
+
+func (m *syncMap) Store(key interface{}, value interface{}) {
+ m.lock.Lock()
+ defer m.lock.Unlock()
+
+ m.container[key] = value
+}
+
+func (m *syncMap) Delete(key interface{}) {
+ m.lock.Lock()
+ defer m.lock.Unlock()
+
+ delete(m.container, key)
+}
+
+func (m *syncMap) Range(f func(interface{}, interface{}) bool) {
+ for k, v := range m.container {
+ if !f(k, v) {
+ return
+ }
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
new file mode 100644
index 000000000..25a66d1dd
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go
@@ -0,0 +1,69 @@
+// Package csm provides the Client Side Monitoring (CSM) client which enables
+// sending metrics via UDP connection to the CSM agent. This package provides
+// control options, and configuration for the CSM client. The client can be
+// controlled manually, or automatically via the SDK's Session configuration.
+//
+// Enabling CSM client via SDK's Session configuration
+//
+// The CSM client can be enabled automatically via SDK's Session configuration.
+// The SDK's session configuration enables the CSM client if the AWS_CSM_PORT
+// environment variable is set to a non-empty value.
+//
+// The configuration options for the CSM client via the SDK's session
+// configuration are:
+//
+// * AWS_CSM_PORT=
+// The port number the CSM agent will receive metrics on.
+//
+// * AWS_CSM_HOST=
+// The hostname, or IP address the CSM agent will receive metrics on.
+// Without port number.
+//
+// Manually enabling the CSM client
+//
+// The CSM client can be started, paused, and resumed manually. The Start
+// function will enable the CSM client to publish metrics to the CSM agent. It
+// is safe to call Start concurrently, but if Start is called additional times
+// with different ClientID or address it will panic.
+//
+// r, err := csm.Start("clientID", ":31000")
+// if err != nil {
+// panic(fmt.Errorf("failed starting CSM: %v", err))
+// }
+//
+// When controlling the CSM client manually, you must also inject its request
+// handlers into the SDK's Session configuration for the SDK's API clients to
+// publish metrics.
+//
+// sess, err := session.NewSession(&aws.Config{})
+// if err != nil {
+// panic(fmt.Errorf("failed loading session: %v", err))
+// }
+//
+// // Add CSM client's metric publishing request handlers to the SDK's
+// // Session Configuration.
+// r.InjectHandlers(&sess.Handlers)
+//
+// Controlling CSM client
+//
+// Once the CSM client has been enabled the Get function will return a Reporter
+// value that you can use to pause and resume the metrics published to the CSM
+// agent. If Get function is called before the reporter is enabled with the
+// Start function or via SDK's Session configuration nil will be returned.
+//
+// The Pause method can be called to stop the CSM client publishing metrics to
+// the CSM agent. The Continue method will resume metric publishing.
+//
+// // Get the CSM client Reporter.
+// r := csm.Get()
+//
+// // Will pause monitoring
+// r.Pause()
+// resp, err = client.GetObject(&s3.GetObjectInput{
+// Bucket: aws.String("bucket"),
+// Key: aws.String("key"),
+// })
+//
+// // Resume monitoring
+// r.Continue()
+package csm
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go
new file mode 100644
index 000000000..4b19e2800
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go
@@ -0,0 +1,89 @@
+package csm
+
+import (
+ "fmt"
+ "strings"
+ "sync"
+)
+
+var (
+ lock sync.Mutex
+)
+
+const (
+ // DefaultPort is used when no port is specified.
+ DefaultPort = "31000"
+
+ // DefaultHost is the host that will be used when none is specified.
+ DefaultHost = "127.0.0.1"
+)
+
+// AddressWithDefaults returns a CSM address built from the host and port
+// values. If the host or port is not set, default values will be used
+// instead. If host is "localhost" it will be replaced with "127.0.0.1".
+func AddressWithDefaults(host, port string) string {
+ if len(host) == 0 || strings.EqualFold(host, "localhost") {
+ host = DefaultHost
+ }
+
+ if len(port) == 0 {
+ port = DefaultPort
+ }
+
+ // Only IP6 host can contain a colon
+ if strings.Contains(host, ":") {
+ return "[" + host + "]:" + port
+ }
+
+ return host + ":" + port
+}
+
+// Start will start a long running go routine to capture
+// client side metrics. Calling start multiple time will only
+// start the metric listener once and will panic if a different
+// client ID or port is passed in.
+//
+// r, err := csm.Start("clientID", "127.0.0.1:31000")
+// if err != nil {
+// panic(fmt.Errorf("expected no error, but received %v", err))
+// }
+// sess := session.NewSession()
+// r.InjectHandlers(sess.Handlers)
+//
+// svc := s3.New(sess)
+// out, err := svc.GetObject(&s3.GetObjectInput{
+// Bucket: aws.String("bucket"),
+// Key: aws.String("key"),
+// })
+func Start(clientID string, url string) (*Reporter, error) {
+ lock.Lock()
+ defer lock.Unlock()
+
+ if sender == nil {
+ sender = newReporter(clientID, url)
+ } else {
+ if sender.clientID != clientID {
+ panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID))
+ }
+
+ if sender.url != url {
+ panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url))
+ }
+ }
+
+ if err := connect(url); err != nil {
+ sender = nil
+ return nil, err
+ }
+
+ return sender, nil
+}
+
+// Get will return a reporter if one exists, if one does not exist, nil will
+// be returned.
+func Get() *Reporter {
+ lock.Lock()
+ defer lock.Unlock()
+
+ return sender
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go
new file mode 100644
index 000000000..5bacc791a
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric.go
@@ -0,0 +1,109 @@
+package csm
+
+import (
+ "strconv"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws"
+)
+
+type metricTime time.Time
+
+func (t metricTime) MarshalJSON() ([]byte, error) {
+ ns := time.Duration(time.Time(t).UnixNano())
+ return []byte(strconv.FormatInt(int64(ns/time.Millisecond), 10)), nil
+}
+
+type metric struct {
+ ClientID *string `json:"ClientId,omitempty"`
+ API *string `json:"Api,omitempty"`
+ Service *string `json:"Service,omitempty"`
+ Timestamp *metricTime `json:"Timestamp,omitempty"`
+ Type *string `json:"Type,omitempty"`
+ Version *int `json:"Version,omitempty"`
+
+ AttemptCount *int `json:"AttemptCount,omitempty"`
+ Latency *int `json:"Latency,omitempty"`
+
+ Fqdn *string `json:"Fqdn,omitempty"`
+ UserAgent *string `json:"UserAgent,omitempty"`
+ AttemptLatency *int `json:"AttemptLatency,omitempty"`
+
+ SessionToken *string `json:"SessionToken,omitempty"`
+ Region *string `json:"Region,omitempty"`
+ AccessKey *string `json:"AccessKey,omitempty"`
+ HTTPStatusCode *int `json:"HttpStatusCode,omitempty"`
+ XAmzID2 *string `json:"XAmzId2,omitempty"`
+ XAmzRequestID *string `json:"XAmznRequestId,omitempty"`
+
+ AWSException *string `json:"AwsException,omitempty"`
+ AWSExceptionMessage *string `json:"AwsExceptionMessage,omitempty"`
+ SDKException *string `json:"SdkException,omitempty"`
+ SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"`
+
+ FinalHTTPStatusCode *int `json:"FinalHttpStatusCode,omitempty"`
+ FinalAWSException *string `json:"FinalAwsException,omitempty"`
+ FinalAWSExceptionMessage *string `json:"FinalAwsExceptionMessage,omitempty"`
+ FinalSDKException *string `json:"FinalSdkException,omitempty"`
+ FinalSDKExceptionMessage *string `json:"FinalSdkExceptionMessage,omitempty"`
+
+ DestinationIP *string `json:"DestinationIp,omitempty"`
+ ConnectionReused *int `json:"ConnectionReused,omitempty"`
+
+ AcquireConnectionLatency *int `json:"AcquireConnectionLatency,omitempty"`
+ ConnectLatency *int `json:"ConnectLatency,omitempty"`
+ RequestLatency *int `json:"RequestLatency,omitempty"`
+ DNSLatency *int `json:"DnsLatency,omitempty"`
+ TCPLatency *int `json:"TcpLatency,omitempty"`
+ SSLLatency *int `json:"SslLatency,omitempty"`
+
+ MaxRetriesExceeded *int `json:"MaxRetriesExceeded,omitempty"`
+}
+
+func (m *metric) TruncateFields() {
+ m.ClientID = truncateString(m.ClientID, 255)
+ m.UserAgent = truncateString(m.UserAgent, 256)
+
+ m.AWSException = truncateString(m.AWSException, 128)
+ m.AWSExceptionMessage = truncateString(m.AWSExceptionMessage, 512)
+
+ m.SDKException = truncateString(m.SDKException, 128)
+ m.SDKExceptionMessage = truncateString(m.SDKExceptionMessage, 512)
+
+ m.FinalAWSException = truncateString(m.FinalAWSException, 128)
+ m.FinalAWSExceptionMessage = truncateString(m.FinalAWSExceptionMessage, 512)
+
+ m.FinalSDKException = truncateString(m.FinalSDKException, 128)
+ m.FinalSDKExceptionMessage = truncateString(m.FinalSDKExceptionMessage, 512)
+}
+
+func truncateString(v *string, l int) *string {
+ if v != nil && len(*v) > l {
+ nv := (*v)[:l]
+ return &nv
+ }
+
+ return v
+}
+
+func (m *metric) SetException(e metricException) {
+ switch te := e.(type) {
+ case awsException:
+ m.AWSException = aws.String(te.exception)
+ m.AWSExceptionMessage = aws.String(te.message)
+ case sdkException:
+ m.SDKException = aws.String(te.exception)
+ m.SDKExceptionMessage = aws.String(te.message)
+ }
+}
+
+func (m *metric) SetFinalException(e metricException) {
+ switch te := e.(type) {
+ case awsException:
+ m.FinalAWSException = aws.String(te.exception)
+ m.FinalAWSExceptionMessage = aws.String(te.message)
+ case sdkException:
+ m.FinalSDKException = aws.String(te.exception)
+ m.FinalSDKExceptionMessage = aws.String(te.message)
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go
new file mode 100644
index 000000000..514fc3739
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go
@@ -0,0 +1,54 @@
+package csm
+
+import (
+ "sync/atomic"
+)
+
+const (
+ runningEnum = iota
+ pausedEnum
+)
+
+var (
+ // MetricsChannelSize of metrics to hold in the channel
+ MetricsChannelSize = 100
+)
+
+type metricChan struct {
+ ch chan metric
+ paused int64
+}
+
+func newMetricChan(size int) metricChan {
+ return metricChan{
+ ch: make(chan metric, size),
+ }
+}
+
+func (ch *metricChan) Pause() {
+ atomic.StoreInt64(&ch.paused, pausedEnum)
+}
+
+func (ch *metricChan) Continue() {
+ atomic.StoreInt64(&ch.paused, runningEnum)
+}
+
+func (ch *metricChan) IsPaused() bool {
+ v := atomic.LoadInt64(&ch.paused)
+ return v == pausedEnum
+}
+
+// Push will push metrics to the metric channel if the channel
+// is not paused
+func (ch *metricChan) Push(m metric) bool {
+ if ch.IsPaused() {
+ return false
+ }
+
+ select {
+ case ch.ch <- m:
+ return true
+ default:
+ return false
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go
new file mode 100644
index 000000000..54a99280c
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/metric_exception.go
@@ -0,0 +1,26 @@
+package csm
+
+type metricException interface {
+ Exception() string
+ Message() string
+}
+
+type requestException struct {
+ exception string
+ message string
+}
+
+func (e requestException) Exception() string {
+ return e.exception
+}
+func (e requestException) Message() string {
+ return e.message
+}
+
+type awsException struct {
+ requestException
+}
+
+type sdkException struct {
+ requestException
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go
new file mode 100644
index 000000000..c7008d8c3
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go
@@ -0,0 +1,265 @@
+package csm
+
+import (
+ "encoding/json"
+ "net"
+ "time"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// Reporter will gather metrics of API requests made and
+// send those metrics to the CSM endpoint.
+type Reporter struct {
+ clientID string
+ url string
+ conn net.Conn
+ metricsCh metricChan
+ done chan struct{}
+}
+
+var (
+ sender *Reporter
+)
+
+func connect(url string) error {
+ const network = "udp"
+ if err := sender.connect(network, url); err != nil {
+ return err
+ }
+
+ if sender.done == nil {
+ sender.done = make(chan struct{})
+ go sender.start()
+ }
+
+ return nil
+}
+
+func newReporter(clientID, url string) *Reporter {
+ return &Reporter{
+ clientID: clientID,
+ url: url,
+ metricsCh: newMetricChan(MetricsChannelSize),
+ }
+}
+
+func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) {
+ if rep == nil {
+ return
+ }
+
+ now := time.Now()
+ creds, _ := r.Config.Credentials.Get()
+
+ m := metric{
+ ClientID: aws.String(rep.clientID),
+ API: aws.String(r.Operation.Name),
+ Service: aws.String(r.ClientInfo.ServiceID),
+ Timestamp: (*metricTime)(&now),
+ UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")),
+ Region: r.Config.Region,
+ Type: aws.String("ApiCallAttempt"),
+ Version: aws.Int(1),
+
+ XAmzRequestID: aws.String(r.RequestID),
+
+ AttemptCount: aws.Int(r.RetryCount + 1),
+ AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))),
+ AccessKey: aws.String(creds.AccessKeyID),
+ }
+
+ if r.HTTPResponse != nil {
+ m.HTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode)
+ }
+
+ if r.Error != nil {
+ if awserr, ok := r.Error.(awserr.Error); ok {
+ m.SetException(getMetricException(awserr))
+ }
+ }
+
+ m.TruncateFields()
+ rep.metricsCh.Push(m)
+}
+
+func getMetricException(err awserr.Error) metricException {
+ msg := err.Error()
+ code := err.Code()
+
+ switch code {
+ case "RequestError",
+ request.ErrCodeSerialization,
+ request.CanceledErrorCode:
+ return sdkException{
+ requestException{exception: code, message: msg},
+ }
+ default:
+ return awsException{
+ requestException{exception: code, message: msg},
+ }
+ }
+}
+
+func (rep *Reporter) sendAPICallMetric(r *request.Request) {
+ if rep == nil {
+ return
+ }
+
+ now := time.Now()
+ m := metric{
+ ClientID: aws.String(rep.clientID),
+ API: aws.String(r.Operation.Name),
+ Service: aws.String(r.ClientInfo.ServiceID),
+ Timestamp: (*metricTime)(&now),
+ UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")),
+ Type: aws.String("ApiCall"),
+ AttemptCount: aws.Int(r.RetryCount + 1),
+ Region: r.Config.Region,
+ Latency: aws.Int(int(time.Since(r.Time) / time.Millisecond)),
+ XAmzRequestID: aws.String(r.RequestID),
+ MaxRetriesExceeded: aws.Int(boolIntValue(r.RetryCount >= r.MaxRetries())),
+ }
+
+ if r.HTTPResponse != nil {
+ m.FinalHTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode)
+ }
+
+ if r.Error != nil {
+ if awserr, ok := r.Error.(awserr.Error); ok {
+ m.SetFinalException(getMetricException(awserr))
+ }
+ }
+
+ m.TruncateFields()
+
+ // TODO: Probably want to figure something out for logging dropped
+ // metrics
+ rep.metricsCh.Push(m)
+}
+
+func (rep *Reporter) connect(network, url string) error {
+ if rep.conn != nil {
+ rep.conn.Close()
+ }
+
+ conn, err := net.Dial(network, url)
+ if err != nil {
+ return awserr.New("UDPError", "Could not connect", err)
+ }
+
+ rep.conn = conn
+
+ return nil
+}
+
+func (rep *Reporter) close() {
+ if rep.done != nil {
+ close(rep.done)
+ }
+
+ rep.metricsCh.Pause()
+}
+
+func (rep *Reporter) start() {
+ defer func() {
+ rep.metricsCh.Pause()
+ }()
+
+ for {
+ select {
+ case <-rep.done:
+ rep.done = nil
+ return
+ case m := <-rep.metricsCh.ch:
+ // TODO: What to do with this error? Probably should just log
+ b, err := json.Marshal(m)
+ if err != nil {
+ continue
+ }
+
+ rep.conn.Write(b)
+ }
+ }
+}
+
+// Pause will pause the metric channel preventing any new metrics from being
+// added. It is safe to call concurrently with other calls to Pause, but if
+// called concurently with Continue can lead to unexpected state.
+func (rep *Reporter) Pause() {
+ lock.Lock()
+ defer lock.Unlock()
+
+ if rep == nil {
+ return
+ }
+
+ rep.close()
+}
+
+// Continue will reopen the metric channel and allow for monitoring to be
+// resumed. It is safe to call concurrently with other calls to Continue, but
+// if called concurently with Pause can lead to unexpected state.
+func (rep *Reporter) Continue() {
+ lock.Lock()
+ defer lock.Unlock()
+ if rep == nil {
+ return
+ }
+
+ if !rep.metricsCh.IsPaused() {
+ return
+ }
+
+ rep.metricsCh.Continue()
+}
+
+// Client side metric handler names
+const (
+ APICallMetricHandlerName = "awscsm.SendAPICallMetric"
+ APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric"
+)
+
+// InjectHandlers will will enable client side metrics and inject the proper
+// handlers to handle how metrics are sent.
+//
+// InjectHandlers is NOT safe to call concurrently. Calling InjectHandlers
+// multiple times may lead to unexpected behavior, (e.g. duplicate metrics).
+//
+// // Start must be called in order to inject the correct handlers
+// r, err := csm.Start("clientID", "127.0.0.1:8094")
+// if err != nil {
+// panic(fmt.Errorf("expected no error, but received %v", err))
+// }
+//
+// sess := session.NewSession()
+// r.InjectHandlers(&sess.Handlers)
+//
+// // create a new service client with our client side metric session
+// svc := s3.New(sess)
+func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
+ if rep == nil {
+ return
+ }
+
+ handlers.Complete.PushFrontNamed(request.NamedHandler{
+ Name: APICallMetricHandlerName,
+ Fn: rep.sendAPICallMetric,
+ })
+
+ handlers.CompleteAttempt.PushFrontNamed(request.NamedHandler{
+ Name: APICallAttemptMetricHandlerName,
+ Fn: rep.sendAPICallAttemptMetric,
+ })
+}
+
+// boolIntValue return 1 for true and 0 for false.
+func boolIntValue(b bool) int {
+ if b {
+ return 1
+ }
+
+ return 0
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
index 3cf1036b6..23bb639e0 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
@@ -24,6 +24,7 @@ import (
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/internal/shareddefaults"
)
// A Defaults provides a collection of default values for SDK clients.
@@ -92,17 +93,28 @@ func Handlers() request.Handlers {
func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
return credentials.NewCredentials(&credentials.ChainProvider{
VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
- Providers: []credentials.Provider{
- &credentials.EnvProvider{},
- &credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
- RemoteCredProvider(*cfg, handlers),
- },
+ Providers: CredProviders(cfg, handlers),
})
}
+// CredProviders returns the slice of providers used in
+// the default credential chain.
+//
+// For applications that need to use some other provider (for example use
+// different environment variables for legacy reasons) but still fall back
+// on the default chain of providers. This allows that default chaint to be
+// automatically updated
+func CredProviders(cfg *aws.Config, handlers request.Handlers) []credentials.Provider {
+ return []credentials.Provider{
+ &credentials.EnvProvider{},
+ &credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
+ RemoteCredProvider(*cfg, handlers),
+ }
+}
+
const (
- httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
- ecsCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
+ httpProviderAuthorizationEnvVar = "AWS_CONTAINER_AUTHORIZATION_TOKEN"
+ httpProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_FULL_URI"
)
// RemoteCredProvider returns a credentials provider for the default remote
@@ -112,8 +124,8 @@ func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.P
return localHTTPCredProvider(cfg, handlers, u)
}
- if uri := os.Getenv(ecsCredsProviderEnvVar); len(uri) > 0 {
- u := fmt.Sprintf("http://169.254.170.2%s", uri)
+ if uri := os.Getenv(shareddefaults.ECSCredsProviderEnvVar); len(uri) > 0 {
+ u := fmt.Sprintf("%s%s", shareddefaults.ECSContainerCredentialsURI, uri)
return httpCredProvider(cfg, handlers, u)
}
@@ -176,6 +188,7 @@ func httpCredProvider(cfg aws.Config, handlers request.Handlers, u string) crede
return endpointcreds.NewProviderClient(cfg, handlers, u,
func(p *endpointcreds.Provider) {
p.ExpiryWindow = 5 * time.Minute
+ p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar)
},
)
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
index 984407a58..2c8d5f56d 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
@@ -4,12 +4,12 @@ import (
"encoding/json"
"fmt"
"net/http"
- "path"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/internal/sdkuri"
)
// GetMetadata uses the path provided to request information from the EC2
@@ -19,13 +19,14 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) {
op := &request.Operation{
Name: "GetMetadata",
HTTPMethod: "GET",
- HTTPPath: path.Join("/", "meta-data", p),
+ HTTPPath: sdkuri.PathJoin("/meta-data", p),
}
output := &metadataOutput{}
req := c.NewRequest(op, nil, output)
+ err := req.Send()
- return output.Content, req.Send()
+ return output.Content, err
}
// GetUserData returns the userdata that was configured for the service. If
@@ -35,7 +36,7 @@ func (c *EC2Metadata) GetUserData() (string, error) {
op := &request.Operation{
Name: "GetUserData",
HTTPMethod: "GET",
- HTTPPath: path.Join("/", "user-data"),
+ HTTPPath: "/user-data",
}
output := &metadataOutput{}
@@ -45,8 +46,9 @@ func (c *EC2Metadata) GetUserData() (string, error) {
r.Error = awserr.New("NotFoundError", "user-data not found", r.Error)
}
})
+ err := req.Send()
- return output.Content, req.Send()
+ return output.Content, err
}
// GetDynamicData uses the path provided to request information from the EC2
@@ -56,13 +58,14 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) {
op := &request.Operation{
Name: "GetDynamicData",
HTTPMethod: "GET",
- HTTPPath: path.Join("/", "dynamic", p),
+ HTTPPath: sdkuri.PathJoin("/dynamic", p),
}
output := &metadataOutput{}
req := c.NewRequest(op, nil, output)
+ err := req.Send()
- return output.Content, req.Send()
+ return output.Content, err
}
// GetInstanceIdentityDocument retrieves an identity document describing an
@@ -79,7 +82,7 @@ func (c *EC2Metadata) GetInstanceIdentityDocument() (EC2InstanceIdentityDocument
doc := EC2InstanceIdentityDocument{}
if err := json.NewDecoder(strings.NewReader(resp)).Decode(&doc); err != nil {
return EC2InstanceIdentityDocument{},
- awserr.New("SerializationError",
+ awserr.New(request.ErrCodeSerialization,
"failed to decode EC2 instance identity document", err)
}
@@ -98,7 +101,7 @@ func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) {
info := EC2IAMInfo{}
if err := json.NewDecoder(strings.NewReader(resp)).Decode(&info); err != nil {
return EC2IAMInfo{},
- awserr.New("SerializationError",
+ awserr.New(request.ErrCodeSerialization,
"failed to decode EC2 IAM info", err)
}
@@ -118,6 +121,10 @@ func (c *EC2Metadata) Region() (string, error) {
return "", err
}
+ if len(resp) == 0 {
+ return "", awserr.New("EC2MetadataError", "invalid Region response", nil)
+ }
+
// returns region without the suffix. Eg: us-west-2a becomes us-west-2
return resp[:len(resp)-1], nil
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
index ef5f73292..f0c1d31e7 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
@@ -4,7 +4,7 @@
// This package's client can be disabled completely by setting the environment
// variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to
// true instructs the SDK to disable the EC2 Metadata client. The client cannot
-// be used while the environemnt variable is set to true, (case insensitive).
+// be used while the environment variable is set to true, (case insensitive).
package ec2metadata
import (
@@ -72,6 +72,7 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceName,
Endpoint: endpoint,
APIVersion: "latest",
},
@@ -91,6 +92,9 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
svc.Handlers.Send.SwapNamed(request.NamedHandler{
Name: corehandlers.SendHandler.Name,
Fn: func(r *request.Request) {
+ r.HTTPResponse = &http.Response{
+ Header: http.Header{},
+ }
r.Error = awserr.New(
request.CanceledErrorCode,
"EC2 IMDS access disabled via "+disableServiceEnvVar+" env var",
@@ -119,7 +123,7 @@ func unmarshalHandler(r *request.Request) {
defer r.HTTPResponse.Body.Close()
b := &bytes.Buffer{}
if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {
- r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata respose", err)
return
}
@@ -132,7 +136,7 @@ func unmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
b := &bytes.Buffer{}
if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {
- r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error respose", err)
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
index 74f72de07..87b9ff3ff 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go
@@ -84,6 +84,8 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol
custAddEC2Metadata(p)
custAddS3DualStack(p)
custRmIotDataService(p)
+ custFixAppAutoscalingChina(p)
+ custFixAppAutoscalingUsGov(p)
}
return ps, nil
@@ -94,7 +96,12 @@ func custAddS3DualStack(p *partition) {
return
}
- s, ok := p.Services["s3"]
+ custAddDualstack(p, "s3")
+ custAddDualstack(p, "s3-control")
+}
+
+func custAddDualstack(p *partition, svcName string) {
+ s, ok := p.Services[svcName]
if !ok {
return
}
@@ -102,7 +109,7 @@ func custAddS3DualStack(p *partition) {
s.Defaults.HasDualStack = boxedTrue
s.Defaults.DualStackHostname = "{service}.dualstack.{region}.{dnsSuffix}"
- p.Services["s3"] = s
+ p.Services[svcName] = s
}
func custAddEC2Metadata(p *partition) {
@@ -122,6 +129,54 @@ func custRmIotDataService(p *partition) {
delete(p.Services, "data.iot")
}
+func custFixAppAutoscalingChina(p *partition) {
+ if p.ID != "aws-cn" {
+ return
+ }
+
+ const serviceName = "application-autoscaling"
+ s, ok := p.Services[serviceName]
+ if !ok {
+ return
+ }
+
+ const expectHostname = `autoscaling.{region}.amazonaws.com`
+ if e, a := s.Defaults.Hostname, expectHostname; e != a {
+ fmt.Printf("custFixAppAutoscalingChina: ignoring customization, expected %s, got %s\n", e, a)
+ return
+ }
+
+ s.Defaults.Hostname = expectHostname + ".cn"
+ p.Services[serviceName] = s
+}
+
+func custFixAppAutoscalingUsGov(p *partition) {
+ if p.ID != "aws-us-gov" {
+ return
+ }
+
+ const serviceName = "application-autoscaling"
+ s, ok := p.Services[serviceName]
+ if !ok {
+ return
+ }
+
+ if a := s.Defaults.CredentialScope.Service; a != "" {
+ fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty credential scope service, got %s\n", a)
+ return
+ }
+
+ if a := s.Defaults.Hostname; a != "" {
+ fmt.Printf("custFixAppAutoscalingUsGov: ignoring customization, expected empty hostname, got %s\n", a)
+ return
+ }
+
+ s.Defaults.CredentialScope.Service = "application-autoscaling"
+ s.Defaults.Hostname = "autoscaling.{region}.amazonaws.com"
+
+ p.Services[serviceName] = s
+}
+
type decodeModelError struct {
awsError
}
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 857f677dd..50b6c7af1 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
@@ -15,6 +15,7 @@ const (
// AWS Standard partition's regions.
const (
+ ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong).
ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo).
ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul).
ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai).
@@ -22,9 +23,11 @@ const (
ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney).
CaCentral1RegionID = "ca-central-1" // Canada (Central).
EuCentral1RegionID = "eu-central-1" // EU (Frankfurt).
+ EuNorth1RegionID = "eu-north-1" // EU (Stockholm).
EuWest1RegionID = "eu-west-1" // EU (Ireland).
EuWest2RegionID = "eu-west-2" // EU (London).
EuWest3RegionID = "eu-west-3" // EU (Paris).
+ MeSouth1RegionID = "me-south-1" // Middle East (Bahrain).
SaEast1RegionID = "sa-east-1" // South America (Sao Paulo).
UsEast1RegionID = "us-east-1" // US East (N. Virginia).
UsEast2RegionID = "us-east-2" // US East (Ohio).
@@ -40,138 +43,10 @@ const (
// AWS GovCloud (US) partition's regions.
const (
+ UsGovEast1RegionID = "us-gov-east-1" // AWS GovCloud (US-East).
UsGovWest1RegionID = "us-gov-west-1" // AWS GovCloud (US).
)
-// Service identifiers
-const (
- A4bServiceID = "a4b" // A4b.
- AcmServiceID = "acm" // Acm.
- AcmPcaServiceID = "acm-pca" // AcmPca.
- ApiPricingServiceID = "api.pricing" // ApiPricing.
- ApigatewayServiceID = "apigateway" // Apigateway.
- ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling.
- Appstream2ServiceID = "appstream2" // Appstream2.
- AthenaServiceID = "athena" // Athena.
- AutoscalingServiceID = "autoscaling" // Autoscaling.
- AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans.
- BatchServiceID = "batch" // Batch.
- BudgetsServiceID = "budgets" // Budgets.
- CeServiceID = "ce" // Ce.
- Cloud9ServiceID = "cloud9" // Cloud9.
- ClouddirectoryServiceID = "clouddirectory" // Clouddirectory.
- CloudformationServiceID = "cloudformation" // Cloudformation.
- CloudfrontServiceID = "cloudfront" // Cloudfront.
- CloudhsmServiceID = "cloudhsm" // Cloudhsm.
- Cloudhsmv2ServiceID = "cloudhsmv2" // Cloudhsmv2.
- CloudsearchServiceID = "cloudsearch" // Cloudsearch.
- CloudtrailServiceID = "cloudtrail" // Cloudtrail.
- CodebuildServiceID = "codebuild" // Codebuild.
- CodecommitServiceID = "codecommit" // Codecommit.
- CodedeployServiceID = "codedeploy" // Codedeploy.
- CodepipelineServiceID = "codepipeline" // Codepipeline.
- CodestarServiceID = "codestar" // Codestar.
- CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity.
- CognitoIdpServiceID = "cognito-idp" // CognitoIdp.
- CognitoSyncServiceID = "cognito-sync" // CognitoSync.
- ComprehendServiceID = "comprehend" // Comprehend.
- ConfigServiceID = "config" // Config.
- CurServiceID = "cur" // Cur.
- DatapipelineServiceID = "datapipeline" // Datapipeline.
- DaxServiceID = "dax" // Dax.
- DevicefarmServiceID = "devicefarm" // Devicefarm.
- DirectconnectServiceID = "directconnect" // Directconnect.
- DiscoveryServiceID = "discovery" // Discovery.
- DmsServiceID = "dms" // Dms.
- DsServiceID = "ds" // Ds.
- DynamodbServiceID = "dynamodb" // Dynamodb.
- Ec2ServiceID = "ec2" // Ec2.
- Ec2metadataServiceID = "ec2metadata" // Ec2metadata.
- EcrServiceID = "ecr" // Ecr.
- EcsServiceID = "ecs" // Ecs.
- ElasticacheServiceID = "elasticache" // Elasticache.
- ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk.
- ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem.
- ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing.
- ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce.
- ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder.
- EmailServiceID = "email" // Email.
- EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace.
- EsServiceID = "es" // Es.
- EventsServiceID = "events" // Events.
- FirehoseServiceID = "firehose" // Firehose.
- FmsServiceID = "fms" // Fms.
- GameliftServiceID = "gamelift" // Gamelift.
- GlacierServiceID = "glacier" // Glacier.
- GlueServiceID = "glue" // Glue.
- GreengrassServiceID = "greengrass" // Greengrass.
- GuarddutyServiceID = "guardduty" // Guardduty.
- HealthServiceID = "health" // Health.
- IamServiceID = "iam" // Iam.
- ImportexportServiceID = "importexport" // Importexport.
- InspectorServiceID = "inspector" // Inspector.
- IotServiceID = "iot" // Iot.
- KinesisServiceID = "kinesis" // Kinesis.
- KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics.
- KinesisvideoServiceID = "kinesisvideo" // Kinesisvideo.
- KmsServiceID = "kms" // Kms.
- LambdaServiceID = "lambda" // Lambda.
- LightsailServiceID = "lightsail" // Lightsail.
- LogsServiceID = "logs" // Logs.
- MachinelearningServiceID = "machinelearning" // Machinelearning.
- MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics.
- MediaconvertServiceID = "mediaconvert" // Mediaconvert.
- MedialiveServiceID = "medialive" // Medialive.
- MediapackageServiceID = "mediapackage" // Mediapackage.
- MediastoreServiceID = "mediastore" // Mediastore.
- MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace.
- MghServiceID = "mgh" // Mgh.
- MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics.
- ModelsLexServiceID = "models.lex" // ModelsLex.
- MonitoringServiceID = "monitoring" // Monitoring.
- MturkRequesterServiceID = "mturk-requester" // MturkRequester.
- OpsworksServiceID = "opsworks" // Opsworks.
- OpsworksCmServiceID = "opsworks-cm" // OpsworksCm.
- OrganizationsServiceID = "organizations" // Organizations.
- PinpointServiceID = "pinpoint" // Pinpoint.
- PollyServiceID = "polly" // Polly.
- RdsServiceID = "rds" // Rds.
- RedshiftServiceID = "redshift" // Redshift.
- RekognitionServiceID = "rekognition" // Rekognition.
- ResourceGroupsServiceID = "resource-groups" // ResourceGroups.
- Route53ServiceID = "route53" // Route53.
- Route53domainsServiceID = "route53domains" // Route53domains.
- RuntimeLexServiceID = "runtime.lex" // RuntimeLex.
- RuntimeSagemakerServiceID = "runtime.sagemaker" // RuntimeSagemaker.
- S3ServiceID = "s3" // S3.
- SagemakerServiceID = "sagemaker" // Sagemaker.
- SdbServiceID = "sdb" // Sdb.
- SecretsmanagerServiceID = "secretsmanager" // Secretsmanager.
- ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo.
- ServicecatalogServiceID = "servicecatalog" // Servicecatalog.
- ServicediscoveryServiceID = "servicediscovery" // Servicediscovery.
- ShieldServiceID = "shield" // Shield.
- SmsServiceID = "sms" // Sms.
- SnowballServiceID = "snowball" // Snowball.
- SnsServiceID = "sns" // Sns.
- SqsServiceID = "sqs" // Sqs.
- SsmServiceID = "ssm" // Ssm.
- StatesServiceID = "states" // States.
- StoragegatewayServiceID = "storagegateway" // Storagegateway.
- StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb.
- StsServiceID = "sts" // Sts.
- SupportServiceID = "support" // Support.
- SwfServiceID = "swf" // Swf.
- TaggingServiceID = "tagging" // Tagging.
- TranslateServiceID = "translate" // Translate.
- WafServiceID = "waf" // Waf.
- WafRegionalServiceID = "waf-regional" // WafRegional.
- WorkdocsServiceID = "workdocs" // Workdocs.
- WorkmailServiceID = "workmail" // Workmail.
- WorkspacesServiceID = "workspaces" // Workspaces.
- XrayServiceID = "xray" // Xray.
-)
-
// DefaultResolver returns an Endpoint resolver that will be able
// to resolve endpoints for: AWS Standard, AWS China, and AWS GovCloud (US).
//
@@ -208,7 +83,7 @@ var awsPartition = partition{
DNSSuffix: "amazonaws.com",
RegionRegex: regionRegex{
Regexp: func() *regexp.Regexp {
- reg, _ := regexp.Compile("^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$")
+ reg, _ := regexp.Compile("^(us|eu|ap|sa|ca|me)\\-\\w+\\-\\d+$")
return reg
}(),
},
@@ -218,6 +93,9 @@ var awsPartition = partition{
SignatureVersions: []string{"v4"},
},
Regions: regions{
+ "ap-east-1": region{
+ Description: "Asia Pacific (Hong Kong)",
+ },
"ap-northeast-1": region{
Description: "Asia Pacific (Tokyo)",
},
@@ -239,6 +117,9 @@ var awsPartition = partition{
"eu-central-1": region{
Description: "EU (Frankfurt)",
},
+ "eu-north-1": region{
+ Description: "EU (Stockholm)",
+ },
"eu-west-1": region{
Description: "EU (Ireland)",
},
@@ -248,6 +129,9 @@ var awsPartition = partition{
"eu-west-3": region{
Description: "EU (Paris)",
},
+ "me-south-1": region{
+ Description: "Middle East (Bahrain)",
+ },
"sa-east-1": region{
Description: "South America (Sao Paulo)",
},
@@ -274,6 +158,7 @@ var awsPartition = partition{
"acm": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -281,9 +166,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -296,14 +183,145 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "api.ecr": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{
+ Hostname: "api.ecr.ap-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-east-1",
+ },
+ },
+ "ap-northeast-1": endpoint{
+ Hostname: "api.ecr.ap-northeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-1",
+ },
+ },
+ "ap-northeast-2": endpoint{
+ Hostname: "api.ecr.ap-northeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-2",
+ },
+ },
+ "ap-south-1": endpoint{
+ Hostname: "api.ecr.ap-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-1",
+ },
+ },
+ "ap-southeast-1": endpoint{
+ Hostname: "api.ecr.ap-southeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-1",
+ },
+ },
+ "ap-southeast-2": endpoint{
+ Hostname: "api.ecr.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ "ca-central-1": endpoint{
+ Hostname: "api.ecr.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
+ "eu-central-1": endpoint{
+ Hostname: "api.ecr.eu-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-central-1",
+ },
+ },
+ "eu-north-1": endpoint{
+ Hostname: "api.ecr.eu-north-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-north-1",
+ },
+ },
+ "eu-west-1": endpoint{
+ Hostname: "api.ecr.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ "eu-west-2": endpoint{
+ Hostname: "api.ecr.eu-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ "eu-west-3": endpoint{
+ Hostname: "api.ecr.eu-west-3.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-3",
+ },
+ },
+ "me-south-1": endpoint{
+ Hostname: "api.ecr.me-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "me-south-1",
+ },
+ },
+ "sa-east-1": endpoint{
+ Hostname: "api.ecr.sa-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "sa-east-1",
+ },
+ },
+ "us-east-1": endpoint{
+ Hostname: "api.ecr.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{
+ Hostname: "api.ecr.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{
+ Hostname: "api.ecr.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{
+ Hostname: "api.ecr.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
+ "api.mediatailor": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
@@ -318,7 +336,7 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
- "apigateway": service{
+ "api.sagemaker": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
@@ -330,7 +348,52 @@ var awsPartition = partition{
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "api-fips.sagemaker.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "api-fips.sagemaker.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "api-fips.sagemaker.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "api-fips.sagemaker.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
+ "apigateway": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -346,6 +409,29 @@ var awsPartition = partition{
Service: "application-autoscaling",
},
},
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "appmesh": service{
+
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
@@ -356,8 +442,6 @@ var awsPartition = partition{
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -373,19 +457,44 @@ var awsPartition = partition{
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
},
+ "appsync": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"athena": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
@@ -396,6 +505,7 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -403,9 +513,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -422,14 +534,22 @@ var awsPartition = partition{
},
},
Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
+ "us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
- "batch": service{
+ "backup": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
@@ -446,6 +566,28 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "batch": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"budgets": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
@@ -472,10 +614,29 @@ var awsPartition = partition{
},
},
},
+ "chime": service{
+ PartitionEndpoint: "aws-global",
+ IsRegionalized: boxedFalse,
+ Defaults: endpoint{
+ SSLCommonName: "service.chime.aws.amazon.com",
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "aws-global": endpoint{
+ Hostname: "service.chime.aws.amazon.com",
+ Protocols: []string{"https"},
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ },
+ },
"cloud9": service{
Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
"ap-southeast-1": endpoint{},
+ "eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -487,6 +648,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
@@ -498,6 +660,7 @@ var awsPartition = partition{
"cloudformation": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -505,9 +668,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -551,13 +716,18 @@ var awsPartition = partition{
},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -582,6 +752,7 @@ var awsPartition = partition{
"cloudtrail": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -589,9 +760,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -602,6 +775,7 @@ var awsPartition = partition{
"codebuild": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -609,9 +783,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-1-fips": endpoint{
@@ -653,19 +829,27 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
+ "fips": endpoint{
+ Hostname: "codecommit-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"codedeploy": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -673,14 +857,40 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "codedeploy-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "codedeploy-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "codedeploy-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "codedeploy-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"codepipeline": service{
@@ -728,6 +938,7 @@ var awsPartition = partition{
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
@@ -744,6 +955,7 @@ var awsPartition = partition{
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
@@ -773,15 +985,33 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-2": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "comprehendmedical": service{
+
+ Endpoints: endpoints{
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
},
},
"config": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -789,9 +1019,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -805,6 +1037,19 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
+ "data.mediastore": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"datapipeline": service{
Endpoints: endpoints{
@@ -815,6 +1060,21 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "datasync": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"dax": service{
Endpoints: endpoints{
@@ -822,6 +1082,7 @@ var awsPartition = partition{
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
@@ -846,9 +1107,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -865,6 +1128,7 @@ var awsPartition = partition{
"dms": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -872,9 +1136,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -882,6 +1148,65 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "docdb": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{
+ Hostname: "rds.ap-northeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-1",
+ },
+ },
+ "ap-northeast-2": endpoint{
+ Hostname: "rds.ap-northeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-2",
+ },
+ },
+ "ap-southeast-2": endpoint{
+ Hostname: "rds.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ "eu-central-1": endpoint{
+ Hostname: "rds.eu-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-central-1",
+ },
+ },
+ "eu-west-1": endpoint{
+ Hostname: "rds.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ "eu-west-2": endpoint{
+ Hostname: "rds.eu-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ "us-east-1": endpoint{
+ Hostname: "rds.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{
+ Hostname: "rds.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-2": endpoint{
+ Hostname: "rds.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
"ds": service{
Endpoints: endpoints{
@@ -892,6 +1217,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"sa-east-1": endpoint{},
@@ -906,16 +1232,24 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
- "eu-central-1": endpoint{},
- "eu-west-1": endpoint{},
- "eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
+ "ca-central-1-fips": endpoint{
+ Hostname: "dynamodb-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"local": endpoint{
Hostname: "localhost:8000",
Protocols: []string{"http"},
@@ -923,11 +1257,36 @@ var awsPartition = partition{
Region: "us-east-1",
},
},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "dynamodb-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
"us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "dynamodb-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
"us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "dynamodb-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
"us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "dynamodb-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"ec2": service{
@@ -935,6 +1294,7 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -942,9 +1302,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -963,29 +1325,10 @@ var awsPartition = partition{
},
},
},
- "ecr": service{
-
- Endpoints: endpoints{
- "ap-northeast-1": endpoint{},
- "ap-northeast-2": endpoint{},
- "ap-south-1": endpoint{},
- "ap-southeast-1": endpoint{},
- "ap-southeast-2": endpoint{},
- "ca-central-1": endpoint{},
- "eu-central-1": endpoint{},
- "eu-west-1": endpoint{},
- "eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
- },
- },
"ecs": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -993,9 +1336,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1006,6 +1351,7 @@ var awsPartition = partition{
"elasticache": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1013,19 +1359,28 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
+ "fips": endpoint{
+ Hostname: "elasticache-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"elasticbeanstalk": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1033,9 +1388,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1046,9 +1403,16 @@ var awsPartition = partition{
"elasticfilesystem": service{
Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1060,6 +1424,7 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1067,9 +1432,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1080,9 +1447,10 @@ var awsPartition = partition{
"elasticmapreduce": service{
Defaults: endpoint{
SSLCommonName: "{region}.{service}.{dnsSuffix}",
- Protocols: []string{"http", "https"},
+ Protocols: []string{"https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1092,10 +1460,12 @@ var awsPartition = partition{
"eu-central-1": endpoint{
SSLCommonName: "{service}.{region}.{dnsSuffix}",
},
- "eu-west-1": endpoint{},
- "eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "{service}.{region}.{dnsSuffix}",
},
@@ -1120,9 +1490,12 @@ var awsPartition = partition{
"email": service{
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
- "us-west-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"entitlement.marketplace": service{
@@ -1138,6 +1511,7 @@ var awsPartition = partition{
"es": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1145,19 +1519,27 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
+ "fips": endpoint{
+ Hostname: "es-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1165,9 +1547,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1179,10 +1563,17 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1194,8 +1585,32 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
- "us-east-1": endpoint{},
- "us-west-2": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "fsx": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"gamelift": service{
@@ -1222,6 +1637,7 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1229,9 +1645,12 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1241,14 +1660,22 @@ var awsPartition = partition{
"glue": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
+ "us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@@ -1259,18 +1686,32 @@ var awsPartition = partition{
},
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
+ "us-east-2": endpoint{},
"us-west-2": endpoint{},
},
},
+ "groundstation": service{
+
+ Endpoints: endpoints{
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"guardduty": service{
IsRegionalized: boxedTrue,
Defaults: endpoint{
Protocols: []string{"https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1278,6 +1719,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
@@ -1330,7 +1772,9 @@ var awsPartition = partition{
"ap-south-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1349,9 +1793,116 @@ var awsPartition = partition{
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "iotanalytics": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "iotevents": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "ioteventsdata": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{
+ Hostname: "data.iotevents.ap-northeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-1",
+ },
+ },
+ "ap-southeast-2": endpoint{
+ Hostname: "data.iotevents.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ "eu-central-1": endpoint{
+ Hostname: "data.iotevents.eu-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-central-1",
+ },
+ },
+ "eu-west-1": endpoint{
+ Hostname: "data.iotevents.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ "us-east-1": endpoint{
+ Hostname: "data.iotevents.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{
+ Hostname: "data.iotevents.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-2": endpoint{
+ Hostname: "data.iotevents.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
+ "iotthingsgraph": service{
+ Defaults: endpoint{
+ CredentialScope: credentialScope{
+ Service: "iotthingsgraph",
+ },
+ },
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "kafka": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-2": endpoint{},
@@ -1360,6 +1911,7 @@ var awsPartition = partition{
"kinesis": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1367,9 +1919,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1380,15 +1934,23 @@ var awsPartition = partition{
"kinesisanalytics": service{
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
- "us-west-2": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
},
},
"kinesisvideo": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
@@ -1398,6 +1960,7 @@ var awsPartition = partition{
"kms": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1405,9 +1968,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1418,6 +1983,7 @@ var awsPartition = partition{
"lambda": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1425,6 +1991,30 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "license-manager": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
@@ -1456,6 +2046,7 @@ var awsPartition = partition{
"logs": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1463,9 +2054,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1486,6 +2079,25 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
+ "mediaconnect": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"mediaconvert": service{
Endpoints: endpoints{
@@ -1498,6 +2110,7 @@ var awsPartition = partition{
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1509,9 +2122,14 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
},
@@ -1521,6 +2139,7 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
@@ -1528,6 +2147,7 @@ var awsPartition = partition{
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
+ "us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
@@ -1535,8 +2155,10 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
"ap-southeast-2": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"us-east-1": endpoint{},
"us-west-2": endpoint{},
@@ -1549,6 +2171,7 @@ var awsPartition = partition{
},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1556,9 +2179,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1594,6 +2219,29 @@ var awsPartition = partition{
Defaults: endpoint{
Protocols: []string{"http", "https"},
},
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "mq": service{
+
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
@@ -1605,7 +2253,6 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -1622,6 +2269,83 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
+ "neptune": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{
+ Hostname: "rds.ap-northeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-1",
+ },
+ },
+ "ap-northeast-2": endpoint{
+ Hostname: "rds.ap-northeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-2",
+ },
+ },
+ "ap-south-1": endpoint{
+ Hostname: "rds.ap-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-south-1",
+ },
+ },
+ "ap-southeast-1": endpoint{
+ Hostname: "rds.ap-southeast-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-1",
+ },
+ },
+ "ap-southeast-2": endpoint{
+ Hostname: "rds.ap-southeast-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ "eu-central-1": endpoint{
+ Hostname: "rds.eu-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-central-1",
+ },
+ },
+ "eu-north-1": endpoint{
+ Hostname: "rds.eu-north-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-north-1",
+ },
+ },
+ "eu-west-1": endpoint{
+ Hostname: "rds.eu-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ "eu-west-2": endpoint{
+ Hostname: "rds.eu-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ "us-east-1": endpoint{
+ Hostname: "rds.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{
+ Hostname: "rds.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-2": endpoint{
+ Hostname: "rds.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
"opsworks": service{
Endpoints: endpoints{
@@ -1676,7 +2400,12 @@ var awsPartition = partition{
},
},
Endpoints: endpoints{
- "us-east-1": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-west-2": endpoint{},
},
},
"polly": service{
@@ -1689,6 +2418,7 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
@@ -1699,7 +2429,19 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
- "rds": service{
+ "projects.iot1click": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "ram": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
@@ -1709,9 +2451,32 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "rds": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "{service}.{dnsSuffix}",
@@ -1724,6 +2489,7 @@ var awsPartition = partition{
"redshift": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1731,9 +2497,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1745,16 +2513,23 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "eu-central-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
+ "us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"resource-groups": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -1762,8 +2537,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1771,6 +2549,18 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "robomaker": service{
+
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"route53": service{
PartitionEndpoint: "aws-global",
IsRegionalized: boxedFalse,
@@ -1790,6 +2580,27 @@ var awsPartition = partition{
"us-east-1": endpoint{},
},
},
+ "route53resolver": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"runtime.lex": service{
Defaults: endpoint{
CredentialScope: credentialScope{
@@ -1805,10 +2616,43 @@ var awsPartition = partition{
"runtime.sagemaker": service{
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "runtime-fips.sagemaker.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
"us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "runtime-fips.sagemaker.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "runtime-fips.sagemaker.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
"us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "runtime-fips.sagemaker.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"s3": service{
@@ -1822,6 +2666,7 @@ var awsPartition = partition{
DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{
Hostname: "s3.ap-northeast-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
@@ -1838,12 +2683,14 @@ var awsPartition = partition{
},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{
Hostname: "s3.eu-west-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
},
- "eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"s3-external-1": endpoint{
Hostname: "s3-external-1.amazonaws.com",
SignatureVersions: []string{"s3", "s3v4"},
@@ -1870,13 +2717,155 @@ var awsPartition = partition{
},
},
},
- "sagemaker": service{
+ "s3-control": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ SignatureVersions: []string{"s3v4"},
+ HasDualStack: boxedTrue,
+ DualStackHostname: "{service}.dualstack.{region}.{dnsSuffix}",
+ },
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-2": endpoint{},
+ "ap-northeast-1": endpoint{
+ Hostname: "s3-control.ap-northeast-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-1",
+ },
+ },
+ "ap-northeast-2": endpoint{
+ Hostname: "s3-control.ap-northeast-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-northeast-2",
+ },
+ },
+ "ap-south-1": endpoint{
+ Hostname: "s3-control.ap-south-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-south-1",
+ },
+ },
+ "ap-southeast-1": endpoint{
+ Hostname: "s3-control.ap-southeast-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-1",
+ },
+ },
+ "ap-southeast-2": endpoint{
+ Hostname: "s3-control.ap-southeast-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ap-southeast-2",
+ },
+ },
+ "ca-central-1": endpoint{
+ Hostname: "s3-control.ca-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
+ "eu-central-1": endpoint{
+ Hostname: "s3-control.eu-central-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-central-1",
+ },
+ },
+ "eu-north-1": endpoint{
+ Hostname: "s3-control.eu-north-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-north-1",
+ },
+ },
+ "eu-west-1": endpoint{
+ Hostname: "s3-control.eu-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-west-1",
+ },
+ },
+ "eu-west-2": endpoint{
+ Hostname: "s3-control.eu-west-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-west-2",
+ },
+ },
+ "eu-west-3": endpoint{
+ Hostname: "s3-control.eu-west-3.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "eu-west-3",
+ },
+ },
+ "sa-east-1": endpoint{
+ Hostname: "s3-control.sa-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "sa-east-1",
+ },
+ },
+ "us-east-1": endpoint{
+ Hostname: "s3-control.us-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-1-fips": endpoint{
+ Hostname: "s3-control-fips.us-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{
+ Hostname: "s3-control.us-east-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-east-2-fips": endpoint{
+ Hostname: "s3-control-fips.us-east-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{
+ Hostname: "s3-control.us-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-1-fips": endpoint{
+ Hostname: "s3-control-fips.us-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{
+ Hostname: "s3-control.us-west-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ "us-west-2-fips": endpoint{
+ Hostname: "s3-control-fips.us-west-2.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"sdb": service{
@@ -1907,8 +2896,56 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "secretsmanager-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "secretsmanager-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "secretsmanager-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "secretsmanager-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ },
+ },
+ "securityhub": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -1942,12 +2979,18 @@ var awsPartition = partition{
"eu-central-1": endpoint{
Protocols: []string{"https"},
},
+ "eu-north-1": endpoint{
+ Protocols: []string{"https"},
+ },
"eu-west-1": endpoint{
Protocols: []string{"https"},
},
"eu-west-2": endpoint{
Protocols: []string{"https"},
},
+ "eu-west-3": endpoint{
+ Protocols: []string{"https"},
+ },
"sa-east-1": endpoint{
Protocols: []string{"https"},
},
@@ -1975,37 +3018,43 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-1": endpoint{},
- "us-west-2": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "servicecatalog-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "servicecatalog-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "servicecatalog-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "servicecatalog-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"servicediscovery": service{
- Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
- "us-east-2": endpoint{},
- "us-west-2": endpoint{},
- },
- },
- "shield": service{
- IsRegionalized: boxedFalse,
- Defaults: endpoint{
- SSLCommonName: "Shield.us-east-1.amazonaws.com",
- Protocols: []string{"https"},
- },
- Endpoints: endpoints{
- "us-east-1": endpoint{},
- },
- },
- "sms": service{
-
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
@@ -2024,10 +3073,43 @@ var awsPartition = partition{
"us-west-2": endpoint{},
},
},
+ "shield": service{
+ IsRegionalized: boxedFalse,
+ Defaults: endpoint{
+ SSLCommonName: "shield.us-east-1.amazonaws.com",
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-east-1": endpoint{},
+ },
+ },
+ "sms": service{
+
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
"snowball": service{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
@@ -2048,6 +3130,7 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -2055,9 +3138,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -2071,6 +3156,7 @@ var awsPartition = partition{
Protocols: []string{"http", "https"},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -2078,10 +3164,36 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
+ "fips-us-east-1": endpoint{
+ Hostname: "sqs-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
+ "fips-us-east-2": endpoint{
+ Hostname: "sqs-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
+ "fips-us-west-1": endpoint{
+ Hostname: "sqs-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
+ "fips-us-west-2": endpoint{
+ Hostname: "sqs-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{
SSLCommonName: "queue.{dnsSuffix}",
},
@@ -2093,6 +3205,7 @@ var awsPartition = partition{
"ssm": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -2100,9 +3213,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -2113,14 +3228,20 @@ var awsPartition = partition{
"states": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -2137,9 +3258,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -2161,10 +3284,17 @@ var awsPartition = partition{
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
- "eu-central-1": endpoint{},
- "eu-west-1": endpoint{},
- "eu-west-2": endpoint{},
- "eu-west-3": endpoint{},
+ "ca-central-1-fips": endpoint{
+ Hostname: "dynamodb-fips.ca-central-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ca-central-1",
+ },
+ },
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"local": endpoint{
Hostname: "localhost:8000",
Protocols: []string{"http"},
@@ -2172,11 +3302,36 @@ var awsPartition = partition{
Region: "us-east-1",
},
},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "dynamodb-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
"us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "dynamodb-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
"us-west-1": endpoint{},
+ "us-west-1-fips": endpoint{
+ Hostname: "dynamodb-fips.us-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-1",
+ },
+ },
"us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "dynamodb-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"sts": service{
@@ -2188,6 +3343,12 @@ var awsPartition = partition{
},
},
Endpoints: endpoints{
+ "ap-east-1": endpoint{
+ Hostname: "sts.ap-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "ap-east-1",
+ },
+ },
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{
Hostname: "sts.ap-northeast-2.amazonaws.com",
@@ -2201,11 +3362,18 @@ var awsPartition = partition{
"aws-global": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
- "us-east-1": endpoint{},
+ "me-south-1": endpoint{
+ Hostname: "sts.me-south-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "me-south-1",
+ },
+ },
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
"us-east-1-fips": endpoint{
Hostname: "sts-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
@@ -2236,14 +3404,21 @@ var awsPartition = partition{
},
},
"support": service{
+ PartitionEndpoint: "aws-global",
Endpoints: endpoints{
- "us-east-1": endpoint{},
+ "aws-global": endpoint{
+ Hostname: "support.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
},
},
"swf": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -2251,9 +3426,11 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -2263,6 +3440,29 @@ var awsPartition = partition{
},
"tagging": service{
+ Endpoints: endpoints{
+ "ap-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "me-south-1": endpoint{},
+ "sa-east-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-2": endpoint{},
+ "us-west-1": endpoint{},
+ "us-west-2": endpoint{},
+ },
+ },
+ "transfer": service{
+
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
@@ -2274,7 +3474,6 @@ var awsPartition = partition{
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
- "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -2286,10 +3485,34 @@ var awsPartition = partition{
Protocols: []string{"https"},
},
Endpoints: endpoints{
- "eu-west-1": endpoint{},
- "us-east-1": endpoint{},
+ "ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
+ "ca-central-1": endpoint{},
+ "eu-central-1": endpoint{},
+ "eu-west-1": endpoint{},
+ "us-east-1": endpoint{},
+ "us-east-1-fips": endpoint{
+ Hostname: "translate-fips.us-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-1",
+ },
+ },
"us-east-2": endpoint{},
+ "us-east-2-fips": endpoint{
+ Hostname: "translate-fips.us-east-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-east-2",
+ },
+ },
"us-west-2": endpoint{},
+ "us-west-2-fips": endpoint{
+ Hostname: "translate-fips.us-west-2.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-west-2",
+ },
+ },
},
},
"waf": service{
@@ -2309,9 +3532,17 @@ var awsPartition = partition{
Endpoints: endpoints{
"ap-northeast-1": endpoint{},
+ "ap-northeast-2": endpoint{},
+ "ap-south-1": endpoint{},
+ "ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
+ "ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
+ "eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
+ "sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
@@ -2358,6 +3589,7 @@ var awsPartition = partition{
"xray": service{
Endpoints: endpoints{
+ "ap-east-1": endpoint{},
"ap-northeast-1": endpoint{},
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
@@ -2365,8 +3597,10 @@ var awsPartition = partition{
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
+ "eu-north-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
+ "eu-west-3": endpoint{},
"sa-east-1": endpoint{},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
@@ -2406,15 +3640,33 @@ var awscnPartition = partition{
},
},
Services: services{
+ "api.ecr": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{
+ Hostname: "api.ecr.cn-north-1.amazonaws.com.cn",
+ CredentialScope: credentialScope{
+ Region: "cn-north-1",
+ },
+ },
+ "cn-northwest-1": endpoint{
+ Hostname: "api.ecr.cn-northwest-1.amazonaws.com.cn",
+ CredentialScope: credentialScope{
+ Region: "cn-northwest-1",
+ },
+ },
+ },
+ },
"apigateway": service{
Endpoints: endpoints{
- "cn-north-1": endpoint{},
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
},
},
"application-autoscaling": service{
Defaults: endpoint{
- Hostname: "autoscaling.{region}.amazonaws.com",
+ Hostname: "autoscaling.{region}.amazonaws.com.cn",
Protocols: []string{"http", "https"},
CredentialScope: credentialScope{
Service: "application-autoscaling",
@@ -2441,6 +3693,20 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "cloudfront": service{
+ PartitionEndpoint: "aws-cn-global",
+ IsRegionalized: boxedFalse,
+
+ Endpoints: endpoints{
+ "aws-cn-global": endpoint{
+ Hostname: "cloudfront.cn-northwest-1.amazonaws.com.cn",
+ Protocols: []string{"http", "https"},
+ CredentialScope: credentialScope{
+ Region: "cn-northwest-1",
+ },
+ },
+ },
+ },
"cloudtrail": service{
Endpoints: endpoints{
@@ -2448,6 +3714,13 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "codebuild": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
"codedeploy": service{
Endpoints: endpoints{
@@ -2475,6 +3748,20 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "dms": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
+ "ds": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
"dynamodb": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
@@ -2504,16 +3791,11 @@ var awscnPartition = partition{
},
},
},
- "ecr": service{
-
- Endpoints: endpoints{
- "cn-north-1": endpoint{},
- },
- },
"ecs": service{
Endpoints: endpoints{
- "cn-north-1": endpoint{},
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
},
},
"elasticache": service{
@@ -2541,7 +3823,7 @@ var awscnPartition = partition{
},
"elasticmapreduce": service{
Defaults: endpoint{
- Protocols: []string{"http", "https"},
+ Protocols: []string{"https"},
},
Endpoints: endpoints{
"cn-north-1": endpoint{},
@@ -2551,6 +3833,7 @@ var awscnPartition = partition{
"es": service{
Endpoints: endpoints{
+ "cn-north-1": endpoint{},
"cn-northwest-1": endpoint{},
},
},
@@ -2561,6 +3844,19 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "firehose": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
+ "gamelift": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ },
+ },
"glacier": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
@@ -2570,6 +3866,15 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "greengrass": service{
+ IsRegionalized: boxedTrue,
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ },
+ },
"iam": service{
PartitionEndpoint: "aws-cn-global",
IsRegionalized: boxedFalse,
@@ -2600,10 +3905,25 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "kms": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
"lambda": service{
Endpoints: endpoints{
- "cn-north-1": endpoint{},
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
+ "license-manager": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
},
},
"logs": service{
@@ -2613,6 +3933,17 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "mediaconvert": service{
+
+ Endpoints: endpoints{
+ "cn-northwest-1": endpoint{
+ Hostname: "subscribe.mediaconvert.cn-northwest-1.amazonaws.com.cn",
+ CredentialScope: credentialScope{
+ Region: "cn-northwest-1",
+ },
+ },
+ },
+ },
"monitoring": service{
Defaults: endpoint{
Protocols: []string{"http", "https"},
@@ -2622,6 +3953,12 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "polly": service{
+
+ Endpoints: endpoints{
+ "cn-northwest-1": endpoint{},
+ },
+ },
"rds": service{
Endpoints: endpoints{
@@ -2646,6 +3983,28 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "s3-control": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ SignatureVersions: []string{"s3v4"},
+ },
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{
+ Hostname: "s3-control.cn-north-1.amazonaws.com.cn",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "cn-north-1",
+ },
+ },
+ "cn-northwest-1": endpoint{
+ Hostname: "s3-control.cn-northwest-1.amazonaws.com.cn",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "cn-northwest-1",
+ },
+ },
+ },
+ },
"sms": service{
Endpoints: endpoints{
@@ -2685,6 +4044,13 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "states": service{
+
+ Endpoints: endpoints{
+ "cn-north-1": endpoint{},
+ "cn-northwest-1": endpoint{},
+ },
+ },
"storagegateway": service{
Endpoints: endpoints{
@@ -2710,6 +4076,18 @@ var awscnPartition = partition{
"cn-northwest-1": endpoint{},
},
},
+ "support": service{
+ PartitionEndpoint: "aws-cn-global",
+
+ Endpoints: endpoints{
+ "aws-cn-global": endpoint{
+ Hostname: "support.cn-north-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "cn-north-1",
+ },
+ },
+ },
+ },
"swf": service{
Endpoints: endpoints{
@@ -2748,6 +4126,9 @@ var awsusgovPartition = partition{
SignatureVersions: []string{"v4"},
},
Regions: regions{
+ "us-gov-east-1": region{
+ Description: "AWS GovCloud (US-East)",
+ },
"us-gov-west-1": region{
Description: "AWS GovCloud (US)",
},
@@ -2755,6 +4136,39 @@ var awsusgovPartition = partition{
Services: services{
"acm": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "acm-pca": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "api.ecr": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{
+ Hostname: "api.ecr.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ "us-gov-west-1": endpoint{
+ Hostname: "api.ecr.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
+ "api.sagemaker": service{
+
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
@@ -2762,20 +4176,48 @@ var awsusgovPartition = partition{
"apigateway": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "application-autoscaling": service{
+ Defaults: endpoint{
+ Hostname: "autoscaling.{region}.amazonaws.com",
+ CredentialScope: credentialScope{
+ Service: "application-autoscaling",
+ },
+ },
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "athena": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"autoscaling": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
+ "clouddirectory": service{
+
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
"cloudformation": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
@@ -2792,23 +4234,67 @@ var awsusgovPartition = partition{
},
},
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"cloudtrail": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "codebuild": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "codecommit": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"codedeploy": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-east-1-fips": endpoint{
+ Hostname: "codedeploy-fips.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ "us-gov-west-1": endpoint{},
+ "us-gov-west-1-fips": endpoint{
+ Hostname: "codedeploy-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
+ "comprehend": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
"config": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "datasync": service{
+
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
@@ -2816,18 +4302,34 @@ var awsusgovPartition = partition{
"directconnect": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"dms": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "ds": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"dynamodb": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-east-1-fips": endpoint{
+ Hostname: "dynamodb.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "dynamodb.us-gov-west-1.amazonaws.com",
@@ -2840,6 +4342,7 @@ var awsusgovPartition = partition{
"ec2": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
@@ -2854,26 +4357,35 @@ var awsusgovPartition = partition{
},
},
},
- "ecr": service{
-
- Endpoints: endpoints{
- "us-gov-west-1": endpoint{},
- },
- },
"ecs": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"elasticache": service{
Endpoints: endpoints{
+ "fips": endpoint{
+ Hostname: "elasticache-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"elasticbeanstalk": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "elasticfilesystem": service{
+
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
@@ -2881,6 +4393,7 @@ var awsusgovPartition = partition{
"elasticloadbalancing": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
@@ -2889,31 +4402,73 @@ var awsusgovPartition = partition{
"elasticmapreduce": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
- Protocols: []string{"http", "https"},
+ Protocols: []string{"https"},
},
},
},
"es": service{
Endpoints: endpoints{
+ "fips": endpoint{
+ Hostname: "es-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"events": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "firehose": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"glacier": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
},
},
+ "glue": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "greengrass": service{
+ IsRegionalized: boxedTrue,
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "guardduty": service{
+ IsRegionalized: boxedTrue,
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
"iam": service{
PartitionEndpoint: "aws-us-gov-global",
IsRegionalized: boxedFalse,
@@ -2927,26 +4482,66 @@ var awsusgovPartition = partition{
},
},
},
+ "inspector": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "iot": service{
+ Defaults: endpoint{
+ CredentialScope: credentialScope{
+ Service: "execute-api",
+ },
+ },
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
"kinesis": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"kms": service{
Endpoints: endpoints{
+ "ProdFips": endpoint{
+ Hostname: "kms-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"lambda": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "license-manager": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"logs": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "mediaconvert": service{
+
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
@@ -2958,30 +4553,53 @@ var awsusgovPartition = partition{
},
},
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"monitoring": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
+ "organizations": service{
+ PartitionEndpoint: "aws-us-gov-global",
+ IsRegionalized: boxedFalse,
+
+ Endpoints: endpoints{
+ "aws-us-gov-global": endpoint{
+ Hostname: "organizations.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
"polly": service{
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
},
+ "ram": service{
+
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
"rds": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"redshift": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
@@ -2991,6 +4609,12 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{},
},
},
+ "runtime.sagemaker": service{
+
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
"s3": service{
Defaults: endpoint{
SignatureVersions: []string{"s3", "s3v4"},
@@ -3002,27 +4626,92 @@ var awsusgovPartition = partition{
Region: "us-gov-west-1",
},
},
+ "us-gov-east-1": endpoint{
+ Hostname: "s3.us-gov-east-1.amazonaws.com",
+ Protocols: []string{"http", "https"},
+ },
"us-gov-west-1": endpoint{
Hostname: "s3.us-gov-west-1.amazonaws.com",
Protocols: []string{"http", "https"},
},
},
},
+ "s3-control": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ SignatureVersions: []string{"s3v4"},
+ },
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{
+ Hostname: "s3-control.us-gov-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ "us-gov-east-1-fips": endpoint{
+ Hostname: "s3-control-fips.us-gov-east-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
+ "us-gov-west-1": endpoint{
+ Hostname: "s3-control.us-gov-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ "us-gov-west-1-fips": endpoint{
+ Hostname: "s3-control-fips.us-gov-west-1.amazonaws.com",
+ SignatureVersions: []string{"s3v4"},
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
+ "secretsmanager": service{
+
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ "us-gov-west-1-fips": endpoint{
+ Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
+ "serverlessrepo": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{
+ Protocols: []string{"https"},
+ },
+ },
+ },
"sms": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"snowball": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"sns": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
Protocols: []string{"http", "https"},
},
@@ -3031,6 +4720,7 @@ var awsusgovPartition = partition{
"sqs": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{
SSLCommonName: "{region}.queue.{dnsSuffix}",
Protocols: []string{"http", "https"},
@@ -3040,6 +4730,14 @@ var awsusgovPartition = partition{
"ssm": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "states": service{
+
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
@@ -3056,6 +4754,13 @@ var awsusgovPartition = partition{
},
},
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-east-1-fips": endpoint{
+ Hostname: "dynamodb.us-gov-east-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-east-1",
+ },
+ },
"us-gov-west-1": endpoint{},
"us-gov-west-1-fips": endpoint{
Hostname: "dynamodb.us-gov-west-1.amazonaws.com",
@@ -3068,17 +4773,46 @@ var awsusgovPartition = partition{
"sts": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"swf": service{
Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"tagging": service{
+ Endpoints: endpoints{
+ "us-gov-east-1": endpoint{},
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "translate": service{
+ Defaults: endpoint{
+ Protocols: []string{"https"},
+ },
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ "us-gov-west-1-fips": endpoint{
+ Hostname: "translate-fips.us-gov-west-1.amazonaws.com",
+ CredentialScope: credentialScope{
+ Region: "us-gov-west-1",
+ },
+ },
+ },
+ },
+ "waf-regional": service{
+
+ Endpoints: endpoints{
+ "us-gov-west-1": endpoint{},
+ },
+ },
+ "workspaces": service{
+
Endpoints: endpoints{
"us-gov-west-1": endpoint{},
},
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go
new file mode 100644
index 000000000..ca8fc828e
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/dep_service_ids.go
@@ -0,0 +1,141 @@
+package endpoints
+
+// Service identifiers
+//
+// Deprecated: Use client package's EndpointsID value instead of these
+// ServiceIDs. These IDs are not maintained, and are out of date.
+const (
+ A4bServiceID = "a4b" // A4b.
+ AcmServiceID = "acm" // Acm.
+ AcmPcaServiceID = "acm-pca" // AcmPca.
+ ApiMediatailorServiceID = "api.mediatailor" // ApiMediatailor.
+ ApiPricingServiceID = "api.pricing" // ApiPricing.
+ ApiSagemakerServiceID = "api.sagemaker" // ApiSagemaker.
+ ApigatewayServiceID = "apigateway" // Apigateway.
+ ApplicationAutoscalingServiceID = "application-autoscaling" // ApplicationAutoscaling.
+ Appstream2ServiceID = "appstream2" // Appstream2.
+ AppsyncServiceID = "appsync" // Appsync.
+ AthenaServiceID = "athena" // Athena.
+ AutoscalingServiceID = "autoscaling" // Autoscaling.
+ AutoscalingPlansServiceID = "autoscaling-plans" // AutoscalingPlans.
+ BatchServiceID = "batch" // Batch.
+ BudgetsServiceID = "budgets" // Budgets.
+ CeServiceID = "ce" // Ce.
+ ChimeServiceID = "chime" // Chime.
+ Cloud9ServiceID = "cloud9" // Cloud9.
+ ClouddirectoryServiceID = "clouddirectory" // Clouddirectory.
+ CloudformationServiceID = "cloudformation" // Cloudformation.
+ CloudfrontServiceID = "cloudfront" // Cloudfront.
+ CloudhsmServiceID = "cloudhsm" // Cloudhsm.
+ Cloudhsmv2ServiceID = "cloudhsmv2" // Cloudhsmv2.
+ CloudsearchServiceID = "cloudsearch" // Cloudsearch.
+ CloudtrailServiceID = "cloudtrail" // Cloudtrail.
+ CodebuildServiceID = "codebuild" // Codebuild.
+ CodecommitServiceID = "codecommit" // Codecommit.
+ CodedeployServiceID = "codedeploy" // Codedeploy.
+ CodepipelineServiceID = "codepipeline" // Codepipeline.
+ CodestarServiceID = "codestar" // Codestar.
+ CognitoIdentityServiceID = "cognito-identity" // CognitoIdentity.
+ CognitoIdpServiceID = "cognito-idp" // CognitoIdp.
+ CognitoSyncServiceID = "cognito-sync" // CognitoSync.
+ ComprehendServiceID = "comprehend" // Comprehend.
+ ConfigServiceID = "config" // Config.
+ CurServiceID = "cur" // Cur.
+ DatapipelineServiceID = "datapipeline" // Datapipeline.
+ DaxServiceID = "dax" // Dax.
+ DevicefarmServiceID = "devicefarm" // Devicefarm.
+ DirectconnectServiceID = "directconnect" // Directconnect.
+ DiscoveryServiceID = "discovery" // Discovery.
+ DmsServiceID = "dms" // Dms.
+ DsServiceID = "ds" // Ds.
+ DynamodbServiceID = "dynamodb" // Dynamodb.
+ Ec2ServiceID = "ec2" // Ec2.
+ Ec2metadataServiceID = "ec2metadata" // Ec2metadata.
+ EcrServiceID = "ecr" // Ecr.
+ EcsServiceID = "ecs" // Ecs.
+ ElasticacheServiceID = "elasticache" // Elasticache.
+ ElasticbeanstalkServiceID = "elasticbeanstalk" // Elasticbeanstalk.
+ ElasticfilesystemServiceID = "elasticfilesystem" // Elasticfilesystem.
+ ElasticloadbalancingServiceID = "elasticloadbalancing" // Elasticloadbalancing.
+ ElasticmapreduceServiceID = "elasticmapreduce" // Elasticmapreduce.
+ ElastictranscoderServiceID = "elastictranscoder" // Elastictranscoder.
+ EmailServiceID = "email" // Email.
+ EntitlementMarketplaceServiceID = "entitlement.marketplace" // EntitlementMarketplace.
+ EsServiceID = "es" // Es.
+ EventsServiceID = "events" // Events.
+ FirehoseServiceID = "firehose" // Firehose.
+ FmsServiceID = "fms" // Fms.
+ GameliftServiceID = "gamelift" // Gamelift.
+ GlacierServiceID = "glacier" // Glacier.
+ GlueServiceID = "glue" // Glue.
+ GreengrassServiceID = "greengrass" // Greengrass.
+ GuarddutyServiceID = "guardduty" // Guardduty.
+ HealthServiceID = "health" // Health.
+ IamServiceID = "iam" // Iam.
+ ImportexportServiceID = "importexport" // Importexport.
+ InspectorServiceID = "inspector" // Inspector.
+ IotServiceID = "iot" // Iot.
+ IotanalyticsServiceID = "iotanalytics" // Iotanalytics.
+ KinesisServiceID = "kinesis" // Kinesis.
+ KinesisanalyticsServiceID = "kinesisanalytics" // Kinesisanalytics.
+ KinesisvideoServiceID = "kinesisvideo" // Kinesisvideo.
+ KmsServiceID = "kms" // Kms.
+ LambdaServiceID = "lambda" // Lambda.
+ LightsailServiceID = "lightsail" // Lightsail.
+ LogsServiceID = "logs" // Logs.
+ MachinelearningServiceID = "machinelearning" // Machinelearning.
+ MarketplacecommerceanalyticsServiceID = "marketplacecommerceanalytics" // Marketplacecommerceanalytics.
+ MediaconvertServiceID = "mediaconvert" // Mediaconvert.
+ MedialiveServiceID = "medialive" // Medialive.
+ MediapackageServiceID = "mediapackage" // Mediapackage.
+ MediastoreServiceID = "mediastore" // Mediastore.
+ MeteringMarketplaceServiceID = "metering.marketplace" // MeteringMarketplace.
+ MghServiceID = "mgh" // Mgh.
+ MobileanalyticsServiceID = "mobileanalytics" // Mobileanalytics.
+ ModelsLexServiceID = "models.lex" // ModelsLex.
+ MonitoringServiceID = "monitoring" // Monitoring.
+ MturkRequesterServiceID = "mturk-requester" // MturkRequester.
+ NeptuneServiceID = "neptune" // Neptune.
+ OpsworksServiceID = "opsworks" // Opsworks.
+ OpsworksCmServiceID = "opsworks-cm" // OpsworksCm.
+ OrganizationsServiceID = "organizations" // Organizations.
+ PinpointServiceID = "pinpoint" // Pinpoint.
+ PollyServiceID = "polly" // Polly.
+ RdsServiceID = "rds" // Rds.
+ RedshiftServiceID = "redshift" // Redshift.
+ RekognitionServiceID = "rekognition" // Rekognition.
+ ResourceGroupsServiceID = "resource-groups" // ResourceGroups.
+ Route53ServiceID = "route53" // Route53.
+ Route53domainsServiceID = "route53domains" // Route53domains.
+ RuntimeLexServiceID = "runtime.lex" // RuntimeLex.
+ RuntimeSagemakerServiceID = "runtime.sagemaker" // RuntimeSagemaker.
+ S3ServiceID = "s3" // S3.
+ S3ControlServiceID = "s3-control" // S3Control.
+ SagemakerServiceID = "api.sagemaker" // Sagemaker.
+ SdbServiceID = "sdb" // Sdb.
+ SecretsmanagerServiceID = "secretsmanager" // Secretsmanager.
+ ServerlessrepoServiceID = "serverlessrepo" // Serverlessrepo.
+ ServicecatalogServiceID = "servicecatalog" // Servicecatalog.
+ ServicediscoveryServiceID = "servicediscovery" // Servicediscovery.
+ ShieldServiceID = "shield" // Shield.
+ SmsServiceID = "sms" // Sms.
+ SnowballServiceID = "snowball" // Snowball.
+ SnsServiceID = "sns" // Sns.
+ SqsServiceID = "sqs" // Sqs.
+ SsmServiceID = "ssm" // Ssm.
+ StatesServiceID = "states" // States.
+ StoragegatewayServiceID = "storagegateway" // Storagegateway.
+ StreamsDynamodbServiceID = "streams.dynamodb" // StreamsDynamodb.
+ StsServiceID = "sts" // Sts.
+ SupportServiceID = "support" // Support.
+ SwfServiceID = "swf" // Swf.
+ TaggingServiceID = "tagging" // Tagging.
+ TransferServiceID = "transfer" // Transfer.
+ TranslateServiceID = "translate" // Translate.
+ WafServiceID = "waf" // Waf.
+ WafRegionalServiceID = "waf-regional" // WafRegional.
+ WorkdocsServiceID = "workdocs" // Workdocs.
+ WorkmailServiceID = "workmail" // Workmail.
+ WorkspacesServiceID = "workspaces" // Workspaces.
+ XrayServiceID = "xray" // Xray.
+)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
index e29c09512..9c936be6c 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go
@@ -35,7 +35,7 @@ type Options struct {
//
// If resolving an endpoint on the partition list the provided region will
// be used to determine which partition's domain name pattern to the service
- // endpoint ID with. If both the service and region are unkonwn and resolving
+ // endpoint ID with. If both the service and region are unknown and resolving
// the endpoint on partition list an UnknownEndpointError error will be returned.
//
// If resolving and endpoint on a partition specific resolver that partition's
@@ -170,10 +170,13 @@ func PartitionForRegion(ps []Partition, regionID string) (Partition, bool) {
// A Partition provides the ability to enumerate the partition's regions
// and services.
type Partition struct {
- id string
- p *partition
+ id, dnsSuffix string
+ p *partition
}
+// DNSSuffix returns the base domain name of the partition.
+func (p Partition) DNSSuffix() string { return p.dnsSuffix }
+
// ID returns the identifier of the partition.
func (p Partition) ID() string { return p.id }
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
index ff6f76db6..523ad79ac 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go
@@ -54,8 +54,9 @@ type partition struct {
func (p partition) Partition() Partition {
return Partition{
- id: p.ID,
- p: &p,
+ dnsSuffix: p.DNSSuffix,
+ id: p.ID,
+ p: &p,
}
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go
index 05e92df22..0fdfcc56e 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model_codegen.go
@@ -16,6 +16,10 @@ import (
type CodeGenOptions struct {
// Options for how the model will be decoded.
DecodeModelOptions DecodeModelOptions
+
+ // Disables code generation of the service endpoint prefix IDs defined in
+ // the model.
+ DisableGenerateServiceIDs bool
}
// Set combines all of the option functions together
@@ -39,8 +43,16 @@ func CodeGenModel(modelFile io.Reader, outFile io.Writer, optFns ...func(*CodeGe
return err
}
+ v := struct {
+ Resolver
+ CodeGenOptions
+ }{
+ Resolver: resolver,
+ CodeGenOptions: opts,
+ }
+
tmpl := template.Must(template.New("tmpl").Funcs(funcMap).Parse(v3Tmpl))
- if err := tmpl.ExecuteTemplate(outFile, "defaults", resolver); err != nil {
+ if err := tmpl.ExecuteTemplate(outFile, "defaults", v); err != nil {
return fmt.Errorf("failed to execute template, %v", err)
}
@@ -166,15 +178,17 @@ import (
"regexp"
)
- {{ template "partition consts" . }}
+ {{ template "partition consts" $.Resolver }}
- {{ range $_, $partition := . }}
+ {{ range $_, $partition := $.Resolver }}
{{ template "partition region consts" $partition }}
{{ end }}
- {{ template "service consts" . }}
+ {{ if not $.DisableGenerateServiceIDs -}}
+ {{ template "service consts" $.Resolver }}
+ {{- end }}
- {{ template "endpoint resolvers" . }}
+ {{ template "endpoint resolvers" $.Resolver }}
{{- end }}
{{ define "partition consts" }}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/errors.go b/vendor/github.com/aws/aws-sdk-go/aws/errors.go
index 576636168..fa06f7a8f 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/errors.go
@@ -5,13 +5,9 @@ import "github.com/aws/aws-sdk-go/aws/awserr"
var (
// ErrMissingRegion is an error that is returned if region configuration is
// not found.
- //
- // @readonly
ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil)
// ErrMissingEndpoint is an error that is returned if an endpoint cannot be
// resolved for a service.
- //
- // @readonly
ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/logger.go
index 3babb5abd..6ed15b2ec 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/logger.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/logger.go
@@ -71,6 +71,12 @@ const (
// LogDebugWithRequestErrors states the SDK should log when service requests fail
// to build, send, validate, or unmarshal.
LogDebugWithRequestErrors
+
+ // LogDebugWithEventStreamBody states the SDK should log EventStream
+ // request and response bodys. This should be used to log the EventStream
+ // wire unmarshaled message content of requests and responses made while
+ // using the SDK Will also enable LogDebug.
+ LogDebugWithEventStreamBody
)
// A Logger is a minimalistic interface for the SDK to log messages to. Should
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go
index 271da432c..d9b37f4d3 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go
@@ -1,18 +1,17 @@
-// +build !appengine,!plan9
-
package request
import (
- "net"
- "os"
- "syscall"
+ "strings"
)
func isErrConnectionReset(err error) bool {
- if opErr, ok := err.(*net.OpError); ok {
- if sysErr, ok := opErr.Err.(*os.SyscallError); ok {
- return sysErr.Err == syscall.ECONNRESET
- }
+ if strings.Contains(err.Error(), "read: connection reset") {
+ return false
+ }
+
+ if strings.Contains(err.Error(), "connection reset") ||
+ strings.Contains(err.Error(), "broken pipe") {
+ return true
}
return false
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go b/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go
deleted file mode 100644
index daf9eca43..000000000
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// +build appengine plan9
-
-package request
-
-import (
- "strings"
-)
-
-func isErrConnectionReset(err error) bool {
- return strings.Contains(err.Error(), "connection reset")
-}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
index 802ac88ad..627ec722c 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
@@ -14,10 +14,12 @@ type Handlers struct {
Send HandlerList
ValidateResponse HandlerList
Unmarshal HandlerList
+ UnmarshalStream HandlerList
UnmarshalMeta HandlerList
UnmarshalError HandlerList
Retry HandlerList
AfterRetry HandlerList
+ CompleteAttempt HandlerList
Complete HandlerList
}
@@ -30,10 +32,12 @@ func (h *Handlers) Copy() Handlers {
Send: h.Send.copy(),
ValidateResponse: h.ValidateResponse.copy(),
Unmarshal: h.Unmarshal.copy(),
+ UnmarshalStream: h.UnmarshalStream.copy(),
UnmarshalError: h.UnmarshalError.copy(),
UnmarshalMeta: h.UnmarshalMeta.copy(),
Retry: h.Retry.copy(),
AfterRetry: h.AfterRetry.copy(),
+ CompleteAttempt: h.CompleteAttempt.copy(),
Complete: h.Complete.copy(),
}
}
@@ -45,14 +49,61 @@ func (h *Handlers) Clear() {
h.Send.Clear()
h.Sign.Clear()
h.Unmarshal.Clear()
+ h.UnmarshalStream.Clear()
h.UnmarshalMeta.Clear()
h.UnmarshalError.Clear()
h.ValidateResponse.Clear()
h.Retry.Clear()
h.AfterRetry.Clear()
+ h.CompleteAttempt.Clear()
h.Complete.Clear()
}
+// IsEmpty returns if there are no handlers in any of the handlerlists.
+func (h *Handlers) IsEmpty() bool {
+ if h.Validate.Len() != 0 {
+ return false
+ }
+ if h.Build.Len() != 0 {
+ return false
+ }
+ if h.Send.Len() != 0 {
+ return false
+ }
+ if h.Sign.Len() != 0 {
+ return false
+ }
+ if h.Unmarshal.Len() != 0 {
+ return false
+ }
+ if h.UnmarshalStream.Len() != 0 {
+ return false
+ }
+ if h.UnmarshalMeta.Len() != 0 {
+ return false
+ }
+ if h.UnmarshalError.Len() != 0 {
+ return false
+ }
+ if h.ValidateResponse.Len() != 0 {
+ return false
+ }
+ if h.Retry.Len() != 0 {
+ return false
+ }
+ if h.AfterRetry.Len() != 0 {
+ return false
+ }
+ if h.CompleteAttempt.Len() != 0 {
+ return false
+ }
+ if h.Complete.Len() != 0 {
+ return false
+ }
+
+ return true
+}
+
// A HandlerListRunItem represents an entry in the HandlerList which
// is being run.
type HandlerListRunItem struct {
@@ -172,6 +223,21 @@ func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) {
return swapped
}
+// Swap will swap out all handlers matching the name passed in. The matched
+// handlers will be swapped in. True is returned if the handlers were swapped.
+func (l *HandlerList) Swap(name string, replace NamedHandler) bool {
+ var swapped bool
+
+ for i := 0; i < len(l.list); i++ {
+ if l.list[i].Name == name {
+ l.list[i] = replace
+ swapped = true
+ }
+ }
+
+ return swapped
+}
+
// SetBackNamed will replace the named handler if it exists in the handler list.
// If the handler does not exist the handler will be added to the end of the list.
func (l *HandlerList) SetBackNamed(n NamedHandler) {
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go
index b0c2ef4fe..9370fa50c 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go
@@ -15,12 +15,15 @@ type offsetReader struct {
closed bool
}
-func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader {
+func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) {
reader := &offsetReader{}
- buf.Seek(offset, sdkio.SeekStart)
+ _, err := buf.Seek(offset, sdkio.SeekStart)
+ if err != nil {
+ return nil, err
+ }
reader.buf = buf
- return reader
+ return reader, nil
}
// Close will close the instance of the offset reader's access to
@@ -54,7 +57,9 @@ func (o *offsetReader) Seek(offset int64, whence int) (int64, error) {
// CloseAndCopy will return a new offsetReader with a copy of the old buffer
// and close the old buffer.
-func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader {
- o.Close()
+func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) {
+ if err := o.Close(); err != nil {
+ return nil, err
+ }
return newOffsetReader(o.buf, offset)
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go
index 69b7a01ad..e7c9b2b61 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go
@@ -46,6 +46,7 @@ type Request struct {
Handlers Handlers
Retryer
+ AttemptTime time.Time
Time time.Time
Operation *Operation
HTTPRequest *http.Request
@@ -231,6 +232,10 @@ func (r *Request) WillRetry() bool {
return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
}
+func fmtAttemptCount(retryCount, maxRetries int) string {
+ return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries)
+}
+
// ParamsFilled returns if the request's parameters have been populated
// and the parameters are valid. False is returned if no parameters are
// provided or invalid.
@@ -259,12 +264,25 @@ func (r *Request) SetStringBody(s string) {
// SetReaderBody will set the request's body reader.
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
r.Body = reader
- r.BodyStart, _ = reader.Seek(0, sdkio.SeekCurrent) // Get the Bodies current offset.
+
+ if aws.IsReaderSeekable(reader) {
+ var err error
+ // Get the Bodies current offset so retries will start from the same
+ // initial position.
+ r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent)
+ if err != nil {
+ r.Error = awserr.New(ErrCodeSerialization,
+ "failed to determine start of request body", err)
+ return
+ }
+ }
r.ResetBody()
}
// Presign returns the request's signed URL. Error will be returned
-// if the signing fails.
+// if the signing fails. The expire parameter is only used for presigned Amazon
+// S3 API requests. All other AWS services will use a fixed expiration
+// time of 15 minutes.
//
// It is invalid to create a presigned URL with a expire duration 0 or less. An
// error is returned if expire duration is 0 or less.
@@ -281,7 +299,9 @@ func (r *Request) Presign(expire time.Duration) (string, error) {
}
// PresignRequest behaves just like presign, with the addition of returning a
-// set of headers that were signed.
+// set of headers that were signed. The expire parameter is only used for
+// presigned Amazon S3 API requests. All other AWS services will use a fixed
+// expiration time of 15 minutes.
//
// It is invalid to create a presigned URL with a expire duration 0 or less. An
// error is returned if expire duration is 0 or less.
@@ -326,16 +346,15 @@ func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, err
return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil
}
-func debugLogReqError(r *Request, stage string, retrying bool, err error) {
+const (
+ notRetrying = "not retrying"
+)
+
+func debugLogReqError(r *Request, stage, retryStr string, err error) {
if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {
return
}
- retryStr := "not retrying"
- if retrying {
- retryStr = "will retry"
- }
-
r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err))
}
@@ -354,12 +373,12 @@ func (r *Request) Build() error {
if !r.built {
r.Handlers.Validate.Run(r)
if r.Error != nil {
- debugLogReqError(r, "Validate Request", false, r.Error)
+ debugLogReqError(r, "Validate Request", notRetrying, r.Error)
return r.Error
}
r.Handlers.Build.Run(r)
if r.Error != nil {
- debugLogReqError(r, "Build Request", false, r.Error)
+ debugLogReqError(r, "Build Request", notRetrying, r.Error)
return r.Error
}
r.built = true
@@ -368,14 +387,14 @@ func (r *Request) Build() error {
return r.Error
}
-// Sign will sign the request returning error if errors are encountered.
+// Sign will sign the request, returning error if errors are encountered.
//
-// Send will build the request prior to signing. All Sign Handlers will
+// Sign will build the request prior to signing. All Sign Handlers will
// be executed in the order they were set.
func (r *Request) Sign() error {
r.Build()
if r.Error != nil {
- debugLogReqError(r, "Build Request", false, r.Error)
+ debugLogReqError(r, "Build Request", notRetrying, r.Error)
return r.Error
}
@@ -383,12 +402,16 @@ func (r *Request) Sign() error {
return r.Error
}
-func (r *Request) getNextRequestBody() (io.ReadCloser, error) {
+func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) {
if r.safeBody != nil {
r.safeBody.Close()
}
- r.safeBody = newOffsetReader(r.Body, r.BodyStart)
+ r.safeBody, err = newOffsetReader(r.Body, r.BodyStart)
+ if err != nil {
+ return nil, awserr.New(ErrCodeSerialization,
+ "failed to get next request body reader", err)
+ }
// Go 1.8 tightened and clarified the rules code needs to use when building
// requests with the http package. Go 1.8 removed the automatic detection
@@ -405,10 +428,10 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) {
// Related golang/go#18257
l, err := aws.SeekerLen(r.Body)
if err != nil {
- return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err)
+ return nil, awserr.New(ErrCodeSerialization,
+ "failed to compute request body size", err)
}
- var body io.ReadCloser
if l == 0 {
body = NoBody
} else if l > 0 {
@@ -440,7 +463,7 @@ func (r *Request) GetBody() io.ReadSeeker {
return r.safeBody
}
-// Send will send the request returning error if errors are encountered.
+// Send will send the request, returning error if errors are encountered.
//
// Send will sign the request prior to sending. All Send Handlers will
// be executed in the order they were set.
@@ -460,79 +483,94 @@ func (r *Request) Send() error {
r.Handlers.Complete.Run(r)
}()
+ if err := r.Error; err != nil {
+ return err
+ }
+
for {
- if aws.BoolValue(r.Retryable) {
- if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
- r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
- r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
- }
+ r.Error = nil
+ r.AttemptTime = time.Now()
- // The previous http.Request will have a reference to the r.Body
- // and the HTTP Client's Transport may still be reading from
- // the request's body even though the Client's Do returned.
- r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil)
- r.ResetBody()
-
- // Closing response body to ensure that no response body is leaked
- // between retry attempts.
- if r.HTTPResponse != nil && r.HTTPResponse.Body != nil {
- r.HTTPResponse.Body.Close()
- }
+ if err := r.Sign(); err != nil {
+ debugLogReqError(r, "Sign Request", notRetrying, err)
+ return err
}
- r.Sign()
- if r.Error != nil {
- return r.Error
- }
-
- r.Retryable = nil
-
- r.Handlers.Send.Run(r)
- if r.Error != nil {
- if !shouldRetryCancel(r) {
- return r.Error
- }
-
- err := r.Error
+ if err := r.sendRequest(); err == nil {
+ return nil
+ } else if !shouldRetryError(r.Error) {
+ return err
+ } else {
r.Handlers.Retry.Run(r)
r.Handlers.AfterRetry.Run(r)
- if r.Error != nil {
- debugLogReqError(r, "Send Request", false, err)
+
+ if r.Error != nil || !aws.BoolValue(r.Retryable) {
return r.Error
}
- debugLogReqError(r, "Send Request", true, err)
- continue
- }
- r.Handlers.UnmarshalMeta.Run(r)
- r.Handlers.ValidateResponse.Run(r)
- if r.Error != nil {
- r.Handlers.UnmarshalError.Run(r)
- err := r.Error
- r.Handlers.Retry.Run(r)
- r.Handlers.AfterRetry.Run(r)
- if r.Error != nil {
- debugLogReqError(r, "Validate Response", false, err)
- return r.Error
+ if err := r.prepareRetry(); err != nil {
+ r.Error = err
+ return err
}
- debugLogReqError(r, "Validate Response", true, err)
continue
}
+ }
+}
- r.Handlers.Unmarshal.Run(r)
- if r.Error != nil {
- err := r.Error
- r.Handlers.Retry.Run(r)
- r.Handlers.AfterRetry.Run(r)
- if r.Error != nil {
- debugLogReqError(r, "Unmarshal Response", false, err)
- return r.Error
- }
- debugLogReqError(r, "Unmarshal Response", true, err)
- continue
- }
+func (r *Request) prepareRetry() error {
+ if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
+ r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
+ r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
+ }
- break
+ // The previous http.Request will have a reference to the r.Body
+ // and the HTTP Client's Transport may still be reading from
+ // the request's body even though the Client's Do returned.
+ r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil)
+ r.ResetBody()
+ if err := r.Error; err != nil {
+ return awserr.New(ErrCodeSerialization,
+ "failed to prepare body for retry", err)
+
+ }
+
+ // Closing response body to ensure that no response body is leaked
+ // between retry attempts.
+ if r.HTTPResponse != nil && r.HTTPResponse.Body != nil {
+ r.HTTPResponse.Body.Close()
+ }
+
+ return nil
+}
+
+func (r *Request) sendRequest() (sendErr error) {
+ defer r.Handlers.CompleteAttempt.Run(r)
+
+ r.Retryable = nil
+ r.Handlers.Send.Run(r)
+ if r.Error != nil {
+ debugLogReqError(r, "Send Request",
+ fmtAttemptCount(r.RetryCount, r.MaxRetries()),
+ r.Error)
+ return r.Error
+ }
+
+ r.Handlers.UnmarshalMeta.Run(r)
+ r.Handlers.ValidateResponse.Run(r)
+ if r.Error != nil {
+ r.Handlers.UnmarshalError.Run(r)
+ debugLogReqError(r, "Validate Response",
+ fmtAttemptCount(r.RetryCount, r.MaxRetries()),
+ r.Error)
+ return r.Error
+ }
+
+ r.Handlers.Unmarshal.Run(r)
+ if r.Error != nil {
+ debugLogReqError(r, "Unmarshal Response",
+ fmtAttemptCount(r.RetryCount, r.MaxRetries()),
+ r.Error)
+ return r.Error
}
return nil
@@ -558,30 +596,49 @@ func AddToUserAgent(r *Request, s string) {
r.HTTPRequest.Header.Set("User-Agent", s)
}
-func shouldRetryCancel(r *Request) bool {
- awsErr, ok := r.Error.(awserr.Error)
- timeoutErr := false
- errStr := r.Error.Error()
- if ok {
- if awsErr.Code() == CanceledErrorCode {
+type temporary interface {
+ Temporary() bool
+}
+
+func shouldRetryError(origErr error) bool {
+ switch err := origErr.(type) {
+ case awserr.Error:
+ if err.Code() == CanceledErrorCode {
return false
}
- err := awsErr.OrigErr()
- netErr, netOK := err.(net.Error)
- timeoutErr = netOK && netErr.Temporary()
- if urlErr, ok := err.(*url.Error); !timeoutErr && ok {
- errStr = urlErr.Err.Error()
+ return shouldRetryError(err.OrigErr())
+ case *url.Error:
+ if strings.Contains(err.Error(), "connection refused") {
+ // Refused connections should be retried as the service may not yet
+ // be running on the port. Go TCP dial considers refused
+ // connections as not temporary.
+ return true
}
+ // *url.Error only implements Temporary after golang 1.6 but since
+ // url.Error only wraps the error:
+ return shouldRetryError(err.Err)
+ case temporary:
+ if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" {
+ return true
+ }
+ // If the error is temporary, we want to allow continuation of the
+ // retry process
+ return err.Temporary() || isErrConnectionReset(origErr)
+ case nil:
+ // `awserr.Error.OrigErr()` can be nil, meaning there was an error but
+ // because we don't know the cause, it is marked as retryable. See
+ // TestRequest4xxUnretryable for an example.
+ return true
+ default:
+ switch err.Error() {
+ case "net/http: request canceled",
+ "net/http: request canceled while waiting for connection":
+ // known 1.5 error case when an http request is cancelled
+ return false
+ }
+ // here we don't know the error; so we allow a retry.
+ return true
}
-
- // There can be two types of canceled errors here.
- // The first being a net.Error and the other being an error.
- // If the request was timed out, we want to continue the retry
- // process. Otherwise, return the canceled error.
- return timeoutErr ||
- (errStr != "net/http: request canceled" &&
- errStr != "net/http: request canceled while waiting for connection")
-
}
// SanitizeHostForHeader removes default port from host and updates request.Host
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go
index 869b97a1a..e36e468b7 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go
@@ -21,7 +21,7 @@ func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil }
var NoBody = noBody{}
// ResetBody rewinds the request body back to its starting position, and
-// set's the HTTP Request body reference. When the body is read prior
+// sets the HTTP Request body reference. When the body is read prior
// to being sent in the HTTP request it will need to be rewound.
//
// ResetBody will automatically be called by the SDK's build handler, but if
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
index c32fc69bc..de1292f45 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go
@@ -4,6 +4,8 @@ package request
import (
"net/http"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
)
// NoBody is a http.NoBody reader instructing Go HTTP client to not include
@@ -11,7 +13,7 @@ import (
var NoBody = http.NoBody
// ResetBody rewinds the request body back to its starting position, and
-// set's the HTTP Request body reference. When the body is read prior
+// sets the HTTP Request body reference. When the body is read prior
// to being sent in the HTTP request it will need to be rewound.
//
// ResetBody will automatically be called by the SDK's build handler, but if
@@ -24,7 +26,8 @@ var NoBody = http.NoBody
func (r *Request) ResetBody() {
body, err := r.getNextRequestBody()
if err != nil {
- r.Error = err
+ r.Error = awserr.New(ErrCodeSerialization,
+ "failed to reset request body", err)
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
index 159518a75..f093fc542 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
@@ -35,8 +35,12 @@ type Pagination struct {
// NewRequest should always be built from the same API operations. It is
// undefined if different API operations are returned on subsequent calls.
NewRequest func() (*Request, error)
+ // EndPageOnSameToken, when enabled, will allow the paginator to stop on
+ // token that are the same as its previous tokens.
+ EndPageOnSameToken bool
started bool
+ prevTokens []interface{}
nextTokens []interface{}
err error
@@ -49,7 +53,15 @@ type Pagination struct {
//
// Will always return true if Next has not been called yet.
func (p *Pagination) HasNextPage() bool {
- return !(p.started && len(p.nextTokens) == 0)
+ if !p.started {
+ return true
+ }
+
+ hasNextPage := len(p.nextTokens) != 0
+ if p.EndPageOnSameToken {
+ return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens)
+ }
+ return hasNextPage
}
// Err returns the error Pagination encountered when retrieving the next page.
@@ -96,6 +108,7 @@ func (p *Pagination) Next() bool {
return false
}
+ p.prevTokens = p.nextTokens
p.nextTokens = req.nextPageTokens()
p.curPage = req.Data
@@ -133,7 +146,7 @@ func (r *Request) nextPageTokens() []interface{} {
return nil
}
case bool:
- if v == false {
+ if !v {
return nil
}
}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
index f35fef213..d0aa54c6d 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
@@ -38,8 +38,10 @@ var throttleCodes = map[string]struct{}{
"ThrottlingException": {},
"RequestLimitExceeded": {},
"RequestThrottled": {},
+ "RequestThrottledException": {},
"TooManyRequestsException": {}, // Lambda functions
"PriorRequestNotComplete": {}, // Route53
+ "TransactionInProgressException": {},
}
// credsExpiredCodes is a collection of error codes which signify the credentials
@@ -97,7 +99,7 @@ func isNestedErrorRetryable(parentErr awserr.Error) bool {
}
if t, ok := err.(temporaryError); ok {
- return t.Temporary()
+ return t.Temporary() || isErrConnectionReset(err)
}
return isErrConnectionReset(err)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go
index 401246228..8630683f3 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/request/validation.go
@@ -17,6 +17,12 @@ const (
ParamMinValueErrCode = "ParamMinValueError"
// ParamMinLenErrCode is the error code for fields without enough elements.
ParamMinLenErrCode = "ParamMinLenError"
+ // ParamMaxLenErrCode is the error code for value being too long.
+ ParamMaxLenErrCode = "ParamMaxLenError"
+
+ // ParamFormatErrCode is the error code for a field with invalid
+ // format or characters.
+ ParamFormatErrCode = "ParamFormatInvalidError"
)
// Validator provides a way for types to perform validation logic on their
@@ -232,3 +238,49 @@ func NewErrParamMinLen(field string, min int) *ErrParamMinLen {
func (e *ErrParamMinLen) MinLen() int {
return e.min
}
+
+// An ErrParamMaxLen represents a maximum length parameter error.
+type ErrParamMaxLen struct {
+ errInvalidParam
+ max int
+}
+
+// NewErrParamMaxLen creates a new maximum length parameter error.
+func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen {
+ return &ErrParamMaxLen{
+ errInvalidParam: errInvalidParam{
+ code: ParamMaxLenErrCode,
+ field: field,
+ msg: fmt.Sprintf("maximum size of %v, %v", max, value),
+ },
+ max: max,
+ }
+}
+
+// MaxLen returns the field's required minimum length.
+func (e *ErrParamMaxLen) MaxLen() int {
+ return e.max
+}
+
+// An ErrParamFormat represents a invalid format parameter error.
+type ErrParamFormat struct {
+ errInvalidParam
+ format string
+}
+
+// NewErrParamFormat creates a new invalid format parameter error.
+func NewErrParamFormat(field string, format, value string) *ErrParamFormat {
+ return &ErrParamFormat{
+ errInvalidParam: errInvalidParam{
+ code: ParamFormatErrCode,
+ field: field,
+ msg: fmt.Sprintf("format %v, %v", format, value),
+ },
+ format: format,
+ }
+}
+
+// Format returns the field's required format.
+func (e *ErrParamFormat) Format() string {
+ return e.format
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go
new file mode 100644
index 000000000..ea9ebb6f6
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport.go
@@ -0,0 +1,26 @@
+// +build go1.7
+
+package session
+
+import (
+ "net"
+ "net/http"
+ "time"
+)
+
+// Transport that should be used when a custom CA bundle is specified with the
+// SDK.
+func getCABundleTransport() *http.Transport {
+ return &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
+ DialContext: (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ DualStack: true,
+ }).DialContext,
+ MaxIdleConns: 100,
+ IdleConnTimeout: 90 * time.Second,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go
new file mode 100644
index 000000000..fec39dfc1
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_5.go
@@ -0,0 +1,22 @@
+// +build !go1.6,go1.5
+
+package session
+
+import (
+ "net"
+ "net/http"
+ "time"
+)
+
+// Transport that should be used when a custom CA bundle is specified with the
+// SDK.
+func getCABundleTransport() *http.Transport {
+ return &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
+ Dial: (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go
new file mode 100644
index 000000000..1c5a5391e
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/cabundle_transport_1_6.go
@@ -0,0 +1,23 @@
+// +build !go1.7,go1.6
+
+package session
+
+import (
+ "net"
+ "net/http"
+ "time"
+)
+
+// Transport that should be used when a custom CA bundle is specified with the
+// SDK.
+func getCABundleTransport() *http.Transport {
+ return &http.Transport{
+ Proxy: http.ProxyFromEnvironment,
+ Dial: (&net.Dialer{
+ Timeout: 30 * time.Second,
+ KeepAlive: 30 * time.Second,
+ }).Dial,
+ TLSHandshakeTimeout: 10 * time.Second,
+ ExpectContinueTimeout: 1 * time.Second,
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go
new file mode 100644
index 000000000..ce4151826
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go
@@ -0,0 +1,258 @@
+package session
+
+import (
+ "fmt"
+ "os"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/aws/credentials"
+ "github.com/aws/aws-sdk-go/aws/credentials/processcreds"
+ "github.com/aws/aws-sdk-go/aws/credentials/stscreds"
+ "github.com/aws/aws-sdk-go/aws/defaults"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/internal/shareddefaults"
+)
+
+func resolveCredentials(cfg *aws.Config,
+ envCfg envConfig, sharedCfg sharedConfig,
+ handlers request.Handlers,
+ sessOpts Options,
+) (*credentials.Credentials, error) {
+
+ switch {
+ case len(envCfg.Profile) != 0:
+ // User explicitly provided an Profile, so load from shared config
+ // first.
+ return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts)
+
+ case envCfg.Creds.HasKeys():
+ // Environment credentials
+ return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil
+
+ case len(envCfg.WebIdentityTokenFilePath) != 0:
+ // Web identity token from environment, RoleARN required to also be
+ // set.
+ return assumeWebIdentity(cfg, handlers,
+ envCfg.WebIdentityTokenFilePath,
+ envCfg.RoleARN,
+ envCfg.RoleSessionName,
+ )
+
+ default:
+ // Fallback to the "default" credential resolution chain.
+ return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts)
+ }
+}
+
+// WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but
+// 'AWS_IAM_ROLE_ARN' was not set.
+var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil)
+
+// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_IAM_ROLE_ARN' was set but
+// 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set.
+var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil)
+
+func assumeWebIdentity(cfg *aws.Config, handlers request.Handlers,
+ filepath string,
+ roleARN, sessionName string,
+) (*credentials.Credentials, error) {
+
+ if len(filepath) == 0 {
+ return nil, WebIdentityEmptyTokenFilePathErr
+ }
+
+ if len(roleARN) == 0 {
+ return nil, WebIdentityEmptyRoleARNErr
+ }
+
+ creds := stscreds.NewWebIdentityCredentials(
+ &Session{
+ Config: cfg,
+ Handlers: handlers.Copy(),
+ },
+ roleARN,
+ sessionName,
+ filepath,
+ )
+
+ return creds, nil
+}
+
+func resolveCredsFromProfile(cfg *aws.Config,
+ envCfg envConfig, sharedCfg sharedConfig,
+ handlers request.Handlers,
+ sessOpts Options,
+) (creds *credentials.Credentials, err error) {
+
+ switch {
+ case sharedCfg.SourceProfile != nil:
+ // Assume IAM role with credentials source from a different profile.
+ creds, err = resolveCredsFromProfile(cfg, envCfg,
+ *sharedCfg.SourceProfile, handlers, sessOpts,
+ )
+
+ case sharedCfg.Creds.HasKeys():
+ // Static Credentials from Shared Config/Credentials file.
+ creds = credentials.NewStaticCredentialsFromCreds(
+ sharedCfg.Creds,
+ )
+
+ case len(sharedCfg.CredentialProcess) != 0:
+ // Get credentials from CredentialProcess
+ creds = processcreds.NewCredentials(sharedCfg.CredentialProcess)
+
+ case len(sharedCfg.CredentialSource) != 0:
+ creds, err = resolveCredsFromSource(cfg, envCfg,
+ sharedCfg, handlers, sessOpts,
+ )
+
+ case len(sharedCfg.WebIdentityTokenFile) != 0:
+ // Credentials from Assume Web Identity token require an IAM Role, and
+ // that roll will be assumed. May be wrapped with another assume role
+ // via SourceProfile.
+ return assumeWebIdentity(cfg, handlers,
+ sharedCfg.WebIdentityTokenFile,
+ sharedCfg.RoleARN,
+ sharedCfg.RoleSessionName,
+ )
+
+ default:
+ // Fallback to default credentials provider, include mock errors for
+ // the credential chain so user can identify why credentials failed to
+ // be retrieved.
+ creds = credentials.NewCredentials(&credentials.ChainProvider{
+ VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
+ Providers: []credentials.Provider{
+ &credProviderError{
+ Err: awserr.New("EnvAccessKeyNotFound",
+ "failed to find credentials in the environment.", nil),
+ },
+ &credProviderError{
+ Err: awserr.New("SharedCredsLoad",
+ fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil),
+ },
+ defaults.RemoteCredProvider(*cfg, handlers),
+ },
+ })
+ }
+ if err != nil {
+ return nil, err
+ }
+
+ if len(sharedCfg.RoleARN) > 0 {
+ cfgCp := *cfg
+ cfgCp.Credentials = creds
+ return credsFromAssumeRole(cfgCp, handlers, sharedCfg, sessOpts)
+ }
+
+ return creds, nil
+}
+
+// valid credential source values
+const (
+ credSourceEc2Metadata = "Ec2InstanceMetadata"
+ credSourceEnvironment = "Environment"
+ credSourceECSContainer = "EcsContainer"
+)
+
+func resolveCredsFromSource(cfg *aws.Config,
+ envCfg envConfig, sharedCfg sharedConfig,
+ handlers request.Handlers,
+ sessOpts Options,
+) (creds *credentials.Credentials, err error) {
+
+ switch sharedCfg.CredentialSource {
+ case credSourceEc2Metadata:
+ p := defaults.RemoteCredProvider(*cfg, handlers)
+ creds = credentials.NewCredentials(p)
+
+ case credSourceEnvironment:
+ creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds)
+
+ case credSourceECSContainer:
+ if len(os.Getenv(shareddefaults.ECSCredsProviderEnvVar)) == 0 {
+ return nil, ErrSharedConfigECSContainerEnvVarEmpty
+ }
+
+ p := defaults.RemoteCredProvider(*cfg, handlers)
+ creds = credentials.NewCredentials(p)
+
+ default:
+ return nil, ErrSharedConfigInvalidCredSource
+ }
+
+ return creds, nil
+}
+
+func credsFromAssumeRole(cfg aws.Config,
+ handlers request.Handlers,
+ sharedCfg sharedConfig,
+ sessOpts Options,
+) (*credentials.Credentials, error) {
+
+ if len(sharedCfg.MFASerial) != 0 && sessOpts.AssumeRoleTokenProvider == nil {
+ // AssumeRole Token provider is required if doing Assume Role
+ // with MFA.
+ return nil, AssumeRoleTokenProviderNotSetError{}
+ }
+
+ return stscreds.NewCredentials(
+ &Session{
+ Config: &cfg,
+ Handlers: handlers.Copy(),
+ },
+ sharedCfg.RoleARN,
+ func(opt *stscreds.AssumeRoleProvider) {
+ opt.RoleSessionName = sharedCfg.RoleSessionName
+ opt.Duration = sessOpts.AssumeRoleDuration
+
+ // Assume role with external ID
+ if len(sharedCfg.ExternalID) > 0 {
+ opt.ExternalID = aws.String(sharedCfg.ExternalID)
+ }
+
+ // Assume role with MFA
+ if len(sharedCfg.MFASerial) > 0 {
+ opt.SerialNumber = aws.String(sharedCfg.MFASerial)
+ opt.TokenProvider = sessOpts.AssumeRoleTokenProvider
+ }
+ },
+ ), nil
+}
+
+// AssumeRoleTokenProviderNotSetError is an error returned when creating a
+// session when the MFAToken option is not set when shared config is configured
+// load assume a role with an MFA token.
+type AssumeRoleTokenProviderNotSetError struct{}
+
+// Code is the short id of the error.
+func (e AssumeRoleTokenProviderNotSetError) Code() string {
+ return "AssumeRoleTokenProviderNotSetError"
+}
+
+// Message is the description of the error
+func (e AssumeRoleTokenProviderNotSetError) Message() string {
+ return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.")
+}
+
+// OrigErr is the underlying error that caused the failure.
+func (e AssumeRoleTokenProviderNotSetError) OrigErr() error {
+ return nil
+}
+
+// Error satisfies the error interface.
+func (e AssumeRoleTokenProviderNotSetError) Error() string {
+ return awserr.SprintError(e.Code(), e.Message(), "", nil)
+}
+
+type credProviderError struct {
+ Err error
+}
+
+func (c credProviderError) Retrieve() (credentials.Value, error) {
+ return credentials.Value{}, c.Err
+}
+func (c credProviderError) IsExpired() bool {
+ return true
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
index ea7b886f8..38a7b05a6 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/doc.go
@@ -99,7 +99,7 @@ handler logs every request and its payload made by a service client:
sess.Handlers.Send.PushFront(func(r *request.Request) {
// Log every request made and its payload
- logger.Println("Request: %s/%s, Payload: %s",
+ logger.Printf("Request: %s/%s, Payload: %s",
r.ClientInfo.ServiceName, r.Operation, r.Params)
})
@@ -128,7 +128,7 @@ read. The Session will be created from configuration values from the shared
credentials file (~/.aws/credentials) over those in the shared config file (~/.aws/config).
Credentials are the values the SDK should use for authenticating requests with
-AWS Services. They arfrom a configuration file will need to include both
+AWS Services. They are from a configuration file will need to include both
aws_access_key_id and aws_secret_access_key must be provided together in the
same file to be considered valid. The values will be ignored if not a complete
group. aws_session_token is an optional field that can be provided if both of
@@ -183,7 +183,7 @@ be returned when creating the session.
// from assumed role.
svc := s3.New(sess)
-To setup assume role outside of a session see the stscrds.AssumeRoleProvider
+To setup assume role outside of a session see the stscreds.AssumeRoleProvider
documentation.
Environment Variables
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
index 12b452177..3a998d5bd 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go
@@ -4,6 +4,7 @@ import (
"os"
"strconv"
+ "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/defaults"
)
@@ -79,7 +80,7 @@ type envConfig struct {
// AWS_CONFIG_FILE=$HOME/my_shared_config
SharedConfigFile string
- // Sets the path to a custom Credentials Authroity (CA) Bundle PEM file
+ // Sets the path to a custom Credentials Authority (CA) Bundle PEM file
// that the SDK will use instead of the system's root CA bundle.
// Only use this if you want to configure the SDK to use a custom set
// of CAs.
@@ -96,9 +97,49 @@ type envConfig struct {
//
// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
CustomCABundle string
+
+ csmEnabled string
+ CSMEnabled bool
+ CSMPort string
+ CSMClientID string
+ CSMHost string
+
+ // Enables endpoint discovery via environment variables.
+ //
+ // AWS_ENABLE_ENDPOINT_DISCOVERY=true
+ EnableEndpointDiscovery *bool
+ enableEndpointDiscovery string
+
+ // Specifies the WebIdentity token the SDK should use to assume a role
+ // with.
+ //
+ // AWS_WEB_IDENTITY_TOKEN_FILE=file_path
+ WebIdentityTokenFilePath string
+
+ // Specifies the IAM role arn to use when assuming an role.
+ //
+ // AWS_ROLE_ARN=role_arn
+ RoleARN string
+
+ // Specifies the IAM role session name to use when assuming a role.
+ //
+ // AWS_ROLE_SESSION_NAME=session_name
+ RoleSessionName string
}
var (
+ csmEnabledEnvKey = []string{
+ "AWS_CSM_ENABLED",
+ }
+ csmHostEnvKey = []string{
+ "AWS_CSM_HOST",
+ }
+ csmPortEnvKey = []string{
+ "AWS_CSM_PORT",
+ }
+ csmClientIDEnvKey = []string{
+ "AWS_CSM_CLIENT_ID",
+ }
credAccessEnvKey = []string{
"AWS_ACCESS_KEY_ID",
"AWS_ACCESS_KEY",
@@ -111,6 +152,10 @@ var (
"AWS_SESSION_TOKEN",
}
+ enableEndpointDiscoveryEnvKey = []string{
+ "AWS_ENABLE_ENDPOINT_DISCOVERY",
+ }
+
regionEnvKeys = []string{
"AWS_REGION",
"AWS_DEFAULT_REGION", // Only read if AWS_SDK_LOAD_CONFIG is also set
@@ -125,6 +170,15 @@ var (
sharedConfigFileEnvKey = []string{
"AWS_CONFIG_FILE",
}
+ webIdentityTokenFilePathEnvKey = []string{
+ "AWS_WEB_IDENTITY_TOKEN_FILE",
+ }
+ roleARNEnvKey = []string{
+ "AWS_ROLE_ARN",
+ }
+ roleSessionNameEnvKey = []string{
+ "AWS_ROLE_SESSION_NAME",
+ }
)
// loadEnvConfig retrieves the SDK's environment configuration.
@@ -153,17 +207,31 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
cfg.EnableSharedConfig = enableSharedConfig
- setFromEnvVal(&cfg.Creds.AccessKeyID, credAccessEnvKey)
- setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey)
- setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey)
-
- // Require logical grouping of credentials
- if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 {
- cfg.Creds = credentials.Value{}
- } else {
- cfg.Creds.ProviderName = EnvProviderName
+ // Static environment credentials
+ var creds credentials.Value
+ setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey)
+ setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey)
+ setFromEnvVal(&creds.SessionToken, credSessionEnvKey)
+ if creds.HasKeys() {
+ // Require logical grouping of credentials
+ creds.ProviderName = EnvProviderName
+ cfg.Creds = creds
}
+ // Role Metadata
+ setFromEnvVal(&cfg.RoleARN, roleARNEnvKey)
+ setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey)
+
+ // Web identity environment variables
+ setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey)
+
+ // CSM environment variables
+ setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey)
+ setFromEnvVal(&cfg.CSMHost, csmHostEnvKey)
+ setFromEnvVal(&cfg.CSMPort, csmPortEnvKey)
+ setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey)
+ cfg.CSMEnabled = len(cfg.csmEnabled) > 0
+
regionKeys := regionEnvKeys
profileKeys := profileEnvKeys
if !cfg.EnableSharedConfig {
@@ -174,6 +242,12 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
setFromEnvVal(&cfg.Region, regionKeys)
setFromEnvVal(&cfg.Profile, profileKeys)
+ // endpoint discovery is in reference to it being enabled.
+ setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey)
+ if len(cfg.enableEndpointDiscovery) > 0 {
+ cfg.EnableEndpointDiscovery = aws.Bool(cfg.enableEndpointDiscovery != "false")
+ }
+
setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
index 259b5c0fe..3a28da5a8 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go
@@ -8,18 +8,36 @@ import (
"io/ioutil"
"net/http"
"os"
+ "time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/corehandlers"
"github.com/aws/aws-sdk-go/aws/credentials"
- "github.com/aws/aws-sdk-go/aws/credentials/stscreds"
+ "github.com/aws/aws-sdk-go/aws/csm"
"github.com/aws/aws-sdk-go/aws/defaults"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
)
+const (
+ // ErrCodeSharedConfig represents an error that occurs in the shared
+ // configuration logic
+ ErrCodeSharedConfig = "SharedConfigErr"
+)
+
+// ErrSharedConfigSourceCollision will be returned if a section contains both
+// source_profile and credential_source
+var ErrSharedConfigSourceCollision = awserr.New(ErrCodeSharedConfig, "only source profile or credential source can be specified, not both", nil)
+
+// ErrSharedConfigECSContainerEnvVarEmpty will be returned if the environment
+// variables are empty and Environment was set as the credential source
+var ErrSharedConfigECSContainerEnvVarEmpty = awserr.New(ErrCodeSharedConfig, "EcsContainer was specified as the credential_source, but 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set", nil)
+
+// ErrSharedConfigInvalidCredSource will be returned if an invalid credential source was provided
+var ErrSharedConfigInvalidCredSource = awserr.New(ErrCodeSharedConfig, "credential source values must be EcsContainer, Ec2InstanceMetadata, or Environment", nil)
+
// A Session provides a central location to create service clients from and
// store configurations and request handlers for those services.
//
@@ -81,10 +99,24 @@ func New(cfgs ...*aws.Config) *Session {
r.Error = err
})
}
+
return s
}
- return deprecatedNewSession(cfgs...)
+ s := deprecatedNewSession(cfgs...)
+ if envCfg.CSMEnabled {
+ err := enableCSM(&s.Handlers, envCfg.CSMClientID,
+ envCfg.CSMHost, envCfg.CSMPort, s.Config.Logger)
+ if err != nil {
+ err = fmt.Errorf("failed to enable CSM, %v", err)
+ s.Config.Logger.Log("ERROR:", err.Error())
+ s.Handlers.Validate.PushBack(func(r *request.Request) {
+ r.Error = err
+ })
+ }
+ }
+
+ return s
}
// NewSession returns a new Session created from SDK defaults, config files,
@@ -184,6 +216,12 @@ type Options struct {
// the config enables assume role wit MFA via the mfa_serial field.
AssumeRoleTokenProvider func() (string, error)
+ // When the SDK's shared config is configured to assume a role this option
+ // may be provided to set the expiry duration of the STS credentials.
+ // Defaults to 15 minutes if not set as documented in the
+ // stscreds.AssumeRoleProvider.
+ AssumeRoleDuration time.Duration
+
// Reader for a custom Credentials Authority (CA) bundle in PEM format that
// the SDK will use instead of the default system's root CA bundle. Use this
// only if you want to replace the CA bundle the SDK uses for TLS requests.
@@ -198,6 +236,12 @@ type Options struct {
// to also enable this feature. CustomCABundle session option field has priority
// over the AWS_CA_BUNDLE environment variable, and will be used if both are set.
CustomCABundle io.Reader
+
+ // The handlers that the session and all API clients will be created with.
+ // This must be a complete set of handlers. Use the defaults.Handlers()
+ // function to initialize this value before changing the handlers to be
+ // used by the SDK.
+ Handlers request.Handlers
}
// NewSessionWithOptions returns a new Session created from SDK defaults, config files,
@@ -300,18 +344,39 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session {
}
initHandlers(s)
-
return s
}
+func enableCSM(handlers *request.Handlers,
+ clientID, host, port string,
+ logger aws.Logger,
+) error {
+ if logger != nil {
+ logger.Log("Enabling CSM")
+ }
+
+ r, err := csm.Start(clientID, csm.AddressWithDefaults(host, port))
+ if err != nil {
+ return err
+ }
+ r.InjectHandlers(handlers)
+
+ return nil
+}
+
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
cfg := defaults.Config()
- handlers := defaults.Handlers()
+
+ handlers := opts.Handlers
+ if handlers.IsEmpty() {
+ handlers = defaults.Handlers()
+ }
// Get a merged version of the user provided config to determine if
// credentials were.
userCfg := &aws.Config{}
userCfg.MergeIn(cfgs...)
+ cfg.MergeIn(userCfg)
// Ordered config files will be loaded in with later files overwriting
// previous config file values.
@@ -328,9 +393,11 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session,
}
// Load additional config from file(s)
- sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles)
+ sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig)
if err != nil {
- return nil, err
+ if _, ok := err.(SharedConfigProfileNotExistsError); !ok {
+ return nil, err
+ }
}
if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil {
@@ -343,6 +410,13 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session,
}
initHandlers(s)
+ if envCfg.CSMEnabled {
+ err := enableCSM(&s.Handlers, envCfg.CSMClientID,
+ envCfg.CSMHost, envCfg.CSMPort, s.Config.Logger)
+ if err != nil {
+ return nil, err
+ }
+ }
// Setup HTTP client with custom cert bundle if enabled
if opts.CustomCABundle != nil {
@@ -366,7 +440,10 @@ func loadCustomCABundle(s *Session, bundle io.Reader) error {
}
}
if t == nil {
- t = &http.Transport{}
+ // Nil transport implies `http.DefaultTransport` should be used. Since
+ // the SDK cannot modify, nor copy the `DefaultTransport` specifying
+ // the values the next closest behavior.
+ t = getCABundleTransport()
}
p, err := loadCertPool(bundle)
@@ -399,9 +476,11 @@ func loadCertPool(r io.Reader) (*x509.CertPool, error) {
return p, nil
}
-func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg sharedConfig, handlers request.Handlers, sessOpts Options) error {
- // Merge in user provided configuration
- cfg.MergeIn(userCfg)
+func mergeConfigSrcs(cfg, userCfg *aws.Config,
+ envCfg envConfig, sharedCfg sharedConfig,
+ handlers request.Handlers,
+ sessOpts Options,
+) error {
// Region if not already set by user
if len(aws.StringValue(cfg.Region)) == 0 {
@@ -412,103 +491,27 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, envCfg envConfig, sharedCfg share
}
}
- // Configure credentials if not already set
- if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {
- if len(envCfg.Creds.AccessKeyID) > 0 {
- cfg.Credentials = credentials.NewStaticCredentialsFromCreds(
- envCfg.Creds,
- )
- } else if envCfg.EnableSharedConfig && len(sharedCfg.AssumeRole.RoleARN) > 0 && sharedCfg.AssumeRoleSource != nil {
- cfgCp := *cfg
- cfgCp.Credentials = credentials.NewStaticCredentialsFromCreds(
- sharedCfg.AssumeRoleSource.Creds,
- )
- if len(sharedCfg.AssumeRole.MFASerial) > 0 && sessOpts.AssumeRoleTokenProvider == nil {
- // AssumeRole Token provider is required if doing Assume Role
- // with MFA.
- return AssumeRoleTokenProviderNotSetError{}
- }
- cfg.Credentials = stscreds.NewCredentials(
- &Session{
- Config: &cfgCp,
- Handlers: handlers.Copy(),
- },
- sharedCfg.AssumeRole.RoleARN,
- func(opt *stscreds.AssumeRoleProvider) {
- opt.RoleSessionName = sharedCfg.AssumeRole.RoleSessionName
-
- // Assume role with external ID
- if len(sharedCfg.AssumeRole.ExternalID) > 0 {
- opt.ExternalID = aws.String(sharedCfg.AssumeRole.ExternalID)
- }
-
- // Assume role with MFA
- if len(sharedCfg.AssumeRole.MFASerial) > 0 {
- opt.SerialNumber = aws.String(sharedCfg.AssumeRole.MFASerial)
- opt.TokenProvider = sessOpts.AssumeRoleTokenProvider
- }
- },
- )
- } else if len(sharedCfg.Creds.AccessKeyID) > 0 {
- cfg.Credentials = credentials.NewStaticCredentialsFromCreds(
- sharedCfg.Creds,
- )
- } else {
- // Fallback to default credentials provider, include mock errors
- // for the credential chain so user can identify why credentials
- // failed to be retrieved.
- cfg.Credentials = credentials.NewCredentials(&credentials.ChainProvider{
- VerboseErrors: aws.BoolValue(cfg.CredentialsChainVerboseErrors),
- Providers: []credentials.Provider{
- &credProviderError{Err: awserr.New("EnvAccessKeyNotFound", "failed to find credentials in the environment.", nil)},
- &credProviderError{Err: awserr.New("SharedCredsLoad", fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil)},
- defaults.RemoteCredProvider(*cfg, handlers),
- },
- })
+ if cfg.EnableEndpointDiscovery == nil {
+ if envCfg.EnableEndpointDiscovery != nil {
+ cfg.WithEndpointDiscovery(*envCfg.EnableEndpointDiscovery)
+ } else if envCfg.EnableSharedConfig && sharedCfg.EnableEndpointDiscovery != nil {
+ cfg.WithEndpointDiscovery(*sharedCfg.EnableEndpointDiscovery)
}
}
+ // Configure credentials if not already set by the user when creating the
+ // Session.
+ if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil {
+ creds, err := resolveCredentials(cfg, envCfg, sharedCfg, handlers, sessOpts)
+ if err != nil {
+ return err
+ }
+ cfg.Credentials = creds
+ }
+
return nil
}
-// AssumeRoleTokenProviderNotSetError is an error returned when creating a session when the
-// MFAToken option is not set when shared config is configured load assume a
-// role with an MFA token.
-type AssumeRoleTokenProviderNotSetError struct{}
-
-// Code is the short id of the error.
-func (e AssumeRoleTokenProviderNotSetError) Code() string {
- return "AssumeRoleTokenProviderNotSetError"
-}
-
-// Message is the description of the error
-func (e AssumeRoleTokenProviderNotSetError) Message() string {
- return fmt.Sprintf("assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.")
-}
-
-// OrigErr is the underlying error that caused the failure.
-func (e AssumeRoleTokenProviderNotSetError) OrigErr() error {
- return nil
-}
-
-// Error satisfies the error interface.
-func (e AssumeRoleTokenProviderNotSetError) Error() string {
- return awserr.SprintError(e.Code(), e.Message(), "", nil)
-}
-
-type credProviderError struct {
- Err error
-}
-
-var emptyCreds = credentials.Value{}
-
-func (c credProviderError) Retrieve() (credentials.Value, error) {
- return credentials.Value{}, c.Err
-}
-func (c credProviderError) IsExpired() bool {
- return true
-}
-
func initHandlers(s *Session) {
// Add the Validate parameter handler if it is not disabled.
s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go
index 09c8e5bc7..5170b4982 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go
@@ -2,11 +2,10 @@ package session
import (
"fmt"
- "io/ioutil"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
- "github.com/go-ini/ini"
+ "github.com/aws/aws-sdk-go/internal/ini"
)
const (
@@ -16,68 +15,86 @@ const (
sessionTokenKey = `aws_session_token` // optional
// Assume Role Credentials group
- roleArnKey = `role_arn` // group required
- sourceProfileKey = `source_profile` // group required
- externalIDKey = `external_id` // optional
- mfaSerialKey = `mfa_serial` // optional
- roleSessionNameKey = `role_session_name` // optional
+ roleArnKey = `role_arn` // group required
+ sourceProfileKey = `source_profile` // group required (or credential_source)
+ credentialSourceKey = `credential_source` // group required (or source_profile)
+ externalIDKey = `external_id` // optional
+ mfaSerialKey = `mfa_serial` // optional
+ roleSessionNameKey = `role_session_name` // optional
// Additional Config fields
regionKey = `region`
+ // endpoint discovery group
+ enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional
+
+ // External Credential Process
+ credentialProcessKey = `credential_process` // optional
+
+ // Web Identity Token File
+ webIdentityTokenFileKey = `web_identity_token_file` // optional
+
// DefaultSharedConfigProfile is the default profile to be used when
// loading configuration from the config files if another profile name
// is not provided.
DefaultSharedConfigProfile = `default`
)
-type assumeRoleConfig struct {
- RoleARN string
- SourceProfile string
- ExternalID string
- MFASerial string
- RoleSessionName string
-}
-
// sharedConfig represents the configuration fields of the SDK config files.
type sharedConfig struct {
- // Credentials values from the config file. Both aws_access_key_id
- // and aws_secret_access_key must be provided together in the same file
- // to be considered valid. The values will be ignored if not a complete group.
- // aws_session_token is an optional field that can be provided if both of the
- // other two fields are also provided.
+ // Credentials values from the config file. Both aws_access_key_id and
+ // aws_secret_access_key must be provided together in the same file to be
+ // considered valid. The values will be ignored if not a complete group.
+ // aws_session_token is an optional field that can be provided if both of
+ // the other two fields are also provided.
//
// aws_access_key_id
// aws_secret_access_key
// aws_session_token
Creds credentials.Value
- AssumeRole assumeRoleConfig
- AssumeRoleSource *sharedConfig
+ CredentialSource string
+ CredentialProcess string
+ WebIdentityTokenFile string
- // Region is the region the SDK should use for looking up AWS service endpoints
- // and signing requests.
+ RoleARN string
+ RoleSessionName string
+ ExternalID string
+ MFASerial string
+
+ SourceProfileName string
+ SourceProfile *sharedConfig
+
+ // Region is the region the SDK should use for looking up AWS service
+ // endpoints and signing requests.
//
// region
Region string
+
+ // EnableEndpointDiscovery can be enabled in the shared config by setting
+ // endpoint_discovery_enabled to true
+ //
+ // endpoint_discovery_enabled = true
+ EnableEndpointDiscovery *bool
}
type sharedConfigFile struct {
Filename string
- IniData *ini.File
+ IniData ini.Sections
}
-// loadSharedConfig retrieves the configuration from the list of files
-// using the profile provided. The order the files are listed will determine
+// loadSharedConfig retrieves the configuration from the list of files using
+// the profile provided. The order the files are listed will determine
// precedence. Values in subsequent files will overwrite values defined in
// earlier files.
//
// For example, given two files A and B. Both define credentials. If the order
-// of the files are A then B, B's credential values will be used instead of A's.
+// of the files are A then B, B's credential values will be used instead of
+// A's.
//
// See sharedConfig.setFromFile for information how the config files
// will be loaded.
-func loadSharedConfig(profile string, filenames []string) (sharedConfig, error) {
+func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) {
if len(profile) == 0 {
profile = DefaultSharedConfigProfile
}
@@ -88,16 +105,11 @@ func loadSharedConfig(profile string, filenames []string) (sharedConfig, error)
}
cfg := sharedConfig{}
- if err = cfg.setFromIniFiles(profile, files); err != nil {
+ profiles := map[string]struct{}{}
+ if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil {
return sharedConfig{}, err
}
- if len(cfg.AssumeRole.SourceProfile) > 0 {
- if err := cfg.setAssumeRoleSource(profile, files); err != nil {
- return sharedConfig{}, err
- }
- }
-
return cfg, nil
}
@@ -105,114 +117,237 @@ func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) {
files := make([]sharedConfigFile, 0, len(filenames))
for _, filename := range filenames {
- b, err := ioutil.ReadFile(filename)
- if err != nil {
+ sections, err := ini.OpenFile(filename)
+ if aerr, ok := err.(awserr.Error); ok && aerr.Code() == ini.ErrCodeUnableToReadFile {
// Skip files which can't be opened and read for whatever reason
continue
- }
-
- f, err := ini.Load(b)
- if err != nil {
+ } else if err != nil {
return nil, SharedConfigLoadError{Filename: filename, Err: err}
}
files = append(files, sharedConfigFile{
- Filename: filename, IniData: f,
+ Filename: filename, IniData: sections,
})
}
return files, nil
}
-func (cfg *sharedConfig) setAssumeRoleSource(origProfile string, files []sharedConfigFile) error {
- var assumeRoleSrc sharedConfig
-
- // Multiple level assume role chains are not support
- if cfg.AssumeRole.SourceProfile == origProfile {
- assumeRoleSrc = *cfg
- assumeRoleSrc.AssumeRole = assumeRoleConfig{}
- } else {
- err := assumeRoleSrc.setFromIniFiles(cfg.AssumeRole.SourceProfile, files)
- if err != nil {
- return err
- }
- }
-
- if len(assumeRoleSrc.Creds.AccessKeyID) == 0 {
- return SharedConfigAssumeRoleError{RoleARN: cfg.AssumeRole.RoleARN}
- }
-
- cfg.AssumeRoleSource = &assumeRoleSrc
-
- return nil
-}
-
-func (cfg *sharedConfig) setFromIniFiles(profile string, files []sharedConfigFile) error {
+func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error {
// Trim files from the list that don't exist.
+ var skippedFiles int
+ var profileNotFoundErr error
for _, f := range files {
- if err := cfg.setFromIniFile(profile, f); err != nil {
+ if err := cfg.setFromIniFile(profile, f, exOpts); err != nil {
if _, ok := err.(SharedConfigProfileNotExistsError); ok {
- // Ignore proviles missings
+ // Ignore profiles not defined in individual files.
+ profileNotFoundErr = err
+ skippedFiles++
continue
}
return err
}
}
+ if skippedFiles == len(files) {
+ // If all files were skipped because the profile is not found, return
+ // the original profile not found error.
+ return profileNotFoundErr
+ }
+
+ if _, ok := profiles[profile]; ok {
+ // if this is the second instance of the profile the Assume Role
+ // options must be cleared because they are only valid for the
+ // first reference of a profile. The self linked instance of the
+ // profile only have credential provider options.
+ cfg.clearAssumeRoleOptions()
+ } else {
+ // First time a profile has been seen, It must either be a assume role
+ // or credentials. Assert if the credential type requires a role ARN,
+ // the ARN is also set.
+ if err := cfg.validateCredentialsRequireARN(profile); err != nil {
+ return err
+ }
+ }
+ profiles[profile] = struct{}{}
+
+ if err := cfg.validateCredentialType(); err != nil {
+ return err
+ }
+
+ // Link source profiles for assume roles
+ if len(cfg.SourceProfileName) != 0 {
+ // Linked profile via source_profile ignore credential provider
+ // options, the source profile must provide the credentials.
+ cfg.clearCredentialOptions()
+
+ srcCfg := &sharedConfig{}
+ err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts)
+ if err != nil {
+ // SourceProfile that doesn't exist is an error in configuration.
+ if _, ok := err.(SharedConfigProfileNotExistsError); ok {
+ err = SharedConfigAssumeRoleError{
+ RoleARN: cfg.RoleARN,
+ SourceProfile: cfg.SourceProfileName,
+ }
+ }
+ return err
+ }
+
+ if !srcCfg.hasCredentials() {
+ return SharedConfigAssumeRoleError{
+ RoleARN: cfg.RoleARN,
+ SourceProfile: cfg.SourceProfileName,
+ }
+ }
+
+ cfg.SourceProfile = srcCfg
+ }
return nil
}
-// setFromFile loads the configuration from the file using
-// the profile provided. A sharedConfig pointer type value is used so that
-// multiple config file loadings can be chained.
+// setFromFile loads the configuration from the file using the profile
+// provided. A sharedConfig pointer type value is used so that multiple config
+// file loadings can be chained.
//
// Only loads complete logically grouped values, and will not set fields in cfg
-// for incomplete grouped values in the config. Such as credentials. For example
-// if a config file only includes aws_access_key_id but no aws_secret_access_key
-// the aws_access_key_id will be ignored.
-func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile) error {
- section, err := file.IniData.GetSection(profile)
- if err != nil {
+// for incomplete grouped values in the config. Such as credentials. For
+// example if a config file only includes aws_access_key_id but no
+// aws_secret_access_key the aws_access_key_id will be ignored.
+func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error {
+ section, ok := file.IniData.GetSection(profile)
+ if !ok {
// Fallback to to alternate profile name: profile
- section, err = file.IniData.GetSection(fmt.Sprintf("profile %s", profile))
- if err != nil {
- return SharedConfigProfileNotExistsError{Profile: profile, Err: err}
+ section, ok = file.IniData.GetSection(fmt.Sprintf("profile %s", profile))
+ if !ok {
+ return SharedConfigProfileNotExistsError{Profile: profile, Err: nil}
}
}
+ if exOpts {
+ // Assume Role Parameters
+ updateString(&cfg.RoleARN, section, roleArnKey)
+ updateString(&cfg.ExternalID, section, externalIDKey)
+ updateString(&cfg.MFASerial, section, mfaSerialKey)
+ updateString(&cfg.RoleSessionName, section, roleSessionNameKey)
+ updateString(&cfg.SourceProfileName, section, sourceProfileKey)
+ updateString(&cfg.CredentialSource, section, credentialSourceKey)
+
+ updateString(&cfg.Region, section, regionKey)
+ }
+
+ updateString(&cfg.CredentialProcess, section, credentialProcessKey)
+ updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey)
+
// Shared Credentials
- akid := section.Key(accessKeyIDKey).String()
- secret := section.Key(secretAccessKey).String()
- if len(akid) > 0 && len(secret) > 0 {
- cfg.Creds = credentials.Value{
- AccessKeyID: akid,
- SecretAccessKey: secret,
- SessionToken: section.Key(sessionTokenKey).String(),
- ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename),
- }
+ creds := credentials.Value{
+ AccessKeyID: section.String(accessKeyIDKey),
+ SecretAccessKey: section.String(secretAccessKey),
+ SessionToken: section.String(sessionTokenKey),
+ ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename),
+ }
+ if creds.HasKeys() {
+ cfg.Creds = creds
}
- // Assume Role
- roleArn := section.Key(roleArnKey).String()
- srcProfile := section.Key(sourceProfileKey).String()
- if len(roleArn) > 0 && len(srcProfile) > 0 {
- cfg.AssumeRole = assumeRoleConfig{
- RoleARN: roleArn,
- SourceProfile: srcProfile,
- ExternalID: section.Key(externalIDKey).String(),
- MFASerial: section.Key(mfaSerialKey).String(),
- RoleSessionName: section.Key(roleSessionNameKey).String(),
- }
- }
-
- // Region
- if v := section.Key(regionKey).String(); len(v) > 0 {
- cfg.Region = v
+ // Endpoint discovery
+ if section.Has(enableEndpointDiscoveryKey) {
+ v := section.Bool(enableEndpointDiscoveryKey)
+ cfg.EnableEndpointDiscovery = &v
}
return nil
}
+func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error {
+ var credSource string
+
+ switch {
+ case len(cfg.SourceProfileName) != 0:
+ credSource = sourceProfileKey
+ case len(cfg.CredentialSource) != 0:
+ credSource = credentialSourceKey
+ case len(cfg.WebIdentityTokenFile) != 0:
+ credSource = webIdentityTokenFileKey
+ }
+
+ if len(credSource) != 0 && len(cfg.RoleARN) == 0 {
+ return CredentialRequiresARNError{
+ Type: credSource,
+ Profile: profile,
+ }
+ }
+
+ return nil
+}
+
+func (cfg *sharedConfig) validateCredentialType() error {
+ // Only one or no credential type can be defined.
+ if !oneOrNone(
+ len(cfg.SourceProfileName) != 0,
+ len(cfg.CredentialSource) != 0,
+ len(cfg.CredentialProcess) != 0,
+ len(cfg.WebIdentityTokenFile) != 0,
+ ) {
+ return ErrSharedConfigSourceCollision
+ }
+
+ return nil
+}
+
+func (cfg *sharedConfig) hasCredentials() bool {
+ switch {
+ case len(cfg.SourceProfileName) != 0:
+ case len(cfg.CredentialSource) != 0:
+ case len(cfg.CredentialProcess) != 0:
+ case len(cfg.WebIdentityTokenFile) != 0:
+ case cfg.Creds.HasKeys():
+ default:
+ return false
+ }
+
+ return true
+}
+
+func (cfg *sharedConfig) clearCredentialOptions() {
+ cfg.CredentialSource = ""
+ cfg.CredentialProcess = ""
+ cfg.WebIdentityTokenFile = ""
+ cfg.Creds = credentials.Value{}
+}
+
+func (cfg *sharedConfig) clearAssumeRoleOptions() {
+ cfg.RoleARN = ""
+ cfg.ExternalID = ""
+ cfg.MFASerial = ""
+ cfg.RoleSessionName = ""
+ cfg.SourceProfileName = ""
+}
+
+func oneOrNone(bs ...bool) bool {
+ var count int
+
+ for _, b := range bs {
+ if b {
+ count++
+ if count > 1 {
+ return false
+ }
+ }
+ }
+
+ return true
+}
+
+// updateString will only update the dst with the value in the section key, key
+// is present in the section.
+func updateString(dst *string, section ini.Section, key string) {
+ if !section.Has(key) {
+ return
+ }
+ *dst = section.String(key)
+}
+
// SharedConfigLoadError is an error for the shared config file failed to load.
type SharedConfigLoadError struct {
Filename string
@@ -270,7 +405,8 @@ func (e SharedConfigProfileNotExistsError) Error() string {
// profile contains assume role information, but that information is invalid
// or not complete.
type SharedConfigAssumeRoleError struct {
- RoleARN string
+ RoleARN string
+ SourceProfile string
}
// Code is the short id of the error.
@@ -280,8 +416,10 @@ func (e SharedConfigAssumeRoleError) Code() string {
// Message is the description of the error
func (e SharedConfigAssumeRoleError) Message() string {
- return fmt.Sprintf("failed to load assume role for %s, source profile has no shared credentials",
- e.RoleARN)
+ return fmt.Sprintf(
+ "failed to load assume role for %s, source profile %s has no shared credentials",
+ e.RoleARN, e.SourceProfile,
+ )
}
// OrigErr is the underlying error that caused the failure.
@@ -293,3 +431,36 @@ func (e SharedConfigAssumeRoleError) OrigErr() error {
func (e SharedConfigAssumeRoleError) Error() string {
return awserr.SprintError(e.Code(), e.Message(), "", nil)
}
+
+// CredentialRequiresARNError provides the error for shared config credentials
+// that are incorrectly configured in the shared config or credentials file.
+type CredentialRequiresARNError struct {
+ // type of credentials that were configured.
+ Type string
+
+ // Profile name the credentials were in.
+ Profile string
+}
+
+// Code is the short id of the error.
+func (e CredentialRequiresARNError) Code() string {
+ return "CredentialRequiresARNError"
+}
+
+// Message is the description of the error
+func (e CredentialRequiresARNError) Message() string {
+ return fmt.Sprintf(
+ "credential type %s requires role_arn, profile %s",
+ e.Type, e.Profile,
+ )
+}
+
+// OrigErr is the underlying error that caused the failure.
+func (e CredentialRequiresARNError) OrigErr() error {
+ return nil
+}
+
+// Error satisfies the error interface.
+func (e CredentialRequiresARNError) Error() string {
+ return awserr.SprintError(e.Code(), e.Message(), "", nil)
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
index 6e4637612..8104793aa 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go
@@ -98,25 +98,25 @@ var ignoredHeaders = rules{
var requiredSignedHeaders = rules{
whitelist{
mapRule{
- "Cache-Control": struct{}{},
- "Content-Disposition": struct{}{},
- "Content-Encoding": struct{}{},
- "Content-Language": struct{}{},
- "Content-Md5": struct{}{},
- "Content-Type": struct{}{},
- "Expires": struct{}{},
- "If-Match": struct{}{},
- "If-Modified-Since": struct{}{},
- "If-None-Match": struct{}{},
- "If-Unmodified-Since": struct{}{},
- "Range": struct{}{},
- "X-Amz-Acl": struct{}{},
- "X-Amz-Copy-Source": struct{}{},
- "X-Amz-Copy-Source-If-Match": struct{}{},
- "X-Amz-Copy-Source-If-Modified-Since": struct{}{},
- "X-Amz-Copy-Source-If-None-Match": struct{}{},
- "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
- "X-Amz-Copy-Source-Range": struct{}{},
+ "Cache-Control": struct{}{},
+ "Content-Disposition": struct{}{},
+ "Content-Encoding": struct{}{},
+ "Content-Language": struct{}{},
+ "Content-Md5": struct{}{},
+ "Content-Type": struct{}{},
+ "Expires": struct{}{},
+ "If-Match": struct{}{},
+ "If-Modified-Since": struct{}{},
+ "If-None-Match": struct{}{},
+ "If-Unmodified-Since": struct{}{},
+ "Range": struct{}{},
+ "X-Amz-Acl": struct{}{},
+ "X-Amz-Copy-Source": struct{}{},
+ "X-Amz-Copy-Source-If-Match": struct{}{},
+ "X-Amz-Copy-Source-If-Modified-Since": struct{}{},
+ "X-Amz-Copy-Source-If-None-Match": struct{}{},
+ "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{},
+ "X-Amz-Copy-Source-Range": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
@@ -134,7 +134,9 @@ var requiredSignedHeaders = rules{
"X-Amz-Server-Side-Encryption-Customer-Key": struct{}{},
"X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
"X-Amz-Storage-Class": struct{}{},
+ "X-Amz-Tagging": struct{}{},
"X-Amz-Website-Redirect-Location": struct{}{},
+ "X-Amz-Content-Sha256": struct{}{},
},
},
patterns{"X-Amz-Meta-"},
@@ -180,7 +182,7 @@ type Signer struct {
// http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html
DisableURIPathEscaping bool
- // Disales the automatical setting of the HTTP request's Body field with the
+ // Disables the automatical setting of the HTTP request's Body field with the
// io.ReadSeeker passed in to the signer. This is useful if you're using a
// custom wrapper around the body for the io.ReadSeeker and want to preserve
// the Body value on the Request.Body.
@@ -420,7 +422,7 @@ var SignRequestHandler = request.NamedHandler{
// If the credentials of the request's config are set to
// credentials.AnonymousCredentials the request will not be signed.
func SignSDKRequest(req *request.Request) {
- signSDKRequestWithCurrTime(req, time.Now)
+ SignSDKRequestWithCurrentTime(req, time.Now)
}
// BuildNamedHandler will build a generic handler for signing.
@@ -428,12 +430,15 @@ func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler
return request.NamedHandler{
Name: name,
Fn: func(req *request.Request) {
- signSDKRequestWithCurrTime(req, time.Now, opts...)
+ SignSDKRequestWithCurrentTime(req, time.Now, opts...)
},
}
}
-func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) {
+// SignSDKRequestWithCurrentTime will sign the SDK's request using the time
+// function passed in. Behaves the same as SignSDKRequest with the exception
+// the request is signed with the value returned by the current time function.
+func SignSDKRequestWithCurrentTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) {
// If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used.
if req.Config.Credentials == credentials.AnonymousCredentials {
@@ -469,13 +474,9 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
opt(v4)
}
- signingTime := req.Time
- if !req.LastSignedAt.IsZero() {
- signingTime = req.LastSignedAt
- }
-
+ curTime := curTimeFn()
signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(),
- name, region, req.ExpireTime, req.ExpireTime > 0, signingTime,
+ name, region, req.ExpireTime, req.ExpireTime > 0, curTime,
)
if err != nil {
req.Error = err
@@ -484,7 +485,7 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
}
req.SignedHeaderVals = signedHeaders
- req.LastSignedAt = curTimeFn()
+ req.LastSignedAt = curTime
}
const logSignInfoMsg = `DEBUG: Request Signature:
@@ -671,17 +672,29 @@ func (ctx *signingCtx) buildSignature() {
func (ctx *signingCtx) buildBodyDigest() error {
hash := ctx.Request.Header.Get("X-Amz-Content-Sha256")
if hash == "" {
- if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") {
+ includeSHA256Header := ctx.unsignedPayload ||
+ ctx.ServiceName == "s3" ||
+ ctx.ServiceName == "glacier"
+
+ s3Presign := ctx.isPresign && ctx.ServiceName == "s3"
+
+ if ctx.unsignedPayload || s3Presign {
hash = "UNSIGNED-PAYLOAD"
+ includeSHA256Header = !s3Presign
} else if ctx.Body == nil {
hash = emptyStringSHA256
} else {
if !aws.IsReaderSeekable(ctx.Body) {
return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body)
}
- hash = hex.EncodeToString(makeSha256Reader(ctx.Body))
+ hashBytes, err := makeSha256Reader(ctx.Body)
+ if err != nil {
+ return err
+ }
+ hash = hex.EncodeToString(hashBytes)
}
- if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" {
+
+ if includeSHA256Header {
ctx.Request.Header.Set("X-Amz-Content-Sha256", hash)
}
}
@@ -725,19 +738,33 @@ func makeSha256(data []byte) []byte {
return hash.Sum(nil)
}
-func makeSha256Reader(reader io.ReadSeeker) []byte {
+func makeSha256Reader(reader io.ReadSeeker) (hashBytes []byte, err error) {
hash := sha256.New()
- start, _ := reader.Seek(0, sdkio.SeekCurrent)
- defer reader.Seek(start, sdkio.SeekStart)
+ start, err := reader.Seek(0, sdkio.SeekCurrent)
+ if err != nil {
+ return nil, err
+ }
+ defer func() {
+ // ensure error is return if unable to seek back to start of payload.
+ _, err = reader.Seek(start, sdkio.SeekStart)
+ }()
- io.Copy(hash, reader)
- return hash.Sum(nil)
+ // Use CopyN to avoid allocating the 32KB buffer in io.Copy for bodies
+ // smaller than 32KB. Fall back to io.Copy if we fail to determine the size.
+ size, err := aws.SeekerLen(reader)
+ if err != nil {
+ io.Copy(hash, reader)
+ } else {
+ io.CopyN(hash, reader, size)
+ }
+
+ return hash.Sum(nil), nil
}
const doubleSpace = " "
// stripExcessSpaces will rewrite the passed in slice's string values to not
-// contain muliple side-by-side spaces.
+// contain multiple side-by-side spaces.
func stripExcessSpaces(vals []string) {
var j, k, l, m, spaces int
for i, str := range vals {
diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go
index 8b6f23425..455091540 100644
--- a/vendor/github.com/aws/aws-sdk-go/aws/types.go
+++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go
@@ -7,13 +7,18 @@ import (
"github.com/aws/aws-sdk-go/internal/sdkio"
)
-// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should
-// only be used with an io.Reader that is also an io.Seeker. Doing so may
-// cause request signature errors, or request body's not sent for GET, HEAD
-// and DELETE HTTP methods.
+// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the
+// SDK to accept an io.Reader that is not also an io.Seeker for unsigned
+// streaming payload API operations.
//
-// Deprecated: Should only be used with io.ReadSeeker. If using for
-// S3 PutObject to stream content use s3manager.Uploader instead.
+// A ReadSeekCloser wrapping an nonseekable io.Reader used in an API
+// operation's input will prevent that operation being retried in the case of
+// network errors, and cause operation requests to fail if the operation
+// requires payload signing.
+//
+// Note: If using With S3 PutObject to stream an object upload The SDK's S3
+// Upload manager (s3manager.Uploader) provides support for streaming with the
+// ability to retry network errors.
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser {
return ReaderSeekerCloser{r}
}
@@ -43,7 +48,8 @@ func IsReaderSeekable(r io.Reader) bool {
// Read reads from the reader up to size of p. The number of bytes read, and
// error if it occurred will be returned.
//
-// If the reader is not an io.Reader zero bytes read, and nil error will be returned.
+// If the reader is not an io.Reader zero bytes read, and nil error will be
+// returned.
//
// Performs the same functionality as io.Reader Read
func (r ReaderSeekerCloser) Read(p []byte) (int, error) {
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 22ae23fa2..d8bfc8c60 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.13.54"
+const SDKVersion = "1.21.9"
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go
new file mode 100644
index 000000000..e83a99886
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ast.go
@@ -0,0 +1,120 @@
+package ini
+
+// ASTKind represents different states in the parse table
+// and the type of AST that is being constructed
+type ASTKind int
+
+// ASTKind* is used in the parse table to transition between
+// the different states
+const (
+ ASTKindNone = ASTKind(iota)
+ ASTKindStart
+ ASTKindExpr
+ ASTKindEqualExpr
+ ASTKindStatement
+ ASTKindSkipStatement
+ ASTKindExprStatement
+ ASTKindSectionStatement
+ ASTKindNestedSectionStatement
+ ASTKindCompletedNestedSectionStatement
+ ASTKindCommentStatement
+ ASTKindCompletedSectionStatement
+)
+
+func (k ASTKind) String() string {
+ switch k {
+ case ASTKindNone:
+ return "none"
+ case ASTKindStart:
+ return "start"
+ case ASTKindExpr:
+ return "expr"
+ case ASTKindStatement:
+ return "stmt"
+ case ASTKindSectionStatement:
+ return "section_stmt"
+ case ASTKindExprStatement:
+ return "expr_stmt"
+ case ASTKindCommentStatement:
+ return "comment"
+ case ASTKindNestedSectionStatement:
+ return "nested_section_stmt"
+ case ASTKindCompletedSectionStatement:
+ return "completed_stmt"
+ case ASTKindSkipStatement:
+ return "skip"
+ default:
+ return ""
+ }
+}
+
+// AST interface allows us to determine what kind of node we
+// are on and casting may not need to be necessary.
+//
+// The root is always the first node in Children
+type AST struct {
+ Kind ASTKind
+ Root Token
+ RootToken bool
+ Children []AST
+}
+
+func newAST(kind ASTKind, root AST, children ...AST) AST {
+ return AST{
+ Kind: kind,
+ Children: append([]AST{root}, children...),
+ }
+}
+
+func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST {
+ return AST{
+ Kind: kind,
+ Root: root,
+ RootToken: true,
+ Children: children,
+ }
+}
+
+// AppendChild will append to the list of children an AST has.
+func (a *AST) AppendChild(child AST) {
+ a.Children = append(a.Children, child)
+}
+
+// GetRoot will return the root AST which can be the first entry
+// in the children list or a token.
+func (a *AST) GetRoot() AST {
+ if a.RootToken {
+ return *a
+ }
+
+ if len(a.Children) == 0 {
+ return AST{}
+ }
+
+ return a.Children[0]
+}
+
+// GetChildren will return the current AST's list of children
+func (a *AST) GetChildren() []AST {
+ if len(a.Children) == 0 {
+ return []AST{}
+ }
+
+ if a.RootToken {
+ return a.Children
+ }
+
+ return a.Children[1:]
+}
+
+// SetChildren will set and override all children of the AST.
+func (a *AST) SetChildren(children []AST) {
+ if a.RootToken {
+ a.Children = children
+ } else {
+ a.Children = append(a.Children[:1], children...)
+ }
+}
+
+// Start is used to indicate the starting state of the parse table.
+var Start = newAST(ASTKindStart, AST{})
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go
new file mode 100644
index 000000000..0895d53cb
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go
@@ -0,0 +1,11 @@
+package ini
+
+var commaRunes = []rune(",")
+
+func isComma(b rune) bool {
+ return b == ','
+}
+
+func newCommaToken() Token {
+ return newToken(TokenComma, commaRunes, NoneType)
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go
new file mode 100644
index 000000000..0b76999ba
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go
@@ -0,0 +1,35 @@
+package ini
+
+// isComment will return whether or not the next byte(s) is a
+// comment.
+func isComment(b []rune) bool {
+ if len(b) == 0 {
+ return false
+ }
+
+ switch b[0] {
+ case ';':
+ return true
+ case '#':
+ return true
+ }
+
+ return false
+}
+
+// newCommentToken will create a comment token and
+// return how many bytes were read.
+func newCommentToken(b []rune) (Token, int, error) {
+ i := 0
+ for ; i < len(b); i++ {
+ if b[i] == '\n' {
+ break
+ }
+
+ if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' {
+ break
+ }
+ }
+
+ return newToken(TokenComment, b[:i], NoneType), i, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go
new file mode 100644
index 000000000..25ce0fe13
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go
@@ -0,0 +1,29 @@
+// Package ini is an LL(1) parser for configuration files.
+//
+// Example:
+// sections, err := ini.OpenFile("/path/to/file")
+// if err != nil {
+// panic(err)
+// }
+//
+// profile := "foo"
+// section, ok := sections.GetSection(profile)
+// if !ok {
+// fmt.Printf("section %q could not be found", profile)
+// }
+//
+// Below is the BNF that describes this parser
+// Grammar:
+// stmt -> value stmt'
+// stmt' -> epsilon | op stmt
+// value -> number | string | boolean | quoted_string
+//
+// section -> [ section'
+// section' -> value section_close
+// section_close -> ]
+//
+// SkipState will skip (NL WS)+
+//
+// comment -> # comment' | ; comment'
+// comment' -> epsilon | value
+package ini
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go
new file mode 100644
index 000000000..04345a54c
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go
@@ -0,0 +1,4 @@
+package ini
+
+// emptyToken is used to satisfy the Token interface
+var emptyToken = newToken(TokenNone, []rune{}, NoneType)
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go
new file mode 100644
index 000000000..91ba2a59d
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go
@@ -0,0 +1,24 @@
+package ini
+
+// newExpression will return an expression AST.
+// Expr represents an expression
+//
+// grammar:
+// expr -> string | number
+func newExpression(tok Token) AST {
+ return newASTWithRootToken(ASTKindExpr, tok)
+}
+
+func newEqualExpr(left AST, tok Token) AST {
+ return newASTWithRootToken(ASTKindEqualExpr, tok, left)
+}
+
+// EqualExprKey will return a LHS value in the equal expr
+func EqualExprKey(ast AST) string {
+ children := ast.GetChildren()
+ if len(children) == 0 || ast.Kind != ASTKindEqualExpr {
+ return ""
+ }
+
+ return string(children[0].Root.Raw())
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go
new file mode 100644
index 000000000..8d462f77e
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go
@@ -0,0 +1,17 @@
+// +build gofuzz
+
+package ini
+
+import (
+ "bytes"
+)
+
+func Fuzz(data []byte) int {
+ b := bytes.NewReader(data)
+
+ if _, err := Parse(b); err != nil {
+ return 0
+ }
+
+ return 1
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go
new file mode 100644
index 000000000..3b0ca7afe
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go
@@ -0,0 +1,51 @@
+package ini
+
+import (
+ "io"
+ "os"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
+)
+
+// OpenFile takes a path to a given file, and will open and parse
+// that file.
+func OpenFile(path string) (Sections, error) {
+ f, err := os.Open(path)
+ if err != nil {
+ return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err)
+ }
+ defer f.Close()
+
+ return Parse(f)
+}
+
+// Parse will parse the given file using the shared config
+// visitor.
+func Parse(f io.Reader) (Sections, error) {
+ tree, err := ParseAST(f)
+ if err != nil {
+ return Sections{}, err
+ }
+
+ v := NewDefaultVisitor()
+ if err = Walk(tree, v); err != nil {
+ return Sections{}, err
+ }
+
+ return v.Sections, nil
+}
+
+// ParseBytes will parse the given bytes and return the parsed sections.
+func ParseBytes(b []byte) (Sections, error) {
+ tree, err := ParseASTBytes(b)
+ if err != nil {
+ return Sections{}, err
+ }
+
+ v := NewDefaultVisitor()
+ if err = Walk(tree, v); err != nil {
+ return Sections{}, err
+ }
+
+ return v.Sections, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go
new file mode 100644
index 000000000..582c024ad
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go
@@ -0,0 +1,165 @@
+package ini
+
+import (
+ "bytes"
+ "io"
+ "io/ioutil"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
+)
+
+const (
+ // ErrCodeUnableToReadFile is used when a file is failed to be
+ // opened or read from.
+ ErrCodeUnableToReadFile = "FailedRead"
+)
+
+// TokenType represents the various different tokens types
+type TokenType int
+
+func (t TokenType) String() string {
+ switch t {
+ case TokenNone:
+ return "none"
+ case TokenLit:
+ return "literal"
+ case TokenSep:
+ return "sep"
+ case TokenOp:
+ return "op"
+ case TokenWS:
+ return "ws"
+ case TokenNL:
+ return "newline"
+ case TokenComment:
+ return "comment"
+ case TokenComma:
+ return "comma"
+ default:
+ return ""
+ }
+}
+
+// TokenType enums
+const (
+ TokenNone = TokenType(iota)
+ TokenLit
+ TokenSep
+ TokenComma
+ TokenOp
+ TokenWS
+ TokenNL
+ TokenComment
+)
+
+type iniLexer struct{}
+
+// Tokenize will return a list of tokens during lexical analysis of the
+// io.Reader.
+func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) {
+ b, err := ioutil.ReadAll(r)
+ if err != nil {
+ return nil, awserr.New(ErrCodeUnableToReadFile, "unable to read file", err)
+ }
+
+ return l.tokenize(b)
+}
+
+func (l *iniLexer) tokenize(b []byte) ([]Token, error) {
+ runes := bytes.Runes(b)
+ var err error
+ n := 0
+ tokenAmount := countTokens(runes)
+ tokens := make([]Token, tokenAmount)
+ count := 0
+
+ for len(runes) > 0 && count < tokenAmount {
+ switch {
+ case isWhitespace(runes[0]):
+ tokens[count], n, err = newWSToken(runes)
+ case isComma(runes[0]):
+ tokens[count], n = newCommaToken(), 1
+ case isComment(runes):
+ tokens[count], n, err = newCommentToken(runes)
+ case isNewline(runes):
+ tokens[count], n, err = newNewlineToken(runes)
+ case isSep(runes):
+ tokens[count], n, err = newSepToken(runes)
+ case isOp(runes):
+ tokens[count], n, err = newOpToken(runes)
+ default:
+ tokens[count], n, err = newLitToken(runes)
+ }
+
+ if err != nil {
+ return nil, err
+ }
+
+ count++
+
+ runes = runes[n:]
+ }
+
+ return tokens[:count], nil
+}
+
+func countTokens(runes []rune) int {
+ count, n := 0, 0
+ var err error
+
+ for len(runes) > 0 {
+ switch {
+ case isWhitespace(runes[0]):
+ _, n, err = newWSToken(runes)
+ case isComma(runes[0]):
+ _, n = newCommaToken(), 1
+ case isComment(runes):
+ _, n, err = newCommentToken(runes)
+ case isNewline(runes):
+ _, n, err = newNewlineToken(runes)
+ case isSep(runes):
+ _, n, err = newSepToken(runes)
+ case isOp(runes):
+ _, n, err = newOpToken(runes)
+ default:
+ _, n, err = newLitToken(runes)
+ }
+
+ if err != nil {
+ return 0
+ }
+
+ count++
+ runes = runes[n:]
+ }
+
+ return count + 1
+}
+
+// Token indicates a metadata about a given value.
+type Token struct {
+ t TokenType
+ ValueType ValueType
+ base int
+ raw []rune
+}
+
+var emptyValue = Value{}
+
+func newToken(t TokenType, raw []rune, v ValueType) Token {
+ return Token{
+ t: t,
+ raw: raw,
+ ValueType: v,
+ }
+}
+
+// Raw return the raw runes that were consumed
+func (tok Token) Raw() []rune {
+ return tok.raw
+}
+
+// Type returns the token type
+func (tok Token) Type() TokenType {
+ return tok.t
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go
new file mode 100644
index 000000000..e56dcee2f
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go
@@ -0,0 +1,349 @@
+package ini
+
+import (
+ "fmt"
+ "io"
+)
+
+// State enums for the parse table
+const (
+ InvalidState = iota
+ // stmt -> value stmt'
+ StatementState
+ // stmt' -> MarkComplete | op stmt
+ StatementPrimeState
+ // value -> number | string | boolean | quoted_string
+ ValueState
+ // section -> [ section'
+ OpenScopeState
+ // section' -> value section_close
+ SectionState
+ // section_close -> ]
+ CloseScopeState
+ // SkipState will skip (NL WS)+
+ SkipState
+ // SkipTokenState will skip any token and push the previous
+ // state onto the stack.
+ SkipTokenState
+ // comment -> # comment' | ; comment'
+ // comment' -> MarkComplete | value
+ CommentState
+ // MarkComplete state will complete statements and move that
+ // to the completed AST list
+ MarkCompleteState
+ // TerminalState signifies that the tokens have been fully parsed
+ TerminalState
+)
+
+// parseTable is a state machine to dictate the grammar above.
+var parseTable = map[ASTKind]map[TokenType]int{
+ ASTKindStart: map[TokenType]int{
+ TokenLit: StatementState,
+ TokenSep: OpenScopeState,
+ TokenWS: SkipTokenState,
+ TokenNL: SkipTokenState,
+ TokenComment: CommentState,
+ TokenNone: TerminalState,
+ },
+ ASTKindCommentStatement: map[TokenType]int{
+ TokenLit: StatementState,
+ TokenSep: OpenScopeState,
+ TokenWS: SkipTokenState,
+ TokenNL: SkipTokenState,
+ TokenComment: CommentState,
+ TokenNone: MarkCompleteState,
+ },
+ ASTKindExpr: map[TokenType]int{
+ TokenOp: StatementPrimeState,
+ TokenLit: ValueState,
+ TokenSep: OpenScopeState,
+ TokenWS: ValueState,
+ TokenNL: SkipState,
+ TokenComment: CommentState,
+ TokenNone: MarkCompleteState,
+ },
+ ASTKindEqualExpr: map[TokenType]int{
+ TokenLit: ValueState,
+ TokenWS: SkipTokenState,
+ TokenNL: SkipState,
+ },
+ ASTKindStatement: map[TokenType]int{
+ TokenLit: SectionState,
+ TokenSep: CloseScopeState,
+ TokenWS: SkipTokenState,
+ TokenNL: SkipTokenState,
+ TokenComment: CommentState,
+ TokenNone: MarkCompleteState,
+ },
+ ASTKindExprStatement: map[TokenType]int{
+ TokenLit: ValueState,
+ TokenSep: OpenScopeState,
+ TokenOp: ValueState,
+ TokenWS: ValueState,
+ TokenNL: MarkCompleteState,
+ TokenComment: CommentState,
+ TokenNone: TerminalState,
+ TokenComma: SkipState,
+ },
+ ASTKindSectionStatement: map[TokenType]int{
+ TokenLit: SectionState,
+ TokenOp: SectionState,
+ TokenSep: CloseScopeState,
+ TokenWS: SectionState,
+ TokenNL: SkipTokenState,
+ },
+ ASTKindCompletedSectionStatement: map[TokenType]int{
+ TokenWS: SkipTokenState,
+ TokenNL: SkipTokenState,
+ TokenLit: StatementState,
+ TokenSep: OpenScopeState,
+ TokenComment: CommentState,
+ TokenNone: MarkCompleteState,
+ },
+ ASTKindSkipStatement: map[TokenType]int{
+ TokenLit: StatementState,
+ TokenSep: OpenScopeState,
+ TokenWS: SkipTokenState,
+ TokenNL: SkipTokenState,
+ TokenComment: CommentState,
+ TokenNone: TerminalState,
+ },
+}
+
+// ParseAST will parse input from an io.Reader using
+// an LL(1) parser.
+func ParseAST(r io.Reader) ([]AST, error) {
+ lexer := iniLexer{}
+ tokens, err := lexer.Tokenize(r)
+ if err != nil {
+ return []AST{}, err
+ }
+
+ return parse(tokens)
+}
+
+// ParseASTBytes will parse input from a byte slice using
+// an LL(1) parser.
+func ParseASTBytes(b []byte) ([]AST, error) {
+ lexer := iniLexer{}
+ tokens, err := lexer.tokenize(b)
+ if err != nil {
+ return []AST{}, err
+ }
+
+ return parse(tokens)
+}
+
+func parse(tokens []Token) ([]AST, error) {
+ start := Start
+ stack := newParseStack(3, len(tokens))
+
+ stack.Push(start)
+ s := newSkipper()
+
+loop:
+ for stack.Len() > 0 {
+ k := stack.Pop()
+
+ var tok Token
+ if len(tokens) == 0 {
+ // this occurs when all the tokens have been processed
+ // but reduction of what's left on the stack needs to
+ // occur.
+ tok = emptyToken
+ } else {
+ tok = tokens[0]
+ }
+
+ step := parseTable[k.Kind][tok.Type()]
+ if s.ShouldSkip(tok) {
+ // being in a skip state with no tokens will break out of
+ // the parse loop since there is nothing left to process.
+ if len(tokens) == 0 {
+ break loop
+ }
+
+ step = SkipTokenState
+ }
+
+ switch step {
+ case TerminalState:
+ // Finished parsing. Push what should be the last
+ // statement to the stack. If there is anything left
+ // on the stack, an error in parsing has occurred.
+ if k.Kind != ASTKindStart {
+ stack.MarkComplete(k)
+ }
+ break loop
+ case SkipTokenState:
+ // When skipping a token, the previous state was popped off the stack.
+ // To maintain the correct state, the previous state will be pushed
+ // onto the stack.
+ stack.Push(k)
+ case StatementState:
+ if k.Kind != ASTKindStart {
+ stack.MarkComplete(k)
+ }
+ expr := newExpression(tok)
+ stack.Push(expr)
+ case StatementPrimeState:
+ if tok.Type() != TokenOp {
+ stack.MarkComplete(k)
+ continue
+ }
+
+ if k.Kind != ASTKindExpr {
+ return nil, NewParseError(
+ fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k),
+ )
+ }
+
+ k = trimSpaces(k)
+ expr := newEqualExpr(k, tok)
+ stack.Push(expr)
+ case ValueState:
+ // ValueState requires the previous state to either be an equal expression
+ // or an expression statement.
+ //
+ // This grammar occurs when the RHS is a number, word, or quoted string.
+ // equal_expr -> lit op equal_expr'
+ // equal_expr' -> number | string | quoted_string
+ // quoted_string -> " quoted_string'
+ // quoted_string' -> string quoted_string_end
+ // quoted_string_end -> "
+ //
+ // otherwise
+ // expr_stmt -> equal_expr (expr_stmt')*
+ // expr_stmt' -> ws S | op S | MarkComplete
+ // S -> equal_expr' expr_stmt'
+ switch k.Kind {
+ case ASTKindEqualExpr:
+ // assiging a value to some key
+ k.AppendChild(newExpression(tok))
+ stack.Push(newExprStatement(k))
+ case ASTKindExpr:
+ k.Root.raw = append(k.Root.raw, tok.Raw()...)
+ stack.Push(k)
+ case ASTKindExprStatement:
+ root := k.GetRoot()
+ children := root.GetChildren()
+ if len(children) == 0 {
+ return nil, NewParseError(
+ fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind),
+ )
+ }
+
+ rhs := children[len(children)-1]
+
+ if rhs.Root.ValueType != QuotedStringType {
+ rhs.Root.ValueType = StringType
+ rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...)
+
+ }
+
+ children[len(children)-1] = rhs
+ k.SetChildren(children)
+
+ stack.Push(k)
+ }
+ case OpenScopeState:
+ if !runeCompare(tok.Raw(), openBrace) {
+ return nil, NewParseError("expected '['")
+ }
+
+ stmt := newStatement()
+ stack.Push(stmt)
+ case CloseScopeState:
+ if !runeCompare(tok.Raw(), closeBrace) {
+ return nil, NewParseError("expected ']'")
+ }
+
+ k = trimSpaces(k)
+ stack.Push(newCompletedSectionStatement(k))
+ case SectionState:
+ var stmt AST
+
+ switch k.Kind {
+ case ASTKindStatement:
+ // If there are multiple literals inside of a scope declaration,
+ // then the current token's raw value will be appended to the Name.
+ //
+ // This handles cases like [ profile default ]
+ //
+ // k will represent a SectionStatement with the children representing
+ // the label of the section
+ stmt = newSectionStatement(tok)
+ case ASTKindSectionStatement:
+ k.Root.raw = append(k.Root.raw, tok.Raw()...)
+ stmt = k
+ default:
+ return nil, NewParseError(
+ fmt.Sprintf("invalid statement: expected statement: %v", k.Kind),
+ )
+ }
+
+ stack.Push(stmt)
+ case MarkCompleteState:
+ if k.Kind != ASTKindStart {
+ stack.MarkComplete(k)
+ }
+
+ if stack.Len() == 0 {
+ stack.Push(start)
+ }
+ case SkipState:
+ stack.Push(newSkipStatement(k))
+ s.Skip()
+ case CommentState:
+ if k.Kind == ASTKindStart {
+ stack.Push(k)
+ } else {
+ stack.MarkComplete(k)
+ }
+
+ stmt := newCommentStatement(tok)
+ stack.Push(stmt)
+ default:
+ return nil, NewParseError(
+ fmt.Sprintf("invalid state with ASTKind %v and TokenType %v",
+ k, tok.Type()))
+ }
+
+ if len(tokens) > 0 {
+ tokens = tokens[1:]
+ }
+ }
+
+ // this occurs when a statement has not been completed
+ if stack.top > 1 {
+ return nil, NewParseError(fmt.Sprintf("incomplete ini expression"))
+ }
+
+ // returns a sublist which excludes the start symbol
+ return stack.List(), nil
+}
+
+// trimSpaces will trim spaces on the left and right hand side of
+// the literal.
+func trimSpaces(k AST) AST {
+ // trim left hand side of spaces
+ for i := 0; i < len(k.Root.raw); i++ {
+ if !isWhitespace(k.Root.raw[i]) {
+ break
+ }
+
+ k.Root.raw = k.Root.raw[1:]
+ i--
+ }
+
+ // trim right hand side of spaces
+ for i := len(k.Root.raw) - 1; i >= 0; i-- {
+ if !isWhitespace(k.Root.raw[i]) {
+ break
+ }
+
+ k.Root.raw = k.Root.raw[:len(k.Root.raw)-1]
+ }
+
+ return k
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go
new file mode 100644
index 000000000..24df543d3
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/literal_tokens.go
@@ -0,0 +1,324 @@
+package ini
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+var (
+ runesTrue = []rune("true")
+ runesFalse = []rune("false")
+)
+
+var literalValues = [][]rune{
+ runesTrue,
+ runesFalse,
+}
+
+func isBoolValue(b []rune) bool {
+ for _, lv := range literalValues {
+ if isLitValue(lv, b) {
+ return true
+ }
+ }
+ return false
+}
+
+func isLitValue(want, have []rune) bool {
+ if len(have) < len(want) {
+ return false
+ }
+
+ for i := 0; i < len(want); i++ {
+ if want[i] != have[i] {
+ return false
+ }
+ }
+
+ return true
+}
+
+// isNumberValue will return whether not the leading characters in
+// a byte slice is a number. A number is delimited by whitespace or
+// the newline token.
+//
+// A number is defined to be in a binary, octal, decimal (int | float), hex format,
+// or in scientific notation.
+func isNumberValue(b []rune) bool {
+ negativeIndex := 0
+ helper := numberHelper{}
+ needDigit := false
+
+ for i := 0; i < len(b); i++ {
+ negativeIndex++
+
+ switch b[i] {
+ case '-':
+ if helper.IsNegative() || negativeIndex != 1 {
+ return false
+ }
+ helper.Determine(b[i])
+ needDigit = true
+ continue
+ case 'e', 'E':
+ if err := helper.Determine(b[i]); err != nil {
+ return false
+ }
+ negativeIndex = 0
+ needDigit = true
+ continue
+ case 'b':
+ if helper.numberFormat == hex {
+ break
+ }
+ fallthrough
+ case 'o', 'x':
+ needDigit = true
+ if i == 0 {
+ return false
+ }
+
+ fallthrough
+ case '.':
+ if err := helper.Determine(b[i]); err != nil {
+ return false
+ }
+ needDigit = true
+ continue
+ }
+
+ if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) {
+ return !needDigit
+ }
+
+ if !helper.CorrectByte(b[i]) {
+ return false
+ }
+ needDigit = false
+ }
+
+ return !needDigit
+}
+
+func isValid(b []rune) (bool, int, error) {
+ if len(b) == 0 {
+ // TODO: should probably return an error
+ return false, 0, nil
+ }
+
+ return isValidRune(b[0]), 1, nil
+}
+
+func isValidRune(r rune) bool {
+ return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n'
+}
+
+// ValueType is an enum that will signify what type
+// the Value is
+type ValueType int
+
+func (v ValueType) String() string {
+ switch v {
+ case NoneType:
+ return "NONE"
+ case DecimalType:
+ return "FLOAT"
+ case IntegerType:
+ return "INT"
+ case StringType:
+ return "STRING"
+ case BoolType:
+ return "BOOL"
+ }
+
+ return ""
+}
+
+// ValueType enums
+const (
+ NoneType = ValueType(iota)
+ DecimalType
+ IntegerType
+ StringType
+ QuotedStringType
+ BoolType
+)
+
+// Value is a union container
+type Value struct {
+ Type ValueType
+ raw []rune
+
+ integer int64
+ decimal float64
+ boolean bool
+ str string
+}
+
+func newValue(t ValueType, base int, raw []rune) (Value, error) {
+ v := Value{
+ Type: t,
+ raw: raw,
+ }
+ var err error
+
+ switch t {
+ case DecimalType:
+ v.decimal, err = strconv.ParseFloat(string(raw), 64)
+ case IntegerType:
+ if base != 10 {
+ raw = raw[2:]
+ }
+
+ v.integer, err = strconv.ParseInt(string(raw), base, 64)
+ case StringType:
+ v.str = string(raw)
+ case QuotedStringType:
+ v.str = string(raw[1 : len(raw)-1])
+ case BoolType:
+ v.boolean = runeCompare(v.raw, runesTrue)
+ }
+
+ // issue 2253
+ //
+ // if the value trying to be parsed is too large, then we will use
+ // the 'StringType' and raw value instead.
+ if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange {
+ v.Type = StringType
+ v.str = string(raw)
+ err = nil
+ }
+
+ return v, err
+}
+
+// Append will append values and change the type to a string
+// type.
+func (v *Value) Append(tok Token) {
+ r := tok.Raw()
+ if v.Type != QuotedStringType {
+ v.Type = StringType
+ r = tok.raw[1 : len(tok.raw)-1]
+ }
+ if tok.Type() != TokenLit {
+ v.raw = append(v.raw, tok.Raw()...)
+ } else {
+ v.raw = append(v.raw, r...)
+ }
+}
+
+func (v Value) String() string {
+ switch v.Type {
+ case DecimalType:
+ return fmt.Sprintf("decimal: %f", v.decimal)
+ case IntegerType:
+ return fmt.Sprintf("integer: %d", v.integer)
+ case StringType:
+ return fmt.Sprintf("string: %s", string(v.raw))
+ case QuotedStringType:
+ return fmt.Sprintf("quoted string: %s", string(v.raw))
+ case BoolType:
+ return fmt.Sprintf("bool: %t", v.boolean)
+ default:
+ return "union not set"
+ }
+}
+
+func newLitToken(b []rune) (Token, int, error) {
+ n := 0
+ var err error
+
+ token := Token{}
+ if b[0] == '"' {
+ n, err = getStringValue(b)
+ if err != nil {
+ return token, n, err
+ }
+
+ token = newToken(TokenLit, b[:n], QuotedStringType)
+ } else if isNumberValue(b) {
+ var base int
+ base, n, err = getNumericalValue(b)
+ if err != nil {
+ return token, 0, err
+ }
+
+ value := b[:n]
+ vType := IntegerType
+ if contains(value, '.') || hasExponent(value) {
+ vType = DecimalType
+ }
+ token = newToken(TokenLit, value, vType)
+ token.base = base
+ } else if isBoolValue(b) {
+ n, err = getBoolValue(b)
+
+ token = newToken(TokenLit, b[:n], BoolType)
+ } else {
+ n, err = getValue(b)
+ token = newToken(TokenLit, b[:n], StringType)
+ }
+
+ return token, n, err
+}
+
+// IntValue returns an integer value
+func (v Value) IntValue() int64 {
+ return v.integer
+}
+
+// FloatValue returns a float value
+func (v Value) FloatValue() float64 {
+ return v.decimal
+}
+
+// BoolValue returns a bool value
+func (v Value) BoolValue() bool {
+ return v.boolean
+}
+
+func isTrimmable(r rune) bool {
+ switch r {
+ case '\n', ' ':
+ return true
+ }
+ return false
+}
+
+// StringValue returns the string value
+func (v Value) StringValue() string {
+ switch v.Type {
+ case StringType:
+ return strings.TrimFunc(string(v.raw), isTrimmable)
+ case QuotedStringType:
+ // preserve all characters in the quotes
+ return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1]))
+ default:
+ return strings.TrimFunc(string(v.raw), isTrimmable)
+ }
+}
+
+func contains(runes []rune, c rune) bool {
+ for i := 0; i < len(runes); i++ {
+ if runes[i] == c {
+ return true
+ }
+ }
+
+ return false
+}
+
+func runeCompare(v1 []rune, v2 []rune) bool {
+ if len(v1) != len(v2) {
+ return false
+ }
+
+ for i := 0; i < len(v1); i++ {
+ if v1[i] != v2[i] {
+ return false
+ }
+ }
+
+ return true
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go
new file mode 100644
index 000000000..e52ac399f
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go
@@ -0,0 +1,30 @@
+package ini
+
+func isNewline(b []rune) bool {
+ if len(b) == 0 {
+ return false
+ }
+
+ if b[0] == '\n' {
+ return true
+ }
+
+ if len(b) < 2 {
+ return false
+ }
+
+ return b[0] == '\r' && b[1] == '\n'
+}
+
+func newNewlineToken(b []rune) (Token, int, error) {
+ i := 1
+ if b[0] == '\r' && isNewline(b[1:]) {
+ i++
+ }
+
+ if !isNewline([]rune(b[:i])) {
+ return emptyToken, 0, NewParseError("invalid new line token")
+ }
+
+ return newToken(TokenNL, b[:i], NoneType), i, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go
new file mode 100644
index 000000000..a45c0bc56
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/number_helper.go
@@ -0,0 +1,152 @@
+package ini
+
+import (
+ "bytes"
+ "fmt"
+ "strconv"
+)
+
+const (
+ none = numberFormat(iota)
+ binary
+ octal
+ decimal
+ hex
+ exponent
+)
+
+type numberFormat int
+
+// numberHelper is used to dictate what format a number is in
+// and what to do for negative values. Since -1e-4 is a valid
+// number, we cannot just simply check for duplicate negatives.
+type numberHelper struct {
+ numberFormat numberFormat
+
+ negative bool
+ negativeExponent bool
+}
+
+func (b numberHelper) Exists() bool {
+ return b.numberFormat != none
+}
+
+func (b numberHelper) IsNegative() bool {
+ return b.negative || b.negativeExponent
+}
+
+func (b *numberHelper) Determine(c rune) error {
+ if b.Exists() {
+ return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c)))
+ }
+
+ switch c {
+ case 'b':
+ b.numberFormat = binary
+ case 'o':
+ b.numberFormat = octal
+ case 'x':
+ b.numberFormat = hex
+ case 'e', 'E':
+ b.numberFormat = exponent
+ case '-':
+ if b.numberFormat != exponent {
+ b.negative = true
+ } else {
+ b.negativeExponent = true
+ }
+ case '.':
+ b.numberFormat = decimal
+ default:
+ return NewParseError(fmt.Sprintf("invalid number character: %v", string(c)))
+ }
+
+ return nil
+}
+
+func (b numberHelper) CorrectByte(c rune) bool {
+ switch {
+ case b.numberFormat == binary:
+ if !isBinaryByte(c) {
+ return false
+ }
+ case b.numberFormat == octal:
+ if !isOctalByte(c) {
+ return false
+ }
+ case b.numberFormat == hex:
+ if !isHexByte(c) {
+ return false
+ }
+ case b.numberFormat == decimal:
+ if !isDigit(c) {
+ return false
+ }
+ case b.numberFormat == exponent:
+ if !isDigit(c) {
+ return false
+ }
+ case b.negativeExponent:
+ if !isDigit(c) {
+ return false
+ }
+ case b.negative:
+ if !isDigit(c) {
+ return false
+ }
+ default:
+ if !isDigit(c) {
+ return false
+ }
+ }
+
+ return true
+}
+
+func (b numberHelper) Base() int {
+ switch b.numberFormat {
+ case binary:
+ return 2
+ case octal:
+ return 8
+ case hex:
+ return 16
+ default:
+ return 10
+ }
+}
+
+func (b numberHelper) String() string {
+ buf := bytes.Buffer{}
+ i := 0
+
+ switch b.numberFormat {
+ case binary:
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": binary format\n")
+ case octal:
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": octal format\n")
+ case hex:
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": hex format\n")
+ case exponent:
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": exponent format\n")
+ default:
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": integer format\n")
+ }
+
+ if b.negative {
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": negative format\n")
+ }
+
+ if b.negativeExponent {
+ i++
+ buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n")
+ }
+
+ return buf.String()
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go
new file mode 100644
index 000000000..8a84c7cbe
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go
@@ -0,0 +1,39 @@
+package ini
+
+import (
+ "fmt"
+)
+
+var (
+ equalOp = []rune("=")
+ equalColonOp = []rune(":")
+)
+
+func isOp(b []rune) bool {
+ if len(b) == 0 {
+ return false
+ }
+
+ switch b[0] {
+ case '=':
+ return true
+ case ':':
+ return true
+ default:
+ return false
+ }
+}
+
+func newOpToken(b []rune) (Token, int, error) {
+ tok := Token{}
+
+ switch b[0] {
+ case '=':
+ tok = newToken(TokenOp, equalOp, NoneType)
+ case ':':
+ tok = newToken(TokenOp, equalColonOp, NoneType)
+ default:
+ return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0]))
+ }
+ return tok, 1, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go
new file mode 100644
index 000000000..457287019
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go
@@ -0,0 +1,43 @@
+package ini
+
+import "fmt"
+
+const (
+ // ErrCodeParseError is returned when a parsing error
+ // has occurred.
+ ErrCodeParseError = "INIParseError"
+)
+
+// ParseError is an error which is returned during any part of
+// the parsing process.
+type ParseError struct {
+ msg string
+}
+
+// NewParseError will return a new ParseError where message
+// is the description of the error.
+func NewParseError(message string) *ParseError {
+ return &ParseError{
+ msg: message,
+ }
+}
+
+// Code will return the ErrCodeParseError
+func (err *ParseError) Code() string {
+ return ErrCodeParseError
+}
+
+// Message returns the error's message
+func (err *ParseError) Message() string {
+ return err.msg
+}
+
+// OrigError return nothing since there will never be any
+// original error.
+func (err *ParseError) OrigError() error {
+ return nil
+}
+
+func (err *ParseError) Error() string {
+ return fmt.Sprintf("%s: %s", err.Code(), err.Message())
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go
new file mode 100644
index 000000000..7f01cf7c7
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go
@@ -0,0 +1,60 @@
+package ini
+
+import (
+ "bytes"
+ "fmt"
+)
+
+// ParseStack is a stack that contains a container, the stack portion,
+// and the list which is the list of ASTs that have been successfully
+// parsed.
+type ParseStack struct {
+ top int
+ container []AST
+ list []AST
+ index int
+}
+
+func newParseStack(sizeContainer, sizeList int) ParseStack {
+ return ParseStack{
+ container: make([]AST, sizeContainer),
+ list: make([]AST, sizeList),
+ }
+}
+
+// Pop will return and truncate the last container element.
+func (s *ParseStack) Pop() AST {
+ s.top--
+ return s.container[s.top]
+}
+
+// Push will add the new AST to the container
+func (s *ParseStack) Push(ast AST) {
+ s.container[s.top] = ast
+ s.top++
+}
+
+// MarkComplete will append the AST to the list of completed statements
+func (s *ParseStack) MarkComplete(ast AST) {
+ s.list[s.index] = ast
+ s.index++
+}
+
+// List will return the completed statements
+func (s ParseStack) List() []AST {
+ return s.list[:s.index]
+}
+
+// Len will return the length of the container
+func (s *ParseStack) Len() int {
+ return s.top
+}
+
+func (s ParseStack) String() string {
+ buf := bytes.Buffer{}
+ for i, node := range s.list {
+ buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node))
+ }
+
+ return buf.String()
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go
new file mode 100644
index 000000000..f82095ba2
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go
@@ -0,0 +1,41 @@
+package ini
+
+import (
+ "fmt"
+)
+
+var (
+ emptyRunes = []rune{}
+)
+
+func isSep(b []rune) bool {
+ if len(b) == 0 {
+ return false
+ }
+
+ switch b[0] {
+ case '[', ']':
+ return true
+ default:
+ return false
+ }
+}
+
+var (
+ openBrace = []rune("[")
+ closeBrace = []rune("]")
+)
+
+func newSepToken(b []rune) (Token, int, error) {
+ tok := Token{}
+
+ switch b[0] {
+ case '[':
+ tok = newToken(TokenSep, openBrace, NoneType)
+ case ']':
+ tok = newToken(TokenSep, closeBrace, NoneType)
+ default:
+ return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0]))
+ }
+ return tok, 1, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go
new file mode 100644
index 000000000..6bb696447
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go
@@ -0,0 +1,45 @@
+package ini
+
+// skipper is used to skip certain blocks of an ini file.
+// Currently skipper is used to skip nested blocks of ini
+// files. See example below
+//
+// [ foo ]
+// nested = ; this section will be skipped
+// a=b
+// c=d
+// bar=baz ; this will be included
+type skipper struct {
+ shouldSkip bool
+ TokenSet bool
+ prevTok Token
+}
+
+func newSkipper() skipper {
+ return skipper{
+ prevTok: emptyToken,
+ }
+}
+
+func (s *skipper) ShouldSkip(tok Token) bool {
+ if s.shouldSkip &&
+ s.prevTok.Type() == TokenNL &&
+ tok.Type() != TokenWS {
+
+ s.Continue()
+ return false
+ }
+ s.prevTok = tok
+
+ return s.shouldSkip
+}
+
+func (s *skipper) Skip() {
+ s.shouldSkip = true
+ s.prevTok = emptyToken
+}
+
+func (s *skipper) Continue() {
+ s.shouldSkip = false
+ s.prevTok = emptyToken
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go
new file mode 100644
index 000000000..18f3fe893
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go
@@ -0,0 +1,35 @@
+package ini
+
+// Statement is an empty AST mostly used for transitioning states.
+func newStatement() AST {
+ return newAST(ASTKindStatement, AST{})
+}
+
+// SectionStatement represents a section AST
+func newSectionStatement(tok Token) AST {
+ return newASTWithRootToken(ASTKindSectionStatement, tok)
+}
+
+// ExprStatement represents a completed expression AST
+func newExprStatement(ast AST) AST {
+ return newAST(ASTKindExprStatement, ast)
+}
+
+// CommentStatement represents a comment in the ini definition.
+//
+// grammar:
+// comment -> #comment' | ;comment'
+// comment' -> epsilon | value
+func newCommentStatement(tok Token) AST {
+ return newAST(ASTKindCommentStatement, newExpression(tok))
+}
+
+// CompletedSectionStatement represents a completed section
+func newCompletedSectionStatement(ast AST) AST {
+ return newAST(ASTKindCompletedSectionStatement, ast)
+}
+
+// SkipStatement is used to skip whole statements
+func newSkipStatement(ast AST) AST {
+ return newAST(ASTKindSkipStatement, ast)
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go
new file mode 100644
index 000000000..305999d29
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/value_util.go
@@ -0,0 +1,284 @@
+package ini
+
+import (
+ "fmt"
+)
+
+// getStringValue will return a quoted string and the amount
+// of bytes read
+//
+// an error will be returned if the string is not properly formatted
+func getStringValue(b []rune) (int, error) {
+ if b[0] != '"' {
+ return 0, NewParseError("strings must start with '\"'")
+ }
+
+ endQuote := false
+ i := 1
+
+ for ; i < len(b) && !endQuote; i++ {
+ if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped {
+ endQuote = true
+ break
+ } else if escaped {
+ /*c, err := getEscapedByte(b[i])
+ if err != nil {
+ return 0, err
+ }
+
+ b[i-1] = c
+ b = append(b[:i], b[i+1:]...)
+ i--*/
+
+ continue
+ }
+ }
+
+ if !endQuote {
+ return 0, NewParseError("missing '\"' in string value")
+ }
+
+ return i + 1, nil
+}
+
+// getBoolValue will return a boolean and the amount
+// of bytes read
+//
+// an error will be returned if the boolean is not of a correct
+// value
+func getBoolValue(b []rune) (int, error) {
+ if len(b) < 4 {
+ return 0, NewParseError("invalid boolean value")
+ }
+
+ n := 0
+ for _, lv := range literalValues {
+ if len(lv) > len(b) {
+ continue
+ }
+
+ if isLitValue(lv, b) {
+ n = len(lv)
+ }
+ }
+
+ if n == 0 {
+ return 0, NewParseError("invalid boolean value")
+ }
+
+ return n, nil
+}
+
+// getNumericalValue will return a numerical string, the amount
+// of bytes read, and the base of the number
+//
+// an error will be returned if the number is not of a correct
+// value
+func getNumericalValue(b []rune) (int, int, error) {
+ if !isDigit(b[0]) {
+ return 0, 0, NewParseError("invalid digit value")
+ }
+
+ i := 0
+ helper := numberHelper{}
+
+loop:
+ for negativeIndex := 0; i < len(b); i++ {
+ negativeIndex++
+
+ if !isDigit(b[i]) {
+ switch b[i] {
+ case '-':
+ if helper.IsNegative() || negativeIndex != 1 {
+ return 0, 0, NewParseError("parse error '-'")
+ }
+
+ n := getNegativeNumber(b[i:])
+ i += (n - 1)
+ helper.Determine(b[i])
+ continue
+ case '.':
+ if err := helper.Determine(b[i]); err != nil {
+ return 0, 0, err
+ }
+ case 'e', 'E':
+ if err := helper.Determine(b[i]); err != nil {
+ return 0, 0, err
+ }
+
+ negativeIndex = 0
+ case 'b':
+ if helper.numberFormat == hex {
+ break
+ }
+ fallthrough
+ case 'o', 'x':
+ if i == 0 && b[i] != '0' {
+ return 0, 0, NewParseError("incorrect base format, expected leading '0'")
+ }
+
+ if i != 1 {
+ return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i))
+ }
+
+ if err := helper.Determine(b[i]); err != nil {
+ return 0, 0, err
+ }
+ default:
+ if isWhitespace(b[i]) {
+ break loop
+ }
+
+ if isNewline(b[i:]) {
+ break loop
+ }
+
+ if !(helper.numberFormat == hex && isHexByte(b[i])) {
+ if i+2 < len(b) && !isNewline(b[i:i+2]) {
+ return 0, 0, NewParseError("invalid numerical character")
+ } else if !isNewline([]rune{b[i]}) {
+ return 0, 0, NewParseError("invalid numerical character")
+ }
+
+ break loop
+ }
+ }
+ }
+ }
+
+ return helper.Base(), i, nil
+}
+
+// isDigit will return whether or not something is an integer
+func isDigit(b rune) bool {
+ return b >= '0' && b <= '9'
+}
+
+func hasExponent(v []rune) bool {
+ return contains(v, 'e') || contains(v, 'E')
+}
+
+func isBinaryByte(b rune) bool {
+ switch b {
+ case '0', '1':
+ return true
+ default:
+ return false
+ }
+}
+
+func isOctalByte(b rune) bool {
+ switch b {
+ case '0', '1', '2', '3', '4', '5', '6', '7':
+ return true
+ default:
+ return false
+ }
+}
+
+func isHexByte(b rune) bool {
+ if isDigit(b) {
+ return true
+ }
+ return (b >= 'A' && b <= 'F') ||
+ (b >= 'a' && b <= 'f')
+}
+
+func getValue(b []rune) (int, error) {
+ i := 0
+
+ for i < len(b) {
+ if isNewline(b[i:]) {
+ break
+ }
+
+ if isOp(b[i:]) {
+ break
+ }
+
+ valid, n, err := isValid(b[i:])
+ if err != nil {
+ return 0, err
+ }
+
+ if !valid {
+ break
+ }
+
+ i += n
+ }
+
+ return i, nil
+}
+
+// getNegativeNumber will return a negative number from a
+// byte slice. This will iterate through all characters until
+// a non-digit has been found.
+func getNegativeNumber(b []rune) int {
+ if b[0] != '-' {
+ return 0
+ }
+
+ i := 1
+ for ; i < len(b); i++ {
+ if !isDigit(b[i]) {
+ return i
+ }
+ }
+
+ return i
+}
+
+// isEscaped will return whether or not the character is an escaped
+// character.
+func isEscaped(value []rune, b rune) bool {
+ if len(value) == 0 {
+ return false
+ }
+
+ switch b {
+ case '\'': // single quote
+ case '"': // quote
+ case 'n': // newline
+ case 't': // tab
+ case '\\': // backslash
+ default:
+ return false
+ }
+
+ return value[len(value)-1] == '\\'
+}
+
+func getEscapedByte(b rune) (rune, error) {
+ switch b {
+ case '\'': // single quote
+ return '\'', nil
+ case '"': // quote
+ return '"', nil
+ case 'n': // newline
+ return '\n', nil
+ case 't': // table
+ return '\t', nil
+ case '\\': // backslash
+ return '\\', nil
+ default:
+ return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b))
+ }
+}
+
+func removeEscapedCharacters(b []rune) []rune {
+ for i := 0; i < len(b); i++ {
+ if isEscaped(b[:i], b[i]) {
+ c, err := getEscapedByte(b[i])
+ if err != nil {
+ return b
+ }
+
+ b[i-1] = c
+ b = append(b[:i], b[i+1:]...)
+ i--
+ }
+ }
+
+ return b
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go
new file mode 100644
index 000000000..94841c324
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/visitor.go
@@ -0,0 +1,166 @@
+package ini
+
+import (
+ "fmt"
+ "sort"
+)
+
+// Visitor is an interface used by walkers that will
+// traverse an array of ASTs.
+type Visitor interface {
+ VisitExpr(AST) error
+ VisitStatement(AST) error
+}
+
+// DefaultVisitor is used to visit statements and expressions
+// and ensure that they are both of the correct format.
+// In addition, upon visiting this will build sections and populate
+// the Sections field which can be used to retrieve profile
+// configuration.
+type DefaultVisitor struct {
+ scope string
+ Sections Sections
+}
+
+// NewDefaultVisitor return a DefaultVisitor
+func NewDefaultVisitor() *DefaultVisitor {
+ return &DefaultVisitor{
+ Sections: Sections{
+ container: map[string]Section{},
+ },
+ }
+}
+
+// VisitExpr visits expressions...
+func (v *DefaultVisitor) VisitExpr(expr AST) error {
+ t := v.Sections.container[v.scope]
+ if t.values == nil {
+ t.values = values{}
+ }
+
+ switch expr.Kind {
+ case ASTKindExprStatement:
+ opExpr := expr.GetRoot()
+ switch opExpr.Kind {
+ case ASTKindEqualExpr:
+ children := opExpr.GetChildren()
+ if len(children) <= 1 {
+ return NewParseError("unexpected token type")
+ }
+
+ rhs := children[1]
+
+ if rhs.Root.Type() != TokenLit {
+ return NewParseError("unexpected token type")
+ }
+
+ key := EqualExprKey(opExpr)
+ v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw())
+ if err != nil {
+ return err
+ }
+
+ t.values[key] = v
+ default:
+ return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
+ }
+ default:
+ return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
+ }
+
+ v.Sections.container[v.scope] = t
+ return nil
+}
+
+// VisitStatement visits statements...
+func (v *DefaultVisitor) VisitStatement(stmt AST) error {
+ switch stmt.Kind {
+ case ASTKindCompletedSectionStatement:
+ child := stmt.GetRoot()
+ if child.Kind != ASTKindSectionStatement {
+ return NewParseError(fmt.Sprintf("unsupported child statement: %T", child))
+ }
+
+ name := string(child.Root.Raw())
+ v.Sections.container[name] = Section{}
+ v.scope = name
+ default:
+ return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind))
+ }
+
+ return nil
+}
+
+// Sections is a map of Section structures that represent
+// a configuration.
+type Sections struct {
+ container map[string]Section
+}
+
+// GetSection will return section p. If section p does not exist,
+// false will be returned in the second parameter.
+func (t Sections) GetSection(p string) (Section, bool) {
+ v, ok := t.container[p]
+ return v, ok
+}
+
+// values represents a map of union values.
+type values map[string]Value
+
+// List will return a list of all sections that were successfully
+// parsed.
+func (t Sections) List() []string {
+ keys := make([]string, len(t.container))
+ i := 0
+ for k := range t.container {
+ keys[i] = k
+ i++
+ }
+
+ sort.Strings(keys)
+ return keys
+}
+
+// Section contains a name and values. This represent
+// a sectioned entry in a configuration file.
+type Section struct {
+ Name string
+ values values
+}
+
+// Has will return whether or not an entry exists in a given section
+func (t Section) Has(k string) bool {
+ _, ok := t.values[k]
+ return ok
+}
+
+// ValueType will returned what type the union is set to. If
+// k was not found, the NoneType will be returned.
+func (t Section) ValueType(k string) (ValueType, bool) {
+ v, ok := t.values[k]
+ return v.Type, ok
+}
+
+// Bool returns a bool value at k
+func (t Section) Bool(k string) bool {
+ return t.values[k].BoolValue()
+}
+
+// Int returns an integer value at k
+func (t Section) Int(k string) int64 {
+ return t.values[k].IntValue()
+}
+
+// Float64 returns a float value at k
+func (t Section) Float64(k string) float64 {
+ return t.values[k].FloatValue()
+}
+
+// String returns the string value at k
+func (t Section) String(k string) string {
+ _, ok := t.values[k]
+ if !ok {
+ return ""
+ }
+ return t.values[k].StringValue()
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go
new file mode 100644
index 000000000..99915f7f7
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go
@@ -0,0 +1,25 @@
+package ini
+
+// Walk will traverse the AST using the v, the Visitor.
+func Walk(tree []AST, v Visitor) error {
+ for _, node := range tree {
+ switch node.Kind {
+ case ASTKindExpr,
+ ASTKindExprStatement:
+
+ if err := v.VisitExpr(node); err != nil {
+ return err
+ }
+ case ASTKindStatement,
+ ASTKindCompletedSectionStatement,
+ ASTKindNestedSectionStatement,
+ ASTKindCompletedNestedSectionStatement:
+
+ if err := v.VisitStatement(node); err != nil {
+ return err
+ }
+ }
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go
new file mode 100644
index 000000000..7ffb4ae06
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go
@@ -0,0 +1,24 @@
+package ini
+
+import (
+ "unicode"
+)
+
+// isWhitespace will return whether or not the character is
+// a whitespace character.
+//
+// Whitespace is defined as a space or tab.
+func isWhitespace(c rune) bool {
+ return unicode.IsSpace(c) && c != '\n' && c != '\r'
+}
+
+func newWSToken(b []rune) (Token, int, error) {
+ i := 0
+ for ; i < len(b); i++ {
+ if !isWhitespace(b[i]) {
+ break
+ }
+ }
+
+ return newToken(TokenWS, b[:i], NoneType), i, nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go
new file mode 100644
index 000000000..38ea61afe
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go
@@ -0,0 +1,23 @@
+package sdkuri
+
+import (
+ "path"
+ "strings"
+)
+
+// PathJoin will join the elements of the path delimited by the "/"
+// character. Similar to path.Join with the exception the trailing "/"
+// character is preserved if present.
+func PathJoin(elems ...string) string {
+ if len(elems) == 0 {
+ return ""
+ }
+
+ hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/")
+ str := path.Join(elems...)
+ if hasTrailing && str != "/" {
+ str += "/"
+ }
+
+ return str
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go
new file mode 100644
index 000000000..7da8a49ce
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go
@@ -0,0 +1,12 @@
+package shareddefaults
+
+const (
+ // ECSCredsProviderEnvVar is an environmental variable key used to
+ // determine which path needs to be hit.
+ ECSCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
+)
+
+// ECSContainerCredentialsURI is the endpoint to retrieve container
+// credentials. This can be overridden to test to ensure the credential process
+// is behaving correctly.
+var ECSContainerCredentialsURI = "http://169.254.170.2"
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
index 3104e6ce4..50c5ed760 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
@@ -21,7 +21,8 @@ func Build(r *request.Request) {
"Version": {r.ClientInfo.APIVersion},
}
if err := queryutil.Parse(body, r.Params, true); err != nil {
- r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
+ r.Error = awserr.New(request.ErrCodeSerialization,
+ "failed encoding EC2 Query request", err)
}
if !r.IsPresigned() {
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go
index 095e97ccf..105d732f9 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go
@@ -4,7 +4,6 @@ package ec2query
import (
"encoding/xml"
- "io"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
@@ -27,7 +26,12 @@ func Unmarshal(r *request.Request) {
decoder := xml.NewDecoder(r.HTTPResponse.Body)
err := xmlutil.UnmarshalXML(r.Data, decoder, "")
if err != nil {
- r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err)
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed decoding EC2 Query response", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
+ )
return
}
}
@@ -35,7 +39,11 @@ func Unmarshal(r *request.Request) {
// UnmarshalMeta unmarshals response headers for the EC2 protocol.
func UnmarshalMeta(r *request.Request) {
- // TODO implement unmarshaling of request IDs
+ r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid")
+ if r.RequestID == "" {
+ // Alternative version of request id in the header
+ r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id")
+ }
}
type xmlErrorResponse struct {
@@ -49,15 +57,21 @@ type xmlErrorResponse struct {
func UnmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
- resp := &xmlErrorResponse{}
- err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
- if err != nil && err != io.EOF {
- r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err)
- } else {
+ var respErr xmlErrorResponse
+ err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body)
+ if err != nil {
r.Error = awserr.NewRequestFailure(
- awserr.New(resp.Code, resp.Message, nil),
+ awserr.New(request.ErrCodeSerialization,
+ "failed to unmarshal error message", err),
r.HTTPResponse.StatusCode,
- resp.RequestID,
+ r.RequestID,
)
+ return
}
+
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(respErr.Code, respErr.Message, nil),
+ r.HTTPResponse.StatusCode,
+ respErr.RequestID,
+ )
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go
new file mode 100644
index 000000000..d7d42db0a
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/host.go
@@ -0,0 +1,68 @@
+package protocol
+
+import (
+ "strings"
+
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// ValidateEndpointHostHandler is a request handler that will validate the
+// request endpoint's hosts is a valid RFC 3986 host.
+var ValidateEndpointHostHandler = request.NamedHandler{
+ Name: "awssdk.protocol.ValidateEndpointHostHandler",
+ Fn: func(r *request.Request) {
+ err := ValidateEndpointHost(r.Operation.Name, r.HTTPRequest.URL.Host)
+ if err != nil {
+ r.Error = err
+ }
+ },
+}
+
+// ValidateEndpointHost validates that the host string passed in is a valid RFC
+// 3986 host. Returns error if the host is not valid.
+func ValidateEndpointHost(opName, host string) error {
+ paramErrs := request.ErrInvalidParams{Context: opName}
+ labels := strings.Split(host, ".")
+
+ for i, label := range labels {
+ if i == len(labels)-1 && len(label) == 0 {
+ // Allow trailing dot for FQDN hosts.
+ continue
+ }
+
+ if !ValidHostLabel(label) {
+ paramErrs.Add(request.NewErrParamFormat(
+ "endpoint host label", "[a-zA-Z0-9-]{1,63}", label))
+ }
+ }
+
+ if len(host) > 255 {
+ paramErrs.Add(request.NewErrParamMaxLen(
+ "endpoint host", 255, host,
+ ))
+ }
+
+ if paramErrs.Len() > 0 {
+ return paramErrs
+ }
+ return nil
+}
+
+// ValidHostLabel returns if the label is a valid RFC 3986 host label.
+func ValidHostLabel(label string) bool {
+ if l := len(label); l == 0 || l > 63 {
+ return false
+ }
+ for _, r := range label {
+ switch {
+ case r >= '0' && r <= '9':
+ case r >= 'A' && r <= 'Z':
+ case r >= 'a' && r <= 'z':
+ case r == '-':
+ default:
+ return false
+ }
+ }
+
+ return true
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go
new file mode 100644
index 000000000..915b0fcaf
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/host_prefix.go
@@ -0,0 +1,54 @@
+package protocol
+
+import (
+ "strings"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// HostPrefixHandlerName is the handler name for the host prefix request
+// handler.
+const HostPrefixHandlerName = "awssdk.endpoint.HostPrefixHandler"
+
+// NewHostPrefixHandler constructs a build handler
+func NewHostPrefixHandler(prefix string, labelsFn func() map[string]string) request.NamedHandler {
+ builder := HostPrefixBuilder{
+ Prefix: prefix,
+ LabelsFn: labelsFn,
+ }
+
+ return request.NamedHandler{
+ Name: HostPrefixHandlerName,
+ Fn: builder.Build,
+ }
+}
+
+// HostPrefixBuilder provides the request handler to expand and prepend
+// the host prefix into the operation's request endpoint host.
+type HostPrefixBuilder struct {
+ Prefix string
+ LabelsFn func() map[string]string
+}
+
+// Build updates the passed in Request with the HostPrefix template expanded.
+func (h HostPrefixBuilder) Build(r *request.Request) {
+ if aws.BoolValue(r.Config.DisableEndpointHostPrefix) {
+ return
+ }
+
+ var labels map[string]string
+ if h.LabelsFn != nil {
+ labels = h.LabelsFn()
+ }
+
+ prefix := h.Prefix
+ for name, value := range labels {
+ prefix = strings.Replace(prefix, "{"+name+"}", value, -1)
+ }
+
+ r.HTTPRequest.URL.Host = prefix + r.HTTPRequest.URL.Host
+ if len(r.HTTPRequest.Host) > 0 {
+ r.HTTPRequest.Host = prefix + r.HTTPRequest.Host
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
index ec765ba25..864fb6704 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
@@ -216,7 +216,17 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro
default:
switch converted := value.Interface().(type) {
case time.Time:
- buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10))
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.UnixTimeFormatName
+ }
+
+ ts := protocol.FormatTime(format, converted)
+ if format != protocol.UnixTimeFormatName {
+ ts = `"` + ts + `"`
+ }
+
+ buf.WriteString(ts)
case []byte:
if !value.IsNil() {
buf.WriteByte('"')
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go
index 037e1e7be..ea0da79a5 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go
@@ -1,32 +1,47 @@
package jsonutil
import (
+ "bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io"
- "io/ioutil"
"reflect"
"time"
"github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/private/protocol"
)
+// UnmarshalJSONError unmarshal's the reader's JSON document into the passed in
+// type. The value to unmarshal the json document into must be a pointer to the
+// type.
+func UnmarshalJSONError(v interface{}, stream io.Reader) error {
+ var errBuf bytes.Buffer
+ body := io.TeeReader(stream, &errBuf)
+
+ err := json.NewDecoder(body).Decode(v)
+ if err != nil {
+ msg := "failed decoding error message"
+ if err == io.EOF {
+ msg = "error message missing"
+ err = nil
+ }
+ return awserr.NewUnmarshalError(err, msg, errBuf.Bytes())
+ }
+
+ return nil
+}
+
// UnmarshalJSON reads a stream and unmarshals the results in object v.
func UnmarshalJSON(v interface{}, stream io.Reader) error {
var out interface{}
- b, err := ioutil.ReadAll(stream)
- if err != nil {
- return err
- }
-
- if len(b) == 0 {
+ err := json.NewDecoder(stream).Decode(&out)
+ if err == io.EOF {
return nil
- }
-
- if err := json.Unmarshal(b, &out); err != nil {
+ } else if err != nil {
return err
}
@@ -172,9 +187,6 @@ func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag)
}
func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error {
- errf := func() error {
- return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
- }
switch d := data.(type) {
case nil:
@@ -189,6 +201,17 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
return err
}
value.Set(reflect.ValueOf(b))
+ case *time.Time:
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.ISO8601TimeFormatName
+ }
+
+ t, err := protocol.ParseTime(format, d)
+ if err != nil {
+ return err
+ }
+ value.Set(reflect.ValueOf(&t))
case aws.JSONValue:
// No need to use escaping as the value is a non-quoted string.
v, err := protocol.DecodeJSONValue(d, protocol.NoEscape)
@@ -197,7 +220,7 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
}
value.Set(reflect.ValueOf(v))
default:
- return errf()
+ return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
case float64:
switch value.Interface().(type) {
@@ -207,17 +230,18 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
case *float64:
value.Set(reflect.ValueOf(&d))
case *time.Time:
+ // Time unmarshaled from a float64 can only be epoch seconds
t := time.Unix(int64(d), 0).UTC()
value.Set(reflect.ValueOf(&t))
default:
- return errf()
+ return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
case bool:
switch value.Interface().(type) {
case *bool:
value.Set(reflect.ValueOf(&d))
default:
- return errf()
+ return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
}
default:
return fmt.Errorf("unsupported JSON value (%v)", data)
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go
index 56af4dc44..bfedc9fd4 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go
@@ -6,8 +6,6 @@ package jsonrpc
//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/json.json unmarshal_test.go
import (
- "encoding/json"
- "io/ioutil"
"strings"
"github.com/aws/aws-sdk-go/aws/awserr"
@@ -37,7 +35,7 @@ func Build(req *request.Request) {
if req.ParamsFilled() {
buf, err = jsonutil.BuildJSON(req.Params)
if err != nil {
- req.Error = awserr.New("SerializationError", "failed encoding JSON RPC request", err)
+ req.Error = awserr.New(request.ErrCodeSerialization, "failed encoding JSON RPC request", err)
return
}
} else {
@@ -52,9 +50,12 @@ func Build(req *request.Request) {
target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name
req.HTTPRequest.Header.Add("X-Amz-Target", target)
}
- if req.ClientInfo.JSONVersion != "" {
+
+ // Only set the content type if one is not already specified and an
+ // JSONVersion is specified.
+ if ct, v := req.HTTPRequest.Header.Get("Content-Type"), req.ClientInfo.JSONVersion; len(ct) == 0 && len(v) != 0 {
jsonVersion := req.ClientInfo.JSONVersion
- req.HTTPRequest.Header.Add("Content-Type", "application/x-amz-json-"+jsonVersion)
+ req.HTTPRequest.Header.Set("Content-Type", "application/x-amz-json-"+jsonVersion)
}
}
@@ -64,7 +65,11 @@ func Unmarshal(req *request.Request) {
if req.DataFilled() {
err := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body)
if err != nil {
- req.Error = awserr.New("SerializationError", "failed decoding JSON RPC response", err)
+ req.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization, "failed decoding JSON RPC response", err),
+ req.HTTPResponse.StatusCode,
+ req.RequestID,
+ )
}
}
return
@@ -78,22 +83,16 @@ func UnmarshalMeta(req *request.Request) {
// UnmarshalError unmarshals an error response for a JSON RPC service.
func UnmarshalError(req *request.Request) {
defer req.HTTPResponse.Body.Close()
- bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body)
- if err != nil {
- req.Error = awserr.New("SerializationError", "failed reading JSON RPC error response", err)
- return
- }
- if len(bodyBytes) == 0 {
- req.Error = awserr.NewRequestFailure(
- awserr.New("SerializationError", req.HTTPResponse.Status, nil),
- req.HTTPResponse.StatusCode,
- "",
- )
- return
- }
+
var jsonErr jsonErrorResponse
- if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil {
- req.Error = awserr.New("SerializationError", "failed decoding JSON RPC error response", err)
+ err := jsonutil.UnmarshalJSONError(&jsonErr, req.HTTPResponse.Body)
+ if err != nil {
+ req.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed to unmarshal error message", err),
+ req.HTTPResponse.StatusCode,
+ req.RequestID,
+ )
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go
new file mode 100644
index 000000000..e21614a12
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go
@@ -0,0 +1,81 @@
+package protocol
+
+import (
+ "io"
+ "io/ioutil"
+ "net/http"
+
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/client/metadata"
+ "github.com/aws/aws-sdk-go/aws/request"
+)
+
+// PayloadUnmarshaler provides the interface for unmarshaling a payload's
+// reader into a SDK shape.
+type PayloadUnmarshaler interface {
+ UnmarshalPayload(io.Reader, interface{}) error
+}
+
+// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a
+// HandlerList. This provides the support for unmarshaling a payload reader to
+// a shape without needing a SDK request first.
+type HandlerPayloadUnmarshal struct {
+ Unmarshalers request.HandlerList
+}
+
+// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using
+// the Unmarshalers HandlerList provided. Returns an error if unable
+// unmarshaling fails.
+func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error {
+ req := &request.Request{
+ HTTPRequest: &http.Request{},
+ HTTPResponse: &http.Response{
+ StatusCode: 200,
+ Header: http.Header{},
+ Body: ioutil.NopCloser(r),
+ },
+ Data: v,
+ }
+
+ h.Unmarshalers.Run(req)
+
+ return req.Error
+}
+
+// PayloadMarshaler provides the interface for marshaling a SDK shape into and
+// io.Writer.
+type PayloadMarshaler interface {
+ MarshalPayload(io.Writer, interface{}) error
+}
+
+// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList.
+// This provides support for marshaling a SDK shape into an io.Writer without
+// needing a SDK request first.
+type HandlerPayloadMarshal struct {
+ Marshalers request.HandlerList
+}
+
+// MarshalPayload marshals the SDK shape into the io.Writer using the
+// Marshalers HandlerList provided. Returns an error if unable if marshal
+// fails.
+func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error {
+ req := request.New(
+ aws.Config{},
+ metadata.ClientInfo{},
+ request.Handlers{},
+ nil,
+ &request.Operation{HTTPMethod: "GET"},
+ v,
+ nil,
+ )
+
+ h.Marshalers.Run(req)
+
+ if req.Error != nil {
+ return req.Error
+ }
+
+ io.Copy(w, req.GetBody())
+
+ return nil
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go
index 60e5b09d5..0cb99eb57 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go
@@ -21,7 +21,7 @@ func Build(r *request.Request) {
"Version": {r.ClientInfo.APIVersion},
}
if err := queryutil.Parse(body, r.Params, false); err != nil {
- r.Error = awserr.New("SerializationError", "failed encoding Query request", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed encoding Query request", err)
return
}
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 5ce9cba32..75866d012 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
@@ -233,7 +233,12 @@ func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, ta
v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
case time.Time:
const ISO8601UTC = "2006-01-02T15:04:05Z"
- v.Set(name, value.UTC().Format(ISO8601UTC))
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.ISO8601TimeFormatName
+ }
+
+ v.Set(name, protocol.FormatTime(format, value))
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go
index e0f4d5a54..f69c1efc9 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go
@@ -23,7 +23,11 @@ func Unmarshal(r *request.Request) {
decoder := xml.NewDecoder(r.HTTPResponse.Body)
err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result")
if err != nil {
- r.Error = awserr.New("SerializationError", "failed decoding Query response", err)
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
+ )
return
}
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go
index f21429617..831b0110c 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go
@@ -2,65 +2,68 @@ package query
import (
"encoding/xml"
- "io/ioutil"
+ "fmt"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
)
-type xmlErrorResponse struct {
- XMLName xml.Name `xml:"ErrorResponse"`
- Code string `xml:"Error>Code"`
- Message string `xml:"Error>Message"`
- RequestID string `xml:"RequestId"`
-}
-
-type xmlServiceUnavailableResponse struct {
- XMLName xml.Name `xml:"ServiceUnavailableException"`
-}
-
// UnmarshalErrorHandler is a name request handler to unmarshal request errors
var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalError", Fn: UnmarshalError}
+type xmlErrorResponse struct {
+ Code string `xml:"Error>Code"`
+ Message string `xml:"Error>Message"`
+ RequestID string `xml:"RequestId"`
+}
+
+type xmlResponseError struct {
+ xmlErrorResponse
+}
+
+func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
+ const svcUnavailableTagName = "ServiceUnavailableException"
+ const errorResponseTagName = "ErrorResponse"
+
+ switch start.Name.Local {
+ case svcUnavailableTagName:
+ e.Code = svcUnavailableTagName
+ e.Message = "service is unavailable"
+ return d.Skip()
+
+ case errorResponseTagName:
+ return d.DecodeElement(&e.xmlErrorResponse, &start)
+
+ default:
+ return fmt.Errorf("unknown error response tag, %v", start)
+ }
+}
+
// UnmarshalError unmarshals an error response for an AWS Query service.
func UnmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
- bodyBytes, err := ioutil.ReadAll(r.HTTPResponse.Body)
+ var respErr xmlResponseError
+ err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to read from query HTTP response body", err)
- return
- }
-
- // First check for specific error
- resp := xmlErrorResponse{}
- decodeErr := xml.Unmarshal(bodyBytes, &resp)
- if decodeErr == nil {
- reqID := resp.RequestID
- if reqID == "" {
- reqID = r.RequestID
- }
r.Error = awserr.NewRequestFailure(
- awserr.New(resp.Code, resp.Message, nil),
- r.HTTPResponse.StatusCode,
- reqID,
- )
- return
- }
-
- // Check for unhandled error
- servUnavailResp := xmlServiceUnavailableResponse{}
- unavailErr := xml.Unmarshal(bodyBytes, &servUnavailResp)
- if unavailErr == nil {
- r.Error = awserr.NewRequestFailure(
- awserr.New("ServiceUnavailableException", "service is unavailable", nil),
+ awserr.New(request.ErrCodeSerialization,
+ "failed to unmarshal error message", err),
r.HTTPResponse.StatusCode,
r.RequestID,
)
return
}
- // Failed to retrieve any error message from the response body
- r.Error = awserr.New("SerializationError",
- "failed to decode query XML error response", decodeErr)
+ reqID := respErr.RequestID
+ if len(reqID) == 0 {
+ reqID = r.RequestID
+ }
+
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(respErr.Code, respErr.Message, nil),
+ r.HTTPResponse.StatusCode,
+ reqID,
+ )
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
index c405288d7..1301b149d 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
@@ -20,14 +20,13 @@ import (
"github.com/aws/aws-sdk-go/private/protocol"
)
-// RFC822 returns an RFC822 formatted timestamp for AWS protocols
-const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
-
// Whether the byte value can be sent without escaping in AWS URLs
var noEscape [256]bool
var errValueNotSet = fmt.Errorf("value not set")
+var byteSliceType = reflect.TypeOf([]byte{})
+
func init() {
for i := 0; i < len(noEscape); i++ {
// AWS expects every character except these to be escaped
@@ -97,6 +96,14 @@ func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bo
continue
}
+ // Support the ability to customize values to be marshaled as a
+ // blob even though they were modeled as a string. Required for S3
+ // API operations like SSECustomerKey is modeled as stirng but
+ // required to be base64 encoded in request.
+ if field.Tag.Get("marshal-as") == "blob" {
+ m = m.Convert(byteSliceType)
+ }
+
var err error
switch field.Tag.Get("location") {
case "headers": // header maps
@@ -140,7 +147,7 @@ func buildBody(r *request.Request, v reflect.Value) {
case string:
r.SetStringBody(reader)
default:
- r.Error = awserr.New("SerializationError",
+ r.Error = awserr.New(request.ErrCodeSerialization,
"failed to encode REST request",
fmt.Errorf("unknown payload type %s", payload.Type()))
}
@@ -155,9 +162,12 @@ func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.
if err == errValueNotSet {
return nil
} else if err != nil {
- return awserr.New("SerializationError", "failed to encode REST request", err)
+ return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err)
}
+ name = strings.TrimSpace(name)
+ str = strings.TrimSpace(str)
+
header.Add(name, str)
return nil
@@ -170,11 +180,13 @@ func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag)
if err == errValueNotSet {
continue
} else if err != nil {
- return awserr.New("SerializationError", "failed to encode REST request", err)
+ return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err)
}
+ keyStr := strings.TrimSpace(key.String())
+ str = strings.TrimSpace(str)
- header.Add(prefix+key.String(), str)
+ header.Add(prefix+keyStr, str)
}
return nil
}
@@ -184,7 +196,7 @@ func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) e
if err == errValueNotSet {
return nil
} else if err != nil {
- return awserr.New("SerializationError", "failed to encode REST request", err)
+ return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err)
}
u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1)
@@ -217,7 +229,7 @@ func buildQueryString(query url.Values, v reflect.Value, name string, tag reflec
if err == errValueNotSet {
return nil
} else if err != nil {
- return awserr.New("SerializationError", "failed to encode REST request", err)
+ return awserr.New(request.ErrCodeSerialization, "failed to encode REST request", err)
}
query.Set(name, str)
}
@@ -270,7 +282,14 @@ func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error)
case float64:
str = strconv.FormatFloat(value, 'f', -1, 64)
case time.Time:
- str = value.UTC().Format(RFC822)
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.RFC822TimeFormatName
+ if tag.Get("location") == "querystring" {
+ format = protocol.ISO8601TimeFormatName
+ }
+ }
+ str = protocol.FormatTime(format, value)
case aws.JSONValue:
if len(value) == 0 {
return "", errValueNotSet
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
index 823f045ee..de021367d 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
@@ -57,7 +57,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) {
defer r.HTTPResponse.Body.Close()
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
} else {
payload.Set(reflect.ValueOf(b))
}
@@ -65,7 +65,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) {
defer r.HTTPResponse.Body.Close()
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
} else {
str := string(b)
payload.Set(reflect.ValueOf(&str))
@@ -77,7 +77,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) {
case "io.ReadSeeker":
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
- r.Error = awserr.New("SerializationError",
+ r.Error = awserr.New(request.ErrCodeSerialization,
"failed to read response body", err)
return
}
@@ -85,7 +85,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) {
default:
io.Copy(ioutil.Discard, r.HTTPResponse.Body)
defer r.HTTPResponse.Body.Close()
- r.Error = awserr.New("SerializationError",
+ r.Error = awserr.New(request.ErrCodeSerialization,
"failed to decode REST response",
fmt.Errorf("unknown payload type %s", payload.Type()))
}
@@ -115,14 +115,14 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) {
case "header":
err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
break
}
case "headers":
prefix := field.Tag.Get("locationName")
err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
break
}
}
@@ -198,7 +198,11 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro
}
v.Set(reflect.ValueOf(&f))
case *time.Time:
- t, err := time.Parse(RFC822, header)
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.RFC822TimeFormatName
+ }
+ t, err := protocol.ParseTime(format, header)
if err != nil {
return err
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go
index 7bdf4c853..cf569645d 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go
@@ -36,7 +36,12 @@ func Build(r *request.Request) {
var buf bytes.Buffer
err := xmlutil.BuildXML(r.Params, xml.NewEncoder(&buf))
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to encode rest XML request", err)
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed to encode rest XML request", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
+ )
return
}
r.SetBufferBody(buf.Bytes())
@@ -50,7 +55,12 @@ func Unmarshal(r *request.Request) {
decoder := xml.NewDecoder(r.HTTPResponse.Body)
err := xmlutil.UnmarshalXML(r.Data, decoder, "")
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode REST XML response", err)
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed to decode REST XML response", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
+ )
return
}
} else {
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go
new file mode 100644
index 000000000..b7ed6c6f8
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go
@@ -0,0 +1,72 @@
+package protocol
+
+import (
+ "strconv"
+ "time"
+)
+
+// Names of time formats supported by the SDK
+const (
+ RFC822TimeFormatName = "rfc822"
+ ISO8601TimeFormatName = "iso8601"
+ UnixTimeFormatName = "unixTimestamp"
+)
+
+// Time formats supported by the SDK
+const (
+ // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT
+ RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT"
+
+ // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z
+ ISO8601TimeFormat = "2006-01-02T15:04:05Z"
+)
+
+// IsKnownTimestampFormat returns if the timestamp format name
+// is know to the SDK's protocols.
+func IsKnownTimestampFormat(name string) bool {
+ switch name {
+ case RFC822TimeFormatName:
+ fallthrough
+ case ISO8601TimeFormatName:
+ fallthrough
+ case UnixTimeFormatName:
+ return true
+ default:
+ return false
+ }
+}
+
+// FormatTime returns a string value of the time.
+func FormatTime(name string, t time.Time) string {
+ t = t.UTC()
+
+ switch name {
+ case RFC822TimeFormatName:
+ return t.Format(RFC822TimeFormat)
+ case ISO8601TimeFormatName:
+ return t.Format(ISO8601TimeFormat)
+ case UnixTimeFormatName:
+ return strconv.FormatInt(t.Unix(), 10)
+ default:
+ panic("unknown timestamp format name, " + name)
+ }
+}
+
+// ParseTime attempts to parse the time given the format. Returns
+// the time if it was able to be parsed, and fails otherwise.
+func ParseTime(formatName, value string) (time.Time, error) {
+ switch formatName {
+ case RFC822TimeFormatName:
+ return time.Parse(RFC822TimeFormat, value)
+ case ISO8601TimeFormatName:
+ return time.Parse(ISO8601TimeFormat, value)
+ case UnixTimeFormatName:
+ v, err := strconv.ParseFloat(value, 64)
+ if err != nil {
+ return time.Time{}, err
+ }
+ return time.Unix(int64(v), 0), nil
+ default:
+ panic("unknown timestamp format name, " + formatName)
+ }
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
index 7091b456d..cf981fe95 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
@@ -13,9 +13,13 @@ import (
"github.com/aws/aws-sdk-go/private/protocol"
)
-// BuildXML will serialize params into an xml.Encoder.
-// Error will be returned if the serialization of any of the params or nested values fails.
+// BuildXML will serialize params into an xml.Encoder. Error will be returned
+// if the serialization of any of the params or nested values fails.
func BuildXML(params interface{}, e *xml.Encoder) error {
+ return buildXML(params, e, false)
+}
+
+func buildXML(params interface{}, e *xml.Encoder, sorted bool) error {
b := xmlBuilder{encoder: e, namespaces: map[string]string{}}
root := NewXMLElement(xml.Name{})
if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil {
@@ -23,7 +27,7 @@ func BuildXML(params interface{}, e *xml.Encoder) error {
}
for _, c := range root.Children {
for _, v := range c {
- return StructToXML(e, v, false)
+ return StructToXML(e, v, sorted)
}
}
return nil
@@ -83,15 +87,13 @@ func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag refle
}
}
-// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested
+// buildStruct adds a struct and its fields to the current XMLNode. All fields and any nested
// types are converted to XMLNodes also.
func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
if !value.IsValid() {
return nil
}
- fieldAdded := false
-
// unwrap payloads
if payload := tag.Get("payload"); payload != "" {
field, _ := value.Type().FieldByName(payload)
@@ -119,6 +121,8 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl
child.Attr = append(child.Attr, ns)
}
+ var payloadFields, nonPayloadFields int
+
t := value.Type()
for i := 0; i < value.NumField(); i++ {
member := elemOf(value.Field(i))
@@ -133,8 +137,10 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl
mTag := field.Tag
if mTag.Get("location") != "" { // skip non-body members
+ nonPayloadFields++
continue
}
+ payloadFields++
if protocol.CanSetIdempotencyToken(value.Field(i), field) {
token := protocol.GetIdempotencyToken()
@@ -149,11 +155,11 @@ func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag refl
if err := b.buildValue(member, child, mTag); err != nil {
return err
}
-
- fieldAdded = true
}
- if fieldAdded { // only append this child if we have one ore more valid members
+ // Only case where the child shape is not added is if the shape only contains
+ // non-payload fields, e.g headers/query.
+ if !(payloadFields == 0 && nonPayloadFields > 0) {
current.AddChild(child)
}
@@ -278,8 +284,12 @@ func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag refl
case float32:
str = strconv.FormatFloat(float64(converted), 'f', -1, 32)
case time.Time:
- const ISO8601UTC = "2006-01-02T15:04:05Z"
- str = converted.UTC().Format(ISO8601UTC)
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.ISO8601TimeFormatName
+ }
+
+ str = protocol.FormatTime(format, converted)
default:
return fmt.Errorf("unsupported value for param %s: %v (%s)",
tag.Get("locationName"), value.Interface(), value.Type().Name())
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
index a6c25ba37..7108d3800 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
@@ -1,6 +1,7 @@
package xmlutil
import (
+ "bytes"
"encoding/base64"
"encoding/xml"
"fmt"
@@ -9,8 +10,28 @@ import (
"strconv"
"strings"
"time"
+
+ "github.com/aws/aws-sdk-go/aws/awserr"
+ "github.com/aws/aws-sdk-go/private/protocol"
)
+// UnmarshalXMLError unmarshals the XML error from the stream into the value
+// type specified. The value must be a pointer. If the message fails to
+// unmarshal, the message content will be included in the returned error as a
+// awserr.UnmarshalError.
+func UnmarshalXMLError(v interface{}, stream io.Reader) error {
+ var errBuf bytes.Buffer
+ body := io.TeeReader(stream, &errBuf)
+
+ err := xml.NewDecoder(body).Decode(v)
+ if err != nil && err != io.EOF {
+ return awserr.NewUnmarshalError(err,
+ "failed to unmarshal error message", errBuf.Bytes())
+ }
+
+ return nil
+}
+
// UnmarshalXML deserializes an xml.Decoder into the container v. V
// needs to match the shape of the XML expected to be decoded.
// If the shape doesn't match unmarshaling will fail.
@@ -253,8 +274,12 @@ func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
}
r.Set(reflect.ValueOf(&v))
case *time.Time:
- const ISO8601UTC = "2006-01-02T15:04:05Z"
- t, err := time.Parse(ISO8601UTC, node.Text)
+ format := tag.Get("timestampFormat")
+ if len(format) == 0 {
+ format = protocol.ISO8601TimeFormatName
+ }
+
+ t, err := protocol.ParseTime(format, node.Text)
if err != nil {
return err
}
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
index 3e970b629..515ce1521 100644
--- a/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
+++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
@@ -29,6 +29,7 @@ func NewXMLElement(name xml.Name) *XMLNode {
// AddChild adds child to the XMLNode.
func (n *XMLNode) AddChild(child *XMLNode) {
+ child.parent = n
if _, ok := n.Children[child.Name.Local]; !ok {
n.Children[child.Name.Local] = []*XMLNode{}
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go
index bf9d7a4e1..8c889ff34 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go
@@ -4,10 +4,12 @@ package dynamodb
import (
"fmt"
+ "net/url"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
+ "github.com/aws/aws-sdk-go/aws/crr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
@@ -18,7 +20,7 @@ const opBatchGetItem = "BatchGetItem"
// BatchGetItemRequest generates a "aws/request.Request" representing the
// client's request for the BatchGetItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -58,6 +60,27 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R
output = &BatchGetItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -67,23 +90,23 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R
// one or more tables. You identify requested items by primary key.
//
// A single operation can retrieve up to 16 MB of data, which can contain as
-// many as 100 items. BatchGetItem will return a partial result if the response
+// many as 100 items. BatchGetItem returns a partial result if the response
// size limit is exceeded, the table's provisioned throughput is exceeded, or
// an internal processing failure occurs. If a partial result is returned, the
// operation returns a value for UnprocessedKeys. You can use this value to
// retry the operation starting with the next item to get.
//
-// If you request more than 100 items BatchGetItem will return a ValidationException
-// with the message "Too many items requested for the BatchGetItem call".
+// If you request more than 100 items, BatchGetItem returns a ValidationException
+// with the message "Too many items requested for the BatchGetItem call."
//
// For example, if you ask to retrieve 100 items, but each individual item is
// 300 KB in size, the system returns 52 items (so as not to exceed the 16 MB
// limit). It also returns an appropriate UnprocessedKeys value so you can get
// the next page of results. If desired, your application can include its own
-// logic to assemble the pages of results into one data set.
+// logic to assemble the pages of results into one dataset.
//
// If none of the items can be processed due to insufficient provisioned throughput
-// on all of the tables in the request, then BatchGetItem will return a ProvisionedThroughputExceededException.
+// on all of the tables in the request, then BatchGetItem returns a ProvisionedThroughputExceededException.
// If at least one of the items is successfully processed, then BatchGetItem
// completes successfully, while returning the keys of the unread items in UnprocessedKeys.
//
@@ -94,7 +117,7 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R
// tables. If you delay the batch operation using exponential backoff, the individual
// requests in the batch are much more likely to succeed.
//
-// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations)
+// For more information, see Batch Operations and Error Handling (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations)
// in the Amazon DynamoDB Developer Guide.
//
// By default, BatchGetItem performs eventually consistent reads on every table
@@ -110,7 +133,7 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R
//
// If a requested item does not exist, it is not returned in the result. Requests
// for nonexistent items consume the minimum read capacity units according to
-// the type of read. For more information, see Capacity Units Calculations (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations)
+// the type of read. For more information, see Working with Tables (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#CapacityUnitCalculations)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -126,13 +149,18 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
// might not be specified correctly, or its status might not be ACTIVE.
//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -169,7 +197,7 @@ func (c *DynamoDB) BatchGetItemWithContext(ctx aws.Context, input *BatchGetItemI
// // Example iterating over at most 3 pages of a BatchGetItem operation.
// pageNum := 0
// err := client.BatchGetItemPages(params,
-// func(page *BatchGetItemOutput, lastPage bool) bool {
+// func(page *dynamodb.BatchGetItemOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -213,7 +241,7 @@ const opBatchWriteItem = "BatchWriteItem"
// BatchWriteItemRequest generates a "aws/request.Request" representing the
// client's request for the BatchWriteItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -247,6 +275,27 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
output = &BatchWriteItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -268,9 +317,8 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
// check for unprocessed items and submit a new BatchWriteItem request with
// those unprocessed items until all items have been processed.
//
-// Note that if none of the items can be processed due to insufficient provisioned
-// throughput on all of the tables in the request, then BatchWriteItem will
-// return a ProvisionedThroughputExceededException.
+// If none of the items can be processed due to insufficient provisioned throughput
+// on all of the tables in the request, then BatchWriteItem returns a ProvisionedThroughputExceededException.
//
// If DynamoDB returns any unprocessed items, you should retry the batch operation
// on those items. However, we strongly recommend that you use an exponential
@@ -279,16 +327,15 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
// tables. If you delay the batch operation using exponential backoff, the individual
// requests in the batch are much more likely to succeed.
//
-// For more information, see Batch Operations and Error Handling (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#BatchOperations)
+// For more information, see Batch Operations and Error Handling (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ErrorHandling.html#Programming.Errors.BatchOperations)
// in the Amazon DynamoDB Developer Guide.
//
// With BatchWriteItem, you can efficiently write or delete large amounts of
-// data, such as from Amazon Elastic MapReduce (EMR), or copy data from another
-// database into DynamoDB. In order to improve performance with these large-scale
-// operations, BatchWriteItem does not behave in the same way as individual
-// PutItem and DeleteItem calls would. For example, you cannot specify conditions
-// on individual put and delete requests, and BatchWriteItem does not return
-// deleted items in the response.
+// data, such as from Amazon EMR, or copy data from another database into DynamoDB.
+// In order to improve performance with these large-scale operations, BatchWriteItem
+// does not behave in the same way as individual PutItem and DeleteItem calls
+// would. For example, you cannot specify conditions on individual put and delete
+// requests, and BatchWriteItem does not return deleted items in the response.
//
// If you use a programming language that supports concurrency, you can use
// threads to write items in parallel. Your application must include the necessary
@@ -316,7 +363,7 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
// BatchWriteItem request. For example, you cannot put and delete the same
// item in the same BatchWriteItem request.
//
-// * Your request contains at least two items with identical hash and range
+// * Your request contains at least two items with identical hash and range
// keys (which essentially is two put operations).
//
// * There are more than 25 requests in the batch.
@@ -338,7 +385,7 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
@@ -349,6 +396,11 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque
// An item collection is too large. This exception is only returned for tables
// that have one or more local secondary indexes.
//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -379,7 +431,7 @@ const opCreateBackup = "CreateBackup"
// CreateBackupRequest generates a "aws/request.Request" representing the
// client's request for the CreateBackup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -413,6 +465,27 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R
output = &CreateBackupOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -420,10 +493,10 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R
//
// Creates a backup for an existing table.
//
-// Each time you create an On-Demand Backup, the entire table data is backed
+// Each time you create an on-demand backup, the entire table data is backed
// up. There is no limit to the number of on-demand backups that can be taken.
//
-// When you create an On-Demand Backup, a time marker of the request is cataloged,
+// When you create an on-demand backup, a time marker of the request is cataloged,
// and the backup is created asynchronously, by applying all changes until the
// time of the request to the last full table snapshot. Backup requests are
// processed instantaneously and become available for restore within minutes.
@@ -435,9 +508,8 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R
//
// If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed
// to contain all data committed to the table up to 14:24:00, and data committed
-// after 14:26:00 will not be. The backup may or may not contain data modifications
-// made between 14:24:00 and 14:26:00. On-Demand Backup does not support causal
-// consistency.
+// after 14:26:00 will not be. The backup might contain data modifications made
+// between 14:24:00 and 14:26:00. On-demand backup does not support causal consistency.
//
// Along with data, the following are also included on the backups:
//
@@ -469,21 +541,21 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R
//
// * ErrCodeBackupInUseException "BackupInUseException"
// There is another ongoing conflicting backup control plane operation on the
-// table. The backups is either being created, deleted or restored to a table.
+// table. The backup is either being created, deleted or restored to a table.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -515,7 +587,7 @@ const opCreateGlobalTable = "CreateGlobalTable"
// CreateGlobalTableRequest generates a "aws/request.Request" representing the
// client's request for the CreateGlobalTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -549,6 +621,27 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req
output = &CreateGlobalTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -556,33 +649,37 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req
//
// Creates a global table from an existing table. A global table creates a replication
// relationship between two or more DynamoDB tables with the same table name
-// in the provided regions.
+// in the provided Regions.
//
-// Tables can only be added as the replicas of a global table group under the
-// following conditions:
+// If you want to add a new replica table to a global table, each of the following
+// conditions must be true:
//
-// * The tables must have the same name.
+// * The table must have the same primary key as all of the other replicas.
//
-// * The tables must contain no items.
+// * The table must have the same name as all of the other replicas.
//
-// * The tables must have the same hash key and sort key (if present).
-//
-// * The tables must have DynamoDB Streams enabled (NEW_AND_OLD_IMAGES).
-//
-//
-// * The tables must have same provisioned and maximum write capacity units.
+// * The table must have DynamoDB Streams enabled, with the stream containing
+// both the new and the old images of the item.
//
+// * None of the replica tables in the global table can contain any data.
//
// If global secondary indexes are specified, then the following conditions
// must also be met:
//
-// * The global secondary indexes must have the same name.
+// * The global secondary indexes must have the same name.
//
-// * The global secondary indexes must have the same hash key and sort key
+// * The global secondary indexes must have the same hash key and sort key
// (if present).
//
-// * The global secondary indexes must have the same provisioned and maximum
-// write capacity units.
+// Write capacity settings should be set consistently across your replica tables
+// and secondary indexes. DynamoDB strongly recommends enabling auto scaling
+// to manage the write capacity settings for all of your global tables replicas
+// and indexes.
+//
+// If you prefer to manage write capacity settings manually, you should provision
+// equal replicated write capacity units to your replica tables. You should
+// also provision equal replicated write capacity units to matching secondary
+// indexes across your global 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
@@ -593,18 +690,18 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -643,7 +740,7 @@ const opCreateTable = "CreateTable"
// CreateTableRequest generates a "aws/request.Request" representing the
// client's request for the CreateTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -677,14 +774,35 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Req
output = &CreateTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// CreateTable API operation for Amazon DynamoDB.
//
// The CreateTable operation adds a new table to your account. In an AWS account,
-// table names must be unique within each region. That is, you can have two
-// tables with same name if you create the tables in different regions.
+// table names must be unique within each Region. That is, you can have two
+// tables with same name if you create the tables in different Regions.
//
// CreateTable is an asynchronous operation. Upon receiving a CreateTable request,
// DynamoDB immediately returns a response with a TableStatus of CREATING. After
@@ -712,18 +830,18 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Req
// in the CREATING state.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -755,7 +873,7 @@ const opDeleteBackup = "DeleteBackup"
// DeleteBackupRequest generates a "aws/request.Request" representing the
// client's request for the DeleteBackup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -789,6 +907,27 @@ func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) (req *request.R
output = &DeleteBackupOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -811,21 +950,21 @@ func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) (req *request.R
//
// * ErrCodeBackupInUseException "BackupInUseException"
// There is another ongoing conflicting backup control plane operation on the
-// table. The backups is either being created, deleted or restored to a table.
+// table. The backup is either being created, deleted or restored to a table.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -857,7 +996,7 @@ const opDeleteItem = "DeleteItem"
// DeleteItemRequest generates a "aws/request.Request" representing the
// client's request for the DeleteItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -891,6 +1030,27 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque
output = &DeleteItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -927,7 +1087,7 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
@@ -938,6 +1098,14 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque
// An item collection is too large. This exception is only returned for tables
// that have one or more local secondary indexes.
//
+// * ErrCodeTransactionConflictException "TransactionConflictException"
+// Operation was rejected because there is an ongoing transaction for the item.
+//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -968,7 +1136,7 @@ const opDeleteTable = "DeleteTable"
// DeleteTableRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1002,6 +1170,27 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Req
output = &DeleteTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1044,18 +1233,18 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Req
// might not be specified correctly, or its status might not be ACTIVE.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -1087,7 +1276,7 @@ const opDescribeBackup = "DescribeBackup"
// DescribeBackupRequest generates a "aws/request.Request" representing the
// client's request for the DescribeBackup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1121,6 +1310,27 @@ func (c *DynamoDB) DescribeBackupRequest(input *DescribeBackupInput) (req *reque
output = &DescribeBackupOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1171,7 +1381,7 @@ const opDescribeContinuousBackups = "DescribeContinuousBackups"
// DescribeContinuousBackupsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeContinuousBackups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1205,6 +1415,27 @@ func (c *DynamoDB) DescribeContinuousBackupsRequest(input *DescribeContinuousBac
output = &DescribeContinuousBackupsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1215,8 +1446,8 @@ func (c *DynamoDB) DescribeContinuousBackupsRequest(input *DescribeContinuousBac
// If point in time recovery is enabled, PointInTimeRecoveryStatus will be set
// to ENABLED.
//
-// Once continuous backups and point in time recovery are enabled, you can restore
-// to any point in time within EarliestRestorableDateTime and LatestRestorableDateTime.
+// After continuous backups and point in time recovery are enabled, you can
+// restore to any point in time within EarliestRestorableDateTime and LatestRestorableDateTime.
//
// LatestRestorableDateTime is typically 5 minutes before the current time.
// You can restore your table to any point in time during the last 35 days.
@@ -1261,12 +1492,145 @@ func (c *DynamoDB) DescribeContinuousBackupsWithContext(ctx aws.Context, input *
return out, req.Send()
}
+const opDescribeEndpoints = "DescribeEndpoints"
+
+// DescribeEndpointsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeEndpoints 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 DescribeEndpoints for more information on using the DescribeEndpoints
+// 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 DescribeEndpointsRequest method.
+// req, resp := client.DescribeEndpointsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeEndpoints
+func (c *DynamoDB) DescribeEndpointsRequest(input *DescribeEndpointsInput) (req *request.Request, output *DescribeEndpointsOutput) {
+ op := &request.Operation{
+ Name: opDescribeEndpoints,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DescribeEndpointsInput{}
+ }
+
+ output = &DescribeEndpointsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeEndpoints API operation for Amazon DynamoDB.
+//
+// Returns the regional endpoint information.
+//
+// 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 DynamoDB's
+// API operation DescribeEndpoints for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeEndpoints
+func (c *DynamoDB) DescribeEndpoints(input *DescribeEndpointsInput) (*DescribeEndpointsOutput, error) {
+ req, out := c.DescribeEndpointsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeEndpointsWithContext is the same as DescribeEndpoints with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeEndpoints 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 *DynamoDB) DescribeEndpointsWithContext(ctx aws.Context, input *DescribeEndpointsInput, opts ...request.Option) (*DescribeEndpointsOutput, error) {
+ req, out := c.DescribeEndpointsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+type discovererDescribeEndpoints struct {
+ Client *DynamoDB
+ Required bool
+ EndpointCache *crr.EndpointCache
+ Params map[string]*string
+ Key string
+}
+
+func (d *discovererDescribeEndpoints) Discover() (crr.Endpoint, error) {
+ input := &DescribeEndpointsInput{}
+
+ resp, err := d.Client.DescribeEndpoints(input)
+ if err != nil {
+ return crr.Endpoint{}, err
+ }
+
+ endpoint := crr.Endpoint{
+ Key: d.Key,
+ }
+
+ for _, e := range resp.Endpoints {
+ if e.Address == nil {
+ continue
+ }
+
+ cachedInMinutes := aws.Int64Value(e.CachePeriodInMinutes)
+ u, err := url.Parse(*e.Address)
+ if err != nil {
+ continue
+ }
+
+ addr := crr.WeightedAddress{
+ URL: u,
+ Expired: time.Now().Add(time.Duration(cachedInMinutes) * time.Minute),
+ }
+
+ endpoint.Add(addr)
+ }
+
+ d.EndpointCache.Add(endpoint)
+
+ return endpoint, nil
+}
+
+func (d *discovererDescribeEndpoints) Handler(r *request.Request) {
+ endpointKey := crr.BuildEndpointKey(d.Params)
+ d.Key = endpointKey
+
+ endpoint, err := d.EndpointCache.Get(d, endpointKey, d.Required)
+ if err != nil {
+ r.Error = err
+ return
+ }
+
+ if endpoint.URL != nil && len(endpoint.URL.String()) > 0 {
+ r.HTTPRequest.URL = endpoint.URL
+ }
+}
+
const opDescribeGlobalTable = "DescribeGlobalTable"
// DescribeGlobalTableRequest generates a "aws/request.Request" representing the
// client's request for the DescribeGlobalTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1300,6 +1664,27 @@ func (c *DynamoDB) DescribeGlobalTableRequest(input *DescribeGlobalTableInput) (
output = &DescribeGlobalTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1348,7 +1733,7 @@ const opDescribeGlobalTableSettings = "DescribeGlobalTableSettings"
// DescribeGlobalTableSettingsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeGlobalTableSettings operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1382,12 +1767,33 @@ func (c *DynamoDB) DescribeGlobalTableSettingsRequest(input *DescribeGlobalTable
output = &DescribeGlobalTableSettingsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// DescribeGlobalTableSettings API operation for Amazon DynamoDB.
//
-// Describes region specific settings for a global table.
+// Describes Region-specific settings for a global 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
@@ -1430,7 +1836,7 @@ const opDescribeLimits = "DescribeLimits"
// DescribeLimitsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeLimits operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1464,20 +1870,41 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reque
output = &DescribeLimitsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// DescribeLimits API operation for Amazon DynamoDB.
//
// Returns the current provisioned-capacity limits for your AWS account in a
-// region, both for the region as a whole and for any one DynamoDB table that
+// Region, both for the Region as a whole and for any one DynamoDB table that
// you create there.
//
// When you establish an AWS account, the account has initial limits on the
// maximum read capacity units and write capacity units that you can provision
-// across all of your DynamoDB tables in a given region. Also, there are per-table
+// across all of your DynamoDB tables in a given Region. Also, there are per-table
// limits that apply when you create a table there. For more information, see
-// Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+// Limits (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// page in the Amazon DynamoDB Developer Guide.
//
// Although you can increase these limits by filing a case at AWS Support Center
@@ -1488,26 +1915,27 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reque
//
// For example, you could use one of the AWS SDKs to do the following:
//
-// Call DescribeLimits for a particular region to obtain your current account
+// Call DescribeLimits for a particular Region to obtain your current account
// limits on provisioned capacity there.
//
// Create a variable to hold the aggregate read capacity units provisioned for
-// all your tables in that region, and one to hold the aggregate write capacity
+// all your tables in that Region, and one to hold the aggregate write capacity
// units. Zero them both.
//
// Call ListTables to obtain a list of all your DynamoDB tables.
//
// For each table name listed by ListTables, do the following:
//
-// Call DescribeTable with the table name.
+// * Call DescribeTable with the table name.
//
-// Use the data returned by DescribeTable to add the read capacity units and
-// write capacity units provisioned for the table itself to your variables.
+// * Use the data returned by DescribeTable to add the read capacity units
+// and write capacity units provisioned for the table itself to your variables.
//
-// If the table has one or more global secondary indexes (GSIs), loop over these
-// GSIs and add their provisioned capacity values to your variables as well.
+// * If the table has one or more global secondary indexes (GSIs), loop over
+// these GSIs and add their provisioned capacity values to your variables
+// as well.
//
-// Report the account limits for that region returned by DescribeLimits, along
+// Report the account limits for that Region returned by DescribeLimits, along
// with the total current provisioned capacity levels you have calculated.
//
// This will let you see whether you are getting close to your account-level
@@ -1517,8 +1945,8 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reque
// the sum of the provisioned capacity of the new table itself and all its global
// secondary indexes.
//
-// For existing tables and their GSIs, DynamoDB will not let you increase provisioned
-// capacity extremely rapidly, but the only upper limit that applies is that
+// For existing tables and their GSIs, DynamoDB doesn't let you increase provisioned
+// capacity extremely rapidly. But the only upper limit that applies is that
// the aggregate provisioned capacity over all your tables and GSIs cannot exceed
// either of the per-account limits.
//
@@ -1565,7 +1993,7 @@ const opDescribeTable = "DescribeTable"
// DescribeTableRequest generates a "aws/request.Request" representing the
// client's request for the DescribeTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1599,6 +2027,27 @@ func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request
output = &DescribeTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1656,7 +2105,7 @@ const opDescribeTimeToLive = "DescribeTimeToLive"
// DescribeTimeToLiveRequest generates a "aws/request.Request" representing the
// client's request for the DescribeTimeToLive operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1690,6 +2139,27 @@ func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (re
output = &DescribeTimeToLiveOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1739,7 +2209,7 @@ const opGetItem = "GetItem"
// GetItemRequest generates a "aws/request.Request" representing the
// client's request for the GetItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1773,6 +2243,27 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, ou
output = &GetItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1800,13 +2291,18 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, ou
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
// might not be specified correctly, or its status might not be ACTIVE.
//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -1837,7 +2333,7 @@ const opListBackups = "ListBackups"
// ListBackupsRequest generates a "aws/request.Request" representing the
// client's request for the ListBackups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1871,6 +2367,27 @@ func (c *DynamoDB) ListBackupsRequest(input *ListBackupsInput) (req *request.Req
output = &ListBackupsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -1878,13 +2395,13 @@ func (c *DynamoDB) ListBackupsRequest(input *ListBackupsInput) (req *request.Req
//
// List backups associated with an AWS account. To list backups for a given
// table, specify TableName. ListBackups returns a paginated list of results
-// with at most 1MB worth of items in a page. You can also specify a limit for
-// the maximum number of entries to be returned in a page.
+// with at most 1 MB worth of items in a page. You can also specify a limit
+// for the maximum number of entries to be returned in a page.
//
-// In the request, start time is inclusive but end time is exclusive. Note that
-// these limits are for the time at which the original backup was requested.
+// In the request, start time is inclusive, but end time is exclusive. Note
+// that these limits are for the time at which the original backup was requested.
//
-// You can call ListBackups a maximum of 5 times per second.
+// You can call ListBackups a maximum of five times per second.
//
// 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
@@ -1924,7 +2441,7 @@ const opListGlobalTables = "ListGlobalTables"
// ListGlobalTablesRequest generates a "aws/request.Request" representing the
// client's request for the ListGlobalTables operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1958,12 +2475,33 @@ func (c *DynamoDB) ListGlobalTablesRequest(input *ListGlobalTablesInput) (req *r
output = &ListGlobalTablesOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// ListGlobalTables API operation for Amazon DynamoDB.
//
-// Lists all global tables that have a replica in the specified region.
+// Lists all global tables that have a replica in the specified 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
@@ -2003,7 +2541,7 @@ const opListTables = "ListTables"
// ListTablesRequest generates a "aws/request.Request" representing the
// client's request for the ListTables operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2043,6 +2581,27 @@ func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Reque
output = &ListTablesOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2096,7 +2655,7 @@ func (c *DynamoDB) ListTablesWithContext(ctx aws.Context, input *ListTablesInput
// // Example iterating over at most 3 pages of a ListTables operation.
// pageNum := 0
// err := client.ListTablesPages(params,
-// func(page *ListTablesOutput, lastPage bool) bool {
+// func(page *dynamodb.ListTablesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -2140,7 +2699,7 @@ const opListTagsOfResource = "ListTagsOfResource"
// ListTagsOfResourceRequest generates a "aws/request.Request" representing the
// client's request for the ListTagsOfResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2174,6 +2733,27 @@ func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (re
output = &ListTagsOfResourceOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2182,7 +2762,7 @@ func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (re
// List all tags on an Amazon DynamoDB resource. You can call ListTagsOfResource
// up to 10 times per second, per account.
//
-// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
+// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2227,7 +2807,7 @@ const opPutItem = "PutItem"
// PutItemRequest generates a "aws/request.Request" representing the
// client's request for the PutItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2261,6 +2841,27 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
output = &PutItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2279,28 +2880,28 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
// For information on how to call the PutItem API using the AWS SDK in specific
// languages, see the following:
//
-// PutItem in the AWS Command Line Interface (http://docs.aws.amazon.com/goto/aws-cli/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS Command Line Interface (http://docs.aws.amazon.com/goto/aws-cli/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for .NET (http://docs.aws.amazon.com/goto/DotNetSDKV3/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for .NET (http://docs.aws.amazon.com/goto/DotNetSDKV3/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for C++ (http://docs.aws.amazon.com/goto/SdkForCpp/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for C++ (http://docs.aws.amazon.com/goto/SdkForCpp/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for Go (http://docs.aws.amazon.com/goto/SdkForGoV1/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for Go (http://docs.aws.amazon.com/goto/SdkForGoV1/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for Java (http://docs.aws.amazon.com/goto/SdkForJava/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for Java (http://docs.aws.amazon.com/goto/SdkForJava/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for JavaScript (http://docs.aws.amazon.com/goto/AWSJavaScriptSDK/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for JavaScript (http://docs.aws.amazon.com/goto/AWSJavaScriptSDK/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for PHP V3 (http://docs.aws.amazon.com/goto/SdkForPHPV3/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for PHP V3 (http://docs.aws.amazon.com/goto/SdkForPHPV3/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for Python (http://docs.aws.amazon.com/goto/boto3/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for Python (http://docs.aws.amazon.com/goto/boto3/dynamodb-2012-08-10/PutItem)
//
-// PutItem in the AWS SDK for Ruby V2 (http://docs.aws.amazon.com/goto/SdkForRubyV2/dynamodb-2012-08-10/PutItem)
+// * PutItem in the AWS SDK for Ruby V2 (http://docs.aws.amazon.com/goto/SdkForRubyV2/dynamodb-2012-08-10/PutItem)
//
-// When you add an item, the primary key attribute(s) are the only required
-// attributes. Attribute values cannot be null. String and Binary type attributes
-// must have lengths greater than zero. Set type attributes cannot be empty.
-// Requests with empty values will be rejected with a ValidationException exception.
+// When you add an item, the primary key attributes are the only required attributes.
+// Attribute values cannot be null. String and Binary type attributes must have
+// lengths greater than zero. Set type attributes cannot be empty. Requests
+// with empty values will be rejected with a ValidationException exception.
//
// To prevent a new item from replacing an existing item, use a conditional
// expression that contains the attribute_not_exists function with the name
@@ -2308,7 +2909,7 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
// record must contain that attribute, the attribute_not_exists function will
// only succeed if no matching item exists.
//
-// For more information about PutItem, see Working with Items (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html)
+// For more information about PutItem, see Working with Items (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2327,7 +2928,7 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
@@ -2338,6 +2939,14 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou
// An item collection is too large. This exception is only returned for tables
// that have one or more local secondary indexes.
//
+// * ErrCodeTransactionConflictException "TransactionConflictException"
+// Operation was rejected because there is an ongoing transaction for the item.
+//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -2368,7 +2977,7 @@ const opQuery = "Query"
// QueryRequest generates a "aws/request.Request" representing the
// client's request for the Query operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2408,6 +3017,27 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output
output = &QueryOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2446,7 +3076,7 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output
// (if using the Limit parameter) or a maximum of 1 MB of data and then apply
// any filtering to the results using FilterExpression. If LastEvaluatedKey
// is present in the response, you will need to paginate the result set. For
-// more information, see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination)
+// more information, see Paginating the Results (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html#Query.Pagination)
// in the Amazon DynamoDB Developer Guide.
//
// FilterExpression is applied after a Query finishes, but before the results
@@ -2475,13 +3105,18 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
// might not be specified correctly, or its status might not be ACTIVE.
//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -2518,7 +3153,7 @@ func (c *DynamoDB) QueryWithContext(ctx aws.Context, input *QueryInput, opts ...
// // Example iterating over at most 3 pages of a Query operation.
// pageNum := 0
// err := client.QueryPages(params,
-// func(page *QueryOutput, lastPage bool) bool {
+// func(page *dynamodb.QueryOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -2562,7 +3197,7 @@ const opRestoreTableFromBackup = "RestoreTableFromBackup"
// RestoreTableFromBackupRequest generates a "aws/request.Request" representing the
// client's request for the RestoreTableFromBackup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2596,6 +3231,27 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn
output = &RestoreTableFromBackupOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2612,7 +3268,7 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn
//
// * IAM policies
//
-// * Cloudwatch metrics and alarms
+// * Amazon CloudWatch metrics and alarms
//
// * Tags
//
@@ -2639,21 +3295,21 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn
//
// * ErrCodeBackupInUseException "BackupInUseException"
// There is another ongoing conflicting backup control plane operation on the
-// table. The backups is either being created, deleted or restored to a table.
+// table. The backup is either being created, deleted or restored to a table.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -2685,7 +3341,7 @@ const opRestoreTableToPointInTime = "RestoreTableToPointInTime"
// RestoreTableToPointInTimeRequest generates a "aws/request.Request" representing the
// client's request for the RestoreTableToPointInTime operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2719,6 +3375,27 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn
output = &RestoreTableToPointInTimeOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2742,10 +3419,8 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn
//
// * Provisioned read and write capacity
//
-// * Encryption settings
-//
-// All these settings come from the current settings of the source table at
-// the time of restore.
+// * Encryption settings All these settings come from the current settings
+// of the source table at the time of restore.
//
// You must manually set up the following on the restored table:
//
@@ -2753,7 +3428,7 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn
//
// * IAM policies
//
-// * Cloudwatch metrics and alarms
+// * Amazon CloudWatch metrics and alarms
//
// * Tags
//
@@ -2782,18 +3457,18 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn
// A target table with the specified name is either being created or deleted.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInvalidRestoreTimeException "InvalidRestoreTimeException"
// An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime
@@ -2832,7 +3507,7 @@ const opScan = "Scan"
// ScanRequest generates a "aws/request.Request" representing the
// client's request for the Scan operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2872,6 +3547,27 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *
output = &ScanOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -2881,23 +3577,23 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *
// every item in a table or a secondary index. To have DynamoDB return fewer
// items, you can provide a FilterExpression operation.
//
-// If the total number of scanned items exceeds the maximum data set size limit
+// If the total number of scanned items exceeds the maximum dataset size limit
// of 1 MB, the scan stops and results are returned to the user as a LastEvaluatedKey
// value to continue the scan in a subsequent operation. The results also include
// the number of items exceeding the limit. A scan can result in no table data
// meeting the filter criteria.
//
-// A single Scan operation will read up to the maximum number of items set (if
-// using the Limit parameter) or a maximum of 1 MB of data and then apply any
-// filtering to the results using FilterExpression. If LastEvaluatedKey is present
-// in the response, you will need to paginate the result set. For more information,
-// see Paginating the Results (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Pagination)
+// A single Scan operation reads up to the maximum number of items set (if using
+// the Limit parameter) or a maximum of 1 MB of data and then apply any filtering
+// to the results using FilterExpression. If LastEvaluatedKey is present in
+// the response, you need to paginate the result set. For more information,
+// see Paginating the Results (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Pagination)
// in the Amazon DynamoDB Developer Guide.
//
// Scan operations proceed sequentially; however, for faster performance on
// a large table or secondary index, applications can request a parallel Scan
// operation by providing the Segment and TotalSegments parameters. For more
-// information, see Parallel Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan)
+// information, see Parallel Scan (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.ParallelScan)
// in the Amazon DynamoDB Developer Guide.
//
// Scan uses eventually consistent reads when accessing the data in a table;
@@ -2919,13 +3615,18 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output *
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
// might not be specified correctly, or its status might not be ACTIVE.
//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -2962,7 +3663,7 @@ func (c *DynamoDB) ScanWithContext(ctx aws.Context, input *ScanInput, opts ...re
// // Example iterating over at most 3 pages of a Scan operation.
// pageNum := 0
// err := client.ScanPages(params,
-// func(page *ScanOutput, lastPage bool) bool {
+// func(page *dynamodb.ScanOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -3006,7 +3707,7 @@ const opTagResource = "TagResource"
// TagResourceRequest generates a "aws/request.Request" representing the
// client's request for the TagResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3040,8 +3741,28 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req
output = &TagResourceOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3049,10 +3770,10 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req
//
// Associate a set of tags with an Amazon DynamoDB resource. You can then activate
// these user-defined tags so that they appear on the Billing and Cost Management
-// console for cost allocation tracking. You can call TagResource up to 5 times
-// per second, per account.
+// console for cost allocation tracking. You can call TagResource up to five
+// times per second, per account.
//
-// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
+// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3064,18 +3785,18 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
@@ -3111,12 +3832,517 @@ func (c *DynamoDB) TagResourceWithContext(ctx aws.Context, input *TagResourceInp
return out, req.Send()
}
+const opTransactGetItems = "TransactGetItems"
+
+// TransactGetItemsRequest generates a "aws/request.Request" representing the
+// client's request for the TransactGetItems 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 TransactGetItems for more information on using the TransactGetItems
+// 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 TransactGetItemsRequest method.
+// req, resp := client.TransactGetItemsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactGetItems
+func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *request.Request, output *TransactGetItemsOutput) {
+ op := &request.Operation{
+ Name: opTransactGetItems,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &TransactGetItemsInput{}
+ }
+
+ output = &TransactGetItemsOutput{}
+ req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
+ return
+}
+
+// TransactGetItems API operation for Amazon DynamoDB.
+//
+// TransactGetItems is a synchronous operation that atomically retrieves multiple
+// items from one or more tables (but not from indexes) in a single account
+// and Region. A TransactGetItems call can contain up to 25 TransactGetItem
+// objects, each of which contains a Get structure that specifies an item to
+// retrieve from a table in the account and Region. A call to TransactGetItems
+// cannot retrieve items from tables in more than one AWS account or Region.
+// The aggregate size of the items in the transaction cannot exceed 4 MB.
+//
+// All AWS Regions and AWS GovCloud (US) support up to 25 items per transaction
+// with up to 4 MB of data, except the following AWS Regions:
+//
+// * China (Beijing)
+//
+// * China (Ningxia)
+//
+// The China (Beijing) and China (Ningxia) Regions support up to 10 items per
+// transaction with up to 4 MB of data.
+//
+// DynamoDB rejects the entire TransactGetItems request if any of the following
+// is true:
+//
+// * A conflicting operation is in the process of updating an item to be
+// read.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * There is a user error, such as an invalid data format.
+//
+// * The aggregate size of the items in the transaction cannot exceed 4 MB.
+//
+// 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 DynamoDB's
+// API operation TransactGetItems for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
+// The operation tried to access a nonexistent table or index. The resource
+// might not be specified correctly, or its status might not be ACTIVE.
+//
+// * ErrCodeTransactionCanceledException "TransactionCanceledException"
+// The entire transaction request was canceled.
+//
+// DynamoDB cancels a TransactWriteItems request under the following circumstances:
+//
+// * A condition in one of the condition expressions is not met.
+//
+// * A table in the TransactWriteItems request is in a different account
+// or region.
+//
+// * More than one action in the TransactWriteItems operation targets the
+// same item.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * An item size becomes too large (larger than 400 KB), or a local secondary
+// index (LSI) becomes too large, or a similar validation error occurs because
+// of changes made by the transaction.
+//
+// * The aggregate size of the items in the transaction exceeds 4 MBs.
+//
+// * There is a user error, such as an invalid data format.
+//
+// DynamoDB cancels a TransactGetItems request under the following circumstances:
+//
+// * There is an ongoing TransactGetItems operation that conflicts with a
+// concurrent PutItem, UpdateItem, DeleteItem or TransactWriteItems request.
+// In this case the TransactGetItems operation fails with a TransactionCanceledException.
+//
+// * A table in the TransactGetItems request is in a different account or
+// region.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * The aggregate size of the items in the transaction exceeds 4 MBs.
+//
+// * There is a user error, such as an invalid data format.
+//
+// If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons
+// property. This property is not set for other languages. Transaction cancellation
+// reasons are ordered in the order of requested items, if an item has no error
+// it will have NONE code and Null message.
+//
+// Cancellation reason codes and possible error messages:
+//
+// * No Errors: Code: NONE Message: null
+//
+// * Conditional Check Failed: Code: ConditionalCheckFailed Message: The
+// conditional request failed.
+//
+// * Item Collection Size Limit Exceeded: Code: ItemCollectionSizeLimitExceeded
+// Message: Collection size exceeded.
+//
+// * Transaction Conflict: Code: TransactionConflict Message: Transaction
+// is ongoing for the item.
+//
+// * Provisioned Throughput Exceeded: Code: ProvisionedThroughputExceeded
+// Messages: The level of configured provisioned throughput for the table
+// was exceeded. Consider increasing your provisioning level with the UpdateTable
+// API. This Message is received when provisioned throughput is exceeded
+// is on a provisioned DynamoDB table. The level of configured provisioned
+// throughput for one or more global secondary indexes of the table was exceeded.
+// Consider increasing your provisioning level for the under-provisioned
+// global secondary indexes with the UpdateTable API. This message is returned
+// when provisioned throughput is exceeded is on a provisioned GSI.
+//
+// * Throttling Error: Code: ThrottlingError Messages: Throughput exceeds
+// the current capacity of your table or index. DynamoDB is automatically
+// scaling your table or index so please try again shortly. If exceptions
+// persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.
+// This message is returned when writes get throttled on an On-Demand table
+// as DynamoDB is automatically scaling the table. Throughput exceeds the
+// current capacity for one or more global secondary indexes. DynamoDB is
+// automatically scaling your index so please try again shortly. This message
+// is returned when when writes get throttled on an On-Demand GSI as DynamoDB
+// is automatically scaling the GSI.
+//
+// * Validation Error: Code: ValidationError Messages: One or more parameter
+// values were invalid. The update expression attempted to update the secondary
+// index key beyond allowed size limits. The update expression attempted
+// to update the secondary index key to unsupported type. An operand in the
+// update expression has an incorrect data type. Item size to update has
+// exceeded the maximum allowed size. Number overflow. Attempting to store
+// a number with magnitude larger than supported range. Type mismatch for
+// attribute to update. Nesting Levels have exceeded supported limits. The
+// document path provided in the update expression is invalid for update.
+// The provided expression refers to an attribute that does not exist in
+// the item.
+//
+// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
+// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
+// requests that receive this exception. Your request is eventually successful,
+// unless your retry queue is too large to finish. Reduce the frequency of requests
+// and use exponential backoff. For more information, go to Error Retries and
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// in the Amazon DynamoDB Developer Guide.
+//
+// * ErrCodeInternalServerError "InternalServerError"
+// An error occurred on the server side.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactGetItems
+func (c *DynamoDB) TransactGetItems(input *TransactGetItemsInput) (*TransactGetItemsOutput, error) {
+ req, out := c.TransactGetItemsRequest(input)
+ return out, req.Send()
+}
+
+// TransactGetItemsWithContext is the same as TransactGetItems with the addition of
+// the ability to pass a context and additional request options.
+//
+// See TransactGetItems 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 *DynamoDB) TransactGetItemsWithContext(ctx aws.Context, input *TransactGetItemsInput, opts ...request.Option) (*TransactGetItemsOutput, error) {
+ req, out := c.TransactGetItemsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opTransactWriteItems = "TransactWriteItems"
+
+// TransactWriteItemsRequest generates a "aws/request.Request" representing the
+// client's request for the TransactWriteItems 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 TransactWriteItems for more information on using the TransactWriteItems
+// 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 TransactWriteItemsRequest method.
+// req, resp := client.TransactWriteItemsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactWriteItems
+func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (req *request.Request, output *TransactWriteItemsOutput) {
+ op := &request.Operation{
+ Name: opTransactWriteItems,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &TransactWriteItemsInput{}
+ }
+
+ output = &TransactWriteItemsOutput{}
+ req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
+ return
+}
+
+// TransactWriteItems API operation for Amazon DynamoDB.
+//
+// TransactWriteItems is a synchronous write operation that groups up to 25
+// action requests. These actions can target items in different tables, but
+// not in different AWS accounts or Regions, and no two actions can target the
+// same item. For example, you cannot both ConditionCheck and Update the same
+// item. The aggregate size of the items in the transaction cannot exceed 4
+// MB.
+//
+// All AWS Regions and AWS GovCloud (US) support up to 25 items per transaction
+// with up to 4 MB of data, except the following AWS Regions:
+//
+// * China (Beijing)
+//
+// * China (Ningxia)
+//
+// The China (Beijing) and China (Ningxia) Regions support up to 10 items per
+// transaction with up to 4 MB of data.
+//
+// The actions are completed atomically so that either all of them succeed,
+// or all of them fail. They are defined by the following objects:
+//
+// * Put — Initiates a PutItem operation to write a new item. This structure
+// specifies the primary key of the item to be written, the name of the table
+// to write it in, an optional condition expression that must be satisfied
+// for the write to succeed, a list of the item's attributes, and a field
+// indicating whether to retrieve the item's attributes if the condition
+// is not met.
+//
+// * Update — Initiates an UpdateItem operation to update an existing item.
+// This structure specifies the primary key of the item to be updated, the
+// name of the table where it resides, an optional condition expression that
+// must be satisfied for the update to succeed, an expression that defines
+// one or more attributes to be updated, and a field indicating whether to
+// retrieve the item's attributes if the condition is not met.
+//
+// * Delete — Initiates a DeleteItem operation to delete an existing item.
+// This structure specifies the primary key of the item to be deleted, the
+// name of the table where it resides, an optional condition expression that
+// must be satisfied for the deletion to succeed, and a field indicating
+// whether to retrieve the item's attributes if the condition is not met.
+//
+// * ConditionCheck — Applies a condition to an item that is not being
+// modified by the transaction. This structure specifies the primary key
+// of the item to be checked, the name of the table where it resides, a condition
+// expression that must be satisfied for the transaction to succeed, and
+// a field indicating whether to retrieve the item's attributes if the condition
+// is not met.
+//
+// DynamoDB rejects the entire TransactWriteItems request if any of the following
+// is true:
+//
+// * A condition in one of the condition expressions is not met.
+//
+// * An ongoing operation is in the process of updating the same item.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * An item size becomes too large (bigger than 400 KB), a local secondary
+// index (LSI) becomes too large, or a similar validation error occurs because
+// of changes made by the transaction.
+//
+// * The aggregate size of the items in the transaction exceeds 4 MB.
+//
+// * There is a user error, such as an invalid data format.
+//
+// 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 DynamoDB's
+// API operation TransactWriteItems for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
+// The operation tried to access a nonexistent table or index. The resource
+// might not be specified correctly, or its status might not be ACTIVE.
+//
+// * ErrCodeTransactionCanceledException "TransactionCanceledException"
+// The entire transaction request was canceled.
+//
+// DynamoDB cancels a TransactWriteItems request under the following circumstances:
+//
+// * A condition in one of the condition expressions is not met.
+//
+// * A table in the TransactWriteItems request is in a different account
+// or region.
+//
+// * More than one action in the TransactWriteItems operation targets the
+// same item.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * An item size becomes too large (larger than 400 KB), or a local secondary
+// index (LSI) becomes too large, or a similar validation error occurs because
+// of changes made by the transaction.
+//
+// * The aggregate size of the items in the transaction exceeds 4 MBs.
+//
+// * There is a user error, such as an invalid data format.
+//
+// DynamoDB cancels a TransactGetItems request under the following circumstances:
+//
+// * There is an ongoing TransactGetItems operation that conflicts with a
+// concurrent PutItem, UpdateItem, DeleteItem or TransactWriteItems request.
+// In this case the TransactGetItems operation fails with a TransactionCanceledException.
+//
+// * A table in the TransactGetItems request is in a different account or
+// region.
+//
+// * There is insufficient provisioned capacity for the transaction to be
+// completed.
+//
+// * The aggregate size of the items in the transaction exceeds 4 MBs.
+//
+// * There is a user error, such as an invalid data format.
+//
+// If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons
+// property. This property is not set for other languages. Transaction cancellation
+// reasons are ordered in the order of requested items, if an item has no error
+// it will have NONE code and Null message.
+//
+// Cancellation reason codes and possible error messages:
+//
+// * No Errors: Code: NONE Message: null
+//
+// * Conditional Check Failed: Code: ConditionalCheckFailed Message: The
+// conditional request failed.
+//
+// * Item Collection Size Limit Exceeded: Code: ItemCollectionSizeLimitExceeded
+// Message: Collection size exceeded.
+//
+// * Transaction Conflict: Code: TransactionConflict Message: Transaction
+// is ongoing for the item.
+//
+// * Provisioned Throughput Exceeded: Code: ProvisionedThroughputExceeded
+// Messages: The level of configured provisioned throughput for the table
+// was exceeded. Consider increasing your provisioning level with the UpdateTable
+// API. This Message is received when provisioned throughput is exceeded
+// is on a provisioned DynamoDB table. The level of configured provisioned
+// throughput for one or more global secondary indexes of the table was exceeded.
+// Consider increasing your provisioning level for the under-provisioned
+// global secondary indexes with the UpdateTable API. This message is returned
+// when provisioned throughput is exceeded is on a provisioned GSI.
+//
+// * Throttling Error: Code: ThrottlingError Messages: Throughput exceeds
+// the current capacity of your table or index. DynamoDB is automatically
+// scaling your table or index so please try again shortly. If exceptions
+// persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.
+// This message is returned when writes get throttled on an On-Demand table
+// as DynamoDB is automatically scaling the table. Throughput exceeds the
+// current capacity for one or more global secondary indexes. DynamoDB is
+// automatically scaling your index so please try again shortly. This message
+// is returned when when writes get throttled on an On-Demand GSI as DynamoDB
+// is automatically scaling the GSI.
+//
+// * Validation Error: Code: ValidationError Messages: One or more parameter
+// values were invalid. The update expression attempted to update the secondary
+// index key beyond allowed size limits. The update expression attempted
+// to update the secondary index key to unsupported type. An operand in the
+// update expression has an incorrect data type. Item size to update has
+// exceeded the maximum allowed size. Number overflow. Attempting to store
+// a number with magnitude larger than supported range. Type mismatch for
+// attribute to update. Nesting Levels have exceeded supported limits. The
+// document path provided in the update expression is invalid for update.
+// The provided expression refers to an attribute that does not exist in
+// the item.
+//
+// * ErrCodeTransactionInProgressException "TransactionInProgressException"
+// The transaction with the given request token is already in progress.
+//
+// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException"
+// DynamoDB rejected the request because you retried a request with a different
+// payload but with an idempotent token that was already used.
+//
+// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException"
+// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
+// requests that receive this exception. Your request is eventually successful,
+// unless your retry queue is too large to finish. Reduce the frequency of requests
+// and use exponential backoff. For more information, go to Error Retries and
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// in the Amazon DynamoDB Developer Guide.
+//
+// * ErrCodeInternalServerError "InternalServerError"
+// An error occurred on the server side.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactWriteItems
+func (c *DynamoDB) TransactWriteItems(input *TransactWriteItemsInput) (*TransactWriteItemsOutput, error) {
+ req, out := c.TransactWriteItemsRequest(input)
+ return out, req.Send()
+}
+
+// TransactWriteItemsWithContext is the same as TransactWriteItems with the addition of
+// the ability to pass a context and additional request options.
+//
+// See TransactWriteItems 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 *DynamoDB) TransactWriteItemsWithContext(ctx aws.Context, input *TransactWriteItemsInput, opts ...request.Option) (*TransactWriteItemsOutput, error) {
+ req, out := c.TransactWriteItemsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opUntagResource = "UntagResource"
// UntagResourceRequest generates a "aws/request.Request" representing the
// client's request for the UntagResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3150,17 +4376,37 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request
output = &UntagResourceOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// UntagResource API operation for Amazon DynamoDB.
//
// Removes the association of tags from an Amazon DynamoDB resource. You can
-// call UntagResource up to 5 times per second, per account.
+// call UntagResource up to five times per second, per account.
//
-// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
+// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3172,18 +4418,18 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request
//
// Returned Error Codes:
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
// The operation tried to access a nonexistent table or index. The resource
@@ -3224,7 +4470,7 @@ const opUpdateContinuousBackups = "UpdateContinuousBackups"
// UpdateContinuousBackupsRequest generates a "aws/request.Request" representing the
// client's request for the UpdateContinuousBackups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3258,6 +4504,27 @@ func (c *DynamoDB) UpdateContinuousBackupsRequest(input *UpdateContinuousBackups
output = &UpdateContinuousBackupsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3273,7 +4540,7 @@ func (c *DynamoDB) UpdateContinuousBackupsRequest(input *UpdateContinuousBackups
// to any point in time within EarliestRestorableDateTime and LatestRestorableDateTime.
//
// LatestRestorableDateTime is typically 5 minutes before the current time.
-// You can restore your table to any point in time during the last 35 days..
+// You can restore your table to any point in time during the last 35 days.
//
// 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
@@ -3320,7 +4587,7 @@ const opUpdateGlobalTable = "UpdateGlobalTable"
// UpdateGlobalTableRequest generates a "aws/request.Request" representing the
// client's request for the UpdateGlobalTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3354,6 +4621,27 @@ func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) (req
output = &UpdateGlobalTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3361,9 +4649,9 @@ func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) (req
//
// Adds or removes replicas in the specified global table. The global table
// must already exist to be able to use this operation. Any replica to be added
-// must be empty, must have the same name as the global table, must have the
-// same key schema, and must have DynamoDB Streams enabled and must have same
-// provisioned and maximum write capacity units.
+// must be empty, have the same name as the global table, have the same key
+// schema, have DynamoDB Streams enabled, and have the same provisioned and
+// maximum write capacity units.
//
// Although you can use UpdateGlobalTable to add replicas and remove replicas
// in a single request, for simplicity we recommend that you issue separate
@@ -3372,12 +4660,12 @@ func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) (req
// If global secondary indexes are specified, then the following conditions
// must also be met:
//
-// * The global secondary indexes must have the same name.
+// * The global secondary indexes must have the same name.
//
-// * The global secondary indexes must have the same hash key and sort key
+// * The global secondary indexes must have the same hash key and sort key
// (if present).
//
-// * The global secondary indexes must have the same provisioned and maximum
+// * The global secondary indexes must have the same provisioned and maximum
// write capacity units.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3431,7 +4719,7 @@ const opUpdateGlobalTableSettings = "UpdateGlobalTableSettings"
// UpdateGlobalTableSettingsRequest generates a "aws/request.Request" representing the
// client's request for the UpdateGlobalTableSettings operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3465,6 +4753,27 @@ func (c *DynamoDB) UpdateGlobalTableSettingsRequest(input *UpdateGlobalTableSett
output = &UpdateGlobalTableSettingsOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3490,18 +4799,18 @@ func (c *DynamoDB) UpdateGlobalTableSettingsRequest(input *UpdateGlobalTableSett
// The operation tried to access a nonexistent index.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeResourceInUseException "ResourceInUseException"
// The operation conflicts with the resource's availability. For example, you
@@ -3538,7 +4847,7 @@ const opUpdateItem = "UpdateItem"
// UpdateItemRequest generates a "aws/request.Request" representing the
// client's request for the UpdateItem operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3572,6 +4881,27 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque
output = &UpdateItemOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3602,7 +4932,7 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
-// Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
//
// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
@@ -3613,6 +4943,14 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque
// An item collection is too large. This exception is only returned for tables
// that have one or more local secondary indexes.
//
+// * ErrCodeTransactionConflictException "TransactionConflictException"
+// Operation was rejected because there is an ongoing transaction for the item.
+//
+// * ErrCodeRequestLimitExceeded "RequestLimitExceeded"
+// Throughput exceeds the current throughput limit for your account. Please
+// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+// a limit increase.
+//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
//
@@ -3643,7 +4981,7 @@ const opUpdateTable = "UpdateTable"
// UpdateTableRequest generates a "aws/request.Request" representing the
// client's request for the UpdateTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3677,6 +5015,27 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req
output = &UpdateTableOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
@@ -3689,11 +5048,11 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req
//
// * Modify the provisioned throughput settings of the table.
//
-// * Enable or disable Streams on the table.
+// * Enable or disable DynamoDB Streams on the table.
//
// * Remove a global secondary index from the table.
//
-// * Create a new global secondary index on the table. Once the index begins
+// * Create a new global secondary index on the table. After the index begins
// backfilling, you can use UpdateTable to perform other operations.
//
// UpdateTable is an asynchronous operation; while it is executing, the table
@@ -3719,18 +5078,18 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req
// might not be specified correctly, or its status might not be ACTIVE.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -3762,7 +5121,7 @@ const opUpdateTimeToLive = "UpdateTimeToLive"
// UpdateTimeToLiveRequest generates a "aws/request.Request" representing the
// client's request for the UpdateTimeToLive operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3796,14 +5155,35 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r
output = &UpdateTimeToLiveOutput{}
req = c.newRequest(op, input, output)
+ if aws.BoolValue(req.Config.EnableEndpointDiscovery) {
+ de := discovererDescribeEndpoints{
+ Required: false,
+ EndpointCache: c.endpointCache,
+ Params: map[string]*string{
+ "op": aws.String(req.Operation.Name),
+ },
+ Client: c,
+ }
+
+ for k, v := range de.Params {
+ if v == nil {
+ delete(de.Params, k)
+ }
+ }
+
+ req.Handlers.Build.PushFrontNamed(request.NamedHandler{
+ Name: "crr.endpointdiscovery",
+ Fn: de.Handler,
+ })
+ }
return
}
// UpdateTimeToLive API operation for Amazon DynamoDB.
//
-// The UpdateTimeToLive method will enable or disable TTL for the specified
-// table. A successful UpdateTimeToLive call returns the current TimeToLiveSpecification;
-// it may take up to one hour for the change to fully process. Any additional
+// The UpdateTimeToLive method enables or disables Time to Live (TTL) for the
+// specified table. A successful UpdateTimeToLive call returns the current TimeToLiveSpecification.
+// It can take up to one hour for the change to fully process. Any additional
// UpdateTimeToLive calls for the same table during this one hour duration result
// in a ValidationException.
//
@@ -3813,7 +5193,7 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r
// deleted.
//
// The epoch time format is the number of seconds elapsed since 12:00:00 AM
-// January 1st, 1970 UTC.
+// January 1, 1970 UTC.
//
// DynamoDB deletes expired items on a best-effort basis to ensure availability
// of throughput for other data operations.
@@ -3823,11 +5203,11 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r
// to the nature of the workload. Items that have expired and not been deleted
// will still show up in reads, queries, and scans.
//
-// As items are deleted, they are removed from any Local Secondary Index and
-// Global Secondary Index immediately in the same eventually consistent way
+// As items are deleted, they are removed from any local secondary index and
+// global secondary index immediately in the same eventually consistent way
// as a standard delete operation.
//
-// For more information, see Time To Live (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html)
+// For more information, see Time To Live (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html)
// in the Amazon DynamoDB Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3848,18 +5228,18 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r
// might not be specified correctly, or its status might not be ACTIVE.
//
// * ErrCodeLimitExceededException "LimitExceededException"
-// Up to 50 CreateBackup operations are allowed per second, per account. There
-// is no limit to the number of daily on-demand backups that can be taken.
+// There is no limit to the number of daily on-demand backups that can be taken.
//
-// Up to 10 simultaneous table operations are allowed per account. These operations
+// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
-// For tables with secondary indexes, only one of those tables can be in the
-// CREATING state at any point in time. Do not attempt to create more than one
-// such table simultaneously.
+// The only exception is when you are creating a table with one or more secondary
+// indexes. You can have up to 25 such requests running at a time; however,
+// if the table or index specifications are complex, DynamoDB might temporarily
+// reduce the number of concurrent operations.
//
-// The total limit of tables in the ACTIVE state is 250.
+// There is a soft account limit of 256 tables.
//
// * ErrCodeInternalServerError "InternalServerError"
// An error occurred on the server side.
@@ -3953,7 +5333,7 @@ func (s *AttributeDefinition) SetAttributeType(v string) *AttributeDefinition {
// Each attribute value is described as a name-value pair. The name is the data
// type, and the value is the data itself.
//
-// For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
+// For more information, see Data Types (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
// in the Amazon DynamoDB Developer Guide.
type AttributeValue struct {
_ struct{} `type:"structure"`
@@ -3977,7 +5357,7 @@ type AttributeValue struct {
// An attribute of type List. For example:
//
- // "L": ["Cookies", "Coffee", 3.14159]
+ // "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
L []*AttributeValue `type:"list"`
// An attribute of type Map. For example:
@@ -4113,47 +5493,38 @@ type AttributeValueUpdate struct {
//
// * DELETE - If no value is specified, the attribute and its value are removed
// from the item. The data type of the specified value must match the existing
- // value's data type.
- //
- // If a set of values is specified, then those values are subtracted from the
- // old set. For example, if the attribute value was the set [a,b,c] and the
- // DELETE action specified [a,c], then the final attribute value would be
- // [b]. Specifying an empty set is an error.
+ // value's data type. If a set of values is specified, then those values
+ // are subtracted from the old set. For example, if the attribute value was
+ // the set [a,b,c] and the DELETE action specified [a,c], then the final
+ // attribute value would be [b]. Specifying an empty set is an error.
//
// * ADD - If the attribute does not already exist, then the attribute and
// its values are added to the item. If the attribute does exist, then the
- // behavior of ADD depends on the data type of the attribute:
- //
- // If the existing attribute is a number, and if Value is also a number, then
- // the Value is mathematically added to the existing attribute. If Value
- // is a negative number, then it is subtracted from the existing attribute.
- //
- // If you use ADD to increment or decrement a number value for an item that
- // doesn't exist before the update, DynamoDB uses 0 as the initial value.
- //
- // In addition, if you use ADD to update an existing item, and intend to increment
- // or decrement an attribute value which does not yet exist, DynamoDB uses
- // 0 as the initial value. For example, suppose that the item you want to
- // update does not yet have an attribute named itemcount, but you decide
- // to ADD the number 3 to this attribute anyway, even though it currently
- // does not exist. DynamoDB will create the itemcount attribute, set its
- // initial value to 0, and finally add 3 to it. The result will be a new
- // itemcount attribute in the item, with a value of 3.
- //
- // If the existing data type is a set, and if the Value is also a set, then
- // the Value is added to the existing set. (This is a set operation, not
- // mathematical addition.) For example, if the attribute value was the set
- // [1,2], and the ADD action specified [3], then the final attribute value
- // would be [1,2,3]. An error occurs if an Add action is specified for a
- // set attribute and the attribute type specified does not match the existing
- // set type.
- //
- // Both sets must have the same primitive data type. For example, if the existing
- // data type is a set of strings, the Value must also be a set of strings.
- // The same holds true for number sets and binary sets.
- //
- // This action is only valid for an existing attribute whose data type is number
- // or is a set. Do not use ADD for any other data types.
+ // behavior of ADD depends on the data type of the attribute: If the existing
+ // attribute is a number, and if Value is also a number, then the Value is
+ // mathematically added to the existing attribute. If Value is a negative
+ // number, then it is subtracted from the existing attribute. If you use
+ // ADD to increment or decrement a number value for an item that doesn't
+ // exist before the update, DynamoDB uses 0 as the initial value. In addition,
+ // if you use ADD to update an existing item, and intend to increment or
+ // decrement an attribute value which does not yet exist, DynamoDB uses 0
+ // as the initial value. For example, suppose that the item you want to update
+ // does not yet have an attribute named itemcount, but you decide to ADD
+ // the number 3 to this attribute anyway, even though it currently does not
+ // exist. DynamoDB will create the itemcount attribute, set its initial value
+ // to 0, and finally add 3 to it. The result will be a new itemcount attribute
+ // in the item, with a value of 3. If the existing data type is a set, and
+ // if the Value is also a set, then the Value is added to the existing set.
+ // (This is a set operation, not mathematical addition.) For example, if
+ // the attribute value was the set [1,2], and the ADD action specified [3],
+ // then the final attribute value would be [1,2,3]. An error occurs if an
+ // Add action is specified for a set attribute and the attribute type specified
+ // does not match the existing set type. Both sets must have the same primitive
+ // data type. For example, if the existing data type is a set of strings,
+ // the Value must also be a set of strings. The same holds true for number
+ // sets and binary sets. This action is only valid for an existing attribute
+ // whose data type is number or is a set. Do not use ADD for any other data
+ // types.
//
// If no item with the specified Key is found:
//
@@ -4172,7 +5543,7 @@ type AttributeValueUpdate struct {
// Each attribute value is described as a name-value pair. The name is the data
// type, and the value is the data itself.
//
- // For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
+ // For more information, see Data Types (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
// in the Amazon DynamoDB Developer Guide.
Value *AttributeValue `type:"structure"`
}
@@ -4199,6 +5570,394 @@ func (s *AttributeValueUpdate) SetValue(v *AttributeValue) *AttributeValueUpdate
return s
}
+// Represents the properties of the scaling policy.
+type AutoScalingPolicyDescription struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the scaling policy.
+ PolicyName *string `min:"1" type:"string"`
+
+ // Represents a target tracking scaling policy configuration.
+ TargetTrackingScalingPolicyConfiguration *AutoScalingTargetTrackingScalingPolicyConfigurationDescription `type:"structure"`
+}
+
+// String returns the string representation
+func (s AutoScalingPolicyDescription) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingPolicyDescription) GoString() string {
+ return s.String()
+}
+
+// SetPolicyName sets the PolicyName field's value.
+func (s *AutoScalingPolicyDescription) SetPolicyName(v string) *AutoScalingPolicyDescription {
+ s.PolicyName = &v
+ return s
+}
+
+// SetTargetTrackingScalingPolicyConfiguration sets the TargetTrackingScalingPolicyConfiguration field's value.
+func (s *AutoScalingPolicyDescription) SetTargetTrackingScalingPolicyConfiguration(v *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) *AutoScalingPolicyDescription {
+ s.TargetTrackingScalingPolicyConfiguration = v
+ return s
+}
+
+// Represents the autoscaling policy to be modified.
+type AutoScalingPolicyUpdate struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the scaling policy.
+ PolicyName *string `min:"1" type:"string"`
+
+ // Represents a target tracking scaling policy configuration.
+ //
+ // TargetTrackingScalingPolicyConfiguration is a required field
+ TargetTrackingScalingPolicyConfiguration *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate `type:"structure" required:"true"`
+}
+
+// String returns the string representation
+func (s AutoScalingPolicyUpdate) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingPolicyUpdate) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AutoScalingPolicyUpdate) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AutoScalingPolicyUpdate"}
+ if s.PolicyName != nil && len(*s.PolicyName) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
+ }
+ if s.TargetTrackingScalingPolicyConfiguration == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetTrackingScalingPolicyConfiguration"))
+ }
+ if s.TargetTrackingScalingPolicyConfiguration != nil {
+ if err := s.TargetTrackingScalingPolicyConfiguration.Validate(); err != nil {
+ invalidParams.AddNested("TargetTrackingScalingPolicyConfiguration", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetPolicyName sets the PolicyName field's value.
+func (s *AutoScalingPolicyUpdate) SetPolicyName(v string) *AutoScalingPolicyUpdate {
+ s.PolicyName = &v
+ return s
+}
+
+// SetTargetTrackingScalingPolicyConfiguration sets the TargetTrackingScalingPolicyConfiguration field's value.
+func (s *AutoScalingPolicyUpdate) SetTargetTrackingScalingPolicyConfiguration(v *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) *AutoScalingPolicyUpdate {
+ s.TargetTrackingScalingPolicyConfiguration = v
+ return s
+}
+
+// Represents the autoscaling settings for a global table or global secondary
+// index.
+type AutoScalingSettingsDescription struct {
+ _ struct{} `type:"structure"`
+
+ // Disabled autoscaling for this global table or global secondary index.
+ AutoScalingDisabled *bool `type:"boolean"`
+
+ // Role ARN used for configuring autoScaling policy.
+ AutoScalingRoleArn *string `type:"string"`
+
+ // The maximum capacity units that a global table or global secondary index
+ // should be scaled up to.
+ MaximumUnits *int64 `min:"1" type:"long"`
+
+ // The minimum capacity units that a global table or global secondary index
+ // should be scaled down to.
+ MinimumUnits *int64 `min:"1" type:"long"`
+
+ // Information about the scaling policies.
+ ScalingPolicies []*AutoScalingPolicyDescription `type:"list"`
+}
+
+// String returns the string representation
+func (s AutoScalingSettingsDescription) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingSettingsDescription) GoString() string {
+ return s.String()
+}
+
+// SetAutoScalingDisabled sets the AutoScalingDisabled field's value.
+func (s *AutoScalingSettingsDescription) SetAutoScalingDisabled(v bool) *AutoScalingSettingsDescription {
+ s.AutoScalingDisabled = &v
+ return s
+}
+
+// SetAutoScalingRoleArn sets the AutoScalingRoleArn field's value.
+func (s *AutoScalingSettingsDescription) SetAutoScalingRoleArn(v string) *AutoScalingSettingsDescription {
+ s.AutoScalingRoleArn = &v
+ return s
+}
+
+// SetMaximumUnits sets the MaximumUnits field's value.
+func (s *AutoScalingSettingsDescription) SetMaximumUnits(v int64) *AutoScalingSettingsDescription {
+ s.MaximumUnits = &v
+ return s
+}
+
+// SetMinimumUnits sets the MinimumUnits field's value.
+func (s *AutoScalingSettingsDescription) SetMinimumUnits(v int64) *AutoScalingSettingsDescription {
+ s.MinimumUnits = &v
+ return s
+}
+
+// SetScalingPolicies sets the ScalingPolicies field's value.
+func (s *AutoScalingSettingsDescription) SetScalingPolicies(v []*AutoScalingPolicyDescription) *AutoScalingSettingsDescription {
+ s.ScalingPolicies = v
+ return s
+}
+
+// Represents the autoscaling settings to be modified for a global table or
+// global secondary index.
+type AutoScalingSettingsUpdate struct {
+ _ struct{} `type:"structure"`
+
+ // Disabled autoscaling for this global table or global secondary index.
+ AutoScalingDisabled *bool `type:"boolean"`
+
+ // Role ARN used for configuring autoscaling policy.
+ AutoScalingRoleArn *string `min:"1" type:"string"`
+
+ // The maximum capacity units that a global table or global secondary index
+ // should be scaled up to.
+ MaximumUnits *int64 `min:"1" type:"long"`
+
+ // The minimum capacity units that a global table or global secondary index
+ // should be scaled down to.
+ MinimumUnits *int64 `min:"1" type:"long"`
+
+ // The scaling policy to apply for scaling target global table or global secondary
+ // index capacity units.
+ ScalingPolicyUpdate *AutoScalingPolicyUpdate `type:"structure"`
+}
+
+// String returns the string representation
+func (s AutoScalingSettingsUpdate) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingSettingsUpdate) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AutoScalingSettingsUpdate) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AutoScalingSettingsUpdate"}
+ if s.AutoScalingRoleArn != nil && len(*s.AutoScalingRoleArn) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("AutoScalingRoleArn", 1))
+ }
+ if s.MaximumUnits != nil && *s.MaximumUnits < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaximumUnits", 1))
+ }
+ if s.MinimumUnits != nil && *s.MinimumUnits < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MinimumUnits", 1))
+ }
+ if s.ScalingPolicyUpdate != nil {
+ if err := s.ScalingPolicyUpdate.Validate(); err != nil {
+ invalidParams.AddNested("ScalingPolicyUpdate", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAutoScalingDisabled sets the AutoScalingDisabled field's value.
+func (s *AutoScalingSettingsUpdate) SetAutoScalingDisabled(v bool) *AutoScalingSettingsUpdate {
+ s.AutoScalingDisabled = &v
+ return s
+}
+
+// SetAutoScalingRoleArn sets the AutoScalingRoleArn field's value.
+func (s *AutoScalingSettingsUpdate) SetAutoScalingRoleArn(v string) *AutoScalingSettingsUpdate {
+ s.AutoScalingRoleArn = &v
+ return s
+}
+
+// SetMaximumUnits sets the MaximumUnits field's value.
+func (s *AutoScalingSettingsUpdate) SetMaximumUnits(v int64) *AutoScalingSettingsUpdate {
+ s.MaximumUnits = &v
+ return s
+}
+
+// SetMinimumUnits sets the MinimumUnits field's value.
+func (s *AutoScalingSettingsUpdate) SetMinimumUnits(v int64) *AutoScalingSettingsUpdate {
+ s.MinimumUnits = &v
+ return s
+}
+
+// SetScalingPolicyUpdate sets the ScalingPolicyUpdate field's value.
+func (s *AutoScalingSettingsUpdate) SetScalingPolicyUpdate(v *AutoScalingPolicyUpdate) *AutoScalingSettingsUpdate {
+ s.ScalingPolicyUpdate = v
+ return s
+}
+
+// Represents the properties of a target tracking scaling policy.
+type AutoScalingTargetTrackingScalingPolicyConfigurationDescription struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether scale in by the target tracking policy is disabled. If
+ // the value is true, scale in is disabled and the target tracking policy won't
+ // remove capacity from the scalable resource. Otherwise, scale in is enabled
+ // and the target tracking policy can remove capacity from the scalable resource.
+ // The default value is false.
+ DisableScaleIn *bool `type:"boolean"`
+
+ // The amount of time, in seconds, after a scale in activity completes before
+ // another scale in activity can start. The cooldown period is used to block
+ // subsequent scale in requests until it has expired. You should scale in conservatively
+ // to protect your application's availability. However, if another alarm triggers
+ // a scale out policy during the cooldown period after a scale-in, application
+ // autoscaling scales out your scalable target immediately.
+ ScaleInCooldown *int64 `type:"integer"`
+
+ // The amount of time, in seconds, after a scale out activity completes before
+ // another scale out activity can start. While the cooldown period is in effect,
+ // the capacity that has been added by the previous scale out event that initiated
+ // the cooldown is calculated as part of the desired capacity for the next scale
+ // out. You should continuously (but not excessively) scale out.
+ ScaleOutCooldown *int64 `type:"integer"`
+
+ // The target value for the metric. The range is 8.515920e-109 to 1.174271e+108
+ // (Base 10) or 2e-360 to 2e360 (Base 2).
+ //
+ // TargetValue is a required field
+ TargetValue *float64 `type:"double" required:"true"`
+}
+
+// String returns the string representation
+func (s AutoScalingTargetTrackingScalingPolicyConfigurationDescription) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingTargetTrackingScalingPolicyConfigurationDescription) GoString() string {
+ return s.String()
+}
+
+// SetDisableScaleIn sets the DisableScaleIn field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) SetDisableScaleIn(v bool) *AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
+ s.DisableScaleIn = &v
+ return s
+}
+
+// SetScaleInCooldown sets the ScaleInCooldown field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) SetScaleInCooldown(v int64) *AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
+ s.ScaleInCooldown = &v
+ return s
+}
+
+// SetScaleOutCooldown sets the ScaleOutCooldown field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) SetScaleOutCooldown(v int64) *AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
+ s.ScaleOutCooldown = &v
+ return s
+}
+
+// SetTargetValue sets the TargetValue field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationDescription) SetTargetValue(v float64) *AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
+ s.TargetValue = &v
+ return s
+}
+
+// Represents the settings of a target tracking scaling policy that will be
+// modified.
+type AutoScalingTargetTrackingScalingPolicyConfigurationUpdate struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether scale in by the target tracking policy is disabled. If
+ // the value is true, scale in is disabled and the target tracking policy won't
+ // remove capacity from the scalable resource. Otherwise, scale in is enabled
+ // and the target tracking policy can remove capacity from the scalable resource.
+ // The default value is false.
+ DisableScaleIn *bool `type:"boolean"`
+
+ // The amount of time, in seconds, after a scale in activity completes before
+ // another scale in activity can start. The cooldown period is used to block
+ // subsequent scale in requests until it has expired. You should scale in conservatively
+ // to protect your application's availability. However, if another alarm triggers
+ // a scale out policy during the cooldown period after a scale-in, application
+ // autoscaling scales out your scalable target immediately.
+ ScaleInCooldown *int64 `type:"integer"`
+
+ // The amount of time, in seconds, after a scale out activity completes before
+ // another scale out activity can start. While the cooldown period is in effect,
+ // the capacity that has been added by the previous scale out event that initiated
+ // the cooldown is calculated as part of the desired capacity for the next scale
+ // out. You should continuously (but not excessively) scale out.
+ ScaleOutCooldown *int64 `type:"integer"`
+
+ // The target value for the metric. The range is 8.515920e-109 to 1.174271e+108
+ // (Base 10) or 2e-360 to 2e360 (Base 2).
+ //
+ // TargetValue is a required field
+ TargetValue *float64 `type:"double" required:"true"`
+}
+
+// String returns the string representation
+func (s AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AutoScalingTargetTrackingScalingPolicyConfigurationUpdate"}
+ if s.TargetValue == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetValue"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDisableScaleIn sets the DisableScaleIn field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) SetDisableScaleIn(v bool) *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
+ s.DisableScaleIn = &v
+ return s
+}
+
+// SetScaleInCooldown sets the ScaleInCooldown field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) SetScaleInCooldown(v int64) *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
+ s.ScaleInCooldown = &v
+ return s
+}
+
+// SetScaleOutCooldown sets the ScaleOutCooldown field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) SetScaleOutCooldown(v int64) *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
+ s.ScaleOutCooldown = &v
+ return s
+}
+
+// SetTargetValue sets the TargetValue field's value.
+func (s *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate) SetTargetValue(v float64) *AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
+ s.TargetValue = &v
+ return s
+}
+
// Contains the description of the backup created for the table.
type BackupDescription struct {
_ struct{} `type:"structure"`
@@ -4254,7 +6013,11 @@ type BackupDetails struct {
// Time at which the backup was created. This is the request time of the backup.
//
// BackupCreationDateTime is a required field
- BackupCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
+ BackupCreationDateTime *time.Time `type:"timestamp" required:"true"`
+
+ // Time at which the automatic on-demand backup created by DynamoDB will expire.
+ // This SYSTEM on-demand backup expires automatically 35 days after its creation.
+ BackupExpiryDateTime *time.Time `type:"timestamp"`
// Name of the requested backup.
//
@@ -4268,6 +6031,20 @@ type BackupDetails struct {
//
// BackupStatus is a required field
BackupStatus *string `type:"string" required:"true" enum:"BackupStatus"`
+
+ // BackupType:
+ //
+ // * USER - You create and manage these using the on-demand backup feature.
+ //
+ // * SYSTEM - If you delete a table with point-in-time recovery enabled,
+ // a SYSTEM backup is automatically created and is retained for 35 days (at
+ // no additional cost). System backups allow you to restore the deleted table
+ // to the state it was in just before the point of deletion.
+ //
+ // * AWS_BACKUP - On-demand backup created by you from AWS Backup service.
+ //
+ // BackupType is a required field
+ BackupType *string `type:"string" required:"true" enum:"BackupType"`
}
// String returns the string representation
@@ -4292,6 +6069,12 @@ func (s *BackupDetails) SetBackupCreationDateTime(v time.Time) *BackupDetails {
return s
}
+// SetBackupExpiryDateTime sets the BackupExpiryDateTime field's value.
+func (s *BackupDetails) SetBackupExpiryDateTime(v time.Time) *BackupDetails {
+ s.BackupExpiryDateTime = &v
+ return s
+}
+
// SetBackupName sets the BackupName field's value.
func (s *BackupDetails) SetBackupName(v string) *BackupDetails {
s.BackupName = &v
@@ -4310,6 +6093,12 @@ func (s *BackupDetails) SetBackupStatus(v string) *BackupDetails {
return s
}
+// SetBackupType sets the BackupType field's value.
+func (s *BackupDetails) SetBackupType(v string) *BackupDetails {
+ s.BackupType = &v
+ return s
+}
+
// Contains details for the backup.
type BackupSummary struct {
_ struct{} `type:"structure"`
@@ -4318,7 +6107,11 @@ type BackupSummary struct {
BackupArn *string `min:"37" type:"string"`
// Time at which the backup was created.
- BackupCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ BackupCreationDateTime *time.Time `type:"timestamp"`
+
+ // Time at which the automatic on-demand backup created by DynamoDB will expire.
+ // This SYSTEM on-demand backup expires automatically 35 days after its creation.
+ BackupExpiryDateTime *time.Time `type:"timestamp"`
// Name of the specified backup.
BackupName *string `min:"3" type:"string"`
@@ -4329,6 +6122,18 @@ type BackupSummary struct {
// Backup can be in one of the following states: CREATING, ACTIVE, DELETED.
BackupStatus *string `type:"string" enum:"BackupStatus"`
+ // BackupType:
+ //
+ // * USER - You create and manage these using the on-demand backup feature.
+ //
+ // * SYSTEM - If you delete a table with point-in-time recovery enabled,
+ // a SYSTEM backup is automatically created and is retained for 35 days (at
+ // no additional cost). System backups allow you to restore the deleted table
+ // to the state it was in just before the point of deletion.
+ //
+ // * AWS_BACKUP - On-demand backup created by you from AWS Backup service.
+ BackupType *string `type:"string" enum:"BackupType"`
+
// ARN associated with the table.
TableArn *string `type:"string"`
@@ -4361,6 +6166,12 @@ func (s *BackupSummary) SetBackupCreationDateTime(v time.Time) *BackupSummary {
return s
}
+// SetBackupExpiryDateTime sets the BackupExpiryDateTime field's value.
+func (s *BackupSummary) SetBackupExpiryDateTime(v time.Time) *BackupSummary {
+ s.BackupExpiryDateTime = &v
+ return s
+}
+
// SetBackupName sets the BackupName field's value.
func (s *BackupSummary) SetBackupName(v string) *BackupSummary {
s.BackupName = &v
@@ -4379,6 +6190,12 @@ func (s *BackupSummary) SetBackupStatus(v string) *BackupSummary {
return s
}
+// SetBackupType sets the BackupType field's value.
+func (s *BackupSummary) SetBackupType(v string) *BackupSummary {
+ s.BackupType = &v
+ return s
+}
+
// SetTableArn sets the TableArn field's value.
func (s *BackupSummary) SetTableArn(v string) *BackupSummary {
s.TableArn = &v
@@ -4412,38 +6229,22 @@ type BatchGetItemInput struct {
//
// * ExpressionAttributeNames - One or more substitution tokens for attribute
// names in the ProjectionExpression parameter. The following are some use
- // cases for using ExpressionAttributeNames:
- //
- // To access an attribute whose name conflicts with a DynamoDB reserved word.
- //
- // To create a placeholder for repeating occurrences of an attribute name in
- // an expression.
- //
- // To prevent special characters in an attribute name from being misinterpreted
- // in an expression.
- //
- // Use the # character in an expression to dereference an attribute name. For
- // example, consider the following attribute name:
- //
- // Percentile
- //
- // The name of this attribute conflicts with a reserved word, so it cannot be
+ // cases for using ExpressionAttributeNames: To access an attribute whose
+ // name conflicts with a DynamoDB reserved word. To create a placeholder
+ // for repeating occurrences of an attribute name in an expression. To prevent
+ // special characters in an attribute name from being misinterpreted in an
+ // expression. Use the # character in an expression to dereference an attribute
+ // name. For example, consider the following attribute name: Percentile The
+ // name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could
- // specify the following for ExpressionAttributeNames:
- //
- // {"#P":"Percentile"}
- //
- // You could then use this substitution in an expression, as in this example:
- //
- // #P = :val
- //
- // Tokens that begin with the : character are expression attribute values, which
- // are placeholders for the actual value at runtime.
- //
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // specify the following for ExpressionAttributeNames: {"#P":"Percentile"}
+ // You could then use this substitution in an expression, as in this example:
+ // #P = :val Tokens that begin with the : character are expression attribute
+ // values, which are placeholders for the actual value at runtime. For more
+ // information about expression attribute names, see Accessing Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
//
// * Keys - An array of primary key attribute values that define specific
@@ -4455,17 +6256,14 @@ type BatchGetItemInput struct {
// * ProjectionExpression - A string that identifies one or more attributes
// to retrieve from the table. These attributes can include scalars, sets,
// or elements of a JSON document. The attributes in the expression must
- // be separated by commas.
- //
- // If no attribute names are specified, then all attributes will be returned.
- // If any of the requested attributes are not found, they will not appear
- // in the result.
- //
- // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // be separated by commas. If no attribute names are specified, then all
+ // attributes are returned. If any of the requested attributes are not found,
+ // they do not appear in the result. For more information, see Accessing
+ // Item Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
//
// * AttributesToGet - This is a legacy parameter. Use ProjectionExpression
- // instead. For more information, see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
+ // instead. For more information, see AttributesToGet (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
// in the Amazon DynamoDB Developer Guide.
//
// RequestItems is a required field
@@ -4476,11 +6274,9 @@ type BatchGetItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -4615,27 +6411,23 @@ type BatchWriteItemInput struct {
// of the following:
//
// * DeleteRequest - Perform a DeleteItem operation on the specified item.
- // The item to be deleted is identified by a Key subelement:
- //
- // Key - A map of primary key attribute values that uniquely identify the item.
- // Each entry in this map consists of an attribute name and an attribute
- // value. For each primary key, you must provide all of the key attributes.
- // For example, with a simple primary key, you only need to provide a value
- // for the partition key. For a composite primary key, you must provide values
+ // The item to be deleted is identified by a Key subelement: Key - A map
+ // of primary key attribute values that uniquely identify the item. Each
+ // entry in this map consists of an attribute name and an attribute value.
+ // For each primary key, you must provide all of the key attributes. For
+ // example, with a simple primary key, you only need to provide a value for
+ // the partition key. For a composite primary key, you must provide values
// for both the partition key and the sort key.
//
// * PutRequest - Perform a PutItem operation on the specified item. The
- // item to be put is identified by an Item subelement:
- //
- // Item - A map of attributes and their values. Each entry in this map consists
- // of an attribute name and an attribute value. Attribute values must not
- // be null; string and binary type attributes must have lengths greater than
- // zero; and set type attributes must not be empty. Requests that contain
- // empty values will be rejected with a ValidationException exception.
- //
- // If you specify any attributes that are part of an index key, then the data
- // types for those attributes must match those of the schema in the table's
- // attribute definition.
+ // item to be put is identified by an Item subelement: Item - A map of attributes
+ // and their values. Each entry in this map consists of an attribute name
+ // and an attribute value. Attribute values must not be null; string and
+ // binary type attributes must have lengths greater than zero; and set type
+ // attributes must not be empty. Requests that contain empty values are rejected
+ // with a ValidationException exception. If you specify any attributes that
+ // are part of an index key, then the data types for those attributes must
+ // match those of the schema in the table's attribute definition.
//
// RequestItems is a required field
RequestItems map[string][]*WriteRequest `min:"1" type:"map" required:"true"`
@@ -4645,11 +6437,9 @@ type BatchWriteItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -4735,10 +6525,9 @@ type BatchWriteItemOutput struct {
// bound for the estimate. The estimate includes the size of all the items
// in the table, plus the size of all attributes projected into all of the
// local secondary indexes on the table. Use this estimate to measure whether
- // a local secondary index is approaching its size limit.
- //
- // The estimate is subject to change over time; therefore, do not rely on the
- // precision or accuracy of the estimate.
+ // a local secondary index is approaching its size limit. The estimate is
+ // subject to change over time; therefore, do not rely on the precision or
+ // accuracy of the estimate.
ItemCollectionMetrics map[string][]*ItemCollectionMetrics `type:"map"`
// A map of tables and requests against those tables that were not processed.
@@ -4750,24 +6539,19 @@ type BatchWriteItemOutput struct {
// a list of operations to perform (DeleteRequest or PutRequest).
//
// * DeleteRequest - Perform a DeleteItem operation on the specified item.
- // The item to be deleted is identified by a Key subelement:
- //
- // Key - A map of primary key attribute values that uniquely identify the item.
- // Each entry in this map consists of an attribute name and an attribute
- // value.
+ // The item to be deleted is identified by a Key subelement: Key - A map
+ // of primary key attribute values that uniquely identify the item. Each
+ // entry in this map consists of an attribute name and an attribute value.
//
// * PutRequest - Perform a PutItem operation on the specified item. The
- // item to be put is identified by an Item subelement:
- //
- // Item - A map of attributes and their values. Each entry in this map consists
- // of an attribute name and an attribute value. Attribute values must not
- // be null; string and binary type attributes must have lengths greater than
- // zero; and set type attributes must not be empty. Requests that contain
- // empty values will be rejected with a ValidationException exception.
- //
- // If you specify any attributes that are part of an index key, then the data
- // types for those attributes must match those of the schema in the table's
- // attribute definition.
+ // item to be put is identified by an Item subelement: Item - A map of attributes
+ // and their values. Each entry in this map consists of an attribute name
+ // and an attribute value. Attribute values must not be null; string and
+ // binary type attributes must have lengths greater than zero; and set type
+ // attributes must not be empty. Requests that contain empty values will
+ // be rejected with a ValidationException exception. If you specify any attributes
+ // that are part of an index key, then the data types for those attributes
+ // must match those of the schema in the table's attribute definition.
//
// If there are no unprocessed items remaining, the response contains an empty
// UnprocessedItems map.
@@ -4802,6 +6586,92 @@ func (s *BatchWriteItemOutput) SetUnprocessedItems(v map[string][]*WriteRequest)
return s
}
+// Contains the details for the read/write capacity mode.
+type BillingModeSummary struct {
+ _ struct{} `type:"structure"`
+
+ // Controls how you are charged for read and write throughput and how you manage
+ // capacity. This setting can be changed later.
+ //
+ // * PROVISIONED - Sets the read/write capacity mode to PROVISIONED. We recommend
+ // using PROVISIONED for predictable workloads.
+ //
+ // * PAY_PER_REQUEST - Sets the read/write capacity mode to PAY_PER_REQUEST.
+ // We recommend using PAY_PER_REQUEST for unpredictable workloads.
+ BillingMode *string `type:"string" enum:"BillingMode"`
+
+ // Represents the time when PAY_PER_REQUEST was last set as the read/write capacity
+ // mode.
+ LastUpdateToPayPerRequestDateTime *time.Time `type:"timestamp"`
+}
+
+// String returns the string representation
+func (s BillingModeSummary) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s BillingModeSummary) GoString() string {
+ return s.String()
+}
+
+// SetBillingMode sets the BillingMode field's value.
+func (s *BillingModeSummary) SetBillingMode(v string) *BillingModeSummary {
+ s.BillingMode = &v
+ return s
+}
+
+// SetLastUpdateToPayPerRequestDateTime sets the LastUpdateToPayPerRequestDateTime field's value.
+func (s *BillingModeSummary) SetLastUpdateToPayPerRequestDateTime(v time.Time) *BillingModeSummary {
+ s.LastUpdateToPayPerRequestDateTime = &v
+ return s
+}
+
+// An ordered list of errors for each item in the request which caused the transaction
+// to get cancelled. The values of the list are ordered according to the ordering
+// of the TransactWriteItems request parameter. If no error occurred for the
+// associated item an error with a Null code and Null message will be present.
+type CancellationReason struct {
+ _ struct{} `type:"structure"`
+
+ // Status code for the result of the cancelled transaction.
+ Code *string `type:"string"`
+
+ // Item in the request which caused the transaction to get cancelled.
+ Item map[string]*AttributeValue `type:"map"`
+
+ // Cancellation reason message description.
+ Message *string `type:"string"`
+}
+
+// String returns the string representation
+func (s CancellationReason) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CancellationReason) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *CancellationReason) SetCode(v string) *CancellationReason {
+ s.Code = &v
+ return s
+}
+
+// SetItem sets the Item field's value.
+func (s *CancellationReason) SetItem(v map[string]*AttributeValue) *CancellationReason {
+ s.Item = v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *CancellationReason) SetMessage(v string) *CancellationReason {
+ s.Message = &v
+ return s
+}
+
// Represents the amount of provisioned throughput capacity consumed on a table
// or an index.
type Capacity struct {
@@ -4809,6 +6679,12 @@ type Capacity struct {
// The total number of capacity units consumed on a table or an index.
CapacityUnits *float64 `type:"double"`
+
+ // The total number of read capacity units consumed on a table or an index.
+ ReadCapacityUnits *float64 `type:"double"`
+
+ // The total number of write capacity units consumed on a table or an index.
+ WriteCapacityUnits *float64 `type:"double"`
}
// String returns the string representation
@@ -4827,16 +6703,25 @@ func (s *Capacity) SetCapacityUnits(v float64) *Capacity {
return s
}
+// SetReadCapacityUnits sets the ReadCapacityUnits field's value.
+func (s *Capacity) SetReadCapacityUnits(v float64) *Capacity {
+ s.ReadCapacityUnits = &v
+ return s
+}
+
+// SetWriteCapacityUnits sets the WriteCapacityUnits field's value.
+func (s *Capacity) SetWriteCapacityUnits(v float64) *Capacity {
+ s.WriteCapacityUnits = &v
+ return s
+}
+
// Represents the selection criteria for a Query or Scan operation:
//
// * For a Query operation, Condition is used for specifying the KeyConditions
// to use when querying a table or an index. For KeyConditions, only the
-// following comparison operators are supported:
-//
-// EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN
-//
-// Condition is also used in a QueryFilter, which evaluates the query results
-// and returns only the desired values.
+// following comparison operators are supported: EQ | LE | LT | GE | GT |
+// BEGINS_WITH | BETWEEN Condition is also used in a QueryFilter, which evaluates
+// the query results and returns only the desired values.
//
// * For a Scan operation, Condition is used in a ScanFilter, which evaluates
// the scan results and returns only the desired values.
@@ -4868,36 +6753,109 @@ type Condition struct {
// The following are descriptions of each comparison operator.
//
// * EQ : Equal. EQ is supported for all data types, including lists and
- // maps.
+ // maps. AttributeValueList can contain only one AttributeValue element of
+ // type String, Number, Binary, String Set, Number Set, or Binary Set. If
+ // an item contains an AttributeValue element of a different type than the
+ // one provided in the request, the value does not match. For example, {"S":"6"}
+ // does not equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2",
+ // "1"]}.
//
- // AttributeValueList can contain only one AttributeValue element of type String,
- // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
- // an AttributeValue element of a different type than the one provided in
+ // * NE : Not equal. NE is supported for all data types, including lists
+ // and maps. AttributeValueList can contain only one AttributeValue of type
+ // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
+ // contains an AttributeValue of a different type than the one provided in
// the request, the value does not match. For example, {"S":"6"} does not
// equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
//
- // * NE : Not equal. NE is supported for all data types, including lists
- // and maps.
+ // * LE : Less than or equal. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If an item
+ // contains an AttributeValue element of a different type than the one provided
+ // in the request, the value does not match. For example, {"S":"6"} does
+ // not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // * AttributeValueList can contain only one AttributeValue of type String,
- // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
- // an AttributeValue of a different type than the one provided in the request,
- // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
- // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
+ // * LT : Less than. AttributeValueList can contain only one AttributeValue
+ // of type String, Number, or Binary (not a set type). If an item contains
+ // an AttributeValue element of a different type than the one provided in
+ // the request, the value does not match. For example, {"S":"6"} does not
+ // equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // * LE : Less than or equal.
+ // * GE : Greater than or equal. AttributeValueList can contain only one
+ // AttributeValue element of type String, Number, or Binary (not a set type).
+ // If an item contains an AttributeValue element of a different type than
+ // the one provided in the request, the value does not match. For example,
+ // {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to
+ // {"NS":["6", "2", "1"]}.
//
- // AttributeValueList can contain only one AttributeValue element of type String,
- // Number, or Binary (not a set type). If an item contains an AttributeValue
- // element of a different type than the one provided in the request, the value
- // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
- // does not compare to {"NS":["6", "2", "1"]}.
+ // * GT : Greater than. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If an item
+ // contains an AttributeValue element of a different type than the one provided
+ // in the request, the value does not match. For example, {"S":"6"} does
+ // not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // LT: Less than.
+ // * NOT_NULL : The attribute exists. NOT_NULL is supported for all data
+ // types, including lists and maps. This operator tests for the existence
+ // of an attribute, not its data type. If the data type of attribute "a"
+ // is null, and you evaluate it using NOT_NULL, the result is a Boolean true.
+ // This result is because the attribute "a" exists; its data type is not
+ // relevant to the NOT_NULL comparison operator.
//
- // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an
- // AttributeValueelement of a different type than the one provided in the request, the value
- // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]}
+ // * NULL : The attribute does not exist. NULL is supported for all data
+ // types, including lists and maps. This operator tests for the nonexistence
+ // of an attribute, not its data type. If the data type of attribute "a"
+ // is null, and you evaluate it using NULL, the result is a Boolean false.
+ // This is because the attribute "a" exists; its data type is not relevant
+ // to the NULL comparison operator.
+ //
+ // * CONTAINS : Checks for a subsequence, or value in a set. AttributeValueList
+ // can contain only one AttributeValue element of type String, Number, or
+ // Binary (not a set type). If the target attribute of the comparison is
+ // of type String, then the operator checks for a substring match. If the
+ // target attribute of the comparison is of type Binary, then the operator
+ // looks for a subsequence of the target that matches the input. If the target
+ // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
+ // evaluates to true if it finds an exact match with any member of the set.
+ // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
+ // be a list; however, "b" cannot be a set, a map, or a list.
+ //
+ // * NOT_CONTAINS : Checks for absence of a subsequence, or absence of a
+ // value in a set. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If the target
+ // attribute of the comparison is a String, then the operator checks for
+ // the absence of a substring match. If the target attribute of the comparison
+ // is Binary, then the operator checks for the absence of a subsequence of
+ // the target that matches the input. If the target attribute of the comparison
+ // is a set ("SS", "NS", or "BS"), then the operator evaluates to true if
+ // it does not find an exact match with any member of the set. NOT_CONTAINS
+ // is supported for lists: When evaluating "a NOT CONTAINS b", "a" can be
+ // a list; however, "b" cannot be a set, a map, or a list.
+ //
+ // * BEGINS_WITH : Checks for a prefix. AttributeValueList can contain only
+ // one AttributeValue of type String or Binary (not a Number or a set type).
+ // The target attribute of the comparison must be of type String or Binary
+ // (not a Number or a set type).
+ //
+ // * IN : Checks for matching elements in a list. AttributeValueList can
+ // contain one or more AttributeValue elements of type String, Number, or
+ // Binary. These attributes are compared against an existing attribute of
+ // an item. If any elements of the input are equal to the item attribute,
+ // the expression evaluates to true.
+ //
+ // * BETWEEN : Greater than or equal to the first value, and less than or
+ // equal to the second value. AttributeValueList must contain two AttributeValue
+ // elements of the same type, either String, Number, or Binary (not a set
+ // type). A target attribute matches if the target value is greater than,
+ // or equal to, the first element and less than, or equal to, the second
+ // element. If an item contains an AttributeValue element of a different
+ // type than the one provided in the request, the value does not match. For
+ // example, {"S":"6"} does not compare to {"N":"6"}. Also, {"N":"6"} does
+ // not compare to {"NS":["6", "2", "1"]}
+ //
+ // For usage examples of AttributeValueList and ComparisonOperator, see Legacy
+ // Conditional Parameters (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
+ // in the Amazon DynamoDB Developer Guide.
//
// ComparisonOperator is a required field
ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"`
@@ -4938,11 +6896,112 @@ func (s *Condition) SetComparisonOperator(v string) *Condition {
return s
}
+// Represents a request to perform a check that an item exists or to check the
+// condition of specific attributes of the item..
+type ConditionCheck struct {
+ _ struct{} `type:"structure"`
+
+ // A condition that must be satisfied in order for a conditional update to succeed.
+ //
+ // ConditionExpression is a required field
+ ConditionExpression *string `type:"string" required:"true"`
+
+ // One or more substitution tokens for attribute names in an expression.
+ ExpressionAttributeNames map[string]*string `type:"map"`
+
+ // One or more values that can be substituted in an expression.
+ ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
+
+ // The primary key of the item to be checked. Each element consists of an attribute
+ // name and a value for that attribute.
+ //
+ // Key is a required field
+ Key map[string]*AttributeValue `type:"map" required:"true"`
+
+ // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the
+ // ConditionCheck condition fails. For ReturnValuesOnConditionCheckFailure,
+ // the valid values are: NONE and ALL_OLD.
+ ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"`
+
+ // Name of the table for the check item request.
+ //
+ // TableName is a required field
+ TableName *string `min:"3" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ConditionCheck) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ConditionCheck) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ConditionCheck) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ConditionCheck"}
+ if s.ConditionExpression == nil {
+ invalidParams.Add(request.NewErrParamRequired("ConditionExpression"))
+ }
+ if s.Key == nil {
+ invalidParams.Add(request.NewErrParamRequired("Key"))
+ }
+ if s.TableName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TableName"))
+ }
+ if s.TableName != nil && len(*s.TableName) < 3 {
+ invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetConditionExpression sets the ConditionExpression field's value.
+func (s *ConditionCheck) SetConditionExpression(v string) *ConditionCheck {
+ s.ConditionExpression = &v
+ return s
+}
+
+// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value.
+func (s *ConditionCheck) SetExpressionAttributeNames(v map[string]*string) *ConditionCheck {
+ s.ExpressionAttributeNames = v
+ return s
+}
+
+// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value.
+func (s *ConditionCheck) SetExpressionAttributeValues(v map[string]*AttributeValue) *ConditionCheck {
+ s.ExpressionAttributeValues = v
+ return s
+}
+
+// SetKey sets the Key field's value.
+func (s *ConditionCheck) SetKey(v map[string]*AttributeValue) *ConditionCheck {
+ s.Key = v
+ return s
+}
+
+// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value.
+func (s *ConditionCheck) SetReturnValuesOnConditionCheckFailure(v string) *ConditionCheck {
+ s.ReturnValuesOnConditionCheckFailure = &v
+ return s
+}
+
+// SetTableName sets the TableName field's value.
+func (s *ConditionCheck) SetTableName(v string) *ConditionCheck {
+ s.TableName = &v
+ return s
+}
+
// The capacity units consumed by an operation. The data returned includes the
// total provisioned throughput consumed, along with statistics for the table
// and any indexes involved in the operation. ConsumedCapacity is only returned
// if the request asked for it. For more information, see Provisioned Throughput
-// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+// (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
type ConsumedCapacity struct {
_ struct{} `type:"structure"`
@@ -4956,11 +7015,17 @@ type ConsumedCapacity struct {
// The amount of throughput consumed on each local index affected by the operation.
LocalSecondaryIndexes map[string]*Capacity `type:"map"`
+ // The total number of read capacity units consumed by the operation.
+ ReadCapacityUnits *float64 `type:"double"`
+
// The amount of throughput consumed on the table affected by the operation.
Table *Capacity `type:"structure"`
// The name of the table that was affected by the operation.
TableName *string `min:"3" type:"string"`
+
+ // The total number of write capacity units consumed by the operation.
+ WriteCapacityUnits *float64 `type:"double"`
}
// String returns the string representation
@@ -4991,6 +7056,12 @@ func (s *ConsumedCapacity) SetLocalSecondaryIndexes(v map[string]*Capacity) *Con
return s
}
+// SetReadCapacityUnits sets the ReadCapacityUnits field's value.
+func (s *ConsumedCapacity) SetReadCapacityUnits(v float64) *ConsumedCapacity {
+ s.ReadCapacityUnits = &v
+ return s
+}
+
// SetTable sets the Table field's value.
func (s *ConsumedCapacity) SetTable(v *Capacity) *ConsumedCapacity {
s.Table = v
@@ -5003,12 +7074,18 @@ func (s *ConsumedCapacity) SetTableName(v string) *ConsumedCapacity {
return s
}
+// SetWriteCapacityUnits sets the WriteCapacityUnits field's value.
+func (s *ConsumedCapacity) SetWriteCapacityUnits(v float64) *ConsumedCapacity {
+ s.WriteCapacityUnits = &v
+ return s
+}
+
// Represents the continuous backups and point in time recovery settings on
// the table.
type ContinuousBackupsDescription struct {
_ struct{} `type:"structure"`
- // ContinuousBackupsStatus can be one of the following states : ENABLED, DISABLED
+ // ContinuousBackupsStatus can be one of the following states: ENABLED, DISABLED
//
// ContinuousBackupsStatus is a required field
ContinuousBackupsStatus *string `type:"string" required:"true" enum:"ContinuousBackupsStatus"`
@@ -5145,11 +7222,9 @@ type CreateGlobalSecondaryIndexAction struct {
// index.
//
// For current minimum and maximum provisioned throughput values, see Limits
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
- //
- // ProvisionedThroughput is a required field
- ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
+ ProvisionedThroughput *ProvisionedThroughput `type:"structure"`
}
// String returns the string representation
@@ -5180,9 +7255,6 @@ func (s *CreateGlobalSecondaryIndexAction) Validate() error {
if s.Projection == nil {
invalidParams.Add(request.NewErrParamRequired("Projection"))
}
- if s.ProvisionedThroughput == nil {
- invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
- }
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
@@ -5242,7 +7314,7 @@ type CreateGlobalTableInput struct {
// GlobalTableName is a required field
GlobalTableName *string `min:"3" type:"string" required:"true"`
- // The regions where the global table needs to be created.
+ // The Regions where the global table needs to be created.
//
// ReplicationGroup is a required field
ReplicationGroup []*Replica `type:"list" required:"true"`
@@ -5360,8 +7432,18 @@ type CreateTableInput struct {
// AttributeDefinitions is a required field
AttributeDefinitions []*AttributeDefinition `type:"list" required:"true"`
- // One or more global secondary indexes (the maximum is five) to be created
- // on the table. Each global secondary index in the array includes the following:
+ // Controls how you are charged for read and write throughput and how you manage
+ // capacity. This setting can be changed later.
+ //
+ // * PROVISIONED - Sets the billing mode to PROVISIONED. We recommend using
+ // PROVISIONED for predictable workloads.
+ //
+ // * PAY_PER_REQUEST - Sets the billing mode to PAY_PER_REQUEST. We recommend
+ // using PAY_PER_REQUEST for unpredictable workloads.
+ BillingMode *string `type:"string" enum:"BillingMode"`
+
+ // One or more global secondary indexes (the maximum is 20) to be created on
+ // the table. Each global secondary index in the array includes the following:
//
// * IndexName - The name of the global secondary index. Must be unique only
// for this table.
@@ -5371,22 +7453,16 @@ type CreateTableInput struct {
// * Projection - Specifies attributes that are copied (projected) from the
// table into the index. These are in addition to the primary key attributes
// and index key attributes, which are automatically projected. Each attribute
- // specification is composed of:
- //
- // * ProjectionType - One of the following:
- //
- // KEYS_ONLY - Only the index and primary keys are projected into the index.
- //
- // INCLUDE - Only the specified table attributes are projected into the index.
- // The list of projected attributes are in NonKeyAttributes.
- //
- // ALL - All of the table attributes are projected into the index.
- //
- // NonKeyAttributes - A list of one or more non-key attribute names that are
- // projected into the secondary index. The total count of attributes provided
- // in NonKeyAttributes, summed across all of the secondary indexes, must
- // not exceed 20. If you project the same attribute into two different indexes,
- // this counts as two distinct attributes when determining the total.
+ // specification is composed of: ProjectionType - One of the following: KEYS_ONLY
+ // - Only the index and primary keys are projected into the index. INCLUDE
+ // - Only the specified table attributes are projected into the index. The
+ // list of projected attributes is in NonKeyAttributes. ALL - All of the
+ // table attributes are projected into the index. NonKeyAttributes - A list
+ // of one or more non-key attribute names that are projected into the secondary
+ // index. The total count of attributes provided in NonKeyAttributes, summed
+ // across all of the secondary indexes, must not exceed 100. If you project
+ // the same attribute into two different indexes, this counts as two distinct
+ // attributes when determining the total.
//
// * ProvisionedThroughput - The provisioned throughput settings for the
// global secondary index, consisting of read and write capacity units.
@@ -5394,21 +7470,18 @@ type CreateTableInput struct {
// Specifies the attributes that make up the primary key for a table or an index.
// The attributes in KeySchema must also be defined in the AttributeDefinitions
- // array. For more information, see Data Model (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html)
+ // array. For more information, see Data Model (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html)
// in the Amazon DynamoDB Developer Guide.
//
// Each KeySchemaElement in the array is composed of:
//
// * AttributeName - The name of this key attribute.
//
- // * KeyType - The role that the key attribute will assume:
- //
- // HASH - partition key
- //
- // RANGE - sort key
+ // * KeyType - The role that the key attribute will assume: HASH - partition
+ // key RANGE - sort key
//
// The partition key of an item is also known as its hash attribute. The term
- // "hash attribute" derives from DynamoDB' usage of an internal hash function
+ // "hash attribute" derives from the DynamoDB usage of an internal hash function
// to evenly distribute data items across partitions, based on their partition
// key values.
//
@@ -5423,16 +7496,16 @@ type CreateTableInput struct {
// exactly two elements, in this order: The first element must have a KeyType
// of HASH, and the second element must have a KeyType of RANGE.
//
- // For more information, see Specifying the Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key)
+ // For more information, see Working with Tables (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key)
// in the Amazon DynamoDB Developer Guide.
//
// KeySchema is a required field
KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"`
- // One or more local secondary indexes (the maximum is five) to be created on
- // the table. Each index is scoped to a given partition key value. There is
- // a 10 GB size limit per partition key value; otherwise, the size of a local
- // secondary index is unconstrained.
+ // One or more local secondary indexes (the maximum is 5) to be created on the
+ // table. Each index is scoped to a given partition key value. There is a 10
+ // GB size limit per partition key value; otherwise, the size of a local secondary
+ // index is unconstrained.
//
// Each local secondary index in the array includes the following:
//
@@ -5445,63 +7518,55 @@ type CreateTableInput struct {
// * Projection - Specifies attributes that are copied (projected) from the
// table into the index. These are in addition to the primary key attributes
// and index key attributes, which are automatically projected. Each attribute
- // specification is composed of:
- //
- // * ProjectionType - One of the following:
- //
- // KEYS_ONLY - Only the index and primary keys are projected into the index.
- //
- // INCLUDE - Only the specified table attributes are projected into the index.
- // The list of projected attributes are in NonKeyAttributes.
- //
- // ALL - All of the table attributes are projected into the index.
- //
- // NonKeyAttributes - A list of one or more non-key attribute names that are
- // projected into the secondary index. The total count of attributes provided
- // in NonKeyAttributes, summed across all of the secondary indexes, must
- // not exceed 20. If you project the same attribute into two different indexes,
- // this counts as two distinct attributes when determining the total.
+ // specification is composed of: ProjectionType - One of the following: KEYS_ONLY
+ // - Only the index and primary keys are projected into the index. INCLUDE
+ // - Only the specified table attributes are projected into the index. The
+ // list of projected attributes is in NonKeyAttributes. ALL - All of the
+ // table attributes are projected into the index. NonKeyAttributes - A list
+ // of one or more non-key attribute names that are projected into the secondary
+ // index. The total count of attributes provided in NonKeyAttributes, summed
+ // across all of the secondary indexes, must not exceed 100. If you project
+ // the same attribute into two different indexes, this counts as two distinct
+ // attributes when determining the total.
LocalSecondaryIndexes []*LocalSecondaryIndex `type:"list"`
// Represents the provisioned throughput settings for a specified table or index.
// The settings can be modified using the UpdateTable operation.
//
- // For current minimum and maximum provisioned throughput values, see Limits
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
- // in the Amazon DynamoDB Developer Guide.
+ // If you set BillingMode as PROVISIONED, you must specify this property. If
+ // you set BillingMode as PAY_PER_REQUEST, you cannot specify this property.
//
- // ProvisionedThroughput is a required field
- ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
+ // For current minimum and maximum provisioned throughput values, see Limits
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // in the Amazon DynamoDB Developer Guide.
+ ProvisionedThroughput *ProvisionedThroughput `type:"structure"`
// Represents the settings used to enable server-side encryption.
SSESpecification *SSESpecification `type:"structure"`
// The settings for DynamoDB Streams on the table. These settings consist of:
//
- // * StreamEnabled - Indicates whether Streams is to be enabled (true) or
- // disabled (false).
+ // * StreamEnabled - Indicates whether DynamoDB Streams is to be enabled
+ // (true) or disabled (false).
//
// * StreamViewType - When an item in the table is modified, StreamViewType
// determines what information is written to the table's stream. Valid values
- // for StreamViewType are:
- //
- // KEYS_ONLY - Only the key attributes of the modified item are written to the
- // stream.
- //
- // NEW_IMAGE - The entire item, as it appears after it was modified, is written
- // to the stream.
- //
- // OLD_IMAGE - The entire item, as it appeared before it was modified, is written
- // to the stream.
- //
- // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item are
- // written to the stream.
+ // for StreamViewType are: KEYS_ONLY - Only the key attributes of the modified
+ // item are written to the stream. NEW_IMAGE - The entire item, as it appears
+ // after it was modified, is written to the stream. OLD_IMAGE - The entire
+ // item, as it appeared before it was modified, is written to the stream.
+ // NEW_AND_OLD_IMAGES - Both the new and the old item images of the item
+ // are written to the stream.
StreamSpecification *StreamSpecification `type:"structure"`
// The name of the table to create.
//
// TableName is a required field
TableName *string `min:"3" type:"string" required:"true"`
+
+ // A list of key-value pairs to label the table. For more information, see Tagging
+ // for DynamoDB (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html).
+ Tags []*Tag `type:"list"`
}
// String returns the string representation
@@ -5526,9 +7591,6 @@ func (s *CreateTableInput) Validate() error {
if s.KeySchema != nil && len(s.KeySchema) < 1 {
invalidParams.Add(request.NewErrParamMinLen("KeySchema", 1))
}
- if s.ProvisionedThroughput == nil {
- invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
- }
if s.TableName == nil {
invalidParams.Add(request.NewErrParamRequired("TableName"))
}
@@ -5580,9 +7642,14 @@ func (s *CreateTableInput) Validate() error {
invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams))
}
}
- if s.SSESpecification != nil {
- if err := s.SSESpecification.Validate(); err != nil {
- invalidParams.AddNested("SSESpecification", err.(request.ErrInvalidParams))
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
}
}
@@ -5598,6 +7665,12 @@ func (s *CreateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *Cr
return s
}
+// SetBillingMode sets the BillingMode field's value.
+func (s *CreateTableInput) SetBillingMode(v string) *CreateTableInput {
+ s.BillingMode = &v
+ return s
+}
+
// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value.
func (s *CreateTableInput) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndex) *CreateTableInput {
s.GlobalSecondaryIndexes = v
@@ -5640,6 +7713,12 @@ func (s *CreateTableInput) SetTableName(v string) *CreateTableInput {
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateTableInput) SetTags(v []*Tag) *CreateTableInput {
+ s.Tags = v
+ return s
+}
+
// Represents the output of a CreateTable operation.
type CreateTableOutput struct {
_ struct{} `type:"structure"`
@@ -5664,6 +7743,101 @@ func (s *CreateTableOutput) SetTableDescription(v *TableDescription) *CreateTabl
return s
}
+// Represents a request to perform a DeleteItem operation.
+type Delete struct {
+ _ struct{} `type:"structure"`
+
+ // A condition that must be satisfied in order for a conditional delete to succeed.
+ ConditionExpression *string `type:"string"`
+
+ // One or more substitution tokens for attribute names in an expression.
+ ExpressionAttributeNames map[string]*string `type:"map"`
+
+ // One or more values that can be substituted in an expression.
+ ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
+
+ // The primary key of the item to be deleted. Each element consists of an attribute
+ // name and a value for that attribute.
+ //
+ // Key is a required field
+ Key map[string]*AttributeValue `type:"map" required:"true"`
+
+ // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the
+ // Delete condition fails. For ReturnValuesOnConditionCheckFailure, the valid
+ // values are: NONE and ALL_OLD.
+ ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"`
+
+ // Name of the table in which the item to be deleted resides.
+ //
+ // TableName is a required field
+ TableName *string `min:"3" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s Delete) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Delete) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Delete) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Delete"}
+ if s.Key == nil {
+ invalidParams.Add(request.NewErrParamRequired("Key"))
+ }
+ if s.TableName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TableName"))
+ }
+ if s.TableName != nil && len(*s.TableName) < 3 {
+ invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetConditionExpression sets the ConditionExpression field's value.
+func (s *Delete) SetConditionExpression(v string) *Delete {
+ s.ConditionExpression = &v
+ return s
+}
+
+// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value.
+func (s *Delete) SetExpressionAttributeNames(v map[string]*string) *Delete {
+ s.ExpressionAttributeNames = v
+ return s
+}
+
+// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value.
+func (s *Delete) SetExpressionAttributeValues(v map[string]*AttributeValue) *Delete {
+ s.ExpressionAttributeValues = v
+ return s
+}
+
+// SetKey sets the Key field's value.
+func (s *Delete) SetKey(v map[string]*AttributeValue) *Delete {
+ s.Key = v
+ return s
+}
+
+// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value.
+func (s *Delete) SetReturnValuesOnConditionCheckFailure(v string) *Delete {
+ s.ReturnValuesOnConditionCheckFailure = &v
+ return s
+}
+
+// SetTableName sets the TableName field's value.
+func (s *Delete) SetTableName(v string) *Delete {
+ s.TableName = &v
+ return s
+}
+
type DeleteBackupInput struct {
_ struct{} `type:"structure"`
@@ -5780,26 +7954,24 @@ type DeleteItemInput struct {
// An expression can contain any of the following:
//
// * Functions: attribute_exists | attribute_not_exists | attribute_type
- // | contains | begins_with | size
- //
- // These function names are case-sensitive.
+ // | contains | begins_with | size These function names are case-sensitive.
//
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
//
- // * Logical operators: AND | OR | NOT
+ // * Logical operators: AND | OR | NOT
//
- // For more information on condition expressions, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information about condition expressions, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ConditionExpression *string `type:"string"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
+ // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
+ // see Expected (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@@ -5822,7 +7994,7 @@ type DeleteItemInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -5835,8 +8007,8 @@ type DeleteItemInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information on expression attribute names, see Specifying Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -5857,8 +8029,8 @@ type DeleteItemInput struct {
//
// ProductStatus IN (:avail, :back, :disc)
//
- // For more information on expression attribute values, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information on expression attribute values, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
@@ -5878,11 +8050,9 @@ type DeleteItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -6016,7 +8186,7 @@ type DeleteItemOutput struct {
// includes the total provisioned throughput consumed, along with statistics
// for the table and any indexes involved in the operation. ConsumedCapacity
// is only returned if the ReturnConsumedCapacity parameter was specified. For
- // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // more information, see Provisioned Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -6035,10 +8205,9 @@ type DeleteItemOutput struct {
// bound for the estimate. The estimate includes the size of all the items
// in the table, plus the size of all attributes projected into all of the
// local secondary indexes on that table. Use this estimate to measure whether
- // a local secondary index is approaching its size limit.
- //
- // The estimate is subject to change over time; therefore, do not rely on the
- // precision or accuracy of the estimate.
+ // a local secondary index is approaching its size limit. The estimate is
+ // subject to change over time; therefore, do not rely on the precision or
+ // accuracy of the estimate.
ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
}
@@ -6206,7 +8375,7 @@ func (s *DeleteTableOutput) SetTableDescription(v *TableDescription) *DeleteTabl
type DescribeBackupInput struct {
_ struct{} `type:"structure"`
- // The ARN associated with the backup.
+ // The Amazon Resource Name (ARN) associated with the backup.
//
// BackupArn is a required field
BackupArn *string `min:"37" type:"string" required:"true"`
@@ -6312,7 +8481,8 @@ func (s *DescribeContinuousBackupsInput) SetTableName(v string) *DescribeContinu
type DescribeContinuousBackupsOutput struct {
_ struct{} `type:"structure"`
- // ContinuousBackupsDescription can be one of the following : ENABLED, DISABLED.
+ // Represents the continuous backups and point in time recovery settings on
+ // the table.
ContinuousBackupsDescription *ContinuousBackupsDescription `type:"structure"`
}
@@ -6332,6 +8502,45 @@ func (s *DescribeContinuousBackupsOutput) SetContinuousBackupsDescription(v *Con
return s
}
+type DescribeEndpointsInput struct {
+ _ struct{} `type:"structure"`
+}
+
+// String returns the string representation
+func (s DescribeEndpointsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeEndpointsInput) GoString() string {
+ return s.String()
+}
+
+type DescribeEndpointsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // List of endpoints.
+ //
+ // Endpoints is a required field
+ Endpoints []*Endpoint `type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s DescribeEndpointsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeEndpointsOutput) GoString() string {
+ return s.String()
+}
+
+// SetEndpoints sets the Endpoints field's value.
+func (s *DescribeEndpointsOutput) SetEndpoints(v []*Endpoint) *DescribeEndpointsOutput {
+ s.Endpoints = v
+ return s
+}
+
type DescribeGlobalTableInput struct {
_ struct{} `type:"structure"`
@@ -6443,7 +8652,7 @@ type DescribeGlobalTableSettingsOutput struct {
// The name of the global table.
GlobalTableName *string `min:"3" type:"string"`
- // The region specific settings for the global table.
+ // The Region-specific settings for the global table.
ReplicaSettings []*ReplicaSettingsDescription `type:"list"`
}
@@ -6489,20 +8698,20 @@ type DescribeLimitsOutput struct {
_ struct{} `type:"structure"`
// The maximum total read capacity units that your account allows you to provision
- // across all of your tables in this region.
+ // across all of your tables in this Region.
AccountMaxReadCapacityUnits *int64 `min:"1" type:"long"`
// The maximum total write capacity units that your account allows you to provision
- // across all of your tables in this region.
+ // across all of your tables in this Region.
AccountMaxWriteCapacityUnits *int64 `min:"1" type:"long"`
// The maximum read capacity units that your account allows you to provision
- // for a new table that you are creating in this region, including the read
+ // for a new table that you are creating in this Region, including the read
// capacity units provisioned for its global secondary indexes (GSIs).
TableMaxReadCapacityUnits *int64 `min:"1" type:"long"`
// The maximum write capacity units that your account allows you to provision
- // for a new table that you are creating in this region, including the write
+ // for a new table that you are creating in this Region, including the write
// capacity units provisioned for its global secondary indexes (GSIs).
TableMaxWriteCapacityUnits *int64 `min:"1" type:"long"`
}
@@ -6671,6 +8880,43 @@ func (s *DescribeTimeToLiveOutput) SetTimeToLiveDescription(v *TimeToLiveDescrip
return s
}
+// An endpoint information details.
+type Endpoint struct {
+ _ struct{} `type:"structure"`
+
+ // IP address of the endpoint.
+ //
+ // Address is a required field
+ Address *string `type:"string" required:"true"`
+
+ // Endpoint cache time to live (TTL) value.
+ //
+ // CachePeriodInMinutes is a required field
+ CachePeriodInMinutes *int64 `type:"long" required:"true"`
+}
+
+// String returns the string representation
+func (s Endpoint) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Endpoint) GoString() string {
+ return s.String()
+}
+
+// SetAddress sets the Address field's value.
+func (s *Endpoint) SetAddress(v string) *Endpoint {
+ s.Address = &v
+ return s
+}
+
+// SetCachePeriodInMinutes sets the CachePeriodInMinutes field's value.
+func (s *Endpoint) SetCachePeriodInMinutes(v int64) *Endpoint {
+ s.CachePeriodInMinutes = &v
+ return s
+}
+
// Represents a condition to be compared with an attribute value. This condition
// can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison
// evaluates to true, the operation succeeds; if not, the operation fails. You
@@ -6707,7 +8953,7 @@ type ExpectedAttributeValue struct {
// For Binary, DynamoDB treats each byte of the binary data as unsigned when
// it compares binary values.
//
- // For information on specifying data types in JSON, see JSON Data Format (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html)
+ // For information on specifying data types in JSON, see JSON Data Format (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html)
// in the Amazon DynamoDB Developer Guide.
AttributeValueList []*AttributeValue `type:"list"`
@@ -6722,48 +8968,117 @@ type ExpectedAttributeValue struct {
// The following are descriptions of each comparison operator.
//
// * EQ : Equal. EQ is supported for all data types, including lists and
- // maps.
+ // maps. AttributeValueList can contain only one AttributeValue element of
+ // type String, Number, Binary, String Set, Number Set, or Binary Set. If
+ // an item contains an AttributeValue element of a different type than the
+ // one provided in the request, the value does not match. For example, {"S":"6"}
+ // does not equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2",
+ // "1"]}.
//
- // AttributeValueList can contain only one AttributeValue element of type String,
- // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
- // an AttributeValue element of a different type than the one provided in
+ // * NE : Not equal. NE is supported for all data types, including lists
+ // and maps. AttributeValueList can contain only one AttributeValue of type
+ // String, Number, Binary, String Set, Number Set, or Binary Set. If an item
+ // contains an AttributeValue of a different type than the one provided in
// the request, the value does not match. For example, {"S":"6"} does not
// equal {"N":"6"}. Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
//
- // * NE : Not equal. NE is supported for all data types, including lists
- // and maps.
+ // * LE : Less than or equal. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If an item
+ // contains an AttributeValue element of a different type than the one provided
+ // in the request, the value does not match. For example, {"S":"6"} does
+ // not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // * AttributeValueList can contain only one AttributeValue of type String,
- // Number, Binary, String Set, Number Set, or Binary Set. If an item contains
- // an AttributeValue of a different type than the one provided in the request,
- // the value does not match. For example, {"S":"6"} does not equal {"N":"6"}.
- // Also, {"N":"6"} does not equal {"NS":["6", "2", "1"]}.
+ // * LT : Less than. AttributeValueList can contain only one AttributeValue
+ // of type String, Number, or Binary (not a set type). If an item contains
+ // an AttributeValue element of a different type than the one provided in
+ // the request, the value does not match. For example, {"S":"6"} does not
+ // equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // * LE : Less than or equal.
+ // * GE : Greater than or equal. AttributeValueList can contain only one
+ // AttributeValue element of type String, Number, or Binary (not a set type).
+ // If an item contains an AttributeValue element of a different type than
+ // the one provided in the request, the value does not match. For example,
+ // {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"} does not compare to
+ // {"NS":["6", "2", "1"]}.
//
- // AttributeValueList can contain only one AttributeValue element of type String,
- // Number, or Binary (not a set type). If an item contains an AttributeValue
- // element of a different type than the one provided in the request, the value
- // does not match. For example, {"S":"6"} does not equal {"N":"6"}. Also, {"N":"6"}
- // does not compare to {"NS":["6", "2", "1"]}.
+ // * GT : Greater than. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If an item
+ // contains an AttributeValue element of a different type than the one provided
+ // in the request, the value does not match. For example, {"S":"6"} does
+ // not equal {"N":"6"}. Also, {"N":"6"} does not compare to {"NS":["6", "2",
+ // "1"]}.
//
- // LT: Less than.
+ // * NOT_NULL : The attribute exists. NOT_NULL is supported for all data
+ // types, including lists and maps. This operator tests for the existence
+ // of an attribute, not its data type. If the data type of attribute "a"
+ // is null, and you evaluate it using NOT_NULL, the result is a Boolean true.
+ // This result is because the attribute "a" exists; its data type is not
+ // relevant to the NOT_NULL comparison operator.
//
- // AttributeValueListcan contain only one AttributeValueof type String, Number, or Binary (not a set type). If an item contains an
- // AttributeValueelement of a different type than the one provided in the request, the value
- // does not match. For example, {"S":"6"}does not equal {"N":"6"}. Also, {"N":"6"}does not compare to {"NS":["6", "2", "1"]}
+ // * NULL : The attribute does not exist. NULL is supported for all data
+ // types, including lists and maps. This operator tests for the nonexistence
+ // of an attribute, not its data type. If the data type of attribute "a"
+ // is null, and you evaluate it using NULL, the result is a Boolean false.
+ // This is because the attribute "a" exists; its data type is not relevant
+ // to the NULL comparison operator.
+ //
+ // * CONTAINS : Checks for a subsequence, or value in a set. AttributeValueList
+ // can contain only one AttributeValue element of type String, Number, or
+ // Binary (not a set type). If the target attribute of the comparison is
+ // of type String, then the operator checks for a substring match. If the
+ // target attribute of the comparison is of type Binary, then the operator
+ // looks for a subsequence of the target that matches the input. If the target
+ // attribute of the comparison is a set ("SS", "NS", or "BS"), then the operator
+ // evaluates to true if it finds an exact match with any member of the set.
+ // CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can
+ // be a list; however, "b" cannot be a set, a map, or a list.
+ //
+ // * NOT_CONTAINS : Checks for absence of a subsequence, or absence of a
+ // value in a set. AttributeValueList can contain only one AttributeValue
+ // element of type String, Number, or Binary (not a set type). If the target
+ // attribute of the comparison is a String, then the operator checks for
+ // the absence of a substring match. If the target attribute of the comparison
+ // is Binary, then the operator checks for the absence of a subsequence of
+ // the target that matches the input. If the target attribute of the comparison
+ // is a set ("SS", "NS", or "BS"), then the operator evaluates to true if
+ // it does not find an exact match with any member of the set. NOT_CONTAINS
+ // is supported for lists: When evaluating "a NOT CONTAINS b", "a" can be
+ // a list; however, "b" cannot be a set, a map, or a list.
+ //
+ // * BEGINS_WITH : Checks for a prefix. AttributeValueList can contain only
+ // one AttributeValue of type String or Binary (not a Number or a set type).
+ // The target attribute of the comparison must be of type String or Binary
+ // (not a Number or a set type).
+ //
+ // * IN : Checks for matching elements in a list. AttributeValueList can
+ // contain one or more AttributeValue elements of type String, Number, or
+ // Binary. These attributes are compared against an existing attribute of
+ // an item. If any elements of the input are equal to the item attribute,
+ // the expression evaluates to true.
+ //
+ // * BETWEEN : Greater than or equal to the first value, and less than or
+ // equal to the second value. AttributeValueList must contain two AttributeValue
+ // elements of the same type, either String, Number, or Binary (not a set
+ // type). A target attribute matches if the target value is greater than,
+ // or equal to, the first element and less than, or equal to, the second
+ // element. If an item contains an AttributeValue element of a different
+ // type than the one provided in the request, the value does not match. For
+ // example, {"S":"6"} does not compare to {"N":"6"}. Also, {"N":"6"} does
+ // not compare to {"NS":["6", "2", "1"]}
ComparisonOperator *string `type:"string" enum:"ComparisonOperator"`
// Causes DynamoDB to evaluate the value before attempting a conditional operation:
//
// * If Exists is true, DynamoDB will check to see if that attribute value
// already exists in the table. If it is found, then the operation succeeds.
- // If it is not found, the operation fails with a ConditionalCheckFailedException.
+ // If it is not found, the operation fails with a ConditionCheckFailedException.
//
// * If Exists is false, DynamoDB assumes that the attribute value does not
// exist in the table. If in fact the value does not exist, then the assumption
// is valid and the operation succeeds. If the value is found, despite the
- // assumption that it does not exist, the operation fails with a ConditionalCheckFailedException.
+ // assumption that it does not exist, the operation fails with a ConditionCheckFailedException.
//
// The default setting for Exists is true. If you supply a Value all by itself,
// DynamoDB assumes the attribute exists: You don't have to set Exists to true,
@@ -6783,7 +9098,7 @@ type ExpectedAttributeValue struct {
// Each attribute value is described as a name-value pair. The name is the data
// type, and the value is the data itself.
//
- // For more information, see Data Types (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
+ // For more information, see Data Types (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes)
// in the Amazon DynamoDB Developer Guide.
Value *AttributeValue `type:"structure"`
}
@@ -6822,12 +9137,93 @@ func (s *ExpectedAttributeValue) SetValue(v *AttributeValue) *ExpectedAttributeV
return s
}
+// Specifies an item and related attribute values to retrieve in a TransactGetItem
+// object.
+type Get struct {
+ _ struct{} `type:"structure"`
+
+ // One or more substitution tokens for attribute names in the ProjectionExpression
+ // parameter.
+ ExpressionAttributeNames map[string]*string `type:"map"`
+
+ // A map of attribute names to AttributeValue objects that specifies the primary
+ // key of the item to retrieve.
+ //
+ // Key is a required field
+ Key map[string]*AttributeValue `type:"map" required:"true"`
+
+ // A string that identifies one or more attributes of the specified item to
+ // retrieve from the table. The attributes in the expression must be separated
+ // by commas. If no attribute names are specified, then all attributes of the
+ // specified item are returned. If any of the requested attributes are not found,
+ // they do not appear in the result.
+ ProjectionExpression *string `type:"string"`
+
+ // The name of the table from which to retrieve the specified item.
+ //
+ // TableName is a required field
+ TableName *string `min:"3" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s Get) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Get) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Get) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Get"}
+ if s.Key == nil {
+ invalidParams.Add(request.NewErrParamRequired("Key"))
+ }
+ if s.TableName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TableName"))
+ }
+ if s.TableName != nil && len(*s.TableName) < 3 {
+ invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value.
+func (s *Get) SetExpressionAttributeNames(v map[string]*string) *Get {
+ s.ExpressionAttributeNames = v
+ return s
+}
+
+// SetKey sets the Key field's value.
+func (s *Get) SetKey(v map[string]*AttributeValue) *Get {
+ s.Key = v
+ return s
+}
+
+// SetProjectionExpression sets the ProjectionExpression field's value.
+func (s *Get) SetProjectionExpression(v string) *Get {
+ s.ProjectionExpression = &v
+ return s
+}
+
+// SetTableName sets the TableName field's value.
+func (s *Get) SetTableName(v string) *Get {
+ s.TableName = &v
+ return s
+}
+
// Represents the input of a GetItem operation.
type GetItemInput struct {
_ struct{} `type:"structure"`
// This is a legacy parameter. Use ProjectionExpression instead. For more information,
- // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
+ // see AttributesToGet (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
// in the Amazon DynamoDB Developer Guide.
AttributesToGet []*string `min:"1" type:"list"`
@@ -6855,7 +9251,7 @@ type GetItemInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -6868,8 +9264,8 @@ type GetItemInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information on expression attribute names, see Specifying Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -6888,11 +9284,11 @@ type GetItemInput struct {
// These attributes can include scalars, sets, or elements of a JSON document.
// The attributes in the expression must be separated by commas.
//
- // If no attribute names are specified, then all attributes will be returned.
- // If any of the requested attributes are not found, they will not appear in
- // the result.
+ // If no attribute names are specified, then all attributes are returned. If
+ // any of the requested attributes are not found, they do not appear in the
+ // result.
//
- // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information, see Specifying Item Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ProjectionExpression *string `type:"string"`
@@ -6901,11 +9297,9 @@ type GetItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -7001,7 +9395,7 @@ type GetItemOutput struct {
// the total provisioned throughput consumed, along with statistics for the
// table and any indexes involved in the operation. ConsumedCapacity is only
// returned if the ReturnConsumedCapacity parameter was specified. For more
- // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // information, see Read/Write Capacity Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -7071,11 +9465,9 @@ type GlobalSecondaryIndex struct {
// index.
//
// For current minimum and maximum provisioned throughput values, see Limits
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
- //
- // ProvisionedThroughput is a required field
- ProvisionedThroughput *ProvisionedThroughput `type:"structure" required:"true"`
+ ProvisionedThroughput *ProvisionedThroughput `type:"structure"`
}
// String returns the string representation
@@ -7106,9 +9498,6 @@ func (s *GlobalSecondaryIndex) Validate() error {
if s.Projection == nil {
invalidParams.Add(request.NewErrParamRequired("Projection"))
}
- if s.ProvisionedThroughput == nil {
- invalidParams.Add(request.NewErrParamRequired("ProvisionedThroughput"))
- }
if s.KeySchema != nil {
for i, v := range s.KeySchema {
if v == nil {
@@ -7227,7 +9616,7 @@ type GlobalSecondaryIndexDescription struct {
// index.
//
// For current minimum and maximum provisioned throughput values, see Limits
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"`
}
@@ -7489,7 +9878,7 @@ type GlobalTableDescription struct {
_ struct{} `type:"structure"`
// The creation time of the global table.
- CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ CreationDateTime *time.Time `type:"timestamp"`
// The unique identifier of the global table.
GlobalTableArn *string `type:"string"`
@@ -7563,6 +9952,10 @@ type GlobalTableGlobalSecondaryIndexSettingsUpdate struct {
// IndexName is a required field
IndexName *string `min:"3" type:"string" required:"true"`
+ // AutoScaling settings for managing a global secondary index's write capacity
+ // units.
+ ProvisionedWriteCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"`
+
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException.
ProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"`
@@ -7590,6 +9983,11 @@ func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) Validate() error {
if s.ProvisionedWriteCapacityUnits != nil && *s.ProvisionedWriteCapacityUnits < 1 {
invalidParams.Add(request.NewErrParamMinValue("ProvisionedWriteCapacityUnits", 1))
}
+ if s.ProvisionedWriteCapacityAutoScalingSettingsUpdate != nil {
+ if err := s.ProvisionedWriteCapacityAutoScalingSettingsUpdate.Validate(); err != nil {
+ invalidParams.AddNested("ProvisionedWriteCapacityAutoScalingSettingsUpdate", err.(request.ErrInvalidParams))
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -7603,6 +10001,12 @@ func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetIndexName(v string) *
return s
}
+// SetProvisionedWriteCapacityAutoScalingSettingsUpdate sets the ProvisionedWriteCapacityAutoScalingSettingsUpdate field's value.
+func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetProvisionedWriteCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *GlobalTableGlobalSecondaryIndexSettingsUpdate {
+ s.ProvisionedWriteCapacityAutoScalingSettingsUpdate = v
+ return s
+}
+
// SetProvisionedWriteCapacityUnits sets the ProvisionedWriteCapacityUnits field's value.
func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetProvisionedWriteCapacityUnits(v int64) *GlobalTableGlobalSecondaryIndexSettingsUpdate {
s.ProvisionedWriteCapacityUnits = &v
@@ -7654,6 +10058,30 @@ func (s *ItemCollectionMetrics) SetSizeEstimateRangeGB(v []*float64) *ItemCollec
return s
}
+// Details for the requested item.
+type ItemResponse struct {
+ _ struct{} `type:"structure"`
+
+ // Map of attribute data consisting of the data type and attribute value.
+ Item map[string]*AttributeValue `type:"map"`
+}
+
+// String returns the string representation
+func (s ItemResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ItemResponse) GoString() string {
+ return s.String()
+}
+
+// SetItem sets the Item field's value.
+func (s *ItemResponse) SetItem(v map[string]*AttributeValue) *ItemResponse {
+ s.Item = v
+ return s
+}
+
// Represents a single element of a key schema. A key schema specifies the attributes
// that make up the primary key of a table, or the key attributes of an index.
//
@@ -7744,7 +10172,7 @@ type KeysAndAttributes struct {
_ struct{} `type:"structure"`
// This is a legacy parameter. Use ProjectionExpression instead. For more information,
- // see Legacy Conditional Parameters (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
+ // see Legacy Conditional Parameters (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html)
// in the Amazon DynamoDB Developer Guide.
AttributesToGet []*string `min:"1" type:"list"`
@@ -7771,7 +10199,7 @@ type KeysAndAttributes struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -7785,7 +10213,7 @@ type KeysAndAttributes struct {
// are placeholders for the actual value at runtime.
//
// For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -7803,7 +10231,7 @@ type KeysAndAttributes struct {
// If any of the requested attributes are not found, they will not appear in
// the result.
//
- // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information, see Accessing Item Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ProjectionExpression *string `type:"string"`
}
@@ -7870,7 +10298,21 @@ func (s *KeysAndAttributes) SetProjectionExpression(v string) *KeysAndAttributes
type ListBackupsInput struct {
_ struct{} `type:"structure"`
- // LastEvaluatedBackupARN returned by the previous ListBackups call.
+ // The backups from the table specified by BackupType are listed.
+ //
+ // Where BackupType can be:
+ //
+ // * USER - On-demand backup created by you.
+ //
+ // * SYSTEM - On-demand backup automatically created by DynamoDB.
+ //
+ // * ALL - All types of on-demand backups (USER and SYSTEM).
+ BackupType *string `type:"string" enum:"BackupTypeFilter"`
+
+ // LastEvaluatedBackupArn is the Amazon Resource Name (ARN) of the backup last
+ // evaluated when the current page of results was returned, inclusive of the
+ // current page of results. This value may be specified as the ExclusiveStartBackupArn
+ // of a new ListBackups operation in order to fetch the next page of results.
ExclusiveStartBackupArn *string `min:"37" type:"string"`
// Maximum number of backups to return at once.
@@ -7880,11 +10322,11 @@ type ListBackupsInput struct {
TableName *string `min:"3" type:"string"`
// Only backups created after this time are listed. TimeRangeLowerBound is inclusive.
- TimeRangeLowerBound *time.Time `type:"timestamp" timestampFormat:"unix"`
+ TimeRangeLowerBound *time.Time `type:"timestamp"`
// Only backups created before this time are listed. TimeRangeUpperBound is
// exclusive.
- TimeRangeUpperBound *time.Time `type:"timestamp" timestampFormat:"unix"`
+ TimeRangeUpperBound *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -7916,6 +10358,12 @@ func (s *ListBackupsInput) Validate() error {
return nil
}
+// SetBackupType sets the BackupType field's value.
+func (s *ListBackupsInput) SetBackupType(v string) *ListBackupsInput {
+ s.BackupType = &v
+ return s
+}
+
// SetExclusiveStartBackupArn sets the ExclusiveStartBackupArn field's value.
func (s *ListBackupsInput) SetExclusiveStartBackupArn(v string) *ListBackupsInput {
s.ExclusiveStartBackupArn = &v
@@ -7952,7 +10400,17 @@ type ListBackupsOutput struct {
// List of BackupSummary objects.
BackupSummaries []*BackupSummary `type:"list"`
- // Last evaluated BackupARN.
+ // The ARN of the backup last evaluated when the current page of results was
+ // returned, inclusive of the current page of results. This value may be specified
+ // as the ExclusiveStartBackupArn of a new ListBackups operation in order to
+ // fetch the next page of results.
+ //
+ // If LastEvaluatedBackupArn is empty, then the last page of results has been
+ // processed and there are no more results to be retrieved.
+ //
+ // If LastEvaluatedBackupArn is not empty, this may or may not indicate that
+ // there is more data to be returned. All results are guaranteed to have been
+ // returned if and only if no value for LastEvaluatedBackupArn is returned.
LastEvaluatedBackupArn *string `min:"37" type:"string"`
}
@@ -7987,7 +10445,7 @@ type ListGlobalTablesInput struct {
// The maximum number of table names to return.
Limit *int64 `min:"1" type:"integer"`
- // Lists the global tables in a specific region.
+ // Lists the global tables in a specific Region.
RegionName *string `type:"string"`
}
@@ -8507,10 +10965,10 @@ type PointInTimeRecoveryDescription struct {
// Specifies the earliest point in time you can restore your table to. It You
// can restore your table to any point in time during the last 35 days.
- EarliestRestorableDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ EarliestRestorableDateTime *time.Time `type:"timestamp"`
// LatestRestorableDateTime is typically 5 minutes before the current time.
- LatestRestorableDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ LatestRestorableDateTime *time.Time `type:"timestamp"`
// The current state of point in time recovery:
//
@@ -8654,24 +11112,28 @@ func (s *Projection) SetProjectionType(v string) *Projection {
// The settings can be modified using the UpdateTable operation.
//
// For current minimum and maximum provisioned throughput values, see Limits
-// (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+// (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
type ProvisionedThroughput struct {
_ struct{} `type:"structure"`
// The maximum number of strongly consistent reads consumed per second before
// DynamoDB returns a ThrottlingException. For more information, see Specifying
- // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
+ // Read and Write Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
// in the Amazon DynamoDB Developer Guide.
//
+ // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.
+ //
// ReadCapacityUnits is a required field
ReadCapacityUnits *int64 `min:"1" type:"long" required:"true"`
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException. For more information, see Specifying Read and Write
- // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
+ // Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
// in the Amazon DynamoDB Developer Guide.
//
+ // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0.
+ //
// WriteCapacityUnits is a required field
WriteCapacityUnits *int64 `min:"1" type:"long" required:"true"`
}
@@ -8726,14 +11188,14 @@ type ProvisionedThroughputDescription struct {
_ struct{} `type:"structure"`
// The date and time of the last provisioned throughput decrease for this table.
- LastDecreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ LastDecreaseDateTime *time.Time `type:"timestamp"`
// The date and time of the last provisioned throughput increase for this table.
- LastIncreaseDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ LastIncreaseDateTime *time.Time `type:"timestamp"`
// The number of provisioned throughput decreases for this table during this
// UTC calendar day. For current maximums on provisioned throughput decreases,
- // see Limits (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // see Limits (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
NumberOfDecreasesToday *int64 `min:"1" type:"long"`
@@ -8741,11 +11203,11 @@ type ProvisionedThroughputDescription struct {
// DynamoDB returns a ThrottlingException. Eventually consistent reads require
// less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits
// per second provides 100 eventually consistent ReadCapacityUnits per second.
- ReadCapacityUnits *int64 `min:"1" type:"long"`
+ ReadCapacityUnits *int64 `type:"long"`
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException.
- WriteCapacityUnits *int64 `min:"1" type:"long"`
+ WriteCapacityUnits *int64 `type:"long"`
}
// String returns the string representation
@@ -8788,6 +11250,104 @@ func (s *ProvisionedThroughputDescription) SetWriteCapacityUnits(v int64) *Provi
return s
}
+// Represents a request to perform a PutItem operation.
+type Put struct {
+ _ struct{} `type:"structure"`
+
+ // A condition that must be satisfied in order for a conditional update to succeed.
+ ConditionExpression *string `type:"string"`
+
+ // One or more substitution tokens for attribute names in an expression.
+ ExpressionAttributeNames map[string]*string `type:"map"`
+
+ // One or more values that can be substituted in an expression.
+ ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
+
+ // A map of attribute name to attribute values, representing the primary key
+ // of the item to be written by PutItem. All of the table's primary key attributes
+ // must be specified, and their data types must match those of the table's key
+ // schema. If any attributes are present in the item that are part of an index
+ // key schema for the table, their types must match the index key schema.
+ //
+ // Item is a required field
+ Item map[string]*AttributeValue `type:"map" required:"true"`
+
+ // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the
+ // Put condition fails. For ReturnValuesOnConditionCheckFailure, the valid values
+ // are: NONE and ALL_OLD.
+ ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"`
+
+ // Name of the table in which to write the item.
+ //
+ // TableName is a required field
+ TableName *string `min:"3" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s Put) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Put) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Put) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Put"}
+ if s.Item == nil {
+ invalidParams.Add(request.NewErrParamRequired("Item"))
+ }
+ if s.TableName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TableName"))
+ }
+ if s.TableName != nil && len(*s.TableName) < 3 {
+ invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetConditionExpression sets the ConditionExpression field's value.
+func (s *Put) SetConditionExpression(v string) *Put {
+ s.ConditionExpression = &v
+ return s
+}
+
+// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value.
+func (s *Put) SetExpressionAttributeNames(v map[string]*string) *Put {
+ s.ExpressionAttributeNames = v
+ return s
+}
+
+// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value.
+func (s *Put) SetExpressionAttributeValues(v map[string]*AttributeValue) *Put {
+ s.ExpressionAttributeValues = v
+ return s
+}
+
+// SetItem sets the Item field's value.
+func (s *Put) SetItem(v map[string]*AttributeValue) *Put {
+ s.Item = v
+ return s
+}
+
+// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value.
+func (s *Put) SetReturnValuesOnConditionCheckFailure(v string) *Put {
+ s.ReturnValuesOnConditionCheckFailure = &v
+ return s
+}
+
+// SetTableName sets the TableName field's value.
+func (s *Put) SetTableName(v string) *Put {
+ s.TableName = &v
+ return s
+}
+
// Represents the input of a PutItem operation.
type PutItemInput struct {
_ struct{} `type:"structure"`
@@ -8798,26 +11358,24 @@ type PutItemInput struct {
// An expression can contain any of the following:
//
// * Functions: attribute_exists | attribute_not_exists | attribute_type
- // | contains | begins_with | size
- //
- // These function names are case-sensitive.
+ // | contains | begins_with | size These function names are case-sensitive.
//
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
//
- // * Logical operators: AND | OR | NOT
+ // * Logical operators: AND | OR | NOT
//
- // For more information on condition expressions, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information on condition expressions, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ConditionExpression *string `type:"string"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
+ // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
+ // see Expected (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@@ -8840,7 +11398,7 @@ type PutItemInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -8853,8 +11411,8 @@ type PutItemInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information on expression attribute names, see Specifying Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -8875,8 +11433,8 @@ type PutItemInput struct {
//
// ProductStatus IN (:avail, :back, :disc)
//
- // For more information on expression attribute values, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information on expression attribute values, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
@@ -8893,7 +11451,7 @@ type PutItemInput struct {
// types for those attributes must match those of the schema in the table's
// attribute definition.
//
- // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey)
+ // For more information about primary keys, see Primary Key (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey)
// in the Amazon DynamoDB Developer Guide.
//
// Each element in the Item map is an AttributeValue object.
@@ -8906,11 +11464,9 @@ type PutItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -9046,7 +11602,7 @@ type PutItemOutput struct {
// the total provisioned throughput consumed, along with statistics for the
// table and any indexes involved in the operation. ConsumedCapacity is only
// returned if the ReturnConsumedCapacity parameter was specified. For more
- // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // information, see Read/Write Capacity Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -9065,10 +11621,9 @@ type PutItemOutput struct {
// bound for the estimate. The estimate includes the size of all the items
// in the table, plus the size of all attributes projected into all of the
// local secondary indexes on that table. Use this estimate to measure whether
- // a local secondary index is approaching its size limit.
- //
- // The estimate is subject to change over time; therefore, do not rely on the
- // precision or accuracy of the estimate.
+ // a local secondary index is approaching its size limit. The estimate is
+ // subject to change over time; therefore, do not rely on the precision or
+ // accuracy of the estimate.
ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
}
@@ -9135,12 +11690,12 @@ type QueryInput struct {
_ struct{} `type:"structure"`
// This is a legacy parameter. Use ProjectionExpression instead. For more information,
- // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
+ // see AttributesToGet (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
// in the Amazon DynamoDB Developer Guide.
AttributesToGet []*string `min:"1" type:"list"`
// This is a legacy parameter. Use FilterExpression instead. For more information,
- // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
+ // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
@@ -9156,7 +11711,7 @@ type QueryInput struct {
// The primary key of the first item that this operation will evaluate. Use
// the value that was returned for LastEvaluatedKey in the previous operation.
//
- // The data type for ExclusiveStartKey must be String, Number or Binary. No
+ // The data type for ExclusiveStartKey must be String, Number, or Binary. No
// set data types are allowed.
ExclusiveStartKey map[string]*AttributeValue `type:"map"`
@@ -9179,7 +11734,7 @@ type QueryInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -9192,8 +11747,8 @@ type QueryInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information on expression attribute names, see Specifying Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -9215,7 +11770,7 @@ type QueryInput struct {
// ProductStatus IN (:avail, :back, :disc)
//
// For more information on expression attribute values, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
@@ -9229,7 +11784,7 @@ type QueryInput struct {
// A FilterExpression is applied after the items have already been read; the
// process of filtering does not consume any additional read capacity units.
//
- // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
+ // For more information, see Filter Expressions (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
// in the Amazon DynamoDB Developer Guide.
FilterExpression *string `type:"string"`
@@ -9238,7 +11793,7 @@ type QueryInput struct {
// parameter, you must also provide TableName.
IndexName *string `min:"3" type:"string"`
- // The condition that specifies the key value(s) for items to be retrieved by
+ // The condition that specifies the key values for items to be retrieved by
// the Query action.
//
// The condition must perform an equality test on a single partition key value.
@@ -9251,34 +11806,35 @@ type QueryInput struct {
// The partition key equality test is required, and must be specified in the
// following format:
//
- // partitionKeyName=:partitionkeyval
+ // partitionKeyName = :partitionkeyval
//
// If you also want to provide a condition for the sort key, it must be combined
// using AND with the condition for the sort key. Following is an example, using
// the = comparison operator for the sort key:
//
- // partitionKeyName=:partitionkeyvalANDsortKeyName=:sortkeyval
+ // partitionKeyName = :partitionkeyval AND sortKeyName = :sortkeyval
//
// Valid comparisons for the sort key condition are as follows:
//
- // * sortKeyName=:sortkeyval - true if the sort key value is equal to :sortkeyval.
+ // * sortKeyName = :sortkeyval - true if the sort key value is equal to :sortkeyval.
//
- // * sortKeyName<:sortkeyval - true if the sort key value is less than :sortkeyval.
- //
- // * sortKeyName<=:sortkeyval - true if the sort key value is less than or
- // equal to :sortkeyval.
- //
- // * sortKeyName>:sortkeyval - true if the sort key value is greater than
+ // * sortKeyName < :sortkeyval - true if the sort key value is less than
// :sortkeyval.
//
- // * sortKeyName>= :sortkeyval - true if the sort key value is greater than
+ // * sortKeyName <= :sortkeyval - true if the sort key value is less than
// or equal to :sortkeyval.
//
- // * sortKeyNameBETWEEN:sortkeyval1AND:sortkeyval2 - true if the sort key
- // value is greater than or equal to :sortkeyval1, and less than or equal
+ // * sortKeyName > :sortkeyval - true if the sort key value is greater than
+ // :sortkeyval.
+ //
+ // * sortKeyName >= :sortkeyval - true if the sort key value is greater than
+ // or equal to :sortkeyval.
+ //
+ // * sortKeyName BETWEEN :sortkeyval1 AND :sortkeyval2 - true if the sort
+ // key value is greater than or equal to :sortkeyval1, and less than or equal
// to :sortkeyval2.
//
- // * begins_with (sortKeyName, :sortkeyval) - true if the sort key value
+ // * begins_with ( sortKeyName, :sortkeyval ) - true if the sort key value
// begins with a particular operand. (You cannot use this function with a
// sort key that is of type Number.) Note that the function name begins_with
// is case-sensitive.
@@ -9299,16 +11855,16 @@ type QueryInput struct {
//
// * #S = :myval
//
- // For a list of reserved words, see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // For a list of reserved words, see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide.
//
// For more information on ExpressionAttributeNames and ExpressionAttributeValues,
- // see Using Placeholders for Attribute Names and Values (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html)
+ // see Using Placeholders for Attribute Names and Values (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html)
// in the Amazon DynamoDB Developer Guide.
KeyConditionExpression *string `type:"string"`
// This is a legacy parameter. Use KeyConditionExpression instead. For more
- // information, see KeyConditions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html)
+ // information, see KeyConditions (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html)
// in the Amazon DynamoDB Developer Guide.
KeyConditions map[string]*Condition `type:"map"`
@@ -9316,11 +11872,11 @@ type QueryInput struct {
// items). If DynamoDB processes the number of items up to the limit while processing
// the results, it stops the operation and returns the matching values up to
// that point, and a key in LastEvaluatedKey to apply in a subsequent operation,
- // so that you can pick up where you left off. Also, if the processed data set
+ // so that you can pick up where you left off. Also, if the processed dataset
// size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation
// and returns the matching values up to the limit, and a key in LastEvaluatedKey
// to apply in a subsequent operation to continue the operation. For more information,
- // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
+ // see Query and Scan (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
// in the Amazon DynamoDB Developer Guide.
Limit *int64 `min:"1" type:"integer"`
@@ -9332,12 +11888,12 @@ type QueryInput struct {
// If any of the requested attributes are not found, they will not appear in
// the result.
//
- // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information, see Accessing Item Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ProjectionExpression *string `type:"string"`
// This is a legacy parameter. Use FilterExpression instead. For more information,
- // see QueryFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html)
+ // see QueryFilter (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html)
// in the Amazon DynamoDB Developer Guide.
QueryFilter map[string]*Condition `type:"map"`
@@ -9346,11 +11902,9 @@ type QueryInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -9379,10 +11933,10 @@ type QueryInput struct {
//
// * ALL_ATTRIBUTES - Returns all of the item attributes from the specified
// table or index. If you query a local secondary index, then for each matching
- // item in the index DynamoDB will fetch the entire item from the parent
- // table. If the index is configured to project all item attributes, then
- // all of the data can be obtained from the local secondary index, and no
- // fetching is required.
+ // item in the index, DynamoDB fetches the entire item from the parent table.
+ // If the index is configured to project all item attributes, then all of
+ // the data can be obtained from the local secondary index, and no fetching
+ // is required.
//
// * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves
// all attributes that have been projected into the index. If the index is
@@ -9394,18 +11948,15 @@ type QueryInput struct {
//
// * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet.
// This return value is equivalent to specifying AttributesToGet without
- // specifying any value for Select.
- //
- // If you query or scan a local secondary index and request only attributes
- // that are projected into that index, the operation will read only the index
- // and not the table. If any of the requested attributes are not projected
- // into the local secondary index, DynamoDB will fetch each of these attributes
- // from the parent table. This extra fetching incurs additional throughput
- // cost and latency.
- //
- // If you query or scan a global secondary index, you can only request attributes
- // that are projected into the index. Global secondary index queries cannot
- // fetch attributes from the parent table.
+ // specifying any value for Select. If you query or scan a local secondary
+ // index and request only attributes that are projected into that index,
+ // the operation will read only the index and not the table. If any of the
+ // requested attributes are not projected into the local secondary index,
+ // DynamoDB fetches each of these attributes from the parent table. This
+ // extra fetching incurs additional throughput cost and latency. If you query
+ // or scan a global secondary index, you can only request attributes that
+ // are projected into the index. Global secondary index queries cannot fetch
+ // attributes from the parent table.
//
// If neither Select nor AttributesToGet are specified, DynamoDB defaults to
// ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when
@@ -9589,8 +12140,8 @@ type QueryOutput struct {
// The capacity units consumed by the Query operation. The data returned includes
// the total provisioned throughput consumed, along with statistics for the
// table and any indexes involved in the operation. ConsumedCapacity is only
- // returned if the ReturnConsumedCapacity parameter was specified For more information,
- // see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // returned if the ReturnConsumedCapacity parameter was specified. For more
+ // information, see Provisioned Throughput (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -9622,7 +12173,7 @@ type QueryOutput struct {
// The number of items evaluated, before any QueryFilter is applied. A high
// ScannedCount value with few, or no, Count results indicates an inefficient
- // Query operation. For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
+ // Query operation. For more information, see Count and ScannedCount (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
// in the Amazon DynamoDB Developer Guide.
//
// If you did not use a filter in the request, then ScannedCount is the same
@@ -9739,10 +12290,18 @@ type ReplicaGlobalSecondaryIndexSettingsDescription struct {
// * ACTIVE - The global secondary index is ready for use.
IndexStatus *string `type:"string" enum:"IndexStatus"`
+ // Autoscaling settings for a global secondary index replica's read capacity
+ // units.
+ ProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"`
+
// The maximum number of strongly consistent reads consumed per second before
// DynamoDB returns a ThrottlingException.
ProvisionedReadCapacityUnits *int64 `min:"1" type:"long"`
+ // AutoScaling settings for a global secondary index replica's write capacity
+ // units.
+ ProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"`
+
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException.
ProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"`
@@ -9770,12 +12329,24 @@ func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetIndexStatus(v string
return s
}
+// SetProvisionedReadCapacityAutoScalingSettings sets the ProvisionedReadCapacityAutoScalingSettings field's value.
+func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedReadCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaGlobalSecondaryIndexSettingsDescription {
+ s.ProvisionedReadCapacityAutoScalingSettings = v
+ return s
+}
+
// SetProvisionedReadCapacityUnits sets the ProvisionedReadCapacityUnits field's value.
func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedReadCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsDescription {
s.ProvisionedReadCapacityUnits = &v
return s
}
+// SetProvisionedWriteCapacityAutoScalingSettings sets the ProvisionedWriteCapacityAutoScalingSettings field's value.
+func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedWriteCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaGlobalSecondaryIndexSettingsDescription {
+ s.ProvisionedWriteCapacityAutoScalingSettings = v
+ return s
+}
+
// SetProvisionedWriteCapacityUnits sets the ProvisionedWriteCapacityUnits field's value.
func (s *ReplicaGlobalSecondaryIndexSettingsDescription) SetProvisionedWriteCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsDescription {
s.ProvisionedWriteCapacityUnits = &v
@@ -9793,6 +12364,10 @@ type ReplicaGlobalSecondaryIndexSettingsUpdate struct {
// IndexName is a required field
IndexName *string `min:"3" type:"string" required:"true"`
+ // Autoscaling settings for managing a global secondary index replica's read
+ // capacity units.
+ ProvisionedReadCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"`
+
// The maximum number of strongly consistent reads consumed per second before
// DynamoDB returns a ThrottlingException.
ProvisionedReadCapacityUnits *int64 `min:"1" type:"long"`
@@ -9820,6 +12395,11 @@ func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) Validate() error {
if s.ProvisionedReadCapacityUnits != nil && *s.ProvisionedReadCapacityUnits < 1 {
invalidParams.Add(request.NewErrParamMinValue("ProvisionedReadCapacityUnits", 1))
}
+ if s.ProvisionedReadCapacityAutoScalingSettingsUpdate != nil {
+ if err := s.ProvisionedReadCapacityAutoScalingSettingsUpdate.Validate(); err != nil {
+ invalidParams.AddNested("ProvisionedReadCapacityAutoScalingSettingsUpdate", err.(request.ErrInvalidParams))
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9833,6 +12413,12 @@ func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetIndexName(v string) *Repl
return s
}
+// SetProvisionedReadCapacityAutoScalingSettingsUpdate sets the ProvisionedReadCapacityAutoScalingSettingsUpdate field's value.
+func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetProvisionedReadCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *ReplicaGlobalSecondaryIndexSettingsUpdate {
+ s.ProvisionedReadCapacityAutoScalingSettingsUpdate = v
+ return s
+}
+
// SetProvisionedReadCapacityUnits sets the ProvisionedReadCapacityUnits field's value.
func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetProvisionedReadCapacityUnits(v int64) *ReplicaGlobalSecondaryIndexSettingsUpdate {
s.ProvisionedReadCapacityUnits = &v
@@ -9848,20 +12434,29 @@ type ReplicaSettingsDescription struct {
// RegionName is a required field
RegionName *string `type:"string" required:"true"`
+ // The read/write capacity mode of the replica.
+ ReplicaBillingModeSummary *BillingModeSummary `type:"structure"`
+
// Replica global secondary index settings for the global table.
ReplicaGlobalSecondaryIndexSettings []*ReplicaGlobalSecondaryIndexSettingsDescription `type:"list"`
+ // Autoscaling settings for a global table replica's read capacity units.
+ ReplicaProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"`
+
// The maximum number of strongly consistent reads consumed per second before
// DynamoDB returns a ThrottlingException. For more information, see Specifying
- // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
+ // Read and Write Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
// in the Amazon DynamoDB Developer Guide.
- ReplicaProvisionedReadCapacityUnits *int64 `min:"1" type:"long"`
+ ReplicaProvisionedReadCapacityUnits *int64 `type:"long"`
+
+ // AutoScaling settings for a global table replica's write capacity units.
+ ReplicaProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"`
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException. For more information, see Specifying Read and Write
- // Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
+ // Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
// in the Amazon DynamoDB Developer Guide.
- ReplicaProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"`
+ ReplicaProvisionedWriteCapacityUnits *int64 `type:"long"`
// The current state of the region:
//
@@ -9891,18 +12486,36 @@ func (s *ReplicaSettingsDescription) SetRegionName(v string) *ReplicaSettingsDes
return s
}
+// SetReplicaBillingModeSummary sets the ReplicaBillingModeSummary field's value.
+func (s *ReplicaSettingsDescription) SetReplicaBillingModeSummary(v *BillingModeSummary) *ReplicaSettingsDescription {
+ s.ReplicaBillingModeSummary = v
+ return s
+}
+
// SetReplicaGlobalSecondaryIndexSettings sets the ReplicaGlobalSecondaryIndexSettings field's value.
func (s *ReplicaSettingsDescription) SetReplicaGlobalSecondaryIndexSettings(v []*ReplicaGlobalSecondaryIndexSettingsDescription) *ReplicaSettingsDescription {
s.ReplicaGlobalSecondaryIndexSettings = v
return s
}
+// SetReplicaProvisionedReadCapacityAutoScalingSettings sets the ReplicaProvisionedReadCapacityAutoScalingSettings field's value.
+func (s *ReplicaSettingsDescription) SetReplicaProvisionedReadCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaSettingsDescription {
+ s.ReplicaProvisionedReadCapacityAutoScalingSettings = v
+ return s
+}
+
// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value.
func (s *ReplicaSettingsDescription) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsDescription {
s.ReplicaProvisionedReadCapacityUnits = &v
return s
}
+// SetReplicaProvisionedWriteCapacityAutoScalingSettings sets the ReplicaProvisionedWriteCapacityAutoScalingSettings field's value.
+func (s *ReplicaSettingsDescription) SetReplicaProvisionedWriteCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaSettingsDescription {
+ s.ReplicaProvisionedWriteCapacityAutoScalingSettings = v
+ return s
+}
+
// SetReplicaProvisionedWriteCapacityUnits sets the ReplicaProvisionedWriteCapacityUnits field's value.
func (s *ReplicaSettingsDescription) SetReplicaProvisionedWriteCapacityUnits(v int64) *ReplicaSettingsDescription {
s.ReplicaProvisionedWriteCapacityUnits = &v
@@ -9928,9 +12541,13 @@ type ReplicaSettingsUpdate struct {
// will be modified.
ReplicaGlobalSecondaryIndexSettingsUpdate []*ReplicaGlobalSecondaryIndexSettingsUpdate `min:"1" type:"list"`
+ // Autoscaling settings for managing a global table replica's read capacity
+ // units.
+ ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"`
+
// The maximum number of strongly consistent reads consumed per second before
// DynamoDB returns a ThrottlingException. For more information, see Specifying
- // Read and Write Requirements (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
+ // Read and Write Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput)
// in the Amazon DynamoDB Developer Guide.
ReplicaProvisionedReadCapacityUnits *int64 `min:"1" type:"long"`
}
@@ -9967,6 +12584,11 @@ func (s *ReplicaSettingsUpdate) Validate() error {
}
}
}
+ if s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate != nil {
+ if err := s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate.Validate(); err != nil {
+ invalidParams.AddNested("ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate", err.(request.ErrInvalidParams))
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9986,6 +12608,12 @@ func (s *ReplicaSettingsUpdate) SetReplicaGlobalSecondaryIndexSettingsUpdate(v [
return s
}
+// SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate sets the ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate field's value.
+func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *ReplicaSettingsUpdate {
+ s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = v
+ return s
+}
+
// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value.
func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsUpdate {
s.ReplicaProvisionedReadCapacityUnits = &v
@@ -10058,7 +12686,7 @@ type RestoreSummary struct {
// Point in time or source backup time.
//
// RestoreDateTime is a required field
- RestoreDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
+ RestoreDateTime *time.Time `type:"timestamp" required:"true"`
// Indicates if a restore is in progress or not.
//
@@ -10109,7 +12737,7 @@ func (s *RestoreSummary) SetSourceTableArn(v string) *RestoreSummary {
type RestoreTableFromBackupInput struct {
_ struct{} `type:"structure"`
- // The ARN associated with the backup.
+ // The Amazon Resource Name (ARN) associated with the backup.
//
// BackupArn is a required field
BackupArn *string `min:"37" type:"string" required:"true"`
@@ -10191,7 +12819,7 @@ type RestoreTableToPointInTimeInput struct {
_ struct{} `type:"structure"`
// Time in the past to restore the table to.
- RestoreDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ RestoreDateTime *time.Time `type:"timestamp"`
// Name of the source table that is being restored.
//
@@ -10291,15 +12919,21 @@ func (s *RestoreTableToPointInTimeOutput) SetTableDescription(v *TableDescriptio
type SSEDescription struct {
_ struct{} `type:"structure"`
- // The current state of server-side encryption:
+ // The KMS customer master key (CMK) ARN used for the KMS encryption.
+ KMSMasterKeyArn *string `type:"string"`
+
+ // Server-side encryption type. The only supported value is:
//
- // * ENABLING - Server-side encryption is being enabled.
+ // * KMS - Server-side encryption which uses AWS Key Management Service.
+ // Key is stored in your account and is managed by AWS KMS (KMS charges apply).
+ SSEType *string `type:"string" enum:"SSEType"`
+
+ // Represents the current state of server-side encryption. The only supported
+ // values are:
//
// * ENABLED - Server-side encryption is enabled.
//
- // * DISABLING - Server-side encryption is being disabled.
- //
- // * DISABLED - Server-side encryption is disabled.
+ // * UPDATING - Server-side encryption is being updated.
Status *string `type:"string" enum:"SSEStatus"`
}
@@ -10313,6 +12947,18 @@ func (s SSEDescription) GoString() string {
return s.String()
}
+// SetKMSMasterKeyArn sets the KMSMasterKeyArn field's value.
+func (s *SSEDescription) SetKMSMasterKeyArn(v string) *SSEDescription {
+ s.KMSMasterKeyArn = &v
+ return s
+}
+
+// SetSSEType sets the SSEType field's value.
+func (s *SSEDescription) SetSSEType(v string) *SSEDescription {
+ s.SSEType = &v
+ return s
+}
+
// SetStatus sets the Status field's value.
func (s *SSEDescription) SetStatus(v string) *SSEDescription {
s.Status = &v
@@ -10323,11 +12969,23 @@ func (s *SSEDescription) SetStatus(v string) *SSEDescription {
type SSESpecification struct {
_ struct{} `type:"structure"`
- // Indicates whether server-side encryption is enabled (true) or disabled (false)
- // on the table.
+ // Indicates whether server-side encryption is done using an AWS managed CMK
+ // or an AWS owned CMK. If enabled (true), server-side encryption type is set
+ // to KMS and an AWS managed CMK is used (AWS KMS charges apply). If disabled
+ // (false) or not specified, server-side encryption is set to AWS owned CMK.
+ Enabled *bool `type:"boolean"`
+
+ // The KMS Customer Master Key (CMK) which should be used for the KMS encryption.
+ // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
+ // or alias ARN. Note that you should only provide this parameter if the key
+ // is different from the default DynamoDB Customer Master Key alias/aws/dynamodb.
+ KMSMasterKeyId *string `type:"string"`
+
+ // Server-side encryption type. The only supported value is:
//
- // Enabled is a required field
- Enabled *bool `type:"boolean" required:"true"`
+ // * KMS - Server-side encryption which uses AWS Key Management Service.
+ // Key is stored in your account and is managed by AWS KMS (KMS charges apply).
+ SSEType *string `type:"string" enum:"SSEType"`
}
// String returns the string representation
@@ -10340,36 +12998,35 @@ func (s SSESpecification) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *SSESpecification) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "SSESpecification"}
- if s.Enabled == nil {
- invalidParams.Add(request.NewErrParamRequired("Enabled"))
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetEnabled sets the Enabled field's value.
func (s *SSESpecification) SetEnabled(v bool) *SSESpecification {
s.Enabled = &v
return s
}
+// SetKMSMasterKeyId sets the KMSMasterKeyId field's value.
+func (s *SSESpecification) SetKMSMasterKeyId(v string) *SSESpecification {
+ s.KMSMasterKeyId = &v
+ return s
+}
+
+// SetSSEType sets the SSEType field's value.
+func (s *SSESpecification) SetSSEType(v string) *SSESpecification {
+ s.SSEType = &v
+ return s
+}
+
// Represents the input of a Scan operation.
type ScanInput struct {
_ struct{} `type:"structure"`
// This is a legacy parameter. Use ProjectionExpression instead. For more information,
- // see AttributesToGet (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
+ // see AttributesToGet (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html)
// in the Amazon DynamoDB Developer Guide.
AttributesToGet []*string `min:"1" type:"list"`
// This is a legacy parameter. Use FilterExpression instead. For more information,
- // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
+ // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
@@ -10377,7 +13034,7 @@ type ScanInput struct {
//
// * If ConsistentRead is false, then the data returned from Scan might not
// contain the results from other recently completed write operations (PutItem,
- // UpdateItem or DeleteItem).
+ // UpdateItem, or DeleteItem).
//
// * If ConsistentRead is true, then all of the write operations that completed
// before the Scan began are guaranteed to be contained in the Scan response.
@@ -10419,7 +13076,7 @@ type ScanInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
// in the Amazon DynamoDB Developer Guide). To work around this, you could specify
// the following for ExpressionAttributeNames:
//
@@ -10432,8 +13089,8 @@ type ScanInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information on expression attribute names, see Specifying Item Attributes
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -10454,8 +13111,8 @@ type ScanInput struct {
//
// ProductStatus IN (:avail, :back, :disc)
//
- // For more information on expression attribute values, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information on expression attribute values, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
@@ -10466,7 +13123,7 @@ type ScanInput struct {
// A FilterExpression is applied after the items have already been read; the
// process of filtering does not consume any additional read capacity units.
//
- // For more information, see Filter Expressions (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
+ // For more information, see Filter Expressions (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults)
// in the Amazon DynamoDB Developer Guide.
FilterExpression *string `type:"string"`
@@ -10479,11 +13136,11 @@ type ScanInput struct {
// items). If DynamoDB processes the number of items up to the limit while processing
// the results, it stops the operation and returns the matching values up to
// that point, and a key in LastEvaluatedKey to apply in a subsequent operation,
- // so that you can pick up where you left off. Also, if the processed data set
+ // so that you can pick up where you left off. Also, if the processed dataset
// size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation
// and returns the matching values up to the limit, and a key in LastEvaluatedKey
// to apply in a subsequent operation to continue the operation. For more information,
- // see Query and Scan (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
+ // see Working with Queries (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html)
// in the Amazon DynamoDB Developer Guide.
Limit *int64 `min:"1" type:"integer"`
@@ -10495,7 +13152,7 @@ type ScanInput struct {
// If any of the requested attributes are not found, they will not appear in
// the result.
//
- // For more information, see Accessing Item Attributes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information, see Specifying Item Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ProjectionExpression *string `type:"string"`
@@ -10504,11 +13161,9 @@ type ScanInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -10517,7 +13172,7 @@ type ScanInput struct {
ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
// This is a legacy parameter. Use FilterExpression instead. For more information,
- // see ScanFilter (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html)
+ // see ScanFilter (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html)
// in the Amazon DynamoDB Developer Guide.
ScanFilter map[string]*Condition `type:"map"`
@@ -10545,10 +13200,10 @@ type ScanInput struct {
//
// * ALL_ATTRIBUTES - Returns all of the item attributes from the specified
// table or index. If you query a local secondary index, then for each matching
- // item in the index DynamoDB will fetch the entire item from the parent
- // table. If the index is configured to project all item attributes, then
- // all of the data can be obtained from the local secondary index, and no
- // fetching is required.
+ // item in the index, DynamoDB fetches the entire item from the parent table.
+ // If the index is configured to project all item attributes, then all of
+ // the data can be obtained from the local secondary index, and no fetching
+ // is required.
//
// * ALL_PROJECTED_ATTRIBUTES - Allowed only when querying an index. Retrieves
// all attributes that have been projected into the index. If the index is
@@ -10560,18 +13215,15 @@ type ScanInput struct {
//
// * SPECIFIC_ATTRIBUTES - Returns only the attributes listed in AttributesToGet.
// This return value is equivalent to specifying AttributesToGet without
- // specifying any value for Select.
- //
- // If you query or scan a local secondary index and request only attributes
- // that are projected into that index, the operation will read only the index
- // and not the table. If any of the requested attributes are not projected
- // into the local secondary index, DynamoDB will fetch each of these attributes
- // from the parent table. This extra fetching incurs additional throughput
- // cost and latency.
- //
- // If you query or scan a global secondary index, you can only request attributes
- // that are projected into the index. Global secondary index queries cannot
- // fetch attributes from the parent table.
+ // specifying any value for Select. If you query or scan a local secondary
+ // index and request only attributes that are projected into that index,
+ // the operation reads only the index and not the table. If any of the requested
+ // attributes are not projected into the local secondary index, DynamoDB
+ // fetches each of these attributes from the parent table. This extra fetching
+ // incurs additional throughput cost and latency. If you query or scan a
+ // global secondary index, you can only request attributes that are projected
+ // into the index. Global secondary index queries cannot fetch attributes
+ // from the parent table.
//
// If neither Select nor AttributesToGet are specified, DynamoDB defaults to
// ALL_ATTRIBUTES when accessing a table, and ALL_PROJECTED_ATTRIBUTES when
@@ -10757,7 +13409,7 @@ type ScanOutput struct {
// the total provisioned throughput consumed, along with statistics for the
// table and any indexes involved in the operation. ConsumedCapacity is only
// returned if the ReturnConsumedCapacity parameter was specified. For more
- // information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // information, see Provisioned Throughput (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -10788,7 +13440,7 @@ type ScanOutput struct {
// The number of items evaluated, before any ScanFilter is applied. A high ScannedCount
// value with few, or no, Count results indicates an inefficient Scan operation.
- // For more information, see Count and ScannedCount (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
+ // For more information, see Count and ScannedCount (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count)
// in the Amazon DynamoDB Developer Guide.
//
// If you did not use a filter in the request, then ScannedCount is the same
@@ -10840,6 +13492,16 @@ func (s *ScanOutput) SetScannedCount(v int64) *ScanOutput {
type SourceTableDetails struct {
_ struct{} `type:"structure"`
+ // Controls how you are charged for read and write throughput and how you manage
+ // capacity. This setting can be changed later.
+ //
+ // * PROVISIONED - Sets the read/write capacity mode to PROVISIONED. We recommend
+ // using PROVISIONED for predictable workloads.
+ //
+ // * PAY_PER_REQUEST - Sets the read/write capacity mode to PAY_PER_REQUEST.
+ // We recommend using PAY_PER_REQUEST for unpredictable workloads.
+ BillingMode *string `type:"string" enum:"BillingMode"`
+
// Number of items in the table. Please note this is an approximate value.
ItemCount *int64 `type:"long"`
@@ -10859,7 +13521,7 @@ type SourceTableDetails struct {
// Time when the source table was created.
//
// TableCreationDateTime is a required field
- TableCreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
+ TableCreationDateTime *time.Time `type:"timestamp" required:"true"`
// Unique identifier for the table for which the backup was created.
//
@@ -10885,6 +13547,12 @@ func (s SourceTableDetails) GoString() string {
return s.String()
}
+// SetBillingMode sets the BillingMode field's value.
+func (s *SourceTableDetails) SetBillingMode(v string) *SourceTableDetails {
+ s.BillingMode = &v
+ return s
+}
+
// SetItemCount sets the ItemCount field's value.
func (s *SourceTableDetails) SetItemCount(v int64) *SourceTableDetails {
s.ItemCount = &v
@@ -11061,9 +13729,12 @@ type TableDescription struct {
// * AttributeType - The data type for the attribute.
AttributeDefinitions []*AttributeDefinition `type:"list"`
+ // Contains the details for the read/write capacity mode.
+ BillingModeSummary *BillingModeSummary `type:"structure"`
+
// The date and time when the table was created, in UNIX epoch time (http://www.epochconverter.com/)
// format.
- CreationDateTime *time.Time `type:"timestamp" timestampFormat:"unix"`
+ CreationDateTime *time.Time `type:"timestamp"`
// The global secondary indexes, if any, on the table. Each index is scoped
// to a given partition key value. Each element is composed of:
@@ -11080,15 +13751,9 @@ type TableDescription struct {
// DynamoDB updates this value approximately every six hours. Recent changes
// might not be reflected in this value.
//
- // * IndexStatus - The current status of the global secondary index:
- //
- // CREATING - The index is being created.
- //
- // UPDATING - The index is being updated.
- //
- // DELETING - The index is being deleted.
- //
- // ACTIVE - The index is ready for use.
+ // * IndexStatus - The current status of the global secondary index: CREATING
+ // - The index is being created. UPDATING - The index is being updated. DELETING
+ // - The index is being deleted. ACTIVE - The index is ready for use.
//
// * ItemCount - The number of items in the global secondary index. DynamoDB
// updates this value approximately every six hours. Recent changes might
@@ -11101,22 +13766,16 @@ type TableDescription struct {
// * Projection - Specifies attributes that are copied (projected) from the
// table into the index. These are in addition to the primary key attributes
// and index key attributes, which are automatically projected. Each attribute
- // specification is composed of:
- //
- // ProjectionType - One of the following:
- //
- // KEYS_ONLY - Only the index and primary keys are projected into the index.
- //
- // INCLUDE - Only the specified table attributes are projected into the index.
- // The list of projected attributes are in NonKeyAttributes.
- //
- // ALL - All of the table attributes are projected into the index.
- //
- // NonKeyAttributes - A list of one or more non-key attribute names that are
- // projected into the secondary index. The total count of attributes provided
- // in NonKeyAttributes, summed across all of the secondary indexes, must
- // not exceed 20. If you project the same attribute into two different indexes,
- // this counts as two distinct attributes when determining the total.
+ // specification is composed of: ProjectionType - One of the following: KEYS_ONLY
+ // - Only the index and primary keys are projected into the index. INCLUDE
+ // - Only the specified table attributes are projected into the index. The
+ // list of projected attributes are in NonKeyAttributes. ALL - All of the
+ // table attributes are projected into the index. NonKeyAttributes - A list
+ // of one or more non-key attribute names that are projected into the secondary
+ // index. The total count of attributes provided in NonKeyAttributes, summed
+ // across all of the secondary indexes, must not exceed 20. If you project
+ // the same attribute into two different indexes, this counts as two distinct
+ // attributes when determining the total.
//
// * ProvisionedThroughput - The provisioned throughput settings for the
// global secondary index, consisting of read and write capacity units, along
@@ -11134,22 +13793,16 @@ type TableDescription struct {
//
// * AttributeName - The name of the attribute.
//
- // * KeyType - The role of the attribute:
+ // * KeyType - The role of the attribute: HASH - partition key RANGE - sort
+ // key The partition key of an item is also known as its hash attribute.
+ // The term "hash attribute" derives from DynamoDB's usage of an internal
+ // hash function to evenly distribute data items across partitions, based
+ // on their partition key values. The sort key of an item is also known as
+ // its range attribute. The term "range attribute" derives from the way DynamoDB
+ // stores items with the same partition key physically close together, in
+ // sorted order by the sort key value.
//
- // HASH - partition key
- //
- // RANGE - sort key
- //
- // The partition key of an item is also known as its hash attribute. The term
- // "hash attribute" derives from DynamoDB' usage of an internal hash function
- // to evenly distribute data items across partitions, based on their partition
- // key values.
- //
- // The sort key of an item is also known as its range attribute. The term "range
- // attribute" derives from the way DynamoDB stores items with the same partition
- // key physically close together, in sorted order by the sort key value.
- //
- // For more information about primary keys, see Primary Key (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey)
+ // For more information about primary keys, see Primary Key (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey)
// in the Amazon DynamoDB Developer Guide.
KeySchema []*KeySchemaElement `min:"1" type:"list"`
@@ -11186,22 +13839,16 @@ type TableDescription struct {
// * Projection - Specifies attributes that are copied (projected) from the
// table into the index. These are in addition to the primary key attributes
// and index key attributes, which are automatically projected. Each attribute
- // specification is composed of:
- //
- // ProjectionType - One of the following:
- //
- // KEYS_ONLY - Only the index and primary keys are projected into the index.
- //
- // INCLUDE - Only the specified table attributes are projected into the index.
- // The list of projected attributes are in NonKeyAttributes.
- //
- // ALL - All of the table attributes are projected into the index.
- //
- // NonKeyAttributes - A list of one or more non-key attribute names that are
- // projected into the secondary index. The total count of attributes provided
- // in NonKeyAttributes, summed across all of the secondary indexes, must
- // not exceed 20. If you project the same attribute into two different indexes,
- // this counts as two distinct attributes when determining the total.
+ // specification is composed of: ProjectionType - One of the following: KEYS_ONLY
+ // - Only the index and primary keys are projected into the index. INCLUDE
+ // - Only the specified table attributes are projected into the index. The
+ // list of projected attributes are in NonKeyAttributes. ALL - All of the
+ // table attributes are projected into the index. NonKeyAttributes - A list
+ // of one or more non-key attribute names that are projected into the secondary
+ // index. The total count of attributes provided in NonKeyAttributes, summed
+ // across all of the secondary indexes, must not exceed 20. If you project
+ // the same attribute into two different indexes, this counts as two distinct
+ // attributes when determining the total.
//
// * IndexSizeBytes - Represents the total size of the index, in bytes. DynamoDB
// updates this value approximately every six hours. Recent changes might
@@ -11270,6 +13917,12 @@ func (s *TableDescription) SetAttributeDefinitions(v []*AttributeDefinition) *Ta
return s
}
+// SetBillingModeSummary sets the BillingModeSummary field's value.
+func (s *TableDescription) SetBillingModeSummary(v *BillingModeSummary) *TableDescription {
+ s.BillingModeSummary = v
+ return s
+}
+
// SetCreationDateTime sets the CreationDateTime field's value.
func (s *TableDescription) SetCreationDateTime(v time.Time) *TableDescription {
s.CreationDateTime = &v
@@ -11374,14 +14027,14 @@ func (s *TableDescription) SetTableStatus(v string) *TableDescription {
// the tag limit of 50. User-assigned tag names have the prefix user: in the
// Cost Allocation Report. You cannot backdate the application of a tag.
//
-// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
+// For an overview on tagging DynamoDB resources, see Tagging for DynamoDB (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html)
// in the Amazon DynamoDB Developer Guide.
type Tag struct {
_ struct{} `type:"structure"`
- // The key of the tag.Tag keys are case sensitive. Each DynamoDB table can only
- // have up to one tag with the same key. If you try to add an existing tag (same
- // key), the existing tag value will be updated to the new value.
+ // The key of the tag. Tag keys are case sensitive. Each DynamoDB table can
+ // only have up to one tag with the same key. If you try to add an existing
+ // tag (same key), the existing tag value will be updated to the new value.
//
// Key is a required field
Key *string `min:"1" type:"string" required:"true"`
@@ -11517,10 +14170,10 @@ func (s TagResourceOutput) GoString() string {
type TimeToLiveDescription struct {
_ struct{} `type:"structure"`
- // The name of the Time to Live attribute for items in the table.
+ // The name of the TTL attribute for items in the table.
AttributeName *string `min:"1" type:"string"`
- // The Time to Live status for the table.
+ // The TTL status for the table.
TimeToLiveStatus *string `type:"string" enum:"TimeToLiveStatus"`
}
@@ -11546,19 +14199,19 @@ func (s *TimeToLiveDescription) SetTimeToLiveStatus(v string) *TimeToLiveDescrip
return s
}
-// Represents the settings used to enable or disable Time to Live for the specified
-// table.
+// Represents the settings used to enable or disable Time to Live (TTL) for
+// the specified table.
type TimeToLiveSpecification struct {
_ struct{} `type:"structure"`
- // The name of the Time to Live attribute used to store the expiration time
- // for items in the table.
+ // The name of the TTL attribute used to store the expiration time for items
+ // in the table.
//
// AttributeName is a required field
AttributeName *string `min:"1" type:"string" required:"true"`
- // Indicates whether Time To Live is to be enabled (true) or disabled (false)
- // on the table.
+ // Indicates whether TTL is to be enabled (true) or disabled (false) on the
+ // table.
//
// Enabled is a required field
Enabled *bool `type:"boolean" required:"true"`
@@ -11605,17 +14258,405 @@ func (s *TimeToLiveSpecification) SetEnabled(v bool) *TimeToLiveSpecification {
return s
}
+// Specifies an item to be retrieved as part of the transaction.
+type TransactGetItem struct {
+ _ struct{} `type:"structure"`
+
+ // Contains the primary key that identifies the item to get, together with the
+ // name of the table that contains the item, and optionally the specific attributes
+ // of the item to retrieve.
+ //
+ // Get is a required field
+ Get *Get `type:"structure" required:"true"`
+}
+
+// String returns the string representation
+func (s TransactGetItem) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactGetItem) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TransactGetItem) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TransactGetItem"}
+ if s.Get == nil {
+ invalidParams.Add(request.NewErrParamRequired("Get"))
+ }
+ if s.Get != nil {
+ if err := s.Get.Validate(); err != nil {
+ invalidParams.AddNested("Get", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetGet sets the Get field's value.
+func (s *TransactGetItem) SetGet(v *Get) *TransactGetItem {
+ s.Get = v
+ return s
+}
+
+type TransactGetItemsInput struct {
+ _ struct{} `type:"structure"`
+
+ // A value of TOTAL causes consumed capacity information to be returned, and
+ // a value of NONE prevents that information from being returned. No other value
+ // is valid.
+ ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
+
+ // An ordered array of up to 25 TransactGetItem objects, each of which contains
+ // a Get structure.
+ //
+ // TransactItems is a required field
+ TransactItems []*TransactGetItem `min:"1" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s TransactGetItemsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactGetItemsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TransactGetItemsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TransactGetItemsInput"}
+ if s.TransactItems == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransactItems"))
+ }
+ if s.TransactItems != nil && len(s.TransactItems) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("TransactItems", 1))
+ }
+ if s.TransactItems != nil {
+ for i, v := range s.TransactItems {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TransactItems", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value.
+func (s *TransactGetItemsInput) SetReturnConsumedCapacity(v string) *TransactGetItemsInput {
+ s.ReturnConsumedCapacity = &v
+ return s
+}
+
+// SetTransactItems sets the TransactItems field's value.
+func (s *TransactGetItemsInput) SetTransactItems(v []*TransactGetItem) *TransactGetItemsInput {
+ s.TransactItems = v
+ return s
+}
+
+type TransactGetItemsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // If the ReturnConsumedCapacity value was TOTAL, this is an array of ConsumedCapacity
+ // objects, one for each table addressed by TransactGetItem objects in the TransactItems
+ // parameter. These ConsumedCapacity objects report the read-capacity units
+ // consumed by the TransactGetItems call in that table.
+ ConsumedCapacity []*ConsumedCapacity `type:"list"`
+
+ // An ordered array of up to 25 ItemResponse objects, each of which corresponds
+ // to the TransactGetItem object in the same position in the TransactItems array.
+ // Each ItemResponse object contains a Map of the name-value pairs that are
+ // the projected attributes of the requested item.
+ //
+ // If a requested item could not be retrieved, the corresponding ItemResponse
+ // object is Null, or if the requested item has no projected attributes, the
+ // corresponding ItemResponse object is an empty Map.
+ Responses []*ItemResponse `min:"1" type:"list"`
+}
+
+// String returns the string representation
+func (s TransactGetItemsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactGetItemsOutput) GoString() string {
+ return s.String()
+}
+
+// SetConsumedCapacity sets the ConsumedCapacity field's value.
+func (s *TransactGetItemsOutput) SetConsumedCapacity(v []*ConsumedCapacity) *TransactGetItemsOutput {
+ s.ConsumedCapacity = v
+ return s
+}
+
+// SetResponses sets the Responses field's value.
+func (s *TransactGetItemsOutput) SetResponses(v []*ItemResponse) *TransactGetItemsOutput {
+ s.Responses = v
+ return s
+}
+
+// A list of requests that can perform update, put, delete, or check operations
+// on multiple items in one or more tables atomically.
+type TransactWriteItem struct {
+ _ struct{} `type:"structure"`
+
+ // A request to perform a check item operation.
+ ConditionCheck *ConditionCheck `type:"structure"`
+
+ // A request to perform a DeleteItem operation.
+ Delete *Delete `type:"structure"`
+
+ // A request to perform a PutItem operation.
+ Put *Put `type:"structure"`
+
+ // A request to perform an UpdateItem operation.
+ Update *Update `type:"structure"`
+}
+
+// String returns the string representation
+func (s TransactWriteItem) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactWriteItem) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TransactWriteItem) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TransactWriteItem"}
+ if s.ConditionCheck != nil {
+ if err := s.ConditionCheck.Validate(); err != nil {
+ invalidParams.AddNested("ConditionCheck", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Delete != nil {
+ if err := s.Delete.Validate(); err != nil {
+ invalidParams.AddNested("Delete", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Put != nil {
+ if err := s.Put.Validate(); err != nil {
+ invalidParams.AddNested("Put", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Update != nil {
+ if err := s.Update.Validate(); err != nil {
+ invalidParams.AddNested("Update", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetConditionCheck sets the ConditionCheck field's value.
+func (s *TransactWriteItem) SetConditionCheck(v *ConditionCheck) *TransactWriteItem {
+ s.ConditionCheck = v
+ return s
+}
+
+// SetDelete sets the Delete field's value.
+func (s *TransactWriteItem) SetDelete(v *Delete) *TransactWriteItem {
+ s.Delete = v
+ return s
+}
+
+// SetPut sets the Put field's value.
+func (s *TransactWriteItem) SetPut(v *Put) *TransactWriteItem {
+ s.Put = v
+ return s
+}
+
+// SetUpdate sets the Update field's value.
+func (s *TransactWriteItem) SetUpdate(v *Update) *TransactWriteItem {
+ s.Update = v
+ return s
+}
+
+type TransactWriteItemsInput struct {
+ _ struct{} `type:"structure"`
+
+ // Providing a ClientRequestToken makes the call to TransactWriteItems idempotent,
+ // meaning that multiple identical calls have the same effect as one single
+ // call.
+ //
+ // Although multiple identical calls using the same client request token produce
+ // the same result on the server (no side effects), the responses to the calls
+ // might not be the same. If the ReturnConsumedCapacity> parameter is set, then
+ // the initial TransactWriteItems call returns the amount of write capacity
+ // units consumed in making the changes. Subsequent TransactWriteItems calls
+ // with the same client token return the number of read capacity units consumed
+ // in reading the item.
+ //
+ // A client request token is valid for 10 minutes after the first request that
+ // uses it is completed. After 10 minutes, any request with the same client
+ // token is treated as a new request. Do not resubmit the same request with
+ // the same client token for more than 10 minutes, or the result might not be
+ // idempotent.
+ //
+ // If you submit a request with the same client token but a change in other
+ // parameters within the 10-minute idempotency window, DynamoDB returns an IdempotentParameterMismatch
+ // exception.
+ ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"`
+
+ // Determines the level of detail about provisioned throughput consumption that
+ // is returned in the response:
+ //
+ // * INDEXES - The response includes the aggregate ConsumedCapacity for the
+ // operation, together with ConsumedCapacity for each table and secondary
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
+ //
+ // * TOTAL - The response includes only the aggregate ConsumedCapacity for
+ // the operation.
+ //
+ // * NONE - No ConsumedCapacity details are included in the response.
+ ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"`
+
+ // Determines whether item collection metrics are returned. If set to SIZE,
+ // the response includes statistics about item collections (if any), that were
+ // modified during the operation and are returned in the response. If set to
+ // NONE (the default), no statistics are returned.
+ ReturnItemCollectionMetrics *string `type:"string" enum:"ReturnItemCollectionMetrics"`
+
+ // An ordered array of up to 25 TransactWriteItem objects, each of which contains
+ // a ConditionCheck, Put, Update, or Delete object. These can operate on items
+ // in different tables, but the tables must reside in the same AWS account and
+ // Region, and no two of them can operate on the same item.
+ //
+ // TransactItems is a required field
+ TransactItems []*TransactWriteItem `min:"1" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s TransactWriteItemsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactWriteItemsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TransactWriteItemsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TransactWriteItemsInput"}
+ if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1))
+ }
+ if s.TransactItems == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransactItems"))
+ }
+ if s.TransactItems != nil && len(s.TransactItems) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("TransactItems", 1))
+ }
+ if s.TransactItems != nil {
+ for i, v := range s.TransactItems {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TransactItems", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientRequestToken sets the ClientRequestToken field's value.
+func (s *TransactWriteItemsInput) SetClientRequestToken(v string) *TransactWriteItemsInput {
+ s.ClientRequestToken = &v
+ return s
+}
+
+// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value.
+func (s *TransactWriteItemsInput) SetReturnConsumedCapacity(v string) *TransactWriteItemsInput {
+ s.ReturnConsumedCapacity = &v
+ return s
+}
+
+// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value.
+func (s *TransactWriteItemsInput) SetReturnItemCollectionMetrics(v string) *TransactWriteItemsInput {
+ s.ReturnItemCollectionMetrics = &v
+ return s
+}
+
+// SetTransactItems sets the TransactItems field's value.
+func (s *TransactWriteItemsInput) SetTransactItems(v []*TransactWriteItem) *TransactWriteItemsInput {
+ s.TransactItems = v
+ return s
+}
+
+type TransactWriteItemsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The capacity units consumed by the entire TransactWriteItems operation. The
+ // values of the list are ordered according to the ordering of the TransactItems
+ // request parameter.
+ ConsumedCapacity []*ConsumedCapacity `type:"list"`
+
+ // A list of tables that were processed by TransactWriteItems and, for each
+ // table, information about any item collections that were affected by individual
+ // UpdateItem, PutItem, or DeleteItem operations.
+ ItemCollectionMetrics map[string][]*ItemCollectionMetrics `type:"map"`
+}
+
+// String returns the string representation
+func (s TransactWriteItemsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransactWriteItemsOutput) GoString() string {
+ return s.String()
+}
+
+// SetConsumedCapacity sets the ConsumedCapacity field's value.
+func (s *TransactWriteItemsOutput) SetConsumedCapacity(v []*ConsumedCapacity) *TransactWriteItemsOutput {
+ s.ConsumedCapacity = v
+ return s
+}
+
+// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value.
+func (s *TransactWriteItemsOutput) SetItemCollectionMetrics(v map[string][]*ItemCollectionMetrics) *TransactWriteItemsOutput {
+ s.ItemCollectionMetrics = v
+ return s
+}
+
type UntagResourceInput struct {
_ struct{} `type:"structure"`
- // The Amazon DyanamoDB resource the tags will be removed from. This value is
- // an Amazon Resource Name (ARN).
+ // The DynamoDB resource that the tags will be removed from. This value is an
+ // Amazon Resource Name (ARN).
//
// ResourceArn is a required field
ResourceArn *string `min:"1" type:"string" required:"true"`
// A list of tag keys. Existing tags of the resource whose keys are members
- // of this list will be removed from the Amazon DynamoDB resource.
+ // of this list will be removed from the DynamoDB resource.
//
// TagKeys is a required field
TagKeys []*string `type:"list" required:"true"`
@@ -11676,6 +14717,116 @@ func (s UntagResourceOutput) GoString() string {
return s.String()
}
+// Represents a request to perform an UpdateItem operation.
+type Update struct {
+ _ struct{} `type:"structure"`
+
+ // A condition that must be satisfied in order for a conditional update to succeed.
+ ConditionExpression *string `type:"string"`
+
+ // One or more substitution tokens for attribute names in an expression.
+ ExpressionAttributeNames map[string]*string `type:"map"`
+
+ // One or more values that can be substituted in an expression.
+ ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
+
+ // The primary key of the item to be updated. Each element consists of an attribute
+ // name and a value for that attribute.
+ //
+ // Key is a required field
+ Key map[string]*AttributeValue `type:"map" required:"true"`
+
+ // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the
+ // Update condition fails. For ReturnValuesOnConditionCheckFailure, the valid
+ // values are: NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW.
+ ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"`
+
+ // Name of the table for the UpdateItem request.
+ //
+ // TableName is a required field
+ TableName *string `min:"3" type:"string" required:"true"`
+
+ // An expression that defines one or more attributes to be updated, the action
+ // to be performed on them, and new value(s) for them.
+ //
+ // UpdateExpression is a required field
+ UpdateExpression *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s Update) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Update) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Update) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Update"}
+ if s.Key == nil {
+ invalidParams.Add(request.NewErrParamRequired("Key"))
+ }
+ if s.TableName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TableName"))
+ }
+ if s.TableName != nil && len(*s.TableName) < 3 {
+ invalidParams.Add(request.NewErrParamMinLen("TableName", 3))
+ }
+ if s.UpdateExpression == nil {
+ invalidParams.Add(request.NewErrParamRequired("UpdateExpression"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetConditionExpression sets the ConditionExpression field's value.
+func (s *Update) SetConditionExpression(v string) *Update {
+ s.ConditionExpression = &v
+ return s
+}
+
+// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value.
+func (s *Update) SetExpressionAttributeNames(v map[string]*string) *Update {
+ s.ExpressionAttributeNames = v
+ return s
+}
+
+// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value.
+func (s *Update) SetExpressionAttributeValues(v map[string]*AttributeValue) *Update {
+ s.ExpressionAttributeValues = v
+ return s
+}
+
+// SetKey sets the Key field's value.
+func (s *Update) SetKey(v map[string]*AttributeValue) *Update {
+ s.Key = v
+ return s
+}
+
+// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value.
+func (s *Update) SetReturnValuesOnConditionCheckFailure(v string) *Update {
+ s.ReturnValuesOnConditionCheckFailure = &v
+ return s
+}
+
+// SetTableName sets the TableName field's value.
+func (s *Update) SetTableName(v string) *Update {
+ s.TableName = &v
+ return s
+}
+
+// SetUpdateExpression sets the UpdateExpression field's value.
+func (s *Update) SetUpdateExpression(v string) *Update {
+ s.UpdateExpression = &v
+ return s
+}
+
type UpdateContinuousBackupsInput struct {
_ struct{} `type:"structure"`
@@ -11774,7 +14925,7 @@ type UpdateGlobalSecondaryIndexAction struct {
// index.
//
// For current minimum and maximum provisioned throughput values, see Limits
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html)
// in the Amazon DynamoDB Developer Guide.
//
// ProvisionedThroughput is a required field
@@ -11835,7 +14986,7 @@ type UpdateGlobalTableInput struct {
// GlobalTableName is a required field
GlobalTableName *string `min:"3" type:"string" required:"true"`
- // A list of regions that should be added or removed from the global table.
+ // A list of Regions that should be added or removed from the global table.
//
// ReplicaUpdates is a required field
ReplicaUpdates []*ReplicaUpdate `type:"list" required:"true"`
@@ -11918,6 +15069,10 @@ func (s *UpdateGlobalTableOutput) SetGlobalTableDescription(v *GlobalTableDescri
type UpdateGlobalTableSettingsInput struct {
_ struct{} `type:"structure"`
+ // The billing mode of the global table. If GlobalTableBillingMode is not specified,
+ // the global table defaults to PROVISIONED capacity billing mode.
+ GlobalTableBillingMode *string `type:"string" enum:"BillingMode"`
+
// Represents the settings of a global secondary index for a global table that
// will be modified.
GlobalTableGlobalSecondaryIndexSettingsUpdate []*GlobalTableGlobalSecondaryIndexSettingsUpdate `min:"1" type:"list"`
@@ -11927,11 +15082,15 @@ type UpdateGlobalTableSettingsInput struct {
// GlobalTableName is a required field
GlobalTableName *string `min:"3" type:"string" required:"true"`
+ // Auto scaling settings for managing provisioned write capacity for the global
+ // table.
+ GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"`
+
// The maximum number of writes consumed per second before DynamoDB returns
// a ThrottlingException.
GlobalTableProvisionedWriteCapacityUnits *int64 `min:"1" type:"long"`
- // Represents the settings for a global table in a region that will be modified.
+ // Represents the settings for a global table in a Region that will be modified.
ReplicaSettingsUpdate []*ReplicaSettingsUpdate `min:"1" type:"list"`
}
@@ -11973,6 +15132,11 @@ func (s *UpdateGlobalTableSettingsInput) Validate() error {
}
}
}
+ if s.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate != nil {
+ if err := s.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate.Validate(); err != nil {
+ invalidParams.AddNested("GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate", err.(request.ErrInvalidParams))
+ }
+ }
if s.ReplicaSettingsUpdate != nil {
for i, v := range s.ReplicaSettingsUpdate {
if v == nil {
@@ -11990,6 +15154,12 @@ func (s *UpdateGlobalTableSettingsInput) Validate() error {
return nil
}
+// SetGlobalTableBillingMode sets the GlobalTableBillingMode field's value.
+func (s *UpdateGlobalTableSettingsInput) SetGlobalTableBillingMode(v string) *UpdateGlobalTableSettingsInput {
+ s.GlobalTableBillingMode = &v
+ return s
+}
+
// SetGlobalTableGlobalSecondaryIndexSettingsUpdate sets the GlobalTableGlobalSecondaryIndexSettingsUpdate field's value.
func (s *UpdateGlobalTableSettingsInput) SetGlobalTableGlobalSecondaryIndexSettingsUpdate(v []*GlobalTableGlobalSecondaryIndexSettingsUpdate) *UpdateGlobalTableSettingsInput {
s.GlobalTableGlobalSecondaryIndexSettingsUpdate = v
@@ -12002,6 +15172,12 @@ func (s *UpdateGlobalTableSettingsInput) SetGlobalTableName(v string) *UpdateGlo
return s
}
+// SetGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate sets the GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate field's value.
+func (s *UpdateGlobalTableSettingsInput) SetGlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *UpdateGlobalTableSettingsInput {
+ s.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate = v
+ return s
+}
+
// SetGlobalTableProvisionedWriteCapacityUnits sets the GlobalTableProvisionedWriteCapacityUnits field's value.
func (s *UpdateGlobalTableSettingsInput) SetGlobalTableProvisionedWriteCapacityUnits(v int64) *UpdateGlobalTableSettingsInput {
s.GlobalTableProvisionedWriteCapacityUnits = &v
@@ -12020,7 +15196,7 @@ type UpdateGlobalTableSettingsOutput struct {
// The name of the global table.
GlobalTableName *string `min:"3" type:"string"`
- // The region specific settings for the global table.
+ // The Region-specific settings for the global table.
ReplicaSettings []*ReplicaSettingsDescription `type:"list"`
}
@@ -12051,7 +15227,7 @@ type UpdateItemInput struct {
_ struct{} `type:"structure"`
// This is a legacy parameter. Use UpdateExpression instead. For more information,
- // see AttributeUpdates (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html)
+ // see AttributeUpdates (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html)
// in the Amazon DynamoDB Developer Guide.
AttributeUpdates map[string]*AttributeValueUpdate `type:"map"`
@@ -12060,26 +15236,24 @@ type UpdateItemInput struct {
// An expression can contain any of the following:
//
// * Functions: attribute_exists | attribute_not_exists | attribute_type
- // | contains | begins_with | size
- //
- // These function names are case-sensitive.
+ // | contains | begins_with | size These function names are case-sensitive.
//
// * Comparison operators: = | <> | < | > | <= | >= | BETWEEN | IN
//
- // * Logical operators: AND | OR | NOT
+ // * Logical operators: AND | OR | NOT
//
- // For more information on condition expressions, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information about condition expressions, see Specifying Conditions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ConditionExpression *string `type:"string"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see ConditionalOperator (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
+ // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html)
// in the Amazon DynamoDB Developer Guide.
ConditionalOperator *string `type:"string" enum:"ConditionalOperator"`
// This is a legacy parameter. Use ConditionExpression instead. For more information,
- // see Expected (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
+ // see Expected (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html)
// in the Amazon DynamoDB Developer Guide.
Expected map[string]*ExpectedAttributeValue `type:"map"`
@@ -12102,8 +15276,8 @@ type UpdateItemInput struct {
//
// The name of this attribute conflicts with a reserved word, so it cannot be
// used directly in an expression. (For the complete list of reserved words,
- // see Reserved Words (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
- // in the Amazon DynamoDB Developer Guide). To work around this, you could specify
+ // see Reserved Words (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html)
+ // in the Amazon DynamoDB Developer Guide.) To work around this, you could specify
// the following for ExpressionAttributeNames:
//
// * {"#P":"Percentile"}
@@ -12115,8 +15289,8 @@ type UpdateItemInput struct {
// Tokens that begin with the : character are expression attribute values, which
// are placeholders for the actual value at runtime.
//
- // For more information on expression attribute names, see Accessing Item Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
+ // For more information about expression attribute names, see Specifying Item
+ // Attributes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeNames map[string]*string `type:"map"`
@@ -12137,8 +15311,8 @@ type UpdateItemInput struct {
//
// ProductStatus IN (:avail, :back, :disc)
//
- // For more information on expression attribute values, see Specifying Conditions
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
+ // For more information on expression attribute values, see Condition Expressions
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html)
// in the Amazon DynamoDB Developer Guide.
ExpressionAttributeValues map[string]*AttributeValue `type:"map"`
@@ -12158,11 +15332,9 @@ type UpdateItemInput struct {
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
- // index that was accessed.
- //
- // Note that some operations, such as GetItem and BatchGetItem, do not access
- // any indexes at all. In these cases, specifying INDEXES will only return
- // ConsumedCapacity information for table(s).
+ // index that was accessed. Note that some operations, such as GetItem and
+ // BatchGetItem, do not access any indexes at all. In these cases, specifying
+ // INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -12207,77 +15379,61 @@ type UpdateItemInput struct {
TableName *string `min:"3" type:"string" required:"true"`
// An expression that defines one or more attributes to be updated, the action
- // to be performed on them, and new value(s) for them.
+ // to be performed on them, and new values for them.
//
// The following action values are available for UpdateExpression.
//
// * SET - Adds one or more attributes and values to an item. If any of these
- // attribute already exist, they are replaced by the new values. You can
+ // attributes already exist, they are replaced by the new values. You can
// also use SET to add or subtract from an attribute that is of type Number.
- // For example: SET myNum = myNum + :val
- //
- // SET supports the following functions:
- //
- // if_not_exists (path, operand) - if the item does not contain an attribute
+ // For example: SET myNum = myNum + :val SET supports the following functions:
+ // if_not_exists (path, operand) - if the item does not contain an attribute
// at the specified path, then if_not_exists evaluates to operand; otherwise,
// it evaluates to path. You can use this function to avoid overwriting an
- // attribute that may already be present in the item.
- //
- // list_append (operand, operand) - evaluates to a list with a new element added
- // to it. You can append the new element to the start or the end of the list
- // by reversing the order of the operands.
- //
- // These function names are case-sensitive.
+ // attribute that may already be present in the item. list_append (operand,
+ // operand) - evaluates to a list with a new element added to it. You can
+ // append the new element to the start or the end of the list by reversing
+ // the order of the operands. These function names are case-sensitive.
//
// * REMOVE - Removes one or more attributes from an item.
//
// * ADD - Adds the specified value to the item, if the attribute does not
// already exist. If the attribute does exist, then the behavior of ADD depends
- // on the data type of the attribute:
+ // on the data type of the attribute: If the existing attribute is a number,
+ // and if Value is also a number, then Value is mathematically added to the
+ // existing attribute. If Value is a negative number, then it is subtracted
+ // from the existing attribute. If you use ADD to increment or decrement
+ // a number value for an item that doesn't exist before the update, DynamoDB
+ // uses 0 as the initial value. Similarly, if you use ADD for an existing
+ // item to increment or decrement an attribute value that doesn't exist before
+ // the update, DynamoDB uses 0 as the initial value. For example, suppose
+ // that the item you want to update doesn't have an attribute named itemcount,
+ // but you decide to ADD the number 3 to this attribute anyway. DynamoDB
+ // will create the itemcount attribute, set its initial value to 0, and finally
+ // add 3 to it. The result will be a new itemcount attribute in the item,
+ // with a value of 3. If the existing data type is a set and if Value is
+ // also a set, then Value is added to the existing set. For example, if the
+ // attribute value is the set [1,2], and the ADD action specified [3], then
+ // the final attribute value is [1,2,3]. An error occurs if an ADD action
+ // is specified for a set attribute and the attribute type specified does
+ // not match the existing set type. Both sets must have the same primitive
+ // data type. For example, if the existing data type is a set of strings,
+ // the Value must also be a set of strings. The ADD action only supports
+ // Number and set data types. In addition, ADD can only be used on top-level
+ // attributes, not nested attributes.
//
- // If the existing attribute is a number, and if Value is also a number, then
- // Value is mathematically added to the existing attribute. If Value is a
- // negative number, then it is subtracted from the existing attribute.
- //
- // If you use ADD to increment or decrement a number value for an item that
- // doesn't exist before the update, DynamoDB uses 0 as the initial value.
- //
- // Similarly, if you use ADD for an existing item to increment or decrement
- // an attribute value that doesn't exist before the update, DynamoDB uses
- // 0 as the initial value. For example, suppose that the item you want to
- // update doesn't have an attribute named itemcount, but you decide to ADD
- // the number 3 to this attribute anyway. DynamoDB will create the itemcount
- // attribute, set its initial value to 0, and finally add 3 to it. The result
- // will be a new itemcount attribute in the item, with a value of 3.
- //
- // If the existing data type is a set and if Value is also a set, then Value
- // is added to the existing set. For example, if the attribute value is the
- // set [1,2], and the ADD action specified [3], then the final attribute
- // value is [1,2,3]. An error occurs if an ADD action is specified for a
- // set attribute and the attribute type specified does not match the existing
- // set type.
- //
- // Both sets must have the same primitive data type. For example, if the existing
- // data type is a set of strings, the Value must also be a set of strings.
- //
- // The ADD action only supports Number and set data types. In addition, ADD
- // can only be used on top-level attributes, not nested attributes.
- //
- // * DELETE - Deletes an element from a set.
- //
- // If a set of values is specified, then those values are subtracted from the
- // old set. For example, if the attribute value was the set [a,b,c] and the
- // DELETE action specifies [a,c], then the final attribute value is [b].
- // Specifying an empty set is an error.
- //
- // The DELETE action only supports set data types. In addition, DELETE can only
- // be used on top-level attributes, not nested attributes.
+ // * DELETE - Deletes an element from a set. If a set of values is specified,
+ // then those values are subtracted from the old set. For example, if the
+ // attribute value was the set [a,b,c] and the DELETE action specifies [a,c],
+ // then the final attribute value is [b]. Specifying an empty set is an error.
+ // The DELETE action only supports set data types. In addition, DELETE can
+ // only be used on top-level attributes, not nested attributes.
//
// You can have many actions in a single expression, such as the following:
// SET a=:value1, b=:value2 DELETE :value3, :value4, :value5
//
// For more information on update expressions, see Modifying Items and Attributes
- // (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html)
+ // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html)
// in the Amazon DynamoDB Developer Guide.
UpdateExpression *string `type:"string"`
}
@@ -12398,7 +15554,7 @@ type UpdateItemOutput struct {
// includes the total provisioned throughput consumed, along with statistics
// for the table and any indexes involved in the operation. ConsumedCapacity
// is only returned if the ReturnConsumedCapacity parameter was specified. For
- // more information, see Provisioned Throughput (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
+ // more information, see Provisioned Throughput (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html)
// in the Amazon DynamoDB Developer Guide.
ConsumedCapacity *ConsumedCapacity `type:"structure"`
@@ -12417,10 +15573,9 @@ type UpdateItemOutput struct {
// bound for the estimate. The estimate includes the size of all the items
// in the table, plus the size of all attributes projected into all of the
// local secondary indexes on that table. Use this estimate to measure whether
- // a local secondary index is approaching its size limit.
- //
- // The estimate is subject to change over time; therefore, do not rely on the
- // precision or accuracy of the estimate.
+ // a local secondary index is approaching its size limit. The estimate is
+ // subject to change over time; therefore, do not rely on the precision or
+ // accuracy of the estimate.
ItemCollectionMetrics *ItemCollectionMetrics `type:"structure"`
}
@@ -12461,6 +15616,19 @@ type UpdateTableInput struct {
// must include the key element(s) of the new index.
AttributeDefinitions []*AttributeDefinition `type:"list"`
+ // Controls how you are charged for read and write throughput and how you manage
+ // capacity. When switching from pay-per-request to provisioned capacity, initial
+ // provisioned capacity values must be set. The initial provisioned capacity
+ // values are estimated based on the consumed read and write capacity of your
+ // table and global secondary indexes over the past 30 minutes.
+ //
+ // * PROVISIONED - Sets the billing mode to PROVISIONED. We recommend using
+ // PROVISIONED for predictable workloads.
+ //
+ // * PAY_PER_REQUEST - Sets the billing mode to PAY_PER_REQUEST. We recommend
+ // using PAY_PER_REQUEST for unpredictable workloads.
+ BillingMode *string `type:"string" enum:"BillingMode"`
+
// An array of one or more global secondary indexes for the table. For each
// index in the array, you can request one action:
//
@@ -12471,18 +15639,21 @@ type UpdateTableInput struct {
//
// * Delete - remove a global secondary index from the table.
//
- // For more information, see Managing Global Secondary Indexes (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html)
+ // For more information, see Managing Global Secondary Indexes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html)
// in the Amazon DynamoDB Developer Guide.
GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexUpdate `type:"list"`
// The new provisioned throughput settings for the specified table or index.
ProvisionedThroughput *ProvisionedThroughput `type:"structure"`
+ // The new server-side encryption settings for the specified table.
+ SSESpecification *SSESpecification `type:"structure"`
+
// Represents the DynamoDB Streams configuration for the table.
//
- // You will receive a ResourceInUseException if you attempt to enable a stream
- // on a table that already has a stream, or if you attempt to disable a stream
- // on a table which does not have a stream.
+ // You receive a ResourceInUseException if you try to enable a stream on a table
+ // that already has a stream, or if you try to disable a stream on a table that
+ // doesn't have a stream.
StreamSpecification *StreamSpecification `type:"structure"`
// The name of the table to be updated.
@@ -12548,6 +15719,12 @@ func (s *UpdateTableInput) SetAttributeDefinitions(v []*AttributeDefinition) *Up
return s
}
+// SetBillingMode sets the BillingMode field's value.
+func (s *UpdateTableInput) SetBillingMode(v string) *UpdateTableInput {
+ s.BillingMode = &v
+ return s
+}
+
// SetGlobalSecondaryIndexUpdates sets the GlobalSecondaryIndexUpdates field's value.
func (s *UpdateTableInput) SetGlobalSecondaryIndexUpdates(v []*GlobalSecondaryIndexUpdate) *UpdateTableInput {
s.GlobalSecondaryIndexUpdates = v
@@ -12560,6 +15737,12 @@ func (s *UpdateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *U
return s
}
+// SetSSESpecification sets the SSESpecification field's value.
+func (s *UpdateTableInput) SetSSESpecification(v *SSESpecification) *UpdateTableInput {
+ s.SSESpecification = v
+ return s
+}
+
// SetStreamSpecification sets the StreamSpecification field's value.
func (s *UpdateTableInput) SetStreamSpecification(v *StreamSpecification) *UpdateTableInput {
s.StreamSpecification = v
@@ -12739,6 +15922,39 @@ const (
BackupStatusAvailable = "AVAILABLE"
)
+const (
+ // BackupTypeUser is a BackupType enum value
+ BackupTypeUser = "USER"
+
+ // BackupTypeSystem is a BackupType enum value
+ BackupTypeSystem = "SYSTEM"
+
+ // BackupTypeAwsBackup is a BackupType enum value
+ BackupTypeAwsBackup = "AWS_BACKUP"
+)
+
+const (
+ // BackupTypeFilterUser is a BackupTypeFilter enum value
+ BackupTypeFilterUser = "USER"
+
+ // BackupTypeFilterSystem is a BackupTypeFilter enum value
+ BackupTypeFilterSystem = "SYSTEM"
+
+ // BackupTypeFilterAwsBackup is a BackupTypeFilter enum value
+ BackupTypeFilterAwsBackup = "AWS_BACKUP"
+
+ // BackupTypeFilterAll is a BackupTypeFilter enum value
+ BackupTypeFilterAll = "ALL"
+)
+
+const (
+ // BillingModeProvisioned is a BillingMode enum value
+ BillingModeProvisioned = "PROVISIONED"
+
+ // BillingModePayPerRequest is a BillingMode enum value
+ BillingModePayPerRequest = "PAY_PER_REQUEST"
+)
+
const (
// ComparisonOperatorEq is a ComparisonOperator enum value
ComparisonOperatorEq = "EQ"
@@ -12870,11 +16086,9 @@ const (
//
// * INDEXES - The response includes the aggregate ConsumedCapacity for the
// operation, together with ConsumedCapacity for each table and secondary
-// index that was accessed.
-//
-// Note that some operations, such as GetItem and BatchGetItem, do not access
-// any indexes at all. In these cases, specifying INDEXES will only return
-// ConsumedCapacity information for table(s).
+// index that was accessed. Note that some operations, such as GetItem and
+// BatchGetItem, do not access any indexes at all. In these cases, specifying
+// INDEXES will only return ConsumedCapacity information for table(s).
//
// * TOTAL - The response includes only the aggregate ConsumedCapacity for
// the operation.
@@ -12916,6 +16130,14 @@ const (
ReturnValueUpdatedNew = "UPDATED_NEW"
)
+const (
+ // ReturnValuesOnConditionCheckFailureAllOld is a ReturnValuesOnConditionCheckFailure enum value
+ ReturnValuesOnConditionCheckFailureAllOld = "ALL_OLD"
+
+ // ReturnValuesOnConditionCheckFailureNone is a ReturnValuesOnConditionCheckFailure enum value
+ ReturnValuesOnConditionCheckFailureNone = "NONE"
+)
+
const (
// SSEStatusEnabling is a SSEStatus enum value
SSEStatusEnabling = "ENABLING"
@@ -12928,6 +16150,17 @@ const (
// SSEStatusDisabled is a SSEStatus enum value
SSEStatusDisabled = "DISABLED"
+
+ // SSEStatusUpdating is a SSEStatus enum value
+ SSEStatusUpdating = "UPDATING"
+)
+
+const (
+ // SSETypeAes256 is a SSEType enum value
+ SSETypeAes256 = "AES256"
+
+ // SSETypeKms is a SSEType enum value
+ SSETypeKms = "KMS"
)
const (
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go
index 5ebc58072..013e9b1d2 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go
@@ -3,7 +3,7 @@ AttributeValue Marshaling and Unmarshaling Helpers
Utility helpers to marshal and unmarshal AttributeValue to and
from Go types can be found in the dynamodbattribute sub package. This package
-provides has specialized functions for the common ways of working with
+provides specialized functions for the common ways of working with
AttributeValues. Such as map[string]*AttributeValue, []*AttributeValue, and
directly with *AttributeValue. This is helpful for marshaling Go types for API
operations such as PutItem, and unmarshaling Query and Scan APIs' responses.
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go
index e02497568..1cae8b288 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/decode.go
@@ -1,6 +1,7 @@
package dynamodbattribute
import (
+ "encoding/base64"
"fmt"
"reflect"
"strconv"
@@ -16,7 +17,7 @@ import (
// Value int
// }
//
-// func (u *exampleUnmarshaler) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error {
+// func (u *ExampleUnmarshaler) UnmarshalDynamoDBAttributeValue(av *dynamodb.AttributeValue) error {
// if av.N == nil {
// return nil
// }
@@ -26,7 +27,7 @@ import (
// return err
// }
//
-// u.Value = n
+// u.Value = int(n)
// return nil
// }
type Unmarshaler interface {
@@ -538,6 +539,16 @@ func (d *Decoder) decodeString(s *string, v reflect.Value, fieldTag tag) error {
switch v.Kind() {
case reflect.String:
v.SetString(*s)
+ case reflect.Slice:
+ // To maintain backwards compatibility with the ConvertFrom family of methods
+ // which converted []byte into base64-encoded strings if the input was typed
+ if v.Type() == byteSliceType {
+ decoded, err := base64.StdEncoding.DecodeString(*s)
+ if err != nil {
+ return &UnmarshalError{Err: err, Value: "string", Type: v.Type()}
+ }
+ v.SetBytes(decoded)
+ }
case reflect.Interface:
// Ensure type aliasing is handled properly
v.Set(reflect.ValueOf(*s).Convert(v.Type()))
@@ -727,9 +738,9 @@ func (e *InvalidUnmarshalError) Message() string {
return "cannot unmarshal to nil value, " + e.Type.String()
}
-// An UnmarshalError wraps an error that occured while unmarshaling a DynamoDB
+// An UnmarshalError wraps an error that occurred while unmarshaling a DynamoDB
// AttributeValue element into a Go type. This is different from UnmarshalTypeError
-// in that it wraps the underlying error that occured.
+// in that it wraps the underlying error that occurred.
type UnmarshalError struct {
Err error
Value string
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go
index 7a51ac076..b83a29c95 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/doc.go
@@ -81,7 +81,7 @@
// The ConvertTo, ConvertToList, ConvertToMap, ConvertFrom, ConvertFromMap
// and ConvertFromList methods have been deprecated. The Marshal and Unmarshal
// functions should be used instead. The ConvertTo|From marshallers do not
-// support BinarySet, NumberSet, nor StringSets, and will incorrect marshal
+// support BinarySet, NumberSet, nor StringSets, and will incorrectly marshal
// binary data fields in structs as base64 strings.
//
// The Marshal and Unmarshal functions correct this behavior, and removes
@@ -91,5 +91,11 @@
// replaced with have been replaced with dynamodbattribute.Marshaler and
// dynamodbattribute.Unmarshaler interfaces.
//
+// The Unmarshal functions are backwards compatible with data marshalled by
+// ConvertTo*, but the reverse is not true: objects marshalled using Marshal
+// are not necessarily usable by ConvertFrom*. This backward compatibility is
+// intended to assist with incremental upgrading of data following a switch
+// away from the Convert* family of functions.
+//
// `time.Time` is marshaled as RFC3339 format.
package dynamodbattribute
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go
index fb30eff91..15c80785c 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/encode.go
@@ -189,6 +189,11 @@ type MarshalOptions struct {
//
// Enabled by default.
SupportJSONTags bool
+
+ // Support other custom struct tag keys, such as `yaml` or `toml`.
+ // Note that values provided with a custom TagKey must also be supported
+ // by the (un)marshalers in this package.
+ TagKey string
}
// An Encoder provides marshaling Go value types to AttributeValues.
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go
index 1fe0d3500..f1c74fec3 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/field.go
@@ -99,8 +99,12 @@ func enumFields(t reflect.Type, opts MarshalOptions) []field {
fieldTag := tag{}
fieldTag.parseAVTag(sf.Tag)
- if opts.SupportJSONTags && fieldTag == (tag{}) {
- fieldTag.parseJSONTag(sf.Tag)
+ // Because MarshalOptions.TagKey must be explicitly set, use it
+ // over JSON, which is enabled by default.
+ if opts.TagKey != "" && fieldTag == (tag{}) {
+ fieldTag.parseStructTag(opts.TagKey, sf.Tag)
+ } else if opts.SupportJSONTags && fieldTag == (tag{}) {
+ fieldTag.parseStructTag("json", sf.Tag)
}
if fieldTag.Ignore {
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go
index 60bd609b5..8b76a7e91 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute/tag.go
@@ -24,8 +24,8 @@ func (t *tag) parseAVTag(structTag reflect.StructTag) {
t.parseTagStr(tagStr)
}
-func (t *tag) parseJSONTag(structTag reflect.StructTag) {
- tagStr := structTag.Get("json")
+func (t *tag) parseStructTag(tag string, structTag reflect.StructTag) {
+ tagStr := structTag.Get(tag)
if len(tagStr) == 0 {
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go
index 9450ae38e..8b9f524e0 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go
@@ -103,6 +103,10 @@ type DynamoDBAPI interface {
DescribeContinuousBackupsWithContext(aws.Context, *dynamodb.DescribeContinuousBackupsInput, ...request.Option) (*dynamodb.DescribeContinuousBackupsOutput, error)
DescribeContinuousBackupsRequest(*dynamodb.DescribeContinuousBackupsInput) (*request.Request, *dynamodb.DescribeContinuousBackupsOutput)
+ DescribeEndpoints(*dynamodb.DescribeEndpointsInput) (*dynamodb.DescribeEndpointsOutput, error)
+ DescribeEndpointsWithContext(aws.Context, *dynamodb.DescribeEndpointsInput, ...request.Option) (*dynamodb.DescribeEndpointsOutput, error)
+ DescribeEndpointsRequest(*dynamodb.DescribeEndpointsInput) (*request.Request, *dynamodb.DescribeEndpointsOutput)
+
DescribeGlobalTable(*dynamodb.DescribeGlobalTableInput) (*dynamodb.DescribeGlobalTableOutput, error)
DescribeGlobalTableWithContext(aws.Context, *dynamodb.DescribeGlobalTableInput, ...request.Option) (*dynamodb.DescribeGlobalTableOutput, error)
DescribeGlobalTableRequest(*dynamodb.DescribeGlobalTableInput) (*request.Request, *dynamodb.DescribeGlobalTableOutput)
@@ -176,6 +180,14 @@ type DynamoDBAPI interface {
TagResourceWithContext(aws.Context, *dynamodb.TagResourceInput, ...request.Option) (*dynamodb.TagResourceOutput, error)
TagResourceRequest(*dynamodb.TagResourceInput) (*request.Request, *dynamodb.TagResourceOutput)
+ TransactGetItems(*dynamodb.TransactGetItemsInput) (*dynamodb.TransactGetItemsOutput, error)
+ TransactGetItemsWithContext(aws.Context, *dynamodb.TransactGetItemsInput, ...request.Option) (*dynamodb.TransactGetItemsOutput, error)
+ TransactGetItemsRequest(*dynamodb.TransactGetItemsInput) (*request.Request, *dynamodb.TransactGetItemsOutput)
+
+ TransactWriteItems(*dynamodb.TransactWriteItemsInput) (*dynamodb.TransactWriteItemsOutput, error)
+ TransactWriteItemsWithContext(aws.Context, *dynamodb.TransactWriteItemsInput, ...request.Option) (*dynamodb.TransactWriteItemsOutput, error)
+ TransactWriteItemsRequest(*dynamodb.TransactWriteItemsInput) (*request.Request, *dynamodb.TransactWriteItemsOutput)
+
UntagResource(*dynamodb.UntagResourceInput) (*dynamodb.UntagResourceOutput, error)
UntagResourceWithContext(aws.Context, *dynamodb.UntagResourceInput, ...request.Option) (*dynamodb.UntagResourceOutput, error)
UntagResourceRequest(*dynamodb.UntagResourceInput) (*request.Request, *dynamodb.UntagResourceOutput)
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go
index 5f6016521..71f3e7d3d 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go
@@ -8,7 +8,7 @@ const (
// "BackupInUseException".
//
// There is another ongoing conflicting backup control plane operation on the
- // table. The backups is either being created, deleted or restored to a table.
+ // table. The backup is either being created, deleted or restored to a table.
ErrCodeBackupInUseException = "BackupInUseException"
// ErrCodeBackupNotFoundException for service response error code
@@ -41,6 +41,13 @@ const (
// The specified global table does not exist.
ErrCodeGlobalTableNotFoundException = "GlobalTableNotFoundException"
+ // ErrCodeIdempotentParameterMismatchException for service response error code
+ // "IdempotentParameterMismatchException".
+ //
+ // DynamoDB rejected the request because you retried a request with a different
+ // payload but with an idempotent token that was already used.
+ ErrCodeIdempotentParameterMismatchException = "IdempotentParameterMismatchException"
+
// ErrCodeIndexNotFoundException for service response error code
// "IndexNotFoundException".
//
@@ -70,18 +77,18 @@ const (
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
- // Up to 50 CreateBackup operations are allowed per second, per account. There
- // is no limit to the number of daily on-demand backups that can be taken.
+ // There is no limit to the number of daily on-demand backups that can be taken.
//
- // Up to 10 simultaneous table operations are allowed per account. These operations
+ // Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
- // For tables with secondary indexes, only one of those tables can be in the
- // CREATING state at any point in time. Do not attempt to create more than one
- // such table simultaneously.
+ // The only exception is when you are creating a table with one or more secondary
+ // indexes. You can have up to 25 such requests running at a time; however,
+ // if the table or index specifications are complex, DynamoDB might temporarily
+ // reduce the number of concurrent operations.
//
- // The total limit of tables in the ACTIVE state is 250.
+ // There is a soft account limit of 256 tables.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodePointInTimeRecoveryUnavailableException for service response error code
@@ -97,7 +104,7 @@ const (
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
- // Exponential Backoff (http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
+ // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException"
@@ -113,6 +120,14 @@ const (
// The specified replica is no longer part of the global table.
ErrCodeReplicaNotFoundException = "ReplicaNotFoundException"
+ // ErrCodeRequestLimitExceeded for service response error code
+ // "RequestLimitExceeded".
+ //
+ // Throughput exceeds the current throughput limit for your account. Please
+ // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
+ // a limit increase.
+ ErrCodeRequestLimitExceeded = "RequestLimitExceeded"
+
// ErrCodeResourceInUseException for service response error code
// "ResourceInUseException".
//
@@ -146,4 +161,110 @@ const (
// A source table with the name TableName does not currently exist within the
// subscriber's account.
ErrCodeTableNotFoundException = "TableNotFoundException"
+
+ // ErrCodeTransactionCanceledException for service response error code
+ // "TransactionCanceledException".
+ //
+ // The entire transaction request was canceled.
+ //
+ // DynamoDB cancels a TransactWriteItems request under the following circumstances:
+ //
+ // * A condition in one of the condition expressions is not met.
+ //
+ // * A table in the TransactWriteItems request is in a different account
+ // or region.
+ //
+ // * More than one action in the TransactWriteItems operation targets the
+ // same item.
+ //
+ // * There is insufficient provisioned capacity for the transaction to be
+ // completed.
+ //
+ // * An item size becomes too large (larger than 400 KB), or a local secondary
+ // index (LSI) becomes too large, or a similar validation error occurs because
+ // of changes made by the transaction.
+ //
+ // * The aggregate size of the items in the transaction exceeds 4 MBs.
+ //
+ // * There is a user error, such as an invalid data format.
+ //
+ // DynamoDB cancels a TransactGetItems request under the following circumstances:
+ //
+ // * There is an ongoing TransactGetItems operation that conflicts with a
+ // concurrent PutItem, UpdateItem, DeleteItem or TransactWriteItems request.
+ // In this case the TransactGetItems operation fails with a TransactionCanceledException.
+ //
+ // * A table in the TransactGetItems request is in a different account or
+ // region.
+ //
+ // * There is insufficient provisioned capacity for the transaction to be
+ // completed.
+ //
+ // * The aggregate size of the items in the transaction exceeds 4 MBs.
+ //
+ // * There is a user error, such as an invalid data format.
+ //
+ // If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons
+ // property. This property is not set for other languages. Transaction cancellation
+ // reasons are ordered in the order of requested items, if an item has no error
+ // it will have NONE code and Null message.
+ //
+ // Cancellation reason codes and possible error messages:
+ //
+ // * No Errors: Code: NONE Message: null
+ //
+ // * Conditional Check Failed: Code: ConditionalCheckFailed Message: The
+ // conditional request failed.
+ //
+ // * Item Collection Size Limit Exceeded: Code: ItemCollectionSizeLimitExceeded
+ // Message: Collection size exceeded.
+ //
+ // * Transaction Conflict: Code: TransactionConflict Message: Transaction
+ // is ongoing for the item.
+ //
+ // * Provisioned Throughput Exceeded: Code: ProvisionedThroughputExceeded
+ // Messages: The level of configured provisioned throughput for the table
+ // was exceeded. Consider increasing your provisioning level with the UpdateTable
+ // API. This Message is received when provisioned throughput is exceeded
+ // is on a provisioned DynamoDB table. The level of configured provisioned
+ // throughput for one or more global secondary indexes of the table was exceeded.
+ // Consider increasing your provisioning level for the under-provisioned
+ // global secondary indexes with the UpdateTable API. This message is returned
+ // when provisioned throughput is exceeded is on a provisioned GSI.
+ //
+ // * Throttling Error: Code: ThrottlingError Messages: Throughput exceeds
+ // the current capacity of your table or index. DynamoDB is automatically
+ // scaling your table or index so please try again shortly. If exceptions
+ // persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.
+ // This message is returned when writes get throttled on an On-Demand table
+ // as DynamoDB is automatically scaling the table. Throughput exceeds the
+ // current capacity for one or more global secondary indexes. DynamoDB is
+ // automatically scaling your index so please try again shortly. This message
+ // is returned when when writes get throttled on an On-Demand GSI as DynamoDB
+ // is automatically scaling the GSI.
+ //
+ // * Validation Error: Code: ValidationError Messages: One or more parameter
+ // values were invalid. The update expression attempted to update the secondary
+ // index key beyond allowed size limits. The update expression attempted
+ // to update the secondary index key to unsupported type. An operand in the
+ // update expression has an incorrect data type. Item size to update has
+ // exceeded the maximum allowed size. Number overflow. Attempting to store
+ // a number with magnitude larger than supported range. Type mismatch for
+ // attribute to update. Nesting Levels have exceeded supported limits. The
+ // document path provided in the update expression is invalid for update.
+ // The provided expression refers to an attribute that does not exist in
+ // the item.
+ ErrCodeTransactionCanceledException = "TransactionCanceledException"
+
+ // ErrCodeTransactionConflictException for service response error code
+ // "TransactionConflictException".
+ //
+ // Operation was rejected because there is an ongoing transaction for the item.
+ ErrCodeTransactionConflictException = "TransactionConflictException"
+
+ // ErrCodeTransactionInProgressException for service response error code
+ // "TransactionInProgressException".
+ //
+ // The transaction with the given request token is already in progress.
+ ErrCodeTransactionInProgressException = "TransactionInProgressException"
)
diff --git a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go
index 80dcd19fd..edcb5b859 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go
@@ -6,6 +6,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
+ "github.com/aws/aws-sdk-go/aws/crr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
@@ -19,6 +20,7 @@ import (
// modify mutate any of the struct's properties though.
type DynamoDB struct {
*client.Client
+ endpointCache *crr.EndpointCache
}
// Used for custom client initialization logic
@@ -29,8 +31,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "dynamodb" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "dynamodb" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "DynamoDB" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the DynamoDB client with a session.
@@ -55,6 +58,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
@@ -65,6 +69,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
handlers,
),
}
+ svc.endpointCache = crr.NewEndpointCache(10)
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
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 342596b83..fde92889f 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
@@ -18,7 +18,7 @@ const opAcceptReservedInstancesExchangeQuote = "AcceptReservedInstancesExchangeQ
// AcceptReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the
// client's request for the AcceptReservedInstancesExchangeQuote operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -88,12 +88,90 @@ func (c *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, i
return out, req.Send()
}
+const opAcceptTransitGatewayVpcAttachment = "AcceptTransitGatewayVpcAttachment"
+
+// AcceptTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the
+// client's request for the AcceptTransitGatewayVpcAttachment 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 AcceptTransitGatewayVpcAttachment for more information on using the AcceptTransitGatewayVpcAttachment
+// 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 AcceptTransitGatewayVpcAttachmentRequest method.
+// req, resp := client.AcceptTransitGatewayVpcAttachmentRequest(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/AcceptTransitGatewayVpcAttachment
+func (c *EC2) AcceptTransitGatewayVpcAttachmentRequest(input *AcceptTransitGatewayVpcAttachmentInput) (req *request.Request, output *AcceptTransitGatewayVpcAttachmentOutput) {
+ op := &request.Operation{
+ Name: opAcceptTransitGatewayVpcAttachment,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &AcceptTransitGatewayVpcAttachmentInput{}
+ }
+
+ output = &AcceptTransitGatewayVpcAttachmentOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// AcceptTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.
+//
+// Accepts a request to attach a VPC to a transit gateway.
+//
+// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments
+// to view your pending VPC attachment requests. Use RejectTransitGatewayVpcAttachment
+// to reject a VPC attachment 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation AcceptTransitGatewayVpcAttachment for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayVpcAttachment
+func (c *EC2) AcceptTransitGatewayVpcAttachment(input *AcceptTransitGatewayVpcAttachmentInput) (*AcceptTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.AcceptTransitGatewayVpcAttachmentRequest(input)
+ return out, req.Send()
+}
+
+// AcceptTransitGatewayVpcAttachmentWithContext is the same as AcceptTransitGatewayVpcAttachment with the addition of
+// the ability to pass a context and additional request options.
+//
+// See AcceptTransitGatewayVpcAttachment 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) AcceptTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *AcceptTransitGatewayVpcAttachmentInput, opts ...request.Option) (*AcceptTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.AcceptTransitGatewayVpcAttachmentRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAcceptVpcEndpointConnections = "AcceptVpcEndpointConnections"
// AcceptVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the
// client's request for the AcceptVpcEndpointConnections operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -168,7 +246,7 @@ const opAcceptVpcPeeringConnection = "AcceptVpcPeeringConnection"
// AcceptVpcPeeringConnectionRequest generates a "aws/request.Request" representing the
// client's request for the AcceptVpcPeeringConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -212,8 +290,8 @@ func (c *EC2) AcceptVpcPeeringConnectionRequest(input *AcceptVpcPeeringConnectio
// of the peer VPC. Use DescribeVpcPeeringConnections to view your outstanding
// VPC peering connection requests.
//
-// For an inter-region VPC peering connection request, you must accept the VPC
-// peering connection in the region of the accepter VPC.
+// For an inter-Region VPC peering connection request, you must accept the VPC
+// peering connection in the Region of the accepter VPC.
//
// 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
@@ -243,12 +321,101 @@ func (c *EC2) AcceptVpcPeeringConnectionWithContext(ctx aws.Context, input *Acce
return out, req.Send()
}
+const opAdvertiseByoipCidr = "AdvertiseByoipCidr"
+
+// AdvertiseByoipCidrRequest generates a "aws/request.Request" representing the
+// client's request for the AdvertiseByoipCidr 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 AdvertiseByoipCidr for more information on using the AdvertiseByoipCidr
+// 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 AdvertiseByoipCidrRequest method.
+// req, resp := client.AdvertiseByoipCidrRequest(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/AdvertiseByoipCidr
+func (c *EC2) AdvertiseByoipCidrRequest(input *AdvertiseByoipCidrInput) (req *request.Request, output *AdvertiseByoipCidrOutput) {
+ op := &request.Operation{
+ Name: opAdvertiseByoipCidr,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &AdvertiseByoipCidrInput{}
+ }
+
+ output = &AdvertiseByoipCidrOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// AdvertiseByoipCidr API operation for Amazon Elastic Compute Cloud.
+//
+// Advertises an IPv4 address range that is provisioned for use with your AWS
+// resources through bring your own IP addresses (BYOIP).
+//
+// You can perform this operation at most once every 10 seconds, even if you
+// specify different address ranges each time.
+//
+// We recommend that you stop advertising the BYOIP CIDR from other locations
+// when you advertise it from AWS. To minimize down time, you can configure
+// your AWS resources to use an address from a BYOIP CIDR before it is advertised,
+// and then simultaneously stop advertising it from the current location and
+// start advertising it through AWS.
+//
+// It can take a few minutes before traffic to the specified addresses starts
+// routing to AWS because of BGP propagation delays.
+//
+// To stop advertising the BYOIP CIDR, use WithdrawByoipCidr.
+//
+// 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 AdvertiseByoipCidr for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AdvertiseByoipCidr
+func (c *EC2) AdvertiseByoipCidr(input *AdvertiseByoipCidrInput) (*AdvertiseByoipCidrOutput, error) {
+ req, out := c.AdvertiseByoipCidrRequest(input)
+ return out, req.Send()
+}
+
+// AdvertiseByoipCidrWithContext is the same as AdvertiseByoipCidr with the addition of
+// the ability to pass a context and additional request options.
+//
+// See AdvertiseByoipCidr 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) AdvertiseByoipCidrWithContext(ctx aws.Context, input *AdvertiseByoipCidrInput, opts ...request.Option) (*AdvertiseByoipCidrOutput, error) {
+ req, out := c.AdvertiseByoipCidrRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAllocateAddress = "AllocateAddress"
// AllocateAddressRequest generates a "aws/request.Request" representing the
// client's request for the AllocateAddress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -287,18 +454,29 @@ func (c *EC2) AllocateAddressRequest(input *AllocateAddressInput) (req *request.
// AllocateAddress API operation for Amazon Elastic Compute Cloud.
//
-// Allocates an Elastic IP address.
+// Allocates an Elastic IP address to your AWS account. After you allocate the
+// Elastic IP address you can associate it with an instance or network interface.
+// After you release an Elastic IP address, it is released to the IP address
+// pool and can be allocated to a different AWS account.
+//
+// You can allocate an Elastic IP address from an address pool owned by AWS
+// or from an address pool created from a public IPv4 address range that you
+// have brought to AWS for use with your AWS 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.
+//
+// [EC2-VPC] 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 to another AWS account. You cannot recover an Elastic IP address
+// for EC2-Classic. To attempt to recover an Elastic IP address that you released,
+// specify it in this operation.
//
// An Elastic IP address is for use either in the EC2-Classic platform or in
// a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic
-// per region and 5 Elastic IP addresses for EC2-VPC per region.
+// per Region and 5 Elastic IP addresses for EC2-VPC per Region.
//
-// If you release an Elastic IP address for use in a VPC, you might be able
-// to recover it. To recover an Elastic IP address that you released, specify
-// it in the Address parameter. Note that you cannot recover an Elastic IP address
-// that you released after it is allocated to another AWS account.
-//
-// For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -334,7 +512,7 @@ const opAllocateHosts = "AllocateHosts"
// AllocateHostsRequest generates a "aws/request.Request" representing the
// client's request for the AllocateHosts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -373,9 +551,8 @@ func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Requ
// AllocateHosts API operation for Amazon Elastic Compute Cloud.
//
-// Allocates a Dedicated Host to your account. At minimum you need to specify
-// the instance size type, Availability Zone, and quantity of hosts you want
-// to allocate.
+// Allocates a Dedicated Host to your account. At a minimum, specify the instance
+// size type, Availability Zone, and quantity of hosts to allocate.
//
// 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
@@ -405,12 +582,88 @@ func (c *EC2) AllocateHostsWithContext(ctx aws.Context, input *AllocateHostsInpu
return out, req.Send()
}
+const opApplySecurityGroupsToClientVpnTargetNetwork = "ApplySecurityGroupsToClientVpnTargetNetwork"
+
+// ApplySecurityGroupsToClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the
+// client's request for the ApplySecurityGroupsToClientVpnTargetNetwork 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 ApplySecurityGroupsToClientVpnTargetNetwork for more information on using the ApplySecurityGroupsToClientVpnTargetNetwork
+// 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 ApplySecurityGroupsToClientVpnTargetNetworkRequest method.
+// req, resp := client.ApplySecurityGroupsToClientVpnTargetNetworkRequest(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/ApplySecurityGroupsToClientVpnTargetNetwork
+func (c *EC2) ApplySecurityGroupsToClientVpnTargetNetworkRequest(input *ApplySecurityGroupsToClientVpnTargetNetworkInput) (req *request.Request, output *ApplySecurityGroupsToClientVpnTargetNetworkOutput) {
+ op := &request.Operation{
+ Name: opApplySecurityGroupsToClientVpnTargetNetwork,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ApplySecurityGroupsToClientVpnTargetNetworkInput{}
+ }
+
+ output = &ApplySecurityGroupsToClientVpnTargetNetworkOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ApplySecurityGroupsToClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud.
+//
+// Applies a security group to the association between the target network and
+// the Client VPN endpoint. This action replaces the existing security groups
+// with the specified security groups.
+//
+// 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 ApplySecurityGroupsToClientVpnTargetNetwork for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ApplySecurityGroupsToClientVpnTargetNetwork
+func (c *EC2) ApplySecurityGroupsToClientVpnTargetNetwork(input *ApplySecurityGroupsToClientVpnTargetNetworkInput) (*ApplySecurityGroupsToClientVpnTargetNetworkOutput, error) {
+ req, out := c.ApplySecurityGroupsToClientVpnTargetNetworkRequest(input)
+ return out, req.Send()
+}
+
+// ApplySecurityGroupsToClientVpnTargetNetworkWithContext is the same as ApplySecurityGroupsToClientVpnTargetNetwork with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ApplySecurityGroupsToClientVpnTargetNetwork 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) ApplySecurityGroupsToClientVpnTargetNetworkWithContext(ctx aws.Context, input *ApplySecurityGroupsToClientVpnTargetNetworkInput, opts ...request.Option) (*ApplySecurityGroupsToClientVpnTargetNetworkOutput, error) {
+ req, out := c.ApplySecurityGroupsToClientVpnTargetNetworkRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAssignIpv6Addresses = "AssignIpv6Addresses"
// AssignIpv6AddressesRequest generates a "aws/request.Request" representing the
// client's request for the AssignIpv6Addresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -455,7 +708,7 @@ func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req *
// 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
+// Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -491,7 +744,7 @@ const opAssignPrivateIpAddresses = "AssignPrivateIpAddresses"
// AssignPrivateIpAddressesRequest generates a "aws/request.Request" representing the
// client's request for the AssignPrivateIpAddresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -525,24 +778,29 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp
output = &AssignPrivateIpAddressesOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return
}
// AssignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud.
//
// Assigns one or more secondary private IP addresses to the specified network
-// interface. 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+// interface.
+//
+// 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// 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.
//
-// AssignPrivateIpAddresses is available only in EC2-VPC.
+// 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.
+//
+// Remapping an IP address is an asynchronous operation. When you move an IP
+// address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s
+// in the instance metadata to confirm that the remapping is complete.
//
// 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
@@ -577,7 +835,7 @@ const opAssociateAddress = "AssociateAddress"
// AssociateAddressRequest generates a "aws/request.Request" representing the
// client's request for the AssociateAddress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -617,9 +875,10 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *reques
// AssociateAddress API operation for Amazon Elastic Compute Cloud.
//
// Associates an Elastic IP address with an instance or a network interface.
+// Before you can use an Elastic IP address, you must allocate it to your account.
//
// An Elastic IP address is for use in either the EC2-Classic platform or in
-// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// a VPC. 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.
//
// [EC2-Classic, VPC in an EC2-VPC-only account] If the Elastic IP address is
@@ -669,12 +928,90 @@ func (c *EC2) AssociateAddressWithContext(ctx aws.Context, input *AssociateAddre
return out, req.Send()
}
+const opAssociateClientVpnTargetNetwork = "AssociateClientVpnTargetNetwork"
+
+// AssociateClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the
+// client's request for the AssociateClientVpnTargetNetwork 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 AssociateClientVpnTargetNetwork for more information on using the AssociateClientVpnTargetNetwork
+// 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 AssociateClientVpnTargetNetworkRequest method.
+// req, resp := client.AssociateClientVpnTargetNetworkRequest(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/AssociateClientVpnTargetNetwork
+func (c *EC2) AssociateClientVpnTargetNetworkRequest(input *AssociateClientVpnTargetNetworkInput) (req *request.Request, output *AssociateClientVpnTargetNetworkOutput) {
+ op := &request.Operation{
+ Name: opAssociateClientVpnTargetNetwork,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &AssociateClientVpnTargetNetworkInput{}
+ }
+
+ output = &AssociateClientVpnTargetNetworkOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// AssociateClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud.
+//
+// Associates a target network with a Client VPN endpoint. A target network
+// is a subnet in a VPC. You can associate multiple subnets from the same VPC
+// with a Client VPN endpoint. You can associate only one subnet in each Availability
+// Zone. We recommend that you associate at least two subnets to provide Availability
+// Zone redundancy.
+//
+// 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 AssociateClientVpnTargetNetwork for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateClientVpnTargetNetwork
+func (c *EC2) AssociateClientVpnTargetNetwork(input *AssociateClientVpnTargetNetworkInput) (*AssociateClientVpnTargetNetworkOutput, error) {
+ req, out := c.AssociateClientVpnTargetNetworkRequest(input)
+ return out, req.Send()
+}
+
+// AssociateClientVpnTargetNetworkWithContext is the same as AssociateClientVpnTargetNetwork with the addition of
+// the ability to pass a context and additional request options.
+//
+// See AssociateClientVpnTargetNetwork 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) AssociateClientVpnTargetNetworkWithContext(ctx aws.Context, input *AssociateClientVpnTargetNetworkInput, opts ...request.Option) (*AssociateClientVpnTargetNetworkOutput, error) {
+ req, out := c.AssociateClientVpnTargetNetworkRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAssociateDhcpOptions = "AssociateDhcpOptions"
// AssociateDhcpOptionsRequest generates a "aws/request.Request" representing the
// client's request for the AssociateDhcpOptions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -708,8 +1045,7 @@ func (c *EC2) AssociateDhcpOptionsRequest(input *AssociateDhcpOptionsInput) (req
output = &AssociateDhcpOptionsOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -725,7 +1061,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 (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html)
+// For more information, see DHCP Options Sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -761,7 +1097,7 @@ const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile"
// AssociateIamInstanceProfileRequest generates a "aws/request.Request" representing the
// client's request for the AssociateIamInstanceProfile operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -836,7 +1172,7 @@ const opAssociateRouteTable = "AssociateRouteTable"
// AssociateRouteTableRequest generates a "aws/request.Request" representing the
// client's request for the AssociateRouteTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -881,7 +1217,7 @@ func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req *
// an association ID, which you need in order to disassociate the route table
// from the subnet later. A route table can be associated with multiple subnets.
//
-// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -917,7 +1253,7 @@ const opAssociateSubnetCidrBlock = "AssociateSubnetCidrBlock"
// AssociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the
// client's request for the AssociateSubnetCidrBlock operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -988,12 +1324,87 @@ func (c *EC2) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *Associ
return out, req.Send()
}
+const opAssociateTransitGatewayRouteTable = "AssociateTransitGatewayRouteTable"
+
+// AssociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the
+// client's request for the AssociateTransitGatewayRouteTable 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 AssociateTransitGatewayRouteTable for more information on using the AssociateTransitGatewayRouteTable
+// 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 AssociateTransitGatewayRouteTableRequest method.
+// req, resp := client.AssociateTransitGatewayRouteTableRequest(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/AssociateTransitGatewayRouteTable
+func (c *EC2) AssociateTransitGatewayRouteTableRequest(input *AssociateTransitGatewayRouteTableInput) (req *request.Request, output *AssociateTransitGatewayRouteTableOutput) {
+ op := &request.Operation{
+ Name: opAssociateTransitGatewayRouteTable,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &AssociateTransitGatewayRouteTableInput{}
+ }
+
+ output = &AssociateTransitGatewayRouteTableOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// AssociateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.
+//
+// Associates the specified attachment with the specified transit gateway route
+// table. You can associate only one route table with an attachment.
+//
+// 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 AssociateTransitGatewayRouteTable for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateTransitGatewayRouteTable
+func (c *EC2) AssociateTransitGatewayRouteTable(input *AssociateTransitGatewayRouteTableInput) (*AssociateTransitGatewayRouteTableOutput, error) {
+ req, out := c.AssociateTransitGatewayRouteTableRequest(input)
+ return out, req.Send()
+}
+
+// AssociateTransitGatewayRouteTableWithContext is the same as AssociateTransitGatewayRouteTable with the addition of
+// the ability to pass a context and additional request options.
+//
+// See AssociateTransitGatewayRouteTable 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) AssociateTransitGatewayRouteTableWithContext(ctx aws.Context, input *AssociateTransitGatewayRouteTableInput, opts ...request.Option) (*AssociateTransitGatewayRouteTableOutput, error) {
+ req, out := c.AssociateTransitGatewayRouteTableRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAssociateVpcCidrBlock = "AssociateVpcCidrBlock"
// AssociateVpcCidrBlockRequest generates a "aws/request.Request" representing the
// client's request for the AssociateVpcCidrBlock operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1037,7 +1448,7 @@ func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (r
// IPv6 CIDR block size is fixed at /56.
//
// For more information about associating CIDR blocks with your VPC and applicable
-// restrictions, see VPC and Subnet Sizing (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html#VPC_Sizing)
+// restrictions, see VPC and Subnet Sizing (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#VPC_Sizing)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -1073,7 +1484,7 @@ const opAttachClassicLinkVpc = "AttachClassicLinkVpc"
// AttachClassicLinkVpcRequest generates a "aws/request.Request" representing the
// client's request for the AttachClassicLinkVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1158,7 +1569,7 @@ const opAttachInternetGateway = "AttachInternetGateway"
// AttachInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the AttachInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1192,16 +1603,15 @@ func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (r
output = &AttachInternetGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// AttachInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// Attaches an Internet gateway to a VPC, enabling connectivity between the
-// Internet and the VPC. For more information about your VPC and Internet gateway,
-// see the Amazon Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/).
+// Attaches an internet gateway to a VPC, enabling connectivity between the
+// internet and the VPC. For more information about your VPC and internet gateway,
+// see the Amazon Virtual Private Cloud User Guide (https://docs.aws.amazon.com/vpc/latest/userguide/).
//
// 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
@@ -1236,7 +1646,7 @@ const opAttachNetworkInterface = "AttachNetworkInterface"
// AttachNetworkInterfaceRequest generates a "aws/request.Request" representing the
// client's request for the AttachNetworkInterface operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1310,7 +1720,7 @@ const opAttachVolume = "AttachVolume"
// AttachVolumeRequest generates a "aws/request.Request" representing the
// client's request for the AttachVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1352,15 +1762,12 @@ func (c *EC2) AttachVolumeRequest(input *AttachVolumeInput) (req *request.Reques
// Attaches an EBS volume to a running or stopped instance and exposes it to
// the instance with the specified device name.
//
-// Encrypted EBS volumes may only be attached to instances that support Amazon
-// EBS encryption. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
+// 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.
//
-// For a list of supported device names, see Attaching an EBS Volume to an Instance
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html).
-// Any device names that aren't reserved for instance store volumes can be used
-// for EBS volumes. For more information, see Amazon EC2 Instance Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html)
-// in the Amazon Elastic Compute Cloud User Guide.
+// After you attach an EBS volume, you must make it available. For more information,
+// see Making an EBS Volume Available For Use (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html).
//
// If a volume has an AWS Marketplace product code:
//
@@ -1374,10 +1781,7 @@ 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 an overview of the AWS Marketplace, see Introducing AWS Marketplace (https://aws.amazon.com/marketplace/help/200900000).
-//
-// For more information about EBS volumes, see Attaching Amazon EBS Volumes
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html)
+// For more information, see Attaching Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-attaching-volume.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -1413,7 +1817,7 @@ const opAttachVpnGateway = "AttachVpnGateway"
// AttachVpnGatewayRequest generates a "aws/request.Request" representing the
// client's request for the AttachVpnGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1455,8 +1859,8 @@ func (c *EC2) AttachVpnGatewayRequest(input *AttachVpnGatewayInput) (req *reques
// Attaches a virtual private gateway to a VPC. You can attach one virtual private
// gateway to one VPC at a time.
//
-// For more information, see AWS Managed VPN Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -1486,12 +1890,89 @@ func (c *EC2) AttachVpnGatewayWithContext(ctx aws.Context, input *AttachVpnGatew
return out, req.Send()
}
+const opAuthorizeClientVpnIngress = "AuthorizeClientVpnIngress"
+
+// AuthorizeClientVpnIngressRequest generates a "aws/request.Request" representing the
+// client's request for the AuthorizeClientVpnIngress 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 AuthorizeClientVpnIngress for more information on using the AuthorizeClientVpnIngress
+// 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 AuthorizeClientVpnIngressRequest method.
+// req, resp := client.AuthorizeClientVpnIngressRequest(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/AuthorizeClientVpnIngress
+func (c *EC2) AuthorizeClientVpnIngressRequest(input *AuthorizeClientVpnIngressInput) (req *request.Request, output *AuthorizeClientVpnIngressOutput) {
+ op := &request.Operation{
+ Name: opAuthorizeClientVpnIngress,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &AuthorizeClientVpnIngressInput{}
+ }
+
+ output = &AuthorizeClientVpnIngressOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// AuthorizeClientVpnIngress API operation for Amazon Elastic Compute Cloud.
+//
+// Adds an ingress authorization rule to a Client VPN endpoint. Ingress authorization
+// rules act as firewall rules that grant access to networks. You must configure
+// ingress authorization rules to enable clients to access resources in AWS
+// or on-premises networks.
+//
+// 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 AuthorizeClientVpnIngress for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AuthorizeClientVpnIngress
+func (c *EC2) AuthorizeClientVpnIngress(input *AuthorizeClientVpnIngressInput) (*AuthorizeClientVpnIngressOutput, error) {
+ req, out := c.AuthorizeClientVpnIngressRequest(input)
+ return out, req.Send()
+}
+
+// AuthorizeClientVpnIngressWithContext is the same as AuthorizeClientVpnIngress with the addition of
+// the ability to pass a context and additional request options.
+//
+// See AuthorizeClientVpnIngress 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) AuthorizeClientVpnIngressWithContext(ctx aws.Context, input *AuthorizeClientVpnIngressInput, opts ...request.Option) (*AuthorizeClientVpnIngressOutput, error) {
+ req, out := c.AuthorizeClientVpnIngressRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opAuthorizeSecurityGroupEgress = "AuthorizeSecurityGroupEgress"
// AuthorizeSecurityGroupEgressRequest generates a "aws/request.Request" representing the
// client's request for the AuthorizeSecurityGroupEgress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1525,32 +2006,30 @@ func (c *EC2) AuthorizeSecurityGroupEgressRequest(input *AuthorizeSecurityGroupE
output = &AuthorizeSecurityGroupEgressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// AuthorizeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud.
//
-// [EC2-VPC only] Adds one or more egress rules to a security group for use
-// with a VPC. Specifically, this action permits instances to send traffic to
-// one or more destination IPv4 or IPv6 CIDR address ranges, or to one or more
-// destination security groups for the same VPC. This action doesn't apply to
-// security groups for use in EC2-Classic. For more information, see Security
-// Groups for Your VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html)
-// in the Amazon Virtual Private Cloud User Guide. For more information about
-// security group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html).
+// [VPC only] Adds the specified egress rules to a security group for use with
+// a VPC.
//
-// Each rule consists of the protocol (for example, TCP), plus either a CIDR
-// range or a source group. 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 can optionally specify a description for the
-// rule.
+// An outbound rule permits instances to send traffic to the specified IPv4
+// or IPv6 CIDR address ranges, or to the instances associated with the specified
+// destination security groups.
+//
+// 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.
//
// Rule changes are propagated to affected instances as quickly as possible.
// However, a small delay might occur.
//
+// For more information about VPC security group limits, see Amazon VPC Limits
+// (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.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
// the error.
@@ -1584,7 +2063,7 @@ const opAuthorizeSecurityGroupIngress = "AuthorizeSecurityGroupIngress"
// AuthorizeSecurityGroupIngressRequest generates a "aws/request.Request" representing the
// client's request for the AuthorizeSecurityGroupIngress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1618,32 +2097,28 @@ func (c *EC2) AuthorizeSecurityGroupIngressRequest(input *AuthorizeSecurityGroup
output = &AuthorizeSecurityGroupIngressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// AuthorizeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud.
//
-// Adds one or more ingress rules to a security group.
+// Adds the specified ingress rules to a security group.
+//
+// An inbound rule permits instances to receive traffic from the specified IPv4
+// or IPv6 CIDR address ranges, or from the instances associated with the specified
+// destination security groups.
+//
+// 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.
//
// Rule changes are propagated to instances within the security group as quickly
// as possible. However, a small delay might occur.
//
-// [EC2-Classic] This action gives one or more IPv4 CIDR address ranges permission
-// to access a security group in your account, or gives one or more security
-// groups (called the source groups) permission to access a security group for
-// your account. A source group can be for your own AWS account, or another.
-// You can have up to 100 rules per group.
-//
-// [EC2-VPC] This action gives one or more IPv4 or IPv6 CIDR address ranges
-// permission to access a security group in your VPC, or gives one or more other
-// security groups (called the source groups) permission to access a security
-// group for your VPC. The security groups must all be for the same VPC or a
-// peer VPC in a VPC peering connection. For more information about VPC security
-// group limits, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html).
-//
-// You can optionally specify a description for the security group rule.
+// For more information about VPC security group limits, see Amazon VPC Limits
+// (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.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
@@ -1678,7 +2153,7 @@ const opBundleInstance = "BundleInstance"
// BundleInstanceRequest generates a "aws/request.Request" representing the
// client's request for the BundleInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1725,8 +2200,6 @@ func (c *EC2) BundleInstanceRequest(input *BundleInstanceInput) (req *request.Re
// This action is not applicable for Linux/Unix instances or Windows instances
// that are backed by Amazon EBS.
//
-// For more information, see Creating an Instance Store-Backed Windows AMI (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_InstanceStoreBacked_WinAMI.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
// the error.
@@ -1760,7 +2233,7 @@ const opCancelBundleTask = "CancelBundleTask"
// CancelBundleTaskRequest generates a "aws/request.Request" representing the
// client's request for the CancelBundleTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1829,12 +2302,93 @@ func (c *EC2) CancelBundleTaskWithContext(ctx aws.Context, input *CancelBundleTa
return out, req.Send()
}
+const opCancelCapacityReservation = "CancelCapacityReservation"
+
+// CancelCapacityReservationRequest generates a "aws/request.Request" representing the
+// client's request for the CancelCapacityReservation 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 CancelCapacityReservation for more information on using the CancelCapacityReservation
+// 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 CancelCapacityReservationRequest method.
+// req, resp := client.CancelCapacityReservationRequest(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/CancelCapacityReservation
+func (c *EC2) CancelCapacityReservationRequest(input *CancelCapacityReservationInput) (req *request.Request, output *CancelCapacityReservationOutput) {
+ op := &request.Operation{
+ Name: opCancelCapacityReservation,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CancelCapacityReservationInput{}
+ }
+
+ output = &CancelCapacityReservationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CancelCapacityReservation API operation for Amazon Elastic Compute Cloud.
+//
+// Cancels the specified Capacity Reservation, releases the reserved capacity,
+// and changes the Capacity Reservation's state to cancelled.
+//
+// Instances running in the reserved capacity continue running until you stop
+// them. Stopped instances that target the Capacity Reservation can no longer
+// launch. Modify these instances to either target a different Capacity Reservation,
+// launch On-Demand Instance capacity, or run in any open Capacity Reservation
+// that has matching attributes and sufficient capacity.
+//
+// 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 CancelCapacityReservation for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CancelCapacityReservation
+func (c *EC2) CancelCapacityReservation(input *CancelCapacityReservationInput) (*CancelCapacityReservationOutput, error) {
+ req, out := c.CancelCapacityReservationRequest(input)
+ return out, req.Send()
+}
+
+// CancelCapacityReservationWithContext is the same as CancelCapacityReservation with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CancelCapacityReservation 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) CancelCapacityReservationWithContext(ctx aws.Context, input *CancelCapacityReservationInput, opts ...request.Option) (*CancelCapacityReservationOutput, error) {
+ req, out := c.CancelCapacityReservationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCancelConversionTask = "CancelConversionTask"
// CancelConversionTaskRequest generates a "aws/request.Request" representing the
// client's request for the CancelConversionTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1868,8 +2422,7 @@ func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req
output = &CancelConversionTaskOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -1882,7 +2435,7 @@ func (c *EC2) CancelConversionTaskRequest(input *CancelConversionTaskInput) (req
// and returns an exception.
//
// For more information, see Importing a Virtual Machine Using the Amazon EC2
-// CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html).
+// CLI (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.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
@@ -1917,7 +2470,7 @@ const opCancelExportTask = "CancelExportTask"
// CancelExportTaskRequest generates a "aws/request.Request" representing the
// client's request for the CancelExportTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1951,8 +2504,7 @@ func (c *EC2) CancelExportTaskRequest(input *CancelExportTaskInput) (req *reques
output = &CancelExportTaskOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -1996,7 +2548,7 @@ const opCancelImportTask = "CancelImportTask"
// CancelImportTaskRequest generates a "aws/request.Request" representing the
// client's request for the CancelImportTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2070,7 +2622,7 @@ const opCancelReservedInstancesListing = "CancelReservedInstancesListing"
// CancelReservedInstancesListingRequest generates a "aws/request.Request" representing the
// client's request for the CancelReservedInstancesListing operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2112,7 +2664,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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2148,7 +2700,7 @@ const opCancelSpotFleetRequests = "CancelSpotFleetRequests"
// CancelSpotFleetRequestsRequest generates a "aws/request.Request" representing the
// client's request for the CancelSpotFleetRequests operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2229,7 +2781,7 @@ const opCancelSpotInstanceRequests = "CancelSpotInstanceRequests"
// CancelSpotInstanceRequestsRequest generates a "aws/request.Request" representing the
// client's request for the CancelSpotInstanceRequests operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2306,7 +2858,7 @@ const opConfirmProductInstance = "ConfirmProductInstance"
// ConfirmProductInstanceRequest generates a "aws/request.Request" representing the
// client's request for the ConfirmProductInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2382,7 +2934,7 @@ const opCopyFpgaImage = "CopyFpgaImage"
// CopyFpgaImageRequest generates a "aws/request.Request" representing the
// client's request for the CopyFpgaImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2421,7 +2973,7 @@ func (c *EC2) CopyFpgaImageRequest(input *CopyFpgaImageInput) (req *request.Requ
// CopyFpgaImage API operation for Amazon Elastic Compute Cloud.
//
-// Copies the specified Amazon FPGA Image (AFI) to the current region.
+// Copies the specified Amazon FPGA Image (AFI) to 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
@@ -2456,7 +3008,7 @@ const opCopyImage = "CopyImage"
// CopyImageRequest generates a "aws/request.Request" representing the
// client's request for the CopyImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2495,12 +3047,17 @@ func (c *EC2) CopyImageRequest(input *CopyImageInput) (req *request.Request, out
// CopyImage API operation for Amazon Elastic Compute Cloud.
//
-// Initiates the copy of an AMI from the specified source region to the current
-// region. You specify the destination region by using its endpoint when making
+// Initiates the copy of an AMI from the specified source Region to the current
+// Region. You specify the destination Region by using its endpoint when making
// the request.
//
+// Copies of encrypted backing snapshots for the AMI are encrypted. Copies of
+// unencrypted backing snapshots remain unencrypted, unless you set Encrypted
+// during the copy operation. You cannot create an unencrypted copy of an encrypted
+// backing snapshot.
+//
// For more information about the prerequisites and limits when copying an AMI,
-// see Copying an AMI (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html)
+// see Copying an AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2536,7 +3093,7 @@ const opCopySnapshot = "CopySnapshot"
// CopySnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CopySnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2576,24 +3133,23 @@ func (c *EC2) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Reques
// CopySnapshot API operation for Amazon Elastic Compute Cloud.
//
// Copies a point-in-time snapshot of an EBS volume and stores it in Amazon
-// S3. You can copy the snapshot within the same region or from one region to
+// S3. You can copy the snapshot within the same Region or from one Region to
// another. You can use the snapshot to create EBS volumes or Amazon Machine
-// Images (AMIs). The snapshot is copied to the regional endpoint that you send
-// the HTTP request to.
+// Images (AMIs).
//
// Copies of encrypted EBS snapshots remain encrypted. Copies of unencrypted
-// snapshots remain unencrypted, unless the Encrypted flag is specified during
-// the snapshot copy operation. By default, encrypted snapshot copies use the
-// default AWS Key Management Service (AWS KMS) customer master key (CMK); however,
-// you can specify a non-default CMK with the KmsKeyId parameter.
+// snapshots remain unencrypted, unless you enable encryption for the snapshot
+// copy operation. By default, encrypted snapshot copies use the default AWS
+// Key Management Service (AWS KMS) customer master key (CMK); however, you
+// can specify a different CMK.
//
// To copy an encrypted snapshot that has been shared from another account,
// you must have permissions for the CMK used to encrypt the snapshot.
//
-// Snapshots created by the CopySnapshot action have an arbitrary volume ID
+// Snapshots created by copying another snapshot have an arbitrary volume ID
// that should not be used for any purpose.
//
-// For more information, see Copying an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html)
+// For more information, see Copying an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2624,12 +3180,262 @@ func (c *EC2) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput,
return out, req.Send()
}
+const opCreateCapacityReservation = "CreateCapacityReservation"
+
+// CreateCapacityReservationRequest generates a "aws/request.Request" representing the
+// client's request for the CreateCapacityReservation 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 CreateCapacityReservation for more information on using the CreateCapacityReservation
+// 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 CreateCapacityReservationRequest method.
+// req, resp := client.CreateCapacityReservationRequest(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/CreateCapacityReservation
+func (c *EC2) CreateCapacityReservationRequest(input *CreateCapacityReservationInput) (req *request.Request, output *CreateCapacityReservationOutput) {
+ op := &request.Operation{
+ Name: opCreateCapacityReservation,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateCapacityReservationInput{}
+ }
+
+ output = &CreateCapacityReservationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateCapacityReservation API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a new Capacity Reservation with the specified attributes.
+//
+// Capacity Reservations enable you to reserve capacity for your Amazon EC2
+// instances in a specific Availability Zone for any duration. This gives you
+// the flexibility to selectively add capacity reservations and still get the
+// Regional RI discounts for that usage. By creating Capacity Reservations,
+// you ensure that you always have access to Amazon EC2 capacity when you need
+// it, for as long as you need it. For more information, see Capacity Reservations
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html)
+// in the Amazon Elastic Compute Cloud User Guide.
+//
+// Your request to create a Capacity Reservation could fail if Amazon EC2 does
+// not have sufficient capacity to fulfill the request. If your request fails
+// due to Amazon EC2 capacity constraints, either try again at a later time,
+// try in a different Availability Zone, or request a smaller capacity reservation.
+// If your application is flexible across instance types and sizes, try to create
+// a Capacity Reservation with different instance attributes.
+//
+// Your request could also fail if the requested quantity exceeds your On-Demand
+// Instance limit for the selected instance type. If your request fails due
+// to limit constraints, increase your On-Demand Instance limit for the required
+// instance type and try again. For more information about increasing your instance
+// limits, see Amazon EC2 Service Limits (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html)
+// in the Amazon Elastic Compute Cloud 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 CreateCapacityReservation for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateCapacityReservation
+func (c *EC2) CreateCapacityReservation(input *CreateCapacityReservationInput) (*CreateCapacityReservationOutput, error) {
+ req, out := c.CreateCapacityReservationRequest(input)
+ return out, req.Send()
+}
+
+// CreateCapacityReservationWithContext is the same as CreateCapacityReservation with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateCapacityReservation 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) CreateCapacityReservationWithContext(ctx aws.Context, input *CreateCapacityReservationInput, opts ...request.Option) (*CreateCapacityReservationOutput, error) {
+ req, out := c.CreateCapacityReservationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateClientVpnEndpoint = "CreateClientVpnEndpoint"
+
+// CreateClientVpnEndpointRequest generates a "aws/request.Request" representing the
+// client's request for the CreateClientVpnEndpoint 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 CreateClientVpnEndpoint for more information on using the CreateClientVpnEndpoint
+// 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 CreateClientVpnEndpointRequest method.
+// req, resp := client.CreateClientVpnEndpointRequest(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/CreateClientVpnEndpoint
+func (c *EC2) CreateClientVpnEndpointRequest(input *CreateClientVpnEndpointInput) (req *request.Request, output *CreateClientVpnEndpointOutput) {
+ op := &request.Operation{
+ Name: opCreateClientVpnEndpoint,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateClientVpnEndpointInput{}
+ }
+
+ output = &CreateClientVpnEndpointOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateClientVpnEndpoint API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a Client VPN endpoint. A Client VPN endpoint is the resource you
+// create and configure to enable and manage client VPN sessions. It is the
+// destination endpoint at which all client VPN sessions are terminated.
+//
+// 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 CreateClientVpnEndpoint for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnEndpoint
+func (c *EC2) CreateClientVpnEndpoint(input *CreateClientVpnEndpointInput) (*CreateClientVpnEndpointOutput, error) {
+ req, out := c.CreateClientVpnEndpointRequest(input)
+ return out, req.Send()
+}
+
+// CreateClientVpnEndpointWithContext is the same as CreateClientVpnEndpoint with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateClientVpnEndpoint 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) CreateClientVpnEndpointWithContext(ctx aws.Context, input *CreateClientVpnEndpointInput, opts ...request.Option) (*CreateClientVpnEndpointOutput, error) {
+ req, out := c.CreateClientVpnEndpointRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateClientVpnRoute = "CreateClientVpnRoute"
+
+// CreateClientVpnRouteRequest generates a "aws/request.Request" representing the
+// client's request for the CreateClientVpnRoute 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 CreateClientVpnRoute for more information on using the CreateClientVpnRoute
+// 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 CreateClientVpnRouteRequest method.
+// req, resp := client.CreateClientVpnRouteRequest(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/CreateClientVpnRoute
+func (c *EC2) CreateClientVpnRouteRequest(input *CreateClientVpnRouteInput) (req *request.Request, output *CreateClientVpnRouteOutput) {
+ op := &request.Operation{
+ Name: opCreateClientVpnRoute,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateClientVpnRouteInput{}
+ }
+
+ output = &CreateClientVpnRouteOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateClientVpnRoute API operation for Amazon Elastic Compute Cloud.
+//
+// Adds a route to a network to a Client VPN endpoint. Each Client VPN endpoint
+// has a route table that describes the available destination network routes.
+// Each route in the route table specifies the path for traffic to specific
+// resources or networks.
+//
+// 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 CreateClientVpnRoute for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateClientVpnRoute
+func (c *EC2) CreateClientVpnRoute(input *CreateClientVpnRouteInput) (*CreateClientVpnRouteOutput, error) {
+ req, out := c.CreateClientVpnRouteRequest(input)
+ return out, req.Send()
+}
+
+// CreateClientVpnRouteWithContext is the same as CreateClientVpnRoute with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateClientVpnRoute 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) CreateClientVpnRouteWithContext(ctx aws.Context, input *CreateClientVpnRouteInput, opts ...request.Option) (*CreateClientVpnRouteOutput, error) {
+ req, out := c.CreateClientVpnRouteRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCreateCustomerGateway = "CreateCustomerGateway"
// CreateCustomerGatewayRequest generates a "aws/request.Request" representing the
// client's request for the CreateCustomerGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2681,12 +3487,11 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r
// a private ASN (in the 64512 - 65534 range).
//
// Amazon EC2 supports all 2-byte ASN numbers in the range of 1 - 65534, with
-// the exception of 7224, which is reserved in the us-east-1 region, and 9059,
-// which is reserved in the eu-west-1 region.
+// the exception of 7224, which is reserved in the us-east-1 Region, and 9059,
+// which is reserved in the eu-west-1 Region.
//
-// For more information about VPN customer gateways, see AWS Managed VPN Connections
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the
-// Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN User Guide.
//
// You cannot create more than one customer gateway with the same VPN type,
// IP address, and BGP ASN parameter values. If you run an identical request
@@ -2727,7 +3532,7 @@ const opCreateDefaultSubnet = "CreateDefaultSubnet"
// CreateDefaultSubnetRequest generates a "aws/request.Request" representing the
// client's request for the CreateDefaultSubnet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2769,7 +3574,7 @@ func (c *EC2) CreateDefaultSubnetRequest(input *CreateDefaultSubnetInput) (req *
// Creates a default subnet with a size /20 IPv4 CIDR block in the specified
// Availability Zone in your default VPC. You can have only one default subnet
// per Availability Zone. For more information, see Creating a Default Subnet
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html#create-default-subnet)
+// (https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#create-default-subnet)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2805,7 +3610,7 @@ const opCreateDefaultVpc = "CreateDefaultVpc"
// CreateDefaultVpcRequest generates a "aws/request.Request" representing the
// client's request for the CreateDefaultVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2846,16 +3651,16 @@ func (c *EC2) CreateDefaultVpcRequest(input *CreateDefaultVpcInput) (req *reques
//
// Creates a default VPC with a size /16 IPv4 CIDR block and a default subnet
// in each Availability Zone. For more information about the components of a
-// default VPC, see Default VPC and Default Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/default-vpc.html)
+// default VPC, see Default VPC and Default Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)
// in the Amazon Virtual Private Cloud User Guide. You cannot specify the components
// of the default VPC yourself.
//
-// You can create a default VPC if you deleted your previous default VPC. You
-// cannot have more than one default VPC per region.
+// If you deleted your previous default VPC, you can create a default VPC. You
+// cannot have more than one default VPC per Region.
//
// If your account supports EC2-Classic, you cannot use this action to create
-// a default VPC in a region that supports EC2-Classic. If you want a default
-// VPC in a region that supports EC2-Classic, see "I really want a default VPC
+// a default VPC in a Region that supports EC2-Classic. If you want a default
+// VPC in a Region that supports EC2-Classic, see "I really want a default VPC
// for my existing EC2 account. Is that possible?" in the Default VPCs FAQ (http://aws.amazon.com/vpc/faqs/#Default_VPCs).
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2891,7 +3696,7 @@ const opCreateDhcpOptions = "CreateDhcpOptions"
// CreateDhcpOptionsRequest generates a "aws/request.Request" representing the
// client's request for the CreateDhcpOptions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2939,12 +3744,12 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ
// * 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. If you want your instance
-// to receive a custom DNS hostname as specified in domain-name, you must
-// set domain-name-servers to a custom DNS server.
+// 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.
//
// * domain-name - If you're using AmazonProvidedDNS in us-east-1, specify
-// ec2.internal. If you're using AmazonProvidedDNS in another region, 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, MyCompany.com). This value
// is used to complete unqualified DNS hostnames. Important: Some Linux operating
@@ -2965,10 +3770,9 @@ func (c *EC2) CreateDhcpOptionsRequest(input *CreateDhcpOptionsInput) (req *requ
//
// 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
+// 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 about DHCP options, see DHCP
-// Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html)
+// 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 Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3004,7 +3808,7 @@ const opCreateEgressOnlyInternetGateway = "CreateEgressOnlyInternetGateway"
// CreateEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the CreateEgressOnlyInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3043,9 +3847,9 @@ func (c *EC2) CreateEgressOnlyInternetGatewayRequest(input *CreateEgressOnlyInte
// CreateEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// [IPv6 only] Creates an egress-only Internet gateway for your VPC. An egress-only
-// Internet gateway is used to enable outbound communication over IPv6 from
-// instances in your VPC to the Internet, and prevents hosts outside of your
+// [IPv6 only] Creates an egress-only internet gateway for your VPC. An egress-only
+// internet gateway is used to enable outbound communication over IPv6 from
+// instances in your VPC to the internet, and prevents hosts outside of your
// VPC from initiating an IPv6 connection with your instance.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3081,7 +3885,7 @@ const opCreateFleet = "CreateFleet"
// CreateFleetRequest generates a "aws/request.Request" representing the
// client's request for the CreateFleet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3125,7 +3929,7 @@ func (c *EC2) CreateFleetRequest(input *CreateFleetInput) (req *request.Request,
// You can create a single EC2 Fleet that includes multiple launch specifications
// that vary by instance type, AMI, Availability Zone, or subnet.
//
-// For more information, see Launching an EC2 Fleet (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html)
+// For more information, see Launching an EC2 Fleet (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3161,7 +3965,7 @@ const opCreateFlowLogs = "CreateFlowLogs"
// CreateFlowLogsRequest generates a "aws/request.Request" representing the
// client's request for the CreateFlowLogs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3200,18 +4004,21 @@ func (c *EC2) CreateFlowLogsRequest(input *CreateFlowLogsInput) (req *request.Re
// CreateFlowLogs API operation for Amazon Elastic Compute Cloud.
//
-// Creates one or more flow logs to capture IP traffic for a specific network
-// interface, subnet, or VPC. Flow logs are delivered to a specified log group
-// in Amazon CloudWatch Logs. If you specify a VPC or subnet in the request,
-// a log stream is created in CloudWatch Logs for each network interface in
-// the subnet or VPC. Log streams can include information about accepted and
-// rejected traffic to a network interface. You can view the data in your log
-// streams using Amazon CloudWatch Logs.
+// Creates one or more flow logs to capture information about IP traffic for
+// a specific network interface, subnet, or VPC.
//
-// In your request, you must also specify an IAM role that has permission to
-// publish logs to CloudWatch Logs.
+// 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.
//
-// For more information, see VPC Flow Logs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html)
+// 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.
+// When publishing to Amazon S3, flow log records for all of the monitored network
+// interfaces are published to a single log file object that is stored in the
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3247,7 +4054,7 @@ const opCreateFpgaImage = "CreateFpgaImage"
// CreateFpgaImageRequest generates a "aws/request.Request" representing the
// client's request for the CreateFpgaImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3292,8 +4099,8 @@ func (c *EC2) CreateFpgaImageRequest(input *CreateFpgaImageInput) (req *request.
// use, check the output logs.
//
// An AFI contains the FPGA bitstream that is ready to download to an FPGA.
-// You can securely deploy an AFI on one or more FPGA-accelerated instances.
-// For more information, see the AWS FPGA Hardware Development Kit (https://github.com/aws/aws-fpga/).
+// You can securely deploy an AFI on multiple FPGA-accelerated instances. For
+// more information, see the AWS FPGA Hardware Development Kit (https://github.com/aws/aws-fpga/).
//
// 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
@@ -3328,7 +4135,7 @@ const opCreateImage = "CreateImage"
// CreateImageRequest generates a "aws/request.Request" representing the
// client's request for the CreateImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3375,7 +4182,7 @@ func (c *EC2) CreateImageRequest(input *CreateImageInput) (req *request.Request,
// mapping information for those volumes. When you launch an instance from this
// new AMI, the instance automatically launches with those additional volumes.
//
-// For more information, see Creating Amazon EBS-Backed Linux AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html)
+// For more information, see Creating Amazon EBS-Backed Linux AMIs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3411,7 +4218,7 @@ const opCreateInstanceExportTask = "CreateInstanceExportTask"
// CreateInstanceExportTaskRequest generates a "aws/request.Request" representing the
// client's request for the CreateInstanceExportTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3454,7 +4261,7 @@ func (c *EC2) CreateInstanceExportTaskRequest(input *CreateInstanceExportTaskInp
//
// For information about the supported operating systems, image formats, and
// known limitations for the types of instances you can export, see Exporting
-// an Instance as a VM Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html)
+// an Instance as a VM Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport.html)
// in the VM Import/Export User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3490,7 +4297,7 @@ const opCreateInternetGateway = "CreateInternetGateway"
// CreateInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the CreateInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3529,11 +4336,11 @@ func (c *EC2) CreateInternetGatewayRequest(input *CreateInternetGatewayInput) (r
// CreateInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// Creates an Internet gateway for use with a VPC. After creating the Internet
+// Creates an internet gateway for use with a VPC. After creating the internet
// gateway, you attach it to a VPC using AttachInternetGateway.
//
-// For more information about your VPC and Internet gateway, see the Amazon
-// Virtual Private Cloud User Guide (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/).
+// For more information about your VPC and internet gateway, see the Amazon
+// Virtual Private Cloud User Guide (https://docs.aws.amazon.com/vpc/latest/userguide/).
//
// 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
@@ -3568,7 +4375,7 @@ const opCreateKeyPair = "CreateKeyPair"
// CreateKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the CreateKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3612,13 +4419,13 @@ func (c *EC2) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Requ
// private key is returned as an unencrypted PEM encoded PKCS#1 private key.
// If a key with the specified name already exists, Amazon EC2 returns an error.
//
-// You can have up to five thousand key pairs per region.
+// You can have up to five thousand key pairs per Region.
//
-// The key pair returned to you is available only in the region in which you
+// The key pair returned to you is available only in the Region in which you
// create it. If you prefer, you can create your own key pair using a third-party
-// tool and upload it to any region using ImportKeyPair.
+// tool and upload it to any Region using ImportKeyPair.
//
-// For more information, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
+// For more information, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3654,7 +4461,7 @@ const opCreateLaunchTemplate = "CreateLaunchTemplate"
// CreateLaunchTemplateRequest generates a "aws/request.Request" representing the
// client's request for the CreateLaunchTemplate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3730,7 +4537,7 @@ const opCreateLaunchTemplateVersion = "CreateLaunchTemplateVersion"
// CreateLaunchTemplateVersionRequest generates a "aws/request.Request" representing the
// client's request for the CreateLaunchTemplateVersion operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3808,7 +4615,7 @@ const opCreateNatGateway = "CreateNatGateway"
// CreateNatGatewayRequest generates a "aws/request.Request" representing the
// client's request for the CreateNatGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3852,7 +4659,7 @@ func (c *EC2) CreateNatGatewayRequest(input *CreateNatGatewayInput) (req *reques
// the IP address range of the subnet. Internet-bound traffic from a private
// subnet can be routed to the NAT gateway, therefore enabling instances in
// the private subnet to connect to the internet. For more information, see
-// NAT Gateways (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html)
+// NAT Gateways (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3888,7 +4695,7 @@ const opCreateNetworkAcl = "CreateNetworkAcl"
// CreateNetworkAclRequest generates a "aws/request.Request" representing the
// client's request for the CreateNetworkAcl operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3930,7 +4737,7 @@ func (c *EC2) CreateNetworkAclRequest(input *CreateNetworkAclInput) (req *reques
// Creates a network ACL in a VPC. Network ACLs provide an optional layer of
// security (in addition to security groups) for the instances in your VPC.
//
-// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html)
+// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3966,7 +4773,7 @@ const opCreateNetworkAclEntry = "CreateNetworkAclEntry"
// CreateNetworkAclEntryRequest generates a "aws/request.Request" representing the
// client's request for the CreateNetworkAclEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4000,8 +4807,7 @@ func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (r
output = &CreateNetworkAclEntryOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -4022,7 +4828,7 @@ func (c *EC2) CreateNetworkAclEntryRequest(input *CreateNetworkAclEntryInput) (r
// After you add an entry, you can't modify it; you must either replace it,
// or create an entry and delete the old one.
//
-// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html)
+// For more information about network ACLs, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4058,7 +4864,7 @@ const opCreateNetworkInterface = "CreateNetworkInterface"
// CreateNetworkInterfaceRequest generates a "aws/request.Request" representing the
// client's request for the CreateNetworkInterface operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4100,7 +4906,7 @@ func (c *EC2) CreateNetworkInterfaceRequest(input *CreateNetworkInterfaceInput)
// Creates a network interface in the specified subnet.
//
// For more information about network interfaces, see Elastic Network Interfaces
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) in the
// Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4136,7 +4942,7 @@ const opCreateNetworkInterfacePermission = "CreateNetworkInterfacePermission"
// CreateNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the
// client's request for the CreateNetworkInterfacePermission operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4214,7 +5020,7 @@ const opCreatePlacementGroup = "CreatePlacementGroup"
// CreatePlacementGroupRequest generates a "aws/request.Request" representing the
// client's request for the CreatePlacementGroup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4248,8 +5054,7 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req
output = &CreatePlacementGroupOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -4260,9 +5065,12 @@ func (c *EC2) CreatePlacementGroupRequest(input *CreatePlacementGroupInput) (req
//
// A cluster placement group is a logical grouping of instances within a single
// Availability Zone that benefit from low network latency, high network throughput.
-// A spread placement group places instances on distinct hardware.
+// A spread placement group places instances on distinct hardware. A partition
+// placement group places groups of instances in different partitions, where
+// instances in one partition do not share the same hardware with instances
+// in another partition.
//
-// For more information, see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
+// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4298,7 +5106,7 @@ const opCreateReservedInstancesListing = "CreateReservedInstancesListing"
// CreateReservedInstancesListingRequest generates a "aws/request.Request" representing the
// client's request for the CreateReservedInstancesListing operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4342,9 +5150,8 @@ func (c *EC2) CreateReservedInstancesListingRequest(input *CreateReservedInstanc
// listing at a time. To get a list of your Standard Reserved Instances, you
// can use the DescribeReservedInstances operation.
//
-// Only Standard Reserved Instances with a capacity reservation can be sold
-// in the Reserved Instance Marketplace. Convertible Reserved Instances and
-// Standard Reserved Instances with a regional benefit cannot be sold.
+// Only Standard Reserved Instances can be sold in the Reserved Instance Marketplace.
+// Convertible Reserved Instances cannot be sold.
//
// The Reserved Instance Marketplace matches sellers who want to resell Standard
// Reserved Instance capacity that they no longer need with buyers who want
@@ -4359,7 +5166,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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4395,7 +5202,7 @@ const opCreateRoute = "CreateRoute"
// CreateRouteRequest generates a "aws/request.Request" representing the
// client's request for the CreateRoute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4436,9 +5243,9 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request,
//
// Creates a route in a route table within a VPC.
//
-// You must specify one of the following targets: Internet gateway or virtual
+// You must specify one of the following targets: internet gateway or virtual
// private gateway, NAT instance, NAT gateway, VPC peering connection, network
-// interface, or egress-only Internet gateway.
+// interface, or egress-only internet gateway.
//
// When determining how to route traffic, we use the route with the most specific
// match. For example, traffic is destined for the IPv4 address 192.0.2.3, and
@@ -4452,7 +5259,7 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request,
// route in the list covers a smaller number of IP addresses and is therefore
// more specific, so we use that route to determine where to target the traffic.
//
-// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// For more information about route tables, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4488,7 +5295,7 @@ const opCreateRouteTable = "CreateRouteTable"
// CreateRouteTableRequest generates a "aws/request.Request" representing the
// client's request for the CreateRouteTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4530,7 +5337,7 @@ func (c *EC2) CreateRouteTableRequest(input *CreateRouteTableInput) (req *reques
// Creates a route table for the specified VPC. After you create a route table,
// you can add routes and associate the table with a subnet.
//
-// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4566,7 +5373,7 @@ const opCreateSecurityGroup = "CreateSecurityGroup"
// CreateSecurityGroupRequest generates a "aws/request.Request" representing the
// client's request for the CreateSecurityGroup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4607,17 +5414,13 @@ func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *
//
// Creates a security group.
//
-// A security group is for use with instances either in the EC2-Classic platform
-// or in a specific VPC. For more information, see Amazon EC2 Security Groups
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html)
+// A security group acts as a virtual firewall for your instance to control
+// inbound and outbound traffic. For more information, see Amazon EC2 Security
+// Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html)
// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your
-// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html)
+// VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html)
// in the Amazon Virtual Private Cloud User Guide.
//
-// EC2-Classic: You can have up to 500 security groups.
-//
-// EC2-VPC: You can create up to 500 security groups per VPC.
-//
// When you create a security group, you specify a friendly name of your choice.
// You can have a security group for use in EC2-Classic with the same name as
// a security group for use in a VPC. However, you can't have two security groups
@@ -4633,6 +5436,9 @@ func (c *EC2) CreateSecurityGroupRequest(input *CreateSecurityGroupInput) (req *
// You can add or remove rules from your security groups using AuthorizeSecurityGroupIngress,
// AuthorizeSecurityGroupEgress, RevokeSecurityGroupIngress, and RevokeSecurityGroupEgress.
//
+// For more information about VPC security group limits, see Amazon VPC Limits
+// (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.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
// the error.
@@ -4666,7 +5472,7 @@ const opCreateSnapshot = "CreateSnapshot"
// CreateSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CreateSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4731,10 +5537,11 @@ func (c *EC2) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Re
// protected.
//
// You can tag your snapshots during creation. For more information, see Tagging
-// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
+// Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// in the Amazon Elastic Compute Cloud User Guide.
//
-// For more information, see Amazon Elastic Block Store (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html)
-// and Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4765,12 +5572,89 @@ func (c *EC2) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotIn
return out, req.Send()
}
+const opCreateSnapshots = "CreateSnapshots"
+
+// CreateSnapshotsRequest generates a "aws/request.Request" representing the
+// client's request for the CreateSnapshots 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 CreateSnapshots for more information on using the CreateSnapshots
+// 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 CreateSnapshotsRequest method.
+// req, resp := client.CreateSnapshotsRequest(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/CreateSnapshots
+func (c *EC2) CreateSnapshotsRequest(input *CreateSnapshotsInput) (req *request.Request, output *CreateSnapshotsOutput) {
+ op := &request.Operation{
+ Name: opCreateSnapshots,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateSnapshotsInput{}
+ }
+
+ output = &CreateSnapshotsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateSnapshots API operation for Amazon Elastic Compute Cloud.
+//
+// Creates crash-consistent snapshots of multiple EBS volumes and stores the
+// data in S3. Volumes are chosen by specifying an instance. Any attached volumes
+// will produce one snapshot each that is crash-consistent across the instance.
+// Boot volumes can be excluded by changing the paramaters.
+//
+// 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 CreateSnapshots for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateSnapshots
+func (c *EC2) CreateSnapshots(input *CreateSnapshotsInput) (*CreateSnapshotsOutput, error) {
+ req, out := c.CreateSnapshotsRequest(input)
+ return out, req.Send()
+}
+
+// CreateSnapshotsWithContext is the same as CreateSnapshots with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateSnapshots 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) CreateSnapshotsWithContext(ctx aws.Context, input *CreateSnapshotsInput, opts ...request.Option) (*CreateSnapshotsOutput, error) {
+ req, out := c.CreateSnapshotsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCreateSpotDatafeedSubscription = "CreateSpotDatafeedSubscription"
// CreateSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the
// client's request for the CreateSpotDatafeedSubscription operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4811,7 +5695,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 AWS account. For more information,
-// see Spot Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4847,7 +5731,7 @@ const opCreateSubnet = "CreateSubnet"
// CreateSubnetRequest generates a "aws/request.Request" representing the
// client's request for the CreateSubnet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4888,13 +5772,13 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Reques
//
// Creates a subnet in an existing VPC.
//
-// When you create each subnet, you provide the VPC ID and the IPv4 CIDR block
-// you want for the subnet. After you create a subnet, you can't change its
-// CIDR block. The size of the subnet's IPv4 CIDR block can be the same as a
-// VPC's IPv4 CIDR block, or a subset of a VPC's IPv4 CIDR block. If you create
-// more than one subnet in a VPC, the subnets' CIDR blocks must not overlap.
-// The smallest IPv4 subnet (and VPC) you can create uses a /28 netmask (16
-// IPv4 addresses), and the largest uses a /16 netmask (65,536 IPv4 addresses).
+// When you create each subnet, you provide the VPC ID and IPv4 CIDR block for
+// the subnet. After you create a subnet, you can't change its CIDR block. The
+// size of the subnet's IPv4 CIDR block can be the same as a VPC's IPv4 CIDR
+// block, or a subset of a VPC's IPv4 CIDR block. If you create more than one
+// subnet in a VPC, the subnets' CIDR blocks must not overlap. The smallest
+// IPv4 subnet (and VPC) you can create uses a /28 netmask (16 IPv4 addresses),
+// and the largest uses a /16 netmask (65,536 IPv4 addresses).
//
// If you've associated an IPv6 CIDR block with your VPC, you can create a subnet
// with an IPv6 CIDR block that uses a /64 prefix length.
@@ -4911,7 +5795,7 @@ func (c *EC2) CreateSubnetRequest(input *CreateSubnetInput) (req *request.Reques
// It's therefore possible to have a subnet with no running instances (they're
// all stopped), but no remaining IP addresses available.
//
-// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html)
+// For more information about subnets, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4947,7 +5831,7 @@ const opCreateTags = "CreateTags"
// CreateTagsRequest generates a "aws/request.Request" representing the
// client's request for the CreateTags operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4981,21 +5865,20 @@ func (c *EC2) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o
output = &CreateTagsOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// CreateTags API operation for Amazon Elastic Compute Cloud.
//
-// Adds or overwrites one or more tags for the specified Amazon EC2 resource
+// Adds or overwrites the specified tags for the specified Amazon EC2 resource
// or resources. Each resource can have a maximum of 50 tags. Each tag consists
// of a key and optional value. Tag keys must be unique per resource.
//
-// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
// in the Amazon Elastic Compute Cloud User Guide. For more information about
// creating IAM policies that control users' access to resources based on tags,
-// see Supported Resource-Level Permissions for Amazon EC2 API Actions (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html)
+// see Supported Resource-Level Permissions for Amazon EC2 API Actions (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-iam-actions-resources.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -5026,12 +5909,661 @@ func (c *EC2) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opt
return out, req.Send()
}
+const opCreateTrafficMirrorFilter = "CreateTrafficMirrorFilter"
+
+// CreateTrafficMirrorFilterRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTrafficMirrorFilter 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 CreateTrafficMirrorFilter for more information on using the CreateTrafficMirrorFilter
+// 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 CreateTrafficMirrorFilterRequest method.
+// req, resp := client.CreateTrafficMirrorFilterRequest(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/CreateTrafficMirrorFilter
+func (c *EC2) CreateTrafficMirrorFilterRequest(input *CreateTrafficMirrorFilterInput) (req *request.Request, output *CreateTrafficMirrorFilterOutput) {
+ op := &request.Operation{
+ Name: opCreateTrafficMirrorFilter,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTrafficMirrorFilterInput{}
+ }
+
+ output = &CreateTrafficMirrorFilterOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTrafficMirrorFilter API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a Traffic Mirror filter.
+//
+// A Traffic Mirror filter is a set of rules that defines the traffic to mirror.
+//
+// By default, no traffic is mirrored. To mirror traffic, use CreateTrafficMirrorFilterRule
+// to add Traffic Mirror rules to the filter. The rules you add define what
+// traffic gets mirrored. You can also use ModifyTrafficMirrorFilterNetworkServices
+// to mirror supported network services.
+//
+// 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 CreateTrafficMirrorFilter for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTrafficMirrorFilter
+func (c *EC2) CreateTrafficMirrorFilter(input *CreateTrafficMirrorFilterInput) (*CreateTrafficMirrorFilterOutput, error) {
+ req, out := c.CreateTrafficMirrorFilterRequest(input)
+ return out, req.Send()
+}
+
+// CreateTrafficMirrorFilterWithContext is the same as CreateTrafficMirrorFilter with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTrafficMirrorFilter 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) CreateTrafficMirrorFilterWithContext(ctx aws.Context, input *CreateTrafficMirrorFilterInput, opts ...request.Option) (*CreateTrafficMirrorFilterOutput, error) {
+ req, out := c.CreateTrafficMirrorFilterRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTrafficMirrorFilterRule = "CreateTrafficMirrorFilterRule"
+
+// CreateTrafficMirrorFilterRuleRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTrafficMirrorFilterRule 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 CreateTrafficMirrorFilterRule for more information on using the CreateTrafficMirrorFilterRule
+// 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 CreateTrafficMirrorFilterRuleRequest method.
+// req, resp := client.CreateTrafficMirrorFilterRuleRequest(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/CreateTrafficMirrorFilterRule
+func (c *EC2) CreateTrafficMirrorFilterRuleRequest(input *CreateTrafficMirrorFilterRuleInput) (req *request.Request, output *CreateTrafficMirrorFilterRuleOutput) {
+ op := &request.Operation{
+ Name: opCreateTrafficMirrorFilterRule,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTrafficMirrorFilterRuleInput{}
+ }
+
+ output = &CreateTrafficMirrorFilterRuleOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTrafficMirrorFilterRule API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a Traffic Mirror rule.
+//
+// A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror.
+//
+// You need the Traffic Mirror filter ID when you create the rule.
+//
+// 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 CreateTrafficMirrorFilterRule for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTrafficMirrorFilterRule
+func (c *EC2) CreateTrafficMirrorFilterRule(input *CreateTrafficMirrorFilterRuleInput) (*CreateTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.CreateTrafficMirrorFilterRuleRequest(input)
+ return out, req.Send()
+}
+
+// CreateTrafficMirrorFilterRuleWithContext is the same as CreateTrafficMirrorFilterRule with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTrafficMirrorFilterRule 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) CreateTrafficMirrorFilterRuleWithContext(ctx aws.Context, input *CreateTrafficMirrorFilterRuleInput, opts ...request.Option) (*CreateTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.CreateTrafficMirrorFilterRuleRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTrafficMirrorSession = "CreateTrafficMirrorSession"
+
+// CreateTrafficMirrorSessionRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTrafficMirrorSession 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 CreateTrafficMirrorSession for more information on using the CreateTrafficMirrorSession
+// 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 CreateTrafficMirrorSessionRequest method.
+// req, resp := client.CreateTrafficMirrorSessionRequest(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/CreateTrafficMirrorSession
+func (c *EC2) CreateTrafficMirrorSessionRequest(input *CreateTrafficMirrorSessionInput) (req *request.Request, output *CreateTrafficMirrorSessionOutput) {
+ op := &request.Operation{
+ Name: opCreateTrafficMirrorSession,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTrafficMirrorSessionInput{}
+ }
+
+ output = &CreateTrafficMirrorSessionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTrafficMirrorSession API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a Traffic Mirror session.
+//
+// A Traffic Mirror session actively copies packets from a Traffic Mirror source
+// to a Traffic Mirror target. Create a filter, and then assign it to the session
+// to define a subset of the traffic to mirror, for example all TCP traffic.
+//
+// The Traffic Mirror source and the Traffic Mirror target (monitoring appliances)
+// can be in the same VPC, or in a different VPC connected via VPC peering or
+// a transit gateway.
+//
+// By default, no traffic is mirrored. Use CreateTrafficMirrorFilter to create
+// filter rules that specify the traffic to mirror.
+//
+// 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 CreateTrafficMirrorSession for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTrafficMirrorSession
+func (c *EC2) CreateTrafficMirrorSession(input *CreateTrafficMirrorSessionInput) (*CreateTrafficMirrorSessionOutput, error) {
+ req, out := c.CreateTrafficMirrorSessionRequest(input)
+ return out, req.Send()
+}
+
+// CreateTrafficMirrorSessionWithContext is the same as CreateTrafficMirrorSession with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTrafficMirrorSession 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) CreateTrafficMirrorSessionWithContext(ctx aws.Context, input *CreateTrafficMirrorSessionInput, opts ...request.Option) (*CreateTrafficMirrorSessionOutput, error) {
+ req, out := c.CreateTrafficMirrorSessionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTrafficMirrorTarget = "CreateTrafficMirrorTarget"
+
+// CreateTrafficMirrorTargetRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTrafficMirrorTarget 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 CreateTrafficMirrorTarget for more information on using the CreateTrafficMirrorTarget
+// 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 CreateTrafficMirrorTargetRequest method.
+// req, resp := client.CreateTrafficMirrorTargetRequest(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/CreateTrafficMirrorTarget
+func (c *EC2) CreateTrafficMirrorTargetRequest(input *CreateTrafficMirrorTargetInput) (req *request.Request, output *CreateTrafficMirrorTargetOutput) {
+ op := &request.Operation{
+ Name: opCreateTrafficMirrorTarget,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTrafficMirrorTargetInput{}
+ }
+
+ output = &CreateTrafficMirrorTargetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTrafficMirrorTarget API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a target for your Traffic Mirror session.
+//
+// A Traffic Mirror target is the destination for mirrored traffic. The Traffic
+// Mirror source and the Traffic Mirror target (monitoring appliances) can be
+// in the same VPC, or in different VPCs connected via VPC peering or a transit
+// gateway.
+//
+// A Traffic Mirror target can be a network interface, or a Network Load Balancer.
+//
+// To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession.
+//
+// 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 CreateTrafficMirrorTarget for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTrafficMirrorTarget
+func (c *EC2) CreateTrafficMirrorTarget(input *CreateTrafficMirrorTargetInput) (*CreateTrafficMirrorTargetOutput, error) {
+ req, out := c.CreateTrafficMirrorTargetRequest(input)
+ return out, req.Send()
+}
+
+// CreateTrafficMirrorTargetWithContext is the same as CreateTrafficMirrorTarget with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTrafficMirrorTarget 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) CreateTrafficMirrorTargetWithContext(ctx aws.Context, input *CreateTrafficMirrorTargetInput, opts ...request.Option) (*CreateTrafficMirrorTargetOutput, error) {
+ req, out := c.CreateTrafficMirrorTargetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTransitGateway = "CreateTransitGateway"
+
+// CreateTransitGatewayRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTransitGateway 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 CreateTransitGateway for more information on using the CreateTransitGateway
+// 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 CreateTransitGatewayRequest method.
+// req, resp := client.CreateTransitGatewayRequest(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/CreateTransitGateway
+func (c *EC2) CreateTransitGatewayRequest(input *CreateTransitGatewayInput) (req *request.Request, output *CreateTransitGatewayOutput) {
+ op := &request.Operation{
+ Name: opCreateTransitGateway,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTransitGatewayInput{}
+ }
+
+ output = &CreateTransitGatewayOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTransitGateway API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a transit gateway.
+//
+// You can use a transit gateway to interconnect your virtual private clouds
+// (VPC) and on-premises networks. After the transit gateway enters the available
+// state, you can attach your VPCs and VPN connections to the transit gateway.
+//
+// To attach your VPCs, use CreateTransitGatewayVpcAttachment.
+//
+// To attach a VPN connection, use CreateCustomerGateway to create a customer
+// gateway and specify the ID of the customer gateway and the ID of the transit
+// gateway in a call to CreateVpnConnection.
+//
+// When you create a transit gateway, we create a default transit gateway route
+// table and use it as the default association route table and the default propagation
+// route table. You can use CreateTransitGatewayRouteTable to create additional
+// transit gateway route tables. If you disable automatic route propagation,
+// we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation
+// to propagate routes from a resource attachment to a transit gateway route
+// table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable
+// to associate a resource attachment with a 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation CreateTransitGateway for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGateway
+func (c *EC2) CreateTransitGateway(input *CreateTransitGatewayInput) (*CreateTransitGatewayOutput, error) {
+ req, out := c.CreateTransitGatewayRequest(input)
+ return out, req.Send()
+}
+
+// CreateTransitGatewayWithContext is the same as CreateTransitGateway with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTransitGateway 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) CreateTransitGatewayWithContext(ctx aws.Context, input *CreateTransitGatewayInput, opts ...request.Option) (*CreateTransitGatewayOutput, error) {
+ req, out := c.CreateTransitGatewayRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTransitGatewayRoute = "CreateTransitGatewayRoute"
+
+// CreateTransitGatewayRouteRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTransitGatewayRoute 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 CreateTransitGatewayRoute for more information on using the CreateTransitGatewayRoute
+// 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 CreateTransitGatewayRouteRequest method.
+// req, resp := client.CreateTransitGatewayRouteRequest(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/CreateTransitGatewayRoute
+func (c *EC2) CreateTransitGatewayRouteRequest(input *CreateTransitGatewayRouteInput) (req *request.Request, output *CreateTransitGatewayRouteOutput) {
+ op := &request.Operation{
+ Name: opCreateTransitGatewayRoute,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTransitGatewayRouteInput{}
+ }
+
+ output = &CreateTransitGatewayRouteOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTransitGatewayRoute API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a static route for the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation CreateTransitGatewayRoute for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRoute
+func (c *EC2) CreateTransitGatewayRoute(input *CreateTransitGatewayRouteInput) (*CreateTransitGatewayRouteOutput, error) {
+ req, out := c.CreateTransitGatewayRouteRequest(input)
+ return out, req.Send()
+}
+
+// CreateTransitGatewayRouteWithContext is the same as CreateTransitGatewayRoute with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTransitGatewayRoute 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) CreateTransitGatewayRouteWithContext(ctx aws.Context, input *CreateTransitGatewayRouteInput, opts ...request.Option) (*CreateTransitGatewayRouteOutput, error) {
+ req, out := c.CreateTransitGatewayRouteRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTransitGatewayRouteTable = "CreateTransitGatewayRouteTable"
+
+// CreateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTransitGatewayRouteTable 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 CreateTransitGatewayRouteTable for more information on using the CreateTransitGatewayRouteTable
+// 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 CreateTransitGatewayRouteTableRequest method.
+// req, resp := client.CreateTransitGatewayRouteTableRequest(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/CreateTransitGatewayRouteTable
+func (c *EC2) CreateTransitGatewayRouteTableRequest(input *CreateTransitGatewayRouteTableInput) (req *request.Request, output *CreateTransitGatewayRouteTableOutput) {
+ op := &request.Operation{
+ Name: opCreateTransitGatewayRouteTable,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTransitGatewayRouteTableInput{}
+ }
+
+ output = &CreateTransitGatewayRouteTableOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.
+//
+// Creates a route table for the specified transit gateway.
+//
+// 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 CreateTransitGatewayRouteTable for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayRouteTable
+func (c *EC2) CreateTransitGatewayRouteTable(input *CreateTransitGatewayRouteTableInput) (*CreateTransitGatewayRouteTableOutput, error) {
+ req, out := c.CreateTransitGatewayRouteTableRequest(input)
+ return out, req.Send()
+}
+
+// CreateTransitGatewayRouteTableWithContext is the same as CreateTransitGatewayRouteTable with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTransitGatewayRouteTable 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) CreateTransitGatewayRouteTableWithContext(ctx aws.Context, input *CreateTransitGatewayRouteTableInput, opts ...request.Option) (*CreateTransitGatewayRouteTableOutput, error) {
+ req, out := c.CreateTransitGatewayRouteTableRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateTransitGatewayVpcAttachment = "CreateTransitGatewayVpcAttachment"
+
+// CreateTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTransitGatewayVpcAttachment 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 CreateTransitGatewayVpcAttachment for more information on using the CreateTransitGatewayVpcAttachment
+// 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 CreateTransitGatewayVpcAttachmentRequest method.
+// req, resp := client.CreateTransitGatewayVpcAttachmentRequest(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/CreateTransitGatewayVpcAttachment
+func (c *EC2) CreateTransitGatewayVpcAttachmentRequest(input *CreateTransitGatewayVpcAttachmentInput) (req *request.Request, output *CreateTransitGatewayVpcAttachmentOutput) {
+ op := &request.Operation{
+ Name: opCreateTransitGatewayVpcAttachment,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTransitGatewayVpcAttachmentInput{}
+ }
+
+ output = &CreateTransitGatewayVpcAttachmentOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.
+//
+// Attaches the specified VPC to the specified transit gateway.
+//
+// If you attach a VPC with a CIDR range that overlaps the CIDR range of a VPC
+// that is already attached, the new VPC CIDR range is not propagated to the
+// default propagation route table.
+//
+// To send VPC traffic to an attached transit gateway, add a route to the VPC
+// route table using CreateRoute.
+//
+// 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 CreateTransitGatewayVpcAttachment for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayVpcAttachment
+func (c *EC2) CreateTransitGatewayVpcAttachment(input *CreateTransitGatewayVpcAttachmentInput) (*CreateTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.CreateTransitGatewayVpcAttachmentRequest(input)
+ return out, req.Send()
+}
+
+// CreateTransitGatewayVpcAttachmentWithContext is the same as CreateTransitGatewayVpcAttachment with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTransitGatewayVpcAttachment 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) CreateTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *CreateTransitGatewayVpcAttachmentInput, opts ...request.Option) (*CreateTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.CreateTransitGatewayVpcAttachmentRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCreateVolume = "CreateVolume"
// CreateVolumeRequest generates a "aws/request.Request" representing the
// client's request for the CreateVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5072,22 +6604,23 @@ func (c *EC2) CreateVolumeRequest(input *CreateVolumeInput) (req *request.Reques
//
// Creates an EBS volume that can be attached to an instance in the same Availability
// Zone. The volume is created in the regional endpoint that you send the HTTP
-// request to. For more information see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html).
+// request to. For more information see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html).
//
// You can create a new empty volume or restore a volume from an EBS snapshot.
// Any AWS Marketplace product codes from the snapshot are propagated to the
// volume.
//
-// You can create encrypted volumes with the Encrypted parameter. Encrypted
-// volumes may only 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
+// 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.
//
// You can tag your volumes during creation. For more information, see Tagging
-// Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
+// Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// in the Amazon Elastic Compute Cloud User Guide.
//
-// For more information, see Creating an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html)
+// For more information, see Creating an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-creating-volume.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -5123,7 +6656,7 @@ const opCreateVpc = "CreateVpc"
// CreateVpcRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5164,8 +6697,8 @@ func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, out
//
// Creates a VPC with the specified IPv4 CIDR block. The smallest VPC you can
// create uses a /28 netmask (16 IPv4 addresses), and the largest uses a /16
-// netmask (65,536 IPv4 addresses). To help you decide how big to make your
-// VPC, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html)
+// netmask (65,536 IPv4 addresses). For more information about how large to
+// make your VPC, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// You can optionally request an Amazon-provided IPv6 CIDR block for the VPC.
@@ -5173,13 +6706,13 @@ func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, out
// pool of IPv6 addresses. You cannot choose the IPv6 range for your VPC.
//
// By default, each instance you launch in the VPC has the default DHCP options,
-// which includes only a default DNS server that we provide (AmazonProvidedDNS).
-// For more information about DHCP options, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html)
+// which include only a default DNS server that we provide (AmazonProvidedDNS).
+// For more information, see DHCP Options Sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// You can specify the instance tenancy value for the VPC when you create it.
// You can't change this value for the VPC after you create it. For more information,
-// see Dedicated Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)
+// see Dedicated Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -5215,7 +6748,7 @@ const opCreateVpcEndpoint = "CreateVpcEndpoint"
// CreateVpcEndpointRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpcEndpoint operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5257,7 +6790,7 @@ func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *requ
// Creates a VPC endpoint for a specified service. An endpoint enables you to
// create a private connection between your VPC and the service. The service
// may be provided by AWS, an AWS Marketplace partner, or another AWS account.
-// For more information, see VPC Endpoints (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html)
+// For more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// A gateway endpoint serves as a target for a route in your route table for
@@ -5305,7 +6838,7 @@ const opCreateVpcEndpointConnectionNotification = "CreateVpcEndpointConnectionNo
// CreateVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpcEndpointConnectionNotification operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5347,7 +6880,7 @@ 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 (http://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html)
+// see Create a Topic (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html)
// in the Amazon Simple Notification Service Developer Guide.
//
// You can create a connection notification for interface endpoints only.
@@ -5385,7 +6918,7 @@ const opCreateVpcEndpointServiceConfiguration = "CreateVpcEndpointServiceConfigu
// CreateVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpcEndpointServiceConfiguration operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5430,7 +6963,7 @@ func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpo
//
// To create an endpoint service configuration, you must first create a Network
// Load Balancer for your service. For more information, see VPC Endpoint Services
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/endpoint-service.html)
+// (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -5466,7 +6999,7 @@ const opCreateVpcPeeringConnection = "CreateVpcPeeringConnection"
// CreateVpcPeeringConnectionRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpcPeeringConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5507,12 +7040,12 @@ func (c *EC2) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConnectio
//
// Requests a VPC peering connection between two VPCs: a requester VPC that
// you own and an accepter VPC with which to create the connection. The accepter
-// VPC can belong to another AWS account and can be in a different region to
+// VPC can belong to another AWS account and can be in a different Region to
// the requester VPC. The requester VPC and accepter VPC cannot have overlapping
// CIDR blocks.
//
// Limitations and rules apply to a VPC peering connection. For more information,
-// see the limitations (http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/vpc-peering-basics.html#vpc-peering-limitations)
+// see the limitations (https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-basics.html#vpc-peering-limitations)
// section in the VPC Peering Guide.
//
// The owner of the accepter VPC must accept the peering request to activate
@@ -5555,7 +7088,7 @@ const opCreateVpnConnection = "CreateVpnConnection"
// CreateVpnConnectionRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpnConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5595,7 +7128,7 @@ func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *
// CreateVpnConnection API operation for Amazon Elastic Compute Cloud.
//
// Creates a VPN connection between an existing virtual private gateway and
-// a VPN customer gateway. The only supported connection type is ipsec.1.
+// a VPN customer gateway. The supported connection types is ipsec.1.
//
// The response includes information that you need to give to your network administrator
// to configure your customer gateway.
@@ -5611,8 +7144,8 @@ func (c *EC2) CreateVpnConnectionRequest(input *CreateVpnConnectionInput) (req *
// This is an idempotent operation. If you perform the operation more than once,
// Amazon EC2 doesn't return an error.
//
-// For more information, see AWS Managed VPN Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -5647,7 +7180,7 @@ const opCreateVpnConnectionRoute = "CreateVpnConnectionRoute"
// CreateVpnConnectionRouteRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpnConnectionRoute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5681,8 +7214,7 @@ func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInp
output = &CreateVpnConnectionRouteOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -5693,9 +7225,8 @@ func (c *EC2) CreateVpnConnectionRouteRequest(input *CreateVpnConnectionRouteInp
// traffic to be routed from the virtual private gateway to the VPN customer
// gateway.
//
-// For more information about VPN connections, see AWS Managed VPN Connections
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the
-// Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -5730,7 +7261,7 @@ const opCreateVpnGateway = "CreateVpnGateway"
// CreateVpnGatewayRequest generates a "aws/request.Request" representing the
// client's request for the CreateVpnGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5773,9 +7304,8 @@ func (c *EC2) CreateVpnGatewayRequest(input *CreateVpnGatewayInput) (req *reques
// on the VPC side of your VPN connection. You can create a virtual private
// gateway before creating the VPC itself.
//
-// For more information about virtual private gateways, see AWS Managed VPN
-// Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -5805,12 +7335,165 @@ func (c *EC2) CreateVpnGatewayWithContext(ctx aws.Context, input *CreateVpnGatew
return out, req.Send()
}
+const opDeleteClientVpnEndpoint = "DeleteClientVpnEndpoint"
+
+// DeleteClientVpnEndpointRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteClientVpnEndpoint 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 DeleteClientVpnEndpoint for more information on using the DeleteClientVpnEndpoint
+// 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 DeleteClientVpnEndpointRequest method.
+// req, resp := client.DeleteClientVpnEndpointRequest(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/DeleteClientVpnEndpoint
+func (c *EC2) DeleteClientVpnEndpointRequest(input *DeleteClientVpnEndpointInput) (req *request.Request, output *DeleteClientVpnEndpointOutput) {
+ op := &request.Operation{
+ Name: opDeleteClientVpnEndpoint,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteClientVpnEndpointInput{}
+ }
+
+ output = &DeleteClientVpnEndpointOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteClientVpnEndpoint API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified Client VPN endpoint. You must disassociate all target
+// networks before you can delete a Client VPN endpoint.
+//
+// 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 DeleteClientVpnEndpoint for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnEndpoint
+func (c *EC2) DeleteClientVpnEndpoint(input *DeleteClientVpnEndpointInput) (*DeleteClientVpnEndpointOutput, error) {
+ req, out := c.DeleteClientVpnEndpointRequest(input)
+ return out, req.Send()
+}
+
+// DeleteClientVpnEndpointWithContext is the same as DeleteClientVpnEndpoint with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteClientVpnEndpoint 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) DeleteClientVpnEndpointWithContext(ctx aws.Context, input *DeleteClientVpnEndpointInput, opts ...request.Option) (*DeleteClientVpnEndpointOutput, error) {
+ req, out := c.DeleteClientVpnEndpointRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteClientVpnRoute = "DeleteClientVpnRoute"
+
+// DeleteClientVpnRouteRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteClientVpnRoute 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 DeleteClientVpnRoute for more information on using the DeleteClientVpnRoute
+// 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 DeleteClientVpnRouteRequest method.
+// req, resp := client.DeleteClientVpnRouteRequest(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/DeleteClientVpnRoute
+func (c *EC2) DeleteClientVpnRouteRequest(input *DeleteClientVpnRouteInput) (req *request.Request, output *DeleteClientVpnRouteOutput) {
+ op := &request.Operation{
+ Name: opDeleteClientVpnRoute,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteClientVpnRouteInput{}
+ }
+
+ output = &DeleteClientVpnRouteOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteClientVpnRoute API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes a route from a Client VPN endpoint. You can only delete routes that
+// you manually added using the CreateClientVpnRoute action. You cannot delete
+// routes that were automatically added when associating a subnet. To remove
+// routes that have been automatically added, disassociate the target subnet
+// from the Client VPN endpoint.
+//
+// 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 DeleteClientVpnRoute for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteClientVpnRoute
+func (c *EC2) DeleteClientVpnRoute(input *DeleteClientVpnRouteInput) (*DeleteClientVpnRouteOutput, error) {
+ req, out := c.DeleteClientVpnRouteRequest(input)
+ return out, req.Send()
+}
+
+// DeleteClientVpnRouteWithContext is the same as DeleteClientVpnRoute with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteClientVpnRoute 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) DeleteClientVpnRouteWithContext(ctx aws.Context, input *DeleteClientVpnRouteInput, opts ...request.Option) (*DeleteClientVpnRouteOutput, error) {
+ req, out := c.DeleteClientVpnRouteRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteCustomerGateway = "DeleteCustomerGateway"
// DeleteCustomerGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCustomerGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5844,8 +7527,7 @@ func (c *EC2) DeleteCustomerGatewayRequest(input *DeleteCustomerGatewayInput) (r
output = &DeleteCustomerGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -5887,7 +7569,7 @@ const opDeleteDhcpOptions = "DeleteDhcpOptions"
// DeleteDhcpOptionsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDhcpOptions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5921,8 +7603,7 @@ func (c *EC2) DeleteDhcpOptionsRequest(input *DeleteDhcpOptionsInput) (req *requ
output = &DeleteDhcpOptionsOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -5966,7 +7647,7 @@ const opDeleteEgressOnlyInternetGateway = "DeleteEgressOnlyInternetGateway"
// DeleteEgressOnlyInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DeleteEgressOnlyInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6005,7 +7686,7 @@ func (c *EC2) DeleteEgressOnlyInternetGatewayRequest(input *DeleteEgressOnlyInte
// DeleteEgressOnlyInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// Deletes an egress-only Internet gateway.
+// Deletes an egress-only internet gateway.
//
// 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
@@ -6040,7 +7721,7 @@ const opDeleteFleets = "DeleteFleets"
// DeleteFleetsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFleets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6081,12 +7762,11 @@ func (c *EC2) DeleteFleetsRequest(input *DeleteFleetsInput) (req *request.Reques
//
// Deletes the specified EC2 Fleet.
//
-// After you delete an EC2 Fleet, the EC2 Fleet launches no new instances. You
-// must specify whether the EC2 Fleet should also terminate its instances. If
-// you terminate the instances, the EC2 Fleet enters the deleted_terminating
-// state. Otherwise, the EC2 Fleet enters the deleted_running state, and the
-// instances continue to run until they are interrupted or you terminate them
-// manually.
+// After you delete an EC2 Fleet, it launches no new instances. You must specify
+// whether an EC2 Fleet should also terminate its instances. If you terminate
+// the instances, the EC2 Fleet enters the deleted_terminating state. Otherwise,
+// the EC2 Fleet enters the deleted_running state, and the instances continue
+// to run until they are interrupted or you terminate them manually.
//
// 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
@@ -6121,7 +7801,7 @@ const opDeleteFlowLogs = "DeleteFlowLogs"
// DeleteFlowLogsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFlowLogs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6195,7 +7875,7 @@ const opDeleteFpgaImage = "DeleteFpgaImage"
// DeleteFpgaImageRequest generates a "aws/request.Request" representing the
// client's request for the DeleteFpgaImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6269,7 +7949,7 @@ const opDeleteInternetGateway = "DeleteInternetGateway"
// DeleteInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DeleteInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6303,14 +7983,13 @@ func (c *EC2) DeleteInternetGatewayRequest(input *DeleteInternetGatewayInput) (r
output = &DeleteInternetGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// Deletes the specified Internet gateway. You must detach the Internet gateway
+// Deletes the specified internet gateway. You must detach the internet gateway
// from the VPC before you can delete it.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -6346,7 +8025,7 @@ const opDeleteKeyPair = "DeleteKeyPair"
// DeleteKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the DeleteKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6380,8 +8059,7 @@ func (c *EC2) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *request.Requ
output = &DeleteKeyPairOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -6422,7 +8100,7 @@ const opDeleteLaunchTemplate = "DeleteLaunchTemplate"
// DeleteLaunchTemplateRequest generates a "aws/request.Request" representing the
// client's request for the DeleteLaunchTemplate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6497,7 +8175,7 @@ const opDeleteLaunchTemplateVersions = "DeleteLaunchTemplateVersions"
// DeleteLaunchTemplateVersionsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteLaunchTemplateVersions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6574,7 +8252,7 @@ const opDeleteNatGateway = "DeleteNatGateway"
// DeleteNatGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DeleteNatGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6650,7 +8328,7 @@ const opDeleteNetworkAcl = "DeleteNetworkAcl"
// DeleteNetworkAclRequest generates a "aws/request.Request" representing the
// client's request for the DeleteNetworkAcl operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6684,8 +8362,7 @@ func (c *EC2) DeleteNetworkAclRequest(input *DeleteNetworkAclInput) (req *reques
output = &DeleteNetworkAclOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -6727,7 +8404,7 @@ const opDeleteNetworkAclEntry = "DeleteNetworkAclEntry"
// DeleteNetworkAclEntryRequest generates a "aws/request.Request" representing the
// client's request for the DeleteNetworkAclEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6761,8 +8438,7 @@ func (c *EC2) DeleteNetworkAclEntryRequest(input *DeleteNetworkAclEntryInput) (r
output = &DeleteNetworkAclEntryOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -6804,7 +8480,7 @@ const opDeleteNetworkInterface = "DeleteNetworkInterface"
// DeleteNetworkInterfaceRequest generates a "aws/request.Request" representing the
// client's request for the DeleteNetworkInterface operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6838,8 +8514,7 @@ func (c *EC2) DeleteNetworkInterfaceRequest(input *DeleteNetworkInterfaceInput)
output = &DeleteNetworkInterfaceOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -6881,7 +8556,7 @@ const opDeleteNetworkInterfacePermission = "DeleteNetworkInterfacePermission"
// DeleteNetworkInterfacePermissionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteNetworkInterfacePermission operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6958,7 +8633,7 @@ const opDeletePlacementGroup = "DeletePlacementGroup"
// DeletePlacementGroupRequest generates a "aws/request.Request" representing the
// client's request for the DeletePlacementGroup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6992,8 +8667,7 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req
output = &DeletePlacementGroupOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7001,7 +8675,7 @@ func (c *EC2) DeletePlacementGroupRequest(input *DeletePlacementGroupInput) (req
//
// Deletes the specified placement group. You must terminate all instances in
// the placement group before you can delete the placement group. For more information,
-// see Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
+// see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -7037,7 +8711,7 @@ const opDeleteRoute = "DeleteRoute"
// DeleteRouteRequest generates a "aws/request.Request" representing the
// client's request for the DeleteRoute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7071,8 +8745,7 @@ func (c *EC2) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Request,
output = &DeleteRouteOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7113,7 +8786,7 @@ const opDeleteRouteTable = "DeleteRouteTable"
// DeleteRouteTableRequest generates a "aws/request.Request" representing the
// client's request for the DeleteRouteTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7147,8 +8820,7 @@ func (c *EC2) DeleteRouteTableRequest(input *DeleteRouteTableInput) (req *reques
output = &DeleteRouteTableOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7191,7 +8863,7 @@ const opDeleteSecurityGroup = "DeleteSecurityGroup"
// DeleteSecurityGroupRequest generates a "aws/request.Request" representing the
// client's request for the DeleteSecurityGroup operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7225,8 +8897,7 @@ func (c *EC2) DeleteSecurityGroupRequest(input *DeleteSecurityGroupInput) (req *
output = &DeleteSecurityGroupOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7271,7 +8942,7 @@ const opDeleteSnapshot = "DeleteSnapshot"
// DeleteSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the DeleteSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7305,8 +8976,7 @@ func (c *EC2) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Re
output = &DeleteSnapshotOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7325,7 +8995,7 @@ 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 Deleting an Amazon EBS Snapshot (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html)
+// For more information, see Deleting an Amazon EBS Snapshot (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -7361,7 +9031,7 @@ const opDeleteSpotDatafeedSubscription = "DeleteSpotDatafeedSubscription"
// DeleteSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteSpotDatafeedSubscription operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7395,8 +9065,7 @@ func (c *EC2) DeleteSpotDatafeedSubscriptionRequest(input *DeleteSpotDatafeedSub
output = &DeleteSpotDatafeedSubscriptionOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7437,7 +9106,7 @@ const opDeleteSubnet = "DeleteSubnet"
// DeleteSubnetRequest generates a "aws/request.Request" representing the
// client's request for the DeleteSubnet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7471,8 +9140,7 @@ func (c *EC2) DeleteSubnetRequest(input *DeleteSubnetInput) (req *request.Reques
output = &DeleteSubnetOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7514,7 +9182,7 @@ const opDeleteTags = "DeleteTags"
// DeleteTagsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTags operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7548,8 +9216,7 @@ func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, o
output = &DeleteTagsOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7558,7 +9225,7 @@ func (c *EC2) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, o
// Deletes the specified set of tags from the specified set of resources.
//
// To list the current tags, use DescribeTags. For more information about tags,
-// see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -7589,12 +9256,612 @@ func (c *EC2) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opt
return out, req.Send()
}
+const opDeleteTrafficMirrorFilter = "DeleteTrafficMirrorFilter"
+
+// DeleteTrafficMirrorFilterRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTrafficMirrorFilter 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 DeleteTrafficMirrorFilter for more information on using the DeleteTrafficMirrorFilter
+// 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 DeleteTrafficMirrorFilterRequest method.
+// req, resp := client.DeleteTrafficMirrorFilterRequest(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/DeleteTrafficMirrorFilter
+func (c *EC2) DeleteTrafficMirrorFilterRequest(input *DeleteTrafficMirrorFilterInput) (req *request.Request, output *DeleteTrafficMirrorFilterOutput) {
+ op := &request.Operation{
+ Name: opDeleteTrafficMirrorFilter,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTrafficMirrorFilterInput{}
+ }
+
+ output = &DeleteTrafficMirrorFilterOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTrafficMirrorFilter API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified Traffic Mirror filter.
+//
+// You cannot delete a Traffic Mirror filter that is in use by a Traffic Mirror
+// session.
+//
+// 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 DeleteTrafficMirrorFilter for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTrafficMirrorFilter
+func (c *EC2) DeleteTrafficMirrorFilter(input *DeleteTrafficMirrorFilterInput) (*DeleteTrafficMirrorFilterOutput, error) {
+ req, out := c.DeleteTrafficMirrorFilterRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTrafficMirrorFilterWithContext is the same as DeleteTrafficMirrorFilter with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTrafficMirrorFilter 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) DeleteTrafficMirrorFilterWithContext(ctx aws.Context, input *DeleteTrafficMirrorFilterInput, opts ...request.Option) (*DeleteTrafficMirrorFilterOutput, error) {
+ req, out := c.DeleteTrafficMirrorFilterRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTrafficMirrorFilterRule = "DeleteTrafficMirrorFilterRule"
+
+// DeleteTrafficMirrorFilterRuleRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTrafficMirrorFilterRule 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 DeleteTrafficMirrorFilterRule for more information on using the DeleteTrafficMirrorFilterRule
+// 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 DeleteTrafficMirrorFilterRuleRequest method.
+// req, resp := client.DeleteTrafficMirrorFilterRuleRequest(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/DeleteTrafficMirrorFilterRule
+func (c *EC2) DeleteTrafficMirrorFilterRuleRequest(input *DeleteTrafficMirrorFilterRuleInput) (req *request.Request, output *DeleteTrafficMirrorFilterRuleOutput) {
+ op := &request.Operation{
+ Name: opDeleteTrafficMirrorFilterRule,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTrafficMirrorFilterRuleInput{}
+ }
+
+ output = &DeleteTrafficMirrorFilterRuleOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTrafficMirrorFilterRule API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified Traffic Mirror rule.
+//
+// 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 DeleteTrafficMirrorFilterRule for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTrafficMirrorFilterRule
+func (c *EC2) DeleteTrafficMirrorFilterRule(input *DeleteTrafficMirrorFilterRuleInput) (*DeleteTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.DeleteTrafficMirrorFilterRuleRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTrafficMirrorFilterRuleWithContext is the same as DeleteTrafficMirrorFilterRule with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTrafficMirrorFilterRule 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) DeleteTrafficMirrorFilterRuleWithContext(ctx aws.Context, input *DeleteTrafficMirrorFilterRuleInput, opts ...request.Option) (*DeleteTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.DeleteTrafficMirrorFilterRuleRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTrafficMirrorSession = "DeleteTrafficMirrorSession"
+
+// DeleteTrafficMirrorSessionRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTrafficMirrorSession 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 DeleteTrafficMirrorSession for more information on using the DeleteTrafficMirrorSession
+// 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 DeleteTrafficMirrorSessionRequest method.
+// req, resp := client.DeleteTrafficMirrorSessionRequest(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/DeleteTrafficMirrorSession
+func (c *EC2) DeleteTrafficMirrorSessionRequest(input *DeleteTrafficMirrorSessionInput) (req *request.Request, output *DeleteTrafficMirrorSessionOutput) {
+ op := &request.Operation{
+ Name: opDeleteTrafficMirrorSession,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTrafficMirrorSessionInput{}
+ }
+
+ output = &DeleteTrafficMirrorSessionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTrafficMirrorSession API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified Traffic Mirror session.
+//
+// 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 DeleteTrafficMirrorSession for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTrafficMirrorSession
+func (c *EC2) DeleteTrafficMirrorSession(input *DeleteTrafficMirrorSessionInput) (*DeleteTrafficMirrorSessionOutput, error) {
+ req, out := c.DeleteTrafficMirrorSessionRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTrafficMirrorSessionWithContext is the same as DeleteTrafficMirrorSession with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTrafficMirrorSession 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) DeleteTrafficMirrorSessionWithContext(ctx aws.Context, input *DeleteTrafficMirrorSessionInput, opts ...request.Option) (*DeleteTrafficMirrorSessionOutput, error) {
+ req, out := c.DeleteTrafficMirrorSessionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTrafficMirrorTarget = "DeleteTrafficMirrorTarget"
+
+// DeleteTrafficMirrorTargetRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTrafficMirrorTarget 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 DeleteTrafficMirrorTarget for more information on using the DeleteTrafficMirrorTarget
+// 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 DeleteTrafficMirrorTargetRequest method.
+// req, resp := client.DeleteTrafficMirrorTargetRequest(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/DeleteTrafficMirrorTarget
+func (c *EC2) DeleteTrafficMirrorTargetRequest(input *DeleteTrafficMirrorTargetInput) (req *request.Request, output *DeleteTrafficMirrorTargetOutput) {
+ op := &request.Operation{
+ Name: opDeleteTrafficMirrorTarget,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTrafficMirrorTargetInput{}
+ }
+
+ output = &DeleteTrafficMirrorTargetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTrafficMirrorTarget API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified Traffic Mirror target.
+//
+// You cannot delete a Traffic Mirror target that is in use by a Traffic Mirror
+// session.
+//
+// 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 DeleteTrafficMirrorTarget for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTrafficMirrorTarget
+func (c *EC2) DeleteTrafficMirrorTarget(input *DeleteTrafficMirrorTargetInput) (*DeleteTrafficMirrorTargetOutput, error) {
+ req, out := c.DeleteTrafficMirrorTargetRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTrafficMirrorTargetWithContext is the same as DeleteTrafficMirrorTarget with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTrafficMirrorTarget 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) DeleteTrafficMirrorTargetWithContext(ctx aws.Context, input *DeleteTrafficMirrorTargetInput, opts ...request.Option) (*DeleteTrafficMirrorTargetOutput, error) {
+ req, out := c.DeleteTrafficMirrorTargetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTransitGateway = "DeleteTransitGateway"
+
+// DeleteTransitGatewayRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTransitGateway 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 DeleteTransitGateway for more information on using the DeleteTransitGateway
+// 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 DeleteTransitGatewayRequest method.
+// req, resp := client.DeleteTransitGatewayRequest(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/DeleteTransitGateway
+func (c *EC2) DeleteTransitGatewayRequest(input *DeleteTransitGatewayInput) (req *request.Request, output *DeleteTransitGatewayOutput) {
+ op := &request.Operation{
+ Name: opDeleteTransitGateway,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTransitGatewayInput{}
+ }
+
+ output = &DeleteTransitGatewayOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTransitGateway API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified transit gateway.
+//
+// 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 DeleteTransitGateway for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGateway
+func (c *EC2) DeleteTransitGateway(input *DeleteTransitGatewayInput) (*DeleteTransitGatewayOutput, error) {
+ req, out := c.DeleteTransitGatewayRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTransitGatewayWithContext is the same as DeleteTransitGateway with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTransitGateway 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) DeleteTransitGatewayWithContext(ctx aws.Context, input *DeleteTransitGatewayInput, opts ...request.Option) (*DeleteTransitGatewayOutput, error) {
+ req, out := c.DeleteTransitGatewayRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTransitGatewayRoute = "DeleteTransitGatewayRoute"
+
+// DeleteTransitGatewayRouteRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTransitGatewayRoute 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 DeleteTransitGatewayRoute for more information on using the DeleteTransitGatewayRoute
+// 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 DeleteTransitGatewayRouteRequest method.
+// req, resp := client.DeleteTransitGatewayRouteRequest(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/DeleteTransitGatewayRoute
+func (c *EC2) DeleteTransitGatewayRouteRequest(input *DeleteTransitGatewayRouteInput) (req *request.Request, output *DeleteTransitGatewayRouteOutput) {
+ op := &request.Operation{
+ Name: opDeleteTransitGatewayRoute,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTransitGatewayRouteInput{}
+ }
+
+ output = &DeleteTransitGatewayRouteOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTransitGatewayRoute API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified route from the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DeleteTransitGatewayRoute for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRoute
+func (c *EC2) DeleteTransitGatewayRoute(input *DeleteTransitGatewayRouteInput) (*DeleteTransitGatewayRouteOutput, error) {
+ req, out := c.DeleteTransitGatewayRouteRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTransitGatewayRouteWithContext is the same as DeleteTransitGatewayRoute with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTransitGatewayRoute 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) DeleteTransitGatewayRouteWithContext(ctx aws.Context, input *DeleteTransitGatewayRouteInput, opts ...request.Option) (*DeleteTransitGatewayRouteOutput, error) {
+ req, out := c.DeleteTransitGatewayRouteRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTransitGatewayRouteTable = "DeleteTransitGatewayRouteTable"
+
+// DeleteTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTransitGatewayRouteTable 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 DeleteTransitGatewayRouteTable for more information on using the DeleteTransitGatewayRouteTable
+// 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 DeleteTransitGatewayRouteTableRequest method.
+// req, resp := client.DeleteTransitGatewayRouteTableRequest(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/DeleteTransitGatewayRouteTable
+func (c *EC2) DeleteTransitGatewayRouteTableRequest(input *DeleteTransitGatewayRouteTableInput) (req *request.Request, output *DeleteTransitGatewayRouteTableOutput) {
+ op := &request.Operation{
+ Name: opDeleteTransitGatewayRouteTable,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTransitGatewayRouteTableInput{}
+ }
+
+ output = &DeleteTransitGatewayRouteTableOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// 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.
+//
+// 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 DeleteTransitGatewayRouteTable for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayRouteTable
+func (c *EC2) DeleteTransitGatewayRouteTable(input *DeleteTransitGatewayRouteTableInput) (*DeleteTransitGatewayRouteTableOutput, error) {
+ req, out := c.DeleteTransitGatewayRouteTableRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTransitGatewayRouteTableWithContext is the same as DeleteTransitGatewayRouteTable with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTransitGatewayRouteTable 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) DeleteTransitGatewayRouteTableWithContext(ctx aws.Context, input *DeleteTransitGatewayRouteTableInput, opts ...request.Option) (*DeleteTransitGatewayRouteTableOutput, error) {
+ req, out := c.DeleteTransitGatewayRouteTableRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteTransitGatewayVpcAttachment = "DeleteTransitGatewayVpcAttachment"
+
+// DeleteTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTransitGatewayVpcAttachment 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 DeleteTransitGatewayVpcAttachment for more information on using the DeleteTransitGatewayVpcAttachment
+// 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 DeleteTransitGatewayVpcAttachmentRequest method.
+// req, resp := client.DeleteTransitGatewayVpcAttachmentRequest(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/DeleteTransitGatewayVpcAttachment
+func (c *EC2) DeleteTransitGatewayVpcAttachmentRequest(input *DeleteTransitGatewayVpcAttachmentInput) (req *request.Request, output *DeleteTransitGatewayVpcAttachmentOutput) {
+ op := &request.Operation{
+ Name: opDeleteTransitGatewayVpcAttachment,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTransitGatewayVpcAttachmentInput{}
+ }
+
+ output = &DeleteTransitGatewayVpcAttachmentOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.
+//
+// Deletes the specified VPC attachment.
+//
+// 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 DeleteTransitGatewayVpcAttachment for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayVpcAttachment
+func (c *EC2) DeleteTransitGatewayVpcAttachment(input *DeleteTransitGatewayVpcAttachmentInput) (*DeleteTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.DeleteTransitGatewayVpcAttachmentRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTransitGatewayVpcAttachmentWithContext is the same as DeleteTransitGatewayVpcAttachment with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTransitGatewayVpcAttachment 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) DeleteTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *DeleteTransitGatewayVpcAttachmentInput, opts ...request.Option) (*DeleteTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.DeleteTransitGatewayVpcAttachmentRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteVolume = "DeleteVolume"
// DeleteVolumeRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7628,8 +9895,7 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Reques
output = &DeleteVolumeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7638,9 +9904,9 @@ func (c *EC2) DeleteVolumeRequest(input *DeleteVolumeInput) (req *request.Reques
// Deletes the specified EBS volume. The volume must be in the available state
// (not attached to an instance).
//
-// The volume may remain in the deleting state for several minutes.
+// The volume can remain in the deleting state for several minutes.
//
-// For more information, see Deleting an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html)
+// For more information, see Deleting an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-volume.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -7676,7 +9942,7 @@ const opDeleteVpc = "DeleteVpc"
// DeleteVpcRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7710,8 +9976,7 @@ func (c *EC2) DeleteVpcRequest(input *DeleteVpcInput) (req *request.Request, out
output = &DeleteVpcOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -7756,7 +10021,7 @@ const opDeleteVpcEndpointConnectionNotifications = "DeleteVpcEndpointConnectionN
// DeleteVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpcEndpointConnectionNotifications operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7830,7 +10095,7 @@ const opDeleteVpcEndpointServiceConfigurations = "DeleteVpcEndpointServiceConfig
// DeleteVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpcEndpointServiceConfigurations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7907,7 +10172,7 @@ const opDeleteVpcEndpoints = "DeleteVpcEndpoints"
// DeleteVpcEndpointsRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpcEndpoints operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7984,7 +10249,7 @@ const opDeleteVpcPeeringConnection = "DeleteVpcPeeringConnection"
// DeleteVpcPeeringConnectionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpcPeeringConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8062,7 +10327,7 @@ const opDeleteVpnConnection = "DeleteVpnConnection"
// DeleteVpnConnectionRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpnConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8096,8 +10361,7 @@ func (c *EC2) DeleteVpnConnectionRequest(input *DeleteVpnConnectionInput) (req *
output = &DeleteVpnConnectionOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -8147,7 +10411,7 @@ const opDeleteVpnConnectionRoute = "DeleteVpnConnectionRoute"
// DeleteVpnConnectionRouteRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpnConnectionRoute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8181,8 +10445,7 @@ func (c *EC2) DeleteVpnConnectionRouteRequest(input *DeleteVpnConnectionRouteInp
output = &DeleteVpnConnectionRouteOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -8226,7 +10489,7 @@ const opDeleteVpnGateway = "DeleteVpnGateway"
// DeleteVpnGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVpnGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8260,8 +10523,7 @@ func (c *EC2) DeleteVpnGatewayRequest(input *DeleteVpnGatewayInput) (req *reques
output = &DeleteVpnGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -8301,12 +10563,92 @@ func (c *EC2) DeleteVpnGatewayWithContext(ctx aws.Context, input *DeleteVpnGatew
return out, req.Send()
}
+const opDeprovisionByoipCidr = "DeprovisionByoipCidr"
+
+// DeprovisionByoipCidrRequest generates a "aws/request.Request" representing the
+// client's request for the DeprovisionByoipCidr 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 DeprovisionByoipCidr for more information on using the DeprovisionByoipCidr
+// 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 DeprovisionByoipCidrRequest method.
+// req, resp := client.DeprovisionByoipCidrRequest(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/DeprovisionByoipCidr
+func (c *EC2) DeprovisionByoipCidrRequest(input *DeprovisionByoipCidrInput) (req *request.Request, output *DeprovisionByoipCidrOutput) {
+ op := &request.Operation{
+ Name: opDeprovisionByoipCidr,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeprovisionByoipCidrInput{}
+ }
+
+ output = &DeprovisionByoipCidrOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeprovisionByoipCidr API operation for Amazon Elastic Compute Cloud.
+//
+// Releases the specified address range that you provisioned for use with your
+// AWS resources through bring your own IP addresses (BYOIP) and deletes the
+// corresponding address pool.
+//
+// Before you can release an address range, you must stop advertising it using
+// WithdrawByoipCidr and you must not have any IP addresses allocated from its
+// address range.
+//
+// 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 DeprovisionByoipCidr for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeprovisionByoipCidr
+func (c *EC2) DeprovisionByoipCidr(input *DeprovisionByoipCidrInput) (*DeprovisionByoipCidrOutput, error) {
+ req, out := c.DeprovisionByoipCidrRequest(input)
+ return out, req.Send()
+}
+
+// DeprovisionByoipCidrWithContext is the same as DeprovisionByoipCidr with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeprovisionByoipCidr 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) DeprovisionByoipCidrWithContext(ctx aws.Context, input *DeprovisionByoipCidrInput, opts ...request.Option) (*DeprovisionByoipCidrOutput, error) {
+ req, out := c.DeprovisionByoipCidrRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeregisterImage = "DeregisterImage"
// DeregisterImageRequest generates a "aws/request.Request" representing the
// client's request for the DeregisterImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8340,8 +10682,7 @@ func (c *EC2) DeregisterImageRequest(input *DeregisterImageInput) (req *request.
output = &DeregisterImageOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -8390,7 +10731,7 @@ const opDescribeAccountAttributes = "DescribeAccountAttributes"
// DescribeAccountAttributesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeAccountAttributes operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8482,7 +10823,7 @@ const opDescribeAddresses = "DescribeAddresses"
// DescribeAddressesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeAddresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8521,10 +10862,10 @@ func (c *EC2) DescribeAddressesRequest(input *DescribeAddressesInput) (req *requ
// DescribeAddresses API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your Elastic IP addresses.
+// Describes the specified Elastic IP addresses or all of your Elastic IP addresses.
//
// An Elastic IP address is for use in either the EC2-Classic platform or in
-// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// a VPC. 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -8560,7 +10901,7 @@ const opDescribeAggregateIdFormat = "DescribeAggregateIdFormat"
// DescribeAggregateIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the DescribeAggregateIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8600,8 +10941,8 @@ func (c *EC2) DescribeAggregateIdFormatRequest(input *DescribeAggregateIdFormatI
// DescribeAggregateIdFormat API operation for Amazon Elastic Compute Cloud.
//
// Describes the longer ID format settings for all resource types in a specific
-// region. This request is useful for performing a quick audit to determine
-// whether a specific region is fully opted in for longer IDs (17-character
+// Region. This request is useful for performing a quick audit to determine
+// whether a specific Region is fully opted in for longer IDs (17-character
// IDs).
//
// This request only returns information about resource types that support longer
@@ -8648,7 +10989,7 @@ const opDescribeAvailabilityZones = "DescribeAvailabilityZones"
// DescribeAvailabilityZonesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeAvailabilityZones operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8687,12 +11028,12 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI
// DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of the Availability Zones that are available to you.
-// The results include zones only for the region you're currently using. If
-// there is an event impacting an Availability Zone, you can use this request
-// to view the state and any provided message for that Availability Zone.
+// Describes the Availability Zones that are available to you. The results include
+// zones only for the Region you're currently using. If there is an event impacting
+// an Availability Zone, you can use this request to view the state and any
+// provided message for that Availability Zone.
//
-// For more information, see Regions and Availability Zones (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html)
+// For more information, see Regions and Availability Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -8728,7 +11069,7 @@ const opDescribeBundleTasks = "DescribeBundleTasks"
// DescribeBundleTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeBundleTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8767,7 +11108,7 @@ func (c *EC2) DescribeBundleTasksRequest(input *DescribeBundleTasksInput) (req *
// DescribeBundleTasks API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your bundling tasks.
+// Describes the specified bundle tasks or all of your bundle tasks.
//
// Completed bundle tasks are listed for only a limited time. If your bundle
// task is no longer in the list, you can still register an AMI from it. Just
@@ -8802,12 +11143,276 @@ func (c *EC2) DescribeBundleTasksWithContext(ctx aws.Context, input *DescribeBun
return out, req.Send()
}
+const opDescribeByoipCidrs = "DescribeByoipCidrs"
+
+// DescribeByoipCidrsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeByoipCidrs 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 DescribeByoipCidrs for more information on using the DescribeByoipCidrs
+// 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 DescribeByoipCidrsRequest method.
+// req, resp := client.DescribeByoipCidrsRequest(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/DescribeByoipCidrs
+func (c *EC2) DescribeByoipCidrsRequest(input *DescribeByoipCidrsInput) (req *request.Request, output *DescribeByoipCidrsOutput) {
+ op := &request.Operation{
+ Name: opDescribeByoipCidrs,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeByoipCidrsInput{}
+ }
+
+ output = &DescribeByoipCidrsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeByoipCidrs API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the IP address ranges that were specified in calls to ProvisionByoipCidr.
+//
+// To describe the address pools that were created when you provisioned the
+// address ranges, use DescribePublicIpv4Pools.
+//
+// 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 DescribeByoipCidrs for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeByoipCidrs
+func (c *EC2) DescribeByoipCidrs(input *DescribeByoipCidrsInput) (*DescribeByoipCidrsOutput, error) {
+ req, out := c.DescribeByoipCidrsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeByoipCidrsWithContext is the same as DescribeByoipCidrs with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeByoipCidrs 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) DescribeByoipCidrsWithContext(ctx aws.Context, input *DescribeByoipCidrsInput, opts ...request.Option) (*DescribeByoipCidrsOutput, error) {
+ req, out := c.DescribeByoipCidrsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeByoipCidrsPages iterates over the pages of a DescribeByoipCidrs operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeByoipCidrs 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 DescribeByoipCidrs operation.
+// pageNum := 0
+// err := client.DescribeByoipCidrsPages(params,
+// func(page *ec2.DescribeByoipCidrsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeByoipCidrsPages(input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool) error {
+ return c.DescribeByoipCidrsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeByoipCidrsPagesWithContext same as DescribeByoipCidrsPages 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) DescribeByoipCidrsPagesWithContext(ctx aws.Context, input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeByoipCidrsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeByoipCidrsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeByoipCidrsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeCapacityReservations = "DescribeCapacityReservations"
+
+// DescribeCapacityReservationsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeCapacityReservations 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 DescribeCapacityReservations for more information on using the DescribeCapacityReservations
+// 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 DescribeCapacityReservationsRequest method.
+// req, resp := client.DescribeCapacityReservationsRequest(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/DescribeCapacityReservations
+func (c *EC2) DescribeCapacityReservationsRequest(input *DescribeCapacityReservationsInput) (req *request.Request, output *DescribeCapacityReservationsOutput) {
+ op := &request.Operation{
+ Name: opDescribeCapacityReservations,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeCapacityReservationsInput{}
+ }
+
+ output = &DescribeCapacityReservationsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeCapacityReservations API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more of your Capacity Reservations. The results describe
+// only the Capacity Reservations in the AWS Region that you're currently using.
+//
+// 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 DescribeCapacityReservations for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCapacityReservations
+func (c *EC2) DescribeCapacityReservations(input *DescribeCapacityReservationsInput) (*DescribeCapacityReservationsOutput, error) {
+ req, out := c.DescribeCapacityReservationsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeCapacityReservationsWithContext is the same as DescribeCapacityReservations with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeCapacityReservations 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) DescribeCapacityReservationsWithContext(ctx aws.Context, input *DescribeCapacityReservationsInput, opts ...request.Option) (*DescribeCapacityReservationsOutput, error) {
+ req, out := c.DescribeCapacityReservationsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeCapacityReservationsPages iterates over the pages of a DescribeCapacityReservations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeCapacityReservations 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 DescribeCapacityReservations operation.
+// pageNum := 0
+// err := client.DescribeCapacityReservationsPages(params,
+// func(page *ec2.DescribeCapacityReservationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeCapacityReservationsPages(input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool) error {
+ return c.DescribeCapacityReservationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeCapacityReservationsPagesWithContext same as DescribeCapacityReservationsPages 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) DescribeCapacityReservationsPagesWithContext(ctx aws.Context, input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeCapacityReservationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeCapacityReservationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeCapacityReservationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances"
// DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeClassicLinkInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8833,6 +11438,12 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst
Name: opDescribeClassicLinkInstances,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -8848,7 +11459,7 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst
//
// 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
+// 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
@@ -8879,12 +11490,713 @@ func (c *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *De
return out, req.Send()
}
+// DescribeClassicLinkInstancesPages iterates over the pages of a DescribeClassicLinkInstances operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClassicLinkInstances 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 DescribeClassicLinkInstances operation.
+// pageNum := 0
+// err := client.DescribeClassicLinkInstancesPages(params,
+// func(page *ec2.DescribeClassicLinkInstancesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClassicLinkInstancesPages(input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool) error {
+ return c.DescribeClassicLinkInstancesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClassicLinkInstancesPagesWithContext same as DescribeClassicLinkInstancesPages 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) DescribeClassicLinkInstancesPagesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClassicLinkInstancesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClassicLinkInstancesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClassicLinkInstancesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeClientVpnAuthorizationRules = "DescribeClientVpnAuthorizationRules"
+
+// DescribeClientVpnAuthorizationRulesRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeClientVpnAuthorizationRules 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 DescribeClientVpnAuthorizationRules for more information on using the DescribeClientVpnAuthorizationRules
+// 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 DescribeClientVpnAuthorizationRulesRequest method.
+// req, resp := client.DescribeClientVpnAuthorizationRulesRequest(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/DescribeClientVpnAuthorizationRules
+func (c *EC2) DescribeClientVpnAuthorizationRulesRequest(input *DescribeClientVpnAuthorizationRulesInput) (req *request.Request, output *DescribeClientVpnAuthorizationRulesOutput) {
+ op := &request.Operation{
+ Name: opDescribeClientVpnAuthorizationRules,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeClientVpnAuthorizationRulesInput{}
+ }
+
+ output = &DescribeClientVpnAuthorizationRulesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeClientVpnAuthorizationRules API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the authorization rules for a specified Client VPN endpoint.
+//
+// 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 DescribeClientVpnAuthorizationRules for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnAuthorizationRules
+func (c *EC2) DescribeClientVpnAuthorizationRules(input *DescribeClientVpnAuthorizationRulesInput) (*DescribeClientVpnAuthorizationRulesOutput, error) {
+ req, out := c.DescribeClientVpnAuthorizationRulesRequest(input)
+ return out, req.Send()
+}
+
+// DescribeClientVpnAuthorizationRulesWithContext is the same as DescribeClientVpnAuthorizationRules with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeClientVpnAuthorizationRules 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) DescribeClientVpnAuthorizationRulesWithContext(ctx aws.Context, input *DescribeClientVpnAuthorizationRulesInput, opts ...request.Option) (*DescribeClientVpnAuthorizationRulesOutput, error) {
+ req, out := c.DescribeClientVpnAuthorizationRulesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeClientVpnAuthorizationRulesPages iterates over the pages of a DescribeClientVpnAuthorizationRules operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClientVpnAuthorizationRules 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 DescribeClientVpnAuthorizationRules operation.
+// pageNum := 0
+// err := client.DescribeClientVpnAuthorizationRulesPages(params,
+// func(page *ec2.DescribeClientVpnAuthorizationRulesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClientVpnAuthorizationRulesPages(input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool) error {
+ return c.DescribeClientVpnAuthorizationRulesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClientVpnAuthorizationRulesPagesWithContext same as DescribeClientVpnAuthorizationRulesPages 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) DescribeClientVpnAuthorizationRulesPagesWithContext(ctx aws.Context, input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClientVpnAuthorizationRulesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClientVpnAuthorizationRulesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClientVpnAuthorizationRulesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeClientVpnConnections = "DescribeClientVpnConnections"
+
+// DescribeClientVpnConnectionsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeClientVpnConnections 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 DescribeClientVpnConnections for more information on using the DescribeClientVpnConnections
+// 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 DescribeClientVpnConnectionsRequest method.
+// req, resp := client.DescribeClientVpnConnectionsRequest(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/DescribeClientVpnConnections
+func (c *EC2) DescribeClientVpnConnectionsRequest(input *DescribeClientVpnConnectionsInput) (req *request.Request, output *DescribeClientVpnConnectionsOutput) {
+ op := &request.Operation{
+ Name: opDescribeClientVpnConnections,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeClientVpnConnectionsInput{}
+ }
+
+ output = &DescribeClientVpnConnectionsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeClientVpnConnections API operation for Amazon Elastic Compute Cloud.
+//
+// Describes active client connections and connections that have been terminated
+// within the last 60 minutes for the specified Client VPN endpoint.
+//
+// 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 DescribeClientVpnConnections for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnConnections
+func (c *EC2) DescribeClientVpnConnections(input *DescribeClientVpnConnectionsInput) (*DescribeClientVpnConnectionsOutput, error) {
+ req, out := c.DescribeClientVpnConnectionsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeClientVpnConnectionsWithContext is the same as DescribeClientVpnConnections with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeClientVpnConnections 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) DescribeClientVpnConnectionsWithContext(ctx aws.Context, input *DescribeClientVpnConnectionsInput, opts ...request.Option) (*DescribeClientVpnConnectionsOutput, error) {
+ req, out := c.DescribeClientVpnConnectionsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeClientVpnConnectionsPages iterates over the pages of a DescribeClientVpnConnections operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClientVpnConnections 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 DescribeClientVpnConnections operation.
+// pageNum := 0
+// err := client.DescribeClientVpnConnectionsPages(params,
+// func(page *ec2.DescribeClientVpnConnectionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClientVpnConnectionsPages(input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool) error {
+ return c.DescribeClientVpnConnectionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClientVpnConnectionsPagesWithContext same as DescribeClientVpnConnectionsPages 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) DescribeClientVpnConnectionsPagesWithContext(ctx aws.Context, input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClientVpnConnectionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClientVpnConnectionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClientVpnConnectionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeClientVpnEndpoints = "DescribeClientVpnEndpoints"
+
+// DescribeClientVpnEndpointsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeClientVpnEndpoints 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 DescribeClientVpnEndpoints for more information on using the DescribeClientVpnEndpoints
+// 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 DescribeClientVpnEndpointsRequest method.
+// req, resp := client.DescribeClientVpnEndpointsRequest(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/DescribeClientVpnEndpoints
+func (c *EC2) DescribeClientVpnEndpointsRequest(input *DescribeClientVpnEndpointsInput) (req *request.Request, output *DescribeClientVpnEndpointsOutput) {
+ op := &request.Operation{
+ Name: opDescribeClientVpnEndpoints,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeClientVpnEndpointsInput{}
+ }
+
+ output = &DescribeClientVpnEndpointsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeClientVpnEndpoints API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more Client VPN endpoints in the 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeClientVpnEndpoints for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnEndpoints
+func (c *EC2) DescribeClientVpnEndpoints(input *DescribeClientVpnEndpointsInput) (*DescribeClientVpnEndpointsOutput, error) {
+ req, out := c.DescribeClientVpnEndpointsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeClientVpnEndpointsWithContext is the same as DescribeClientVpnEndpoints with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeClientVpnEndpoints 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) DescribeClientVpnEndpointsWithContext(ctx aws.Context, input *DescribeClientVpnEndpointsInput, opts ...request.Option) (*DescribeClientVpnEndpointsOutput, error) {
+ req, out := c.DescribeClientVpnEndpointsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeClientVpnEndpointsPages iterates over the pages of a DescribeClientVpnEndpoints operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClientVpnEndpoints 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 DescribeClientVpnEndpoints operation.
+// pageNum := 0
+// err := client.DescribeClientVpnEndpointsPages(params,
+// func(page *ec2.DescribeClientVpnEndpointsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClientVpnEndpointsPages(input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool) error {
+ return c.DescribeClientVpnEndpointsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClientVpnEndpointsPagesWithContext same as DescribeClientVpnEndpointsPages 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) DescribeClientVpnEndpointsPagesWithContext(ctx aws.Context, input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClientVpnEndpointsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClientVpnEndpointsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClientVpnEndpointsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeClientVpnRoutes = "DescribeClientVpnRoutes"
+
+// DescribeClientVpnRoutesRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeClientVpnRoutes 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 DescribeClientVpnRoutes for more information on using the DescribeClientVpnRoutes
+// 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 DescribeClientVpnRoutesRequest method.
+// req, resp := client.DescribeClientVpnRoutesRequest(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/DescribeClientVpnRoutes
+func (c *EC2) DescribeClientVpnRoutesRequest(input *DescribeClientVpnRoutesInput) (req *request.Request, output *DescribeClientVpnRoutesOutput) {
+ op := &request.Operation{
+ Name: opDescribeClientVpnRoutes,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeClientVpnRoutesInput{}
+ }
+
+ output = &DescribeClientVpnRoutesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeClientVpnRoutes API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the routes for the specified Client VPN endpoint.
+//
+// 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 DescribeClientVpnRoutes for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnRoutes
+func (c *EC2) DescribeClientVpnRoutes(input *DescribeClientVpnRoutesInput) (*DescribeClientVpnRoutesOutput, error) {
+ req, out := c.DescribeClientVpnRoutesRequest(input)
+ return out, req.Send()
+}
+
+// DescribeClientVpnRoutesWithContext is the same as DescribeClientVpnRoutes with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeClientVpnRoutes 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) DescribeClientVpnRoutesWithContext(ctx aws.Context, input *DescribeClientVpnRoutesInput, opts ...request.Option) (*DescribeClientVpnRoutesOutput, error) {
+ req, out := c.DescribeClientVpnRoutesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeClientVpnRoutesPages iterates over the pages of a DescribeClientVpnRoutes operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClientVpnRoutes 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 DescribeClientVpnRoutes operation.
+// pageNum := 0
+// err := client.DescribeClientVpnRoutesPages(params,
+// func(page *ec2.DescribeClientVpnRoutesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClientVpnRoutesPages(input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool) error {
+ return c.DescribeClientVpnRoutesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClientVpnRoutesPagesWithContext same as DescribeClientVpnRoutesPages 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) DescribeClientVpnRoutesPagesWithContext(ctx aws.Context, input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClientVpnRoutesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClientVpnRoutesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClientVpnRoutesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeClientVpnTargetNetworks = "DescribeClientVpnTargetNetworks"
+
+// DescribeClientVpnTargetNetworksRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeClientVpnTargetNetworks 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 DescribeClientVpnTargetNetworks for more information on using the DescribeClientVpnTargetNetworks
+// 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 DescribeClientVpnTargetNetworksRequest method.
+// req, resp := client.DescribeClientVpnTargetNetworksRequest(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/DescribeClientVpnTargetNetworks
+func (c *EC2) DescribeClientVpnTargetNetworksRequest(input *DescribeClientVpnTargetNetworksInput) (req *request.Request, output *DescribeClientVpnTargetNetworksOutput) {
+ op := &request.Operation{
+ Name: opDescribeClientVpnTargetNetworks,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeClientVpnTargetNetworksInput{}
+ }
+
+ output = &DescribeClientVpnTargetNetworksOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeClientVpnTargetNetworks API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the target networks associated with the specified Client VPN endpoint.
+//
+// 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 DescribeClientVpnTargetNetworks for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeClientVpnTargetNetworks
+func (c *EC2) DescribeClientVpnTargetNetworks(input *DescribeClientVpnTargetNetworksInput) (*DescribeClientVpnTargetNetworksOutput, error) {
+ req, out := c.DescribeClientVpnTargetNetworksRequest(input)
+ return out, req.Send()
+}
+
+// DescribeClientVpnTargetNetworksWithContext is the same as DescribeClientVpnTargetNetworks with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeClientVpnTargetNetworks 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) DescribeClientVpnTargetNetworksWithContext(ctx aws.Context, input *DescribeClientVpnTargetNetworksInput, opts ...request.Option) (*DescribeClientVpnTargetNetworksOutput, error) {
+ req, out := c.DescribeClientVpnTargetNetworksRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeClientVpnTargetNetworksPages iterates over the pages of a DescribeClientVpnTargetNetworks operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeClientVpnTargetNetworks 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 DescribeClientVpnTargetNetworks operation.
+// pageNum := 0
+// err := client.DescribeClientVpnTargetNetworksPages(params,
+// func(page *ec2.DescribeClientVpnTargetNetworksOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeClientVpnTargetNetworksPages(input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool) error {
+ return c.DescribeClientVpnTargetNetworksPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeClientVpnTargetNetworksPagesWithContext same as DescribeClientVpnTargetNetworksPages 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) DescribeClientVpnTargetNetworksPagesWithContext(ctx aws.Context, input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeClientVpnTargetNetworksInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeClientVpnTargetNetworksRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeClientVpnTargetNetworksOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeConversionTasks = "DescribeConversionTasks"
// DescribeConversionTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeConversionTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -8923,11 +12235,11 @@ func (c *EC2) DescribeConversionTasksRequest(input *DescribeConversionTasksInput
// DescribeConversionTasks API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your conversion tasks. For more information, see
-// the VM Import/Export User Guide (http://docs.aws.amazon.com/vm-import/latest/userguide/).
+// Describes the specified conversion tasks or all your conversion tasks. For
+// more information, see the VM Import/Export User Guide (https://docs.aws.amazon.com/vm-import/latest/userguide/).
//
// For information about the import manifest referenced by this API action,
-// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
+// see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.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
@@ -8962,7 +12274,7 @@ const opDescribeCustomerGateways = "DescribeCustomerGateways"
// DescribeCustomerGatewaysRequest generates a "aws/request.Request" representing the
// client's request for the DescribeCustomerGateways operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9003,9 +12315,8 @@ func (c *EC2) DescribeCustomerGatewaysRequest(input *DescribeCustomerGatewaysInp
//
// Describes one or more of your VPN customer gateways.
//
-// For more information about VPN customer gateways, see AWS Managed VPN Connections
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the
-// Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -9040,7 +12351,7 @@ const opDescribeDhcpOptions = "DescribeDhcpOptions"
// DescribeDhcpOptionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeDhcpOptions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9066,6 +12377,12 @@ func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *
Name: opDescribeDhcpOptions,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9081,7 +12398,7 @@ func (c *EC2) DescribeDhcpOptionsRequest(input *DescribeDhcpOptionsInput) (req *
//
// Describes one or more of your DHCP options sets.
//
-// For more information about DHCP options sets, see DHCP Options Sets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html)
+// For more information, see DHCP Options Sets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_DHCP_Options.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -9112,12 +12429,62 @@ func (c *EC2) DescribeDhcpOptionsWithContext(ctx aws.Context, input *DescribeDhc
return out, req.Send()
}
+// DescribeDhcpOptionsPages iterates over the pages of a DescribeDhcpOptions operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeDhcpOptions 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 DescribeDhcpOptions operation.
+// pageNum := 0
+// err := client.DescribeDhcpOptionsPages(params,
+// func(page *ec2.DescribeDhcpOptionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeDhcpOptionsPages(input *DescribeDhcpOptionsInput, fn func(*DescribeDhcpOptionsOutput, bool) bool) error {
+ return c.DescribeDhcpOptionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeDhcpOptionsPagesWithContext same as DescribeDhcpOptionsPages 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) DescribeDhcpOptionsPagesWithContext(ctx aws.Context, input *DescribeDhcpOptionsInput, fn func(*DescribeDhcpOptionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeDhcpOptionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeDhcpOptionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeDhcpOptionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeEgressOnlyInternetGateways = "DescribeEgressOnlyInternetGateways"
// DescribeEgressOnlyInternetGatewaysRequest generates a "aws/request.Request" representing the
// client's request for the DescribeEgressOnlyInternetGateways operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9143,6 +12510,12 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl
Name: opDescribeEgressOnlyInternetGateways,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9156,7 +12529,7 @@ 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 one or more of your egress-only internet gateways.
//
// 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
@@ -9186,12 +12559,62 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, inp
return out, req.Send()
}
+// DescribeEgressOnlyInternetGatewaysPages iterates over the pages of a DescribeEgressOnlyInternetGateways operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeEgressOnlyInternetGateways 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 DescribeEgressOnlyInternetGateways operation.
+// pageNum := 0
+// err := client.DescribeEgressOnlyInternetGatewaysPages(params,
+// func(page *ec2.DescribeEgressOnlyInternetGatewaysOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeEgressOnlyInternetGatewaysPages(input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool) error {
+ return c.DescribeEgressOnlyInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeEgressOnlyInternetGatewaysPagesWithContext same as DescribeEgressOnlyInternetGatewaysPages 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) DescribeEgressOnlyInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeEgressOnlyInternetGatewaysInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeEgressOnlyInternetGatewaysRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeEgressOnlyInternetGatewaysOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeElasticGpus = "DescribeElasticGpus"
// DescribeElasticGpusRequest generates a "aws/request.Request" representing the
// client's request for the DescribeElasticGpus operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9230,8 +12653,9 @@ func (c *EC2) DescribeElasticGpusRequest(input *DescribeElasticGpusInput) (req *
// DescribeElasticGpus API operation for Amazon Elastic Compute Cloud.
//
-// Describes the Elastic GPUs associated with your instances. For more information
-// about Elastic GPUs, see Amazon EC2 Elastic GPUs (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-gpus.html).
+// 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
@@ -9266,7 +12690,7 @@ const opDescribeExportTasks = "DescribeExportTasks"
// DescribeExportTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeExportTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9305,7 +12729,7 @@ func (c *EC2) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *
// DescribeExportTasks API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your export tasks.
+// Describes the specified export tasks or all your export tasks.
//
// 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
@@ -9340,7 +12764,7 @@ const opDescribeFleetHistory = "DescribeFleetHistory"
// DescribeFleetHistoryRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFleetHistory operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9414,7 +12838,7 @@ const opDescribeFleetInstances = "DescribeFleetInstances"
// DescribeFleetInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFleetInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9488,7 +12912,7 @@ const opDescribeFleets = "DescribeFleets"
// DescribeFleetsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFleets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9514,6 +12938,12 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re
Name: opDescribeFleets,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9527,7 +12957,7 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re
// DescribeFleets API operation for Amazon Elastic Compute Cloud.
//
-// Describes the specified EC2 Fleet.
+// Describes the specified EC2 Fleets or all your EC2 Fleets.
//
// 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
@@ -9557,12 +12987,62 @@ func (c *EC2) DescribeFleetsWithContext(ctx aws.Context, input *DescribeFleetsIn
return out, req.Send()
}
+// DescribeFleetsPages iterates over the pages of a DescribeFleets operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeFleets 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 DescribeFleets operation.
+// pageNum := 0
+// err := client.DescribeFleetsPages(params,
+// func(page *ec2.DescribeFleetsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeFleetsPages(input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool) error {
+ return c.DescribeFleetsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeFleetsPagesWithContext same as DescribeFleetsPages 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) DescribeFleetsPagesWithContext(ctx aws.Context, input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeFleetsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeFleetsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeFleetsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeFlowLogs = "DescribeFlowLogs"
// DescribeFlowLogsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFlowLogs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9588,6 +13068,12 @@ func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *reques
Name: opDescribeFlowLogs,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9633,12 +13119,62 @@ func (c *EC2) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLo
return out, req.Send()
}
+// DescribeFlowLogsPages iterates over the pages of a DescribeFlowLogs operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeFlowLogs 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 DescribeFlowLogs operation.
+// pageNum := 0
+// err := client.DescribeFlowLogsPages(params,
+// func(page *ec2.DescribeFlowLogsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeFlowLogsPages(input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool) error {
+ return c.DescribeFlowLogsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeFlowLogsPagesWithContext same as DescribeFlowLogsPages 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) DescribeFlowLogsPagesWithContext(ctx aws.Context, input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeFlowLogsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeFlowLogsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeFlowLogsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute"
// DescribeFpgaImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFpgaImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9712,7 +13248,7 @@ const opDescribeFpgaImages = "DescribeFpgaImages"
// DescribeFpgaImagesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeFpgaImages operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9738,6 +13274,12 @@ func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) (req *re
Name: opDescribeFpgaImages,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9751,9 +13293,9 @@ func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) (req *re
// DescribeFpgaImages API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more available Amazon FPGA Images (AFIs). These include
-// public AFIs, private AFIs that you own, and AFIs owned by other AWS accounts
-// for which you have load permissions.
+// Describes the Amazon FPGA Images (AFIs) available to you. These include public
+// AFIs, private AFIs that you own, and AFIs owned by other AWS accounts for
+// which you have load permissions.
//
// 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
@@ -9783,12 +13325,62 @@ func (c *EC2) DescribeFpgaImagesWithContext(ctx aws.Context, input *DescribeFpga
return out, req.Send()
}
+// DescribeFpgaImagesPages iterates over the pages of a DescribeFpgaImages operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeFpgaImages 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 DescribeFpgaImages operation.
+// pageNum := 0
+// err := client.DescribeFpgaImagesPages(params,
+// func(page *ec2.DescribeFpgaImagesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeFpgaImagesPages(input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool) error {
+ return c.DescribeFpgaImagesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeFpgaImagesPagesWithContext same as DescribeFpgaImagesPages 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) DescribeFpgaImagesPagesWithContext(ctx aws.Context, input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeFpgaImagesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeFpgaImagesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeFpgaImagesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings"
// DescribeHostReservationOfferingsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeHostReservationOfferings operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9814,6 +13406,12 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva
Name: opDescribeHostReservationOfferings,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9827,14 +13425,14 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva
// DescribeHostReservationOfferings API operation for Amazon Elastic Compute Cloud.
//
-// Describes the Dedicated Host Reservations that are available to purchase.
+// Describes the Dedicated Host reservations that are available to purchase.
//
-// The results describe all the Dedicated Host Reservation offerings, including
-// offerings that may not match the instance family and region of your Dedicated
-// Hosts. When purchasing an offering, ensure that the the instance family and
-// region of the offering matches that of the Dedicated Host/s it will be associated
-// with. For an overview of supported instance types, see Dedicated Hosts Overview
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html)
+// The results describe all the Dedicated Host reservation offerings, including
+// offerings that may not match the instance family and Region of your Dedicated
+// Hosts. When purchasing an offering, ensure that the instance family and Region
+// of the offering matches that of the Dedicated Hosts with which it is to be
+// associated. For more information about supported instance types, see Dedicated
+// Hosts Overview (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -9865,12 +13463,62 @@ func (c *EC2) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input
return out, req.Send()
}
+// DescribeHostReservationOfferingsPages iterates over the pages of a DescribeHostReservationOfferings operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeHostReservationOfferings 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 DescribeHostReservationOfferings operation.
+// pageNum := 0
+// err := client.DescribeHostReservationOfferingsPages(params,
+// func(page *ec2.DescribeHostReservationOfferingsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeHostReservationOfferingsPages(input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool) error {
+ return c.DescribeHostReservationOfferingsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeHostReservationOfferingsPagesWithContext same as DescribeHostReservationOfferingsPages 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) DescribeHostReservationOfferingsPagesWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeHostReservationOfferingsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeHostReservationOfferingsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeHostReservationOfferingsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeHostReservations = "DescribeHostReservations"
// DescribeHostReservationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeHostReservations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9896,6 +13544,12 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp
Name: opDescribeHostReservations,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9909,8 +13563,7 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp
// DescribeHostReservations API operation for Amazon Elastic Compute Cloud.
//
-// Describes Dedicated Host Reservations which are associated with Dedicated
-// Hosts in your account.
+// Describes reservations that are associated with Dedicated Hosts in 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
@@ -9940,12 +13593,62 @@ func (c *EC2) DescribeHostReservationsWithContext(ctx aws.Context, input *Descri
return out, req.Send()
}
+// DescribeHostReservationsPages iterates over the pages of a DescribeHostReservations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeHostReservations 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 DescribeHostReservations operation.
+// pageNum := 0
+// err := client.DescribeHostReservationsPages(params,
+// func(page *ec2.DescribeHostReservationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeHostReservationsPages(input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool) error {
+ return c.DescribeHostReservationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeHostReservationsPagesWithContext same as DescribeHostReservationsPages 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) DescribeHostReservationsPagesWithContext(ctx aws.Context, input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeHostReservationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeHostReservationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeHostReservationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeHosts = "DescribeHosts"
// DescribeHostsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeHosts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -9971,6 +13674,12 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Requ
Name: opDescribeHosts,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -9984,11 +13693,11 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Requ
// DescribeHosts API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your Dedicated Hosts.
+// Describes the specified Dedicated Hosts or all your Dedicated Hosts.
//
-// The results describe only the Dedicated Hosts in the region you're currently
+// The results describe only the Dedicated Hosts in the Region you're currently
// using. All listed instances consume capacity on your Dedicated Host. Dedicated
-// Hosts that have recently been released will be listed with the state released.
+// Hosts that have recently been released are listed with the state released.
//
// 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
@@ -10018,12 +13727,62 @@ func (c *EC2) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInpu
return out, req.Send()
}
+// DescribeHostsPages iterates over the pages of a DescribeHosts operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeHosts 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 DescribeHosts operation.
+// pageNum := 0
+// err := client.DescribeHostsPages(params,
+// func(page *ec2.DescribeHostsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeHostsPages(input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool) error {
+ return c.DescribeHostsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeHostsPagesWithContext same as DescribeHostsPages 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) DescribeHostsPagesWithContext(ctx aws.Context, input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeHostsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeHostsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeHostsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations"
// DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeIamInstanceProfileAssociations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10049,6 +13808,12 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamIn
Name: opDescribeIamInstanceProfileAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -10092,12 +13857,62 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context,
return out, req.Send()
}
+// DescribeIamInstanceProfileAssociationsPages iterates over the pages of a DescribeIamInstanceProfileAssociations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeIamInstanceProfileAssociations 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 DescribeIamInstanceProfileAssociations operation.
+// pageNum := 0
+// err := client.DescribeIamInstanceProfileAssociationsPages(params,
+// func(page *ec2.DescribeIamInstanceProfileAssociationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeIamInstanceProfileAssociationsPages(input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool) error {
+ return c.DescribeIamInstanceProfileAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeIamInstanceProfileAssociationsPagesWithContext same as DescribeIamInstanceProfileAssociationsPages 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) DescribeIamInstanceProfileAssociationsPagesWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeIamInstanceProfileAssociationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeIamInstanceProfileAssociationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeIamInstanceProfileAssociationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeIdFormat = "DescribeIdFormat"
// DescribeIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the DescribeIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10136,7 +13951,7 @@ func (c *EC2) DescribeIdFormatRequest(input *DescribeIdFormatInput) (req *reques
// DescribeIdFormat API operation for Amazon Elastic Compute Cloud.
//
-// Describes the ID format settings for your resources on a per-region basis,
+// Describes the ID format settings for your resources on a per-Region basis,
// for example, to view which resource types are enabled for longer IDs. This
// request only returns information about resource types whose ID formats can
// be modified; it does not return information about other resource types.
@@ -10189,7 +14004,7 @@ const opDescribeIdentityIdFormat = "DescribeIdentityIdFormat"
// DescribeIdentityIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the DescribeIdentityIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10232,7 +14047,7 @@ func (c *EC2) DescribeIdentityIdFormatRequest(input *DescribeIdentityIdFormatInp
// IAM role, or root user. For example, you can view the resource types that
// are enabled for longer IDs. This request only returns information about resource
// types whose ID formats can be modified; it does not return information about
-// other resource types. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
+// other resource types. For more information, see Resource IDs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// The following resource types support longer IDs: bundle | conversion-task
@@ -10279,7 +14094,7 @@ const opDescribeImageAttribute = "DescribeImageAttribute"
// DescribeImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10354,7 +14169,7 @@ const opDescribeImages = "DescribeImages"
// DescribeImagesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeImages operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10393,13 +14208,17 @@ func (c *EC2) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re
// DescribeImages API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of the images (AMIs, AKIs, and ARIs) available to you.
-// Images available to you include public images, private images that you own,
-// and private images owned by other AWS accounts but for which you have explicit
+// Describes the specified images (AMIs, AKIs, and ARIs) available to you or
+// all of the images available to you.
+//
+// The images available to you include public images, private images that you
+// own, and private images owned by other AWS accounts for which you have explicit
// launch permissions.
//
-// Deregistered images are included in the returned results for an unspecified
-// interval after deregistration.
+// Recently deregistered images appear in the returned results for a short interval
+// and then return empty results. After all instances that reference a deregistered
+// AMI are terminated, specifying the ID of the image results in an error indicating
+// that the AMI ID cannot be found.
//
// 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
@@ -10434,7 +14253,7 @@ const opDescribeImportImageTasks = "DescribeImportImageTasks"
// DescribeImportImageTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeImportImageTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10460,6 +14279,12 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp
Name: opDescribeImportImageTasks,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -10504,12 +14329,62 @@ func (c *EC2) DescribeImportImageTasksWithContext(ctx aws.Context, input *Descri
return out, req.Send()
}
+// DescribeImportImageTasksPages iterates over the pages of a DescribeImportImageTasks operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeImportImageTasks 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 DescribeImportImageTasks operation.
+// pageNum := 0
+// err := client.DescribeImportImageTasksPages(params,
+// func(page *ec2.DescribeImportImageTasksOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeImportImageTasksPages(input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool) error {
+ return c.DescribeImportImageTasksPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeImportImageTasksPagesWithContext same as DescribeImportImageTasksPages 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) DescribeImportImageTasksPagesWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeImportImageTasksInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeImportImageTasksRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeImportImageTasksOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks"
// DescribeImportSnapshotTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeImportSnapshotTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10535,6 +14410,12 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa
Name: opDescribeImportSnapshotTasks,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -10578,12 +14459,62 @@ func (c *EC2) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *Des
return out, req.Send()
}
+// DescribeImportSnapshotTasksPages iterates over the pages of a DescribeImportSnapshotTasks operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeImportSnapshotTasks 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 DescribeImportSnapshotTasks operation.
+// pageNum := 0
+// err := client.DescribeImportSnapshotTasksPages(params,
+// func(page *ec2.DescribeImportSnapshotTasksOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeImportSnapshotTasksPages(input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool) error {
+ return c.DescribeImportSnapshotTasksPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeImportSnapshotTasksPagesWithContext same as DescribeImportSnapshotTasksPages 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) DescribeImportSnapshotTasksPagesWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeImportSnapshotTasksInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeImportSnapshotTasksRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeImportSnapshotTasksOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeInstanceAttribute = "DescribeInstanceAttribute"
// DescribeInstanceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeInstanceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10661,7 +14592,7 @@ const opDescribeInstanceCreditSpecifications = "DescribeInstanceCreditSpecificat
// DescribeInstanceCreditSpecificationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeInstanceCreditSpecifications operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10687,6 +14618,12 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc
Name: opDescribeInstanceCreditSpecifications,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -10700,14 +14637,19 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc
// DescribeInstanceCreditSpecifications API operation for Amazon Elastic Compute Cloud.
//
-// Describes the credit option for CPU usage of one or more of your T2 instances.
+// Describes the credit option for CPU usage of the specified T2 or T3 instances.
// The credit options are standard and unlimited.
//
-// If you do not specify an instance ID, Amazon EC2 returns only the T2 instances
-// with the unlimited credit option. If you specify one or more instance IDs,
-// Amazon EC2 returns the credit option (standard or unlimited) of those instances.
-// If you specify an instance ID that is not valid, such as an instance that
-// is not a T2 instance, an error is returned.
+// If you do not specify an instance ID, Amazon EC2 returns T2 and T3 instances
+// with the unlimited credit option, as well as instances that were previously
+// configured as T2 or T3 with the unlimited credit option. For example, if
+// you resize a T2 instance, while it is configured as unlimited, to an M4 instance,
+// Amazon EC2 returns the M4 instance.
+//
+// If you specify one or more instance IDs, Amazon EC2 returns the credit option
+// (standard or unlimited) of those instances. If you specify an instance ID
+// that is not valid, such as an instance that is not a T2 or T3 instance, an
+// error is returned.
//
// Recently terminated instances might appear in the returned results. This
// interval is usually less than one hour.
@@ -10717,7 +14659,7 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc
// all, the call fails. If you specify only instance IDs in an unaffected zone,
// the call works normally.
//
-// For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html)
+// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -10748,12 +14690,62 @@ func (c *EC2) DescribeInstanceCreditSpecificationsWithContext(ctx aws.Context, i
return out, req.Send()
}
+// DescribeInstanceCreditSpecificationsPages iterates over the pages of a DescribeInstanceCreditSpecifications operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeInstanceCreditSpecifications 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 DescribeInstanceCreditSpecifications operation.
+// pageNum := 0
+// err := client.DescribeInstanceCreditSpecificationsPages(params,
+// func(page *ec2.DescribeInstanceCreditSpecificationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeInstanceCreditSpecificationsPages(input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool) error {
+ return c.DescribeInstanceCreditSpecificationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeInstanceCreditSpecificationsPagesWithContext same as DescribeInstanceCreditSpecificationsPages 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) DescribeInstanceCreditSpecificationsPagesWithContext(ctx aws.Context, input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeInstanceCreditSpecificationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeInstanceCreditSpecificationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeInstanceCreditSpecificationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeInstanceStatus = "DescribeInstanceStatus"
// DescribeInstanceStatusRequest generates a "aws/request.Request" representing the
// client's request for the DescribeInstanceStatus operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10798,27 +14790,27 @@ func (c *EC2) DescribeInstanceStatusRequest(input *DescribeInstanceStatusInput)
// DescribeInstanceStatus API operation for Amazon Elastic Compute Cloud.
//
-// Describes the status of one or more instances. By default, only running instances
-// are described, unless you specifically indicate to return the status of all
-// instances.
+// Describes the status of the specified instances or all of your instances.
+// By default, only running instances are described, unless you specifically
+// indicate to return the status of all instances.
//
// Instance status includes the following components:
//
// * Status checks - Amazon EC2 performs status checks on running EC2 instances
// to identify hardware and software issues. For more information, see Status
-// Checks for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html)
-// and Troubleshooting Instances with Failed Status Checks (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html)
+// Checks for Your Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-system-instance-status-check.html)
+// and Troubleshooting Instances with Failed Status Checks (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// * Scheduled events - Amazon EC2 can schedule events (such as reboot, stop,
// or terminate) for your instances related to hardware issues, software
// updates, or system maintenance. For more information, see Scheduled Events
-// for Your Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html)
+// for Your Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// * Instance state - You can manage your instances from the moment you launch
// them through their termination. For more information, see Instance Lifecycle
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -10860,7 +14852,7 @@ func (c *EC2) DescribeInstanceStatusWithContext(ctx aws.Context, input *Describe
// // Example iterating over at most 3 pages of a DescribeInstanceStatus operation.
// pageNum := 0
// err := client.DescribeInstanceStatusPages(params,
-// func(page *DescribeInstanceStatusOutput, lastPage bool) bool {
+// func(page *ec2.DescribeInstanceStatusOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -10904,7 +14896,7 @@ const opDescribeInstances = "DescribeInstances"
// DescribeInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -10949,7 +14941,7 @@ func (c *EC2) DescribeInstancesRequest(input *DescribeInstancesInput) (req *requ
// DescribeInstances API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your instances.
+// Describes the specified instances or all of AWS account's instances.
//
// If you specify one or more instance IDs, Amazon EC2 returns information for
// those instances. If you do not specify instance IDs, Amazon EC2 returns information
@@ -11005,7 +14997,7 @@ func (c *EC2) DescribeInstancesWithContext(ctx aws.Context, input *DescribeInsta
// // Example iterating over at most 3 pages of a DescribeInstances operation.
// pageNum := 0
// err := client.DescribeInstancesPages(params,
-// func(page *DescribeInstancesOutput, lastPage bool) bool {
+// func(page *ec2.DescribeInstancesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -11049,7 +15041,7 @@ const opDescribeInternetGateways = "DescribeInternetGateways"
// DescribeInternetGatewaysRequest generates a "aws/request.Request" representing the
// client's request for the DescribeInternetGateways operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11075,6 +15067,12 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp
Name: opDescribeInternetGateways,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11088,7 +15086,7 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp
// DescribeInternetGateways API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your Internet gateways.
+// Describes one or more of your internet gateways.
//
// 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
@@ -11118,12 +15116,62 @@ func (c *EC2) DescribeInternetGatewaysWithContext(ctx aws.Context, input *Descri
return out, req.Send()
}
+// DescribeInternetGatewaysPages iterates over the pages of a DescribeInternetGateways operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeInternetGateways 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 DescribeInternetGateways operation.
+// pageNum := 0
+// err := client.DescribeInternetGatewaysPages(params,
+// func(page *ec2.DescribeInternetGatewaysOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeInternetGatewaysPages(input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool) error {
+ return c.DescribeInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeInternetGatewaysPagesWithContext same as DescribeInternetGatewaysPages 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) DescribeInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeInternetGatewaysInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeInternetGatewaysRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeInternetGatewaysOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeKeyPairs = "DescribeKeyPairs"
// DescribeKeyPairsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeKeyPairs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11162,9 +15210,9 @@ func (c *EC2) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *reques
// DescribeKeyPairs API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your key pairs.
+// Describes the specified key pairs or all of your key pairs.
//
-// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
+// For more information about key pairs, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -11200,7 +15248,7 @@ const opDescribeLaunchTemplateVersions = "DescribeLaunchTemplateVersions"
// DescribeLaunchTemplateVersionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeLaunchTemplateVersions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11226,6 +15274,12 @@ func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplat
Name: opDescribeLaunchTemplateVersions,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11270,12 +15324,62 @@ func (c *EC2) DescribeLaunchTemplateVersionsWithContext(ctx aws.Context, input *
return out, req.Send()
}
+// DescribeLaunchTemplateVersionsPages iterates over the pages of a DescribeLaunchTemplateVersions operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeLaunchTemplateVersions 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 DescribeLaunchTemplateVersions operation.
+// pageNum := 0
+// err := client.DescribeLaunchTemplateVersionsPages(params,
+// func(page *ec2.DescribeLaunchTemplateVersionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeLaunchTemplateVersionsPages(input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool) error {
+ return c.DescribeLaunchTemplateVersionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeLaunchTemplateVersionsPagesWithContext same as DescribeLaunchTemplateVersionsPages 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) DescribeLaunchTemplateVersionsPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeLaunchTemplateVersionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeLaunchTemplateVersionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeLaunchTemplateVersionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeLaunchTemplates = "DescribeLaunchTemplates"
// DescribeLaunchTemplatesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeLaunchTemplates operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11301,6 +15405,12 @@ func (c *EC2) DescribeLaunchTemplatesRequest(input *DescribeLaunchTemplatesInput
Name: opDescribeLaunchTemplates,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11344,12 +15454,62 @@ func (c *EC2) DescribeLaunchTemplatesWithContext(ctx aws.Context, input *Describ
return out, req.Send()
}
+// DescribeLaunchTemplatesPages iterates over the pages of a DescribeLaunchTemplates operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeLaunchTemplates 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 DescribeLaunchTemplates operation.
+// pageNum := 0
+// err := client.DescribeLaunchTemplatesPages(params,
+// func(page *ec2.DescribeLaunchTemplatesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeLaunchTemplatesPages(input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool) error {
+ return c.DescribeLaunchTemplatesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeLaunchTemplatesPagesWithContext same as DescribeLaunchTemplatesPages 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) DescribeLaunchTemplatesPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeLaunchTemplatesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeLaunchTemplatesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeLaunchTemplatesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeMovingAddresses = "DescribeMovingAddresses"
// DescribeMovingAddressesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeMovingAddresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11375,6 +15535,12 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput
Name: opDescribeMovingAddresses,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11420,12 +15586,62 @@ func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *Describ
return out, req.Send()
}
+// DescribeMovingAddressesPages iterates over the pages of a DescribeMovingAddresses operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeMovingAddresses 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 DescribeMovingAddresses operation.
+// pageNum := 0
+// err := client.DescribeMovingAddressesPages(params,
+// func(page *ec2.DescribeMovingAddressesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeMovingAddressesPages(input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool) error {
+ return c.DescribeMovingAddressesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeMovingAddressesPagesWithContext same as DescribeMovingAddressesPages 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) DescribeMovingAddressesPagesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeMovingAddressesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeMovingAddressesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeMovingAddressesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeNatGateways = "DescribeNatGateways"
// DescribeNatGatewaysRequest generates a "aws/request.Request" representing the
// client's request for the DescribeNatGateways operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11470,7 +15686,7 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req *
// DescribeNatGateways API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of the your NAT gateways.
+// Describes one or more of your NAT gateways.
//
// 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
@@ -11511,7 +15727,7 @@ func (c *EC2) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNat
// // Example iterating over at most 3 pages of a DescribeNatGateways operation.
// pageNum := 0
// err := client.DescribeNatGatewaysPages(params,
-// func(page *DescribeNatGatewaysOutput, lastPage bool) bool {
+// func(page *ec2.DescribeNatGatewaysOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -11555,7 +15771,7 @@ const opDescribeNetworkAcls = "DescribeNetworkAcls"
// DescribeNetworkAclsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeNetworkAcls operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11581,6 +15797,12 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *
Name: opDescribeNetworkAcls,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11596,7 +15818,7 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *
//
// Describes one or more of your network ACLs.
//
-// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html)
+// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -11627,12 +15849,62 @@ func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNet
return out, req.Send()
}
+// DescribeNetworkAclsPages iterates over the pages of a DescribeNetworkAcls operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeNetworkAcls 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 DescribeNetworkAcls operation.
+// pageNum := 0
+// err := client.DescribeNetworkAclsPages(params,
+// func(page *ec2.DescribeNetworkAclsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeNetworkAclsPages(input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool) error {
+ return c.DescribeNetworkAclsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeNetworkAclsPagesWithContext same as DescribeNetworkAclsPages 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) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeNetworkAclsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeNetworkAclsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeNetworkAclsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute"
// DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeNetworkInterfaceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11707,7 +15979,7 @@ const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissio
// DescribeNetworkInterfacePermissionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeNetworkInterfacePermissions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11733,6 +16005,12 @@ func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkI
Name: opDescribeNetworkInterfacePermissions,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11776,12 +16054,62 @@ func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, in
return out, req.Send()
}
+// DescribeNetworkInterfacePermissionsPages iterates over the pages of a DescribeNetworkInterfacePermissions operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeNetworkInterfacePermissions 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 DescribeNetworkInterfacePermissions operation.
+// pageNum := 0
+// err := client.DescribeNetworkInterfacePermissionsPages(params,
+// func(page *ec2.DescribeNetworkInterfacePermissionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeNetworkInterfacePermissionsPages(input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool) error {
+ return c.DescribeNetworkInterfacePermissionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeNetworkInterfacePermissionsPagesWithContext same as DescribeNetworkInterfacePermissionsPages 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) DescribeNetworkInterfacePermissionsPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeNetworkInterfacePermissionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeNetworkInterfacePermissionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeNetworkInterfacePermissionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces"
// DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeNetworkInterfaces operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11807,6 +16135,12 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI
Name: opDescribeNetworkInterfaces,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11850,12 +16184,62 @@ func (c *EC2) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *Descr
return out, req.Send()
}
+// DescribeNetworkInterfacesPages iterates over the pages of a DescribeNetworkInterfaces operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeNetworkInterfaces 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 DescribeNetworkInterfaces operation.
+// pageNum := 0
+// err := client.DescribeNetworkInterfacesPages(params,
+// func(page *ec2.DescribeNetworkInterfacesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeNetworkInterfacesPages(input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool) error {
+ return c.DescribeNetworkInterfacesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeNetworkInterfacesPagesWithContext same as DescribeNetworkInterfacesPages 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) DescribeNetworkInterfacesPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeNetworkInterfacesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeNetworkInterfacesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeNetworkInterfacesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribePlacementGroups = "DescribePlacementGroups"
// DescribePlacementGroupsRequest generates a "aws/request.Request" representing the
// client's request for the DescribePlacementGroups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11894,8 +16278,8 @@ func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput
// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your placement groups. For more information, see
-// Placement Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
+// Describes the specified placement groups or all of your placement groups.
+// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -11931,7 +16315,7 @@ const opDescribePrefixLists = "DescribePrefixLists"
// DescribePrefixListsRequest generates a "aws/request.Request" representing the
// client's request for the DescribePrefixLists operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -11957,6 +16341,12 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *
Name: opDescribePrefixLists,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -11974,7 +16364,8 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *
// the prefix list name and prefix list ID of the service and the IP address
// range for the service. A prefix list ID is required for creating an outbound
// security group rule that allows traffic from a VPC to access an AWS service
-// through a gateway VPC endpoint.
+// through a gateway VPC endpoint. Currently, the services that support this
+// action are Amazon S3 and Amazon DynamoDB.
//
// 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
@@ -12004,12 +16395,62 @@ func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePre
return out, req.Send()
}
+// DescribePrefixListsPages iterates over the pages of a DescribePrefixLists operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribePrefixLists 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 DescribePrefixLists operation.
+// pageNum := 0
+// err := client.DescribePrefixListsPages(params,
+// func(page *ec2.DescribePrefixListsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribePrefixListsPages(input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool) error {
+ return c.DescribePrefixListsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribePrefixListsPagesWithContext same as DescribePrefixListsPages 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) DescribePrefixListsPagesWithContext(ctx aws.Context, input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribePrefixListsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribePrefixListsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribePrefixListsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat"
// DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the DescribePrincipalIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12035,6 +16476,12 @@ func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatI
Name: opDescribePrincipalIdFormat,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -12092,12 +16539,192 @@ func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *Descr
return out, req.Send()
}
+// DescribePrincipalIdFormatPages iterates over the pages of a DescribePrincipalIdFormat operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribePrincipalIdFormat 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 DescribePrincipalIdFormat operation.
+// pageNum := 0
+// err := client.DescribePrincipalIdFormatPages(params,
+// func(page *ec2.DescribePrincipalIdFormatOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribePrincipalIdFormatPages(input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool) error {
+ return c.DescribePrincipalIdFormatPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribePrincipalIdFormatPagesWithContext same as DescribePrincipalIdFormatPages 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) DescribePrincipalIdFormatPagesWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribePrincipalIdFormatInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribePrincipalIdFormatRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribePrincipalIdFormatOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribePublicIpv4Pools = "DescribePublicIpv4Pools"
+
+// DescribePublicIpv4PoolsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribePublicIpv4Pools 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 DescribePublicIpv4Pools for more information on using the DescribePublicIpv4Pools
+// 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 DescribePublicIpv4PoolsRequest method.
+// req, resp := client.DescribePublicIpv4PoolsRequest(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/DescribePublicIpv4Pools
+func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput) (req *request.Request, output *DescribePublicIpv4PoolsOutput) {
+ op := &request.Operation{
+ Name: opDescribePublicIpv4Pools,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribePublicIpv4PoolsInput{}
+ }
+
+ output = &DescribePublicIpv4PoolsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribePublicIpv4Pools API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the specified IPv4 address pools.
+//
+// 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 DescribePublicIpv4Pools for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePublicIpv4Pools
+func (c *EC2) DescribePublicIpv4Pools(input *DescribePublicIpv4PoolsInput) (*DescribePublicIpv4PoolsOutput, error) {
+ req, out := c.DescribePublicIpv4PoolsRequest(input)
+ return out, req.Send()
+}
+
+// DescribePublicIpv4PoolsWithContext is the same as DescribePublicIpv4Pools with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribePublicIpv4Pools 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) DescribePublicIpv4PoolsWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, opts ...request.Option) (*DescribePublicIpv4PoolsOutput, error) {
+ req, out := c.DescribePublicIpv4PoolsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribePublicIpv4PoolsPages iterates over the pages of a DescribePublicIpv4Pools operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribePublicIpv4Pools 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 DescribePublicIpv4Pools operation.
+// pageNum := 0
+// err := client.DescribePublicIpv4PoolsPages(params,
+// func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribePublicIpv4PoolsPages(input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool) error {
+ return c.DescribePublicIpv4PoolsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribePublicIpv4PoolsPagesWithContext same as DescribePublicIpv4PoolsPages 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) DescribePublicIpv4PoolsPagesWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribePublicIpv4PoolsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribePublicIpv4PoolsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribePublicIpv4PoolsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeRegions = "DescribeRegions"
// DescribeRegionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeRegions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12136,10 +16763,14 @@ func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.
// DescribeRegions API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more regions that are currently available to you.
+// Describes the Regions that are enabled for your account, or all Regions.
//
-// For a list of the regions supported by Amazon EC2, see Regions and Endpoints
-// (http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region).
+// For a list of the Regions supported by Amazon EC2, see Regions and Endpoints
+// (https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region).
+//
+// For information about enabling and disabling Regions for your account, see
+// Managing AWS Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html)
+// in the AWS General Reference.
//
// 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
@@ -12174,7 +16805,7 @@ const opDescribeReservedInstances = "DescribeReservedInstances"
// DescribeReservedInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeReservedInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12215,7 +16846,7 @@ func (c *EC2) DescribeReservedInstancesRequest(input *DescribeReservedInstancesI
//
// Describes one or more of the Reserved Instances that you purchased.
//
-// For more information about Reserved Instances, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html)
+// 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 Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -12251,7 +16882,7 @@ const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings"
// DescribeReservedInstancesListingsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeReservedInstancesListings operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12310,7 +16941,7 @@ 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -12346,7 +16977,7 @@ const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModif
// DescribeReservedInstancesModificationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeReservedInstancesModifications operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12396,7 +17027,7 @@ 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
+// For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -12438,7 +17069,7 @@ func (c *EC2) DescribeReservedInstancesModificationsWithContext(ctx aws.Context,
// // Example iterating over at most 3 pages of a DescribeReservedInstancesModifications operation.
// pageNum := 0
// err := client.DescribeReservedInstancesModificationsPages(params,
-// func(page *DescribeReservedInstancesModificationsOutput, lastPage bool) bool {
+// func(page *ec2.DescribeReservedInstancesModificationsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -12482,7 +17113,7 @@ const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings
// DescribeReservedInstancesOfferingsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeReservedInstancesOfferings operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12537,7 +17168,7 @@ 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -12579,7 +17210,7 @@ func (c *EC2) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, inp
// // Example iterating over at most 3 pages of a DescribeReservedInstancesOfferings operation.
// pageNum := 0
// err := client.DescribeReservedInstancesOfferingsPages(params,
-// func(page *DescribeReservedInstancesOfferingsOutput, lastPage bool) bool {
+// func(page *ec2.DescribeReservedInstancesOfferingsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -12623,7 +17254,7 @@ const opDescribeRouteTables = "DescribeRouteTables"
// DescribeRouteTablesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeRouteTables operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12649,6 +17280,12 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *
Name: opDescribeRouteTables,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -12669,7 +17306,7 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *
// with the main route table. This command does not return the subnet ID for
// implicit associations.
//
-// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -12700,12 +17337,62 @@ func (c *EC2) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRou
return out, req.Send()
}
+// DescribeRouteTablesPages iterates over the pages of a DescribeRouteTables operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeRouteTables 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 DescribeRouteTables operation.
+// pageNum := 0
+// err := client.DescribeRouteTablesPages(params,
+// func(page *ec2.DescribeRouteTablesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeRouteTablesPages(input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool) error {
+ return c.DescribeRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeRouteTablesPagesWithContext same as DescribeRouteTablesPages 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) DescribeRouteTablesPagesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeRouteTablesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeRouteTablesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeRouteTablesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability"
// DescribeScheduledInstanceAvailabilityRequest generates a "aws/request.Request" representing the
// client's request for the DescribeScheduledInstanceAvailability operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12731,6 +17418,12 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeSchedu
Name: opDescribeScheduledInstanceAvailability,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -12782,12 +17475,62 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context,
return out, req.Send()
}
+// DescribeScheduledInstanceAvailabilityPages iterates over the pages of a DescribeScheduledInstanceAvailability operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeScheduledInstanceAvailability 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 DescribeScheduledInstanceAvailability operation.
+// pageNum := 0
+// err := client.DescribeScheduledInstanceAvailabilityPages(params,
+// func(page *ec2.DescribeScheduledInstanceAvailabilityOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeScheduledInstanceAvailabilityPages(input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool) error {
+ return c.DescribeScheduledInstanceAvailabilityPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeScheduledInstanceAvailabilityPagesWithContext same as DescribeScheduledInstanceAvailabilityPages 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) DescribeScheduledInstanceAvailabilityPagesWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeScheduledInstanceAvailabilityInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeScheduledInstanceAvailabilityRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeScheduledInstanceAvailabilityOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeScheduledInstances = "DescribeScheduledInstances"
// DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeScheduledInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12813,6 +17556,12 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance
Name: opDescribeScheduledInstances,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -12826,7 +17575,7 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance
// DescribeScheduledInstances API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your Scheduled Instances.
+// Describes the specified Scheduled Instances or all your Scheduled 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
@@ -12856,12 +17605,62 @@ func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *Desc
return out, req.Send()
}
+// DescribeScheduledInstancesPages iterates over the pages of a DescribeScheduledInstances operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeScheduledInstances 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 DescribeScheduledInstances operation.
+// pageNum := 0
+// err := client.DescribeScheduledInstancesPages(params,
+// func(page *ec2.DescribeScheduledInstancesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeScheduledInstancesPages(input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool) error {
+ return c.DescribeScheduledInstancesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeScheduledInstancesPagesWithContext same as DescribeScheduledInstancesPages 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) DescribeScheduledInstancesPagesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeScheduledInstancesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeScheduledInstancesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeScheduledInstancesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences"
// DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSecurityGroupReferences operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12900,7 +17699,7 @@ func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGrou
// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud.
//
-// [EC2-VPC only] Describes the VPCs on the other side of a VPC peering connection
+// [VPC only] 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
@@ -12936,7 +17735,7 @@ const opDescribeSecurityGroups = "DescribeSecurityGroups"
// DescribeSecurityGroupsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSecurityGroups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -12962,6 +17761,12 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput)
Name: opDescribeSecurityGroups,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -12975,13 +17780,13 @@ func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput)
// DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of your security groups.
+// Describes the specified security groups or all of your security groups.
//
// A security group is for use with instances either in the EC2-Classic platform
// or in a specific VPC. For more information, see Amazon EC2 Security Groups
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html)
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html)
// in the Amazon Elastic Compute Cloud User Guide and Security Groups for Your
-// VPC (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html)
+// VPC (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -13012,12 +17817,62 @@ func (c *EC2) DescribeSecurityGroupsWithContext(ctx aws.Context, input *Describe
return out, req.Send()
}
+// DescribeSecurityGroupsPages iterates over the pages of a DescribeSecurityGroups operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeSecurityGroups 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 DescribeSecurityGroups operation.
+// pageNum := 0
+// err := client.DescribeSecurityGroupsPages(params,
+// func(page *ec2.DescribeSecurityGroupsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeSecurityGroupsPages(input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool) error {
+ return c.DescribeSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeSecurityGroupsPagesWithContext same as DescribeSecurityGroupsPages 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) DescribeSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeSecurityGroupsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeSecurityGroupsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeSecurityGroupsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute"
// DescribeSnapshotAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSnapshotAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13059,7 +17914,7 @@ 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -13095,7 +17950,7 @@ const opDescribeSnapshots = "DescribeSnapshots"
// DescribeSnapshotsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSnapshots operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13140,10 +17995,12 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ
// DescribeSnapshots API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of the EBS snapshots available to you. Available snapshots
-// include public snapshots available for any AWS account to launch, private
-// snapshots that you own, and private snapshots owned by another AWS account
-// but for which you've been given explicit create volume permissions.
+// Describes the specified EBS snapshots available to you or all of the EBS
+// snapshots available to you.
+//
+// The snapshots available to you include public snapshots, private snapshots
+// that you own, and private snapshots owned by other AWS accounts for which
+// you have explicit create volume permissions.
//
// The create volume permissions fall into the following categories:
//
@@ -13184,7 +18041,7 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ
// a NextToken value that can be passed to a subsequent DescribeSnapshots request
// to retrieve the remaining results.
//
-// For more information about EBS snapshots, see Amazon EBS Snapshots (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -13226,7 +18083,7 @@ func (c *EC2) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnaps
// // Example iterating over at most 3 pages of a DescribeSnapshots operation.
// pageNum := 0
// err := client.DescribeSnapshotsPages(params,
-// func(page *DescribeSnapshotsOutput, lastPage bool) bool {
+// func(page *ec2.DescribeSnapshotsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -13270,7 +18127,7 @@ const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription"
// DescribeSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotDatafeedSubscription operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13310,7 +18167,7 @@ func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafee
// DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud.
//
// Describes the data feed for Spot Instances. For more information, see Spot
-// Instance Data Feed (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html)
+// Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html)
// in the Amazon EC2 User Guide for Linux Instances.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -13346,7 +18203,7 @@ const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances"
// DescribeSpotFleetInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotFleetInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13420,7 +18277,7 @@ const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory"
// DescribeSpotFleetRequestHistoryRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotFleetRequestHistory operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13464,7 +18321,7 @@ func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetReq
//
// Spot Fleet events are delayed by up to 30 seconds before they can be described.
// This ensures that you can query by the last evaluated time and not miss a
-// recorded event.
+// recorded event. Spot Fleet events are available for 48 hours.
//
// 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
@@ -13499,7 +18356,7 @@ const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests"
// DescribeSpotFleetRequestsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotFleetRequests operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13588,7 +18445,7 @@ func (c *EC2) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *Descr
// // Example iterating over at most 3 pages of a DescribeSpotFleetRequests operation.
// pageNum := 0
// err := client.DescribeSpotFleetRequestsPages(params,
-// func(page *DescribeSpotFleetRequestsOutput, lastPage bool) bool {
+// func(page *ec2.DescribeSpotFleetRequestsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -13632,7 +18489,7 @@ const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests"
// DescribeSpotInstanceRequestsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotInstanceRequests operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13658,6 +18515,12 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq
Name: opDescribeSpotInstanceRequests,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -13679,6 +18542,13 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq
// instance. Alternatively, you can use DescribeInstances with a filter to look
// for instances where the instance lifecycle is spot.
//
+// We recommend that you set MaxResults to a value between 5 and 1000 to limit
+// the number of results returned. This paginates the output, which makes the
+// list more manageable and returns the results faster. If the list of results
+// exceeds your MaxResults value, then that number of results is returned along
+// with a NextToken value that can be passed to a subsequent DescribeSpotInstanceRequests
+// request to retrieve the remaining results.
+//
// Spot Instance requests are deleted four hours after they are canceled and
// their instances are terminated.
//
@@ -13710,12 +18580,62 @@ func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *De
return out, req.Send()
}
+// DescribeSpotInstanceRequestsPages iterates over the pages of a DescribeSpotInstanceRequests operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeSpotInstanceRequests 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 DescribeSpotInstanceRequests operation.
+// pageNum := 0
+// err := client.DescribeSpotInstanceRequestsPages(params,
+// func(page *ec2.DescribeSpotInstanceRequestsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeSpotInstanceRequestsPages(input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool) error {
+ return c.DescribeSpotInstanceRequestsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeSpotInstanceRequestsPagesWithContext same as DescribeSpotInstanceRequestsPages 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) DescribeSpotInstanceRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeSpotInstanceRequestsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeSpotInstanceRequestsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory"
// DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSpotPriceHistory operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13761,7 +18681,7 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp
// DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud.
//
// Describes the Spot price history. For more information, see Spot Instance
-// Pricing History (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html)
+// Pricing History (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html)
// in the Amazon EC2 User Guide for Linux Instances.
//
// When you specify a start and end time, this operation returns the prices
@@ -13808,7 +18728,7 @@ func (c *EC2) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *Descri
// // Example iterating over at most 3 pages of a DescribeSpotPriceHistory operation.
// pageNum := 0
// err := client.DescribeSpotPriceHistoryPages(params,
-// func(page *DescribeSpotPriceHistoryOutput, lastPage bool) bool {
+// func(page *ec2.DescribeSpotPriceHistoryOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -13852,7 +18772,7 @@ const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups"
// DescribeStaleSecurityGroupsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeStaleSecurityGroups operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13878,6 +18798,12 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro
Name: opDescribeStaleSecurityGroups,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -13891,10 +18817,10 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro
// DescribeStaleSecurityGroups API operation for Amazon Elastic Compute Cloud.
//
-// [EC2-VPC only] Describes the stale security group rules for security groups
-// in a specified VPC. Rules are stale when they reference a deleted security
-// group in a peer VPC, or a security group in a peer VPC for which the VPC
-// peering connection has been deleted.
+// [VPC only] Describes the stale security group rules for security groups in
+// a specified VPC. Rules are stale when they reference a deleted security group
+// in a peer VPC, or 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
@@ -13924,12 +18850,62 @@ func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *Des
return out, req.Send()
}
+// DescribeStaleSecurityGroupsPages iterates over the pages of a DescribeStaleSecurityGroups operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeStaleSecurityGroups 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 DescribeStaleSecurityGroups operation.
+// pageNum := 0
+// err := client.DescribeStaleSecurityGroupsPages(params,
+// func(page *ec2.DescribeStaleSecurityGroupsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeStaleSecurityGroupsPages(input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool) error {
+ return c.DescribeStaleSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeStaleSecurityGroupsPagesWithContext same as DescribeStaleSecurityGroupsPages 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) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeStaleSecurityGroupsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeStaleSecurityGroupsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeStaleSecurityGroupsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeSubnets = "DescribeSubnets"
// DescribeSubnetsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeSubnets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -13955,6 +18931,12 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.
Name: opDescribeSubnets,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -13970,7 +18952,7 @@ func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.
//
// Describes one or more of your subnets.
//
-// For more information about subnets, see Your VPC and Subnets (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html)
+// For more information, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -14001,12 +18983,62 @@ func (c *EC2) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnets
return out, req.Send()
}
+// DescribeSubnetsPages iterates over the pages of a DescribeSubnets operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeSubnets 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 DescribeSubnets operation.
+// pageNum := 0
+// err := client.DescribeSubnetsPages(params,
+// func(page *ec2.DescribeSubnetsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeSubnetsPages(input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool) error {
+ return c.DescribeSubnetsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeSubnetsPagesWithContext same as DescribeSubnetsPages 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) DescribeSubnetsPagesWithContext(ctx aws.Context, input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeSubnetsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeSubnetsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeSubnetsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeTags = "DescribeTags"
// DescribeTagsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeTags operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14051,9 +19083,9 @@ func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques
// DescribeTags API operation for Amazon Elastic Compute Cloud.
//
-// Describes one or more of the tags for your EC2 resources.
+// Describes the specified tags for your EC2 resources.
//
-// For more information about tags, see Tagging Your Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
+// For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -14095,7 +19127,7 @@ func (c *EC2) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput,
// // Example iterating over at most 3 pages of a DescribeTags operation.
// pageNum := 0
// err := client.DescribeTagsPages(params,
-// func(page *DescribeTagsOutput, lastPage bool) bool {
+// func(page *ec2.DescribeTagsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -14134,12 +19166,929 @@ func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsI
return p.Err()
}
+const opDescribeTrafficMirrorFilters = "DescribeTrafficMirrorFilters"
+
+// DescribeTrafficMirrorFiltersRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTrafficMirrorFilters 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 DescribeTrafficMirrorFilters for more information on using the DescribeTrafficMirrorFilters
+// 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 DescribeTrafficMirrorFiltersRequest method.
+// req, resp := client.DescribeTrafficMirrorFiltersRequest(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/DescribeTrafficMirrorFilters
+func (c *EC2) DescribeTrafficMirrorFiltersRequest(input *DescribeTrafficMirrorFiltersInput) (req *request.Request, output *DescribeTrafficMirrorFiltersOutput) {
+ op := &request.Operation{
+ Name: opDescribeTrafficMirrorFilters,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTrafficMirrorFiltersInput{}
+ }
+
+ output = &DescribeTrafficMirrorFiltersOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTrafficMirrorFilters API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more Traffic Mirror filters.
+//
+// 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 DescribeTrafficMirrorFilters for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilters
+func (c *EC2) DescribeTrafficMirrorFilters(input *DescribeTrafficMirrorFiltersInput) (*DescribeTrafficMirrorFiltersOutput, error) {
+ req, out := c.DescribeTrafficMirrorFiltersRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorFiltersWithContext is the same as DescribeTrafficMirrorFilters with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTrafficMirrorFilters 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) DescribeTrafficMirrorFiltersWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, opts ...request.Option) (*DescribeTrafficMirrorFiltersOutput, error) {
+ req, out := c.DescribeTrafficMirrorFiltersRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorFiltersPages iterates over the pages of a DescribeTrafficMirrorFilters operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTrafficMirrorFilters 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 DescribeTrafficMirrorFilters operation.
+// pageNum := 0
+// err := client.DescribeTrafficMirrorFiltersPages(params,
+// func(page *ec2.DescribeTrafficMirrorFiltersOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTrafficMirrorFiltersPages(input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool) error {
+ return c.DescribeTrafficMirrorFiltersPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTrafficMirrorFiltersPagesWithContext same as DescribeTrafficMirrorFiltersPages 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) DescribeTrafficMirrorFiltersPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTrafficMirrorFiltersInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTrafficMirrorFiltersRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTrafficMirrorFiltersOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTrafficMirrorSessions = "DescribeTrafficMirrorSessions"
+
+// DescribeTrafficMirrorSessionsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTrafficMirrorSessions 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 DescribeTrafficMirrorSessions for more information on using the DescribeTrafficMirrorSessions
+// 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 DescribeTrafficMirrorSessionsRequest method.
+// req, resp := client.DescribeTrafficMirrorSessionsRequest(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/DescribeTrafficMirrorSessions
+func (c *EC2) DescribeTrafficMirrorSessionsRequest(input *DescribeTrafficMirrorSessionsInput) (req *request.Request, output *DescribeTrafficMirrorSessionsOutput) {
+ op := &request.Operation{
+ Name: opDescribeTrafficMirrorSessions,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTrafficMirrorSessionsInput{}
+ }
+
+ output = &DescribeTrafficMirrorSessionsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTrafficMirrorSessions API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror
+// sessions 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeTrafficMirrorSessions for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorSessions
+func (c *EC2) DescribeTrafficMirrorSessions(input *DescribeTrafficMirrorSessionsInput) (*DescribeTrafficMirrorSessionsOutput, error) {
+ req, out := c.DescribeTrafficMirrorSessionsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorSessionsWithContext is the same as DescribeTrafficMirrorSessions with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTrafficMirrorSessions 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) DescribeTrafficMirrorSessionsWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, opts ...request.Option) (*DescribeTrafficMirrorSessionsOutput, error) {
+ req, out := c.DescribeTrafficMirrorSessionsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorSessionsPages iterates over the pages of a DescribeTrafficMirrorSessions operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTrafficMirrorSessions 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 DescribeTrafficMirrorSessions operation.
+// pageNum := 0
+// err := client.DescribeTrafficMirrorSessionsPages(params,
+// func(page *ec2.DescribeTrafficMirrorSessionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTrafficMirrorSessionsPages(input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool) error {
+ return c.DescribeTrafficMirrorSessionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTrafficMirrorSessionsPagesWithContext same as DescribeTrafficMirrorSessionsPages 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) DescribeTrafficMirrorSessionsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTrafficMirrorSessionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTrafficMirrorSessionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTrafficMirrorSessionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTrafficMirrorTargets = "DescribeTrafficMirrorTargets"
+
+// DescribeTrafficMirrorTargetsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTrafficMirrorTargets 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 DescribeTrafficMirrorTargets for more information on using the DescribeTrafficMirrorTargets
+// 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 DescribeTrafficMirrorTargetsRequest method.
+// req, resp := client.DescribeTrafficMirrorTargetsRequest(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/DescribeTrafficMirrorTargets
+func (c *EC2) DescribeTrafficMirrorTargetsRequest(input *DescribeTrafficMirrorTargetsInput) (req *request.Request, output *DescribeTrafficMirrorTargetsOutput) {
+ op := &request.Operation{
+ Name: opDescribeTrafficMirrorTargets,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTrafficMirrorTargetsInput{}
+ }
+
+ output = &DescribeTrafficMirrorTargetsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTrafficMirrorTargets API operation for Amazon Elastic Compute Cloud.
+//
+// Information about one or more Traffic Mirror targets.
+//
+// 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 DescribeTrafficMirrorTargets for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorTargets
+func (c *EC2) DescribeTrafficMirrorTargets(input *DescribeTrafficMirrorTargetsInput) (*DescribeTrafficMirrorTargetsOutput, error) {
+ req, out := c.DescribeTrafficMirrorTargetsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorTargetsWithContext is the same as DescribeTrafficMirrorTargets with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTrafficMirrorTargets 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) DescribeTrafficMirrorTargetsWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, opts ...request.Option) (*DescribeTrafficMirrorTargetsOutput, error) {
+ req, out := c.DescribeTrafficMirrorTargetsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTrafficMirrorTargetsPages iterates over the pages of a DescribeTrafficMirrorTargets operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTrafficMirrorTargets 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 DescribeTrafficMirrorTargets operation.
+// pageNum := 0
+// err := client.DescribeTrafficMirrorTargetsPages(params,
+// func(page *ec2.DescribeTrafficMirrorTargetsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTrafficMirrorTargetsPages(input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool) error {
+ return c.DescribeTrafficMirrorTargetsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTrafficMirrorTargetsPagesWithContext same as DescribeTrafficMirrorTargetsPages 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) DescribeTrafficMirrorTargetsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTrafficMirrorTargetsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTrafficMirrorTargetsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTrafficMirrorTargetsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTransitGatewayAttachments = "DescribeTransitGatewayAttachments"
+
+// DescribeTransitGatewayAttachmentsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTransitGatewayAttachments 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 DescribeTransitGatewayAttachments for more information on using the DescribeTransitGatewayAttachments
+// 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 DescribeTransitGatewayAttachmentsRequest method.
+// req, resp := client.DescribeTransitGatewayAttachmentsRequest(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/DescribeTransitGatewayAttachments
+func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGatewayAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayAttachmentsOutput) {
+ op := &request.Operation{
+ Name: opDescribeTransitGatewayAttachments,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTransitGatewayAttachmentsInput{}
+ }
+
+ output = &DescribeTransitGatewayAttachmentsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTransitGatewayAttachments API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more attachments between resources and transit gateways.
+// By default, all attachments are described. Alternatively, you can filter
+// the results by attachment ID, attachment state, resource ID, or resource
+// owner.
+//
+// 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 DescribeTransitGatewayAttachments for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayAttachments
+func (c *EC2) DescribeTransitGatewayAttachments(input *DescribeTransitGatewayAttachmentsInput) (*DescribeTransitGatewayAttachmentsOutput, error) {
+ req, out := c.DescribeTransitGatewayAttachmentsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayAttachmentsWithContext is the same as DescribeTransitGatewayAttachments with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTransitGatewayAttachments 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) DescribeTransitGatewayAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayAttachmentsOutput, error) {
+ req, out := c.DescribeTransitGatewayAttachmentsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayAttachmentsPages iterates over the pages of a DescribeTransitGatewayAttachments operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTransitGatewayAttachments 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 DescribeTransitGatewayAttachments operation.
+// pageNum := 0
+// err := client.DescribeTransitGatewayAttachmentsPages(params,
+// func(page *ec2.DescribeTransitGatewayAttachmentsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTransitGatewayAttachmentsPages(input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool) error {
+ return c.DescribeTransitGatewayAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTransitGatewayAttachmentsPagesWithContext same as DescribeTransitGatewayAttachmentsPages 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) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTransitGatewayAttachmentsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTransitGatewayAttachmentsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTransitGatewayAttachmentsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTransitGatewayRouteTables = "DescribeTransitGatewayRouteTables"
+
+// DescribeTransitGatewayRouteTablesRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTransitGatewayRouteTables 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 DescribeTransitGatewayRouteTables for more information on using the DescribeTransitGatewayRouteTables
+// 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 DescribeTransitGatewayRouteTablesRequest method.
+// req, resp := client.DescribeTransitGatewayRouteTablesRequest(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/DescribeTransitGatewayRouteTables
+func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGatewayRouteTablesInput) (req *request.Request, output *DescribeTransitGatewayRouteTablesOutput) {
+ op := &request.Operation{
+ Name: opDescribeTransitGatewayRouteTables,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTransitGatewayRouteTablesInput{}
+ }
+
+ output = &DescribeTransitGatewayRouteTablesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTransitGatewayRouteTables API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more transit gateway route tables. By default, all transit
+// gateway route tables 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeTransitGatewayRouteTables for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayRouteTables
+func (c *EC2) DescribeTransitGatewayRouteTables(input *DescribeTransitGatewayRouteTablesInput) (*DescribeTransitGatewayRouteTablesOutput, error) {
+ req, out := c.DescribeTransitGatewayRouteTablesRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayRouteTablesWithContext is the same as DescribeTransitGatewayRouteTables with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTransitGatewayRouteTables 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) DescribeTransitGatewayRouteTablesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, opts ...request.Option) (*DescribeTransitGatewayRouteTablesOutput, error) {
+ req, out := c.DescribeTransitGatewayRouteTablesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayRouteTablesPages iterates over the pages of a DescribeTransitGatewayRouteTables operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTransitGatewayRouteTables 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 DescribeTransitGatewayRouteTables operation.
+// pageNum := 0
+// err := client.DescribeTransitGatewayRouteTablesPages(params,
+// func(page *ec2.DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTransitGatewayRouteTablesPages(input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool) error {
+ return c.DescribeTransitGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTransitGatewayRouteTablesPagesWithContext same as DescribeTransitGatewayRouteTablesPages 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) DescribeTransitGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTransitGatewayRouteTablesInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTransitGatewayRouteTablesRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTransitGatewayRouteTablesOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTransitGatewayVpcAttachments = "DescribeTransitGatewayVpcAttachments"
+
+// DescribeTransitGatewayVpcAttachmentsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTransitGatewayVpcAttachments 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 DescribeTransitGatewayVpcAttachments for more information on using the DescribeTransitGatewayVpcAttachments
+// 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 DescribeTransitGatewayVpcAttachmentsRequest method.
+// req, resp := client.DescribeTransitGatewayVpcAttachmentsRequest(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/DescribeTransitGatewayVpcAttachments
+func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransitGatewayVpcAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayVpcAttachmentsOutput) {
+ op := &request.Operation{
+ Name: opDescribeTransitGatewayVpcAttachments,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTransitGatewayVpcAttachmentsInput{}
+ }
+
+ output = &DescribeTransitGatewayVpcAttachmentsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTransitGatewayVpcAttachments API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more VPC attachments. By default, all VPC attachments 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeTransitGatewayVpcAttachments for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayVpcAttachments
+func (c *EC2) DescribeTransitGatewayVpcAttachments(input *DescribeTransitGatewayVpcAttachmentsInput) (*DescribeTransitGatewayVpcAttachmentsOutput, error) {
+ req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayVpcAttachmentsWithContext is the same as DescribeTransitGatewayVpcAttachments with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTransitGatewayVpcAttachments 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) DescribeTransitGatewayVpcAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayVpcAttachmentsOutput, error) {
+ req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewayVpcAttachmentsPages iterates over the pages of a DescribeTransitGatewayVpcAttachments operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTransitGatewayVpcAttachments 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 DescribeTransitGatewayVpcAttachments operation.
+// pageNum := 0
+// err := client.DescribeTransitGatewayVpcAttachmentsPages(params,
+// func(page *ec2.DescribeTransitGatewayVpcAttachmentsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTransitGatewayVpcAttachmentsPages(input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error {
+ return c.DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTransitGatewayVpcAttachmentsPagesWithContext same as DescribeTransitGatewayVpcAttachmentsPages 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) DescribeTransitGatewayVpcAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTransitGatewayVpcAttachmentsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTransitGatewayVpcAttachmentsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTransitGatewayVpcAttachmentsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opDescribeTransitGateways = "DescribeTransitGateways"
+
+// DescribeTransitGatewaysRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTransitGateways 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 DescribeTransitGateways for more information on using the DescribeTransitGateways
+// 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 DescribeTransitGatewaysRequest method.
+// req, resp := client.DescribeTransitGatewaysRequest(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/DescribeTransitGateways
+func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput) (req *request.Request, output *DescribeTransitGatewaysOutput) {
+ op := &request.Operation{
+ Name: opDescribeTransitGateways,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &DescribeTransitGatewaysInput{}
+ }
+
+ output = &DescribeTransitGatewaysOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTransitGateways API operation for Amazon Elastic Compute Cloud.
+//
+// Describes one or more transit gateways. By default, all transit gateways
+// 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DescribeTransitGateways for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGateways
+func (c *EC2) DescribeTransitGateways(input *DescribeTransitGatewaysInput) (*DescribeTransitGatewaysOutput, error) {
+ req, out := c.DescribeTransitGatewaysRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewaysWithContext is the same as DescribeTransitGateways with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTransitGateways 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) DescribeTransitGatewaysWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, opts ...request.Option) (*DescribeTransitGatewaysOutput, error) {
+ req, out := c.DescribeTransitGatewaysRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// DescribeTransitGatewaysPages iterates over the pages of a DescribeTransitGateways operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeTransitGateways 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 DescribeTransitGateways operation.
+// pageNum := 0
+// err := client.DescribeTransitGatewaysPages(params,
+// func(page *ec2.DescribeTransitGatewaysOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeTransitGatewaysPages(input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool) error {
+ return c.DescribeTransitGatewaysPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeTransitGatewaysPagesWithContext same as DescribeTransitGatewaysPages 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) DescribeTransitGatewaysPagesWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeTransitGatewaysInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeTransitGatewaysRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeTransitGatewaysOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVolumeAttribute = "DescribeVolumeAttribute"
// DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVolumeAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14181,7 +20130,7 @@ 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -14217,7 +20166,7 @@ const opDescribeVolumeStatus = "DescribeVolumeStatus"
// DescribeVolumeStatusRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVolumeStatus operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14279,8 +20228,9 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req
// status of the volume is ok. If the check fails, the overall status is impaired.
// If the status is insufficient-data, then the checks may still be taking place
// on your volume at the time. We recommend that you retry the request. For
-// more information on volume status, see Monitoring the Status of Your Volumes
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html).
+// more information about volume status, see Monitoring 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.
//
// Events: Reflect the cause of a volume status and may require you to take
// action. For example, if your volume returns an impaired status, then the
@@ -14337,7 +20287,7 @@ func (c *EC2) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVo
// // Example iterating over at most 3 pages of a DescribeVolumeStatus operation.
// pageNum := 0
// err := client.DescribeVolumeStatusPages(params,
-// func(page *DescribeVolumeStatusOutput, lastPage bool) bool {
+// func(page *ec2.DescribeVolumeStatusOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -14381,7 +20331,7 @@ const opDescribeVolumes = "DescribeVolumes"
// DescribeVolumesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVolumes operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14426,7 +20376,7 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.
// DescribeVolumes API operation for Amazon Elastic Compute Cloud.
//
-// Describes the specified EBS volumes.
+// Describes the specified EBS volumes or all of your EBS volumes.
//
// If you are describing a long list of volumes, you can paginate the output
// to make the list more manageable. The MaxResults parameter sets the maximum
@@ -14435,7 +20385,7 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.
// a NextToken value that can be passed to a subsequent DescribeVolumes request
// to retrieve the remaining results.
//
-// For more information about EBS volumes, see Amazon EBS Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -14477,7 +20427,7 @@ func (c *EC2) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumes
// // Example iterating over at most 3 pages of a DescribeVolumes operation.
// pageNum := 0
// err := client.DescribeVolumesPages(params,
-// func(page *DescribeVolumesOutput, lastPage bool) bool {
+// func(page *ec2.DescribeVolumesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -14521,7 +20471,7 @@ const opDescribeVolumesModifications = "DescribeVolumesModifications"
// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVolumesModifications operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14547,6 +20497,12 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica
Name: opDescribeVolumesModifications,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -14571,8 +20527,9 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica
//
// 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 (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
-// For more information, see Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
+// CloudWatch Events User Guide (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
+// For more information, see Monitoring Volume Modifications" (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods)
+// in the Amazon Elastic Compute Cloud 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
@@ -14602,12 +20559,62 @@ func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *De
return out, req.Send()
}
+// DescribeVolumesModificationsPages iterates over the pages of a DescribeVolumesModifications operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVolumesModifications 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 DescribeVolumesModifications operation.
+// pageNum := 0
+// err := client.DescribeVolumesModificationsPages(params,
+// func(page *ec2.DescribeVolumesModificationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVolumesModificationsPages(input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool) error {
+ return c.DescribeVolumesModificationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVolumesModificationsPagesWithContext same as DescribeVolumesModificationsPages 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) DescribeVolumesModificationsPagesWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVolumesModificationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVolumesModificationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVolumesModificationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcAttribute = "DescribeVpcAttribute"
// DescribeVpcAttributeRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14682,7 +20689,7 @@ const opDescribeVpcClassicLink = "DescribeVpcClassicLink"
// DescribeVpcClassicLinkRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcClassicLink operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14756,7 +20763,7 @@ const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport"
// DescribeVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcClassicLinkDnsSupport operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14782,6 +20789,12 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL
Name: opDescribeVpcClassicLinkDnsSupport,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -14800,7 +20813,7 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL
// IP address when addressed from an instance in the VPC to which it's linked.
// Similarly, the DNS hostname of an instance in a VPC resolves to its private
// IP address when addressed from a linked EC2-Classic instance. For more information,
-// see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
+// see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -14831,12 +20844,62 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input
return out, req.Send()
}
+// DescribeVpcClassicLinkDnsSupportPages iterates over the pages of a DescribeVpcClassicLinkDnsSupport operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcClassicLinkDnsSupport 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 DescribeVpcClassicLinkDnsSupport operation.
+// pageNum := 0
+// err := client.DescribeVpcClassicLinkDnsSupportPages(params,
+// func(page *ec2.DescribeVpcClassicLinkDnsSupportOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcClassicLinkDnsSupportPages(input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error {
+ return c.DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcClassicLinkDnsSupportPagesWithContext same as DescribeVpcClassicLinkDnsSupportPages 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) DescribeVpcClassicLinkDnsSupportPagesWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcClassicLinkDnsSupportInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcClassicLinkDnsSupportRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcClassicLinkDnsSupportOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications"
// DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpointConnectionNotifications operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14862,6 +20925,12 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeV
Name: opDescribeVpcEndpointConnectionNotifications,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -14906,12 +20975,62 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Cont
return out, req.Send()
}
+// DescribeVpcEndpointConnectionNotificationsPages iterates over the pages of a DescribeVpcEndpointConnectionNotifications operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcEndpointConnectionNotifications 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 DescribeVpcEndpointConnectionNotifications operation.
+// pageNum := 0
+// err := client.DescribeVpcEndpointConnectionNotificationsPages(params,
+// func(page *ec2.DescribeVpcEndpointConnectionNotificationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcEndpointConnectionNotificationsPages(input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error {
+ return c.DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcEndpointConnectionNotificationsPagesWithContext same as DescribeVpcEndpointConnectionNotificationsPages 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) DescribeVpcEndpointConnectionNotificationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcEndpointConnectionNotificationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcEndpointConnectionNotificationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcEndpointConnectionNotificationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections"
// DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpointConnections operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -14937,6 +21056,12 @@ func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointCo
Name: opDescribeVpcEndpointConnections,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -14981,12 +21106,62 @@ func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input *
return out, req.Send()
}
+// DescribeVpcEndpointConnectionsPages iterates over the pages of a DescribeVpcEndpointConnections operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcEndpointConnections 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 DescribeVpcEndpointConnections operation.
+// pageNum := 0
+// err := client.DescribeVpcEndpointConnectionsPages(params,
+// func(page *ec2.DescribeVpcEndpointConnectionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcEndpointConnectionsPages(input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool) error {
+ return c.DescribeVpcEndpointConnectionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcEndpointConnectionsPagesWithContext same as DescribeVpcEndpointConnectionsPages 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) DescribeVpcEndpointConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcEndpointConnectionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcEndpointConnectionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcEndpointConnectionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations"
// DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpointServiceConfigurations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15012,6 +21187,12 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpc
Name: opDescribeVpcEndpointServiceConfigurations,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -15055,12 +21236,62 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Contex
return out, req.Send()
}
+// DescribeVpcEndpointServiceConfigurationsPages iterates over the pages of a DescribeVpcEndpointServiceConfigurations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcEndpointServiceConfigurations 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 DescribeVpcEndpointServiceConfigurations operation.
+// pageNum := 0
+// err := client.DescribeVpcEndpointServiceConfigurationsPages(params,
+// func(page *ec2.DescribeVpcEndpointServiceConfigurationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcEndpointServiceConfigurationsPages(input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error {
+ return c.DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcEndpointServiceConfigurationsPagesWithContext same as DescribeVpcEndpointServiceConfigurationsPages 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) DescribeVpcEndpointServiceConfigurationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcEndpointServiceConfigurationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcEndpointServiceConfigurationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcEndpointServiceConfigurationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions"
// DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpointServicePermissions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15086,6 +21317,12 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEnd
Name: opDescribeVpcEndpointServicePermissions,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -15130,12 +21367,62 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context,
return out, req.Send()
}
+// DescribeVpcEndpointServicePermissionsPages iterates over the pages of a DescribeVpcEndpointServicePermissions operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcEndpointServicePermissions 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 DescribeVpcEndpointServicePermissions operation.
+// pageNum := 0
+// err := client.DescribeVpcEndpointServicePermissionsPages(params,
+// func(page *ec2.DescribeVpcEndpointServicePermissionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcEndpointServicePermissionsPages(input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool) error {
+ return c.DescribeVpcEndpointServicePermissionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcEndpointServicePermissionsPagesWithContext same as DescribeVpcEndpointServicePermissionsPages 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) DescribeVpcEndpointServicePermissionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcEndpointServicePermissionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcEndpointServicePermissionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcEndpointServicePermissionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices"
// DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpointServices operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15209,7 +21496,7 @@ const opDescribeVpcEndpoints = "DescribeVpcEndpoints"
// DescribeVpcEndpointsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcEndpoints operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15235,6 +21522,12 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req
Name: opDescribeVpcEndpoints,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -15278,12 +21571,62 @@ func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVp
return out, req.Send()
}
+// DescribeVpcEndpointsPages iterates over the pages of a DescribeVpcEndpoints operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcEndpoints 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 DescribeVpcEndpoints operation.
+// pageNum := 0
+// err := client.DescribeVpcEndpointsPages(params,
+// func(page *ec2.DescribeVpcEndpointsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcEndpointsPages(input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool) error {
+ return c.DescribeVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcEndpointsPagesWithContext same as DescribeVpcEndpointsPages 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) DescribeVpcEndpointsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcEndpointsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcEndpointsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcEndpointsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections"
// DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcPeeringConnections operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15309,6 +21652,12 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn
Name: opDescribeVpcPeeringConnections,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -15352,12 +21701,62 @@ func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *D
return out, req.Send()
}
+// DescribeVpcPeeringConnectionsPages iterates over the pages of a DescribeVpcPeeringConnections operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcPeeringConnections 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 DescribeVpcPeeringConnections operation.
+// pageNum := 0
+// err := client.DescribeVpcPeeringConnectionsPages(params,
+// func(page *ec2.DescribeVpcPeeringConnectionsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcPeeringConnectionsPages(input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool) error {
+ return c.DescribeVpcPeeringConnectionsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcPeeringConnectionsPagesWithContext same as DescribeVpcPeeringConnectionsPages 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) DescribeVpcPeeringConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcPeeringConnectionsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcPeeringConnectionsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpcs = "DescribeVpcs"
// DescribeVpcsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpcs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15383,6 +21782,12 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques
Name: opDescribeVpcs,
HTTPMethod: "POST",
HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
}
if input == nil {
@@ -15426,12 +21831,62 @@ func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput,
return out, req.Send()
}
+// DescribeVpcsPages iterates over the pages of a DescribeVpcs operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See DescribeVpcs 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 DescribeVpcs operation.
+// pageNum := 0
+// err := client.DescribeVpcsPages(params,
+// func(page *ec2.DescribeVpcsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) DescribeVpcsPages(input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool) error {
+ return c.DescribeVpcsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// DescribeVpcsPagesWithContext same as DescribeVpcsPages 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) DescribeVpcsPagesWithContext(ctx aws.Context, input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *DescribeVpcsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.DescribeVpcsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*DescribeVpcsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
const opDescribeVpnConnections = "DescribeVpnConnections"
// DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpnConnections operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15472,9 +21927,8 @@ func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput)
//
// Describes one or more of your VPN connections.
//
-// For more information about VPN connections, see AWS Managed VPN Connections
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html) in the
-// Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -15509,7 +21963,7 @@ const opDescribeVpnGateways = "DescribeVpnGateways"
// DescribeVpnGatewaysRequest generates a "aws/request.Request" representing the
// client's request for the DescribeVpnGateways operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15550,9 +22004,8 @@ func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *
//
// Describes one or more of your virtual private gateways.
//
-// For more information about virtual private gateways, see AWS Managed VPN
-// Connections (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html)
+// in the AWS Site-to-Site VPN 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
@@ -15587,7 +22040,7 @@ const opDetachClassicLinkVpc = "DetachClassicLinkVpc"
// DetachClassicLinkVpcRequest generates a "aws/request.Request" representing the
// client's request for the DetachClassicLinkVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15663,7 +22116,7 @@ const opDetachInternetGateway = "DetachInternetGateway"
// DetachInternetGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DetachInternetGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15697,15 +22150,14 @@ func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (r
output = &DetachInternetGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DetachInternetGateway API operation for Amazon Elastic Compute Cloud.
//
-// Detaches an Internet gateway from a VPC, disabling connectivity between the
-// Internet and the VPC. The VPC must not contain any running instances with
+// Detaches an internet gateway from a VPC, disabling connectivity between the
+// internet and the VPC. The VPC must not contain any running instances with
// Elastic IP addresses or public IPv4 addresses.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -15741,7 +22193,7 @@ const opDetachNetworkInterface = "DetachNetworkInterface"
// DetachNetworkInterfaceRequest generates a "aws/request.Request" representing the
// client's request for the DetachNetworkInterface operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15775,8 +22227,7 @@ func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput)
output = &DetachNetworkInterfaceOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -15817,7 +22268,7 @@ const opDetachVolume = "DetachVolume"
// DetachVolumeRequest generates a "aws/request.Request" representing the
// client's request for the DetachVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15868,7 +22319,7 @@ func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Reques
// When a volume with an AWS Marketplace product code is detached from an instance,
// the product code is no longer associated with the instance.
//
-// For more information, see Detaching an Amazon EBS Volume (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html)
+// For more information, see Detaching an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -15904,7 +22355,7 @@ const opDetachVpnGateway = "DetachVpnGateway"
// DetachVpnGatewayRequest generates a "aws/request.Request" representing the
// client's request for the DetachVpnGateway operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -15938,8 +22389,7 @@ func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *reques
output = &DetachVpnGatewayOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -15982,12 +22432,170 @@ func (c *EC2) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatew
return out, req.Send()
}
+const opDisableEbsEncryptionByDefault = "DisableEbsEncryptionByDefault"
+
+// DisableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the
+// client's request for the DisableEbsEncryptionByDefault 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 DisableEbsEncryptionByDefault for more information on using the DisableEbsEncryptionByDefault
+// 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 DisableEbsEncryptionByDefaultRequest method.
+// req, resp := client.DisableEbsEncryptionByDefaultRequest(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/DisableEbsEncryptionByDefault
+func (c *EC2) DisableEbsEncryptionByDefaultRequest(input *DisableEbsEncryptionByDefaultInput) (req *request.Request, output *DisableEbsEncryptionByDefaultOutput) {
+ op := &request.Operation{
+ Name: opDisableEbsEncryptionByDefault,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DisableEbsEncryptionByDefaultInput{}
+ }
+
+ output = &DisableEbsEncryptionByDefaultOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DisableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud.
+//
+// Disables EBS encryption by default for your account in the current Region.
+//
+// After you disable encryption by default, you can still create encrypted volumes
+// by enabling encryption when you create each volume.
+//
+// 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.
+//
+// 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 DisableEbsEncryptionByDefault for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableEbsEncryptionByDefault
+func (c *EC2) DisableEbsEncryptionByDefault(input *DisableEbsEncryptionByDefaultInput) (*DisableEbsEncryptionByDefaultOutput, error) {
+ req, out := c.DisableEbsEncryptionByDefaultRequest(input)
+ return out, req.Send()
+}
+
+// DisableEbsEncryptionByDefaultWithContext is the same as DisableEbsEncryptionByDefault with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DisableEbsEncryptionByDefault 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) DisableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *DisableEbsEncryptionByDefaultInput, opts ...request.Option) (*DisableEbsEncryptionByDefaultOutput, error) {
+ req, out := c.DisableEbsEncryptionByDefaultRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDisableTransitGatewayRouteTablePropagation = "DisableTransitGatewayRouteTablePropagation"
+
+// DisableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the
+// client's request for the DisableTransitGatewayRouteTablePropagation 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 DisableTransitGatewayRouteTablePropagation for more information on using the DisableTransitGatewayRouteTablePropagation
+// 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 DisableTransitGatewayRouteTablePropagationRequest method.
+// req, resp := client.DisableTransitGatewayRouteTablePropagationRequest(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/DisableTransitGatewayRouteTablePropagation
+func (c *EC2) DisableTransitGatewayRouteTablePropagationRequest(input *DisableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *DisableTransitGatewayRouteTablePropagationOutput) {
+ op := &request.Operation{
+ Name: opDisableTransitGatewayRouteTablePropagation,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DisableTransitGatewayRouteTablePropagationInput{}
+ }
+
+ output = &DisableTransitGatewayRouteTablePropagationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DisableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud.
+//
+// Disables the specified resource attachment from propagating routes to the
+// specified propagation 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DisableTransitGatewayRouteTablePropagation for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableTransitGatewayRouteTablePropagation
+func (c *EC2) DisableTransitGatewayRouteTablePropagation(input *DisableTransitGatewayRouteTablePropagationInput) (*DisableTransitGatewayRouteTablePropagationOutput, error) {
+ req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input)
+ return out, req.Send()
+}
+
+// DisableTransitGatewayRouteTablePropagationWithContext is the same as DisableTransitGatewayRouteTablePropagation with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DisableTransitGatewayRouteTablePropagation 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) DisableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *DisableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*DisableTransitGatewayRouteTablePropagationOutput, error) {
+ req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation"
// DisableVgwRoutePropagationRequest generates a "aws/request.Request" representing the
// client's request for the DisableVgwRoutePropagation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16021,8 +22629,7 @@ func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagatio
output = &DisableVgwRoutePropagationOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -16064,7 +22671,7 @@ const opDisableVpcClassicLink = "DisableVpcClassicLink"
// DisableVpcClassicLinkRequest generates a "aws/request.Request" representing the
// client's request for the DisableVpcClassicLink operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16139,7 +22746,7 @@ const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport"
// DisableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the
// client's request for the DisableVpcClassicLinkDnsSupport operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16180,8 +22787,8 @@ func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLin
//
// Disables ClassicLink DNS support for a VPC. If disabled, DNS hostnames resolve
// to public IP addresses when addressed between a linked EC2-Classic instance
-// and instances in the VPC to which it's linked. For more information about
-// ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
+// and instances in the VPC to which it's linked. For more information, see
+// ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -16217,7 +22824,7 @@ const opDisassociateAddress = "DisassociateAddress"
// DisassociateAddressRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateAddress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16251,8 +22858,7 @@ func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *
output = &DisassociateAddressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -16262,7 +22868,7 @@ func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *
// it's associated with.
//
// An Elastic IP address is for use in either the EC2-Classic platform or in
-// a VPC. For more information, see Elastic IP Addresses (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+// a VPC. 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.
//
// This is an idempotent operation. If you perform the operation more than once,
@@ -16296,12 +22902,96 @@ func (c *EC2) DisassociateAddressWithContext(ctx aws.Context, input *Disassociat
return out, req.Send()
}
+const opDisassociateClientVpnTargetNetwork = "DisassociateClientVpnTargetNetwork"
+
+// DisassociateClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the
+// client's request for the DisassociateClientVpnTargetNetwork 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 DisassociateClientVpnTargetNetwork for more information on using the DisassociateClientVpnTargetNetwork
+// 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 DisassociateClientVpnTargetNetworkRequest method.
+// req, resp := client.DisassociateClientVpnTargetNetworkRequest(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/DisassociateClientVpnTargetNetwork
+func (c *EC2) DisassociateClientVpnTargetNetworkRequest(input *DisassociateClientVpnTargetNetworkInput) (req *request.Request, output *DisassociateClientVpnTargetNetworkOutput) {
+ op := &request.Operation{
+ Name: opDisassociateClientVpnTargetNetwork,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DisassociateClientVpnTargetNetworkInput{}
+ }
+
+ output = &DisassociateClientVpnTargetNetworkOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DisassociateClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud.
+//
+// Disassociates a target network from the specified Client VPN endpoint. When
+// you disassociate the last target network from a Client VPN, the following
+// happens:
+//
+// * The route that was automatically added for the VPC is deleted
+//
+// * All active client connections are terminated
+//
+// * New client connections are disallowed
+//
+// * The Client VPN endpoint's status changes to pending-associate
+//
+// 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 DisassociateClientVpnTargetNetwork for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateClientVpnTargetNetwork
+func (c *EC2) DisassociateClientVpnTargetNetwork(input *DisassociateClientVpnTargetNetworkInput) (*DisassociateClientVpnTargetNetworkOutput, error) {
+ req, out := c.DisassociateClientVpnTargetNetworkRequest(input)
+ return out, req.Send()
+}
+
+// DisassociateClientVpnTargetNetworkWithContext is the same as DisassociateClientVpnTargetNetwork with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DisassociateClientVpnTargetNetwork 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) DisassociateClientVpnTargetNetworkWithContext(ctx aws.Context, input *DisassociateClientVpnTargetNetworkInput, opts ...request.Option) (*DisassociateClientVpnTargetNetworkOutput, error) {
+ req, out := c.DisassociateClientVpnTargetNetworkRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile"
// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateIamInstanceProfile operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16377,7 +23067,7 @@ const opDisassociateRouteTable = "DisassociateRouteTable"
// DisassociateRouteTableRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateRouteTable operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16411,8 +23101,7 @@ func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput)
output = &DisassociateRouteTableOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -16422,7 +23111,7 @@ func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput)
//
// After you perform this action, the subnet no longer uses the routes in the
// route table. Instead, it uses the routes in the VPC's main route table. For
-// more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// more information about route tables, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -16458,7 +23147,7 @@ const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock"
// DisassociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateSubnetCidrBlock operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16529,12 +23218,86 @@ func (c *EC2) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *Dis
return out, req.Send()
}
+const opDisassociateTransitGatewayRouteTable = "DisassociateTransitGatewayRouteTable"
+
+// DisassociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the
+// client's request for the DisassociateTransitGatewayRouteTable 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 DisassociateTransitGatewayRouteTable for more information on using the DisassociateTransitGatewayRouteTable
+// 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 DisassociateTransitGatewayRouteTableRequest method.
+// req, resp := client.DisassociateTransitGatewayRouteTableRequest(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/DisassociateTransitGatewayRouteTable
+func (c *EC2) DisassociateTransitGatewayRouteTableRequest(input *DisassociateTransitGatewayRouteTableInput) (req *request.Request, output *DisassociateTransitGatewayRouteTableOutput) {
+ op := &request.Operation{
+ Name: opDisassociateTransitGatewayRouteTable,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DisassociateTransitGatewayRouteTableInput{}
+ }
+
+ output = &DisassociateTransitGatewayRouteTableOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DisassociateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud.
+//
+// Disassociates a resource attachment from a 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation DisassociateTransitGatewayRouteTable for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayRouteTable
+func (c *EC2) DisassociateTransitGatewayRouteTable(input *DisassociateTransitGatewayRouteTableInput) (*DisassociateTransitGatewayRouteTableOutput, error) {
+ req, out := c.DisassociateTransitGatewayRouteTableRequest(input)
+ return out, req.Send()
+}
+
+// DisassociateTransitGatewayRouteTableWithContext is the same as DisassociateTransitGatewayRouteTable with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DisassociateTransitGatewayRouteTable 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) DisassociateTransitGatewayRouteTableWithContext(ctx aws.Context, input *DisassociateTransitGatewayRouteTableInput, opts ...request.Option) (*DisassociateTransitGatewayRouteTableOutput, error) {
+ req, out := c.DisassociateTransitGatewayRouteTableRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock"
// DisassociateVpcCidrBlockRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateVpcCidrBlock operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16609,12 +23372,177 @@ func (c *EC2) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *Disass
return out, req.Send()
}
+const opEnableEbsEncryptionByDefault = "EnableEbsEncryptionByDefault"
+
+// EnableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the
+// client's request for the EnableEbsEncryptionByDefault 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 EnableEbsEncryptionByDefault for more information on using the EnableEbsEncryptionByDefault
+// 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 EnableEbsEncryptionByDefaultRequest method.
+// req, resp := client.EnableEbsEncryptionByDefaultRequest(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/EnableEbsEncryptionByDefault
+func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDefaultInput) (req *request.Request, output *EnableEbsEncryptionByDefaultOutput) {
+ op := &request.Operation{
+ Name: opEnableEbsEncryptionByDefault,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &EnableEbsEncryptionByDefaultInput{}
+ }
+
+ output = &EnableEbsEncryptionByDefaultOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// EnableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud.
+//
+// Enables EBS encryption by default for your account in the current Region.
+//
+// After you enable encryption by default, the EBS volumes that you create are
+// are always encrypted, either using the default CMK or the CMK 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.
+//
+// You can specify the default CMK for encryption by default using ModifyEbsDefaultKmsKeyId
+// or ResetEbsDefaultKmsKeyId.
+//
+// Enabling encryption by default has no effect on the encryption status of
+// your existing volumes.
+//
+// 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).
+//
+// 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 EnableEbsEncryptionByDefault for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableEbsEncryptionByDefault
+func (c *EC2) EnableEbsEncryptionByDefault(input *EnableEbsEncryptionByDefaultInput) (*EnableEbsEncryptionByDefaultOutput, error) {
+ req, out := c.EnableEbsEncryptionByDefaultRequest(input)
+ return out, req.Send()
+}
+
+// EnableEbsEncryptionByDefaultWithContext is the same as EnableEbsEncryptionByDefault with the addition of
+// the ability to pass a context and additional request options.
+//
+// See EnableEbsEncryptionByDefault 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) EnableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *EnableEbsEncryptionByDefaultInput, opts ...request.Option) (*EnableEbsEncryptionByDefaultOutput, error) {
+ req, out := c.EnableEbsEncryptionByDefaultRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opEnableTransitGatewayRouteTablePropagation = "EnableTransitGatewayRouteTablePropagation"
+
+// EnableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the
+// client's request for the EnableTransitGatewayRouteTablePropagation 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 EnableTransitGatewayRouteTablePropagation for more information on using the EnableTransitGatewayRouteTablePropagation
+// 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 EnableTransitGatewayRouteTablePropagationRequest method.
+// req, resp := client.EnableTransitGatewayRouteTablePropagationRequest(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/EnableTransitGatewayRouteTablePropagation
+func (c *EC2) EnableTransitGatewayRouteTablePropagationRequest(input *EnableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *EnableTransitGatewayRouteTablePropagationOutput) {
+ op := &request.Operation{
+ Name: opEnableTransitGatewayRouteTablePropagation,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &EnableTransitGatewayRouteTablePropagationInput{}
+ }
+
+ output = &EnableTransitGatewayRouteTablePropagationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// EnableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud.
+//
+// Enables the specified attachment to propagate routes to the specified propagation
+// 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation EnableTransitGatewayRouteTablePropagation for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableTransitGatewayRouteTablePropagation
+func (c *EC2) EnableTransitGatewayRouteTablePropagation(input *EnableTransitGatewayRouteTablePropagationInput) (*EnableTransitGatewayRouteTablePropagationOutput, error) {
+ req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input)
+ return out, req.Send()
+}
+
+// EnableTransitGatewayRouteTablePropagationWithContext is the same as EnableTransitGatewayRouteTablePropagation with the addition of
+// the ability to pass a context and additional request options.
+//
+// See EnableTransitGatewayRouteTablePropagation 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) EnableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *EnableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*EnableTransitGatewayRouteTablePropagationOutput, error) {
+ req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation"
// EnableVgwRoutePropagationRequest generates a "aws/request.Request" representing the
// client's request for the EnableVgwRoutePropagation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16648,8 +23576,7 @@ func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationI
output = &EnableVgwRoutePropagationOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -16691,7 +23618,7 @@ const opEnableVolumeIO = "EnableVolumeIO"
// EnableVolumeIORequest generates a "aws/request.Request" representing the
// client's request for the EnableVolumeIO operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16725,8 +23652,7 @@ func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Re
output = &EnableVolumeIOOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -16768,7 +23694,7 @@ const opEnableVpcClassicLink = "EnableVpcClassicLink"
// EnableVpcClassicLinkRequest generates a "aws/request.Request" representing the
// client's request for the EnableVpcClassicLink operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16809,10 +23735,10 @@ func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req
//
// Enables a VPC for ClassicLink. You can then link EC2-Classic instances to
// your ClassicLink-enabled VPC to allow communication over private IP addresses.
-// You cannot enable your VPC for ClassicLink if any of your VPC's route tables
+// You cannot enable your VPC for ClassicLink if any of your VPC route tables
// have existing routes for address ranges within the 10.0.0.0/8 IP address
// range, excluding local routes for VPCs in the 10.0.0.0/16 and 10.1.0.0/16
-// IP address ranges. For more information, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
+// IP address ranges. For more information, see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -16848,7 +23774,7 @@ const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport"
// EnableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the
// client's request for the EnableVpcClassicLinkDnsSupport operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16891,8 +23817,8 @@ func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkD
// the DNS hostname of a linked EC2-Classic instance resolves to its private
// IP address when addressed from an instance in the VPC to which it's linked.
// Similarly, the DNS hostname of an instance in a VPC resolves to its private
-// IP address when addressed from a linked EC2-Classic instance. For more information
-// about ClassicLink, see ClassicLink (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
+// IP address when addressed from a linked EC2-Classic instance. For more information,
+// see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -16923,12 +23849,312 @@ func (c *EC2) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *
return out, req.Send()
}
+const opExportClientVpnClientCertificateRevocationList = "ExportClientVpnClientCertificateRevocationList"
+
+// ExportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the
+// client's request for the ExportClientVpnClientCertificateRevocationList 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 ExportClientVpnClientCertificateRevocationList for more information on using the ExportClientVpnClientCertificateRevocationList
+// 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 ExportClientVpnClientCertificateRevocationListRequest method.
+// req, resp := client.ExportClientVpnClientCertificateRevocationListRequest(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/ExportClientVpnClientCertificateRevocationList
+func (c *EC2) ExportClientVpnClientCertificateRevocationListRequest(input *ExportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ExportClientVpnClientCertificateRevocationListOutput) {
+ op := &request.Operation{
+ Name: opExportClientVpnClientCertificateRevocationList,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ExportClientVpnClientCertificateRevocationListInput{}
+ }
+
+ output = &ExportClientVpnClientCertificateRevocationListOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ExportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud.
+//
+// Downloads the client certificate revocation list for the specified Client
+// VPN endpoint.
+//
+// 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 ExportClientVpnClientCertificateRevocationList for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientCertificateRevocationList
+func (c *EC2) ExportClientVpnClientCertificateRevocationList(input *ExportClientVpnClientCertificateRevocationListInput) (*ExportClientVpnClientCertificateRevocationListOutput, error) {
+ req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input)
+ return out, req.Send()
+}
+
+// ExportClientVpnClientCertificateRevocationListWithContext is the same as ExportClientVpnClientCertificateRevocationList with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ExportClientVpnClientCertificateRevocationList 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) ExportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ExportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ExportClientVpnClientCertificateRevocationListOutput, error) {
+ req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opExportClientVpnClientConfiguration = "ExportClientVpnClientConfiguration"
+
+// ExportClientVpnClientConfigurationRequest generates a "aws/request.Request" representing the
+// client's request for the ExportClientVpnClientConfiguration 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 ExportClientVpnClientConfiguration for more information on using the ExportClientVpnClientConfiguration
+// 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 ExportClientVpnClientConfigurationRequest method.
+// req, resp := client.ExportClientVpnClientConfigurationRequest(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/ExportClientVpnClientConfiguration
+func (c *EC2) ExportClientVpnClientConfigurationRequest(input *ExportClientVpnClientConfigurationInput) (req *request.Request, output *ExportClientVpnClientConfigurationOutput) {
+ op := &request.Operation{
+ Name: opExportClientVpnClientConfiguration,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ExportClientVpnClientConfigurationInput{}
+ }
+
+ output = &ExportClientVpnClientConfigurationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ExportClientVpnClientConfiguration API operation for Amazon Elastic Compute Cloud.
+//
+// Downloads the contents of the Client VPN endpoint configuration file for
+// the specified Client VPN endpoint. The Client VPN endpoint configuration
+// file includes the Client VPN endpoint and certificate information clients
+// need to establish a connection with the Client VPN endpoint.
+//
+// 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 ExportClientVpnClientConfiguration for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientConfiguration
+func (c *EC2) ExportClientVpnClientConfiguration(input *ExportClientVpnClientConfigurationInput) (*ExportClientVpnClientConfigurationOutput, error) {
+ req, out := c.ExportClientVpnClientConfigurationRequest(input)
+ return out, req.Send()
+}
+
+// ExportClientVpnClientConfigurationWithContext is the same as ExportClientVpnClientConfiguration with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ExportClientVpnClientConfiguration 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) ExportClientVpnClientConfigurationWithContext(ctx aws.Context, input *ExportClientVpnClientConfigurationInput, opts ...request.Option) (*ExportClientVpnClientConfigurationOutput, error) {
+ req, out := c.ExportClientVpnClientConfigurationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opExportTransitGatewayRoutes = "ExportTransitGatewayRoutes"
+
+// ExportTransitGatewayRoutesRequest generates a "aws/request.Request" representing the
+// client's request for the ExportTransitGatewayRoutes 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 ExportTransitGatewayRoutes for more information on using the ExportTransitGatewayRoutes
+// 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 ExportTransitGatewayRoutesRequest method.
+// req, resp := client.ExportTransitGatewayRoutesRequest(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/ExportTransitGatewayRoutes
+func (c *EC2) ExportTransitGatewayRoutesRequest(input *ExportTransitGatewayRoutesInput) (req *request.Request, output *ExportTransitGatewayRoutesOutput) {
+ op := &request.Operation{
+ Name: opExportTransitGatewayRoutes,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ExportTransitGatewayRoutesInput{}
+ }
+
+ output = &ExportTransitGatewayRoutesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ExportTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud.
+//
+// Exports routes from the specified transit gateway route table to the specified
+// S3 bucket. By default, all routes are exported. Alternatively, you can filter
+// by CIDR range.
+//
+// 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 ExportTransitGatewayRoutes for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTransitGatewayRoutes
+func (c *EC2) ExportTransitGatewayRoutes(input *ExportTransitGatewayRoutesInput) (*ExportTransitGatewayRoutesOutput, error) {
+ req, out := c.ExportTransitGatewayRoutesRequest(input)
+ return out, req.Send()
+}
+
+// ExportTransitGatewayRoutesWithContext is the same as ExportTransitGatewayRoutes with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ExportTransitGatewayRoutes 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) ExportTransitGatewayRoutesWithContext(ctx aws.Context, input *ExportTransitGatewayRoutesInput, opts ...request.Option) (*ExportTransitGatewayRoutesOutput, error) {
+ req, out := c.ExportTransitGatewayRoutesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetCapacityReservationUsage = "GetCapacityReservationUsage"
+
+// GetCapacityReservationUsageRequest generates a "aws/request.Request" representing the
+// client's request for the GetCapacityReservationUsage 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 GetCapacityReservationUsage for more information on using the GetCapacityReservationUsage
+// 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 GetCapacityReservationUsageRequest method.
+// req, resp := client.GetCapacityReservationUsageRequest(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/GetCapacityReservationUsage
+func (c *EC2) GetCapacityReservationUsageRequest(input *GetCapacityReservationUsageInput) (req *request.Request, output *GetCapacityReservationUsageOutput) {
+ op := &request.Operation{
+ Name: opGetCapacityReservationUsage,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetCapacityReservationUsageInput{}
+ }
+
+ output = &GetCapacityReservationUsageOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetCapacityReservationUsage API operation for Amazon Elastic Compute Cloud.
+//
+// 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 GetCapacityReservationUsage for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCapacityReservationUsage
+func (c *EC2) GetCapacityReservationUsage(input *GetCapacityReservationUsageInput) (*GetCapacityReservationUsageOutput, error) {
+ req, out := c.GetCapacityReservationUsageRequest(input)
+ return out, req.Send()
+}
+
+// GetCapacityReservationUsageWithContext is the same as GetCapacityReservationUsage with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetCapacityReservationUsage 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) GetCapacityReservationUsageWithContext(ctx aws.Context, input *GetCapacityReservationUsageInput, opts ...request.Option) (*GetCapacityReservationUsageOutput, error) {
+ req, out := c.GetCapacityReservationUsageRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetConsoleOutput = "GetConsoleOutput"
// GetConsoleOutputRequest generates a "aws/request.Request" representing the
// client's request for the GetConsoleOutput operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -16970,20 +24196,20 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *reques
// Gets the console output for the specified instance. For Linux instances,
// the instance console output displays the exact console output that would
// normally be displayed on a physical monitor attached to a computer. For Windows
-// instances, the instance console output includes output from the EC2Config
-// service.
-//
-// GetConsoleOutput returns up to 64 KB of console output shortly after it's
-// generated by the instance.
+// 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.
+// 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 only supported on C5, M5, and
-// i3.metal instances.
+// 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 Elastic Compute Cloud 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
@@ -17018,7 +24244,7 @@ const opGetConsoleScreenshot = "GetConsoleScreenshot"
// GetConsoleScreenshotRequest generates a "aws/request.Request" representing the
// client's request for the GetConsoleScreenshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17089,12 +24315,169 @@ func (c *EC2) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsole
return out, req.Send()
}
+const opGetEbsDefaultKmsKeyId = "GetEbsDefaultKmsKeyId"
+
+// GetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the
+// client's request for the GetEbsDefaultKmsKeyId 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 GetEbsDefaultKmsKeyId for more information on using the GetEbsDefaultKmsKeyId
+// 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 GetEbsDefaultKmsKeyIdRequest method.
+// req, resp := client.GetEbsDefaultKmsKeyIdRequest(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/GetEbsDefaultKmsKeyId
+func (c *EC2) GetEbsDefaultKmsKeyIdRequest(input *GetEbsDefaultKmsKeyIdInput) (req *request.Request, output *GetEbsDefaultKmsKeyIdOutput) {
+ op := &request.Operation{
+ Name: opGetEbsDefaultKmsKeyId,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetEbsDefaultKmsKeyIdInput{}
+ }
+
+ output = &GetEbsDefaultKmsKeyIdOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud.
+//
+// Describes the default customer master key (CMK) for EBS encryption by default
+// for your account in this Region. You can change the default CMK 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.
+//
+// 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 GetEbsDefaultKmsKeyId for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsDefaultKmsKeyId
+func (c *EC2) GetEbsDefaultKmsKeyId(input *GetEbsDefaultKmsKeyIdInput) (*GetEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.GetEbsDefaultKmsKeyIdRequest(input)
+ return out, req.Send()
+}
+
+// GetEbsDefaultKmsKeyIdWithContext is the same as GetEbsDefaultKmsKeyId with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetEbsDefaultKmsKeyId 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) GetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *GetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*GetEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.GetEbsDefaultKmsKeyIdRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetEbsEncryptionByDefault = "GetEbsEncryptionByDefault"
+
+// GetEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the
+// client's request for the GetEbsEncryptionByDefault 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 GetEbsEncryptionByDefault for more information on using the GetEbsEncryptionByDefault
+// 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 GetEbsEncryptionByDefaultRequest method.
+// req, resp := client.GetEbsEncryptionByDefaultRequest(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/GetEbsEncryptionByDefault
+func (c *EC2) GetEbsEncryptionByDefaultRequest(input *GetEbsEncryptionByDefaultInput) (req *request.Request, output *GetEbsEncryptionByDefaultOutput) {
+ op := &request.Operation{
+ Name: opGetEbsEncryptionByDefault,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetEbsEncryptionByDefaultInput{}
+ }
+
+ output = &GetEbsEncryptionByDefaultOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud.
+//
+// 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.
+//
+// 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 GetEbsEncryptionByDefault for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsEncryptionByDefault
+func (c *EC2) GetEbsEncryptionByDefault(input *GetEbsEncryptionByDefaultInput) (*GetEbsEncryptionByDefaultOutput, error) {
+ req, out := c.GetEbsEncryptionByDefaultRequest(input)
+ return out, req.Send()
+}
+
+// GetEbsEncryptionByDefaultWithContext is the same as GetEbsEncryptionByDefault with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetEbsEncryptionByDefault 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) GetEbsEncryptionByDefaultWithContext(ctx aws.Context, input *GetEbsEncryptionByDefaultInput, opts ...request.Option) (*GetEbsEncryptionByDefaultOutput, error) {
+ req, out := c.GetEbsEncryptionByDefaultRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview"
// GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the
// client's request for the GetHostReservationPurchasePreview operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17173,7 +24556,7 @@ const opGetLaunchTemplateData = "GetLaunchTemplateData"
// GetLaunchTemplateDataRequest generates a "aws/request.Request" representing the
// client's request for the GetLaunchTemplateData operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17248,7 +24631,7 @@ const opGetPasswordData = "GetPasswordData"
// GetPasswordDataRequest generates a "aws/request.Request" representing the
// client's request for the GetPasswordData operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17291,8 +24674,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 (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html)
-// and EC2Launch (http://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/WindowsGuide/UsingConfig_WinAMI.html)
+// and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// For the EC2Config service, the password is not generated for rebundled AMIs
@@ -17339,7 +24722,7 @@ const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote"
// GetReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the
// client's request for the GetReservedInstancesExchangeQuote operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17411,12 +24794,483 @@ func (c *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, inpu
return out, req.Send()
}
+const opGetTransitGatewayAttachmentPropagations = "GetTransitGatewayAttachmentPropagations"
+
+// GetTransitGatewayAttachmentPropagationsRequest generates a "aws/request.Request" representing the
+// client's request for the GetTransitGatewayAttachmentPropagations 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 GetTransitGatewayAttachmentPropagations for more information on using the GetTransitGatewayAttachmentPropagations
+// 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 GetTransitGatewayAttachmentPropagationsRequest method.
+// req, resp := client.GetTransitGatewayAttachmentPropagationsRequest(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/GetTransitGatewayAttachmentPropagations
+func (c *EC2) GetTransitGatewayAttachmentPropagationsRequest(input *GetTransitGatewayAttachmentPropagationsInput) (req *request.Request, output *GetTransitGatewayAttachmentPropagationsOutput) {
+ op := &request.Operation{
+ Name: opGetTransitGatewayAttachmentPropagations,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &GetTransitGatewayAttachmentPropagationsInput{}
+ }
+
+ output = &GetTransitGatewayAttachmentPropagationsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetTransitGatewayAttachmentPropagations API operation for Amazon Elastic Compute Cloud.
+//
+// Lists the route tables to which the specified resource attachment propagates
+// routes.
+//
+// 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 GetTransitGatewayAttachmentPropagations for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayAttachmentPropagations
+func (c *EC2) GetTransitGatewayAttachmentPropagations(input *GetTransitGatewayAttachmentPropagationsInput) (*GetTransitGatewayAttachmentPropagationsOutput, error) {
+ req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input)
+ return out, req.Send()
+}
+
+// GetTransitGatewayAttachmentPropagationsWithContext is the same as GetTransitGatewayAttachmentPropagations with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetTransitGatewayAttachmentPropagations 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) GetTransitGatewayAttachmentPropagationsWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, opts ...request.Option) (*GetTransitGatewayAttachmentPropagationsOutput, error) {
+ req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// GetTransitGatewayAttachmentPropagationsPages iterates over the pages of a GetTransitGatewayAttachmentPropagations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See GetTransitGatewayAttachmentPropagations 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 GetTransitGatewayAttachmentPropagations operation.
+// pageNum := 0
+// err := client.GetTransitGatewayAttachmentPropagationsPages(params,
+// func(page *ec2.GetTransitGatewayAttachmentPropagationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) GetTransitGatewayAttachmentPropagationsPages(input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error {
+ return c.GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// GetTransitGatewayAttachmentPropagationsPagesWithContext same as GetTransitGatewayAttachmentPropagationsPages 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) GetTransitGatewayAttachmentPropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *GetTransitGatewayAttachmentPropagationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.GetTransitGatewayAttachmentPropagationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*GetTransitGatewayAttachmentPropagationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations"
+
+// GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the
+// client's request for the GetTransitGatewayRouteTableAssociations 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 GetTransitGatewayRouteTableAssociations for more information on using the GetTransitGatewayRouteTableAssociations
+// 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 GetTransitGatewayRouteTableAssociationsRequest method.
+// req, resp := client.GetTransitGatewayRouteTableAssociationsRequest(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/GetTransitGatewayRouteTableAssociations
+func (c *EC2) GetTransitGatewayRouteTableAssociationsRequest(input *GetTransitGatewayRouteTableAssociationsInput) (req *request.Request, output *GetTransitGatewayRouteTableAssociationsOutput) {
+ op := &request.Operation{
+ Name: opGetTransitGatewayRouteTableAssociations,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &GetTransitGatewayRouteTableAssociationsInput{}
+ }
+
+ output = &GetTransitGatewayRouteTableAssociationsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetTransitGatewayRouteTableAssociations API operation for Amazon Elastic Compute Cloud.
+//
+// Gets information about the associations for the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation GetTransitGatewayRouteTableAssociations for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTableAssociations
+func (c *EC2) GetTransitGatewayRouteTableAssociations(input *GetTransitGatewayRouteTableAssociationsInput) (*GetTransitGatewayRouteTableAssociationsOutput, error) {
+ req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input)
+ return out, req.Send()
+}
+
+// GetTransitGatewayRouteTableAssociationsWithContext is the same as GetTransitGatewayRouteTableAssociations with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetTransitGatewayRouteTableAssociations 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) GetTransitGatewayRouteTableAssociationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, opts ...request.Option) (*GetTransitGatewayRouteTableAssociationsOutput, error) {
+ req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// GetTransitGatewayRouteTableAssociationsPages iterates over the pages of a GetTransitGatewayRouteTableAssociations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See GetTransitGatewayRouteTableAssociations 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 GetTransitGatewayRouteTableAssociations operation.
+// pageNum := 0
+// err := client.GetTransitGatewayRouteTableAssociationsPages(params,
+// func(page *ec2.GetTransitGatewayRouteTableAssociationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) GetTransitGatewayRouteTableAssociationsPages(input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error {
+ return c.GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// GetTransitGatewayRouteTableAssociationsPagesWithContext same as GetTransitGatewayRouteTableAssociationsPages 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) GetTransitGatewayRouteTableAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *GetTransitGatewayRouteTableAssociationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.GetTransitGatewayRouteTableAssociationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*GetTransitGatewayRouteTableAssociationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opGetTransitGatewayRouteTablePropagations = "GetTransitGatewayRouteTablePropagations"
+
+// GetTransitGatewayRouteTablePropagationsRequest generates a "aws/request.Request" representing the
+// client's request for the GetTransitGatewayRouteTablePropagations 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 GetTransitGatewayRouteTablePropagations for more information on using the GetTransitGatewayRouteTablePropagations
+// 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 GetTransitGatewayRouteTablePropagationsRequest method.
+// req, resp := client.GetTransitGatewayRouteTablePropagationsRequest(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/GetTransitGatewayRouteTablePropagations
+func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGatewayRouteTablePropagationsInput) (req *request.Request, output *GetTransitGatewayRouteTablePropagationsOutput) {
+ op := &request.Operation{
+ Name: opGetTransitGatewayRouteTablePropagations,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ Paginator: &request.Paginator{
+ InputTokens: []string{"NextToken"},
+ OutputTokens: []string{"NextToken"},
+ LimitToken: "MaxResults",
+ TruncationToken: "",
+ },
+ }
+
+ if input == nil {
+ input = &GetTransitGatewayRouteTablePropagationsInput{}
+ }
+
+ output = &GetTransitGatewayRouteTablePropagationsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetTransitGatewayRouteTablePropagations API operation for Amazon Elastic Compute Cloud.
+//
+// Gets information about the route table propagations for the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation GetTransitGatewayRouteTablePropagations for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTablePropagations
+func (c *EC2) GetTransitGatewayRouteTablePropagations(input *GetTransitGatewayRouteTablePropagationsInput) (*GetTransitGatewayRouteTablePropagationsOutput, error) {
+ req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input)
+ return out, req.Send()
+}
+
+// GetTransitGatewayRouteTablePropagationsWithContext is the same as GetTransitGatewayRouteTablePropagations with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetTransitGatewayRouteTablePropagations 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) GetTransitGatewayRouteTablePropagationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, opts ...request.Option) (*GetTransitGatewayRouteTablePropagationsOutput, error) {
+ req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+// GetTransitGatewayRouteTablePropagationsPages iterates over the pages of a GetTransitGatewayRouteTablePropagations operation,
+// calling the "fn" function with the response data for each page. To stop
+// iterating, return false from the fn function.
+//
+// See GetTransitGatewayRouteTablePropagations 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 GetTransitGatewayRouteTablePropagations operation.
+// pageNum := 0
+// err := client.GetTransitGatewayRouteTablePropagationsPages(params,
+// func(page *ec2.GetTransitGatewayRouteTablePropagationsOutput, lastPage bool) bool {
+// pageNum++
+// fmt.Println(page)
+// return pageNum <= 3
+// })
+//
+func (c *EC2) GetTransitGatewayRouteTablePropagationsPages(input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error {
+ return c.GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.BackgroundContext(), input, fn)
+}
+
+// GetTransitGatewayRouteTablePropagationsPagesWithContext same as GetTransitGatewayRouteTablePropagationsPages 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) GetTransitGatewayRouteTablePropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool, opts ...request.Option) error {
+ p := request.Pagination{
+ NewRequest: func() (*request.Request, error) {
+ var inCpy *GetTransitGatewayRouteTablePropagationsInput
+ if input != nil {
+ tmp := *input
+ inCpy = &tmp
+ }
+ req, _ := c.GetTransitGatewayRouteTablePropagationsRequest(inCpy)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return req, nil
+ },
+ }
+
+ cont := true
+ for p.Next() && cont {
+ cont = fn(p.Page().(*GetTransitGatewayRouteTablePropagationsOutput), !p.HasNextPage())
+ }
+ return p.Err()
+}
+
+const opImportClientVpnClientCertificateRevocationList = "ImportClientVpnClientCertificateRevocationList"
+
+// ImportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the
+// client's request for the ImportClientVpnClientCertificateRevocationList 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 ImportClientVpnClientCertificateRevocationList for more information on using the ImportClientVpnClientCertificateRevocationList
+// 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 ImportClientVpnClientCertificateRevocationListRequest method.
+// req, resp := client.ImportClientVpnClientCertificateRevocationListRequest(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/ImportClientVpnClientCertificateRevocationList
+func (c *EC2) ImportClientVpnClientCertificateRevocationListRequest(input *ImportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ImportClientVpnClientCertificateRevocationListOutput) {
+ op := &request.Operation{
+ Name: opImportClientVpnClientCertificateRevocationList,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ImportClientVpnClientCertificateRevocationListInput{}
+ }
+
+ output = &ImportClientVpnClientCertificateRevocationListOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ImportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud.
+//
+// Uploads a client certificate revocation list to the specified Client VPN
+// endpoint. Uploading a client certificate revocation list overwrites the existing
+// client certificate revocation list.
+//
+// Uploading a client certificate revocation list resets existing client connections.
+//
+// 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 ImportClientVpnClientCertificateRevocationList for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportClientVpnClientCertificateRevocationList
+func (c *EC2) ImportClientVpnClientCertificateRevocationList(input *ImportClientVpnClientCertificateRevocationListInput) (*ImportClientVpnClientCertificateRevocationListOutput, error) {
+ req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input)
+ return out, req.Send()
+}
+
+// ImportClientVpnClientCertificateRevocationListWithContext is the same as ImportClientVpnClientCertificateRevocationList with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ImportClientVpnClientCertificateRevocationList 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) ImportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ImportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ImportClientVpnClientCertificateRevocationListOutput, error) {
+ req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opImportImage = "ImportImage"
// ImportImageRequest generates a "aws/request.Request" representing the
// client's request for the ImportImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17457,7 +25311,7 @@ func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request,
//
// Import single or multi-volume disk images or EBS snapshots into an Amazon
// Machine Image (AMI). For more information, see Importing a VM as an Image
-// Using VM Import/Export (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html)
+// Using VM Import/Export (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html)
// in the VM Import/Export User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -17493,7 +25347,7 @@ const opImportInstance = "ImportInstance"
// ImportInstanceRequest generates a "aws/request.Request" representing the
// client's request for the ImportInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17535,10 +25389,10 @@ func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Re
// Creates an import instance task using metadata from the specified disk image.
// ImportInstance only supports single-volume VMs. To import multi-volume VMs,
// use ImportImage. For more information, see Importing a Virtual Machine Using
-// the Amazon EC2 CLI (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html).
+// the Amazon EC2 CLI (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html).
//
// For information about the import manifest referenced by this API action,
-// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
+// see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.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
@@ -17573,7 +25427,7 @@ const opImportKeyPair = "ImportKeyPair"
// ImportKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the ImportKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17618,7 +25472,7 @@ func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Requ
// you create the key pair and give AWS just the public key. The private key
// is never transferred between you and AWS.
//
-// For more information about key pairs, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
+// For more information about key pairs, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -17654,7 +25508,7 @@ const opImportSnapshot = "ImportSnapshot"
// ImportSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the ImportSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17728,7 +25582,7 @@ const opImportVolume = "ImportVolume"
// ImportVolumeRequest generates a "aws/request.Request" representing the
// client's request for the ImportVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17768,10 +25622,10 @@ func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Reques
// ImportVolume API operation for Amazon Elastic Compute Cloud.
//
// Creates an import volume task using metadata from the specified disk image.For
-// more information, see Importing Disks to Amazon EBS (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html).
+// more information, see Importing Disks to Amazon EBS (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html).
//
// For information about the import manifest referenced by this API action,
-// see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
+// see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.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
@@ -17801,12 +25655,254 @@ func (c *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput,
return out, req.Send()
}
+const opModifyCapacityReservation = "ModifyCapacityReservation"
+
+// ModifyCapacityReservationRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyCapacityReservation 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 ModifyCapacityReservation for more information on using the ModifyCapacityReservation
+// 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 ModifyCapacityReservationRequest method.
+// req, resp := client.ModifyCapacityReservationRequest(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/ModifyCapacityReservation
+func (c *EC2) ModifyCapacityReservationRequest(input *ModifyCapacityReservationInput) (req *request.Request, output *ModifyCapacityReservationOutput) {
+ op := &request.Operation{
+ Name: opModifyCapacityReservation,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyCapacityReservationInput{}
+ }
+
+ output = &ModifyCapacityReservationOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyCapacityReservation API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies a Capacity Reservation's capacity and the conditions under which
+// it is to be released. You cannot change a Capacity Reservation's instance
+// type, EBS optimization, instance store settings, platform, Availability Zone,
+// or instance eligibility. If you need to modify any of these attributes, we
+// recommend that you cancel the Capacity Reservation, and then create a new
+// one with the required attributes.
+//
+// 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 ModifyCapacityReservation for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyCapacityReservation
+func (c *EC2) ModifyCapacityReservation(input *ModifyCapacityReservationInput) (*ModifyCapacityReservationOutput, error) {
+ req, out := c.ModifyCapacityReservationRequest(input)
+ return out, req.Send()
+}
+
+// ModifyCapacityReservationWithContext is the same as ModifyCapacityReservation with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyCapacityReservation 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) ModifyCapacityReservationWithContext(ctx aws.Context, input *ModifyCapacityReservationInput, opts ...request.Option) (*ModifyCapacityReservationOutput, error) {
+ req, out := c.ModifyCapacityReservationRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opModifyClientVpnEndpoint = "ModifyClientVpnEndpoint"
+
+// ModifyClientVpnEndpointRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyClientVpnEndpoint 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 ModifyClientVpnEndpoint for more information on using the ModifyClientVpnEndpoint
+// 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 ModifyClientVpnEndpointRequest method.
+// req, resp := client.ModifyClientVpnEndpointRequest(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/ModifyClientVpnEndpoint
+func (c *EC2) ModifyClientVpnEndpointRequest(input *ModifyClientVpnEndpointInput) (req *request.Request, output *ModifyClientVpnEndpointOutput) {
+ op := &request.Operation{
+ Name: opModifyClientVpnEndpoint,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyClientVpnEndpointInput{}
+ }
+
+ output = &ModifyClientVpnEndpointOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyClientVpnEndpoint API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the specified Client VPN endpoint. You can only modify an endpoint's
+// server certificate information, client connection logging information, DNS
+// server, and description. Modifying the DNS server resets existing client
+// connections.
+//
+// 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 ModifyClientVpnEndpoint for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyClientVpnEndpoint
+func (c *EC2) ModifyClientVpnEndpoint(input *ModifyClientVpnEndpointInput) (*ModifyClientVpnEndpointOutput, error) {
+ req, out := c.ModifyClientVpnEndpointRequest(input)
+ return out, req.Send()
+}
+
+// ModifyClientVpnEndpointWithContext is the same as ModifyClientVpnEndpoint with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyClientVpnEndpoint 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) ModifyClientVpnEndpointWithContext(ctx aws.Context, input *ModifyClientVpnEndpointInput, opts ...request.Option) (*ModifyClientVpnEndpointOutput, error) {
+ req, out := c.ModifyClientVpnEndpointRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opModifyEbsDefaultKmsKeyId = "ModifyEbsDefaultKmsKeyId"
+
+// ModifyEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyEbsDefaultKmsKeyId 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 ModifyEbsDefaultKmsKeyId for more information on using the ModifyEbsDefaultKmsKeyId
+// 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 ModifyEbsDefaultKmsKeyIdRequest method.
+// req, resp := client.ModifyEbsDefaultKmsKeyIdRequest(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/ModifyEbsDefaultKmsKeyId
+func (c *EC2) ModifyEbsDefaultKmsKeyIdRequest(input *ModifyEbsDefaultKmsKeyIdInput) (req *request.Request, output *ModifyEbsDefaultKmsKeyIdOutput) {
+ op := &request.Operation{
+ Name: opModifyEbsDefaultKmsKeyId,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyEbsDefaultKmsKeyIdInput{}
+ }
+
+ output = &ModifyEbsDefaultKmsKeyIdOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud.
+//
+// Changes the default customer master key (CMK) for EBS encryption by default
+// for your account in this Region.
+//
+// AWS creates a unique AWS managed CMK in each Region for use with encryption
+// by default. If you change the default CMK to a customer managed CMK, it is
+// used instead of the AWS managed CMK. To reset the default CMK to the AWS
+// managed CMK for EBS, use ResetEbsDefaultKmsKeyId.
+//
+// If you delete or disable the customer managed CMK 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.
+//
+// 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 ModifyEbsDefaultKmsKeyId for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyEbsDefaultKmsKeyId
+func (c *EC2) ModifyEbsDefaultKmsKeyId(input *ModifyEbsDefaultKmsKeyIdInput) (*ModifyEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input)
+ return out, req.Send()
+}
+
+// ModifyEbsDefaultKmsKeyIdWithContext is the same as ModifyEbsDefaultKmsKeyId with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyEbsDefaultKmsKeyId 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) ModifyEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ModifyEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ModifyEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opModifyFleet = "ModifyFleet"
// ModifyFleetRequest generates a "aws/request.Request" representing the
// client's request for the ModifyFleet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17882,7 +25978,7 @@ const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute"
// ModifyFpgaImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyFpgaImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17956,7 +26052,7 @@ const opModifyHosts = "ModifyHosts"
// ModifyHostsRequest generates a "aws/request.Request" representing the
// client's request for the ModifyHosts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -17996,12 +26092,12 @@ func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request,
// ModifyHosts API operation for Amazon Elastic Compute Cloud.
//
// Modify the auto-placement setting of a Dedicated Host. When auto-placement
-// is enabled, AWS will place instances that you launch with a tenancy of host,
-// but without targeting a specific host ID, onto any available Dedicated Host
-// in your account which has auto-placement enabled. When auto-placement is
-// disabled, you need to provide a host ID if you want the instance to launch
-// onto a specific host. If no host ID is provided, the instance will be launched
-// onto a suitable host which has auto-placement enabled.
+// is enabled, any instances that you launch with a tenancy of host but without
+// a specific host ID are placed onto any available Dedicated Host in your account
+// that has auto-placement enabled. When auto-placement is disabled, you need
+// to provide a host ID to have the instance launch onto a specific host. If
+// no host ID is provided, the instance is launched onto a suitable host with
+// auto-placement enabled.
//
// 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
@@ -18036,7 +26132,7 @@ const opModifyIdFormat = "ModifyIdFormat"
// ModifyIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the ModifyIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18070,14 +26166,13 @@ func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Re
output = &ModifyIdFormatOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// ModifyIdFormat API operation for Amazon Elastic Compute Cloud.
//
-// Modifies the ID format for the specified resource on a per-region basis.
+// Modifies the ID format for the specified resource on a per-Region basis.
// You can specify that resources should receive longer IDs (17-character IDs)
// when they are created.
//
@@ -18094,7 +26189,7 @@ func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Re
// to the entire AWS account. By default, an IAM user defaults to the same settings
// as the root user. If you're using this action as the root user, then these
// settings apply to the entire account, unless an IAM user explicitly overrides
-// these settings for themselves. For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
+// these settings for themselves. For more information, see Resource IDs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Resources created with longer IDs are visible to all IAM roles and users,
@@ -18134,7 +26229,7 @@ const opModifyIdentityIdFormat = "ModifyIdentityIdFormat"
// ModifyIdentityIdFormatRequest generates a "aws/request.Request" representing the
// client's request for the ModifyIdentityIdFormat operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18168,8 +26263,7 @@ func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput)
output = &ModifyIdentityIdFormatOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -18189,7 +26283,7 @@ func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput)
// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association
// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway.
//
-// For more information, see Resource IDs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
+// For more information, see Resource IDs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// This setting applies to the principal specified in the request; it does not
@@ -18232,7 +26326,7 @@ const opModifyImageAttribute = "ModifyImageAttribute"
// ModifyImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18266,8 +26360,7 @@ func (c *EC2) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req
output = &ModifyImageAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -18317,7 +26410,7 @@ const opModifyInstanceAttribute = "ModifyInstanceAttribute"
// ModifyInstanceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyInstanceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18351,8 +26444,7 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput
output = &ModifyInstanceAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -18368,7 +26460,7 @@ func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput
// we recommend that you use the ModifyNetworkInterfaceAttribute action.
//
// To modify some attributes, the instance must be stopped. For more information,
-// see Modifying Attributes of a Stopped Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html)
+// see Modifying Attributes of a Stopped Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -18399,12 +26491,89 @@ func (c *EC2) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyI
return out, req.Send()
}
+const opModifyInstanceCapacityReservationAttributes = "ModifyInstanceCapacityReservationAttributes"
+
+// ModifyInstanceCapacityReservationAttributesRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyInstanceCapacityReservationAttributes 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 ModifyInstanceCapacityReservationAttributes for more information on using the ModifyInstanceCapacityReservationAttributes
+// 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 ModifyInstanceCapacityReservationAttributesRequest method.
+// req, resp := client.ModifyInstanceCapacityReservationAttributesRequest(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/ModifyInstanceCapacityReservationAttributes
+func (c *EC2) ModifyInstanceCapacityReservationAttributesRequest(input *ModifyInstanceCapacityReservationAttributesInput) (req *request.Request, output *ModifyInstanceCapacityReservationAttributesOutput) {
+ op := &request.Operation{
+ Name: opModifyInstanceCapacityReservationAttributes,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyInstanceCapacityReservationAttributesInput{}
+ }
+
+ output = &ModifyInstanceCapacityReservationAttributesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyInstanceCapacityReservationAttributes API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the Capacity Reservation settings for a stopped instance. Use this
+// action to configure an instance to target a specific Capacity Reservation,
+// run in any open Capacity Reservation with matching attributes, or run On-Demand
+// Instance capacity.
+//
+// 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 ModifyInstanceCapacityReservationAttributes for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCapacityReservationAttributes
+func (c *EC2) ModifyInstanceCapacityReservationAttributes(input *ModifyInstanceCapacityReservationAttributesInput) (*ModifyInstanceCapacityReservationAttributesOutput, error) {
+ req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input)
+ return out, req.Send()
+}
+
+// ModifyInstanceCapacityReservationAttributesWithContext is the same as ModifyInstanceCapacityReservationAttributes with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyInstanceCapacityReservationAttributes 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) ModifyInstanceCapacityReservationAttributesWithContext(ctx aws.Context, input *ModifyInstanceCapacityReservationAttributesInput, opts ...request.Option) (*ModifyInstanceCapacityReservationAttributesOutput, error) {
+ req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification"
// ModifyInstanceCreditSpecificationRequest generates a "aws/request.Request" representing the
// client's request for the ModifyInstanceCreditSpecification operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18443,10 +26612,10 @@ func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCred
// ModifyInstanceCreditSpecification API operation for Amazon Elastic Compute Cloud.
//
-// Modifies the credit option for CPU usage on a running or stopped T2 instance.
-// The credit options are standard and unlimited.
+// Modifies the credit option for CPU usage on a running or stopped T2 or T3
+// instance. The credit options are standard and unlimited.
//
-// For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html)
+// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -18477,12 +26646,86 @@ func (c *EC2) ModifyInstanceCreditSpecificationWithContext(ctx aws.Context, inpu
return out, req.Send()
}
+const opModifyInstanceEventStartTime = "ModifyInstanceEventStartTime"
+
+// ModifyInstanceEventStartTimeRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyInstanceEventStartTime 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 ModifyInstanceEventStartTime for more information on using the ModifyInstanceEventStartTime
+// 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 ModifyInstanceEventStartTimeRequest method.
+// req, resp := client.ModifyInstanceEventStartTimeRequest(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/ModifyInstanceEventStartTime
+func (c *EC2) ModifyInstanceEventStartTimeRequest(input *ModifyInstanceEventStartTimeInput) (req *request.Request, output *ModifyInstanceEventStartTimeOutput) {
+ op := &request.Operation{
+ Name: opModifyInstanceEventStartTime,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyInstanceEventStartTimeInput{}
+ }
+
+ output = &ModifyInstanceEventStartTimeOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyInstanceEventStartTime API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the start time for a scheduled Amazon EC2 instance event.
+//
+// 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 ModifyInstanceEventStartTime for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime
+func (c *EC2) ModifyInstanceEventStartTime(input *ModifyInstanceEventStartTimeInput) (*ModifyInstanceEventStartTimeOutput, error) {
+ req, out := c.ModifyInstanceEventStartTimeRequest(input)
+ return out, req.Send()
+}
+
+// ModifyInstanceEventStartTimeWithContext is the same as ModifyInstanceEventStartTime with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyInstanceEventStartTime 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) ModifyInstanceEventStartTimeWithContext(ctx aws.Context, input *ModifyInstanceEventStartTimeInput, opts ...request.Option) (*ModifyInstanceEventStartTimeOutput, error) {
+ req, out := c.ModifyInstanceEventStartTimeRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opModifyInstancePlacement = "ModifyInstancePlacement"
// ModifyInstancePlacementRequest generates a "aws/request.Request" representing the
// client's request for the ModifyInstancePlacement operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18524,7 +26767,7 @@ func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput
// Modifies the placement attributes for a specified instance. You can do the
// following:
//
-// * Modify the affinity between an instance and a Dedicated Host (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html).
+// * 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
// automatically associated with the host on which it lands. If the instance
@@ -18535,14 +26778,14 @@ func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput
// * Change the instance tenancy of an instance from host to dedicated, or
// from dedicated to host.
//
-// * Move an instance to or from a placement group (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html).
+// * Move an instance to or from a placement group (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html).
//
// At least one attribute for affinity, host ID, tenancy, or placement group
// name must be specified in the request. Affinity and tenancy can be modified
// in the same request.
//
-// To modify the host ID, tenancy, or placement group for an instance, the instance
-// must be in the stopped state.
+// To modify the host ID, tenancy, placement group, or partition for an instance,
+// the instance must be in the stopped state.
//
// 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
@@ -18577,7 +26820,7 @@ const opModifyLaunchTemplate = "ModifyLaunchTemplate"
// ModifyLaunchTemplateRequest generates a "aws/request.Request" representing the
// client's request for the ModifyLaunchTemplate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18653,7 +26896,7 @@ const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute"
// ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyNetworkInterfaceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18687,15 +26930,15 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa
output = &ModifyNetworkInterfaceAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud.
//
// Modifies the specified network interface attribute. You can specify only
-// one attribute at a time.
+// one attribute at a time. You can use this action to attach and detach security
+// groups from an existing EC2 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
@@ -18730,7 +26973,7 @@ const opModifyReservedInstances = "ModifyReservedInstances"
// ModifyReservedInstancesRequest generates a "aws/request.Request" representing the
// client's request for the ModifyReservedInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18774,7 +27017,7 @@ func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput
// Instances to be modified must be identical, except for Availability Zone,
// network platform, and instance type.
//
-// For more information, see Modifying Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
+// For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -18810,7 +27053,7 @@ const opModifySnapshotAttribute = "ModifySnapshotAttribute"
// ModifySnapshotAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifySnapshotAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18844,8 +27087,7 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput
output = &ModifySnapshotAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -18853,16 +27095,15 @@ func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput
//
// Adds or removes permission settings for the specified snapshot. You may add
// or remove specified AWS account IDs from a snapshot's list of create volume
-// permissions, but you cannot do both in a single API call. If you need to
-// both add and remove account IDs for a snapshot, you must use multiple API
-// calls.
+// permissions, but you cannot do both in a single operation. If you need to
+// both add and remove account IDs for a snapshot, you must use multiple operations.
//
// Encrypted snapshots and snapshots with AWS Marketplace product codes cannot
// be made public. Snapshots encrypted with your default CMK cannot be shared
// with other accounts.
//
-// For more information on modifying snapshot permissions, see Sharing Snapshots
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
+// For more information about modifying snapshot permissions, see Sharing Snapshots
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -18898,7 +27139,7 @@ const opModifySpotFleetRequest = "ModifySpotFleetRequest"
// ModifySpotFleetRequestRequest generates a "aws/request.Request" representing the
// client's request for the ModifySpotFleetRequest operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -18939,6 +27180,8 @@ func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput)
//
// Modifies the specified Spot Fleet request.
//
+// You can only modify a Spot Fleet request of type maintain.
+//
// While the Spot Fleet request is being modified, it is in the modifying state.
//
// To scale up your Spot Fleet, increase its target capacity. The Spot Fleet
@@ -18994,7 +27237,7 @@ const opModifySubnetAttribute = "ModifySubnetAttribute"
// ModifySubnetAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifySubnetAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19028,8 +27271,7 @@ func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (r
output = &ModifySubnetAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -19065,12 +27307,321 @@ func (c *EC2) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySub
return out, req.Send()
}
+const opModifyTrafficMirrorFilterNetworkServices = "ModifyTrafficMirrorFilterNetworkServices"
+
+// ModifyTrafficMirrorFilterNetworkServicesRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyTrafficMirrorFilterNetworkServices 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 ModifyTrafficMirrorFilterNetworkServices for more information on using the ModifyTrafficMirrorFilterNetworkServices
+// 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 ModifyTrafficMirrorFilterNetworkServicesRequest method.
+// req, resp := client.ModifyTrafficMirrorFilterNetworkServicesRequest(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/ModifyTrafficMirrorFilterNetworkServices
+func (c *EC2) ModifyTrafficMirrorFilterNetworkServicesRequest(input *ModifyTrafficMirrorFilterNetworkServicesInput) (req *request.Request, output *ModifyTrafficMirrorFilterNetworkServicesOutput) {
+ op := &request.Operation{
+ Name: opModifyTrafficMirrorFilterNetworkServices,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyTrafficMirrorFilterNetworkServicesInput{}
+ }
+
+ output = &ModifyTrafficMirrorFilterNetworkServicesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyTrafficMirrorFilterNetworkServices API operation for Amazon Elastic Compute Cloud.
+//
+// Allows or restricts mirroring network services.
+//
+// By default, Amazon DNS network services are not eligible for Traffic Mirror.
+// Use AddNetworkServices to add network services to a Traffic Mirror filter.
+// When a network service is added to the Traffic Mirror filter, all traffic
+// related to that network service will be mirrored. When you no longer want
+// to mirror network services, use RemoveNetworkServices to remove the network
+// services from the Traffic Mirror filter.
+//
+// FFor information about filter rule properties, see Network Services (https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html#traffic-mirroring-network-services)
+// in the Traffic Mirroring 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 ModifyTrafficMirrorFilterNetworkServices for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterNetworkServices
+func (c *EC2) ModifyTrafficMirrorFilterNetworkServices(input *ModifyTrafficMirrorFilterNetworkServicesInput) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) {
+ req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input)
+ return out, req.Send()
+}
+
+// ModifyTrafficMirrorFilterNetworkServicesWithContext is the same as ModifyTrafficMirrorFilterNetworkServices with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyTrafficMirrorFilterNetworkServices 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) ModifyTrafficMirrorFilterNetworkServicesWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterNetworkServicesInput, opts ...request.Option) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) {
+ req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opModifyTrafficMirrorFilterRule = "ModifyTrafficMirrorFilterRule"
+
+// ModifyTrafficMirrorFilterRuleRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyTrafficMirrorFilterRule 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 ModifyTrafficMirrorFilterRule for more information on using the ModifyTrafficMirrorFilterRule
+// 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 ModifyTrafficMirrorFilterRuleRequest method.
+// req, resp := client.ModifyTrafficMirrorFilterRuleRequest(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/ModifyTrafficMirrorFilterRule
+func (c *EC2) ModifyTrafficMirrorFilterRuleRequest(input *ModifyTrafficMirrorFilterRuleInput) (req *request.Request, output *ModifyTrafficMirrorFilterRuleOutput) {
+ op := &request.Operation{
+ Name: opModifyTrafficMirrorFilterRule,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyTrafficMirrorFilterRuleInput{}
+ }
+
+ output = &ModifyTrafficMirrorFilterRuleOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyTrafficMirrorFilterRule API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the specified Traffic Mirror rule.
+//
+// DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an
+// IPv6 range.
+//
+// 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 ModifyTrafficMirrorFilterRule for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule
+func (c *EC2) ModifyTrafficMirrorFilterRule(input *ModifyTrafficMirrorFilterRuleInput) (*ModifyTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.ModifyTrafficMirrorFilterRuleRequest(input)
+ return out, req.Send()
+}
+
+// ModifyTrafficMirrorFilterRuleWithContext is the same as ModifyTrafficMirrorFilterRule with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyTrafficMirrorFilterRule 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) ModifyTrafficMirrorFilterRuleWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterRuleInput, opts ...request.Option) (*ModifyTrafficMirrorFilterRuleOutput, error) {
+ req, out := c.ModifyTrafficMirrorFilterRuleRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opModifyTrafficMirrorSession = "ModifyTrafficMirrorSession"
+
+// ModifyTrafficMirrorSessionRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyTrafficMirrorSession 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 ModifyTrafficMirrorSession for more information on using the ModifyTrafficMirrorSession
+// 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 ModifyTrafficMirrorSessionRequest method.
+// req, resp := client.ModifyTrafficMirrorSessionRequest(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/ModifyTrafficMirrorSession
+func (c *EC2) ModifyTrafficMirrorSessionRequest(input *ModifyTrafficMirrorSessionInput) (req *request.Request, output *ModifyTrafficMirrorSessionOutput) {
+ op := &request.Operation{
+ Name: opModifyTrafficMirrorSession,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyTrafficMirrorSessionInput{}
+ }
+
+ output = &ModifyTrafficMirrorSessionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyTrafficMirrorSession API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies a Traffic Mirror session.
+//
+// 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 ModifyTrafficMirrorSession for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorSession
+func (c *EC2) ModifyTrafficMirrorSession(input *ModifyTrafficMirrorSessionInput) (*ModifyTrafficMirrorSessionOutput, error) {
+ req, out := c.ModifyTrafficMirrorSessionRequest(input)
+ return out, req.Send()
+}
+
+// ModifyTrafficMirrorSessionWithContext is the same as ModifyTrafficMirrorSession with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyTrafficMirrorSession 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) ModifyTrafficMirrorSessionWithContext(ctx aws.Context, input *ModifyTrafficMirrorSessionInput, opts ...request.Option) (*ModifyTrafficMirrorSessionOutput, error) {
+ req, out := c.ModifyTrafficMirrorSessionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opModifyTransitGatewayVpcAttachment = "ModifyTransitGatewayVpcAttachment"
+
+// ModifyTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyTransitGatewayVpcAttachment 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 ModifyTransitGatewayVpcAttachment for more information on using the ModifyTransitGatewayVpcAttachment
+// 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 ModifyTransitGatewayVpcAttachmentRequest method.
+// req, resp := client.ModifyTransitGatewayVpcAttachmentRequest(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/ModifyTransitGatewayVpcAttachment
+func (c *EC2) ModifyTransitGatewayVpcAttachmentRequest(input *ModifyTransitGatewayVpcAttachmentInput) (req *request.Request, output *ModifyTransitGatewayVpcAttachmentOutput) {
+ op := &request.Operation{
+ Name: opModifyTransitGatewayVpcAttachment,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyTransitGatewayVpcAttachmentInput{}
+ }
+
+ output = &ModifyTransitGatewayVpcAttachmentOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the specified VPC attachment.
+//
+// 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 ModifyTransitGatewayVpcAttachment for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayVpcAttachment
+func (c *EC2) ModifyTransitGatewayVpcAttachment(input *ModifyTransitGatewayVpcAttachmentInput) (*ModifyTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input)
+ return out, req.Send()
+}
+
+// ModifyTransitGatewayVpcAttachmentWithContext is the same as ModifyTransitGatewayVpcAttachment with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyTransitGatewayVpcAttachment 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) ModifyTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *ModifyTransitGatewayVpcAttachmentInput, opts ...request.Option) (*ModifyTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opModifyVolume = "ModifyVolume"
// ModifyVolumeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVolume operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19114,30 +27665,29 @@ func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Reques
// current-generation EC2 instance type, you may be able to apply these changes
// without stopping the instance or detaching the volume from it. For more information
// about modifying an EBS volume running Linux, see Modifying the Size, IOPS,
-// or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
+// or Type of an EBS Volume on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
// For more information about modifying an EBS volume running Windows, see Modifying
-// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
+// the Size, IOPS, or Type of an EBS Volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
//
// 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 information about extending a Linux file system, see Extending a Linux
-// File System (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux).
+// File System (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux).
// For information about extending a Windows file system, see Extending a Windows
-// File System (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows).
+// File System (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows).
//
// 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 (http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/).
-// You can also track the status of a modification using the DescribeVolumesModifications
-// API. For information about tracking status changes using either method, see
-// Monitoring Volume Modifications (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
+// 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 Monitoring
+// Volume Modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods).
//
// With previous-generation instance types, resizing an EBS volume may require
// detaching and reattaching the volume or stopping and restarting the instance.
-// For more information about modifying an EBS volume running Linux, see Modifying
-// the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html).
-// For more information about modifying an EBS volume running Windows, see Modifying
-// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
+// For more information, see Modifying the Size, IOPS, or Type of an EBS Volume
+// on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html)
+// and Modifying the Size, IOPS, or Type of an EBS Volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html).
//
// If you reach the maximum volume modification rate per volume limit, you will
// need to wait at least six hours before applying further modifications to
@@ -19176,7 +27726,7 @@ const opModifyVolumeAttribute = "ModifyVolumeAttribute"
// ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVolumeAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19210,8 +27760,7 @@ func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (r
output = &ModifyVolumeAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -19261,7 +27810,7 @@ const opModifyVpcAttribute = "ModifyVpcAttribute"
// ModifyVpcAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19295,8 +27844,7 @@ func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *re
output = &ModifyVpcAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -19337,7 +27885,7 @@ const opModifyVpcEndpoint = "ModifyVpcEndpoint"
// ModifyVpcEndpointRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcEndpoint operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19378,7 +27926,7 @@ func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *requ
//
// Modifies attributes of a specified VPC endpoint. The attributes that you
// can modify depend on the type of VPC endpoint (interface or gateway). For
-// more information, see VPC Endpoints (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-endpoints.html)
+// more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -19414,7 +27962,7 @@ const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNo
// ModifyVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcEndpointConnectionNotification operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19490,7 +28038,7 @@ const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfigu
// ModifyVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcEndpointServiceConfiguration operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19567,7 +28115,7 @@ const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissio
// ModifyVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcEndpointServicePermissions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19606,10 +28154,15 @@ func (c *EC2) ModifyVpcEndpointServicePermissionsRequest(input *ModifyVpcEndpoin
// ModifyVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud.
//
-// Modifies the permissions for your VPC endpoint service (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/endpoint-service.html).
+// Modifies the permissions for your VPC endpoint service (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html).
// You can add or remove permissions for service consumers (IAM users, IAM roles,
// and AWS accounts) to connect to your endpoint service.
//
+// If you grant permissions to all principals, the service is public. Any users
+// who know the name of a public service can send a request to attach an endpoint.
+// If the service does not require manual approval, attachments are automatically
+// approved.
+//
// 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.
@@ -19643,7 +28196,7 @@ const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions"
// ModifyVpcPeeringConnectionOptionsRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcPeeringConnectionOptions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19695,12 +28248,16 @@ func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringCo
// * Enable/disable the ability to resolve public DNS hostnames to private
// IP addresses when queried from instances in the peer VPC.
//
-// If the peered VPCs are in different accounts, each owner must initiate a
-// separate request to modify the peering connection options, depending on whether
-// their VPC was the requester or accepter for the VPC peering connection. If
-// the peered VPCs are in the same account, you can modify the requester and
-// accepter options in the same request. To confirm which VPC is the accepter
-// and requester for a VPC peering connection, use the DescribeVpcPeeringConnections
+// If the peered VPCs are in the same AWS account, you can enable DNS resolution
+// for queries from the local VPC. This ensures that queries from the local
+// VPC resolve to private IP addresses in the peer VPC. This option is not available
+// if the peered VPCs are in different AWS accounts or different Regions. For
+// peered VPCs in different AWS accounts, each AWS account owner must initiate
+// a separate request to modify the peering connection options. For inter-region
+// peering connections, you must use the Region for the requester VPC to modify
+// the requester VPC peering options and the Region for the accepter VPC to
+// modify the accepter VPC peering options. To verify which VPCs are the accepter
+// and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections
// command.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -19736,7 +28293,7 @@ const opModifyVpcTenancy = "ModifyVpcTenancy"
// ModifyVpcTenancyRequest generates a "aws/request.Request" representing the
// client's request for the ModifyVpcTenancy operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19783,7 +28340,7 @@ func (c *EC2) ModifyVpcTenancyRequest(input *ModifyVpcTenancyInput) (req *reques
// into the VPC have a tenancy of default, unless you specify otherwise during
// launch. The tenancy of any existing instances in the VPC is not affected.
//
-// For more information about Dedicated Instances, see Dedicated Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)
+// For more information, see Dedicated Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -19814,12 +28371,125 @@ func (c *EC2) ModifyVpcTenancyWithContext(ctx aws.Context, input *ModifyVpcTenan
return out, req.Send()
}
+const opModifyVpnConnection = "ModifyVpnConnection"
+
+// ModifyVpnConnectionRequest generates a "aws/request.Request" representing the
+// client's request for the ModifyVpnConnection 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 ModifyVpnConnection for more information on using the ModifyVpnConnection
+// 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 ModifyVpnConnectionRequest method.
+// req, resp := client.ModifyVpnConnectionRequest(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/ModifyVpnConnection
+func (c *EC2) ModifyVpnConnectionRequest(input *ModifyVpnConnectionInput) (req *request.Request, output *ModifyVpnConnectionOutput) {
+ op := &request.Operation{
+ Name: opModifyVpnConnection,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ModifyVpnConnectionInput{}
+ }
+
+ output = &ModifyVpnConnectionOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ModifyVpnConnection API operation for Amazon Elastic Compute Cloud.
+//
+// Modifies the target gateway of a AWS Site-to-Site VPN connection. The following
+// migration options are available:
+//
+// * An existing virtual private gateway to a new virtual private gateway
+//
+// * An existing virtual private gateway to a transit gateway
+//
+// * An existing transit gateway to a new transit gateway
+//
+// * An existing transit gateway to a virtual private gateway
+//
+// Before you perform the migration to the new gateway, you must configure the
+// new gateway. Use CreateVpnGateway to create a virtual private gateway, or
+// CreateTransitGateway to create a transit gateway.
+//
+// This step is required when you migrate from a virtual private gateway with
+// static routes to a transit gateway.
+//
+// You must delete the static routes before you migrate to the new gateway.
+//
+// Keep a copy of the static route before you delete it. You will need to add
+// back these routes to the transit gateway after the VPN connection migration
+// is complete.
+//
+// After you migrate to the new gateway, you might need to modify your VPC route
+// table. Use CreateRoute and DeleteRoute to make the changes described in VPN
+// Gateway Target Modification Required VPC Route Table Updates (https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing)
+// in the AWS Site-to-Site VPN User Guide.
+//
+// When the new gateway is a transit gateway, modify the transit gateway route
+// table to allow traffic between the VPC and the AWS Site-to-Site VPN connection.
+// Use CreateTransitGatewayRoute to add the routes.
+//
+// If you deleted VPN static routes, you must add the static routes to the transit
+// gateway route table.
+//
+// After you perform this operation, the AWS VPN endpoint's IP addresses on
+// the AWS side and the tunnel options remain intact. Your s2slong; connection
+// will be temporarily unavailable for approximately 10 minutes while we provision
+// the new endpoints
+//
+// 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 ModifyVpnConnection for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnection
+func (c *EC2) ModifyVpnConnection(input *ModifyVpnConnectionInput) (*ModifyVpnConnectionOutput, error) {
+ req, out := c.ModifyVpnConnectionRequest(input)
+ return out, req.Send()
+}
+
+// ModifyVpnConnectionWithContext is the same as ModifyVpnConnection with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ModifyVpnConnection 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) ModifyVpnConnectionWithContext(ctx aws.Context, input *ModifyVpnConnectionInput, opts ...request.Option) (*ModifyVpnConnectionOutput, error) {
+ req, out := c.ModifyVpnConnectionRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opMonitorInstances = "MonitorInstances"
// MonitorInstancesRequest generates a "aws/request.Request" representing the
// client's request for the MonitorInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19860,7 +28530,7 @@ func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *reques
//
// Enables detailed monitoring for a running instance. Otherwise, basic monitoring
// is enabled. For more information, see Monitoring Your Instances and Volumes
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html)
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// To disable detailed monitoring, see .
@@ -19898,7 +28568,7 @@ const opMoveAddressToVpc = "MoveAddressToVpc"
// MoveAddressToVpcRequest generates a "aws/request.Request" representing the
// client's request for the MoveAddressToVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -19973,12 +28643,102 @@ func (c *EC2) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToV
return out, req.Send()
}
+const opProvisionByoipCidr = "ProvisionByoipCidr"
+
+// ProvisionByoipCidrRequest generates a "aws/request.Request" representing the
+// client's request for the ProvisionByoipCidr 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 ProvisionByoipCidr for more information on using the ProvisionByoipCidr
+// 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 ProvisionByoipCidrRequest method.
+// req, resp := client.ProvisionByoipCidrRequest(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/ProvisionByoipCidr
+func (c *EC2) ProvisionByoipCidrRequest(input *ProvisionByoipCidrInput) (req *request.Request, output *ProvisionByoipCidrOutput) {
+ op := &request.Operation{
+ Name: opProvisionByoipCidr,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ProvisionByoipCidrInput{}
+ }
+
+ output = &ProvisionByoipCidrOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ProvisionByoipCidr API operation for Amazon Elastic Compute Cloud.
+//
+// Provisions an address range for use with your AWS resources through bring
+// your own IP addresses (BYOIP) and creates a corresponding address pool. After
+// the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr.
+//
+// AWS verifies that you own the address range and are authorized to advertise
+// it. You must ensure that the address range is registered to 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.
+//
+// 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
+// from pending-provision to provisioned. To monitor the status of an address
+// range, use DescribeByoipCidrs. To allocate an Elastic IP address from your
+// address pool, use AllocateAddress with either the specific address from the
+// address pool or the ID of the address pool.
+//
+// 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 ProvisionByoipCidr for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidr
+func (c *EC2) ProvisionByoipCidr(input *ProvisionByoipCidrInput) (*ProvisionByoipCidrOutput, error) {
+ req, out := c.ProvisionByoipCidrRequest(input)
+ return out, req.Send()
+}
+
+// ProvisionByoipCidrWithContext is the same as ProvisionByoipCidr with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ProvisionByoipCidr 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) ProvisionByoipCidrWithContext(ctx aws.Context, input *ProvisionByoipCidrInput, opts ...request.Option) (*ProvisionByoipCidrOutput, error) {
+ req, out := c.ProvisionByoipCidrRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opPurchaseHostReservation = "PurchaseHostReservation"
// PurchaseHostReservationRequest generates a "aws/request.Request" representing the
// client's request for the PurchaseHostReservation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20055,7 +28815,7 @@ const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering"
// PurchaseReservedInstancesOfferingRequest generates a "aws/request.Request" representing the
// client's request for the PurchaseReservedInstancesOffering operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20101,8 +28861,8 @@ func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedIn
// offerings that match your specifications. After you've purchased a Reserved
// Instance, you can check for your new Reserved Instance with DescribeReservedInstances.
//
-// For more information, see Reserved Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html)
-// and Reserved Instance Marketplace (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html)
+// 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)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -20138,7 +28898,7 @@ const opPurchaseScheduledInstances = "PurchaseScheduledInstances"
// PurchaseScheduledInstancesRequest generates a "aws/request.Request" representing the
// client's request for the PurchaseScheduledInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20177,7 +28937,7 @@ func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstance
// PurchaseScheduledInstances API operation for Amazon Elastic Compute Cloud.
//
-// Purchases one or more Scheduled Instances with the specified schedule.
+// Purchases the Scheduled Instances with the specified schedule.
//
// Scheduled Instances enable you to purchase Amazon EC2 compute capacity by
// the hour for a one-year term. Before you can purchase a Scheduled Instance,
@@ -20221,7 +28981,7 @@ const opRebootInstances = "RebootInstances"
// RebootInstancesRequest generates a "aws/request.Request" representing the
// client's request for the RebootInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20255,14 +29015,13 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.
output = &RebootInstancesOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// RebootInstances API operation for Amazon Elastic Compute Cloud.
//
-// Requests a reboot of one or more instances. This operation is asynchronous;
+// Requests a reboot of the specified instances. This operation is asynchronous;
// it only queues a request to reboot the specified instances. The operation
// succeeds if the instances are valid and belong to you. Requests to reboot
// terminated instances are ignored.
@@ -20271,7 +29030,7 @@ func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.
// performs a hard reboot.
//
// For more information about troubleshooting, see Getting Console Output and
-// Rebooting Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html)
+// Rebooting Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -20307,7 +29066,7 @@ const opRegisterImage = "RegisterImage"
// RegisterImageRequest generates a "aws/request.Request" representing the
// client's request for the RegisterImage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20348,7 +29107,7 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ
//
// 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 Creating Your Own AMIs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html)
+// about creating AMIs, see Creating Your Own AMIs (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
@@ -20357,7 +29116,7 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ
// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from
// a snapshot of a root device volume. You specify the snapshot using the block
// device mapping. For more information, see Launching a Linux Instance from
-// a Backup (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html)
+// a Backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// You can't register an image where a secondary (non-root) snapshot has AWS
@@ -20366,10 +29125,13 @@ func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Requ
// Some Linux distributions, such as Red Hat Enterprise Linux (RHEL) and SUSE
// Linux Enterprise Server (SLES), use the EC2 billing product code associated
// with an AMI to verify the subscription status for package updates. Creating
-// an AMI from an EBS snapshot does not maintain this billing code, and subsequent
-// instances launched from such an AMI will not be able to connect to package
-// update infrastructure. To create an AMI that must retain billing codes, see
-// CreateImage.
+// an AMI from an EBS snapshot does not maintain this billing code, and instances
+// launched from such an AMI are not able to connect to package update infrastructure.
+// If you purchase a Reserved Instance offering for one of these Linux distributions
+// and launch instances using an AMI that does not contain the required billing
+// code, your Reserved Instance is not applied to these instances.
+//
+// To create an AMI for operating systems that require a billing code, see CreateImage.
//
// If needed, you can deregister an AMI at any time. Any modifications you make
// to an AMI backed by an instance store volume invalidates its registration.
@@ -20404,12 +29166,90 @@ func (c *EC2) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInpu
return out, req.Send()
}
+const opRejectTransitGatewayVpcAttachment = "RejectTransitGatewayVpcAttachment"
+
+// RejectTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the
+// client's request for the RejectTransitGatewayVpcAttachment 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 RejectTransitGatewayVpcAttachment for more information on using the RejectTransitGatewayVpcAttachment
+// 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 RejectTransitGatewayVpcAttachmentRequest method.
+// req, resp := client.RejectTransitGatewayVpcAttachmentRequest(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/RejectTransitGatewayVpcAttachment
+func (c *EC2) RejectTransitGatewayVpcAttachmentRequest(input *RejectTransitGatewayVpcAttachmentInput) (req *request.Request, output *RejectTransitGatewayVpcAttachmentOutput) {
+ op := &request.Operation{
+ Name: opRejectTransitGatewayVpcAttachment,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &RejectTransitGatewayVpcAttachmentInput{}
+ }
+
+ output = &RejectTransitGatewayVpcAttachmentOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// RejectTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud.
+//
+// Rejects a request to attach a VPC to a transit gateway.
+//
+// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments
+// to view your pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachment
+// to accept a VPC attachment 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation RejectTransitGatewayVpcAttachment for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayVpcAttachment
+func (c *EC2) RejectTransitGatewayVpcAttachment(input *RejectTransitGatewayVpcAttachmentInput) (*RejectTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.RejectTransitGatewayVpcAttachmentRequest(input)
+ return out, req.Send()
+}
+
+// RejectTransitGatewayVpcAttachmentWithContext is the same as RejectTransitGatewayVpcAttachment with the addition of
+// the ability to pass a context and additional request options.
+//
+// See RejectTransitGatewayVpcAttachment 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) RejectTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *RejectTransitGatewayVpcAttachmentInput, opts ...request.Option) (*RejectTransitGatewayVpcAttachmentOutput, error) {
+ req, out := c.RejectTransitGatewayVpcAttachmentRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections"
// RejectVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the
// client's request for the RejectVpcEndpointConnections operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20484,7 +29324,7 @@ const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection"
// RejectVpcPeeringConnectionRequest generates a "aws/request.Request" representing the
// client's request for the RejectVpcPeeringConnection operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20562,7 +29402,7 @@ const opReleaseAddress = "ReleaseAddress"
// ReleaseAddressRequest generates a "aws/request.Request" representing the
// client's request for the ReleaseAddress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20596,8 +29436,7 @@ func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Re
output = &ReleaseAddressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -20655,7 +29494,7 @@ const opReleaseHosts = "ReleaseHosts"
// ReleaseHostsRequest generates a "aws/request.Request" representing the
// client's request for the ReleaseHosts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20697,15 +29536,14 @@ func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Reques
// When you no longer want to use an On-Demand Dedicated Host it can be released.
// On-Demand billing is stopped and the host goes into released state. The host
// ID of Dedicated Hosts that have been released can no longer be specified
-// in another request, e.g., ModifyHosts. You must stop or terminate all instances
-// on a host before it can be released.
+// in another request, for example, to modify the host. You must stop or terminate
+// all instances on a host before it can be released.
//
-// When Dedicated Hosts are released, it make take some time for them to stop
+// When Dedicated Hosts are released, it may take some time for them to stop
// counting toward your limit and you may receive capacity errors when trying
-// to allocate new Dedicated hosts. Try waiting a few minutes, and then try
-// again.
+// to allocate new Dedicated Hosts. Wait a few minutes and then try again.
//
-// Released hosts will still appear in a DescribeHosts response.
+// Released hosts still appear in a DescribeHosts response.
//
// 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
@@ -20740,7 +29578,7 @@ const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssocia
// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the
// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20819,7 +29657,7 @@ const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation"
// ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the
// client's request for the ReplaceNetworkAclAssociation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20860,7 +29698,7 @@ func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssoci
//
// Changes which network ACL a subnet is associated with. By default when you
// create a subnet, it's automatically associated with the default network ACL.
-// For more information about network ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html)
+// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// This is an idempotent operation.
@@ -20898,7 +29736,7 @@ const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry"
// ReplaceNetworkAclEntryRequest generates a "aws/request.Request" representing the
// client's request for the ReplaceNetworkAclEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -20932,16 +29770,15 @@ func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput)
output = &ReplaceNetworkAclEntryOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// ReplaceNetworkAclEntry API operation for Amazon Elastic Compute Cloud.
//
-// Replaces an entry (rule) in a network ACL. For more information about network
-// ACLs, see Network ACLs (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html)
-// in the Amazon Virtual Private Cloud User Guide.
+// Replaces an entry (rule) in a network ACL. For more information, see Network
+// ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html) in
+// the Amazon Virtual Private Cloud 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
@@ -20976,7 +29813,7 @@ const opReplaceRoute = "ReplaceRoute"
// ReplaceRouteRequest generates a "aws/request.Request" representing the
// client's request for the ReplaceRoute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21010,19 +29847,18 @@ func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Reques
output = &ReplaceRouteOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// ReplaceRoute API operation for Amazon Elastic Compute Cloud.
//
// Replaces an existing route within a route table in a VPC. You must provide
-// only one of the following: Internet gateway or virtual private gateway, NAT
+// only one of the following: internet gateway or virtual private gateway, NAT
// instance, NAT gateway, VPC peering connection, network interface, or egress-only
-// Internet gateway.
+// internet gateway.
//
-// For more information about route tables, see Route Tables (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -21058,7 +29894,7 @@ const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation"
// ReplaceRouteTableAssociationRequest generates a "aws/request.Request" representing the
// client's request for the ReplaceRouteTableAssociation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21100,7 +29936,7 @@ func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssoci
// Changes the route table associated with a given subnet in a VPC. After the
// operation completes, the subnet uses the routes in the new route table it's
// associated with. For more information about route tables, see Route Tables
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html)
+// (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html)
// in the Amazon Virtual Private Cloud User Guide.
//
// You can also use ReplaceRouteTableAssociation to change which table is the
@@ -21135,12 +29971,86 @@ func (c *EC2) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *Re
return out, req.Send()
}
+const opReplaceTransitGatewayRoute = "ReplaceTransitGatewayRoute"
+
+// ReplaceTransitGatewayRouteRequest generates a "aws/request.Request" representing the
+// client's request for the ReplaceTransitGatewayRoute 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 ReplaceTransitGatewayRoute for more information on using the ReplaceTransitGatewayRoute
+// 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 ReplaceTransitGatewayRouteRequest method.
+// req, resp := client.ReplaceTransitGatewayRouteRequest(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/ReplaceTransitGatewayRoute
+func (c *EC2) ReplaceTransitGatewayRouteRequest(input *ReplaceTransitGatewayRouteInput) (req *request.Request, output *ReplaceTransitGatewayRouteOutput) {
+ op := &request.Operation{
+ Name: opReplaceTransitGatewayRoute,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ReplaceTransitGatewayRouteInput{}
+ }
+
+ output = &ReplaceTransitGatewayRouteOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ReplaceTransitGatewayRoute API operation for Amazon Elastic Compute Cloud.
+//
+// Replaces the specified route in the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation ReplaceTransitGatewayRoute for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceTransitGatewayRoute
+func (c *EC2) ReplaceTransitGatewayRoute(input *ReplaceTransitGatewayRouteInput) (*ReplaceTransitGatewayRouteOutput, error) {
+ req, out := c.ReplaceTransitGatewayRouteRequest(input)
+ return out, req.Send()
+}
+
+// ReplaceTransitGatewayRouteWithContext is the same as ReplaceTransitGatewayRoute with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ReplaceTransitGatewayRoute 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) ReplaceTransitGatewayRouteWithContext(ctx aws.Context, input *ReplaceTransitGatewayRouteInput, opts ...request.Option) (*ReplaceTransitGatewayRouteOutput, error) {
+ req, out := c.ReplaceTransitGatewayRouteRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opReportInstanceStatus = "ReportInstanceStatus"
// ReportInstanceStatusRequest generates a "aws/request.Request" representing the
// client's request for the ReportInstanceStatus operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21174,8 +30084,7 @@ func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req
output = &ReportInstanceStatusOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -21222,7 +30131,7 @@ const opRequestSpotFleet = "RequestSpotFleet"
// RequestSpotFleetRequest generates a "aws/request.Request" representing the
// client's request for the RequestSpotFleet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21284,7 +30193,7 @@ func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *reques
// types in a Spot Fleet request because only the instance resource type is
// supported.
//
-// For more information, see Spot Fleet Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html)
+// For more information, see Spot Fleet Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html)
// in the Amazon EC2 User Guide for Linux Instances.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -21320,7 +30229,7 @@ const opRequestSpotInstances = "RequestSpotInstances"
// RequestSpotInstancesRequest generates a "aws/request.Request" representing the
// client's request for the RequestSpotInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21361,7 +30270,7 @@ func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req
//
// Creates a Spot Instance request.
//
-// For more information, see Spot Instance Requests (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html)
+// 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -21392,12 +30301,92 @@ func (c *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpo
return out, req.Send()
}
+const opResetEbsDefaultKmsKeyId = "ResetEbsDefaultKmsKeyId"
+
+// ResetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the
+// client's request for the ResetEbsDefaultKmsKeyId 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 ResetEbsDefaultKmsKeyId for more information on using the ResetEbsDefaultKmsKeyId
+// 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 ResetEbsDefaultKmsKeyIdRequest method.
+// req, resp := client.ResetEbsDefaultKmsKeyIdRequest(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/ResetEbsDefaultKmsKeyId
+func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput) (req *request.Request, output *ResetEbsDefaultKmsKeyIdOutput) {
+ op := &request.Operation{
+ Name: opResetEbsDefaultKmsKeyId,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ResetEbsDefaultKmsKeyIdInput{}
+ }
+
+ output = &ResetEbsDefaultKmsKeyIdOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ResetEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud.
+//
+// Resets the default customer master key (CMK) for EBS encryption for your
+// account in this Region to the AWS managed CMK for EBS.
+//
+// After resetting the default CMK to the AWS managed CMK, you can continue
+// to encrypt by a customer managed CMK 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.
+//
+// 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 ResetEbsDefaultKmsKeyId for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetEbsDefaultKmsKeyId
+func (c *EC2) ResetEbsDefaultKmsKeyId(input *ResetEbsDefaultKmsKeyIdInput) (*ResetEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.ResetEbsDefaultKmsKeyIdRequest(input)
+ return out, req.Send()
+}
+
+// ResetEbsDefaultKmsKeyIdWithContext is the same as ResetEbsDefaultKmsKeyId with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ResetEbsDefaultKmsKeyId 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) ResetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ResetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ResetEbsDefaultKmsKeyIdOutput, error) {
+ req, out := c.ResetEbsDefaultKmsKeyIdRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opResetFpgaImageAttribute = "ResetFpgaImageAttribute"
// ResetFpgaImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ResetFpgaImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21472,7 +30461,7 @@ const opResetImageAttribute = "ResetImageAttribute"
// ResetImageAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ResetImageAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21506,8 +30495,7 @@ func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *
output = &ResetImageAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -21550,7 +30538,7 @@ const opResetInstanceAttribute = "ResetInstanceAttribute"
// ResetInstanceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ResetInstanceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21584,8 +30572,7 @@ func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput)
output = &ResetInstanceAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -21598,7 +30585,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 (http://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 Virtual Private Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -21634,7 +30621,7 @@ const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute"
// ResetNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ResetNetworkInterfaceAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21668,8 +30655,7 @@ func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterface
output = &ResetNetworkInterfaceAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -21711,7 +30697,7 @@ const opResetSnapshotAttribute = "ResetSnapshotAttribute"
// ResetSnapshotAttributeRequest generates a "aws/request.Request" representing the
// client's request for the ResetSnapshotAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21745,8 +30731,7 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput)
output = &ResetSnapshotAttributeOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -21754,8 +30739,8 @@ func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput)
//
// Resets permission settings for the specified snapshot.
//
-// For more information on modifying snapshot permissions, see Sharing Snapshots
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
+// For more information about modifying snapshot permissions, see Sharing Snapshots
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -21791,7 +30776,7 @@ const opRestoreAddressToClassic = "RestoreAddressToClassic"
// RestoreAddressToClassicRequest generates a "aws/request.Request" representing the
// client's request for the RestoreAddressToClassic operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21863,12 +30848,86 @@ func (c *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *Restore
return out, req.Send()
}
+const opRevokeClientVpnIngress = "RevokeClientVpnIngress"
+
+// RevokeClientVpnIngressRequest generates a "aws/request.Request" representing the
+// client's request for the RevokeClientVpnIngress 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 RevokeClientVpnIngress for more information on using the RevokeClientVpnIngress
+// 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 RevokeClientVpnIngressRequest method.
+// req, resp := client.RevokeClientVpnIngressRequest(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/RevokeClientVpnIngress
+func (c *EC2) RevokeClientVpnIngressRequest(input *RevokeClientVpnIngressInput) (req *request.Request, output *RevokeClientVpnIngressOutput) {
+ op := &request.Operation{
+ Name: opRevokeClientVpnIngress,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &RevokeClientVpnIngressInput{}
+ }
+
+ output = &RevokeClientVpnIngressOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// RevokeClientVpnIngress API operation for Amazon Elastic Compute Cloud.
+//
+// Removes an ingress authorization rule from a Client VPN endpoint.
+//
+// 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 RevokeClientVpnIngress for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeClientVpnIngress
+func (c *EC2) RevokeClientVpnIngress(input *RevokeClientVpnIngressInput) (*RevokeClientVpnIngressOutput, error) {
+ req, out := c.RevokeClientVpnIngressRequest(input)
+ return out, req.Send()
+}
+
+// RevokeClientVpnIngressWithContext is the same as RevokeClientVpnIngress with the addition of
+// the ability to pass a context and additional request options.
+//
+// See RevokeClientVpnIngress 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) RevokeClientVpnIngressWithContext(ctx aws.Context, input *RevokeClientVpnIngressInput, opts ...request.Option) (*RevokeClientVpnIngressOutput, error) {
+ req, out := c.RevokeClientVpnIngressRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress"
// RevokeSecurityGroupEgressRequest generates a "aws/request.Request" representing the
// client's request for the RevokeSecurityGroupEgress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21902,17 +30961,16 @@ func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressI
output = &RevokeSecurityGroupEgressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud.
//
-// [EC2-VPC only] Removes one or more egress rules from a security group for
-// EC2-VPC. This action doesn't apply to security groups for use in EC2-Classic.
-// To remove a rule, the values that you specify (for example, ports) must match
-// the existing rule's values exactly.
+// [VPC only] Removes the specified egress rules from a security group for EC2-VPC.
+// This action doesn't apply to security groups for use in EC2-Classic. To remove
+// a rule, the values that you specify (for example, ports) must match the existing
+// rule's values exactly.
//
// Each rule consists of the protocol and the IPv4 or IPv6 CIDR range or source
// security group. For the TCP and UDP protocols, you must also specify the
@@ -21956,7 +31014,7 @@ const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress"
// RevokeSecurityGroupIngressRequest generates a "aws/request.Request" representing the
// client's request for the RevokeSecurityGroupIngress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -21990,20 +31048,19 @@ func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngres
output = &RevokeSecurityGroupIngressOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud.
//
-// Removes one or more ingress rules from a security group. To remove a rule,
+// Removes the specified ingress rules from a security group. To remove a rule,
// the values that you specify (for example, ports) must match the existing
// rule's values exactly.
//
-// [EC2-Classic security groups only] If the values you specify do not match
-// the existing rule's values, no error is returned. Use DescribeSecurityGroups
-// to verify that the rule has been removed.
+// [EC2-Classic only] If the values you specify do not match the existing rule's
+// values, no error is returned. Use DescribeSecurityGroups to verify that the
+// rule has been removed.
//
// Each rule consists of the protocol and the CIDR range or source security
// group. For the TCP and UDP protocols, you must also specify the destination
@@ -22047,7 +31104,7 @@ const opRunInstances = "RunInstances"
// RunInstancesRequest generates a "aws/request.Request" representing the
// client's request for the RunInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22101,22 +31158,22 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques
//
// * Some instance types must be launched into a VPC. If you do not have
// a default VPC, or if you do not specify a subnet ID, the request fails.
-// For more information, see Instance Types Available Only in a VPC (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types).
+// For more information, see Instance Types Available Only in a VPC (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html#vpc-only-instance-types).
//
// * [EC2-VPC] All instances have a network interface with a primary private
// IPv4 address. If you don't specify this address, we choose one from the
// IPv4 range of your subnet.
//
// * Not all instance types support IPv6 addresses. For more information,
-// see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).
+// 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html).
+// group. 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.
//
-// You can create a launch template (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html),
+// You can create a launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html),
// which is a resource that contains the parameters to launch an instance. When
// you launch an instance using RunInstances, you can specify the launch template
// instead of specifying the launch parameters.
@@ -22128,17 +31185,17 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques
// 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,
-// see CreateTags and Tagging Your Amazon EC2 Resources (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
+// see CreateTags and Tagging Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
//
// Linux instances have access to the public key of the key pair at boot. You
// can use this key to provide secure access to the instance. Amazon EC2 public
// images use this feature to provide secure access without passwords. For more
-// information, see Key Pairs (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
+// information, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// For troubleshooting, see What To Do If An Instance Immediately Terminates
-// (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html),
-// and Troubleshooting Connecting to Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html)
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html),
+// and Troubleshooting Connecting to Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22174,7 +31231,7 @@ const opRunScheduledInstances = "RunScheduledInstances"
// RunScheduledInstancesRequest generates a "aws/request.Request" representing the
// client's request for the RunScheduledInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22222,7 +31279,7 @@ func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (r
// 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html)
+// see Scheduled Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22253,12 +31310,86 @@ func (c *EC2) RunScheduledInstancesWithContext(ctx aws.Context, input *RunSchedu
return out, req.Send()
}
+const opSearchTransitGatewayRoutes = "SearchTransitGatewayRoutes"
+
+// SearchTransitGatewayRoutesRequest generates a "aws/request.Request" representing the
+// client's request for the SearchTransitGatewayRoutes 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 SearchTransitGatewayRoutes for more information on using the SearchTransitGatewayRoutes
+// 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 SearchTransitGatewayRoutesRequest method.
+// req, resp := client.SearchTransitGatewayRoutesRequest(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/SearchTransitGatewayRoutes
+func (c *EC2) SearchTransitGatewayRoutesRequest(input *SearchTransitGatewayRoutesInput) (req *request.Request, output *SearchTransitGatewayRoutesOutput) {
+ op := &request.Operation{
+ Name: opSearchTransitGatewayRoutes,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &SearchTransitGatewayRoutesInput{}
+ }
+
+ output = &SearchTransitGatewayRoutesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// SearchTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud.
+//
+// Searches for routes in the specified 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
+// the error.
+//
+// See the AWS API reference guide for Amazon Elastic Compute Cloud's
+// API operation SearchTransitGatewayRoutes for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayRoutes
+func (c *EC2) SearchTransitGatewayRoutes(input *SearchTransitGatewayRoutesInput) (*SearchTransitGatewayRoutesOutput, error) {
+ req, out := c.SearchTransitGatewayRoutesRequest(input)
+ return out, req.Send()
+}
+
+// SearchTransitGatewayRoutesWithContext is the same as SearchTransitGatewayRoutes with the addition of
+// the ability to pass a context and additional request options.
+//
+// See SearchTransitGatewayRoutes 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) SearchTransitGatewayRoutesWithContext(ctx aws.Context, input *SearchTransitGatewayRoutesInput, opts ...request.Option) (*SearchTransitGatewayRoutesOutput, error) {
+ req, out := c.SearchTransitGatewayRoutesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opStartInstances = "StartInstances"
// StartInstancesRequest generates a "aws/request.Request" representing the
// client's request for the StartInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22318,7 +31449,7 @@ 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.
//
-// For more information, see Stopping Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
+// For more information, see Stopping Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22354,7 +31485,7 @@ const opStopInstances = "StopInstances"
// StopInstancesRequest generates a "aws/request.Request" representing the
// client's request for the StopInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22395,6 +31526,12 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ
//
// Stops an Amazon EBS-backed instance.
//
+// 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/Hibernate.html#enabling-hibernation)
+// and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites).
+// 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.
+//
// We don't charge usage for a stopped instance, or data transfer fees; however,
// your root partition Amazon EBS volume remains and continues to persist your
// data, and you are charged for Amazon EBS volume usage. Every time you start
@@ -22405,26 +31542,31 @@ func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Requ
// your Linux instance, Amazon EC2 charges a one-minute minimum for instance
// usage, and thereafter charges per second for instance usage.
//
-// You can't start or stop Spot Instances, and you can't stop instance store-backed
-// instances.
+// You can't start, stop, or hibernate Spot Instances, and you can't stop or
+// hibernate instance store-backed instances. For information about using hibernation
+// for Spot Instances, see Hibernating Interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances)
+// in the Amazon Elastic Compute Cloud User Guide.
//
-// When you stop an instance, we shut it down. You can restart your instance
-// at any time. Before stopping an instance, make sure it is in a state from
-// which it can be restarted. Stopping an instance does not preserve data stored
-// in RAM.
+// When you stop or hibernate an instance, we shut it down. You can restart
+// your instance at any time. Before stopping or hibernating an instance, make
+// sure it is in a state from which it can be restarted. Stopping an instance
+// does not preserve data stored in RAM, but hibernating an instance does preserve
+// data stored in RAM. If an instance cannot hibernate successfully, a normal
+// shutdown occurs.
//
-// Stopping an instance is different to rebooting or terminating it. For example,
-// when you stop an instance, the root device and any other devices attached
-// to the instance persist. When you terminate an instance, the root device
-// and any other devices attached during the instance launch are automatically
-// deleted. For more information about the differences between rebooting, stopping,
-// and terminating instances, see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
+// Stopping and hibernating an instance is different to rebooting or terminating
+// it. For example, when you stop or hibernate an instance, the root device
+// and any other devices attached to the instance persist. When you terminate
+// an instance, the root device and any other devices attached during the instance
+// launch are automatically deleted. For more information about the differences
+// between rebooting, stopping, hibernating, and terminating instances, see
+// Instance Lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// When you stop an instance, we attempt to shut it down forcibly after a short
// while. If your instance appears stuck in the stopping state after a period
// of time, there may be an issue with the underlying host computer. For more
-// information, see Troubleshooting Stopping Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html)
+// information, see Troubleshooting Stopping Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22455,12 +31597,88 @@ func (c *EC2) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInpu
return out, req.Send()
}
+const opTerminateClientVpnConnections = "TerminateClientVpnConnections"
+
+// TerminateClientVpnConnectionsRequest generates a "aws/request.Request" representing the
+// client's request for the TerminateClientVpnConnections 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 TerminateClientVpnConnections for more information on using the TerminateClientVpnConnections
+// 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 TerminateClientVpnConnectionsRequest method.
+// req, resp := client.TerminateClientVpnConnectionsRequest(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/TerminateClientVpnConnections
+func (c *EC2) TerminateClientVpnConnectionsRequest(input *TerminateClientVpnConnectionsInput) (req *request.Request, output *TerminateClientVpnConnectionsOutput) {
+ op := &request.Operation{
+ Name: opTerminateClientVpnConnections,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &TerminateClientVpnConnectionsInput{}
+ }
+
+ output = &TerminateClientVpnConnectionsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// TerminateClientVpnConnections API operation for Amazon Elastic Compute Cloud.
+//
+// Terminates active Client VPN endpoint connections. This action can be used
+// to terminate a specific client connection, or up to five connections established
+// by a specific user.
+//
+// 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 TerminateClientVpnConnections for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateClientVpnConnections
+func (c *EC2) TerminateClientVpnConnections(input *TerminateClientVpnConnectionsInput) (*TerminateClientVpnConnectionsOutput, error) {
+ req, out := c.TerminateClientVpnConnectionsRequest(input)
+ return out, req.Send()
+}
+
+// TerminateClientVpnConnectionsWithContext is the same as TerminateClientVpnConnections with the addition of
+// the ability to pass a context and additional request options.
+//
+// See TerminateClientVpnConnections 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) TerminateClientVpnConnectionsWithContext(ctx aws.Context, input *TerminateClientVpnConnectionsInput, opts ...request.Option) (*TerminateClientVpnConnectionsOutput, error) {
+ req, out := c.TerminateClientVpnConnectionsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opTerminateInstances = "TerminateInstances"
// TerminateInstancesRequest generates a "aws/request.Request" representing the
// client's request for the TerminateInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22499,8 +31717,8 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re
// TerminateInstances API operation for Amazon Elastic Compute Cloud.
//
-// Shuts down one or more instances. This operation is idempotent; if you terminate
-// an instance more than once, each call succeeds.
+// Shuts down the specified instances. This operation is idempotent; if you
+// terminate an instance more than once, each call succeeds.
//
// If you specify multiple instances and the request fails (for example, because
// of a single incorrect instance ID), none of the instances are terminated.
@@ -22518,11 +31736,11 @@ func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *re
// an instance, any attached EBS volumes with the DeleteOnTermination block
// device mapping parameter set to true are automatically deleted. For more
// information about the differences between stopping and terminating instances,
-// see Instance Lifecycle (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
+// see Instance Lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// For more information about troubleshooting, see Troubleshooting Terminating
-// Your Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html)
+// Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22558,7 +31776,7 @@ const opUnassignIpv6Addresses = "UnassignIpv6Addresses"
// UnassignIpv6AddressesRequest generates a "aws/request.Request" representing the
// client's request for the UnassignIpv6Addresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22632,7 +31850,7 @@ const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses"
// UnassignPrivateIpAddressesRequest generates a "aws/request.Request" representing the
// client's request for the UnassignPrivateIpAddresses operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22666,8 +31884,7 @@ func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddresse
output = &UnassignPrivateIpAddressesOutput{}
req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Remove(ec2query.UnmarshalHandler)
- req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
+ req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -22708,7 +31925,7 @@ const opUnmonitorInstances = "UnmonitorInstances"
// UnmonitorInstancesRequest generates a "aws/request.Request" representing the
// client's request for the UnmonitorInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22748,7 +31965,7 @@ func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *re
// UnmonitorInstances API operation for Amazon Elastic Compute Cloud.
//
// Disables detailed monitoring for a running instance. For more information,
-// see Monitoring Your Instances and Volumes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html)
+// see Monitoring Your Instances and Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -22784,7 +32001,7 @@ const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDesc
// UpdateSecurityGroupRuleDescriptionsEgressRequest generates a "aws/request.Request" representing the
// client's request for the UpdateSecurityGroupRuleDescriptionsEgress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22823,7 +32040,7 @@ func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressRequest(input *UpdateSecu
// UpdateSecurityGroupRuleDescriptionsEgress API operation for Amazon Elastic Compute Cloud.
//
-// [EC2-VPC only] Updates the description of an egress (outbound) security group
+// [VPC only] Updates the description of an egress (outbound) security group
// rule. You can replace an existing description, or add a description to a
// rule that did not have one previously.
//
@@ -22864,7 +32081,7 @@ const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDes
// UpdateSecurityGroupRuleDescriptionsIngressRequest generates a "aws/request.Request" representing the
// client's request for the UpdateSecurityGroupRuleDescriptionsIngress operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -22939,6 +32156,87 @@ func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressWithContext(ctx aws.Cont
return out, req.Send()
}
+const opWithdrawByoipCidr = "WithdrawByoipCidr"
+
+// WithdrawByoipCidrRequest generates a "aws/request.Request" representing the
+// client's request for the WithdrawByoipCidr 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 WithdrawByoipCidr for more information on using the WithdrawByoipCidr
+// 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 WithdrawByoipCidrRequest method.
+// req, resp := client.WithdrawByoipCidrRequest(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/WithdrawByoipCidr
+func (c *EC2) WithdrawByoipCidrRequest(input *WithdrawByoipCidrInput) (req *request.Request, output *WithdrawByoipCidrOutput) {
+ op := &request.Operation{
+ Name: opWithdrawByoipCidr,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &WithdrawByoipCidrInput{}
+ }
+
+ output = &WithdrawByoipCidrOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// WithdrawByoipCidr API operation for Amazon Elastic Compute Cloud.
+//
+// Stops advertising an IPv4 address range that is provisioned as an address
+// pool.
+//
+// You can perform this operation at most once every 10 seconds, even if you
+// specify different address ranges each time.
+//
+// It can take a few minutes before traffic to the specified addresses stops
+// routing to AWS because of BGP propagation delays.
+//
+// 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 WithdrawByoipCidr for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/WithdrawByoipCidr
+func (c *EC2) WithdrawByoipCidr(input *WithdrawByoipCidrInput) (*WithdrawByoipCidrOutput, error) {
+ req, out := c.WithdrawByoipCidrRequest(input)
+ return out, req.Send()
+}
+
+// WithdrawByoipCidrWithContext is the same as WithdrawByoipCidr with the addition of
+// the ability to pass a context and additional request options.
+//
+// See WithdrawByoipCidr 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) WithdrawByoipCidrWithContext(ctx aws.Context, input *WithdrawByoipCidrInput, opts ...request.Option) (*WithdrawByoipCidrOutput, error) {
+ req, out := c.WithdrawByoipCidrRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
// Contains the parameters for accepting the quote.
type AcceptReservedInstancesExchangeQuoteInput struct {
_ struct{} `type:"structure"`
@@ -23035,6 +32333,79 @@ func (s *AcceptReservedInstancesExchangeQuoteOutput) SetExchangeId(v string) *Ac
return s
}
+type AcceptTransitGatewayVpcAttachmentInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s AcceptTransitGatewayVpcAttachmentInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AcceptTransitGatewayVpcAttachmentInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AcceptTransitGatewayVpcAttachmentInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AcceptTransitGatewayVpcAttachmentInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *AcceptTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *AcceptTransitGatewayVpcAttachmentInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *AcceptTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *AcceptTransitGatewayVpcAttachmentInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+type AcceptTransitGatewayVpcAttachmentOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The VPC attachment.
+ TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"`
+}
+
+// String returns the string representation
+func (s AcceptTransitGatewayVpcAttachmentOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AcceptTransitGatewayVpcAttachmentOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value.
+func (s *AcceptTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *AcceptTransitGatewayVpcAttachmentOutput {
+ s.TransitGatewayVpcAttachment = v
+ return s
+}
+
type AcceptVpcEndpointConnectionsInput struct {
_ struct{} `type:"structure"`
@@ -23122,7 +32493,6 @@ func (s *AcceptVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulIt
return s
}
-// Contains the parameters for AcceptVpcPeeringConnection.
type AcceptVpcPeeringConnectionInput struct {
_ struct{} `type:"structure"`
@@ -23159,7 +32529,6 @@ func (s *AcceptVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *A
return s
}
-// Contains the output of AcceptVpcPeeringConnection.
type AcceptVpcPeeringConnectionOutput struct {
_ struct{} `type:"structure"`
@@ -23190,7 +32559,7 @@ type AccountAttribute struct {
// The name of the account attribute.
AttributeName *string `locationName:"attributeName" type:"string"`
- // One or more values for the account attribute.
+ // The values for the account attribute.
AttributeValues []*AccountAttributeValue `locationName:"attributeValueSet" locationNameList:"item" type:"list"`
}
@@ -23323,6 +32692,9 @@ type Address struct {
// The Elastic IP address.
PublicIp *string `locationName:"publicIp" type:"string"`
+ // The ID of an address pool.
+ PublicIpv4Pool *string `locationName:"publicIpv4Pool" type:"string"`
+
// Any tags assigned to the Elastic IP address.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
}
@@ -23385,17 +32757,97 @@ func (s *Address) SetPublicIp(v string) *Address {
return s
}
+// SetPublicIpv4Pool sets the PublicIpv4Pool field's value.
+func (s *Address) SetPublicIpv4Pool(v string) *Address {
+ s.PublicIpv4Pool = &v
+ return s
+}
+
// SetTags sets the Tags field's value.
func (s *Address) SetTags(v []*Tag) *Address {
s.Tags = v
return s
}
-// Contains the parameters for AllocateAddress.
+type AdvertiseByoipCidrInput struct {
+ _ struct{} `type:"structure"`
+
+ // The IPv4 address range, in CIDR notation. This must be the exact range that
+ // you provisioned. You can't advertise only a portion of the provisioned range.
+ //
+ // Cidr is a required field
+ Cidr *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s AdvertiseByoipCidrInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AdvertiseByoipCidrInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AdvertiseByoipCidrInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AdvertiseByoipCidrInput"}
+ if s.Cidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cidr"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCidr sets the Cidr field's value.
+func (s *AdvertiseByoipCidrInput) SetCidr(v string) *AdvertiseByoipCidrInput {
+ s.Cidr = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *AdvertiseByoipCidrInput) SetDryRun(v bool) *AdvertiseByoipCidrInput {
+ s.DryRun = &v
+ return s
+}
+
+type AdvertiseByoipCidrOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the address range.
+ ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"`
+}
+
+// String returns the string representation
+func (s AdvertiseByoipCidrOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AdvertiseByoipCidrOutput) GoString() string {
+ return s.String()
+}
+
+// SetByoipCidr sets the ByoipCidr field's value.
+func (s *AdvertiseByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *AdvertiseByoipCidrOutput {
+ s.ByoipCidr = v
+ return s
+}
+
type AllocateAddressInput struct {
_ struct{} `type:"structure"`
- // [EC2-VPC] The Elastic IP address to recover.
+ // [EC2-VPC] The Elastic IP address to recover or an IPv4 address from an address
+ // pool.
Address *string `type:"string"`
// Set to vpc to allocate the address for use with instances in a VPC.
@@ -23408,6 +32860,11 @@ type AllocateAddressInput struct {
// the required permissions, the error response is DryRunOperation. Otherwise,
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
+
+ // The ID of an address pool that you own. Use this parameter to let Amazon
+ // EC2 select an address from the address pool. To specify a specific address
+ // from the address pool, use the Address parameter instead.
+ PublicIpv4Pool *string `type:"string"`
}
// String returns the string representation
@@ -23438,7 +32895,12 @@ func (s *AllocateAddressInput) SetDryRun(v bool) *AllocateAddressInput {
return s
}
-// Contains the output of AllocateAddress.
+// SetPublicIpv4Pool sets the PublicIpv4Pool field's value.
+func (s *AllocateAddressInput) SetPublicIpv4Pool(v string) *AllocateAddressInput {
+ s.PublicIpv4Pool = &v
+ return s
+}
+
type AllocateAddressOutput struct {
_ struct{} `type:"structure"`
@@ -23452,6 +32914,9 @@ type AllocateAddressOutput struct {
// The Elastic IP address.
PublicIp *string `locationName:"publicIp" type:"string"`
+
+ // The ID of an address pool.
+ PublicIpv4Pool *string `locationName:"publicIpv4Pool" type:"string"`
}
// String returns the string representation
@@ -23482,39 +32947,55 @@ func (s *AllocateAddressOutput) SetPublicIp(v string) *AllocateAddressOutput {
return s
}
-// Contains the parameters for AllocateHosts.
+// SetPublicIpv4Pool sets the PublicIpv4Pool field's value.
+func (s *AllocateAddressOutput) SetPublicIpv4Pool(v string) *AllocateAddressOutput {
+ s.PublicIpv4Pool = &v
+ return s
+}
+
type AllocateHostsInput struct {
_ struct{} `type:"structure"`
- // This is enabled by default. This property allows instances to be automatically
- // placed onto available Dedicated Hosts, when you are launching instances without
- // specifying a host ID.
+ // Indicates whether the host accepts any untargeted instance launches that
+ // match its instance type configuration, or if it only accepts Host tenancy
+ // instance launches that specify its unique host ID. For more information,
+ // see Understanding Instance Placement and Host Affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding)
+ // in the Amazon EC2 User Guide for Linux Instances.
//
- // Default: Enabled
+ // Default: on
AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"`
- // The Availability Zone for the Dedicated Hosts.
+ // The Availability Zone in which to allocate the Dedicated Host.
//
// AvailabilityZone is a required field
AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"`
- // Unique, case-sensitive identifier you provide to ensure idempotency of the
- // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // 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).
ClientToken *string `locationName:"clientToken" type:"string"`
- // Specify the instance type that you want your Dedicated Hosts to be configured
- // for. When you specify the instance type, that is the only instance type that
- // you can launch onto that host.
+ // Indicates whether to enable or disable host recovery for the Dedicated Host.
+ // Host recovery is disabled by default. For more information, see Host Recovery
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html)
+ // in the Amazon Elastic Compute Cloud User Guide.
+ //
+ // Default: off
+ HostRecovery *string `type:"string" enum:"HostRecovery"`
+
+ // Specifies the instance type for which to configure your Dedicated Hosts.
+ // When you specify the instance type, that is the only instance type that you
+ // can launch onto that host.
//
// InstanceType is a required field
InstanceType *string `locationName:"instanceType" type:"string" required:"true"`
- // The number of Dedicated Hosts you want to allocate to your account with these
- // parameters.
+ // The number of Dedicated Hosts to allocate to your account with these parameters.
//
// Quantity is a required field
Quantity *int64 `locationName:"quantity" type:"integer" required:"true"`
+
+ // The tags to apply to the Dedicated Host during creation.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
}
// String returns the string representation
@@ -23564,6 +33045,12 @@ func (s *AllocateHostsInput) SetClientToken(v string) *AllocateHostsInput {
return s
}
+// SetHostRecovery sets the HostRecovery field's value.
+func (s *AllocateHostsInput) SetHostRecovery(v string) *AllocateHostsInput {
+ s.HostRecovery = &v
+ return s
+}
+
// SetInstanceType sets the InstanceType field's value.
func (s *AllocateHostsInput) SetInstanceType(v string) *AllocateHostsInput {
s.InstanceType = &v
@@ -23576,12 +33063,18 @@ func (s *AllocateHostsInput) SetQuantity(v int64) *AllocateHostsInput {
return s
}
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *AllocateHostsInput) SetTagSpecifications(v []*TagSpecification) *AllocateHostsInput {
+ s.TagSpecifications = v
+ return s
+}
+
// Contains the output of AllocateHosts.
type AllocateHostsOutput struct {
_ struct{} `type:"structure"`
- // The ID of the allocated Dedicated Host. This is used when you want to launch
- // an instance onto a specific host.
+ // The ID of the allocated Dedicated Host. This is used to launch an instance
+ // onto a specific host.
HostIds []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"`
}
@@ -23634,6 +33127,108 @@ func (s *AllowedPrincipal) SetPrincipalType(v string) *AllowedPrincipal {
return s
}
+type ApplySecurityGroupsToClientVpnTargetNetworkInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The IDs of the security groups to apply to the associated target network.
+ // Up to 5 security groups can be applied to an associated target network.
+ //
+ // SecurityGroupIds is a required field
+ SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list" required:"true"`
+
+ // The ID of the VPC in which the associated target network is located.
+ //
+ // VpcId is a required field
+ VpcId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToClientVpnTargetNetworkInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.SecurityGroupIds == nil {
+ invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds"))
+ }
+ if s.VpcId == nil {
+ invalidParams.Add(request.NewErrParamRequired("VpcId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetDryRun(v bool) *ApplySecurityGroupsToClientVpnTargetNetworkInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetSecurityGroupIds sets the SecurityGroupIds field's value.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkInput {
+ s.SecurityGroupIds = v
+ return s
+}
+
+// SetVpcId sets the VpcId field's value.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetVpcId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput {
+ s.VpcId = &v
+ return s
+}
+
+type ApplySecurityGroupsToClientVpnTargetNetworkOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The IDs of the applied security groups.
+ SecurityGroupIds []*string `locationName:"securityGroupIds" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) GoString() string {
+ return s.String()
+}
+
+// SetSecurityGroupIds sets the SecurityGroupIds field's value.
+func (s *ApplySecurityGroupsToClientVpnTargetNetworkOutput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkOutput {
+ s.SecurityGroupIds = v
+ return s
+}
+
type AssignIpv6AddressesInput struct {
_ struct{} `type:"structure"`
@@ -23800,6 +33395,12 @@ func (s *AssignPrivateIpAddressesInput) SetSecondaryPrivateIpAddressCount(v int6
type AssignPrivateIpAddressesOutput struct {
_ struct{} `type:"structure"`
+
+ // The private IP addresses assigned to the network interface.
+ AssignedPrivateIpAddresses []*AssignedPrivateIpAddress `locationName:"assignedPrivateIpAddressesSet" locationNameList:"item" type:"list"`
+
+ // The ID of the network interface.
+ NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"`
}
// String returns the string representation
@@ -23812,7 +33413,42 @@ func (s AssignPrivateIpAddressesOutput) GoString() string {
return s.String()
}
-// Contains the parameters for AssociateAddress.
+// SetAssignedPrivateIpAddresses sets the AssignedPrivateIpAddresses field's value.
+func (s *AssignPrivateIpAddressesOutput) SetAssignedPrivateIpAddresses(v []*AssignedPrivateIpAddress) *AssignPrivateIpAddressesOutput {
+ s.AssignedPrivateIpAddresses = v
+ return s
+}
+
+// SetNetworkInterfaceId sets the NetworkInterfaceId field's value.
+func (s *AssignPrivateIpAddressesOutput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesOutput {
+ s.NetworkInterfaceId = &v
+ return s
+}
+
+// Describes the private IP addresses assigned to a network interface.
+type AssignedPrivateIpAddress struct {
+ _ struct{} `type:"structure"`
+
+ // The private IP address assigned to the network interface.
+ PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
+}
+
+// String returns the string representation
+func (s AssignedPrivateIpAddress) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssignedPrivateIpAddress) GoString() string {
+ return s.String()
+}
+
+// SetPrivateIpAddress sets the PrivateIpAddress field's value.
+func (s *AssignedPrivateIpAddress) SetPrivateIpAddress(v string) *AssignedPrivateIpAddress {
+ s.PrivateIpAddress = &v
+ return s
+}
+
type AssociateAddressInput struct {
_ struct{} `type:"structure"`
@@ -23841,6 +33477,9 @@ type AssociateAddressInput struct {
// [EC2-VPC] The ID of the network interface. If the instance has more than
// one network interface, you must specify a network interface ID.
+ //
+ // For EC2-VPC, you can specify either the instance ID or the network interface
+ // ID, but not both.
NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"`
// [EC2-VPC] The primary or secondary private IP address to associate with the
@@ -23848,7 +33487,8 @@ type AssociateAddressInput struct {
// address is associated with the primary private IP address.
PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
- // The Elastic IP address. This is required for EC2-Classic.
+ // The Elastic IP address to associate with the instance. This is required for
+ // EC2-Classic.
PublicIp *string `type:"string"`
}
@@ -23904,7 +33544,6 @@ func (s *AssociateAddressInput) SetPublicIp(v string) *AssociateAddressInput {
return s
}
-// Contains the output of AssociateAddress.
type AssociateAddressOutput struct {
_ struct{} `type:"structure"`
@@ -23929,7 +33568,112 @@ func (s *AssociateAddressOutput) SetAssociationId(v string) *AssociateAddressOut
return s
}
-// Contains the parameters for AssociateDhcpOptions.
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the subnet to associate with the Client VPN endpoint.
+ //
+ // SubnetId is a required field
+ SubnetId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s AssociateClientVpnTargetNetworkInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociateClientVpnTargetNetworkInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AssociateClientVpnTargetNetworkInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AssociateClientVpnTargetNetworkInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.SubnetId == nil {
+ invalidParams.Add(request.NewErrParamRequired("SubnetId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *AssociateClientVpnTargetNetworkInput) SetClientToken(v string) *AssociateClientVpnTargetNetworkInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *AssociateClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *AssociateClientVpnTargetNetworkInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *AssociateClientVpnTargetNetworkInput) SetDryRun(v bool) *AssociateClientVpnTargetNetworkInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetSubnetId sets the SubnetId field's value.
+func (s *AssociateClientVpnTargetNetworkInput) SetSubnetId(v string) *AssociateClientVpnTargetNetworkInput {
+ s.SubnetId = &v
+ return s
+}
+
+type AssociateClientVpnTargetNetworkOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The unique ID of the target network association.
+ AssociationId *string `locationName:"associationId" type:"string"`
+
+ // The current state of the target network association.
+ Status *AssociationStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s AssociateClientVpnTargetNetworkOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociateClientVpnTargetNetworkOutput) GoString() string {
+ return s.String()
+}
+
+// SetAssociationId sets the AssociationId field's value.
+func (s *AssociateClientVpnTargetNetworkOutput) SetAssociationId(v string) *AssociateClientVpnTargetNetworkOutput {
+ s.AssociationId = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *AssociateClientVpnTargetNetworkOutput) SetStatus(v *AssociationStatus) *AssociateClientVpnTargetNetworkOutput {
+ s.Status = v
+ return s
+}
+
type AssociateDhcpOptionsInput struct {
_ struct{} `type:"structure"`
@@ -24084,7 +33828,6 @@ func (s *AssociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *
return s
}
-// Contains the parameters for AssociateRouteTable.
type AssociateRouteTableInput struct {
_ struct{} `type:"structure"`
@@ -24149,11 +33892,11 @@ func (s *AssociateRouteTableInput) SetSubnetId(v string) *AssociateRouteTableInp
return s
}
-// Contains the output of AssociateRouteTable.
type AssociateRouteTableOutput struct {
_ struct{} `type:"structure"`
- // The route table association ID (needed to disassociate the route table).
+ // The route table association ID. This ID is required for disassociating the
+ // route table.
AssociationId *string `locationName:"associationId" type:"string"`
}
@@ -24257,6 +34000,93 @@ func (s *AssociateSubnetCidrBlockOutput) SetSubnetId(v string) *AssociateSubnetC
return s
}
+type AssociateTransitGatewayRouteTableInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s AssociateTransitGatewayRouteTableInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociateTransitGatewayRouteTableInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AssociateTransitGatewayRouteTableInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AssociateTransitGatewayRouteTableInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *AssociateTransitGatewayRouteTableInput) SetDryRun(v bool) *AssociateTransitGatewayRouteTableInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayAttachmentId(v string) *AssociateTransitGatewayRouteTableInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *AssociateTransitGatewayRouteTableInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type AssociateTransitGatewayRouteTableOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the association.
+ Association *TransitGatewayAssociation `locationName:"association" type:"structure"`
+}
+
+// String returns the string representation
+func (s AssociateTransitGatewayRouteTableOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociateTransitGatewayRouteTableOutput) GoString() string {
+ return s.String()
+}
+
+// SetAssociation sets the Association field's value.
+func (s *AssociateTransitGatewayRouteTableOutput) SetAssociation(v *TransitGatewayAssociation) *AssociateTransitGatewayRouteTableOutput {
+ s.Association = v
+ return s
+}
+
type AssociateVpcCidrBlockInput struct {
_ struct{} `type:"structure"`
@@ -24356,7 +34186,73 @@ func (s *AssociateVpcCidrBlockOutput) SetVpcId(v string) *AssociateVpcCidrBlockO
return s
}
-// Contains the parameters for AttachClassicLinkVpc.
+// Describes a target network that is associated with a Client VPN endpoint.
+// A target network is a subnet in a VPC.
+type AssociatedTargetNetwork struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the subnet.
+ NetworkId *string `locationName:"networkId" type:"string"`
+
+ // The target network type.
+ NetworkType *string `locationName:"networkType" type:"string" enum:"AssociatedNetworkType"`
+}
+
+// String returns the string representation
+func (s AssociatedTargetNetwork) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociatedTargetNetwork) GoString() string {
+ return s.String()
+}
+
+// SetNetworkId sets the NetworkId field's value.
+func (s *AssociatedTargetNetwork) SetNetworkId(v string) *AssociatedTargetNetwork {
+ s.NetworkId = &v
+ return s
+}
+
+// SetNetworkType sets the NetworkType field's value.
+func (s *AssociatedTargetNetwork) SetNetworkType(v string) *AssociatedTargetNetwork {
+ s.NetworkType = &v
+ return s
+}
+
+// Describes the state of a target network association.
+type AssociationStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the target network association.
+ Code *string `locationName:"code" type:"string" enum:"AssociationStatusCode"`
+
+ // A message about the status of the target network association, if applicable.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s AssociationStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AssociationStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *AssociationStatus) SetCode(v string) *AssociationStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *AssociationStatus) SetMessage(v string) *AssociationStatus {
+ s.Message = &v
+ return s
+}
+
type AttachClassicLinkVpcInput struct {
_ struct{} `type:"structure"`
@@ -24436,7 +34332,6 @@ func (s *AttachClassicLinkVpcInput) SetVpcId(v string) *AttachClassicLinkVpcInpu
return s
}
-// Contains the output of AttachClassicLinkVpc.
type AttachClassicLinkVpcOutput struct {
_ struct{} `type:"structure"`
@@ -24460,7 +34355,6 @@ func (s *AttachClassicLinkVpcOutput) SetReturn(v bool) *AttachClassicLinkVpcOutp
return s
}
-// Contains the parameters for AttachInternetGateway.
type AttachInternetGatewayInput struct {
_ struct{} `type:"structure"`
@@ -24470,7 +34364,7 @@ type AttachInternetGatewayInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The ID of the Internet gateway.
+ // The ID of the internet gateway.
//
// InternetGatewayId is a required field
InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"`
@@ -24859,7 +34753,203 @@ func (s *AttributeValue) SetValue(v string) *AttributeValue {
return s
}
-// Contains the parameters for AuthorizeSecurityGroupEgress.
+// Information about an authorization rule.
+type AuthorizationRule struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether the authorization rule grants access to all clients.
+ AccessAll *bool `locationName:"accessAll" type:"boolean"`
+
+ // The ID of the Client VPN endpoint with which the authorization rule is associated.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // A brief description of the authorization rule.
+ Description *string `locationName:"description" type:"string"`
+
+ // The IPv4 address range, in CIDR notation, of the network to which the authorization
+ // rule applies.
+ DestinationCidr *string `locationName:"destinationCidr" type:"string"`
+
+ // The ID of the Active Directory group to which the authorization rule grants
+ // access.
+ GroupId *string `locationName:"groupId" type:"string"`
+
+ // The current state of the authorization rule.
+ Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s AuthorizationRule) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AuthorizationRule) GoString() string {
+ return s.String()
+}
+
+// SetAccessAll sets the AccessAll field's value.
+func (s *AuthorizationRule) SetAccessAll(v bool) *AuthorizationRule {
+ s.AccessAll = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *AuthorizationRule) SetClientVpnEndpointId(v string) *AuthorizationRule {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *AuthorizationRule) SetDescription(v string) *AuthorizationRule {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidr sets the DestinationCidr field's value.
+func (s *AuthorizationRule) SetDestinationCidr(v string) *AuthorizationRule {
+ s.DestinationCidr = &v
+ return s
+}
+
+// SetGroupId sets the GroupId field's value.
+func (s *AuthorizationRule) SetGroupId(v string) *AuthorizationRule {
+ s.GroupId = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *AuthorizationRule) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizationRule {
+ s.Status = v
+ return s
+}
+
+type AuthorizeClientVpnIngressInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Active Directory group to grant access.
+ AccessGroupId *string `type:"string"`
+
+ // Indicates whether to grant access to all clients. Use true to grant all clients
+ // who successfully establish a VPN connection access to the network.
+ 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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"true"`
+
+ // A brief description of the authorization rule.
+ Description *string `type:"string"`
+
+ // 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 IPv4 address range, in CIDR notation, of the network for which access
+ // is being authorized.
+ //
+ // TargetNetworkCidr is a required field
+ TargetNetworkCidr *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s AuthorizeClientVpnIngressInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AuthorizeClientVpnIngressInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *AuthorizeClientVpnIngressInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "AuthorizeClientVpnIngressInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.TargetNetworkCidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetNetworkCidr"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAccessGroupId sets the AccessGroupId field's value.
+func (s *AuthorizeClientVpnIngressInput) SetAccessGroupId(v string) *AuthorizeClientVpnIngressInput {
+ s.AccessGroupId = &v
+ return s
+}
+
+// SetAuthorizeAllGroups sets the AuthorizeAllGroups field's value.
+func (s *AuthorizeClientVpnIngressInput) SetAuthorizeAllGroups(v bool) *AuthorizeClientVpnIngressInput {
+ s.AuthorizeAllGroups = &v
+ return s
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *AuthorizeClientVpnIngressInput) SetClientToken(v string) *AuthorizeClientVpnIngressInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *AuthorizeClientVpnIngressInput) SetClientVpnEndpointId(v string) *AuthorizeClientVpnIngressInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *AuthorizeClientVpnIngressInput) SetDescription(v string) *AuthorizeClientVpnIngressInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *AuthorizeClientVpnIngressInput) SetDryRun(v bool) *AuthorizeClientVpnIngressInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTargetNetworkCidr sets the TargetNetworkCidr field's value.
+func (s *AuthorizeClientVpnIngressInput) SetTargetNetworkCidr(v string) *AuthorizeClientVpnIngressInput {
+ s.TargetNetworkCidr = &v
+ return s
+}
+
+type AuthorizeClientVpnIngressOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current state of the authorization rule.
+ Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s AuthorizeClientVpnIngressOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s AuthorizeClientVpnIngressOutput) GoString() string {
+ return s.String()
+}
+
+// SetStatus sets the Status field's value.
+func (s *AuthorizeClientVpnIngressOutput) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizeClientVpnIngressOutput {
+ s.Status = v
+ return s
+}
+
type AuthorizeSecurityGroupEgressInput struct {
_ struct{} `type:"structure"`
@@ -24880,8 +34970,8 @@ type AuthorizeSecurityGroupEgressInput struct {
// GroupId is a required field
GroupId *string `locationName:"groupId" type:"string" required:"true"`
- // One or more 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 sets of IP permissions. You can't specify a destination security group
+ // and a CIDR IP address range in the same set of permissions.
IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"`
// Not supported. Use a set of IP permissions to specify the protocol name or
@@ -24991,12 +35081,15 @@ func (s AuthorizeSecurityGroupEgressOutput) GoString() string {
return s.String()
}
-// Contains the parameters for AuthorizeSecurityGroupIngress.
type AuthorizeSecurityGroupIngressInput struct {
_ struct{} `type:"structure"`
- // The CIDR IPv4 address range. You can't specify this parameter when specifying
- // a source security group.
+ // 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.
+ //
+ // Alternatively, use a set of IP permissions to specify multiple rules and
+ // a description for the rule.
CidrIp *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -25005,9 +35098,12 @@ type AuthorizeSecurityGroupIngressInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The start of port range for the TCP and UDP protocols, or an ICMP/ICMPv6
- // type number. For the ICMP/ICMPv6 type number, use -1 to specify all types.
- // If you specify all ICMP/ICMPv6 types, you must specify all codes.
+ // The start of port range for the TCP and UDP protocols, or an ICMP type number.
+ // For the ICMP type number, use -1 to specify all types. If you specify all
+ // ICMP types, you must specify all codes.
+ //
+ // Alternatively, use a set of IP permissions to specify multiple rules and
+ // a description for the rule.
FromPort *int64 `type:"integer"`
// The ID of the security group. You must specify either the security group
@@ -25019,16 +35115,18 @@ type AuthorizeSecurityGroupIngressInput struct {
// either the security group ID or the security group name in the request.
GroupName *string `type:"string"`
- // One or more sets of IP permissions. Can be used to specify multiple rules
- // in a single command.
+ // The sets of IP permissions.
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)).
- // (VPC only) Use -1 to specify all protocols. If you specify -1, or a protocol
- // number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is
- // allowed, regardless of any ports you specify. For tcp, udp, and icmp, you
- // must specify a port range. For protocol 58 (ICMPv6), you can optionally specify
- // a port range; if you don't, traffic for all types and codes is allowed.
+ // To specify icmpv6, use a set of IP permissions.
+ //
+ // [VPC only] 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.
+ //
+ // Alternatively, use a set of IP permissions to specify multiple rules and
+ // a description for the rule.
IpProtocol *string `type:"string"`
// [EC2-Classic, default VPC] The name of the source security group. You can't
@@ -25040,17 +35138,20 @@ type AuthorizeSecurityGroupIngressInput struct {
// be in the same VPC.
SourceSecurityGroupName *string `type:"string"`
- // [EC2-Classic] The AWS account ID for the source security group, if the source
- // security group is in a different account. You can't specify this parameter
+ // [nondefault VPC] The AWS 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.
SourceSecurityGroupOwnerId *string `type:"string"`
- // The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code
- // number. For the ICMP/ICMPv6 code number, use -1 to specify all codes. If
- // you specify all ICMP/ICMPv6 types, you must specify all codes.
+ // The end of port range for the TCP and UDP protocols, or an ICMP code number.
+ // For the ICMP code number, use -1 to specify all codes. If you specify all
+ // ICMP types, you must specify all codes.
+ //
+ // Alternatively, use a set of IP permissions to specify multiple rules and
+ // a description for the rule.
ToPort *int64 `type:"integer"`
}
@@ -25145,12 +35246,15 @@ type AvailabilityZone struct {
// Any messages about the Availability Zone.
Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"`
- // The name of the region.
+ // The name of the Region.
RegionName *string `locationName:"regionName" type:"string"`
// The state of the Availability Zone.
State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"`
+ // The ID of the Availability Zone.
+ ZoneId *string `locationName:"zoneId" type:"string"`
+
// The name of the Availability Zone.
ZoneName *string `locationName:"zoneName" type:"string"`
}
@@ -25183,6 +35287,12 @@ func (s *AvailabilityZone) SetState(v string) *AvailabilityZone {
return s
}
+// SetZoneId sets the ZoneId field's value.
+func (s *AvailabilityZone) SetZoneId(v string) *AvailabilityZone {
+ s.ZoneId = &v
+ return s
+}
+
// SetZoneName sets the ZoneName field's value.
func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone {
s.ZoneName = &v
@@ -25217,7 +35327,7 @@ func (s *AvailabilityZoneMessage) SetMessage(v string) *AvailabilityZoneMessage
type AvailableCapacity struct {
_ struct{} `type:"structure"`
- // The total number of instances that the Dedicated Host supports.
+ // The total number of instances supported by the Dedicated Host.
AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" locationNameList:"item" type:"list"`
// The number of vCPUs available on the Dedicated Host.
@@ -25286,10 +35396,13 @@ type BlockDeviceMapping struct {
// The virtual device name (ephemeralN). Instance store volumes are numbered
// starting from 0. An instance type with 2 available instance store volumes
- // can specify mappings for ephemeral0 and ephemeral1.The number of available
+ // can specify mappings for ephemeral0 and ephemeral1. The number of available
// instance store volumes depends on the instance type. After you connect to
// the instance, you must mount the volume.
//
+ // NVMe instance store volumes are automatically enumerated and assigned a device
+ // name. Including them in your block device mapping has no effect.
+ //
// Constraints: For M3 instances, you must specify instance store volumes in
// the block device mapping for the instance. When you launch an M3 instance,
// we ignore any instance store volumes specified in the block device mapping
@@ -25445,7 +35558,7 @@ type BundleTask struct {
Progress *string `locationName:"progress" type:"string"`
// The time this task started.
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// The state of the task.
State *string `locationName:"state" type:"string" enum:"BundleTaskState"`
@@ -25454,7 +35567,7 @@ type BundleTask struct {
Storage *Storage `locationName:"storage" type:"structure"`
// The time of the most recent update for the task.
- UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"`
+ UpdateTime *time.Time `locationName:"updateTime" type:"timestamp"`
}
// String returns the string representation
@@ -25548,6 +35661,59 @@ func (s *BundleTaskError) SetMessage(v string) *BundleTaskError {
return s
}
+// Information about an address range that is provisioned for use with your
+// AWS resources through bring your own IP addresses (BYOIP).
+type ByoipCidr struct {
+ _ struct{} `type:"structure"`
+
+ // The public IPv4 address range, in CIDR notation.
+ Cidr *string `locationName:"cidr" type:"string"`
+
+ // The description of the address range.
+ Description *string `locationName:"description" type:"string"`
+
+ // The state of the address pool.
+ State *string `locationName:"state" type:"string" enum:"ByoipCidrState"`
+
+ // Upon success, contains the ID of the address pool. Otherwise, contains an
+ // error message.
+ StatusMessage *string `locationName:"statusMessage" type:"string"`
+}
+
+// String returns the string representation
+func (s ByoipCidr) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ByoipCidr) GoString() string {
+ return s.String()
+}
+
+// SetCidr sets the Cidr field's value.
+func (s *ByoipCidr) SetCidr(v string) *ByoipCidr {
+ s.Cidr = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *ByoipCidr) SetDescription(v string) *ByoipCidr {
+ s.Description = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *ByoipCidr) SetState(v string) *ByoipCidr {
+ s.State = &v
+ return s
+}
+
+// SetStatusMessage sets the StatusMessage field's value.
+func (s *ByoipCidr) SetStatusMessage(v string) *ByoipCidr {
+ s.StatusMessage = &v
+ return s
+}
+
// Contains the parameters for CancelBundleTask.
type CancelBundleTaskInput struct {
_ struct{} `type:"structure"`
@@ -25623,7 +35789,79 @@ func (s *CancelBundleTaskOutput) SetBundleTask(v *BundleTask) *CancelBundleTaskO
return s
}
-// Contains the parameters for CancelConversionTask.
+type CancelCapacityReservationInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Capacity Reservation to be cancelled.
+ //
+ // CapacityReservationId is a required field
+ CapacityReservationId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s CancelCapacityReservationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CancelCapacityReservationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CancelCapacityReservationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CancelCapacityReservationInput"}
+ if s.CapacityReservationId == nil {
+ invalidParams.Add(request.NewErrParamRequired("CapacityReservationId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *CancelCapacityReservationInput) SetCapacityReservationId(v string) *CancelCapacityReservationInput {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CancelCapacityReservationInput) SetDryRun(v bool) *CancelCapacityReservationInput {
+ s.DryRun = &v
+ return s
+}
+
+type CancelCapacityReservationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation
+func (s CancelCapacityReservationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CancelCapacityReservationOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *CancelCapacityReservationOutput) SetReturn(v bool) *CancelCapacityReservationOutput {
+ s.Return = &v
+ return s
+}
+
type CancelConversionTaskInput struct {
_ struct{} `type:"structure"`
@@ -25697,7 +35935,6 @@ func (s CancelConversionTaskOutput) GoString() string {
return s.String()
}
-// Contains the parameters for CancelExportTask.
type CancelExportTaskInput struct {
_ struct{} `type:"structure"`
@@ -25750,7 +35987,6 @@ func (s CancelExportTaskOutput) GoString() string {
return s.String()
}
-// Contains the parameters for CancelImportTask.
type CancelImportTaskInput struct {
_ struct{} `type:"structure"`
@@ -25795,7 +36031,6 @@ func (s *CancelImportTaskInput) SetImportTaskId(v string) *CancelImportTaskInput
return s
}
-// Contains the output for CancelImportTask.
type CancelImportTaskOutput struct {
_ struct{} `type:"structure"`
@@ -25905,14 +36140,10 @@ type CancelSpotFleetRequestsError struct {
_ struct{} `type:"structure"`
// The error code.
- //
- // Code is a required field
- Code *string `locationName:"code" type:"string" required:"true" enum:"CancelBatchErrorCode"`
+ Code *string `locationName:"code" type:"string" enum:"CancelBatchErrorCode"`
// The description for the error code.
- //
- // Message is a required field
- Message *string `locationName:"message" type:"string" required:"true"`
+ Message *string `locationName:"message" type:"string"`
}
// String returns the string representation
@@ -25942,14 +36173,10 @@ type CancelSpotFleetRequestsErrorItem struct {
_ struct{} `type:"structure"`
// The error.
- //
- // Error is a required field
- Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure" required:"true"`
+ Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
}
// String returns the string representation
@@ -26078,19 +36305,13 @@ type CancelSpotFleetRequestsSuccessItem struct {
_ struct{} `type:"structure"`
// The current state of the Spot Fleet request.
- //
- // CurrentSpotFleetRequestState is a required field
- CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"`
+ CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" enum:"BatchState"`
// The previous state of the Spot Fleet request.
- //
- // PreviousSpotFleetRequestState is a required field
- PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" required:"true" enum:"BatchState"`
+ PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" enum:"BatchState"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
}
// String returns the string representation
@@ -26229,6 +36450,480 @@ func (s *CancelledSpotInstanceRequest) SetState(v string) *CancelledSpotInstance
return s
}
+// Describes a Capacity Reservation.
+type CapacityReservation struct {
+ _ struct{} `type:"structure"`
+
+ // The Availability Zone in which the capacity is reserved.
+ AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
+
+ AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"`
+
+ // The remaining capacity. Indicates the number of instances that can be launched
+ // in the Capacity Reservation.
+ AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"`
+
+ CapacityReservationArn *string `locationName:"capacityReservationArn" type:"string"`
+
+ // The ID of the Capacity Reservation.
+ CapacityReservationId *string `locationName:"capacityReservationId" type:"string"`
+
+ // The date and time at which the Capacity Reservation was created.
+ CreateDate *time.Time `locationName:"createDate" type:"timestamp"`
+
+ // Indicates whether the Capacity Reservation supports EBS-optimized instances.
+ // This optimization provides dedicated throughput to Amazon EBS and an optimized
+ // configuration stack to provide optimal I/O performance. This optimization
+ // isn't available with all instance types. Additional usage charges apply when
+ // using an EBS- optimized instance.
+ EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"`
+
+ // The date and time at which the Capacity Reservation expires. When a Capacity
+ // Reservation expires, the reserved capacity is released and you can no longer
+ // launch instances into it. The Capacity Reservation's state changes to expired
+ // when it reaches its end date and time.
+ EndDate *time.Time `locationName:"endDate" type:"timestamp"`
+
+ // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation
+ // can have one of the following end types:
+ //
+ // * unlimited - The Capacity Reservation remains active until you explicitly
+ // cancel it.
+ //
+ // * limited - The Capacity Reservation expires automatically at a specified
+ // date and time.
+ EndDateType *string `locationName:"endDateType" type:"string" enum:"EndDateType"`
+
+ // Indicates whether the Capacity Reservation supports instances with temporary,
+ // block-level storage.
+ EphemeralStorage *bool `locationName:"ephemeralStorage" type:"boolean"`
+
+ // Indicates the type of instance launches that the Capacity Reservation accepts.
+ // The options include:
+ //
+ // * open - The Capacity Reservation accepts all instances that have matching
+ // attributes (instance type, platform, and Availability Zone). Instances
+ // that have matching attributes launch into the Capacity Reservation automatically
+ // without specifying any additional parameters.
+ //
+ // * targeted - The Capacity Reservation only accepts instances that have
+ // matching attributes (instance type, platform, and Availability Zone),
+ // and explicitly target the Capacity Reservation. This ensures that only
+ // permitted instances can use the reserved capacity.
+ InstanceMatchCriteria *string `locationName:"instanceMatchCriteria" type:"string" enum:"InstanceMatchCriteria"`
+
+ // The type of operating system for which the Capacity Reservation reserves
+ // capacity.
+ InstancePlatform *string `locationName:"instancePlatform" type:"string" enum:"CapacityReservationInstancePlatform"`
+
+ // The type of instance for which the Capacity Reservation reserves capacity.
+ InstanceType *string `locationName:"instanceType" type:"string"`
+
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // The current state of the Capacity Reservation. A Capacity Reservation can
+ // be in one of the following states:
+ //
+ // * active - The Capacity Reservation is active and the capacity is available
+ // for your use.
+ //
+ // * cancelled - The Capacity Reservation expired automatically at the date
+ // and time specified in your request. The reserved capacity is no longer
+ // available for your use.
+ //
+ // * expired - The Capacity Reservation was manually cancelled. The reserved
+ // capacity is no longer available for your use.
+ //
+ // * pending - The Capacity Reservation request was successful but the capacity
+ // provisioning is still pending.
+ //
+ // * failed - The Capacity Reservation request has failed. A request might
+ // fail due to invalid request parameters, capacity constraints, or instance
+ // limit constraints. Failed requests are retained for 60 minutes.
+ State *string `locationName:"state" type:"string" enum:"CapacityReservationState"`
+
+ // Any tags assigned to the Capacity Reservation.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation
+ // can have one of the following tenancy settings:
+ //
+ // * default - The Capacity Reservation is created on hardware that is shared
+ // with other AWS accounts.
+ //
+ // * dedicated - The Capacity Reservation is created on single-tenant hardware
+ // that is dedicated to a single AWS account.
+ Tenancy *string `locationName:"tenancy" type:"string" enum:"CapacityReservationTenancy"`
+
+ // The number of instances for which the Capacity Reservation reserves capacity.
+ TotalInstanceCount *int64 `locationName:"totalInstanceCount" type:"integer"`
+}
+
+// String returns the string representation
+func (s CapacityReservation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CapacityReservation) GoString() string {
+ return s.String()
+}
+
+// SetAvailabilityZone sets the AvailabilityZone field's value.
+func (s *CapacityReservation) SetAvailabilityZone(v string) *CapacityReservation {
+ s.AvailabilityZone = &v
+ return s
+}
+
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *CapacityReservation) SetAvailabilityZoneId(v string) *CapacityReservation {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
+// SetAvailableInstanceCount sets the AvailableInstanceCount field's value.
+func (s *CapacityReservation) SetAvailableInstanceCount(v int64) *CapacityReservation {
+ s.AvailableInstanceCount = &v
+ return s
+}
+
+// SetCapacityReservationArn sets the CapacityReservationArn field's value.
+func (s *CapacityReservation) SetCapacityReservationArn(v string) *CapacityReservation {
+ s.CapacityReservationArn = &v
+ return s
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *CapacityReservation) SetCapacityReservationId(v string) *CapacityReservation {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetCreateDate sets the CreateDate field's value.
+func (s *CapacityReservation) SetCreateDate(v time.Time) *CapacityReservation {
+ s.CreateDate = &v
+ return s
+}
+
+// SetEbsOptimized sets the EbsOptimized field's value.
+func (s *CapacityReservation) SetEbsOptimized(v bool) *CapacityReservation {
+ s.EbsOptimized = &v
+ return s
+}
+
+// SetEndDate sets the EndDate field's value.
+func (s *CapacityReservation) SetEndDate(v time.Time) *CapacityReservation {
+ s.EndDate = &v
+ return s
+}
+
+// SetEndDateType sets the EndDateType field's value.
+func (s *CapacityReservation) SetEndDateType(v string) *CapacityReservation {
+ s.EndDateType = &v
+ return s
+}
+
+// SetEphemeralStorage sets the EphemeralStorage field's value.
+func (s *CapacityReservation) SetEphemeralStorage(v bool) *CapacityReservation {
+ s.EphemeralStorage = &v
+ return s
+}
+
+// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value.
+func (s *CapacityReservation) SetInstanceMatchCriteria(v string) *CapacityReservation {
+ s.InstanceMatchCriteria = &v
+ return s
+}
+
+// SetInstancePlatform sets the InstancePlatform field's value.
+func (s *CapacityReservation) SetInstancePlatform(v string) *CapacityReservation {
+ s.InstancePlatform = &v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *CapacityReservation) SetInstanceType(v string) *CapacityReservation {
+ s.InstanceType = &v
+ return s
+}
+
+// SetOwnerId sets the OwnerId field's value.
+func (s *CapacityReservation) SetOwnerId(v string) *CapacityReservation {
+ s.OwnerId = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *CapacityReservation) SetState(v string) *CapacityReservation {
+ s.State = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CapacityReservation) SetTags(v []*Tag) *CapacityReservation {
+ s.Tags = v
+ return s
+}
+
+// SetTenancy sets the Tenancy field's value.
+func (s *CapacityReservation) SetTenancy(v string) *CapacityReservation {
+ s.Tenancy = &v
+ return s
+}
+
+// SetTotalInstanceCount sets the TotalInstanceCount field's value.
+func (s *CapacityReservation) SetTotalInstanceCount(v int64) *CapacityReservation {
+ s.TotalInstanceCount = &v
+ return s
+}
+
+// Describes an instance's Capacity Reservation targeting option. You can specify
+// only one parameter at a time. If you specify CapacityReservationPreference
+// and CapacityReservationTarget, the request fails.
+//
+// Use the CapacityReservationPreference parameter to configure the instance
+// to run as an On-Demand Instance or to run in any open Capacity Reservation
+// that has matching attributes (instance type, platform, Availability Zone).
+// Use the CapacityReservationTarget parameter to explicitly target a specific
+// Capacity Reservation.
+type CapacityReservationSpecification struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates the instance's Capacity Reservation preferences. Possible preferences
+ // include:
+ //
+ // * open - The instance can run in any open Capacity Reservation that has
+ // matching attributes (instance type, platform, Availability Zone).
+ //
+ // * none - The instance avoids running in a Capacity Reservation even if
+ // one is available. The instance runs as an On-Demand Instance.
+ CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"`
+
+ // Information about the target Capacity Reservation.
+ CapacityReservationTarget *CapacityReservationTarget `type:"structure"`
+}
+
+// String returns the string representation
+func (s CapacityReservationSpecification) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CapacityReservationSpecification) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationPreference sets the CapacityReservationPreference field's value.
+func (s *CapacityReservationSpecification) SetCapacityReservationPreference(v string) *CapacityReservationSpecification {
+ s.CapacityReservationPreference = &v
+ return s
+}
+
+// SetCapacityReservationTarget sets the CapacityReservationTarget field's value.
+func (s *CapacityReservationSpecification) SetCapacityReservationTarget(v *CapacityReservationTarget) *CapacityReservationSpecification {
+ s.CapacityReservationTarget = v
+ return s
+}
+
+// Describes the instance's Capacity Reservation targeting preferences. The
+// action returns the capacityReservationPreference response element if the
+// instance is configured to run in On-Demand capacity, or if it is configured
+// in run in any open Capacity Reservation that has matching attributes (instance
+// type, platform, Availability Zone). The action returns the capacityReservationTarget
+// response element if the instance explicily targets a specific Capacity Reservation.
+type CapacityReservationSpecificationResponse struct {
+ _ struct{} `type:"structure"`
+
+ // Describes the instance's Capacity Reservation preferences. Possible preferences
+ // include:
+ //
+ // * open - The instance can run in any open Capacity Reservation that has
+ // matching attributes (instance type, platform, Availability Zone).
+ //
+ // * none - The instance avoids running in a Capacity Reservation even if
+ // one is available. The instance runs in On-Demand capacity.
+ CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"`
+
+ // Information about the targeted Capacity Reservation.
+ CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" type:"structure"`
+}
+
+// String returns the string representation
+func (s CapacityReservationSpecificationResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CapacityReservationSpecificationResponse) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationPreference sets the CapacityReservationPreference field's value.
+func (s *CapacityReservationSpecificationResponse) SetCapacityReservationPreference(v string) *CapacityReservationSpecificationResponse {
+ s.CapacityReservationPreference = &v
+ return s
+}
+
+// SetCapacityReservationTarget sets the CapacityReservationTarget field's value.
+func (s *CapacityReservationSpecificationResponse) SetCapacityReservationTarget(v *CapacityReservationTargetResponse) *CapacityReservationSpecificationResponse {
+ s.CapacityReservationTarget = v
+ return s
+}
+
+// Describes a target Capacity Reservation.
+type CapacityReservationTarget struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Capacity Reservation.
+ CapacityReservationId *string `type:"string"`
+}
+
+// String returns the string representation
+func (s CapacityReservationTarget) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CapacityReservationTarget) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *CapacityReservationTarget) SetCapacityReservationId(v string) *CapacityReservationTarget {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// Describes a target Capacity Reservation.
+type CapacityReservationTargetResponse struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Capacity Reservation.
+ CapacityReservationId *string `locationName:"capacityReservationId" type:"string"`
+}
+
+// String returns the string representation
+func (s CapacityReservationTargetResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CapacityReservationTargetResponse) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *CapacityReservationTargetResponse) SetCapacityReservationId(v string) *CapacityReservationTargetResponse {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// Information about the client certificate used for authentication.
+type CertificateAuthentication struct {
+ _ struct{} `type:"structure"`
+
+ // The ARN of the client certificate.
+ ClientRootCertificateChain *string `locationName:"clientRootCertificateChain" type:"string"`
+}
+
+// String returns the string representation
+func (s CertificateAuthentication) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CertificateAuthentication) GoString() string {
+ return s.String()
+}
+
+// SetClientRootCertificateChain sets the ClientRootCertificateChain field's value.
+func (s *CertificateAuthentication) SetClientRootCertificateChain(v string) *CertificateAuthentication {
+ s.ClientRootCertificateChain = &v
+ return s
+}
+
+// Information about the client certificate to be used for authentication.
+type CertificateAuthenticationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The ARN of the client certificate. The certificate must be signed by a certificate
+ // authority (CA) and it must be provisioned in AWS Certificate Manager (ACM).
+ ClientRootCertificateChainArn *string `type:"string"`
+}
+
+// String returns the string representation
+func (s CertificateAuthenticationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CertificateAuthenticationRequest) GoString() string {
+ return s.String()
+}
+
+// SetClientRootCertificateChainArn sets the ClientRootCertificateChainArn field's value.
+func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v string) *CertificateAuthenticationRequest {
+ s.ClientRootCertificateChainArn = &v
+ return s
+}
+
+// Provides authorization for Amazon to bring a specific IP address range to
+// a specific AWS account using bring your own IP addresses (BYOIP). For more
+// information, see Prepare to Bring Your Address Range to Your AWS Account
+// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip)
+// in the Amazon Elastic Compute Cloud User Guide.
+type CidrAuthorizationContext struct {
+ _ struct{} `type:"structure"`
+
+ // The plain-text authorization message for the prefix and account.
+ //
+ // Message is a required field
+ Message *string `type:"string" required:"true"`
+
+ // The signed authorization message for the prefix and account.
+ //
+ // Signature is a required field
+ Signature *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CidrAuthorizationContext) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CidrAuthorizationContext) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CidrAuthorizationContext) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CidrAuthorizationContext"}
+ if s.Message == nil {
+ invalidParams.Add(request.NewErrParamRequired("Message"))
+ }
+ if s.Signature == nil {
+ invalidParams.Add(request.NewErrParamRequired("Signature"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetMessage sets the Message field's value.
+func (s *CidrAuthorizationContext) SetMessage(v string) *CidrAuthorizationContext {
+ s.Message = &v
+ return s
+}
+
+// SetSignature sets the Signature field's value.
+func (s *CidrAuthorizationContext) SetSignature(v string) *CidrAuthorizationContext {
+ s.Signature = &v
+ return s
+}
+
// Describes an IPv4 CIDR block.
type CidrBlock struct {
_ struct{} `type:"structure"`
@@ -26342,9 +37037,7 @@ type ClassicLoadBalancer struct {
_ struct{} `type:"structure"`
// The name of the load balancer.
- //
- // Name is a required field
- Name *string `locationName:"name" type:"string" required:"true"`
+ Name *string `locationName:"name" type:"string"`
}
// String returns the string representation
@@ -26357,19 +37050,6 @@ func (s ClassicLoadBalancer) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *ClassicLoadBalancer) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancer"}
- if s.Name == nil {
- invalidParams.Add(request.NewErrParamRequired("Name"))
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetName sets the Name field's value.
func (s *ClassicLoadBalancer) SetName(v string) *ClassicLoadBalancer {
s.Name = &v
@@ -26382,9 +37062,7 @@ type ClassicLoadBalancersConfig struct {
_ struct{} `type:"structure"`
// One or more Classic Load Balancers.
- //
- // ClassicLoadBalancers is a required field
- ClassicLoadBalancers []*ClassicLoadBalancer `locationName:"classicLoadBalancers" locationNameList:"item" min:"1" type:"list" required:"true"`
+ ClassicLoadBalancers []*ClassicLoadBalancer `locationName:"classicLoadBalancers" locationNameList:"item" min:"1" type:"list"`
}
// String returns the string representation
@@ -26400,22 +37078,9 @@ func (s ClassicLoadBalancersConfig) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *ClassicLoadBalancersConfig) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancersConfig"}
- if s.ClassicLoadBalancers == nil {
- invalidParams.Add(request.NewErrParamRequired("ClassicLoadBalancers"))
- }
if s.ClassicLoadBalancers != nil && len(s.ClassicLoadBalancers) < 1 {
invalidParams.Add(request.NewErrParamMinLen("ClassicLoadBalancers", 1))
}
- if s.ClassicLoadBalancers != nil {
- for i, v := range s.ClassicLoadBalancers {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ClassicLoadBalancers", i), err.(request.ErrInvalidParams))
- }
- }
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -26429,6 +37094,40 @@ func (s *ClassicLoadBalancersConfig) SetClassicLoadBalancers(v []*ClassicLoadBal
return s
}
+// Describes the state of a client certificate revocation list.
+type ClientCertificateRevocationListStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the client certificate revocation list.
+ Code *string `locationName:"code" type:"string" enum:"ClientCertificateRevocationListStatusCode"`
+
+ // A message about the status of the client certificate revocation list, if
+ // applicable.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientCertificateRevocationListStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientCertificateRevocationListStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *ClientCertificateRevocationListStatus) SetCode(v string) *ClientCertificateRevocationListStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *ClientCertificateRevocationListStatus) SetMessage(v string) *ClientCertificateRevocationListStatus {
+ s.Message = &v
+ return s
+}
+
// Describes the client-specific data.
type ClientData struct {
_ struct{} `type:"structure"`
@@ -26437,13 +37136,13 @@ type ClientData struct {
Comment *string `type:"string"`
// The time that the disk upload ends.
- UploadEnd *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ UploadEnd *time.Time `type:"timestamp"`
// The size of the uploaded disk image, in GiB.
UploadSize *float64 `type:"double"`
// The time that the disk upload starts.
- UploadStart *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ UploadStart *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -26480,7 +37179,629 @@ func (s *ClientData) SetUploadStart(v time.Time) *ClientData {
return s
}
-// Contains the parameters for ConfirmProductInstance.
+// Describes the authentication methods used by a Client VPN endpoint. Client
+// VPN supports Active Directory and mutual authentication. For more information,
+// see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication)
+// in the AWS Client VPN Administrator Guide.
+type ClientVpnAuthentication struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Active Directory, if applicable.
+ ActiveDirectory *DirectoryServiceAuthentication `locationName:"activeDirectory" type:"structure"`
+
+ // Information about the authentication certificates, if applicable.
+ MutualAuthentication *CertificateAuthentication `locationName:"mutualAuthentication" type:"structure"`
+
+ // The authentication type used.
+ Type *string `locationName:"type" type:"string" enum:"ClientVpnAuthenticationType"`
+}
+
+// String returns the string representation
+func (s ClientVpnAuthentication) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnAuthentication) GoString() string {
+ return s.String()
+}
+
+// SetActiveDirectory sets the ActiveDirectory field's value.
+func (s *ClientVpnAuthentication) SetActiveDirectory(v *DirectoryServiceAuthentication) *ClientVpnAuthentication {
+ s.ActiveDirectory = v
+ return s
+}
+
+// SetMutualAuthentication sets the MutualAuthentication field's value.
+func (s *ClientVpnAuthentication) SetMutualAuthentication(v *CertificateAuthentication) *ClientVpnAuthentication {
+ s.MutualAuthentication = v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *ClientVpnAuthentication) SetType(v string) *ClientVpnAuthentication {
+ s.Type = &v
+ return s
+}
+
+// Describes the authentication method to be used by a Client VPN endpoint.
+// Client VPN supports Active Directory and mutual authentication. For more
+// information, see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication)
+// in the AWS Client VPN Administrator Guide.
+type ClientVpnAuthenticationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Active Directory to be used, if applicable. You must
+ // provide this information if Type is directory-service-authentication.
+ ActiveDirectory *DirectoryServiceAuthenticationRequest `type:"structure"`
+
+ // Information about the authentication certificates to be used, if applicable.
+ // You must provide this information if Type is certificate-authentication.
+ MutualAuthentication *CertificateAuthenticationRequest `type:"structure"`
+
+ // The type of client authentication to be used. Specify certificate-authentication
+ // to use certificate-based authentication, or directory-service-authentication
+ // to use Active Directory authentication.
+ Type *string `type:"string" enum:"ClientVpnAuthenticationType"`
+}
+
+// String returns the string representation
+func (s ClientVpnAuthenticationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnAuthenticationRequest) GoString() string {
+ return s.String()
+}
+
+// SetActiveDirectory sets the ActiveDirectory field's value.
+func (s *ClientVpnAuthenticationRequest) SetActiveDirectory(v *DirectoryServiceAuthenticationRequest) *ClientVpnAuthenticationRequest {
+ s.ActiveDirectory = v
+ return s
+}
+
+// SetMutualAuthentication sets the MutualAuthentication field's value.
+func (s *ClientVpnAuthenticationRequest) SetMutualAuthentication(v *CertificateAuthenticationRequest) *ClientVpnAuthenticationRequest {
+ s.MutualAuthentication = v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *ClientVpnAuthenticationRequest) SetType(v string) *ClientVpnAuthenticationRequest {
+ s.Type = &v
+ return s
+}
+
+// Describes the state of an authorization rule.
+type ClientVpnAuthorizationRuleStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the authorization rule.
+ Code *string `locationName:"code" type:"string" enum:"ClientVpnAuthorizationRuleStatusCode"`
+
+ // A message about the status of the authorization rule, if applicable.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnAuthorizationRuleStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnAuthorizationRuleStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *ClientVpnAuthorizationRuleStatus) SetCode(v string) *ClientVpnAuthorizationRuleStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *ClientVpnAuthorizationRuleStatus) SetMessage(v string) *ClientVpnAuthorizationRuleStatus {
+ s.Message = &v
+ return s
+}
+
+// Describes a client connection.
+type ClientVpnConnection struct {
+ _ struct{} `type:"structure"`
+
+ // The IP address of the client.
+ ClientIp *string `locationName:"clientIp" type:"string"`
+
+ // The ID of the Client VPN endpoint to which the client is connected.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // The common name associated with the client. This is either the name of the
+ // client certificate, or the Active Directory user name.
+ CommonName *string `locationName:"commonName" type:"string"`
+
+ // The date and time the client connection was terminated.
+ ConnectionEndTime *string `locationName:"connectionEndTime" type:"string"`
+
+ // The date and time the client connection was established.
+ ConnectionEstablishedTime *string `locationName:"connectionEstablishedTime" type:"string"`
+
+ // The ID of the client connection.
+ ConnectionId *string `locationName:"connectionId" type:"string"`
+
+ // The number of bytes received by the client.
+ EgressBytes *string `locationName:"egressBytes" type:"string"`
+
+ // The number of packets received by the client.
+ EgressPackets *string `locationName:"egressPackets" type:"string"`
+
+ // The number of bytes sent by the client.
+ IngressBytes *string `locationName:"ingressBytes" type:"string"`
+
+ // The number of packets sent by the client.
+ IngressPackets *string `locationName:"ingressPackets" type:"string"`
+
+ // The current state of the client connection.
+ Status *ClientVpnConnectionStatus `locationName:"status" type:"structure"`
+
+ // The current date and time.
+ Timestamp *string `locationName:"timestamp" type:"string"`
+
+ // The username of the client who established the client connection. This information
+ // is only provided if Active Directory client authentication is used.
+ Username *string `locationName:"username" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnConnection) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnConnection) GoString() string {
+ return s.String()
+}
+
+// SetClientIp sets the ClientIp field's value.
+func (s *ClientVpnConnection) SetClientIp(v string) *ClientVpnConnection {
+ s.ClientIp = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ClientVpnConnection) SetClientVpnEndpointId(v string) *ClientVpnConnection {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetCommonName sets the CommonName field's value.
+func (s *ClientVpnConnection) SetCommonName(v string) *ClientVpnConnection {
+ s.CommonName = &v
+ return s
+}
+
+// SetConnectionEndTime sets the ConnectionEndTime field's value.
+func (s *ClientVpnConnection) SetConnectionEndTime(v string) *ClientVpnConnection {
+ s.ConnectionEndTime = &v
+ return s
+}
+
+// SetConnectionEstablishedTime sets the ConnectionEstablishedTime field's value.
+func (s *ClientVpnConnection) SetConnectionEstablishedTime(v string) *ClientVpnConnection {
+ s.ConnectionEstablishedTime = &v
+ return s
+}
+
+// SetConnectionId sets the ConnectionId field's value.
+func (s *ClientVpnConnection) SetConnectionId(v string) *ClientVpnConnection {
+ s.ConnectionId = &v
+ return s
+}
+
+// SetEgressBytes sets the EgressBytes field's value.
+func (s *ClientVpnConnection) SetEgressBytes(v string) *ClientVpnConnection {
+ s.EgressBytes = &v
+ return s
+}
+
+// SetEgressPackets sets the EgressPackets field's value.
+func (s *ClientVpnConnection) SetEgressPackets(v string) *ClientVpnConnection {
+ s.EgressPackets = &v
+ return s
+}
+
+// SetIngressBytes sets the IngressBytes field's value.
+func (s *ClientVpnConnection) SetIngressBytes(v string) *ClientVpnConnection {
+ s.IngressBytes = &v
+ return s
+}
+
+// SetIngressPackets sets the IngressPackets field's value.
+func (s *ClientVpnConnection) SetIngressPackets(v string) *ClientVpnConnection {
+ s.IngressPackets = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *ClientVpnConnection) SetStatus(v *ClientVpnConnectionStatus) *ClientVpnConnection {
+ s.Status = v
+ return s
+}
+
+// SetTimestamp sets the Timestamp field's value.
+func (s *ClientVpnConnection) SetTimestamp(v string) *ClientVpnConnection {
+ s.Timestamp = &v
+ return s
+}
+
+// SetUsername sets the Username field's value.
+func (s *ClientVpnConnection) SetUsername(v string) *ClientVpnConnection {
+ s.Username = &v
+ return s
+}
+
+// Describes the status of a client connection.
+type ClientVpnConnectionStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the client connection.
+ Code *string `locationName:"code" type:"string" enum:"ClientVpnConnectionStatusCode"`
+
+ // A message about the status of the client connection, if applicable.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnConnectionStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnConnectionStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *ClientVpnConnectionStatus) SetCode(v string) *ClientVpnConnectionStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *ClientVpnConnectionStatus) SetMessage(v string) *ClientVpnConnectionStatus {
+ s.Message = &v
+ return s
+}
+
+// Describes a Client VPN endpoint.
+type ClientVpnEndpoint struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the associated target networks. A target network is a subnet
+ // in a VPC.
+ //
+ // Deprecated: This property is deprecated. To view the target networks associated with a Client VPN endpoint, call DescribeClientVpnTargetNetworks and inspect the clientVpnTargetNetworks response element.
+ AssociatedTargetNetworks []*AssociatedTargetNetwork `locationName:"associatedTargetNetwork" locationNameList:"item" deprecated:"true" type:"list"`
+
+ // Information about the authentication method used by the Client VPN endpoint.
+ AuthenticationOptions []*ClientVpnAuthentication `locationName:"authenticationOptions" locationNameList:"item" type:"list"`
+
+ // The IPv4 address range, in CIDR notation, from which client IP addresses
+ // are assigned.
+ ClientCidrBlock *string `locationName:"clientCidrBlock" type:"string"`
+
+ // The ID of the Client VPN endpoint.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // Information about the client connection logging options for the Client VPN
+ // endpoint.
+ ConnectionLogOptions *ConnectionLogResponseOptions `locationName:"connectionLogOptions" type:"structure"`
+
+ // The date and time the Client VPN endpoint was created.
+ CreationTime *string `locationName:"creationTime" type:"string"`
+
+ // The date and time the Client VPN endpoint was deleted, if applicable.
+ DeletionTime *string `locationName:"deletionTime" type:"string"`
+
+ // A brief description of the endpoint.
+ Description *string `locationName:"description" type:"string"`
+
+ // The DNS name to be used by clients when connecting to the Client VPN endpoint.
+ DnsName *string `locationName:"dnsName" type:"string"`
+
+ // Information about the DNS servers to be used for DNS resolution.
+ DnsServers []*string `locationName:"dnsServer" locationNameList:"item" type:"list"`
+
+ // The ARN of the server certificate.
+ ServerCertificateArn *string `locationName:"serverCertificateArn" type:"string"`
+
+ // Indicates whether split-tunnel is enabled in the AWS Client VPN endpoint
+ // endpoint.
+ //
+ // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client
+ // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html)
+ // in the AWS Client VPN Administrator Guide.
+ SplitTunnel *bool `locationName:"splitTunnel" type:"boolean"`
+
+ // The current state of the Client VPN endpoint.
+ Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"`
+
+ // Any tags assigned to the Client VPN endpoint.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The transport protocol used by the Client VPN endpoint.
+ TransportProtocol *string `locationName:"transportProtocol" type:"string" enum:"TransportProtocol"`
+
+ // The protocol used by the VPN session.
+ VpnProtocol *string `locationName:"vpnProtocol" type:"string" enum:"VpnProtocol"`
+}
+
+// String returns the string representation
+func (s ClientVpnEndpoint) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnEndpoint) GoString() string {
+ return s.String()
+}
+
+// SetAssociatedTargetNetworks sets the AssociatedTargetNetworks field's value.
+func (s *ClientVpnEndpoint) SetAssociatedTargetNetworks(v []*AssociatedTargetNetwork) *ClientVpnEndpoint {
+ s.AssociatedTargetNetworks = v
+ return s
+}
+
+// SetAuthenticationOptions sets the AuthenticationOptions field's value.
+func (s *ClientVpnEndpoint) SetAuthenticationOptions(v []*ClientVpnAuthentication) *ClientVpnEndpoint {
+ s.AuthenticationOptions = v
+ return s
+}
+
+// SetClientCidrBlock sets the ClientCidrBlock field's value.
+func (s *ClientVpnEndpoint) SetClientCidrBlock(v string) *ClientVpnEndpoint {
+ s.ClientCidrBlock = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ClientVpnEndpoint) SetClientVpnEndpointId(v string) *ClientVpnEndpoint {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetConnectionLogOptions sets the ConnectionLogOptions field's value.
+func (s *ClientVpnEndpoint) SetConnectionLogOptions(v *ConnectionLogResponseOptions) *ClientVpnEndpoint {
+ s.ConnectionLogOptions = v
+ return s
+}
+
+// SetCreationTime sets the CreationTime field's value.
+func (s *ClientVpnEndpoint) SetCreationTime(v string) *ClientVpnEndpoint {
+ s.CreationTime = &v
+ return s
+}
+
+// SetDeletionTime sets the DeletionTime field's value.
+func (s *ClientVpnEndpoint) SetDeletionTime(v string) *ClientVpnEndpoint {
+ s.DeletionTime = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *ClientVpnEndpoint) SetDescription(v string) *ClientVpnEndpoint {
+ s.Description = &v
+ return s
+}
+
+// SetDnsName sets the DnsName field's value.
+func (s *ClientVpnEndpoint) SetDnsName(v string) *ClientVpnEndpoint {
+ s.DnsName = &v
+ return s
+}
+
+// SetDnsServers sets the DnsServers field's value.
+func (s *ClientVpnEndpoint) SetDnsServers(v []*string) *ClientVpnEndpoint {
+ s.DnsServers = v
+ return s
+}
+
+// SetServerCertificateArn sets the ServerCertificateArn field's value.
+func (s *ClientVpnEndpoint) SetServerCertificateArn(v string) *ClientVpnEndpoint {
+ s.ServerCertificateArn = &v
+ return s
+}
+
+// SetSplitTunnel sets the SplitTunnel field's value.
+func (s *ClientVpnEndpoint) SetSplitTunnel(v bool) *ClientVpnEndpoint {
+ s.SplitTunnel = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *ClientVpnEndpoint) SetStatus(v *ClientVpnEndpointStatus) *ClientVpnEndpoint {
+ s.Status = v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *ClientVpnEndpoint) SetTags(v []*Tag) *ClientVpnEndpoint {
+ s.Tags = v
+ return s
+}
+
+// SetTransportProtocol sets the TransportProtocol field's value.
+func (s *ClientVpnEndpoint) SetTransportProtocol(v string) *ClientVpnEndpoint {
+ s.TransportProtocol = &v
+ return s
+}
+
+// SetVpnProtocol sets the VpnProtocol field's value.
+func (s *ClientVpnEndpoint) SetVpnProtocol(v string) *ClientVpnEndpoint {
+ s.VpnProtocol = &v
+ return s
+}
+
+// Describes the state of a Client VPN endpoint.
+type ClientVpnEndpointStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the Client VPN endpoint. Possible states include:
+ //
+ // * pending-associate - The Client VPN endpoint has been created but no
+ // target networks have been associated. The Client VPN endpoint cannot accept
+ // connections.
+ //
+ // * available - The Client VPN endpoint has been created and a target network
+ // has been associated. The Client VPN endpoint can accept connections.
+ //
+ // * deleting - The Client VPN endpoint is being deleted. The Client VPN
+ // endpoint cannot accept connections.
+ //
+ // * deleted - The Client VPN endpoint has been deleted. The Client VPN endpoint
+ // cannot accept connections.
+ Code *string `locationName:"code" type:"string" enum:"ClientVpnEndpointStatusCode"`
+
+ // A message about the status of the Client VPN endpoint.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnEndpointStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnEndpointStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *ClientVpnEndpointStatus) SetCode(v string) *ClientVpnEndpointStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *ClientVpnEndpointStatus) SetMessage(v string) *ClientVpnEndpointStatus {
+ s.Message = &v
+ return s
+}
+
+// Information about a Client VPN endpoint route.
+type ClientVpnRoute struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint with which the route is associated.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // A brief description of the route.
+ Description *string `locationName:"description" type:"string"`
+
+ // The IPv4 address range, in CIDR notation, of the route destination.
+ DestinationCidr *string `locationName:"destinationCidr" type:"string"`
+
+ // Indicates how the route was associated with the Client VPN endpoint. associate
+ // indicates that the route was automatically added when the target network
+ // was associated with the Client VPN endpoint. add-route indicates that the
+ // route was manually added using the CreateClientVpnRoute action.
+ Origin *string `locationName:"origin" type:"string"`
+
+ // The current state of the route.
+ Status *ClientVpnRouteStatus `locationName:"status" type:"structure"`
+
+ // The ID of the subnet through which traffic is routed.
+ TargetSubnet *string `locationName:"targetSubnet" type:"string"`
+
+ // The route type.
+ Type *string `locationName:"type" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnRoute) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnRoute) GoString() string {
+ return s.String()
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ClientVpnRoute) SetClientVpnEndpointId(v string) *ClientVpnRoute {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *ClientVpnRoute) SetDescription(v string) *ClientVpnRoute {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidr sets the DestinationCidr field's value.
+func (s *ClientVpnRoute) SetDestinationCidr(v string) *ClientVpnRoute {
+ s.DestinationCidr = &v
+ return s
+}
+
+// SetOrigin sets the Origin field's value.
+func (s *ClientVpnRoute) SetOrigin(v string) *ClientVpnRoute {
+ s.Origin = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *ClientVpnRoute) SetStatus(v *ClientVpnRouteStatus) *ClientVpnRoute {
+ s.Status = v
+ return s
+}
+
+// SetTargetSubnet sets the TargetSubnet field's value.
+func (s *ClientVpnRoute) SetTargetSubnet(v string) *ClientVpnRoute {
+ s.TargetSubnet = &v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *ClientVpnRoute) SetType(v string) *ClientVpnRoute {
+ s.Type = &v
+ return s
+}
+
+// Describes the state of a Client VPN endpoint route.
+type ClientVpnRouteStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the Client VPN endpoint route.
+ Code *string `locationName:"code" type:"string" enum:"ClientVpnRouteStatusCode"`
+
+ // A message about the status of the Client VPN endpoint route, if applicable.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s ClientVpnRouteStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClientVpnRouteStatus) GoString() string {
+ return s.String()
+}
+
+// SetCode sets the Code field's value.
+func (s *ClientVpnRouteStatus) SetCode(v string) *ClientVpnRouteStatus {
+ s.Code = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *ClientVpnRouteStatus) SetMessage(v string) *ClientVpnRouteStatus {
+ s.Message = &v
+ return s
+}
+
type ConfirmProductInstanceInput struct {
_ struct{} `type:"structure"`
@@ -26545,7 +37866,6 @@ func (s *ConfirmProductInstanceInput) SetProductCode(v string) *ConfirmProductIn
return s
}
-// Contains the output of ConfirmProductInstance.
type ConfirmProductInstanceOutput struct {
_ struct{} `type:"structure"`
@@ -26580,6 +37900,95 @@ func (s *ConfirmProductInstanceOutput) SetReturn(v bool) *ConfirmProductInstance
return s
}
+// Describes the client connection logging options for the Client VPN endpoint.
+type ConnectionLogOptions struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the CloudWatch Logs log group.
+ CloudwatchLogGroup *string `type:"string"`
+
+ // The name of the CloudWatch Logs log stream to which the connection data is
+ // published.
+ CloudwatchLogStream *string `type:"string"`
+
+ // Indicates whether connection logging is enabled.
+ Enabled *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ConnectionLogOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ConnectionLogOptions) GoString() string {
+ return s.String()
+}
+
+// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value.
+func (s *ConnectionLogOptions) SetCloudwatchLogGroup(v string) *ConnectionLogOptions {
+ s.CloudwatchLogGroup = &v
+ return s
+}
+
+// SetCloudwatchLogStream sets the CloudwatchLogStream field's value.
+func (s *ConnectionLogOptions) SetCloudwatchLogStream(v string) *ConnectionLogOptions {
+ s.CloudwatchLogStream = &v
+ return s
+}
+
+// SetEnabled sets the Enabled field's value.
+func (s *ConnectionLogOptions) SetEnabled(v bool) *ConnectionLogOptions {
+ s.Enabled = &v
+ return s
+}
+
+// Information about the client connection logging options for a Client VPN
+// endpoint.
+type ConnectionLogResponseOptions struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the Amazon CloudWatch Logs log group to which connection logging
+ // data is published.
+ CloudwatchLogGroup *string `type:"string"`
+
+ // The name of the Amazon CloudWatch Logs log stream to which connection logging
+ // data is published.
+ CloudwatchLogStream *string `type:"string"`
+
+ // Indicates whether client connection logging is enabled for the Client VPN
+ // endpoint.
+ Enabled *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ConnectionLogResponseOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ConnectionLogResponseOptions) GoString() string {
+ return s.String()
+}
+
+// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value.
+func (s *ConnectionLogResponseOptions) SetCloudwatchLogGroup(v string) *ConnectionLogResponseOptions {
+ s.CloudwatchLogGroup = &v
+ return s
+}
+
+// SetCloudwatchLogStream sets the CloudwatchLogStream field's value.
+func (s *ConnectionLogResponseOptions) SetCloudwatchLogStream(v string) *ConnectionLogResponseOptions {
+ s.CloudwatchLogStream = &v
+ return s
+}
+
+// SetEnabled sets the Enabled field's value.
+func (s *ConnectionLogResponseOptions) SetEnabled(v bool) *ConnectionLogResponseOptions {
+ s.Enabled = &v
+ return s
+}
+
// Describes a connection notification for a VPC endpoint or VPC endpoint service.
type ConnectionNotification struct {
_ struct{} `type:"structure"`
@@ -26744,7 +38153,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 (http://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/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// The description for the new AFI.
@@ -26764,7 +38173,7 @@ type CopyFpgaImageInput struct {
// SourceFpgaImageId is a required field
SourceFpgaImageId *string `type:"string" required:"true"`
- // The region that contains the source AFI.
+ // The Region that contains the source AFI.
//
// SourceRegion is a required field
SourceRegion *string `type:"string" required:"true"`
@@ -26860,11 +38269,11 @@ type CopyImageInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure idempotency of the
- // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
+ // request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
// in the Amazon Elastic Compute Cloud User Guide.
ClientToken *string `type:"string"`
- // A description for the new AMI in the destination region.
+ // A description for the new AMI in the destination Region.
Description *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -26874,9 +38283,11 @@ type CopyImageInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// Specifies whether the destination snapshots of the copied image should be
- // encrypted. The default CMK for EBS is used unless a non-default AWS Key Management
- // Service (AWS KMS) CMK is specified with KmsKeyId. For more information, see
- // Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
+ // encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot
+ // create an unencrypted copy of an encrypted snapshot. The default CMK for
+ // EBS is used unless you specify a non-default AWS Key Management Service (AWS
+ // KMS) CMK using KmsKeyId. 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.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
@@ -26886,31 +38297,26 @@ type CopyImageInput struct {
// the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted
// flag must also be set.
//
- // The CMK identifier may be provided in any of the following formats:
+ // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
+ // or alias ARN. When using an alias name, prefix it with "alias/". For example:
//
- // * Key ID
+ // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
//
- // * Key alias, in the form alias/ExampleAlias
+ // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
//
- // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed
- // by the region of the CMK, the AWS account ID of the CMK owner, the key
- // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
- //
- //
- // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace,
- // followed by the region of the CMK, the AWS account ID of the CMK owner,
- // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ // * Alias name: alias/ExampleAlias
//
+ // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
//
// AWS parses KmsKeyId asynchronously, meaning that the action you call may
// appear to complete even though you provided an invalid identifier. This action
// will eventually report failure.
//
- // The specified CMK must exist in the region that the snapshot is being copied
+ // The specified CMK must exist in the Region that the snapshot is being copied
// to.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
- // The name of the new AMI in the destination region.
+ // The name of the new AMI in the destination Region.
//
// Name is a required field
Name *string `type:"string" required:"true"`
@@ -26920,7 +38326,7 @@ type CopyImageInput struct {
// SourceImageId is a required field
SourceImageId *string `type:"string" required:"true"`
- // The name of the region that contains the AMI to copy.
+ // The name of the Region that contains the AMI to copy.
//
// SourceRegion is a required field
SourceRegion *string `type:"string" required:"true"`
@@ -27034,14 +38440,14 @@ type CopySnapshotInput struct {
// A description for the EBS snapshot.
Description *string `type:"string"`
- // The destination region to use in the PresignedUrl parameter of a snapshot
+ // The destination Region to use in the PresignedUrl parameter of a snapshot
// copy operation. This parameter is only valid for specifying the destination
- // region in a PresignedUrl parameter, where it is required.
+ // Region in a PresignedUrl parameter, where it is required.
//
- // CopySnapshot sends the snapshot copy to the regional endpoint that you send
- // the HTTP request to, such as ec2.us-east-1.amazonaws.com (in the AWS CLI,
- // this is specified with the --region parameter or the default region in your
- // AWS configuration file).
+ // The snapshot copy is sent to the regional endpoint that you sent the HTTP
+ // request to (for example, ec2.us-east-1.amazonaws.com). With the AWS CLI,
+ // this is specified using the --region parameter or the default Region in your
+ // AWS configuration file.
DestinationRegion *string `locationName:"destinationRegion" type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -27050,58 +38456,50 @@ type CopySnapshotInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // Specifies whether the destination snapshot should be encrypted. You can encrypt
- // a copy of an unencrypted snapshot using this flag, but you cannot use it
- // to create an unencrypted copy from an encrypted snapshot. Your default CMK
- // for EBS is used unless a non-default AWS Key Management Service (AWS KMS)
- // CMK is specified with KmsKeyId. For more information, see Amazon EBS Encryption
- // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in
- // the Amazon Elastic Compute Cloud User Guide.
+ // To encrypt a copy of an unencrypted snapshot if encryption by default is
+ // 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.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
- // An identifier for the AWS Key Management Service (AWS KMS) customer master
- // key (CMK) to use when creating the encrypted volume. This parameter is only
- // required if you want to use a non-default CMK; if this parameter is not specified,
- // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted
- // flag must also be set.
+ // The identifier of the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified,
+ // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted
+ // state must be true.
//
- // The CMK identifier may be provided in any of the following formats:
+ // You can specify the CMK using any of the following:
//
- // * Key ID
+ // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.
//
- // * Key alias
+ // * Key alias. For example, alias/ExampleAlias.
//
- // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed
- // by the region of the CMK, the AWS account ID of the CMK owner, the key
- // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
+ // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
//
+ // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
//
- // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace,
- // followed by the region of the CMK, the AWS account ID of the CMK owner,
- // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
- //
- //
- // AWS parses KmsKeyId asynchronously, meaning that the action you call may
- // appear to complete even though you provided an invalid identifier. The action
- // will eventually fail.
+ // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID,
+ // alias, or ARN that is not valid, the action can appear to complete, but eventually
+ // fails.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
// When you copy an encrypted source snapshot using the Amazon EC2 Query API,
// you must supply a pre-signed URL. This parameter is optional for unencrypted
- // snapshots. For more information, see Query Requests (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html).
+ // snapshots. For more information, see Query Requests (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html).
//
// The PresignedUrl should use the snapshot source endpoint, the CopySnapshot
// action, and include the SourceRegion, SourceSnapshotId, and DestinationRegion
// parameters. The PresignedUrl must be signed using AWS Signature Version 4.
// Because EBS snapshots are stored in Amazon S3, the signing algorithm for
// this parameter uses the same logic that is described in Authenticating Requests
- // by Using Query Parameters (AWS Signature Version 4) (http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
+ // by Using Query Parameters (AWS 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.
PresignedUrl *string `locationName:"presignedUrl" type:"string"`
- // The ID of the region that contains the snapshot to be copied.
+ // The ID of the Region that contains the snapshot to be copied.
//
// SourceRegion is a required field
SourceRegion *string `type:"string" required:"true"`
@@ -27279,6 +38677,592 @@ func (s *CpuOptionsRequest) SetThreadsPerCore(v int64) *CpuOptionsRequest {
return s
}
+type CreateCapacityReservationInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Availability Zone in which to create the Capacity Reservation.
+ AvailabilityZone *string `type:"string"`
+
+ AvailabilityZoneId *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).
+ //
+ // Constraint: Maximum 64 ASCII characters.
+ ClientToken *string `type:"string"`
+
+ // 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"`
+
+ // Indicates whether the Capacity Reservation supports EBS-optimized instances.
+ // This optimization provides dedicated throughput to Amazon EBS and an optimized
+ // configuration stack to provide optimal I/O performance. This optimization
+ // isn't available with all instance types. Additional usage charges apply when
+ // using an EBS- optimized instance.
+ EbsOptimized *bool `type:"boolean"`
+
+ // The date and time at which the Capacity Reservation expires. When a Capacity
+ // Reservation expires, the reserved capacity is released and you can no longer
+ // launch instances into it. The Capacity Reservation's state changes to expired
+ // when it reaches its end date and time.
+ //
+ // You must provide an EndDate value if EndDateType is limited. Omit EndDate
+ // if EndDateType is unlimited.
+ //
+ // If the EndDateType is limited, the Capacity Reservation is cancelled within
+ // an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55,
+ // the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55
+ // on 5/31/2019.
+ EndDate *time.Time `type:"timestamp"`
+
+ // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation
+ // can have one of the following end types:
+ //
+ // * unlimited - The Capacity Reservation remains active until you explicitly
+ // cancel it. Do not provide an EndDate if the EndDateType is unlimited.
+ //
+ // * limited - The Capacity Reservation expires automatically at a specified
+ // date and time. You must provide an EndDate value if the EndDateType value
+ // is limited.
+ EndDateType *string `type:"string" enum:"EndDateType"`
+
+ // Indicates whether the Capacity Reservation supports instances with temporary,
+ // block-level storage.
+ EphemeralStorage *bool `type:"boolean"`
+
+ // The number of instances for which to reserve capacity.
+ //
+ // InstanceCount is a required field
+ InstanceCount *int64 `type:"integer" required:"true"`
+
+ // Indicates the type of instance launches that the Capacity Reservation accepts.
+ // The options include:
+ //
+ // * open - The Capacity Reservation automatically matches all instances
+ // that have matching attributes (instance type, platform, and Availability
+ // Zone). Instances that have matching attributes run in the Capacity Reservation
+ // automatically without specifying any additional parameters.
+ //
+ // * targeted - The Capacity Reservation only accepts instances that have
+ // matching attributes (instance type, platform, and Availability Zone),
+ // and explicitly target the Capacity Reservation. This ensures that only
+ // permitted instances can use the reserved capacity.
+ //
+ // Default: open
+ InstanceMatchCriteria *string `type:"string" enum:"InstanceMatchCriteria"`
+
+ // The type of operating system for which to reserve capacity.
+ //
+ // InstancePlatform is a required field
+ InstancePlatform *string `type:"string" required:"true" enum:"CapacityReservationInstancePlatform"`
+
+ // The instance type for which to reserve capacity. 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.
+ //
+ // InstanceType is a required field
+ InstanceType *string `type:"string" required:"true"`
+
+ // The tags to apply to the Capacity Reservation during launch.
+ TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"`
+
+ // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation
+ // can have one of the following tenancy settings:
+ //
+ // * default - The Capacity Reservation is created on hardware that is shared
+ // with other AWS accounts.
+ //
+ // * dedicated - The Capacity Reservation is created on single-tenant hardware
+ // that is dedicated to a single AWS account.
+ Tenancy *string `type:"string" enum:"CapacityReservationTenancy"`
+}
+
+// String returns the string representation
+func (s CreateCapacityReservationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateCapacityReservationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateCapacityReservationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateCapacityReservationInput"}
+ if s.InstanceCount == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceCount"))
+ }
+ if s.InstancePlatform == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstancePlatform"))
+ }
+ if s.InstanceType == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceType"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAvailabilityZone sets the AvailabilityZone field's value.
+func (s *CreateCapacityReservationInput) SetAvailabilityZone(v string) *CreateCapacityReservationInput {
+ s.AvailabilityZone = &v
+ return s
+}
+
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *CreateCapacityReservationInput) SetAvailabilityZoneId(v string) *CreateCapacityReservationInput {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateCapacityReservationInput) SetClientToken(v string) *CreateCapacityReservationInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateCapacityReservationInput) SetDryRun(v bool) *CreateCapacityReservationInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetEbsOptimized sets the EbsOptimized field's value.
+func (s *CreateCapacityReservationInput) SetEbsOptimized(v bool) *CreateCapacityReservationInput {
+ s.EbsOptimized = &v
+ return s
+}
+
+// SetEndDate sets the EndDate field's value.
+func (s *CreateCapacityReservationInput) SetEndDate(v time.Time) *CreateCapacityReservationInput {
+ s.EndDate = &v
+ return s
+}
+
+// SetEndDateType sets the EndDateType field's value.
+func (s *CreateCapacityReservationInput) SetEndDateType(v string) *CreateCapacityReservationInput {
+ s.EndDateType = &v
+ return s
+}
+
+// SetEphemeralStorage sets the EphemeralStorage field's value.
+func (s *CreateCapacityReservationInput) SetEphemeralStorage(v bool) *CreateCapacityReservationInput {
+ s.EphemeralStorage = &v
+ return s
+}
+
+// SetInstanceCount sets the InstanceCount field's value.
+func (s *CreateCapacityReservationInput) SetInstanceCount(v int64) *CreateCapacityReservationInput {
+ s.InstanceCount = &v
+ return s
+}
+
+// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value.
+func (s *CreateCapacityReservationInput) SetInstanceMatchCriteria(v string) *CreateCapacityReservationInput {
+ s.InstanceMatchCriteria = &v
+ return s
+}
+
+// SetInstancePlatform sets the InstancePlatform field's value.
+func (s *CreateCapacityReservationInput) SetInstancePlatform(v string) *CreateCapacityReservationInput {
+ s.InstancePlatform = &v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *CreateCapacityReservationInput) SetInstanceType(v string) *CreateCapacityReservationInput {
+ s.InstanceType = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateCapacityReservationInput) SetTagSpecifications(v []*TagSpecification) *CreateCapacityReservationInput {
+ s.TagSpecifications = v
+ return s
+}
+
+// SetTenancy sets the Tenancy field's value.
+func (s *CreateCapacityReservationInput) SetTenancy(v string) *CreateCapacityReservationInput {
+ s.Tenancy = &v
+ return s
+}
+
+type CreateCapacityReservationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Capacity Reservation.
+ CapacityReservation *CapacityReservation `locationName:"capacityReservation" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateCapacityReservationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateCapacityReservationOutput) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservation sets the CapacityReservation field's value.
+func (s *CreateCapacityReservationOutput) SetCapacityReservation(v *CapacityReservation) *CreateCapacityReservationOutput {
+ s.CapacityReservation = v
+ return s
+}
+
+type CreateClientVpnEndpointInput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the authentication method to be used to authenticate clients.
+ //
+ // AuthenticationOptions is a required field
+ AuthenticationOptions []*ClientVpnAuthenticationRequest `locationName:"Authentication" type:"list" required:"true"`
+
+ // The IPv4 address range, in CIDR notation, from which to assign client IP
+ // addresses. The address range cannot overlap with the local CIDR of the VPC
+ // in which the associated subnet is located, or the routes that you add manually.
+ // The address range cannot be changed after the Client VPN endpoint has been
+ // created. The CIDR block should be /22 or greater.
+ //
+ // ClientCidrBlock is a required field
+ ClientCidrBlock *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/APIReference/Run_Instance_Idempotency.html).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // Information about the client connection logging options.
+ //
+ // If you enable client connection logging, data about client connections is
+ // sent to a Cloudwatch Logs log stream. The following information is logged:
+ //
+ // * Client connection requests
+ //
+ // * Client connection results (successful and unsuccessful)
+ //
+ // * Reasons for unsuccessful client connection requests
+ //
+ // * Client connection termination time
+ //
+ // ConnectionLogOptions is a required field
+ ConnectionLogOptions *ConnectionLogOptions `type:"structure" required:"true"`
+
+ // A brief description of the Client VPN endpoint.
+ Description *string `type:"string"`
+
+ // Information about the DNS servers to be used for DNS resolution. A Client
+ // VPN endpoint can have up to two DNS servers. If no DNS server is specified,
+ // the DNS address of the VPC that is to be associated with Client VPN endpoint
+ // is used as the DNS server.
+ DnsServers []*string `locationNameList:"item" type:"list"`
+
+ // 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 ARN of the server certificate. For more information, see the AWS Certificate
+ // Manager User Guide (https://docs.aws.amazon.com/acm/latest/userguide/).
+ //
+ // ServerCertificateArn is a required field
+ ServerCertificateArn *string `type:"string" required:"true"`
+
+ // Indicates whether split-tunnel is enabled on the AWS Client VPN endpoint
+ // endpoint.
+ //
+ // By default, split-tunnel on a VPN endpoint is disabled.
+ //
+ // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client
+ // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html)
+ // in the AWS Client VPN Administrator Guide.
+ SplitTunnel *bool `type:"boolean"`
+
+ // The tags to apply to the Client VPN endpoint during creation.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+
+ // The transport protocol to be used by the VPN session.
+ //
+ // Default value: udp
+ TransportProtocol *string `type:"string" enum:"TransportProtocol"`
+}
+
+// String returns the string representation
+func (s CreateClientVpnEndpointInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateClientVpnEndpointInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateClientVpnEndpointInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnEndpointInput"}
+ if s.AuthenticationOptions == nil {
+ invalidParams.Add(request.NewErrParamRequired("AuthenticationOptions"))
+ }
+ if s.ClientCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientCidrBlock"))
+ }
+ if s.ConnectionLogOptions == nil {
+ invalidParams.Add(request.NewErrParamRequired("ConnectionLogOptions"))
+ }
+ if s.ServerCertificateArn == nil {
+ invalidParams.Add(request.NewErrParamRequired("ServerCertificateArn"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAuthenticationOptions sets the AuthenticationOptions field's value.
+func (s *CreateClientVpnEndpointInput) SetAuthenticationOptions(v []*ClientVpnAuthenticationRequest) *CreateClientVpnEndpointInput {
+ s.AuthenticationOptions = v
+ return s
+}
+
+// SetClientCidrBlock sets the ClientCidrBlock field's value.
+func (s *CreateClientVpnEndpointInput) SetClientCidrBlock(v string) *CreateClientVpnEndpointInput {
+ s.ClientCidrBlock = &v
+ return s
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateClientVpnEndpointInput) SetClientToken(v string) *CreateClientVpnEndpointInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetConnectionLogOptions sets the ConnectionLogOptions field's value.
+func (s *CreateClientVpnEndpointInput) SetConnectionLogOptions(v *ConnectionLogOptions) *CreateClientVpnEndpointInput {
+ s.ConnectionLogOptions = v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateClientVpnEndpointInput) SetDescription(v string) *CreateClientVpnEndpointInput {
+ s.Description = &v
+ return s
+}
+
+// SetDnsServers sets the DnsServers field's value.
+func (s *CreateClientVpnEndpointInput) SetDnsServers(v []*string) *CreateClientVpnEndpointInput {
+ s.DnsServers = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateClientVpnEndpointInput) SetDryRun(v bool) *CreateClientVpnEndpointInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetServerCertificateArn sets the ServerCertificateArn field's value.
+func (s *CreateClientVpnEndpointInput) SetServerCertificateArn(v string) *CreateClientVpnEndpointInput {
+ s.ServerCertificateArn = &v
+ return s
+}
+
+// SetSplitTunnel sets the SplitTunnel field's value.
+func (s *CreateClientVpnEndpointInput) SetSplitTunnel(v bool) *CreateClientVpnEndpointInput {
+ s.SplitTunnel = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateClientVpnEndpointInput) SetTagSpecifications(v []*TagSpecification) *CreateClientVpnEndpointInput {
+ s.TagSpecifications = v
+ return s
+}
+
+// SetTransportProtocol sets the TransportProtocol field's value.
+func (s *CreateClientVpnEndpointInput) SetTransportProtocol(v string) *CreateClientVpnEndpointInput {
+ s.TransportProtocol = &v
+ return s
+}
+
+type CreateClientVpnEndpointOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // The DNS name to be used by clients when establishing their VPN session.
+ DnsName *string `locationName:"dnsName" type:"string"`
+
+ // The current state of the Client VPN endpoint.
+ Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateClientVpnEndpointOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateClientVpnEndpointOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *CreateClientVpnEndpointOutput) SetClientVpnEndpointId(v string) *CreateClientVpnEndpointOutput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDnsName sets the DnsName field's value.
+func (s *CreateClientVpnEndpointOutput) SetDnsName(v string) *CreateClientVpnEndpointOutput {
+ s.DnsName = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *CreateClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *CreateClientVpnEndpointOutput {
+ s.Status = v
+ return s
+}
+
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The ID of the Client VPN endpoint to which to add the route.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"true"`
+
+ // A brief description of the route.
+ Description *string `type:"string"`
+
+ // The IPv4 address range, in CIDR notation, of the route destination. For example:
+ //
+ // * To add a route for Internet access, enter 0.0.0.0/0
+ //
+ // * To add a route for a peered VPC, enter the peered VPC's IPv4 CIDR range
+ //
+ // * To add a route for an on-premises network, enter the AWS Site-to-Site
+ // VPN connection's IPv4 CIDR range
+ //
+ // Route address ranges cannot overlap with the CIDR range specified for client
+ // allocation.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the subnet through which you want to route traffic. The specified
+ // subnet must be an existing target network of the Client VPN endpoint.
+ //
+ // TargetVpcSubnetId is a required field
+ TargetVpcSubnetId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateClientVpnRouteInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateClientVpnRouteInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateClientVpnRouteInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnRouteInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+ if s.TargetVpcSubnetId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetVpcSubnetId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateClientVpnRouteInput) SetClientToken(v string) *CreateClientVpnRouteInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *CreateClientVpnRouteInput) SetClientVpnEndpointId(v string) *CreateClientVpnRouteInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateClientVpnRouteInput) SetDescription(v string) *CreateClientVpnRouteInput {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *CreateClientVpnRouteInput) SetDestinationCidrBlock(v string) *CreateClientVpnRouteInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateClientVpnRouteInput) SetDryRun(v bool) *CreateClientVpnRouteInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value.
+func (s *CreateClientVpnRouteInput) SetTargetVpcSubnetId(v string) *CreateClientVpnRouteInput {
+ s.TargetVpcSubnetId = &v
+ return s
+}
+
+type CreateClientVpnRouteOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current state of the route.
+ Status *ClientVpnRouteStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateClientVpnRouteOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateClientVpnRouteOutput) GoString() string {
+ return s.String()
+}
+
+// SetStatus sets the Status field's value.
+func (s *CreateClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *CreateClientVpnRouteOutput {
+ s.Status = v
+ return s
+}
+
// Contains the parameters for CreateCustomerGateway.
type CreateCustomerGatewayInput struct {
_ struct{} `type:"structure"`
@@ -27458,7 +39442,6 @@ func (s *CreateDefaultSubnetOutput) SetSubnet(v *Subnet) *CreateDefaultSubnetOut
return s
}
-// Contains the parameters for CreateDefaultVpc.
type CreateDefaultVpcInput struct {
_ struct{} `type:"structure"`
@@ -27485,7 +39468,6 @@ func (s *CreateDefaultVpcInput) SetDryRun(v bool) *CreateDefaultVpcInput {
return s
}
-// Contains the output of CreateDefaultVpc.
type CreateDefaultVpcOutput struct {
_ struct{} `type:"structure"`
@@ -27509,7 +39491,6 @@ func (s *CreateDefaultVpcOutput) SetVpc(v *Vpc) *CreateDefaultVpcOutput {
return s
}
-// Contains the parameters for CreateDhcpOptions.
type CreateDhcpOptionsInput struct {
_ struct{} `type:"structure"`
@@ -27560,7 +39541,6 @@ func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput {
return s
}
-// Contains the output of CreateDhcpOptions.
type CreateDhcpOptionsOutput struct {
_ struct{} `type:"structure"`
@@ -27587,8 +39567,8 @@ func (s *CreateDhcpOptionsOutput) SetDhcpOptions(v *DhcpOptions) *CreateDhcpOpti
type CreateEgressOnlyInternetGatewayInput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // 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).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -27597,7 +39577,7 @@ type CreateEgressOnlyInternetGatewayInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // The ID of the VPC for which to create the egress-only Internet gateway.
+ // The ID of the VPC for which to create the egress-only internet gateway.
//
// VpcId is a required field
VpcId *string `type:"string" required:"true"`
@@ -27647,11 +39627,11 @@ func (s *CreateEgressOnlyInternetGatewayInput) SetVpcId(v string) *CreateEgressO
type CreateEgressOnlyInternetGatewayOutput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request.
+ // Unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request.
ClientToken *string `locationName:"clientToken" type:"string"`
- // Information about the egress-only Internet gateway.
+ // Information about the egress-only internet gateway.
EgressOnlyInternetGateway *EgressOnlyInternetGateway `locationName:"egressOnlyInternetGateway" type:"structure"`
}
@@ -27677,11 +39657,67 @@ func (s *CreateEgressOnlyInternetGatewayOutput) SetEgressOnlyInternetGateway(v *
return s
}
+// Describes the instances that could not be launched by the fleet.
+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).
+ 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 ee Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html).
+ ErrorMessage *string `locationName:"errorMessage" type:"string"`
+
+ // The launch templates and overrides that were used for launching the instances.
+ // Any parameters that you specify in the Overrides override the same parameters
+ // in the launch template.
+ LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"`
+
+ // Indicates if the instance that could not be launched was a Spot Instance
+ // or On-Demand Instance.
+ Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"`
+}
+
+// String returns the string representation
+func (s CreateFleetError) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateFleetError) GoString() string {
+ return s.String()
+}
+
+// SetErrorCode sets the ErrorCode field's value.
+func (s *CreateFleetError) SetErrorCode(v string) *CreateFleetError {
+ s.ErrorCode = &v
+ return s
+}
+
+// SetErrorMessage sets the ErrorMessage field's value.
+func (s *CreateFleetError) SetErrorMessage(v string) *CreateFleetError {
+ s.ErrorMessage = &v
+ return s
+}
+
+// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value.
+func (s *CreateFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetError {
+ s.LaunchTemplateAndOverrides = v
+ return s
+}
+
+// SetLifecycle sets the Lifecycle field's value.
+func (s *CreateFleetError) SetLifecycle(v string) *CreateFleetError {
+ s.Lifecycle = &v
+ return s
+}
+
type CreateFleetInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -27700,18 +39736,22 @@ type CreateFleetInput struct {
// LaunchTemplateConfigs is a required field
LaunchTemplateConfigs []*FleetLaunchTemplateConfigRequest `locationNameList:"item" type:"list" required:"true"`
+ // Describes the configuration of On-Demand Instances in an EC2 Fleet.
+ OnDemandOptions *OnDemandOptionsRequest `type:"structure"`
+
// Indicates whether EC2 Fleet should replace unhealthy instances.
ReplaceUnhealthyInstances *bool `type:"boolean"`
- // Includes SpotAllocationStrategy and SpotInstanceInterruptionBehavior inside
- // this structure.
+ // Describes the configuration of Spot Instances in an EC2 Fleet.
SpotOptions *SpotOptionsRequest `type:"structure"`
- // The tags for an EC2 Fleet resource.
+ // The key-value pair for tagging the EC2 Fleet request on creation. The value
+ // for ResourceType must be fleet, otherwise the fleet request fails. To tag
+ // instances at launch, specify the tags in the launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template).
+ // For information about tagging after launch, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources).
TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
- // The TotalTargetCapacity, OnDemandTargetCapacity, SpotTargetCapacity, and
- // DefaultCapacityType structure.
+ // The number of units to request.
//
// TargetCapacitySpecification is a required field
TargetCapacitySpecification *TargetCapacitySpecificationRequest `type:"structure" required:"true"`
@@ -27720,24 +39760,24 @@ type CreateFleetInput struct {
// expires.
TerminateInstancesWithExpiration *bool `type:"boolean"`
- // The type of request. Indicates whether the EC2 Fleet only requests the target
- // capacity, or also attempts to maintain it. If you request a certain target
- // capacity, EC2 Fleet only places the required requests. It does not attempt
- // to replenish instances if capacity is diminished, and does not submit requests
- // in alternative capacity pools if capacity is unavailable. To maintain a certain
- // target capacity, EC2 Fleet places the required requests to meet this target
- // capacity. It also automatically replenishes any interrupted Spot Instances.
- // Default: maintain.
+ // The type of the request. By default, the EC2 Fleet places an asynchronous
+ // request for your desired capacity, and maintains it by replenishing interrupted
+ // Spot Instances (maintain). A value of instant places a synchronous one-time
+ // request, and returns errors for any instances that could not be launched.
+ // A value of request places an asynchronous one-time request without maintaining
+ // capacity or submitting requests in alternative capacity pools if capacity
+ // is unavailable. For more information, see EC2 Fleet Request Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type)
+ // in the Amazon Elastic Compute Cloud User Guide.
Type *string `type:"string" enum:"FleetType"`
// The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// The default is to start fulfilling the request immediately.
- ValidFrom *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ ValidFrom *time.Time `type:"timestamp"`
// The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// At this point, no new EC2 Fleet requests are placed or able to fulfill the
- // request. The default end date is 7 days from the current date.
- ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ // request. If no value is specified, the request remains until you cancel it.
+ ValidUntil *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -27805,6 +39845,12 @@ func (s *CreateFleetInput) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConf
return s
}
+// SetOnDemandOptions sets the OnDemandOptions field's value.
+func (s *CreateFleetInput) SetOnDemandOptions(v *OnDemandOptionsRequest) *CreateFleetInput {
+ s.OnDemandOptions = v
+ return s
+}
+
// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value.
func (s *CreateFleetInput) SetReplaceUnhealthyInstances(v bool) *CreateFleetInput {
s.ReplaceUnhealthyInstances = &v
@@ -27853,11 +39899,82 @@ func (s *CreateFleetInput) SetValidUntil(v time.Time) *CreateFleetInput {
return s
}
+// Describes the instances that were launched by the fleet.
+type CreateFleetInstance struct {
+ _ struct{} `type:"structure"`
+
+ // The IDs of the instances.
+ InstanceIds []*string `locationName:"instanceIds" locationNameList:"item" type:"list"`
+
+ // The instance type.
+ InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
+
+ // The launch templates and overrides that were used for launching the instances.
+ // Any parameters that you specify in the Overrides override the same parameters
+ // in the launch template.
+ LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"`
+
+ // Indicates if the instance that was launched is a Spot Instance or On-Demand
+ // Instance.
+ Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"`
+
+ // The value is Windows for Windows instances; otherwise blank.
+ Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"`
+}
+
+// String returns the string representation
+func (s CreateFleetInstance) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateFleetInstance) GoString() string {
+ return s.String()
+}
+
+// SetInstanceIds sets the InstanceIds field's value.
+func (s *CreateFleetInstance) SetInstanceIds(v []*string) *CreateFleetInstance {
+ s.InstanceIds = v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *CreateFleetInstance) SetInstanceType(v string) *CreateFleetInstance {
+ s.InstanceType = &v
+ return s
+}
+
+// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value.
+func (s *CreateFleetInstance) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetInstance {
+ s.LaunchTemplateAndOverrides = v
+ return s
+}
+
+// SetLifecycle sets the Lifecycle field's value.
+func (s *CreateFleetInstance) SetLifecycle(v string) *CreateFleetInstance {
+ s.Lifecycle = &v
+ return s
+}
+
+// SetPlatform sets the Platform field's value.
+func (s *CreateFleetInstance) SetPlatform(v string) *CreateFleetInstance {
+ s.Platform = &v
+ return s
+}
+
type CreateFleetOutput struct {
_ struct{} `type:"structure"`
+ // Information about the instances that could not be launched by the fleet.
+ // Valid only when Type is set to instant.
+ Errors []*CreateFleetError `locationName:"errorSet" locationNameList:"item" type:"list"`
+
// The ID of the EC2 Fleet.
FleetId *string `locationName:"fleetId" type:"string"`
+
+ // Information about the instances that were launched by the fleet. Valid only
+ // when Type is set to instant.
+ Instances []*CreateFleetInstance `locationName:"fleetInstanceSet" locationNameList:"item" type:"list"`
}
// String returns the string representation
@@ -27870,44 +39987,94 @@ func (s CreateFleetOutput) GoString() string {
return s.String()
}
+// SetErrors sets the Errors field's value.
+func (s *CreateFleetOutput) SetErrors(v []*CreateFleetError) *CreateFleetOutput {
+ s.Errors = v
+ return s
+}
+
// SetFleetId sets the FleetId field's value.
func (s *CreateFleetOutput) SetFleetId(v string) *CreateFleetOutput {
s.FleetId = &v
return s
}
-// Contains the parameters for CreateFlowLogs.
+// SetInstances sets the Instances field's value.
+func (s *CreateFleetOutput) SetInstances(v []*CreateFleetInstance) *CreateFleetOutput {
+ s.Instances = v
+ return s
+}
+
type CreateFlowLogsInput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // 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).
ClientToken *string `type:"string"`
- // The ARN for the IAM role that's used to post flow logs to a CloudWatch Logs
- // log group.
+ // The ARN for the IAM role that permits Amazon EC2 to publish flow logs to
+ // a CloudWatch Logs log group in your account.
//
- // DeliverLogsPermissionArn is a required field
- DeliverLogsPermissionArn *string `type:"string" required:"true"`
+ // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn
+ // or LogGroupName.
+ DeliverLogsPermissionArn *string `type:"string"`
- // The name of the CloudWatch log group.
+ // 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"`
+
+ // Specifies the destination to which the flow log data is to be published.
+ // Flow log data can be published to a CloudWatch Logs log group or an Amazon
+ // S3 bucket. The value specified for this parameter depends on the value specified
+ // for LogDestinationType.
//
- // LogGroupName is a required field
- LogGroupName *string `type:"string" required:"true"`
+ // If LogDestinationType is not specified or cloud-watch-logs, specify the Amazon
+ // Resource Name (ARN) of the CloudWatch Logs log group.
+ //
+ // If LogDestinationType is s3, specify the ARN of the Amazon S3 bucket. You
+ // can also specify a subfolder in the bucket. To specify a subfolder in the
+ // bucket, use the following ARN format: bucket_ARN/subfolder_name/. For example,
+ // to specify a subfolder named my-logs in a bucket named my-bucket, use the
+ // following ARN: arn:aws:s3:::my-bucket/my-logs/. You cannot use AWSLogs as
+ // a subfolder name. This is a reserved term.
+ LogDestination *string `type:"string"`
- // One or more subnet, network interface, or VPC IDs.
+ // Specifies the type of destination to which the flow log data is to be published.
+ // Flow log data can be published to CloudWatch Logs or Amazon S3. To publish
+ // flow log data to CloudWatch Logs, specify cloud-watch-logs. To publish flow
+ // log data to Amazon S3, specify s3.
+ //
+ // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn
+ // or LogGroupName.
+ //
+ // Default: cloud-watch-logs
+ LogDestinationType *string `type:"string" enum:"LogDestinationType"`
+
+ // The name of a new or existing CloudWatch Logs log group where Amazon EC2
+ // publishes your flow logs.
+ //
+ // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn
+ // or LogGroupName.
+ LogGroupName *string `type:"string"`
+
+ // The ID of the subnet, network interface, or VPC for which you want to create
+ // a flow log.
//
// Constraints: Maximum of 1000 resources
//
// ResourceIds is a required field
ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"`
- // The type of resource on which to create the flow log.
+ // The type of resource for which to create the flow log. For example, if you
+ // specified a VPC ID for the ResourceId property, specify VPC for this property.
//
// ResourceType is a required field
ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"`
- // The type of traffic to log.
+ // The type of traffic to log. You can log traffic that the resource accepts
+ // or rejects, or all traffic.
//
// TrafficType is a required field
TrafficType *string `type:"string" required:"true" enum:"TrafficType"`
@@ -27926,12 +40093,6 @@ func (s CreateFlowLogsInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateFlowLogsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateFlowLogsInput"}
- if s.DeliverLogsPermissionArn == nil {
- invalidParams.Add(request.NewErrParamRequired("DeliverLogsPermissionArn"))
- }
- if s.LogGroupName == nil {
- invalidParams.Add(request.NewErrParamRequired("LogGroupName"))
- }
if s.ResourceIds == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceIds"))
}
@@ -27960,6 +40121,24 @@ func (s *CreateFlowLogsInput) SetDeliverLogsPermissionArn(v string) *CreateFlowL
return s
}
+// SetDryRun sets the DryRun field's value.
+func (s *CreateFlowLogsInput) SetDryRun(v bool) *CreateFlowLogsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetLogDestination sets the LogDestination field's value.
+func (s *CreateFlowLogsInput) SetLogDestination(v string) *CreateFlowLogsInput {
+ s.LogDestination = &v
+ return s
+}
+
+// SetLogDestinationType sets the LogDestinationType field's value.
+func (s *CreateFlowLogsInput) SetLogDestinationType(v string) *CreateFlowLogsInput {
+ s.LogDestinationType = &v
+ return s
+}
+
// SetLogGroupName sets the LogGroupName field's value.
func (s *CreateFlowLogsInput) SetLogGroupName(v string) *CreateFlowLogsInput {
s.LogGroupName = &v
@@ -27984,12 +40163,11 @@ func (s *CreateFlowLogsInput) SetTrafficType(v string) *CreateFlowLogsInput {
return s
}
-// Contains the output of CreateFlowLogs.
type CreateFlowLogsOutput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request.
+ // Unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request.
ClientToken *string `locationName:"clientToken" type:"string"`
// The IDs of the flow logs.
@@ -28031,7 +40209,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 (http://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/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// A description for the AFI.
@@ -28147,11 +40325,12 @@ func (s *CreateFpgaImageOutput) SetFpgaImageId(v string) *CreateFpgaImageOutput
return s
}
-// Contains the parameters for CreateImage.
type CreateImageInput struct {
_ struct{} `type:"structure"`
- // Information about one or more block device mappings.
+ // The block device mappings. This parameter cannot be used to modify the encryption
+ // status of existing volumes or snapshots. To create an AMI with encrypted
+ // snapshots, use the CopyImage action.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
// A description for the new image.
@@ -28246,7 +40425,6 @@ func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput {
return s
}
-// Contains the output of CreateImage.
type CreateImageOutput struct {
_ struct{} `type:"structure"`
@@ -28270,7 +40448,6 @@ func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput {
return s
}
-// Contains the parameters for CreateInstanceExportTask.
type CreateInstanceExportTaskInput struct {
_ struct{} `type:"structure"`
@@ -28337,7 +40514,6 @@ func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateIn
return s
}
-// Contains the output for CreateInstanceExportTask.
type CreateInstanceExportTaskOutput struct {
_ struct{} `type:"structure"`
@@ -28361,7 +40537,6 @@ func (s *CreateInstanceExportTaskOutput) SetExportTask(v *ExportTask) *CreateIns
return s
}
-// Contains the parameters for CreateInternetGateway.
type CreateInternetGatewayInput struct {
_ struct{} `type:"structure"`
@@ -28388,11 +40563,10 @@ func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInp
return s
}
-// Contains the output of CreateInternetGateway.
type CreateInternetGatewayOutput struct {
_ struct{} `type:"structure"`
- // Information about the Internet gateway.
+ // Information about the internet gateway.
InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"`
}
@@ -28412,7 +40586,6 @@ func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *Cr
return s
}
-// Contains the parameters for CreateKeyPair.
type CreateKeyPairInput struct {
_ struct{} `type:"structure"`
@@ -28511,7 +40684,9 @@ type CreateLaunchTemplateInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ //
+ // Constraint: Maximum 128 ASCII characters.
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -28530,6 +40705,9 @@ type CreateLaunchTemplateInput struct {
// LaunchTemplateName is a required field
LaunchTemplateName *string `min:"3" type:"string" required:"true"`
+ // The tags to apply to the launch template during creation.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+
// A description for the first version of the launch template.
VersionDescription *string `type:"string"`
}
@@ -28592,6 +40770,12 @@ func (s *CreateLaunchTemplateInput) SetLaunchTemplateName(v string) *CreateLaunc
return s
}
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateLaunchTemplateInput) SetTagSpecifications(v []*TagSpecification) *CreateLaunchTemplateInput {
+ s.TagSpecifications = v
+ return s
+}
+
// SetVersionDescription sets the VersionDescription field's value.
func (s *CreateLaunchTemplateInput) SetVersionDescription(v string) *CreateLaunchTemplateInput {
s.VersionDescription = &v
@@ -28625,7 +40809,9 @@ type CreateLaunchTemplateVersionInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ //
+ // Constraint: Maximum 128 ASCII characters.
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -28752,7 +40938,6 @@ func (s *CreateLaunchTemplateVersionOutput) SetLaunchTemplateVersion(v *LaunchTe
return s
}
-// Contains the parameters for CreateNatGateway.
type CreateNatGatewayInput struct {
_ struct{} `type:"structure"`
@@ -28763,8 +40948,8 @@ type CreateNatGatewayInput struct {
// AllocationId is a required field
AllocationId *string `type:"string" required:"true"`
- // Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // 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).
//
// Constraint: Maximum 64 ASCII characters.
ClientToken *string `type:"string"`
@@ -28819,7 +41004,6 @@ func (s *CreateNatGatewayInput) SetSubnetId(v string) *CreateNatGatewayInput {
return s
}
-// Contains the output of CreateNatGateway.
type CreateNatGatewayOutput struct {
_ struct{} `type:"structure"`
@@ -28853,7 +41037,6 @@ func (s *CreateNatGatewayOutput) SetNatGateway(v *NatGateway) *CreateNatGatewayO
return s
}
-// Contains the parameters for CreateNetworkAclEntry.
type CreateNetworkAclEntryInput struct {
_ struct{} `type:"structure"`
@@ -28872,8 +41055,8 @@ type CreateNetworkAclEntryInput struct {
// Egress is a required field
Egress *bool `locationName:"egress" type:"boolean" required:"true"`
- // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the
- // ICMP protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block.
+ // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol
+ // 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"`
// The IPv6 network range to allow or deny, in CIDR notation (for example 2001:db8:1234:1a00::/64).
@@ -28884,16 +41067,17 @@ type CreateNetworkAclEntryInput struct {
// NetworkAclId is a required field
NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"`
- // TCP or UDP protocols: The range of ports the rule applies to.
+ // TCP or UDP protocols: The range of ports the rule applies to. Required if
+ // specifying protocol 6 (TCP) or 17 (UDP).
PortRange *PortRange `locationName:"portRange" type:"structure"`
- // The protocol. A value of -1 or all means all protocols. If you specify all,
- // -1, or a protocol number other than 6 (tcp), 17 (udp), or 1 (icmp), traffic
- // on all ports is allowed, regardless of any ports or ICMP types or codes you
- // specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block,
- // traffic for all ICMP types and codes allowed, regardless of any that you
- // specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block,
- // you must specify an ICMP type and code.
+ // The protocol number. A value of "-1" means all protocols. If you specify
+ // "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP),
+ // traffic on all ports is allowed, regardless of any ports or ICMP types or
+ // codes that you specify. If you specify protocol "58" (ICMPv6) and specify
+ // an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless
+ // of any that you specify. If you specify protocol "58" (ICMPv6) and specify
+ // an IPv6 CIDR block, you must specify an ICMP type and code.
//
// Protocol is a required field
Protocol *string `locationName:"protocol" type:"string" required:"true"`
@@ -29022,7 +41206,6 @@ func (s CreateNetworkAclEntryOutput) GoString() string {
return s.String()
}
-// Contains the parameters for CreateNetworkAcl.
type CreateNetworkAclInput struct {
_ struct{} `type:"structure"`
@@ -29073,7 +41256,6 @@ func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput {
return s
}
-// Contains the output of CreateNetworkAcl.
type CreateNetworkAclOutput struct {
_ struct{} `type:"structure"`
@@ -29113,6 +41295,11 @@ type CreateNetworkInterfaceInput struct {
// The IDs of one or more security groups.
Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
+ // Indicates 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.
+ InterfaceType *string `type:"string" enum:"NetworkInterfaceCreationType"`
+
// The number of IPv6 addresses to assign to a network interface. Amazon EC2
// automatically selects the IPv6 addresses from the subnet range. You can't
// use this option if specifying specific IPv6 addresses. If your subnet has
@@ -29141,7 +41328,7 @@ type CreateNetworkInterfaceInput struct {
//
// 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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
+ // Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI)
// in the Amazon Virtual Private Cloud User Guide.
SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"`
@@ -29167,16 +41354,6 @@ func (s *CreateNetworkInterfaceInput) Validate() error {
if s.SubnetId == nil {
invalidParams.Add(request.NewErrParamRequired("SubnetId"))
}
- if s.PrivateIpAddresses != nil {
- for i, v := range s.PrivateIpAddresses {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams))
- }
- }
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -29202,6 +41379,12 @@ func (s *CreateNetworkInterfaceInput) SetGroups(v []*string) *CreateNetworkInter
return s
}
+// SetInterfaceType sets the InterfaceType field's value.
+func (s *CreateNetworkInterfaceInput) SetInterfaceType(v string) *CreateNetworkInterfaceInput {
+ s.InterfaceType = &v
+ return s
+}
+
// SetIpv6AddressCount sets the Ipv6AddressCount field's value.
func (s *CreateNetworkInterfaceInput) SetIpv6AddressCount(v int64) *CreateNetworkInterfaceInput {
s.Ipv6AddressCount = &v
@@ -29369,7 +41552,6 @@ func (s *CreateNetworkInterfacePermissionOutput) SetInterfacePermission(v *Netwo
return s
}
-// Contains the parameters for CreatePlacementGroup.
type CreatePlacementGroupInput struct {
_ struct{} `type:"structure"`
@@ -29380,17 +41562,16 @@ type CreatePlacementGroupInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// A name for the placement group. Must be unique within the scope of your account
- // for the region.
+ // for the Region.
//
// Constraints: Up to 255 ASCII characters
- //
- // GroupName is a required field
- GroupName *string `locationName:"groupName" type:"string" required:"true"`
+ GroupName *string `locationName:"groupName" type:"string"`
+
+ // The number of partitions. Valid only when Strategy is set to partition.
+ PartitionCount *int64 `type:"integer"`
// The placement strategy.
- //
- // Strategy is a required field
- Strategy *string `locationName:"strategy" type:"string" required:"true" enum:"PlacementStrategy"`
+ Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"`
}
// String returns the string representation
@@ -29403,22 +41584,6 @@ func (s CreatePlacementGroupInput) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *CreatePlacementGroupInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "CreatePlacementGroupInput"}
- if s.GroupName == nil {
- invalidParams.Add(request.NewErrParamRequired("GroupName"))
- }
- if s.Strategy == nil {
- invalidParams.Add(request.NewErrParamRequired("Strategy"))
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetDryRun sets the DryRun field's value.
func (s *CreatePlacementGroupInput) SetDryRun(v bool) *CreatePlacementGroupInput {
s.DryRun = &v
@@ -29431,6 +41596,12 @@ func (s *CreatePlacementGroupInput) SetGroupName(v string) *CreatePlacementGroup
return s
}
+// SetPartitionCount sets the PartitionCount field's value.
+func (s *CreatePlacementGroupInput) SetPartitionCount(v int64) *CreatePlacementGroupInput {
+ s.PartitionCount = &v
+ return s
+}
+
// SetStrategy sets the Strategy field's value.
func (s *CreatePlacementGroupInput) SetStrategy(v string) *CreatePlacementGroupInput {
s.Strategy = &v
@@ -29457,7 +41628,7 @@ type CreateReservedInstancesListingInput struct {
// Unique, case-sensitive identifier you provide to ensure idempotency of your
// listings. This helps avoid duplicate listings. For more information, see
- // Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
//
// ClientToken is a required field
ClientToken *string `locationName:"clientToken" type:"string" required:"true"`
@@ -29562,7 +41733,6 @@ func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v []
return s
}
-// Contains the parameters for CreateRoute.
type CreateRouteInput struct {
_ struct{} `type:"structure"`
@@ -29580,10 +41750,10 @@ type CreateRouteInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // [IPv6 traffic only] The ID of an egress-only Internet gateway.
+ // [IPv6 traffic only] The ID of an egress-only internet gateway.
EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"`
- // The ID of an Internet gateway or virtual private gateway attached to your
+ // The ID of an internet gateway or virtual private gateway attached to your
// VPC.
GatewayId *string `locationName:"gatewayId" type:"string"`
@@ -29602,6 +41772,9 @@ type CreateRouteInput struct {
// RouteTableId is a required field
RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"`
+ // The ID of a transit gateway.
+ TransitGatewayId *string `type:"string"`
+
// The ID of a VPC peering connection.
VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"`
}
@@ -29683,13 +41856,18 @@ func (s *CreateRouteInput) SetRouteTableId(v string) *CreateRouteInput {
return s
}
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *CreateRouteInput) SetTransitGatewayId(v string) *CreateRouteInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value.
func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput {
s.VpcPeeringConnectionId = &v
return s
}
-// Contains the output of CreateRoute.
type CreateRouteOutput struct {
_ struct{} `type:"structure"`
@@ -29713,7 +41891,6 @@ func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput {
return s
}
-// Contains the parameters for CreateRouteTable.
type CreateRouteTableInput struct {
_ struct{} `type:"structure"`
@@ -29764,7 +41941,6 @@ func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput {
return s
}
-// Contains the output of CreateRouteTable.
type CreateRouteTableOutput struct {
_ struct{} `type:"structure"`
@@ -29788,7 +41964,6 @@ func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableO
return s
}
-// Contains the parameters for CreateSecurityGroup.
type CreateSecurityGroupInput struct {
_ struct{} `type:"structure"`
@@ -29874,7 +42049,6 @@ func (s *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput
return s
}
-// Contains the output of CreateSecurityGroup.
type CreateSecurityGroupOutput struct {
_ struct{} `type:"structure"`
@@ -29967,6 +42141,105 @@ func (s *CreateSnapshotInput) SetVolumeId(v string) *CreateSnapshotInput {
return s
}
+type CreateSnapshotsInput struct {
+ _ struct{} `type:"structure"`
+
+ // Copies the tags from the specified volume to corresponding snapshot.
+ CopyTagsFromSource *string `type:"string" enum:"CopyTagsFromSource"`
+
+ // A description propagated to every snapshot specified by the instance.
+ Description *string `type:"string"`
+
+ // Checks whether you have the required permissions for the action without actually
+ // making the request. Provides an error response. If you have the required
+ // permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The instance to specify which volumes should be included in the snapshots.
+ //
+ // InstanceSpecification is a required field
+ InstanceSpecification *InstanceSpecification `type:"structure" required:"true"`
+
+ // Tags to apply to every snapshot specified by the instance.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateSnapshotsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateSnapshotsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateSnapshotsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotsInput"}
+ if s.InstanceSpecification == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceSpecification"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCopyTagsFromSource sets the CopyTagsFromSource field's value.
+func (s *CreateSnapshotsInput) SetCopyTagsFromSource(v string) *CreateSnapshotsInput {
+ s.CopyTagsFromSource = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateSnapshotsInput) SetDescription(v string) *CreateSnapshotsInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateSnapshotsInput) SetDryRun(v bool) *CreateSnapshotsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetInstanceSpecification sets the InstanceSpecification field's value.
+func (s *CreateSnapshotsInput) SetInstanceSpecification(v *InstanceSpecification) *CreateSnapshotsInput {
+ s.InstanceSpecification = v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateSnapshotsInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotsInput {
+ s.TagSpecifications = v
+ return s
+}
+
+type CreateSnapshotsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // List of snapshots.
+ Snapshots []*SnapshotInfo `locationName:"snapshotSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateSnapshotsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateSnapshotsOutput) GoString() string {
+ return s.String()
+}
+
+// SetSnapshots sets the Snapshots field's value.
+func (s *CreateSnapshotsOutput) SetSnapshots(v []*SnapshotInfo) *CreateSnapshotsOutput {
+ s.Snapshots = v
+ return s
+}
+
// Contains the parameters for CreateSpotDatafeedSubscription.
type CreateSpotDatafeedSubscriptionInput struct {
_ struct{} `type:"structure"`
@@ -30051,7 +42324,6 @@ func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *Sp
return s
}
-// Contains the parameters for CreateSubnet.
type CreateSubnetInput struct {
_ struct{} `type:"structure"`
@@ -30061,6 +42333,9 @@ type CreateSubnetInput struct {
// VPC, we may not necessarily select a different zone for each subnet.
AvailabilityZone *string `type:"string"`
+ // The AZ ID of the subnet.
+ AvailabilityZoneId *string `type:"string"`
+
// The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24.
//
// CidrBlock is a required field
@@ -30114,6 +42389,12 @@ func (s *CreateSubnetInput) SetAvailabilityZone(v string) *CreateSubnetInput {
return s
}
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *CreateSubnetInput) SetAvailabilityZoneId(v string) *CreateSubnetInput {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
// SetCidrBlock sets the CidrBlock field's value.
func (s *CreateSubnetInput) SetCidrBlock(v string) *CreateSubnetInput {
s.CidrBlock = &v
@@ -30138,7 +42419,6 @@ func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput {
return s
}
-// Contains the output of CreateSubnet.
type CreateSubnetOutput struct {
_ struct{} `type:"structure"`
@@ -30162,7 +42442,6 @@ func (s *CreateSubnetOutput) SetSubnet(v *Subnet) *CreateSubnetOutput {
return s
}
-// Contains the parameters for CreateTags.
type CreateTagsInput struct {
_ struct{} `type:"structure"`
@@ -30172,14 +42451,17 @@ type CreateTagsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The IDs of one or more resources to tag. For example, ami-1a2b3c4d.
+ // The IDs of the resources, separated by spaces.
+ //
+ // Constraints: Up to 1000 resource IDs. We recommend breaking up this request
+ // into smaller batches.
//
// Resources is a required field
Resources []*string `locationName:"ResourceId" type:"list" required:"true"`
- // One or more tags. The value parameter is required, but if you don't want
- // the tag to have a value, specify the parameter with no value, and we set
- // the value to an empty string.
+ // The tags. The value parameter is required, but if you don't want the tag
+ // to have a value, specify the parameter with no value, and we set the value
+ // to an empty string.
//
// Tags is a required field
Tags []*Tag `locationName:"Tag" locationNameList:"item" type:"list" required:"true"`
@@ -30243,12 +42525,1013 @@ func (s CreateTagsOutput) GoString() string {
return s.String()
}
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The description of the Traffic Mirror filter.
+ Description *string `type:"string"`
+
+ // 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 tags to assign to a Traffic Mirror filter.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorFilterInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorFilterInput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorFilterInput) SetClientToken(v string) *CreateTrafficMirrorFilterInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateTrafficMirrorFilterInput) SetDescription(v string) *CreateTrafficMirrorFilterInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTrafficMirrorFilterInput) SetDryRun(v bool) *CreateTrafficMirrorFilterInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTrafficMirrorFilterInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorFilterInput {
+ s.TagSpecifications = v
+ return s
+}
+
+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).
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
+ // Information about the Traffic Mirror filter.
+ TrafficMirrorFilter *TrafficMirrorFilter `locationName:"trafficMirrorFilter" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorFilterOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorFilterOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorFilterOutput) SetClientToken(v string) *CreateTrafficMirrorFilterOutput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilter sets the TrafficMirrorFilter field's value.
+func (s *CreateTrafficMirrorFilterOutput) SetTrafficMirrorFilter(v *TrafficMirrorFilter) *CreateTrafficMirrorFilterOutput {
+ s.TrafficMirrorFilter = v
+ return s
+}
+
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The description of the Traffic Mirror rule.
+ Description *string `type:"string"`
+
+ // The destination CIDR block to assign to the Traffic Mirror rule.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"true"`
+
+ // The destination port range.
+ DestinationPortRange *TrafficMirrorPortRangeRequest `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 protocol, for example UDP, to assign to the Traffic Mirror rule.
+ //
+ // For information about the protocol value, see Protocol Numbers (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)
+ // on the Internet Assigned Numbers Authority (IANA) website.
+ Protocol *int64 `type:"integer"`
+
+ // The action to take (accept | reject) on the filtered traffic.
+ //
+ // RuleAction is a required field
+ RuleAction *string `type:"string" required:"true" enum:"TrafficMirrorRuleAction"`
+
+ // The number of the Traffic Mirror rule. This number must be unique for each
+ // Traffic Mirror rule in a given direction. The rules are processed in ascending
+ // order by rule number.
+ //
+ // RuleNumber is a required field
+ RuleNumber *int64 `type:"integer" required:"true"`
+
+ // The source CIDR block to assign to the Traffic Mirror rule.
+ //
+ // SourceCidrBlock is a required field
+ SourceCidrBlock *string `type:"string" required:"true"`
+
+ // The source port range.
+ SourcePortRange *TrafficMirrorPortRangeRequest `type:"structure"`
+
+ // The type of traffic (ingress | egress).
+ //
+ // TrafficDirection is a required field
+ TrafficDirection *string `type:"string" required:"true" enum:"TrafficDirection"`
+
+ // The ID of the filter that this rule is associated with.
+ //
+ // TrafficMirrorFilterId is a required field
+ TrafficMirrorFilterId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorFilterRuleInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorFilterRuleInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTrafficMirrorFilterRuleInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorFilterRuleInput"}
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+ if s.RuleAction == nil {
+ invalidParams.Add(request.NewErrParamRequired("RuleAction"))
+ }
+ if s.RuleNumber == nil {
+ invalidParams.Add(request.NewErrParamRequired("RuleNumber"))
+ }
+ if s.SourceCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("SourceCidrBlock"))
+ }
+ if s.TrafficDirection == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficDirection"))
+ }
+ if s.TrafficMirrorFilterId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetDescription(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDestinationPortRange sets the DestinationPortRange field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationPortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput {
+ s.DestinationPortRange = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetDryRun(v bool) *CreateTrafficMirrorFilterRuleInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetProtocol sets the Protocol field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetProtocol(v int64) *CreateTrafficMirrorFilterRuleInput {
+ s.Protocol = &v
+ return s
+}
+
+// SetRuleAction sets the RuleAction field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetRuleAction(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.RuleAction = &v
+ return s
+}
+
+// SetRuleNumber sets the RuleNumber field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetRuleNumber(v int64) *CreateTrafficMirrorFilterRuleInput {
+ s.RuleNumber = &v
+ return s
+}
+
+// SetSourceCidrBlock sets the SourceCidrBlock field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetSourceCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.SourceCidrBlock = &v
+ return s
+}
+
+// SetSourcePortRange sets the SourcePortRange field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetSourcePortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput {
+ s.SourcePortRange = v
+ return s
+}
+
+// SetTrafficDirection sets the TrafficDirection field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficDirection(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.TrafficDirection = &v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorFilterRuleInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+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).
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
+ // The Traffic Mirror rule.
+ TrafficMirrorFilterRule *TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRule" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorFilterRuleOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorFilterRuleOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorFilterRuleOutput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleOutput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRule sets the TrafficMirrorFilterRule field's value.
+func (s *CreateTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRule(v *TrafficMirrorFilterRule) *CreateTrafficMirrorFilterRuleOutput {
+ s.TrafficMirrorFilterRule = v
+ return s
+}
+
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The description of the Traffic Mirror session.
+ Description *string `type:"string"`
+
+ // 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 source network interface.
+ //
+ // NetworkInterfaceId is a required field
+ NetworkInterfaceId *string `type:"string" required:"true"`
+
+ // The number of bytes in each packet to mirror. These are bytes after the VXLAN
+ // header. Do not specify this parameter when you want to mirror the entire
+ // packet. To mirror a subset of the packet, set this to the length (in bytes)
+ // that you want to mirror. For example, if you set this value to 1network0,
+ // then the first 100 bytes that meet the filter criteria are copied to the
+ // target.
+ //
+ // If you do not want to mirror the entire packet, use the PacketLength parameter
+ // to specify the number of bytes in each packet to mirror.
+ PacketLength *int64 `type:"integer"`
+
+ // The session number determines the order in which sessions are evaluated when
+ // an interface is used by multiple sessions. The first session with a matching
+ // filter is the one that mirrors the packets.
+ //
+ // Valid values are 1-32766.
+ //
+ // SessionNumber is a required field
+ SessionNumber *int64 `type:"integer" required:"true"`
+
+ // The tags to assign to a Traffic Mirror session.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+
+ // The ID of the Traffic Mirror filter.
+ //
+ // TrafficMirrorFilterId is a required field
+ TrafficMirrorFilterId *string `type:"string" required:"true"`
+
+ // The ID of the Traffic Mirror target.
+ //
+ // TrafficMirrorTargetId is a required field
+ 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.
+ VirtualNetworkId *int64 `type:"integer"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorSessionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorSessionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTrafficMirrorSessionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorSessionInput"}
+ if s.NetworkInterfaceId == nil {
+ invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId"))
+ }
+ if s.SessionNumber == nil {
+ invalidParams.Add(request.NewErrParamRequired("SessionNumber"))
+ }
+ if s.TrafficMirrorFilterId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId"))
+ }
+ if s.TrafficMirrorTargetId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorSessionInput) SetClientToken(v string) *CreateTrafficMirrorSessionInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateTrafficMirrorSessionInput) SetDescription(v string) *CreateTrafficMirrorSessionInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTrafficMirrorSessionInput) SetDryRun(v bool) *CreateTrafficMirrorSessionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetNetworkInterfaceId sets the NetworkInterfaceId field's value.
+func (s *CreateTrafficMirrorSessionInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorSessionInput {
+ s.NetworkInterfaceId = &v
+ return s
+}
+
+// SetPacketLength sets the PacketLength field's value.
+func (s *CreateTrafficMirrorSessionInput) SetPacketLength(v int64) *CreateTrafficMirrorSessionInput {
+ s.PacketLength = &v
+ return s
+}
+
+// SetSessionNumber sets the SessionNumber field's value.
+func (s *CreateTrafficMirrorSessionInput) SetSessionNumber(v int64) *CreateTrafficMirrorSessionInput {
+ s.SessionNumber = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTrafficMirrorSessionInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorSessionInput {
+ s.TagSpecifications = v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorSessionInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorTargetId(v string) *CreateTrafficMirrorSessionInput {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+// SetVirtualNetworkId sets the VirtualNetworkId field's value.
+func (s *CreateTrafficMirrorSessionInput) SetVirtualNetworkId(v int64) *CreateTrafficMirrorSessionInput {
+ s.VirtualNetworkId = &v
+ return s
+}
+
+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).
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
+ // Information about the Traffic Mirror session.
+ TrafficMirrorSession *TrafficMirrorSession `locationName:"trafficMirrorSession" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorSessionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorSessionOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorSessionOutput) SetClientToken(v string) *CreateTrafficMirrorSessionOutput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetTrafficMirrorSession sets the TrafficMirrorSession field's value.
+func (s *CreateTrafficMirrorSessionOutput) SetTrafficMirrorSession(v *TrafficMirrorSession) *CreateTrafficMirrorSessionOutput {
+ s.TrafficMirrorSession = v
+ return s
+}
+
+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).
+ ClientToken *string `type:"string" idempotencyToken:"true"`
+
+ // The description of the Traffic Mirror target.
+ Description *string `type:"string"`
+
+ // 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 network interface ID that is associated with the target.
+ NetworkInterfaceId *string `type:"string"`
+
+ // The Amazon Resource Name (ARN) of the Network Load Balancer that is associated
+ // with the target.
+ NetworkLoadBalancerArn *string `type:"string"`
+
+ // The tags to assign to the Traffic Mirror target.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorTargetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorTargetInput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorTargetInput) SetClientToken(v string) *CreateTrafficMirrorTargetInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateTrafficMirrorTargetInput) SetDescription(v string) *CreateTrafficMirrorTargetInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTrafficMirrorTargetInput) SetDryRun(v bool) *CreateTrafficMirrorTargetInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetNetworkInterfaceId sets the NetworkInterfaceId field's value.
+func (s *CreateTrafficMirrorTargetInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorTargetInput {
+ s.NetworkInterfaceId = &v
+ return s
+}
+
+// SetNetworkLoadBalancerArn sets the NetworkLoadBalancerArn field's value.
+func (s *CreateTrafficMirrorTargetInput) SetNetworkLoadBalancerArn(v string) *CreateTrafficMirrorTargetInput {
+ s.NetworkLoadBalancerArn = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTrafficMirrorTargetInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorTargetInput {
+ s.TagSpecifications = v
+ return s
+}
+
+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).
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
+ // Information about the Traffic Mirror target.
+ TrafficMirrorTarget *TrafficMirrorTarget `locationName:"trafficMirrorTarget" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTrafficMirrorTargetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTrafficMirrorTargetOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTrafficMirrorTargetOutput) SetClientToken(v string) *CreateTrafficMirrorTargetOutput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetTrafficMirrorTarget sets the TrafficMirrorTarget field's value.
+func (s *CreateTrafficMirrorTargetOutput) SetTrafficMirrorTarget(v *TrafficMirrorTarget) *CreateTrafficMirrorTargetOutput {
+ s.TrafficMirrorTarget = v
+ return s
+}
+
+type CreateTransitGatewayInput struct {
+ _ struct{} `type:"structure"`
+
+ // A description of the transit gateway.
+ Description *string `type:"string"`
+
+ // 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 transit gateway options.
+ Options *TransitGatewayRequestOptions `type:"structure"`
+
+ // The tags to apply to the transit gateway.
+ TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayInput) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *CreateTransitGatewayInput) SetDescription(v string) *CreateTransitGatewayInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTransitGatewayInput) SetDryRun(v bool) *CreateTransitGatewayInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetOptions sets the Options field's value.
+func (s *CreateTransitGatewayInput) SetOptions(v *TransitGatewayRequestOptions) *CreateTransitGatewayInput {
+ s.Options = v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTransitGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayInput {
+ s.TagSpecifications = v
+ return s
+}
+
+type CreateTransitGatewayOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the transit gateway.
+ TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGateway sets the TransitGateway field's value.
+func (s *CreateTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *CreateTransitGatewayOutput {
+ s.TransitGateway = v
+ return s
+}
+
+type CreateTransitGatewayRouteInput struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether to drop traffic that matches this route.
+ Blackhole *bool `type:"boolean"`
+
+ // The CIDR range used for destination matches. Routing decisions are based
+ // on the most specific match.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `type:"string"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayRouteInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayRouteInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTransitGatewayRouteInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteInput"}
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetBlackhole sets the Blackhole field's value.
+func (s *CreateTransitGatewayRouteInput) SetBlackhole(v bool) *CreateTransitGatewayRouteInput {
+ s.Blackhole = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *CreateTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *CreateTransitGatewayRouteInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTransitGatewayRouteInput) SetDryRun(v bool) *CreateTransitGatewayRouteInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *CreateTransitGatewayRouteInput) SetTransitGatewayAttachmentId(v string) *CreateTransitGatewayRouteInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *CreateTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *CreateTransitGatewayRouteInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type CreateTransitGatewayRouteOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the route.
+ Route *TransitGatewayRoute `locationName:"route" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayRouteOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayRouteOutput) GoString() string {
+ return s.String()
+}
+
+// SetRoute sets the Route field's value.
+func (s *CreateTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *CreateTransitGatewayRouteOutput {
+ s.Route = v
+ return s
+}
+
+type CreateTransitGatewayRouteTableInput 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 tags to apply to the transit gateway route table.
+ TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"`
+
+ // The ID of the transit gateway.
+ //
+ // TransitGatewayId is a required field
+ TransitGatewayId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayRouteTableInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayRouteTableInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTransitGatewayRouteTableInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteTableInput"}
+ if s.TransitGatewayId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTransitGatewayRouteTableInput) SetDryRun(v bool) *CreateTransitGatewayRouteTableInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTransitGatewayRouteTableInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayRouteTableInput {
+ s.TagSpecifications = v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *CreateTransitGatewayRouteTableInput) SetTransitGatewayId(v string) *CreateTransitGatewayRouteTableInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
+type CreateTransitGatewayRouteTableOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the transit gateway route table.
+ TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayRouteTableOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayRouteTableOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value.
+func (s *CreateTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *CreateTransitGatewayRouteTableOutput {
+ s.TransitGatewayRouteTable = v
+ return s
+}
+
+type CreateTransitGatewayVpcAttachmentInput 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 VPC attachment options.
+ Options *CreateTransitGatewayVpcAttachmentRequestOptions `type:"structure"`
+
+ // The IDs of one or more subnets. You can specify only one subnet per Availability
+ // Zone. You must specify at least one subnet, but we recommend that you specify
+ // two subnets for better availability. The transit gateway uses one IP address
+ // from each specified subnet.
+ //
+ // SubnetIds is a required field
+ SubnetIds []*string `locationNameList:"item" type:"list" required:"true"`
+
+ // The tags to apply to the VPC attachment.
+ TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"`
+
+ // The ID of the transit gateway.
+ //
+ // TransitGatewayId is a required field
+ TransitGatewayId *string `type:"string" required:"true"`
+
+ // The ID of the VPC.
+ //
+ // VpcId is a required field
+ VpcId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayVpcAttachmentInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayVpcAttachmentInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTransitGatewayVpcAttachmentInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayVpcAttachmentInput"}
+ if s.SubnetIds == nil {
+ invalidParams.Add(request.NewErrParamRequired("SubnetIds"))
+ }
+ if s.TransitGatewayId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayId"))
+ }
+ if s.VpcId == nil {
+ invalidParams.Add(request.NewErrParamRequired("VpcId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *CreateTransitGatewayVpcAttachmentInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetOptions sets the Options field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetOptions(v *CreateTransitGatewayVpcAttachmentRequestOptions) *CreateTransitGatewayVpcAttachmentInput {
+ s.Options = v
+ return s
+}
+
+// SetSubnetIds sets the SubnetIds field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetSubnetIds(v []*string) *CreateTransitGatewayVpcAttachmentInput {
+ s.SubnetIds = v
+ return s
+}
+
+// SetTagSpecifications sets the TagSpecifications field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayVpcAttachmentInput {
+ s.TagSpecifications = v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetTransitGatewayId(v string) *CreateTransitGatewayVpcAttachmentInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// SetVpcId sets the VpcId field's value.
+func (s *CreateTransitGatewayVpcAttachmentInput) SetVpcId(v string) *CreateTransitGatewayVpcAttachmentInput {
+ s.VpcId = &v
+ return s
+}
+
+type CreateTransitGatewayVpcAttachmentOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the VPC attachment.
+ TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayVpcAttachmentOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayVpcAttachmentOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value.
+func (s *CreateTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *CreateTransitGatewayVpcAttachmentOutput {
+ s.TransitGatewayVpcAttachment = v
+ return s
+}
+
+// Describes the options for a VPC attachment.
+type CreateTransitGatewayVpcAttachmentRequestOptions struct {
+ _ struct{} `type:"structure"`
+
+ // Enable or disable DNS support. The default is enable.
+ DnsSupport *string `type:"string" enum:"DnsSupportValue"`
+
+ // Enable or disable IPv6 support. The default is enable.
+ Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"`
+}
+
+// String returns the string representation
+func (s CreateTransitGatewayVpcAttachmentRequestOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTransitGatewayVpcAttachmentRequestOptions) GoString() string {
+ return s.String()
+}
+
+// SetDnsSupport sets the DnsSupport field's value.
+func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetDnsSupport(v string) *CreateTransitGatewayVpcAttachmentRequestOptions {
+ s.DnsSupport = &v
+ return s
+}
+
+// SetIpv6Support sets the Ipv6Support field's value.
+func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetIpv6Support(v string) *CreateTransitGatewayVpcAttachmentRequestOptions {
+ s.Ipv6Support = &v
+ return s
+}
+
// Contains the parameters for CreateVolume.
type CreateVolumeInput struct {
_ struct{} `type:"structure"`
- // The Availability Zone in which to create the volume. Use DescribeAvailabilityZones
- // to list the Availability Zones that are currently available to you.
+ // The Availability Zone in which to create the volume.
//
// AvailabilityZone is a required field
AvailabilityZone *string `type:"string" required:"true"`
@@ -30259,60 +43542,62 @@ type CreateVolumeInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // Specifies whether the volume should be encrypted. Encrypted Amazon EBS volumes
- // may only be attached to instances that support Amazon EBS encryption. Volumes
- // that are created from encrypted snapshots are automatically encrypted. There
- // is no way to create an encrypted volume from an unencrypted snapshot or vice
- // versa. If your AMI uses encrypted volumes, you can only launch it on supported
- // instance types. For more information, see Amazon EBS Encryption (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html)
+ // Specifies 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.
+ //
+ // 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).
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The number of I/O operations per second (IOPS) to provision for the volume,
- // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 32000 IOPS for volumes
- // in most regions. For exceptions, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
+ // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes
+ // in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based
+ // instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances).
+ // Other instance families guarantee performance up to 32,000 IOPS. 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.
//
// This parameter is valid only for Provisioned IOPS SSD (io1) volumes.
Iops *int64 `type:"integer"`
- // An identifier for the AWS Key Management Service (AWS KMS) customer master
- // key (CMK) to use when creating the encrypted volume. This parameter is only
- // required if you want to use a non-default CMK; if this parameter is not specified,
- // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted
- // flag must also be set.
+ // The identifier of the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified,
+ // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted
+ // state must be true.
//
- // The CMK identifier may be provided in any of the following formats:
+ // You can specify the CMK using any of the following:
//
- // * Key ID
+ // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.
//
- // * Key alias
+ // * Key alias. For example, alias/ExampleAlias.
//
- // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed
- // by the region of the CMK, the AWS account ID of the CMK owner, the key
- // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
+ // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
//
+ // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
//
- // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace,
- // followed by the region of the CMK, the AWS account ID of the CMK owner,
- // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
- //
- //
- // AWS parses KmsKeyId asynchronously, meaning that the action you call may
- // appear to complete even though you provided an invalid identifier. The action
- // will eventually fail.
+ // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID,
+ // alias, or ARN that is not valid, the action can appear to complete, but eventually
+ // fails.
KmsKeyId *string `type:"string"`
// The size of the volume, in GiBs.
//
- // Constraints: 1-16384 for gp2, 4-16384 for io1, 500-16384 for st1, 500-16384
- // for sc1, and 1-1024 for standard. If you specify a snapshot, the volume size
- // must be equal to or larger than the snapshot size.
+ // Constraints: 1-16,384 for gp2, 4-16,384 for io1, 500-16,384 for st1, 500-16,384
+ // for sc1, and 1-1,024 for standard. If you specify a snapshot, the volume
+ // size must be equal to or larger than the snapshot size.
//
// Default: If you're creating the volume from a snapshot and don't specify
// a volume size, the default is the snapshot size.
+ //
+ // At least one of Size or SnapshotId is required.
Size *int64 `type:"integer"`
// The snapshot from which to create the volume.
+ //
+ // At least one of Size or SnapshotId are required.
SnapshotId *string `type:"string"`
// The tags to apply to the volume during creation.
@@ -30325,7 +43610,7 @@ type CreateVolumeInput struct {
// Defaults: If no volume type is specified, the default is standard in us-east-1,
// eu-west-1, eu-central-1, us-west-2, us-west-1, sa-east-1, ap-northeast-1,
// ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-south-1, us-gov-west-1,
- // and cn-north-1. In all other regions, EBS defaults to gp2.
+ // and cn-north-1. In all other Regions, EBS defaults to gp2.
VolumeType *string `type:"string" enum:"VolumeType"`
}
@@ -30406,17 +43691,15 @@ func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput {
return s
}
-// Describes the user or group to be added or removed from the permissions for
-// a volume.
+// Describes the user or group to be added or removed from the list of create
+// volume permissions for a volume.
type CreateVolumePermission struct {
_ struct{} `type:"structure"`
- // The specific group that is to be added or removed from a volume's list of
- // create volume permissions.
+ // The group to be added or removed. The possible value is all.
Group *string `locationName:"group" type:"string" enum:"PermissionGroup"`
- // The specific AWS account ID that is to be added or removed from a volume's
- // list of create volume permissions.
+ // The AWS account ID to be added or removed.
UserId *string `locationName:"userId" type:"string"`
}
@@ -30442,16 +43725,14 @@ func (s *CreateVolumePermission) SetUserId(v string) *CreateVolumePermission {
return s
}
-// Describes modifications to the permissions for a volume.
+// Describes modifications to the list of create volume permissions for a volume.
type CreateVolumePermissionModifications struct {
_ struct{} `type:"structure"`
- // Adds a specific AWS account ID or group to a volume's list of create volume
- // permissions.
+ // Adds the specified AWS account ID or group to the list.
Add []*CreateVolumePermission `locationNameList:"item" type:"list"`
- // Removes a specific AWS account ID or group from a volume's list of create
- // volume permissions.
+ // Removes the specified AWS account ID or group from the list.
Remove []*CreateVolumePermission `locationNameList:"item" type:"list"`
}
@@ -30481,7 +43762,7 @@ type CreateVpcEndpointConnectionNotificationInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// One or more endpoint events for which to receive notifications. Valid values
@@ -30608,7 +43889,7 @@ type CreateVpcEndpointInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -30617,15 +43898,14 @@ type CreateVpcEndpointInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // (Gateway endpoint) A policy to attach to the endpoint that controls access
- // to the service. The policy must be in valid JSON format. If this parameter
- // is not specified, we attach a default policy that allows full access to the
- // service.
+ // A policy to attach to the endpoint that controls access to the service. The
+ // policy must be in valid JSON format. If this parameter is not specified,
+ // we attach a default policy that allows full access to the service.
PolicyDocument *string `type:"string"`
// (Interface endpoint) Indicate whether to associate a private hosted zone
// with the specified VPC. The private hosted zone contains a record set for
- // the default public DNS name for the service for the region (for example,
+ // the default public DNS name for the service for the Region (for example,
// kinesis.us-east-1.amazonaws.com) which resolves to the private IP addresses
// of the endpoint network interfaces in the VPC. This enables you to make requests
// to the default public DNS name for the service instead of the public DNS
@@ -30794,7 +44074,7 @@ type CreateVpcEndpointServiceConfigurationInput struct {
AcceptanceRequired *bool `type:"boolean"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
+ // the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -30890,7 +44170,6 @@ func (s *CreateVpcEndpointServiceConfigurationOutput) SetServiceConfiguration(v
return s
}
-// Contains the parameters for CreateVpc.
type CreateVpcInput struct {
_ struct{} `type:"structure"`
@@ -30970,7 +44249,6 @@ func (s *CreateVpcInput) SetInstanceTenancy(v string) *CreateVpcInput {
return s
}
-// Contains the output of CreateVpc.
type CreateVpcOutput struct {
_ struct{} `type:"structure"`
@@ -30994,7 +44272,6 @@ func (s *CreateVpcOutput) SetVpc(v *Vpc) *CreateVpcOutput {
return s
}
-// Contains the parameters for CreateVpcPeeringConnection.
type CreateVpcPeeringConnectionInput struct {
_ struct{} `type:"structure"`
@@ -31009,10 +44286,10 @@ type CreateVpcPeeringConnectionInput struct {
// Default: Your AWS account ID
PeerOwnerId *string `locationName:"peerOwnerId" type:"string"`
- // The region code for the accepter VPC, if the accepter VPC is located in a
- // region other than the region in which you make the request.
+ // The Region code for the accepter VPC, if the accepter VPC is located in a
+ // Region other than the Region in which you make the request.
//
- // Default: The region in which you make the request.
+ // Default: The Region in which you make the request.
PeerRegion *string `type:"string"`
// The ID of the VPC with which you are creating the VPC peering connection.
@@ -31063,7 +44340,6 @@ func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringCo
return s
}
-// Contains the output of CreateVpcPeeringConnection.
type CreateVpcPeeringConnectionOutput struct {
_ struct{} `type:"structure"`
@@ -31105,15 +44381,18 @@ type CreateVpnConnectionInput struct {
// The options for the VPN connection.
Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"`
+ // The ID of the transit gateway. If you specify a transit gateway, you cannot
+ // specify a virtual private gateway.
+ TransitGatewayId *string `type:"string"`
+
// The type of VPN connection (ipsec.1).
//
// Type is a required field
Type *string `type:"string" required:"true"`
- // The ID of the virtual private gateway.
- //
- // VpnGatewayId is a required field
- VpnGatewayId *string `type:"string" required:"true"`
+ // The ID of the virtual private gateway. If you specify a virtual private gateway,
+ // you cannot specify a transit gateway.
+ VpnGatewayId *string `type:"string"`
}
// String returns the string representation
@@ -31135,9 +44414,6 @@ func (s *CreateVpnConnectionInput) Validate() error {
if s.Type == nil {
invalidParams.Add(request.NewErrParamRequired("Type"))
}
- if s.VpnGatewayId == nil {
- invalidParams.Add(request.NewErrParamRequired("VpnGatewayId"))
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -31163,6 +44439,12 @@ func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecificati
return s
}
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *CreateVpnConnectionInput) SetTransitGatewayId(v string) *CreateVpnConnectionInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
// SetType sets the Type field's value.
func (s *CreateVpnConnectionInput) SetType(v string) *CreateVpnConnectionInput {
s.Type = &v
@@ -31363,11 +44645,12 @@ func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayO
return s
}
-// Describes the credit option for CPU usage of a T2 instance.
+// Describes the credit option for CPU usage of a T2 or T3 instance.
type CreditSpecification struct {
_ struct{} `type:"structure"`
- // The credit option for CPU usage of a T2 instance.
+ // The credit option for CPU usage of a T2 or T3 instance. Valid values are
+ // standard and unlimited.
CpuCredits *string `locationName:"cpuCredits" type:"string"`
}
@@ -31387,12 +44670,12 @@ func (s *CreditSpecification) SetCpuCredits(v string) *CreditSpecification {
return s
}
-// The credit option for CPU usage of a T2 instance.
+// The credit option for CPU usage of a T2 or T3 instance.
type CreditSpecificationRequest struct {
_ struct{} `type:"structure"`
- // The credit option for CPU usage of a T2 instance. Valid values are standard
- // and unlimited.
+ // The credit option for CPU usage of a T2 or T3 instance. Valid values are
+ // standard and unlimited.
//
// CpuCredits is a required field
CpuCredits *string `type:"string" required:"true"`
@@ -31498,6 +44781,175 @@ func (s *CustomerGateway) SetType(v string) *CustomerGateway {
return s
}
+type DeleteClientVpnEndpointInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN to be deleted.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s DeleteClientVpnEndpointInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteClientVpnEndpointInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteClientVpnEndpointInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnEndpointInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DeleteClientVpnEndpointInput) SetClientVpnEndpointId(v string) *DeleteClientVpnEndpointInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteClientVpnEndpointInput) SetDryRun(v bool) *DeleteClientVpnEndpointInput {
+ s.DryRun = &v
+ return s
+}
+
+type DeleteClientVpnEndpointOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current state of the Client VPN endpoint.
+ Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteClientVpnEndpointOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteClientVpnEndpointOutput) GoString() string {
+ return s.String()
+}
+
+// SetStatus sets the Status field's value.
+func (s *DeleteClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *DeleteClientVpnEndpointOutput {
+ s.Status = v
+ return s
+}
+
+type DeleteClientVpnRouteInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint from which the route is to be deleted.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"true"`
+
+ // The IPv4 address range, in CIDR notation, of the route to be deleted.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the target subnet used by the route.
+ TargetVpcSubnetId *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteClientVpnRouteInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteClientVpnRouteInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteClientVpnRouteInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnRouteInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DeleteClientVpnRouteInput) SetClientVpnEndpointId(v string) *DeleteClientVpnRouteInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *DeleteClientVpnRouteInput) SetDestinationCidrBlock(v string) *DeleteClientVpnRouteInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteClientVpnRouteInput) SetDryRun(v bool) *DeleteClientVpnRouteInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value.
+func (s *DeleteClientVpnRouteInput) SetTargetVpcSubnetId(v string) *DeleteClientVpnRouteInput {
+ s.TargetVpcSubnetId = &v
+ return s
+}
+
+type DeleteClientVpnRouteOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current state of the route.
+ Status *ClientVpnRouteStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteClientVpnRouteOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteClientVpnRouteOutput) GoString() string {
+ return s.String()
+}
+
+// SetStatus sets the Status field's value.
+func (s *DeleteClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *DeleteClientVpnRouteOutput {
+ s.Status = v
+ return s
+}
+
// Contains the parameters for DeleteCustomerGateway.
type DeleteCustomerGatewayInput struct {
_ struct{} `type:"structure"`
@@ -31563,7 +45015,6 @@ func (s DeleteCustomerGatewayOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteDhcpOptions.
type DeleteDhcpOptionsInput struct {
_ struct{} `type:"structure"`
@@ -31637,7 +45088,7 @@ type DeleteEgressOnlyInternetGatewayInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // The ID of the egress-only Internet gateway.
+ // The ID of the egress-only internet gateway.
//
// EgressOnlyInternetGatewayId is a required field
EgressOnlyInternetGatewayId *string `type:"string" required:"true"`
@@ -31906,12 +45357,19 @@ func (s *DeleteFleetsOutput) SetUnsuccessfulFleetDeletions(v []*DeleteFleetError
return s
}
-// Contains the parameters for DeleteFlowLogs.
type DeleteFlowLogsInput 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"`
+
// One or more flow log IDs.
//
+ // Constraint: Maximum of 1000 flow log IDs.
+ //
// FlowLogIds is a required field
FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"`
}
@@ -31939,13 +45397,18 @@ func (s *DeleteFlowLogsInput) Validate() error {
return nil
}
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteFlowLogsInput) SetDryRun(v bool) *DeleteFlowLogsInput {
+ s.DryRun = &v
+ return s
+}
+
// SetFlowLogIds sets the FlowLogIds field's value.
func (s *DeleteFlowLogsInput) SetFlowLogIds(v []*string) *DeleteFlowLogsInput {
s.FlowLogIds = v
return s
}
-// Contains the output of DeleteFlowLogs.
type DeleteFlowLogsOutput struct {
_ struct{} `type:"structure"`
@@ -32042,7 +45505,6 @@ func (s *DeleteFpgaImageOutput) SetReturn(v bool) *DeleteFpgaImageOutput {
return s
}
-// Contains the parameters for DeleteInternetGateway.
type DeleteInternetGatewayInput struct {
_ struct{} `type:"structure"`
@@ -32052,7 +45514,7 @@ type DeleteInternetGatewayInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The ID of the Internet gateway.
+ // The ID of the internet gateway.
//
// InternetGatewayId is a required field
InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"`
@@ -32107,7 +45569,6 @@ func (s DeleteInternetGatewayOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteKeyPair.
type DeleteKeyPairInput struct {
_ struct{} `type:"structure"`
@@ -32452,7 +45913,6 @@ func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetVersionNumber(v int
return s
}
-// Contains the parameters for DeleteNatGateway.
type DeleteNatGatewayInput struct {
_ struct{} `type:"structure"`
@@ -32491,7 +45951,6 @@ func (s *DeleteNatGatewayInput) SetNatGatewayId(v string) *DeleteNatGatewayInput
return s
}
-// Contains the output of DeleteNatGateway.
type DeleteNatGatewayOutput struct {
_ struct{} `type:"structure"`
@@ -32515,7 +45974,6 @@ func (s *DeleteNatGatewayOutput) SetNatGatewayId(v string) *DeleteNatGatewayOutp
return s
}
-// Contains the parameters for DeleteNetworkAclEntry.
type DeleteNetworkAclEntryInput struct {
_ struct{} `type:"structure"`
@@ -32608,7 +46066,6 @@ func (s DeleteNetworkAclEntryOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteNetworkAcl.
type DeleteNetworkAclInput struct {
_ struct{} `type:"structure"`
@@ -32823,7 +46280,6 @@ func (s *DeleteNetworkInterfacePermissionOutput) SetReturn(v bool) *DeleteNetwor
return s
}
-// Contains the parameters for DeletePlacementGroup.
type DeletePlacementGroupInput struct {
_ struct{} `type:"structure"`
@@ -32888,7 +46344,6 @@ func (s DeletePlacementGroupOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteRoute.
type DeleteRouteInput struct {
_ struct{} `type:"structure"`
@@ -32973,7 +46428,6 @@ func (s DeleteRouteOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteRouteTable.
type DeleteRouteTableInput struct {
_ struct{} `type:"structure"`
@@ -33038,7 +46492,6 @@ func (s DeleteRouteTableOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteSecurityGroup.
type DeleteSecurityGroupInput struct {
_ struct{} `type:"structure"`
@@ -33204,7 +46657,6 @@ func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteSubnet.
type DeleteSubnetInput struct {
_ struct{} `type:"structure"`
@@ -33269,7 +46721,6 @@ func (s DeleteSubnetOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteTags.
type DeleteTagsInput struct {
_ struct{} `type:"structure"`
@@ -33279,14 +46730,17 @@ type DeleteTagsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The IDs of one or more resources.
+ // The IDs of the resources, separated by spaces.
+ //
+ // Constraints: Up to 1000 resource IDs. We recommend breaking up this request
+ // into smaller batches.
//
// Resources is a required field
Resources []*string `locationName:"resourceId" type:"list" required:"true"`
- // One or more tags to delete. Specify a tag key and an optional tag value to
- // delete specific tags. If you specify a tag key without a tag value, we delete
- // any tag with this key regardless of its value. If you specify a tag key with
+ // The tags to delete. Specify a tag key and an optional tag value to delete
+ // specific tags. If you specify a tag key without a tag value, we delete any
+ // tag with this key regardless of its value. If you specify a tag key with
// an empty string as the tag value, we delete the tag only if its value is
// an empty string.
//
@@ -33350,6 +46804,604 @@ func (s DeleteTagsOutput) GoString() string {
return s.String()
}
+type DeleteTrafficMirrorFilterInput 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 Traffic Mirror filter.
+ //
+ // TrafficMirrorFilterId is a required field
+ TrafficMirrorFilterId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorFilterInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorFilterInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTrafficMirrorFilterInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterInput"}
+ if s.TrafficMirrorFilterId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTrafficMirrorFilterInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *DeleteTrafficMirrorFilterInput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+type DeleteTrafficMirrorFilterOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Traffic Mirror filter.
+ TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorFilterOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorFilterOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *DeleteTrafficMirrorFilterOutput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterOutput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+type DeleteTrafficMirrorFilterRuleInput 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 Traffic Mirror rule.
+ //
+ // TrafficMirrorFilterRuleId is a required field
+ TrafficMirrorFilterRuleId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorFilterRuleInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorFilterRuleInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTrafficMirrorFilterRuleInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterRuleInput"}
+ if s.TrafficMirrorFilterRuleId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterRuleId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTrafficMirrorFilterRuleInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterRuleInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value.
+func (s *DeleteTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleInput {
+ s.TrafficMirrorFilterRuleId = &v
+ return s
+}
+
+type DeleteTrafficMirrorFilterRuleOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the deleted Traffic Mirror rule.
+ TrafficMirrorFilterRuleId *string `locationName:"trafficMirrorFilterRuleId" type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorFilterRuleOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorFilterRuleOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value.
+func (s *DeleteTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleOutput {
+ s.TrafficMirrorFilterRuleId = &v
+ return s
+}
+
+type DeleteTrafficMirrorSessionInput 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 Traffic Mirror session.
+ //
+ // TrafficMirrorSessionId is a required field
+ TrafficMirrorSessionId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorSessionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorSessionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTrafficMirrorSessionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorSessionInput"}
+ if s.TrafficMirrorSessionId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorSessionId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTrafficMirrorSessionInput) SetDryRun(v bool) *DeleteTrafficMirrorSessionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value.
+func (s *DeleteTrafficMirrorSessionInput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionInput {
+ s.TrafficMirrorSessionId = &v
+ return s
+}
+
+type DeleteTrafficMirrorSessionOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the deleted Traffic Mirror session.
+ TrafficMirrorSessionId *string `locationName:"trafficMirrorSessionId" type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorSessionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorSessionOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value.
+func (s *DeleteTrafficMirrorSessionOutput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionOutput {
+ s.TrafficMirrorSessionId = &v
+ return s
+}
+
+type DeleteTrafficMirrorTargetInput 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 Traffic Mirror target.
+ //
+ // TrafficMirrorTargetId is a required field
+ TrafficMirrorTargetId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorTargetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorTargetInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTrafficMirrorTargetInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorTargetInput"}
+ if s.TrafficMirrorTargetId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTrafficMirrorTargetInput) SetDryRun(v bool) *DeleteTrafficMirrorTargetInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *DeleteTrafficMirrorTargetInput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetInput {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+type DeleteTrafficMirrorTargetOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the deleted Traffic Mirror target.
+ TrafficMirrorTargetId *string `locationName:"trafficMirrorTargetId" type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteTrafficMirrorTargetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTrafficMirrorTargetOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *DeleteTrafficMirrorTargetOutput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetOutput {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+type DeleteTransitGatewayInput 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 transit gateway.
+ //
+ // TransitGatewayId is a required field
+ TransitGatewayId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTransitGatewayInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayInput"}
+ if s.TransitGatewayId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTransitGatewayInput) SetDryRun(v bool) *DeleteTransitGatewayInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *DeleteTransitGatewayInput) SetTransitGatewayId(v string) *DeleteTransitGatewayInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
+type DeleteTransitGatewayOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the deleted transit gateway.
+ TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGateway sets the TransitGateway field's value.
+func (s *DeleteTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *DeleteTransitGatewayOutput {
+ s.TransitGateway = v
+ return s
+}
+
+type DeleteTransitGatewayRouteInput struct {
+ _ struct{} `type:"structure"`
+
+ // The CIDR range for the route. This must match the CIDR for the route exactly.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayRouteInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayRouteInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTransitGatewayRouteInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteInput"}
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *DeleteTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *DeleteTransitGatewayRouteInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTransitGatewayRouteInput) SetDryRun(v bool) *DeleteTransitGatewayRouteInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *DeleteTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type DeleteTransitGatewayRouteOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the route.
+ Route *TransitGatewayRoute `locationName:"route" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayRouteOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayRouteOutput) GoString() string {
+ return s.String()
+}
+
+// SetRoute sets the Route field's value.
+func (s *DeleteTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *DeleteTransitGatewayRouteOutput {
+ s.Route = v
+ return s
+}
+
+type DeleteTransitGatewayRouteTableInput 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 transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayRouteTableInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayRouteTableInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTransitGatewayRouteTableInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteTableInput"}
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTransitGatewayRouteTableInput) SetDryRun(v bool) *DeleteTransitGatewayRouteTableInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *DeleteTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteTableInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type DeleteTransitGatewayRouteTableOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the deleted transit gateway route table.
+ TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayRouteTableOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayRouteTableOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value.
+func (s *DeleteTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *DeleteTransitGatewayRouteTableOutput {
+ s.TransitGatewayRouteTable = v
+ return s
+}
+
+type DeleteTransitGatewayVpcAttachmentInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayVpcAttachmentInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayVpcAttachmentInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTransitGatewayVpcAttachmentInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayVpcAttachmentInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeleteTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *DeleteTransitGatewayVpcAttachmentInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *DeleteTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *DeleteTransitGatewayVpcAttachmentInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+type DeleteTransitGatewayVpcAttachmentOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the deleted VPC attachment.
+ TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteTransitGatewayVpcAttachmentOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTransitGatewayVpcAttachmentOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value.
+func (s *DeleteTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *DeleteTransitGatewayVpcAttachmentOutput {
+ s.TransitGatewayVpcAttachment = v
+ return s
+}
+
// Contains the parameters for DeleteVolume.
type DeleteVolumeInput struct {
_ struct{} `type:"structure"`
@@ -33636,7 +47688,6 @@ func (s *DeleteVpcEndpointsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *Delet
return s
}
-// Contains the parameters for DeleteVpc.
type DeleteVpcInput struct {
_ struct{} `type:"structure"`
@@ -33701,7 +47752,6 @@ func (s DeleteVpcOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DeleteVpcPeeringConnection.
type DeleteVpcPeeringConnectionInput struct {
_ struct{} `type:"structure"`
@@ -33752,7 +47802,6 @@ func (s *DeleteVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *D
return s
}
-// Contains the output of DeleteVpcPeeringConnection.
type DeleteVpcPeeringConnectionOutput struct {
_ struct{} `type:"structure"`
@@ -33973,6 +48022,80 @@ func (s DeleteVpnGatewayOutput) GoString() string {
return s.String()
}
+type DeprovisionByoipCidrInput struct {
+ _ struct{} `type:"structure"`
+
+ // The public IPv4 address range, in CIDR notation. The prefix must be the same
+ // prefix that you specified when you provisioned the address range.
+ //
+ // Cidr is a required field
+ Cidr *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s DeprovisionByoipCidrInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeprovisionByoipCidrInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeprovisionByoipCidrInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeprovisionByoipCidrInput"}
+ if s.Cidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cidr"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCidr sets the Cidr field's value.
+func (s *DeprovisionByoipCidrInput) SetCidr(v string) *DeprovisionByoipCidrInput {
+ s.Cidr = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DeprovisionByoipCidrInput) SetDryRun(v bool) *DeprovisionByoipCidrInput {
+ s.DryRun = &v
+ return s
+}
+
+type DeprovisionByoipCidrOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the address range.
+ ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeprovisionByoipCidrOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeprovisionByoipCidrOutput) GoString() string {
+ return s.String()
+}
+
+// SetByoipCidr sets the ByoipCidr field's value.
+func (s *DeprovisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *DeprovisionByoipCidrOutput {
+ s.ByoipCidr = v
+ return s
+}
+
// Contains the parameters for DeregisterImage.
type DeregisterImageInput struct {
_ struct{} `type:"structure"`
@@ -34038,11 +48161,10 @@ func (s DeregisterImageOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DescribeAccountAttributes.
type DescribeAccountAttributesInput struct {
_ struct{} `type:"structure"`
- // One or more account attribute names.
+ // The account attribute names.
AttributeNames []*string `locationName:"attributeName" locationNameList:"attributeName" type:"list"`
// Checks whether you have the required permissions for the action, without
@@ -34074,11 +48196,10 @@ func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttri
return s
}
-// Contains the output of DescribeAccountAttributes.
type DescribeAccountAttributesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more account attributes.
+ // Information about the account attributes.
AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"`
}
@@ -34098,13 +48219,10 @@ func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttri
return s
}
-// Contains the parameters for DescribeAddresses.
type DescribeAddressesInput struct {
_ struct{} `type:"structure"`
- // [EC2-VPC] One or more allocation IDs.
- //
- // Default: Describes all your Elastic IP addresses.
+ // [EC2-VPC] Information about the allocation IDs.
AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"`
// Checks whether you have the required permissions for the action, without
@@ -34135,20 +48253,18 @@ type DescribeAddressesInput struct {
//
// * public-ip - The Elastic IP address.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of the tag's key). If you want to
- // list only resources where Purpose is X, see the tag:key=value filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // [EC2-Classic] One or more Elastic IP addresses.
+ // One or more Elastic IP addresses.
//
// Default: Describes all your Elastic IP addresses.
PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"`
@@ -34188,11 +48304,10 @@ func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInp
return s
}
-// Contains the output of DescribeAddresses.
type DescribeAddressesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more Elastic IP addresses.
+ // Information about the Elastic IP addresses.
Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"`
}
@@ -34244,9 +48359,9 @@ type DescribeAggregateIdFormatOutput struct {
// Information about each resource's ID format.
Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"`
- // Indicates whether all resource types in the region are configured to use
+ // Indicates whether all resource types in the Region are configured to use
// longer IDs. This value is only true if all users are configured to use longer
- // IDs for all resources types in the region.
+ // IDs for all resources types in the Region.
UseLongIdsAggregated *bool `locationName:"useLongIdsAggregated" type:"boolean"`
}
@@ -34272,7 +48387,6 @@ func (s *DescribeAggregateIdFormatOutput) SetUseLongIdsAggregated(v bool) *Descr
return s
}
-// Contains the parameters for DescribeAvailabilityZones.
type DescribeAvailabilityZonesInput struct {
_ struct{} `type:"structure"`
@@ -34282,20 +48396,25 @@ type DescribeAvailabilityZonesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * message - Information about the Availability Zone.
//
- // * region-name - The name of the region for the Availability Zone (for
+ // * region-name - The name of the Region for the Availability Zone (for
// example, us-east-1).
//
// * state - The state of the Availability Zone (available | information
// | impaired | unavailable).
//
+ // * zone-id - The ID of the Availability Zone (for example, use1-az1).
+ //
// * zone-name - The name of the Availability Zone (for example, us-east-1a).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The names of one or more Availability Zones.
+ // The IDs of the Availability Zones.
+ ZoneIds []*string `locationName:"ZoneId" locationNameList:"ZoneId" type:"list"`
+
+ // The names of the Availability Zones.
ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"`
}
@@ -34321,17 +48440,22 @@ func (s *DescribeAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeAvaila
return s
}
+// SetZoneIds sets the ZoneIds field's value.
+func (s *DescribeAvailabilityZonesInput) SetZoneIds(v []*string) *DescribeAvailabilityZonesInput {
+ s.ZoneIds = v
+ return s
+}
+
// SetZoneNames sets the ZoneNames field's value.
func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvailabilityZonesInput {
s.ZoneNames = v
return s
}
-// Contains the output of DescribeAvailabiltyZones.
type DescribeAvailabilityZonesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more Availability Zones.
+ // Information about the Availability Zones.
AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"`
}
@@ -34351,11 +48475,10 @@ func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*Availability
return s
}
-// Contains the parameters for DescribeBundleTasks.
type DescribeBundleTasksInput struct {
_ struct{} `type:"structure"`
- // One or more bundle task IDs.
+ // The bundle task IDs.
//
// Default: Describes all your bundle tasks.
BundleIds []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"`
@@ -34366,7 +48489,7 @@ type DescribeBundleTasksInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * bundle-id - The ID of the bundle task.
//
@@ -34420,11 +48543,10 @@ func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksI
return s
}
-// Contains the output of DescribeBundleTasks.
type DescribeBundleTasksOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more bundle tasks.
+ // Information about the bundle tasks.
BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"`
}
@@ -34444,7 +48566,212 @@ func (s *DescribeBundleTasksOutput) SetBundleTasks(v []*BundleTask) *DescribeBun
return s
}
-// Contains the parameters for DescribeClassicLinkInstances.
+type DescribeByoipCidrsInput 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 maximum number of results to return with a single call. To retrieve the
+ // remaining results, make another call with the returned nextToken value.
+ //
+ // MaxResults is a required field
+ MaxResults *int64 `min:"1" type:"integer" required:"true"`
+
+ // The token for the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeByoipCidrsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeByoipCidrsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeByoipCidrsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeByoipCidrsInput"}
+ if s.MaxResults == nil {
+ invalidParams.Add(request.NewErrParamRequired("MaxResults"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeByoipCidrsInput) SetDryRun(v bool) *DescribeByoipCidrsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeByoipCidrsInput) SetMaxResults(v int64) *DescribeByoipCidrsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeByoipCidrsInput) SetNextToken(v string) *DescribeByoipCidrsInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeByoipCidrsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about your address ranges.
+ ByoipCidrs []*ByoipCidr `locationName:"byoipCidrSet" 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
+func (s DescribeByoipCidrsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeByoipCidrsOutput) GoString() string {
+ return s.String()
+}
+
+// SetByoipCidrs sets the ByoipCidrs field's value.
+func (s *DescribeByoipCidrsOutput) SetByoipCidrs(v []*ByoipCidr) *DescribeByoipCidrsOutput {
+ s.ByoipCidrs = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeByoipCidrsOutput) SetNextToken(v string) *DescribeByoipCidrsOutput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeCapacityReservationsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Capacity Reservation.
+ CapacityReservationIds []*string `locationName:"CapacityReservationId" locationNameList:"item" type:"list"`
+
+ // 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"`
+
+ // One or more filters.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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.
+ MaxResults *int64 `min:"1" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeCapacityReservationsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeCapacityReservationsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeCapacityReservationsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeCapacityReservationsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCapacityReservationIds sets the CapacityReservationIds field's value.
+func (s *DescribeCapacityReservationsInput) SetCapacityReservationIds(v []*string) *DescribeCapacityReservationsInput {
+ s.CapacityReservationIds = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeCapacityReservationsInput) SetDryRun(v bool) *DescribeCapacityReservationsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeCapacityReservationsInput) SetFilters(v []*Filter) *DescribeCapacityReservationsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeCapacityReservationsInput) SetMaxResults(v int64) *DescribeCapacityReservationsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeCapacityReservationsInput) SetNextToken(v string) *DescribeCapacityReservationsInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeCapacityReservationsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Capacity Reservations.
+ CapacityReservations []*CapacityReservation `locationName:"capacityReservationSet" 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
+func (s DescribeCapacityReservationsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeCapacityReservationsOutput) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservations sets the CapacityReservations field's value.
+func (s *DescribeCapacityReservationsOutput) SetCapacityReservations(v []*CapacityReservation) *DescribeCapacityReservationsOutput {
+ s.CapacityReservations = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeCapacityReservationsOutput) SetNextToken(v string) *DescribeCapacityReservationsOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeClassicLinkInstancesInput struct {
_ struct{} `type:"structure"`
@@ -34461,36 +48788,30 @@ type DescribeClassicLinkInstancesInput struct {
//
// * instance-id - The ID of the instance.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
- //
- // * vpc-id - The ID of the VPC that the instance is linked to.
+ // * vpc-id - The ID of the VPC to which the instance is linked. vpc-id -
+ // The ID of the VPC that the instance is linked to.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// One or more instance IDs. Must be instances linked to a VPC through ClassicLink.
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"`
- // The maximum number of results to return for the request in a single page.
- // The remaining results of the initial request can be seen by sending another
- // request with the returned NextToken value. This value can be between 5 and
- // 1000; if MaxResults is given a value larger than 1000, only 1000 results
- // are returned. You cannot specify this parameter and the instance IDs parameter
- // in the same request.
+ // The maximum number of results to return with a single call. To retrieve the
+ // remaining results, make another call with the returned nextToken value.
//
// Constraint: If the value is greater than 1000, we return only 1000 items.
- MaxResults *int64 `locationName:"maxResults" type:"integer"`
+ MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"`
- // The token to retrieve the next page of results.
+ // The token for the next page of results.
NextToken *string `locationName:"nextToken" type:"string"`
}
@@ -34504,6 +48825,19 @@ func (s DescribeClassicLinkInstancesInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClassicLinkInstancesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClassicLinkInstancesInput"}
+ 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 *DescribeClassicLinkInstancesInput) SetDryRun(v bool) *DescribeClassicLinkInstancesInput {
s.DryRun = &v
@@ -34534,7 +48868,6 @@ func (s *DescribeClassicLinkInstancesInput) SetNextToken(v string) *DescribeClas
return s
}
-// Contains the output of DescribeClassicLinkInstances.
type DescribeClassicLinkInstancesOutput struct {
_ struct{} `type:"structure"`
@@ -34568,11 +48901,589 @@ func (s *DescribeClassicLinkInstancesOutput) SetNextToken(v string) *DescribeCla
return s
}
-// Contains the parameters for DescribeConversionTasks.
+type DescribeClientVpnAuthorizationRulesInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // One or more filters. Filter names and values are case-sensitive.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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 nextToken
+ // value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnAuthorizationRulesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnAuthorizationRulesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClientVpnAuthorizationRulesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnAuthorizationRulesInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DescribeClientVpnAuthorizationRulesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnAuthorizationRulesInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeClientVpnAuthorizationRulesInput) SetDryRun(v bool) *DescribeClientVpnAuthorizationRulesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeClientVpnAuthorizationRulesInput) SetFilters(v []*Filter) *DescribeClientVpnAuthorizationRulesInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeClientVpnAuthorizationRulesInput) SetMaxResults(v int64) *DescribeClientVpnAuthorizationRulesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnAuthorizationRulesInput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnAuthorizationRulesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the authorization rules.
+ AuthorizationRules []*AuthorizationRule `locationName:"authorizationRule" 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
+func (s DescribeClientVpnAuthorizationRulesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnAuthorizationRulesOutput) GoString() string {
+ return s.String()
+}
+
+// SetAuthorizationRules sets the AuthorizationRules field's value.
+func (s *DescribeClientVpnAuthorizationRulesOutput) SetAuthorizationRules(v []*AuthorizationRule) *DescribeClientVpnAuthorizationRulesOutput {
+ s.AuthorizationRules = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnAuthorizationRulesOutput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesOutput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnConnectionsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // One or more filters. Filter names and values are case-sensitive.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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 nextToken
+ // value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnConnectionsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnConnectionsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClientVpnConnectionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnConnectionsInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DescribeClientVpnConnectionsInput) SetClientVpnEndpointId(v string) *DescribeClientVpnConnectionsInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeClientVpnConnectionsInput) SetDryRun(v bool) *DescribeClientVpnConnectionsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeClientVpnConnectionsInput) SetFilters(v []*Filter) *DescribeClientVpnConnectionsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeClientVpnConnectionsInput) SetMaxResults(v int64) *DescribeClientVpnConnectionsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnConnectionsInput) SetNextToken(v string) *DescribeClientVpnConnectionsInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnConnectionsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the active and terminated client connections.
+ Connections []*ClientVpnConnection `locationName:"connections" 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
+func (s DescribeClientVpnConnectionsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnConnectionsOutput) GoString() string {
+ return s.String()
+}
+
+// SetConnections sets the Connections field's value.
+func (s *DescribeClientVpnConnectionsOutput) SetConnections(v []*ClientVpnConnection) *DescribeClientVpnConnectionsOutput {
+ s.Connections = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnConnectionsOutput) SetNextToken(v string) *DescribeClientVpnConnectionsOutput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnEndpointsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ ClientVpnEndpointIds []*string `locationName:"ClientVpnEndpointId" locationNameList:"item" type:"list"`
+
+ // 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"`
+
+ // One or more filters. Filter names and values are case-sensitive.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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 nextToken
+ // value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnEndpointsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnEndpointsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClientVpnEndpointsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnEndpointsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointIds sets the ClientVpnEndpointIds field's value.
+func (s *DescribeClientVpnEndpointsInput) SetClientVpnEndpointIds(v []*string) *DescribeClientVpnEndpointsInput {
+ s.ClientVpnEndpointIds = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeClientVpnEndpointsInput) SetDryRun(v bool) *DescribeClientVpnEndpointsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeClientVpnEndpointsInput) SetFilters(v []*Filter) *DescribeClientVpnEndpointsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeClientVpnEndpointsInput) SetMaxResults(v int64) *DescribeClientVpnEndpointsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnEndpointsInput) SetNextToken(v string) *DescribeClientVpnEndpointsInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnEndpointsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Client VPN endpoints.
+ ClientVpnEndpoints []*ClientVpnEndpoint `locationName:"clientVpnEndpoint" 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
+func (s DescribeClientVpnEndpointsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnEndpointsOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientVpnEndpoints sets the ClientVpnEndpoints field's value.
+func (s *DescribeClientVpnEndpointsOutput) SetClientVpnEndpoints(v []*ClientVpnEndpoint) *DescribeClientVpnEndpointsOutput {
+ s.ClientVpnEndpoints = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnEndpointsOutput) SetNextToken(v string) *DescribeClientVpnEndpointsOutput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnRoutesInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // One or more filters. Filter names and values are case-sensitive.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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 nextToken
+ // value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnRoutesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnRoutesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClientVpnRoutesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnRoutesInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DescribeClientVpnRoutesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnRoutesInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeClientVpnRoutesInput) SetDryRun(v bool) *DescribeClientVpnRoutesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeClientVpnRoutesInput) SetFilters(v []*Filter) *DescribeClientVpnRoutesInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeClientVpnRoutesInput) SetMaxResults(v int64) *DescribeClientVpnRoutesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnRoutesInput) SetNextToken(v string) *DescribeClientVpnRoutesInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnRoutesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the Client VPN endpoint routes.
+ Routes []*ClientVpnRoute `locationName:"routes" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnRoutesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnRoutesOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnRoutesOutput) SetNextToken(v string) *DescribeClientVpnRoutesOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetRoutes sets the Routes field's value.
+func (s *DescribeClientVpnRoutesOutput) SetRoutes(v []*ClientVpnRoute) *DescribeClientVpnRoutesOutput {
+ s.Routes = v
+ return s
+}
+
+type DescribeClientVpnTargetNetworksInput struct {
+ _ struct{} `type:"structure"`
+
+ // The IDs of the target network associations.
+ AssociationIds []*string `locationNameList:"item" type:"list"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // One or more filters. Filter names and values are case-sensitive.
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" 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 nextToken
+ // value.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DescribeClientVpnTargetNetworksInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnTargetNetworksInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeClientVpnTargetNetworksInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnTargetNetworksInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAssociationIds sets the AssociationIds field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetAssociationIds(v []*string) *DescribeClientVpnTargetNetworksInput {
+ s.AssociationIds = v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetClientVpnEndpointId(v string) *DescribeClientVpnTargetNetworksInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetDryRun(v bool) *DescribeClientVpnTargetNetworksInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetFilters(v []*Filter) *DescribeClientVpnTargetNetworksInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetMaxResults(v int64) *DescribeClientVpnTargetNetworksInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnTargetNetworksInput) SetNextToken(v string) *DescribeClientVpnTargetNetworksInput {
+ s.NextToken = &v
+ return s
+}
+
+type DescribeClientVpnTargetNetworksOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the associated target networks.
+ ClientVpnTargetNetworks []*TargetNetwork `locationName:"clientVpnTargetNetworks" 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
+func (s DescribeClientVpnTargetNetworksOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeClientVpnTargetNetworksOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientVpnTargetNetworks sets the ClientVpnTargetNetworks field's value.
+func (s *DescribeClientVpnTargetNetworksOutput) SetClientVpnTargetNetworks(v []*TargetNetwork) *DescribeClientVpnTargetNetworksOutput {
+ s.ClientVpnTargetNetworks = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeClientVpnTargetNetworksOutput) SetNextToken(v string) *DescribeClientVpnTargetNetworksOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeConversionTasksInput struct {
_ struct{} `type:"structure"`
- // One or more conversion task IDs.
+ // The conversion task IDs.
ConversionTaskIds []*string `locationName:"conversionTaskId" locationNameList:"item" type:"list"`
// Checks whether you have the required permissions for the action, without
@@ -34604,7 +49515,6 @@ func (s *DescribeConversionTasksInput) SetDryRun(v bool) *DescribeConversionTask
return s
}
-// Contains the output for DescribeConversionTasks.
type DescribeConversionTasksOutput struct {
_ struct{} `type:"structure"`
@@ -34659,21 +49569,15 @@ type DescribeCustomerGatewaysInput struct {
// * type - The type of customer gateway. Currently, the only supported type
// is ipsec.1.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
}
@@ -34729,7 +49633,6 @@ func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGatewa
return s
}
-// Contains the parameters for DescribeDhcpOptions.
type DescribeDhcpOptionsInput struct {
_ struct{} `type:"structure"`
@@ -34746,28 +49649,31 @@ type DescribeDhcpOptionsInput struct {
// One or more filters.
//
- // * dhcp-options-id - The ID of a set of DHCP options.
+ // * dhcp-options-id - The ID of a DHCP options set.
//
// * key - The key for one of the options (for example, domain-name).
//
// * value - The value for one of the options.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * owner-id - The ID of the AWS account that owns the DHCP options set.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
+ // * tag: - 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.
//
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
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"`
}
// String returns the string representation
@@ -34780,6 +49686,19 @@ func (s DescribeDhcpOptionsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeDhcpOptionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeDhcpOptionsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetDhcpOptionsIds sets the DhcpOptionsIds field's value.
func (s *DescribeDhcpOptionsInput) SetDhcpOptionsIds(v []*string) *DescribeDhcpOptionsInput {
s.DhcpOptionsIds = v
@@ -34798,12 +49717,27 @@ func (s *DescribeDhcpOptionsInput) SetFilters(v []*Filter) *DescribeDhcpOptionsI
return s
}
-// Contains the output of DescribeDhcpOptions.
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeDhcpOptionsInput) SetMaxResults(v int64) *DescribeDhcpOptionsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeDhcpOptionsInput) SetNextToken(v string) *DescribeDhcpOptionsInput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeDhcpOptionsOutput struct {
_ struct{} `type:"structure"`
// Information about one or more DHCP options sets.
DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" 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
@@ -34822,6 +49756,12 @@ func (s *DescribeDhcpOptionsOutput) SetDhcpOptions(v []*DhcpOptions) *DescribeDh
return s
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeDhcpOptionsOutput) SetNextToken(v string) *DescribeDhcpOptionsOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeEgressOnlyInternetGatewaysInput struct {
_ struct{} `type:"structure"`
@@ -34831,16 +49771,14 @@ type DescribeEgressOnlyInternetGatewaysInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more egress-only Internet gateway IDs.
+ // One or more egress-only internet gateway IDs.
EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" 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 1000; if MaxResults is given
- // a value larger than 1000, only 1000 results are returned.
- MaxResults *int64 `type:"integer"`
+ // 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 to retrieve the next page of results.
+ // The token for the next page of results.
NextToken *string `type:"string"`
}
@@ -34854,6 +49792,19 @@ func (s DescribeEgressOnlyInternetGatewaysInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeEgressOnlyInternetGatewaysInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeEgressOnlyInternetGatewaysInput"}
+ 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 *DescribeEgressOnlyInternetGatewaysInput) SetDryRun(v bool) *DescribeEgressOnlyInternetGatewaysInput {
s.DryRun = &v
@@ -34881,10 +49832,11 @@ func (s *DescribeEgressOnlyInternetGatewaysInput) SetNextToken(v string) *Descri
type DescribeEgressOnlyInternetGatewaysOutput struct {
_ struct{} `type:"structure"`
- // Information about the egress-only Internet gateways.
+ // Information about the egress-only internet gateways.
EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"`
- // The token to use to retrieve the next page of results.
+ // 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"`
}
@@ -34919,26 +49871,30 @@ type DescribeElasticGpusInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more Elastic GPU IDs.
+ // The Elastic Graphics accelerator IDs.
ElasticGpuIds []*string `locationName:"ElasticGpuId" locationNameList:"item" type:"list"`
- // One or more filters.
+ // The filters.
//
- // * availability-zone - The Availability Zone in which the Elastic GPU resides.
+ // * availability-zone - The Availability Zone in which the Elastic Graphics
+ // accelerator resides.
//
- // * elastic-gpu-health - The status of the Elastic GPU (OK | IMPAIRED).
+ // * elastic-gpu-health - The status of the Elastic Graphics accelerator
+ // (OK | IMPAIRED).
//
- // * elastic-gpu-state - The state of the Elastic GPU (ATTACHED).
+ // * elastic-gpu-state - The state of the Elastic Graphics accelerator (ATTACHED).
//
- // * elastic-gpu-type - The type of Elastic GPU; for example, eg1.medium.
+ // * elastic-gpu-type - The type of Elastic Graphics accelerator; for example,
+ // eg1.medium.
//
- // * instance-id - The ID of the instance to which the Elastic GPU is associated.
+ // * instance-id - The ID of the instance to which the Elastic Graphics accelerator
+ // is associated.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value. This
// value can be between 5 and 1000.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"10" type:"integer"`
// The token to request the next page of results.
NextToken *string `type:"string"`
@@ -34954,6 +49910,19 @@ func (s DescribeElasticGpusInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeElasticGpusInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeElasticGpusInput"}
+ if s.MaxResults != nil && *s.MaxResults < 10 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetDryRun sets the DryRun field's value.
func (s *DescribeElasticGpusInput) SetDryRun(v bool) *DescribeElasticGpusInput {
s.DryRun = &v
@@ -34987,7 +49956,7 @@ func (s *DescribeElasticGpusInput) SetNextToken(v string) *DescribeElasticGpusIn
type DescribeElasticGpusOutput struct {
_ struct{} `type:"structure"`
- // Information about the Elastic GPUs.
+ // Information about the Elastic Graphics accelerators.
ElasticGpuSet []*ElasticGpus `locationName:"elasticGpuSet" locationNameList:"item" type:"list"`
// The total number of items to return. If the total number of items available
@@ -35028,11 +49997,10 @@ func (s *DescribeElasticGpusOutput) SetNextToken(v string) *DescribeElasticGpusO
return s
}
-// Contains the parameters for DescribeExportTasks.
type DescribeExportTasksInput struct {
_ struct{} `type:"structure"`
- // One or more export task IDs.
+ // The export task IDs.
ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"`
}
@@ -35052,7 +50020,6 @@ func (s *DescribeExportTasksInput) SetExportTaskIds(v []*string) *DescribeExport
return s
}
-// Contains the output for DescribeExportTasks.
type DescribeExportTasksOutput struct {
_ struct{} `type:"structure"`
@@ -35076,6 +50043,62 @@ func (s *DescribeExportTasksOutput) SetExportTasks(v []*ExportTask) *DescribeExp
return s
}
+// Describes the instances that could not be launched by the fleet.
+type DescribeFleetError 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).
+ 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 ee Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html).
+ ErrorMessage *string `locationName:"errorMessage" type:"string"`
+
+ // The launch templates and overrides that were used for launching the instances.
+ // Any parameters that you specify in the Overrides override the same parameters
+ // in the launch template.
+ LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"`
+
+ // Indicates if the instance that could not be launched was a Spot Instance
+ // or On-Demand Instance.
+ Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"`
+}
+
+// String returns the string representation
+func (s DescribeFleetError) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeFleetError) GoString() string {
+ return s.String()
+}
+
+// SetErrorCode sets the ErrorCode field's value.
+func (s *DescribeFleetError) SetErrorCode(v string) *DescribeFleetError {
+ s.ErrorCode = &v
+ return s
+}
+
+// SetErrorMessage sets the ErrorMessage field's value.
+func (s *DescribeFleetError) SetErrorMessage(v string) *DescribeFleetError {
+ s.ErrorMessage = &v
+ return s
+}
+
+// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value.
+func (s *DescribeFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetError {
+ s.LaunchTemplateAndOverrides = v
+ return s
+}
+
+// SetLifecycle sets the Lifecycle field's value.
+func (s *DescribeFleetError) SetLifecycle(v string) *DescribeFleetError {
+ s.Lifecycle = &v
+ return s
+}
+
type DescribeFleetHistoryInput struct {
_ struct{} `type:"structure"`
@@ -35104,7 +50127,7 @@ type DescribeFleetHistoryInput struct {
// The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
//
// StartTime is a required field
- StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ StartTime *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@@ -35182,13 +50205,13 @@ type DescribeFleetHistoryOutput struct {
// All records up to this time were retrieved.
//
// If nextToken indicates that there are more results, this value is not present.
- LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601"`
+ LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp"`
// The token for the next set of results.
NextToken *string `locationName:"nextToken" type:"string"`
// The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
}
// String returns the string representation
@@ -35240,7 +50263,9 @@ type DescribeFleetInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
+ //
+ // * instance-type - The instance type.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The ID of the EC2 Fleet.
@@ -35361,7 +50386,22 @@ type DescribeFleetsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
+ //
+ // * activity-status - The progress of the EC2 Fleet ( error | pending-fulfillment
+ // | pending-termination | fulfilled).
+ //
+ // * excess-capacity-termination-policy - Indicates whether to terminate
+ // running instances if the target capacity is decreased below the current
+ // EC2 Fleet size (true | false).
+ //
+ // * fleet-state - The state of the EC2 Fleet (submitted | active | deleted
+ // | failed | deleted-running | deleted-terminating | modifying).
+ //
+ // * replace-unhealthy-instances - Indicates whether EC2 Fleet should replace
+ // unhealthy instances (true | false).
+ //
+ // * type - The type of request (instant | request | maintain).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The ID of the EC2 Fleets.
@@ -35416,10 +50456,73 @@ func (s *DescribeFleetsInput) SetNextToken(v string) *DescribeFleetsInput {
return s
}
+// Describes the instances that were launched by the fleet.
+type DescribeFleetsInstances struct {
+ _ struct{} `type:"structure"`
+
+ // The IDs of the instances.
+ InstanceIds []*string `locationName:"instanceIds" locationNameList:"item" type:"list"`
+
+ // The instance type.
+ InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
+
+ // The launch templates and overrides that were used for launching the instances.
+ // Any parameters that you specify in the Overrides override the same parameters
+ // in the launch template.
+ LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"`
+
+ // Indicates if the instance that was launched is a Spot Instance or On-Demand
+ // Instance.
+ Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"`
+
+ // The value is Windows for Windows instances; otherwise blank.
+ Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"`
+}
+
+// String returns the string representation
+func (s DescribeFleetsInstances) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeFleetsInstances) GoString() string {
+ return s.String()
+}
+
+// SetInstanceIds sets the InstanceIds field's value.
+func (s *DescribeFleetsInstances) SetInstanceIds(v []*string) *DescribeFleetsInstances {
+ s.InstanceIds = v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *DescribeFleetsInstances) SetInstanceType(v string) *DescribeFleetsInstances {
+ s.InstanceType = &v
+ return s
+}
+
+// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value.
+func (s *DescribeFleetsInstances) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetsInstances {
+ s.LaunchTemplateAndOverrides = v
+ return s
+}
+
+// SetLifecycle sets the Lifecycle field's value.
+func (s *DescribeFleetsInstances) SetLifecycle(v string) *DescribeFleetsInstances {
+ s.Lifecycle = &v
+ return s
+}
+
+// SetPlatform sets the Platform field's value.
+func (s *DescribeFleetsInstances) SetPlatform(v string) *DescribeFleetsInstances {
+ s.Platform = &v
+ return s
+}
+
type DescribeFleetsOutput struct {
_ struct{} `type:"structure"`
- // The EC2 Fleets.
+ // Information about the EC2 Fleets.
Fleets []*FleetData `locationName:"fleetSet" locationNameList:"item" type:"list"`
// The token for the next set of results.
@@ -35448,34 +50551,42 @@ func (s *DescribeFleetsOutput) SetNextToken(v string) *DescribeFleetsOutput {
return s
}
-// Contains the parameters for DescribeFlowLogs.
type DescribeFlowLogsInput 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"`
+
// One or more filters.
//
// * deliver-log-status - The status of the logs delivery (SUCCESS | FAILED).
//
+ // * log-destination-type - The type of destination to which the flow log
+ // publishes data. Possible destination types include cloud-watch-logs and
+ // S3.
+ //
// * flow-log-id - The ID of the flow log.
//
// * log-group-name - The name of the log group.
//
// * resource-id - The ID of the VPC, subnet, or network interface.
//
- // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL)
+ // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL).
Filter []*Filter `locationNameList:"Filter" type:"list"`
// One or more flow log IDs.
+ //
+ // Constraint: Maximum of 1000 flow log IDs.
FlowLogIds []*string `locationName:"FlowLogId" 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 1000; if MaxResults is given
- // a value larger than 1000, only 1000 results are returned. You cannot specify
- // this parameter and the flow log IDs parameter in the same request.
+ // 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 `type:"integer"`
- // The token to retrieve the next page of results.
+ // The token for the next page of results.
NextToken *string `type:"string"`
}
@@ -35489,6 +50600,12 @@ func (s DescribeFlowLogsInput) GoString() string {
return s.String()
}
+// SetDryRun sets the DryRun field's value.
+func (s *DescribeFlowLogsInput) SetDryRun(v bool) *DescribeFlowLogsInput {
+ s.DryRun = &v
+ return s
+}
+
// SetFilter sets the Filter field's value.
func (s *DescribeFlowLogsInput) SetFilter(v []*Filter) *DescribeFlowLogsInput {
s.Filter = v
@@ -35513,7 +50630,6 @@ func (s *DescribeFlowLogsInput) SetNextToken(v string) *DescribeFlowLogsInput {
return s
}
-// Contains the output of DescribeFlowLogs.
type DescribeFlowLogsOutput struct {
_ struct{} `type:"structure"`
@@ -35643,7 +50759,7 @@ type DescribeFpgaImagesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * create-time - The creation time of the AFI.
//
@@ -35662,33 +50778,27 @@ type DescribeFpgaImagesInput struct {
//
// * state - The state of the AFI (pending | failed | available | unavailable).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * update-time - The time of the most recent update.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more AFI IDs.
+ // The AFI IDs.
FpgaImageIds []*string `locationName:"FpgaImageId" locationNameList:"item" type:"list"`
// The maximum number of results to return in a single call.
MaxResults *int64 `min:"5" type:"integer"`
// The token to retrieve the next page of results.
- NextToken *string `min:"1" type:"string"`
+ NextToken *string `type:"string"`
// Filters the AFI by owner. Specify an AWS account ID, self (owner is the sender
// of the request), or an AWS owner alias (valid values are amazon | aws-marketplace).
@@ -35711,9 +50821,6 @@ func (s *DescribeFpgaImagesInput) Validate() error {
if s.MaxResults != nil && *s.MaxResults < 5 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
}
- if s.NextToken != nil && len(*s.NextToken) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -35760,12 +50867,12 @@ func (s *DescribeFpgaImagesInput) SetOwners(v []*string) *DescribeFpgaImagesInpu
type DescribeFpgaImagesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more FPGA images.
+ // Information about the FPGA images.
FpgaImages []*FpgaImage `locationName:"fpgaImageSet" 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" min:"1" type:"string"`
+ NextToken *string `locationName:"nextToken" type:"string"`
}
// String returns the string representation
@@ -35793,25 +50900,26 @@ func (s *DescribeFpgaImagesOutput) SetNextToken(v string) *DescribeFpgaImagesOut
type DescribeHostReservationOfferingsInput struct {
_ struct{} `type:"structure"`
- // One or more filters.
+ // The filters.
//
- // * instance-family - The instance family of the offering (e.g., m4).
+ // * instance-family - The instance family of the offering (for example,
+ // m4).
//
// * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront).
Filter []*Filter `locationNameList:"Filter" type:"list"`
- // This is the maximum duration of the reservation you'd like to purchase, specified
- // in seconds. Reservations are available in one-year and three-year terms.
- // The number of seconds specified must be the number of seconds in a year (365x24x60x60)
+ // This is the maximum duration of the reservation to purchase, specified in
+ // seconds. Reservations are available in one-year and three-year terms. The
+ // number of seconds specified must be the number of seconds in a year (365x24x60x60)
// times one of the supported durations (1 or 3). For example, specify 94608000
// for three years.
MaxDuration *int64 `type:"integer"`
// 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 will receive an error.
- MaxResults *int64 `type:"integer"`
+ // 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"`
// This is the minimum duration of the reservation you'd like to purchase, specified
// in seconds. Reservations are available in one-year and three-year terms.
@@ -35837,6 +50945,19 @@ func (s DescribeHostReservationOfferingsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeHostReservationOfferingsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeHostReservationOfferingsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetFilter sets the Filter field's value.
func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput {
s.Filter = v
@@ -35909,23 +51030,33 @@ func (s *DescribeHostReservationOfferingsOutput) SetOfferingSet(v []*HostOfferin
type DescribeHostReservationsInput struct {
_ struct{} `type:"structure"`
- // One or more filters.
+ // The filters.
//
- // * instance-family - The instance family (e.g., m4).
+ // * instance-family - The instance family (for example, m4).
//
// * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront).
//
// * state - The state of the reservation (payment-pending | payment-failed
// | active | retired).
+ //
+ // * tag: - 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.
+ //
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filter []*Filter `locationNameList:"Filter" type:"list"`
- // One or more host reservation IDs.
+ // The host reservation IDs.
HostReservationIdSet []*string `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 will receive an error.
+ // 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 `type:"integer"`
// The token to use to retrieve the next page of results.
@@ -35999,18 +51130,17 @@ func (s *DescribeHostReservationsOutput) SetNextToken(v string) *DescribeHostRes
return s
}
-// Contains the parameters for DescribeHosts.
type DescribeHostsInput struct {
_ struct{} `type:"structure"`
- // One or more filters.
+ // The filters.
//
// * auto-placement - Whether auto-placement is enabled or disabled (on |
// off).
//
// * availability-zone - The Availability Zone of the host.
//
- // * client-token - The idempotency token you provided when you allocated
+ // * client-token - The idempotency token that you provided when you allocated
// the host.
//
// * host-reservation-id - The ID of the reservation assigned to this host.
@@ -36020,6 +51150,10 @@ type DescribeHostsInput struct {
//
// * state - The allocation state of the Dedicated Host (available | under-assessment
// | permanent-failure | released | released-permanent-failure).
+ //
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filter []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"`
// The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.
@@ -36027,12 +51161,14 @@ type DescribeHostsInput struct {
// 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 will receive an error. You cannot specify this
- // parameter and the host IDs parameter in the same request.
+ // nextToken value. This value can be between 5 and 500. If maxResults is given
+ // a larger value than 500, you receive an error.
+ //
+ // You cannot specify this parameter and the host IDs parameter in the same
+ // request.
MaxResults *int64 `locationName:"maxResults" type:"integer"`
- // The token to retrieve the next page of results.
+ // The token to use to retrieve the next page of results.
NextToken *string `locationName:"nextToken" type:"string"`
}
@@ -36070,7 +51206,6 @@ func (s *DescribeHostsInput) SetNextToken(v string) *DescribeHostsInput {
return s
}
-// Contains the output of DescribeHosts.
type DescribeHostsOutput struct {
_ struct{} `type:"structure"`
@@ -36107,10 +51242,10 @@ func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput {
type DescribeIamInstanceProfileAssociationsInput struct {
_ struct{} `type:"structure"`
- // One or more IAM instance profile associations.
+ // The IAM instance profile associations.
AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" type:"list"`
- // One or more filters.
+ // The filters.
//
// * instance-id - The ID of the instance.
//
@@ -36123,7 +51258,7 @@ type DescribeIamInstanceProfileAssociationsInput struct {
MaxResults *int64 `min:"5" type:"integer"`
// The token to request the next page of results.
- NextToken *string `min:"1" type:"string"`
+ NextToken *string `type:"string"`
}
// String returns the string representation
@@ -36142,9 +51277,6 @@ func (s *DescribeIamInstanceProfileAssociationsInput) Validate() error {
if s.MaxResults != nil && *s.MaxResults < 5 {
invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
}
- if s.NextToken != nil && len(*s.NextToken) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("NextToken", 1))
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -36179,12 +51311,12 @@ func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *De
type DescribeIamInstanceProfileAssociationsOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more IAM instance profile associations.
+ // Information about the IAM instance profile associations.
IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" 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" min:"1" type:"string"`
+ NextToken *string `locationName:"nextToken" type:"string"`
}
// String returns the string representation
@@ -36209,7 +51341,6 @@ func (s *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *D
return s
}
-// Contains the parameters for DescribeIdFormat.
type DescribeIdFormatInput struct {
_ struct{} `type:"structure"`
@@ -36239,7 +51370,6 @@ func (s *DescribeIdFormatInput) SetResource(v string) *DescribeIdFormatInput {
return s
}
-// Contains the output of DescribeIdFormat.
type DescribeIdFormatOutput struct {
_ struct{} `type:"structure"`
@@ -36263,7 +51393,6 @@ func (s *DescribeIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdFormatOut
return s
}
-// Contains the parameters for DescribeIdentityIdFormat.
type DescribeIdentityIdFormatInput struct {
_ struct{} `type:"structure"`
@@ -36318,7 +51447,6 @@ func (s *DescribeIdentityIdFormatInput) SetResource(v string) *DescribeIdentityI
return s
}
-// Contains the output of DescribeIdentityIdFormat.
type DescribeIdentityIdFormatOutput struct {
_ struct{} `type:"structure"`
@@ -36415,7 +51543,7 @@ func (s *DescribeImageAttributeInput) SetImageId(v string) *DescribeImageAttribu
type DescribeImageAttributeOutput struct {
_ struct{} `type:"structure"`
- // One or more block device mapping entries.
+ // The block device mapping entries.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
// A description for the AMI.
@@ -36427,10 +51555,10 @@ type DescribeImageAttributeOutput struct {
// The kernel ID.
KernelId *AttributeValue `locationName:"kernel" type:"structure"`
- // One or more launch permissions.
+ // The launch permissions.
LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"`
- // One or more product codes.
+ // The product codes.
ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"`
// The RAM disk ID.
@@ -36499,7 +51627,6 @@ func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *De
return s
}
-// Contains the parameters for DescribeImages.
type DescribeImagesInput struct {
_ struct{} `type:"structure"`
@@ -36513,9 +51640,9 @@ type DescribeImagesInput struct {
// account ID, self (the sender of the request), or all (public AMIs).
ExecutableUsers []*string `locationName:"ExecutableBy" locationNameList:"ExecutableBy" type:"list"`
- // One or more filters.
+ // The filters.
//
- // * architecture - The image architecture (i386 | x86_64).
+ // * architecture - The image architecture (i386 | x86_64 | arm64).
//
// * block-device-mapping.delete-on-termination - A Boolean value that indicates
// whether the Amazon EBS volume is deleted on instance termination.
@@ -36532,6 +51659,9 @@ type DescribeImagesInput struct {
// * block-device-mapping.volume-type - The volume type of the EBS volume
// (gp2 | io1 | st1 | sc1 | standard).
//
+ // * block-device-mapping.encrypted - A Boolean that indicates whether the
+ // EBS volume is encrypted.
+ //
// * description - The description of the image (provided during image creation).
//
// * ena-support - A Boolean that indicates whether enhanced networking with
@@ -36579,26 +51709,20 @@ type DescribeImagesInput struct {
// * sriov-net-support - A value of simple indicates that enhanced networking
// with the Intel 82599 VF interface is enabled.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * virtualization-type - The virtualization type (paravirtual | hvm).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more image IDs.
+ // The image IDs.
//
// Default: Describes all images available to you.
ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"`
@@ -36650,11 +51774,10 @@ func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput {
return s
}
-// Contains the output of DescribeImages.
type DescribeImagesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more images.
+ // Information about the images.
Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"`
}
@@ -36674,7 +51797,6 @@ func (s *DescribeImagesOutput) SetImages(v []*Image) *DescribeImagesOutput {
return s
}
-// Contains the parameters for DescribeImportImageTasks.
type DescribeImportImageTasksInput struct {
_ struct{} `type:"structure"`
@@ -36739,7 +51861,6 @@ func (s *DescribeImportImageTasksInput) SetNextToken(v string) *DescribeImportIm
return s
}
-// Contains the output for DescribeImportImageTasks.
type DescribeImportImageTasksOutput struct {
_ struct{} `type:"structure"`
@@ -36774,7 +51895,6 @@ func (s *DescribeImportImageTasksOutput) SetNextToken(v string) *DescribeImportI
return s
}
-// Contains the parameters for DescribeImportSnapshotTasks.
type DescribeImportSnapshotTasksInput struct {
_ struct{} `type:"structure"`
@@ -36784,7 +51904,7 @@ type DescribeImportSnapshotTasksInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
Filters []*Filter `locationNameList:"Filter" type:"list"`
// A list of import snapshot task IDs.
@@ -36838,7 +51958,6 @@ func (s *DescribeImportSnapshotTasksInput) SetNextToken(v string) *DescribeImpor
return s
}
-// Contains the output for DescribeImportSnapshotTasks.
type DescribeImportSnapshotTasksOutput struct {
_ struct{} `type:"structure"`
@@ -36873,7 +51992,6 @@ func (s *DescribeImportSnapshotTasksOutput) SetNextToken(v string) *DescribeImpo
return s
}
-// Contains the parameters for DescribeInstanceAttribute.
type DescribeInstanceAttributeInput struct {
_ struct{} `type:"structure"`
@@ -37104,12 +52222,12 @@ type DescribeInstanceCreditSpecificationsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * instance-id - The ID of the instance.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more instance IDs.
+ // The instance IDs.
//
// Default: Describes all your instances.
//
@@ -37120,7 +52238,7 @@ type DescribeInstanceCreditSpecificationsInput struct {
// remaining results, make another call with the returned NextToken value. This
// value can be between 5 and 1000. You cannot specify this parameter and the
// instance IDs parameter in the same call.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"5" type:"integer"`
// The token to retrieve the next page of results.
NextToken *string `type:"string"`
@@ -37136,6 +52254,19 @@ func (s DescribeInstanceCreditSpecificationsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeInstanceCreditSpecificationsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceCreditSpecificationsInput"}
+ 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 *DescribeInstanceCreditSpecificationsInput) SetDryRun(v bool) *DescribeInstanceCreditSpecificationsInput {
s.DryRun = &v
@@ -37199,7 +52330,6 @@ func (s *DescribeInstanceCreditSpecificationsOutput) SetNextToken(v string) *Des
return s
}
-// Contains the parameters for DescribeInstanceStatus.
type DescribeInstanceStatusInput struct {
_ struct{} `type:"structure"`
@@ -37209,7 +52339,7 @@ type DescribeInstanceStatusInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * availability-zone - The Availability Zone of the instance.
//
@@ -37218,14 +52348,20 @@ type DescribeInstanceStatusInput struct {
//
// * event.description - A description of the event.
//
+ // * event.instance-event-id - The ID of the event whose date and time you
+ // are modifying.
+ //
// * event.not-after - The latest end time for the scheduled event (for example,
// 2014-09-15T17:15:20.000Z).
//
// * event.not-before - The earliest start time for the scheduled event (for
// example, 2014-09-15T17:15:20.000Z).
//
+ // * event.not-before-deadline - The deadline for starting the event (for
+ // example, 2014-09-15T17:15:20.000Z).
+ //
// * instance-state-code - The code for the instance state, as a 16-bit unsigned
- // integer. The high byte is an opaque internal value and should be ignored.
+ // integer. The high byte is used for internal purposes and should be ignored.
// The low byte is set based on the state represented. The valid values are
// 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping),
// and 80 (stopped).
@@ -37252,7 +52388,7 @@ type DescribeInstanceStatusInput struct {
// Default: false
IncludeAllInstances *bool `locationName:"includeAllInstances" type:"boolean"`
- // One or more instance IDs.
+ // The instance IDs.
//
// Default: Describes all your instances.
//
@@ -37315,11 +52451,10 @@ func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceSt
return s
}
-// Contains the output of DescribeInstanceStatus.
type DescribeInstanceStatusOutput struct {
_ struct{} `type:"structure"`
- // One or more instance status descriptions.
+ // Information about the status of the instances.
InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"`
// The token to use to retrieve the next page of results. This value is null
@@ -37349,7 +52484,6 @@ func (s *DescribeInstanceStatusOutput) SetNextToken(v string) *DescribeInstanceS
return s
}
-// Contains the parameters for DescribeInstances.
type DescribeInstancesInput struct {
_ struct{} `type:"structure"`
@@ -37359,12 +52493,12 @@ type DescribeInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * affinity - The affinity setting for an instance running on a Dedicated
// Host (default | host).
//
- // * architecture - The instance architecture (i386 | x86_64).
+ // * architecture - The instance architecture (i386 | x86_64 | arm64).
//
// * availability-zone - The Availability Zone of the instance.
//
@@ -37393,6 +52527,10 @@ type DescribeInstancesInput struct {
// * group-name - The name of the security group for the instance. EC2-Classic
// only.
//
+ // * hibernation-options.configured - A Boolean that indicates whether the
+ // instance is enabled for hibernation. A value of true means that the instance
+ // is enabled for hibernation.
+ //
// * host-id - The ID of the Dedicated Host on which the instance is running,
// if applicable.
//
@@ -37409,7 +52547,7 @@ type DescribeInstancesInput struct {
// Scheduled Instance (spot | scheduled).
//
// * instance-state-code - The state of the instance, as a 16-bit unsigned
- // integer. The high byte is an opaque internal value and should be ignored.
+ // integer. The high byte is used for internal purposes and should be ignored.
// The low byte is set based on the state represented. The valid values are:
// 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping),
// and 80 (stopped).
@@ -37423,7 +52561,6 @@ type DescribeInstancesInput struct {
//
// * instance.group-name - The name of the security group for the instance.
//
- //
// * ip-address - The public IPv4 address of the instance.
//
// * kernel-id - The kernel ID.
@@ -37433,7 +52570,6 @@ type DescribeInstancesInput struct {
// * launch-index - When launching multiple instances, this is the index
// for the instance in the launch group (for example, 0, 1, 2, and so on).
//
- //
// * launch-time - The time when the instance was launched.
//
// * monitoring-state - Indicates whether detailed monitoring is enabled
@@ -37529,8 +52665,10 @@ type DescribeInstancesInput struct {
//
// * placement-group-name - The name of the placement group for the instance.
//
- // * platform - The platform. Use windows if you have Windows instances;
- // otherwise, leave blank.
+ // * placement-partition-number - The partition in which the instance is
+ // located.
+ //
+ // * platform - The platform. To list only Windows instances, use windows.
//
// * private-dns-name - The private IPv4 DNS name of the instance.
//
@@ -37576,20 +52714,15 @@ type DescribeInstancesInput struct {
//
// * subnet-id - The ID of the subnet for the instance.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of the tag's key). If you want to
- // list only resources where Purpose is X, see the tag:key=value filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources that have a tag with a specific key, regardless
+ // of the tag value.
//
// * tenancy - The tenancy of an instance (dedicated | default | host).
//
@@ -37599,7 +52732,7 @@ type DescribeInstancesInput struct {
// * vpc-id - The ID of the VPC that the instance is running in.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more instance IDs.
+ // The instance IDs.
//
// Default: Describes all your instances.
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"`
@@ -37607,7 +52740,7 @@ type DescribeInstancesInput struct {
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value. This
// value can be between 5 and 1000. You cannot specify this parameter and the
- // instance IDs parameter or tag filters in the same call.
+ // instance IDs parameter in the same call.
MaxResults *int64 `locationName:"maxResults" type:"integer"`
// The token to request the next page of results.
@@ -37654,7 +52787,6 @@ func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput
return s
}
-// Contains the output of DescribeInstances.
type DescribeInstancesOutput struct {
_ struct{} `type:"structure"`
@@ -37662,7 +52794,7 @@ type DescribeInstancesOutput struct {
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // Zero or more reservations.
+ // Information about the reservations.
Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"`
}
@@ -37688,7 +52820,6 @@ func (s *DescribeInstancesOutput) SetReservations(v []*Reservation) *DescribeIns
return s
}
-// Contains the parameters for DescribeInternetGateways.
type DescribeInternetGatewaysInput struct {
_ struct{} `type:"structure"`
@@ -37707,27 +52838,30 @@ type DescribeInternetGatewaysInput struct {
//
// * internet-gateway-id - The ID of the Internet gateway.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * owner-id - The ID of the AWS account that owns the internet gateway.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
+ // * tag: - 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.
//
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more Internet gateway IDs.
+ // One or more internet gateway IDs.
//
- // Default: Describes all your Internet gateways.
+ // Default: Describes all your internet gateways.
InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" 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"`
}
// String returns the string representation
@@ -37740,6 +52874,19 @@ func (s DescribeInternetGatewaysInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeInternetGatewaysInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeInternetGatewaysInput"}
+ 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 *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput {
s.DryRun = &v
@@ -37758,12 +52905,27 @@ func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *Desc
return s
}
-// Contains the output of DescribeInternetGateways.
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeInternetGatewaysInput) SetMaxResults(v int64) *DescribeInternetGatewaysInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternetGatewaysInput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeInternetGatewaysOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more Internet gateways.
+ // Information about one or more internet gateways.
InternetGateways []*InternetGateway `locationName:"internetGatewaySet" 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
@@ -37782,7 +52944,12 @@ func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGatewa
return s
}
-// Contains the parameters for DescribeKeyPairs.
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeInternetGatewaysOutput) SetNextToken(v string) *DescribeInternetGatewaysOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeKeyPairsInput struct {
_ struct{} `type:"structure"`
@@ -37792,14 +52959,14 @@ type DescribeKeyPairsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * fingerprint - The fingerprint of the key pair.
//
// * key-name - The name of the key pair.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more key pair names.
+ // The key pair names.
//
// Default: Describes all your key pairs.
KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"`
@@ -37833,11 +53000,10 @@ func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput
return s
}
-// Contains the output of DescribeKeyPairs.
type DescribeKeyPairsOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more key pairs.
+ // Information about the key pairs.
KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"`
}
@@ -37897,7 +53063,7 @@ type DescribeLaunchTemplateVersionsInput struct {
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value. This
- // value can be between 5 and 1000.
+ // value can be between 1 and 200.
MaxResults *int64 `type:"integer"`
// The version number up to which to describe launch template versions.
@@ -38038,17 +53204,15 @@ type DescribeLaunchTemplatesInput struct {
//
// * launch-template-name - The name of the launch template.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of the tag's key). If you want to
- // list only resources where Purpose is X, see the tag:key=value filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// One or more launch template IDs.
@@ -38059,8 +53223,8 @@ type DescribeLaunchTemplatesInput struct {
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value. This
- // value can be between 5 and 1000.
- MaxResults *int64 `type:"integer"`
+ // value can be between 1 and 200.
+ MaxResults *int64 `min:"1" type:"integer"`
// The token to request the next page of results.
NextToken *string `type:"string"`
@@ -38076,6 +53240,19 @@ func (s DescribeLaunchTemplatesInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeLaunchTemplatesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplatesInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetDryRun sets the DryRun field's value.
func (s *DescribeLaunchTemplatesInput) SetDryRun(v bool) *DescribeLaunchTemplatesInput {
s.DryRun = &v
@@ -38145,7 +53322,6 @@ func (s *DescribeLaunchTemplatesOutput) SetNextToken(v string) *DescribeLaunchTe
return s
}
-// Contains the parameters for DescribeMovingAddresses.
type DescribeMovingAddressesInput struct {
_ struct{} `type:"structure"`
@@ -38167,9 +53343,9 @@ type DescribeMovingAddressesInput struct {
// 1000; if MaxResults is given a value outside of this range, an error is returned.
//
// Default: If no value is provided, the default is 1000.
- MaxResults *int64 `locationName:"maxResults" type:"integer"`
+ MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"`
- // The token to use to retrieve the next page of results.
+ // The token for the next page of results.
NextToken *string `locationName:"nextToken" type:"string"`
// One or more Elastic IP addresses.
@@ -38186,6 +53362,19 @@ func (s DescribeMovingAddressesInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeMovingAddressesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeMovingAddressesInput"}
+ 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 *DescribeMovingAddressesInput) SetDryRun(v bool) *DescribeMovingAddressesInput {
s.DryRun = &v
@@ -38216,7 +53405,6 @@ func (s *DescribeMovingAddressesInput) SetPublicIps(v []*string) *DescribeMoving
return s
}
-// Contains the output of DescribeMovingAddresses.
type DescribeMovingAddressesOutput struct {
_ struct{} `type:"structure"`
@@ -38250,7 +53438,6 @@ func (s *DescribeMovingAddressesOutput) SetNextToken(v string) *DescribeMovingAd
return s
}
-// Contains the parameters for DescribeNatGateways.
type DescribeNatGatewaysInput struct {
_ struct{} `type:"structure"`
@@ -38263,37 +53450,27 @@ type DescribeNatGatewaysInput struct {
//
// * subnet-id - The ID of the subnet in which the NAT gateway resides.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC in which the NAT gateway resides.
Filter []*Filter `locationNameList:"Filter" type:"list"`
- // The maximum number of items to return for this request. The request returns
- // a token that you can specify in a subsequent call to get the next set of
- // results.
- //
- // Constraint: If the value specified is greater than 1000, we return only 1000
- // items.
- MaxResults *int64 `type:"integer"`
+ // 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"`
// One or more NAT gateway IDs.
NatGatewayIds []*string `locationName:"NatGatewayId" locationNameList:"item" type:"list"`
- // The token to retrieve the next page of results.
+ // The token for the next page of results.
NextToken *string `type:"string"`
}
@@ -38307,6 +53484,19 @@ func (s DescribeNatGatewaysInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeNatGatewaysInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeNatGatewaysInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetFilter sets the Filter field's value.
func (s *DescribeNatGatewaysInput) SetFilter(v []*Filter) *DescribeNatGatewaysInput {
s.Filter = v
@@ -38331,7 +53521,6 @@ func (s *DescribeNatGatewaysInput) SetNextToken(v string) *DescribeNatGatewaysIn
return s
}
-// Contains the output of DescribeNatGateways.
type DescribeNatGatewaysOutput struct {
_ struct{} `type:"structure"`
@@ -38365,7 +53554,6 @@ func (s *DescribeNatGatewaysOutput) SetNextToken(v string) *DescribeNatGatewaysO
return s
}
-// Contains the parameters for DescribeNetworkAcls.
type DescribeNetworkAclsInput struct {
_ struct{} `type:"structure"`
@@ -38389,8 +53577,6 @@ type DescribeNetworkAclsInput struct {
//
// * entry.cidr - The IPv4 CIDR range specified in the entry.
//
- // * entry.egress - Indicates whether the entry applies to egress traffic.
- //
// * entry.icmp.code - The ICMP code specified in the entry, if any.
//
// * entry.icmp.type - The ICMP type specified in the entry, if any.
@@ -38402,40 +53588,42 @@ type DescribeNetworkAclsInput struct {
//
// * entry.port-range.to - The end of the port range specified in the entry.
//
- //
// * entry.protocol - The protocol specified in the entry (tcp | udp | icmp
// or a protocol number).
//
// * entry.rule-action - Allows or denies the matching traffic (allow | deny).
//
// * entry.rule-number - The number of an entry (in other words, rule) in
- // the ACL's set of entries.
+ // the set of ACL entries.
//
// * network-acl-id - The ID of the network ACL.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * owner-id - The ID of the AWS account that owns the network ACL.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
+ // * tag: - 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.
//
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC for the network ACL.
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"`
+
// One or more network ACL IDs.
//
// Default: Describes all your network ACLs.
NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"`
+
+ // The token for the next page of results.
+ NextToken *string `type:"string"`
}
// String returns the string representation
@@ -38448,6 +53636,19 @@ func (s DescribeNetworkAclsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeNetworkAclsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkAclsInput"}
+ 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 *DescribeNetworkAclsInput) SetDryRun(v bool) *DescribeNetworkAclsInput {
s.DryRun = &v
@@ -38460,18 +53661,33 @@ func (s *DescribeNetworkAclsInput) SetFilters(v []*Filter) *DescribeNetworkAclsI
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeNetworkAclsInput) SetMaxResults(v int64) *DescribeNetworkAclsInput {
+ s.MaxResults = &v
+ return s
+}
+
// SetNetworkAclIds sets the NetworkAclIds field's value.
func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput {
s.NetworkAclIds = v
return s
}
-// Contains the output of DescribeNetworkAcls.
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeNetworkAclsInput) SetNextToken(v string) *DescribeNetworkAclsInput {
+ s.NextToken = &v
+ return s
+}
+
type DescribeNetworkAclsOutput struct {
_ struct{} `type:"structure"`
// Information about one or more network ACLs.
NetworkAcls []*NetworkAcl `locationName:"networkAclSet" 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
@@ -38490,6 +53706,12 @@ func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAcl) *DescribeNet
return s
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeNetworkAclsOutput) SetNextToken(v string) *DescribeNetworkAclsOutput {
+ s.NextToken = &v
+ return s
+}
+
// Contains the parameters for DescribeNetworkInterfaceAttribute.
type DescribeNetworkInterfaceAttributeInput struct {
_ struct{} `type:"structure"`
@@ -38633,7 +53855,7 @@ type DescribeNetworkInterfacePermissionsInput struct {
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value. If
// this parameter is not specified, up to 50 results are returned by default.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"5" type:"integer"`
// One or more network interface permission IDs.
NetworkInterfacePermissionIds []*string `locationName:"NetworkInterfacePermissionId" type:"list"`
@@ -38652,6 +53874,19 @@ func (s DescribeNetworkInterfacePermissionsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeNetworkInterfacePermissionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInterfacePermissionsInput"}
+ 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 *DescribeNetworkInterfacePermissionsInput) SetFilters(v []*Filter) *DescribeNetworkInterfacePermissionsInput {
s.Filters = v
@@ -38750,7 +53985,7 @@ type DescribeNetworkInterfacesInput struct {
//
// * attachment.attachment-id - The ID of the interface attachment.
//
- // * attachment.attach.time - The time that the network interface was attached
+ // * attachment.attach-time - The time that the network interface was attached
// to an instance.
//
// * attachment.delete-on-termination - Indicates whether the attachment
@@ -38801,7 +54036,7 @@ type DescribeNetworkInterfacesInput struct {
// managed by an AWS service (for example, AWS Management Console, Auto Scaling,
// and so on).
//
- // * source-desk-check - Indicates whether the network interface performs
+ // * source-dest-check - Indicates whether the network interface performs
// source/destination checking. A value of true means checking is enabled,
// and false means checking is disabled. The value must be false for the
// network interface to perform network address translation (NAT) in your
@@ -38813,29 +54048,31 @@ type DescribeNetworkInterfacesInput struct {
//
// * subnet-id - The ID of the subnet for the network interface.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC for the network interface.
Filters []*Filter `locationName:"filter" locationNameList:"Filter" type:"list"`
+ // The maximum number of items to return for this request. The request returns
+ // a token that you can specify in a subsequent call to get the next set of
+ // results.
+ MaxResults *int64 `min:"5" type:"integer"`
+
// One or more network interface IDs.
//
// Default: Describes all your network interfaces.
NetworkInterfaceIds []*string `locationName:"NetworkInterfaceId" locationNameList:"item" type:"list"`
+
+ // The token to retrieve the next page of results.
+ NextToken *string `type:"string"`
}
// String returns the string representation
@@ -38848,6 +54085,19 @@ func (s DescribeNetworkInterfacesInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeNetworkInterfacesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkInterfacesInput"}
+ 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 *DescribeNetworkInterfacesInput) SetDryRun(v bool) *DescribeNetworkInterfacesInput {
s.DryRun = &v
@@ -38860,18 +54110,34 @@ func (s *DescribeNetworkInterfacesInput) SetFilters(v []*Filter) *DescribeNetwor
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeNetworkInterfacesInput) SetMaxResults(v int64) *DescribeNetworkInterfacesInput {
+ s.MaxResults = &v
+ return s
+}
+
// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value.
func (s *DescribeNetworkInterfacesInput) SetNetworkInterfaceIds(v []*string) *DescribeNetworkInterfacesInput {
s.NetworkInterfaceIds = v
return s
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeNetworkInterfacesInput) SetNextToken(v string) *DescribeNetworkInterfacesInput {
+ s.NextToken = &v
+ return s
+}
+
// Contains the output of DescribeNetworkInterfaces.
type DescribeNetworkInterfacesOutput struct {
_ struct{} `type:"structure"`
// Information about one or more network interfaces.
NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaceSet" 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
@@ -38890,7 +54156,12 @@ func (s *DescribeNetworkInterfacesOutput) SetNetworkInterfaces(v []*NetworkInter
return s
}
-// Contains the parameters for DescribePlacementGroups.
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeNetworkInterfacesOutput) SetNextToken(v string) *DescribeNetworkInterfacesOutput {
+ s.NextToken = &v
+ return s
+}
+
type DescribePlacementGroupsInput struct {
_ struct{} `type:"structure"`
@@ -38900,17 +54171,17 @@ type DescribePlacementGroupsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * group-name - The name of the placement group.
//
// * state - The state of the placement group (pending | available | deleting
// | deleted).
//
- // * strategy - The strategy of the placement group (cluster | spread).
+ // * strategy - The strategy of the placement group (cluster | spread | partition).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more placement group names.
+ // The names of the placement groups.
//
// Default: Describes all your placement groups, or only those otherwise specified.
GroupNames []*string `locationName:"groupName" type:"list"`
@@ -38944,11 +54215,10 @@ func (s *DescribePlacementGroupsInput) SetGroupNames(v []*string) *DescribePlace
return s
}
-// Contains the output of DescribePlacementGroups.
type DescribePlacementGroupsOutput struct {
_ struct{} `type:"structure"`
- // One or more placement groups.
+ // Information about the placement groups.
PlacementGroups []*PlacementGroup `locationName:"placementGroupSet" locationNameList:"item" type:"list"`
}
@@ -38968,7 +54238,6 @@ func (s *DescribePlacementGroupsOutput) SetPlacementGroups(v []*PlacementGroup)
return s
}
-// Contains the parameters for DescribePrefixLists.
type DescribePrefixListsInput struct {
_ struct{} `type:"structure"`
@@ -38985,16 +54254,11 @@ type DescribePrefixListsInput struct {
// * prefix-list-name: The name of a prefix list.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The maximum number of items to return for this request. The request returns
- // a token that you can specify in a subsequent call to get the next set of
- // results.
- //
- // Constraint: If the value specified is greater than 1000, we return only 1000
- // items.
+ // 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 `type:"integer"`
- // The token for the next set of items to return. (You received this token from
- // a prior call.)
+ // The token for the next page of results.
NextToken *string `type:"string"`
// One or more prefix list IDs.
@@ -39041,12 +54305,11 @@ func (s *DescribePrefixListsInput) SetPrefixListIds(v []*string) *DescribePrefix
return s
}
-// Contains the output of DescribePrefixLists.
type DescribePrefixListsOutput struct {
_ struct{} `type:"structure"`
- // The token to use when requesting the next set of items. If there are no additional
- // items to return, the string is empty.
+ // 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"`
// All available prefix lists.
@@ -39086,7 +54349,7 @@ type DescribePrincipalIdFormatInput struct {
// The maximum number of results to return in a single call. To retrieve the
// remaining results, make another call with the returned NextToken value.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"1" type:"integer"`
// The token to request the next page of results.
NextToken *string `type:"string"`
@@ -39111,6 +54374,19 @@ func (s DescribePrincipalIdFormatInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribePrincipalIdFormatInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribePrincipalIdFormatInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetDryRun sets the DryRun field's value.
func (s *DescribePrincipalIdFormatInput) SetDryRun(v bool) *DescribePrincipalIdFormatInput {
s.DryRun = &v
@@ -39168,24 +54444,116 @@ func (s *DescribePrincipalIdFormatOutput) SetPrincipals(v []*PrincipalIdFormat)
return s
}
-// Contains the parameters for DescribeRegions.
+type DescribePublicIpv4PoolsInput struct {
+ _ struct{} `type:"structure"`
+
+ // 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:"1" type:"integer"`
+
+ // The token for the next page of results.
+ NextToken *string `type:"string"`
+
+ // The IDs of the address pools.
+ PoolIds []*string `locationName:"PoolId" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribePublicIpv4PoolsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribePublicIpv4PoolsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribePublicIpv4PoolsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribePublicIpv4PoolsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribePublicIpv4PoolsInput) SetMaxResults(v int64) *DescribePublicIpv4PoolsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribePublicIpv4PoolsInput) SetNextToken(v string) *DescribePublicIpv4PoolsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetPoolIds sets the PoolIds field's value.
+func (s *DescribePublicIpv4PoolsInput) SetPoolIds(v []*string) *DescribePublicIpv4PoolsInput {
+ s.PoolIds = v
+ return s
+}
+
+type DescribePublicIpv4PoolsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the address pools.
+ PublicIpv4Pools []*PublicIpv4Pool `locationName:"publicIpv4PoolSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribePublicIpv4PoolsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribePublicIpv4PoolsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribePublicIpv4PoolsOutput) SetNextToken(v string) *DescribePublicIpv4PoolsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetPublicIpv4Pools sets the PublicIpv4Pools field's value.
+func (s *DescribePublicIpv4PoolsOutput) SetPublicIpv4Pools(v []*PublicIpv4Pool) *DescribePublicIpv4PoolsOutput {
+ s.PublicIpv4Pools = v
+ return s
+}
+
type DescribeRegionsInput struct {
_ struct{} `type:"structure"`
+ // Indicates whether to display all Regions, including Regions that are disabled
+ // for your account.
+ AllRegions *bool `type:"boolean"`
+
// 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 `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
- // * endpoint - The endpoint of the region (for example, ec2.us-east-1.amazonaws.com).
+ // * endpoint - The endpoint of the Region (for example, ec2.us-east-1.amazonaws.com).
//
- // * region-name - The name of the region (for example, us-east-1).
+ // * region-name - The name of the Region (for example, us-east-1).
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // The names of one or more regions.
+ // The names of the Regions. You can specify any Regions, whether they are enabled
+ // and disabled for your account.
RegionNames []*string `locationName:"RegionName" locationNameList:"RegionName" type:"list"`
}
@@ -39199,6 +54567,12 @@ func (s DescribeRegionsInput) GoString() string {
return s.String()
}
+// SetAllRegions sets the AllRegions field's value.
+func (s *DescribeRegionsInput) SetAllRegions(v bool) *DescribeRegionsInput {
+ s.AllRegions = &v
+ return s
+}
+
// SetDryRun sets the DryRun field's value.
func (s *DescribeRegionsInput) SetDryRun(v bool) *DescribeRegionsInput {
s.DryRun = &v
@@ -39217,11 +54591,10 @@ func (s *DescribeRegionsInput) SetRegionNames(v []*string) *DescribeRegionsInput
return s
}
-// Contains the output of DescribeRegions.
type DescribeRegionsOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more regions.
+ // Information about the Regions.
Regions []*Region `locationName:"regionInfo" locationNameList:"item" type:"list"`
}
@@ -39286,21 +54659,15 @@ type DescribeReservedInstancesInput struct {
// * state - The state of the Reserved Instance (payment-pending | active
// | payment-failed | retired).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * usage-price - The usage price of the Reserved Instance, per hour (for
// example, 0.84).
@@ -39454,7 +54821,7 @@ type DescribeReservedInstancesModificationsInput struct {
// * modification-result.target-configuration.availability-zone - The Availability
// Zone for the new Reserved Instances.
//
- // * modification-result.target-configuration.instance-count - The number
+ // * modification-result.target-configuration.instance-count - The number
// of new Reserved Instances.
//
// * modification-result.target-configuration.instance-type - The instance
@@ -39582,7 +54949,7 @@ type DescribeReservedInstancesOfferingsInput struct {
// SUSE Linux (Amazon VPC) | Red Hat Enterprise Linux | Red Hat Enterprise
// Linux (Amazon VPC) | Windows | Windows (Amazon VPC) | Windows with SQL
// Server Standard | Windows with SQL Server Standard (Amazon VPC) | Windows
- // with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows
+ // with SQL Server Web | Windows with SQL Server Web (Amazon VPC) | Windows
// with SQL Server Enterprise | Windows with SQL Server Enterprise (Amazon
// VPC))
//
@@ -39608,7 +54975,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 (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // 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.
InstanceType *string `type:"string" enum:"InstanceType"`
@@ -39811,7 +55178,6 @@ func (s *DescribeReservedInstancesOutput) SetReservedInstances(v []*ReservedInst
return s
}
-// Contains the parameters for DescribeRouteTables.
type DescribeRouteTablesInput struct {
_ struct{} `type:"structure"`
@@ -39835,6 +55201,8 @@ type DescribeRouteTablesInput struct {
// table for the VPC (true | false). Route tables that do not have an association
// ID are not returned in the response.
//
+ // * owner-id - The ID of the AWS account that owns the route table.
+ //
// * route-table-id - The ID of the route table.
//
// * route.destination-cidr-block - The IPv4 CIDR range specified in a route
@@ -39856,6 +55224,8 @@ type DescribeRouteTablesInput struct {
//
// * route.nat-gateway-id - The ID of a NAT gateway.
//
+ // * route.transit-gateway-id - The ID of a transit gateway.
+ //
// * route.origin - Describes how the route was created. CreateRouteTable
// indicates that the route was automatically created when the route table
// was created; CreateRoute indicates that the route was manually added to
@@ -39870,25 +55240,28 @@ type DescribeRouteTablesInput struct {
// * route.vpc-peering-connection-id - The ID of a VPC peering connection
// specified in a route in the table.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * transit-gateway-id - The ID of a transit gateway.
//
// * vpc-id - The ID of the VPC for the route table.
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"`
+
// One or more route table IDs.
//
// Default: Describes all your route tables.
@@ -39905,6 +55278,19 @@ func (s DescribeRouteTablesInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeRouteTablesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeRouteTablesInput"}
+ 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 *DescribeRouteTablesInput) SetDryRun(v bool) *DescribeRouteTablesInput {
s.DryRun = &v
@@ -39917,6 +55303,18 @@ func (s *DescribeRouteTablesInput) SetFilters(v []*Filter) *DescribeRouteTablesI
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeRouteTablesInput) SetMaxResults(v int64) *DescribeRouteTablesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeRouteTablesInput) SetNextToken(v string) *DescribeRouteTablesInput {
+ s.NextToken = &v
+ return s
+}
+
// SetRouteTableIds sets the RouteTableIds field's value.
func (s *DescribeRouteTablesInput) SetRouteTableIds(v []*string) *DescribeRouteTablesInput {
s.RouteTableIds = v
@@ -39927,6 +55325,10 @@ func (s *DescribeRouteTablesInput) SetRouteTableIds(v []*string) *DescribeRouteT
type DescribeRouteTablesOutput struct {
_ struct{} `type:"structure"`
+ // 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"`
+
// Information about one or more route tables.
RouteTables []*RouteTable `locationName:"routeTableSet" locationNameList:"item" type:"list"`
}
@@ -39941,6 +55343,12 @@ func (s DescribeRouteTablesOutput) GoString() string {
return s.String()
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeRouteTablesOutput) SetNextToken(v string) *DescribeRouteTablesOutput {
+ s.NextToken = &v
+ return s
+}
+
// SetRouteTables sets the RouteTables field's value.
func (s *DescribeRouteTablesOutput) SetRouteTables(v []*RouteTable) *DescribeRouteTablesOutput {
s.RouteTables = v
@@ -39957,7 +55365,7 @@ type DescribeScheduledInstanceAvailabilityInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * availability-zone - The Availability Zone (for example, us-west-2a).
//
@@ -39976,7 +55384,7 @@ type DescribeScheduledInstanceAvailabilityInput struct {
// The maximum number of results to return in a single call. This value can
// be between 5 and 300. The default value is 300. To retrieve the remaining
// results, make another call with the returned NextToken value.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"5" type:"integer"`
// The maximum available duration, in hours. This value must be greater than
// MinSlotDurationInHours and less than 1,720.
@@ -40013,6 +55421,9 @@ func (s *DescribeScheduledInstanceAvailabilityInput) Validate() error {
if s.FirstSlotStartTimeRange == nil {
invalidParams.Add(request.NewErrParamRequired("FirstSlotStartTimeRange"))
}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
if s.Recurrence == nil {
invalidParams.Add(request.NewErrParamRequired("Recurrence"))
}
@@ -40120,7 +55531,7 @@ type DescribeScheduledInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * availability-zone - The Availability Zone (for example, us-west-2a).
//
@@ -40139,7 +55550,7 @@ type DescribeScheduledInstancesInput struct {
// The token for the next set of results.
NextToken *string `type:"string"`
- // One or more Scheduled Instance IDs.
+ // The Scheduled Instance IDs.
ScheduledInstanceIds []*string `locationName:"ScheduledInstanceId" locationNameList:"ScheduledInstanceId" type:"list"`
// The time period for the first schedule to start.
@@ -40229,13 +55640,13 @@ func (s *DescribeScheduledInstancesOutput) SetScheduledInstanceSet(v []*Schedule
type DescribeSecurityGroupReferencesInput struct {
_ struct{} `type:"structure"`
- // Checks whether you have the required permissions for the operation, without
+ // 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"`
- // One or more security group IDs in your account.
+ // The IDs of the security groups in your account.
//
// GroupId is a required field
GroupId []*string `locationNameList:"item" type:"list" required:"true"`
@@ -40299,7 +55710,6 @@ func (s *DescribeSecurityGroupReferencesOutput) SetSecurityGroupReferenceSet(v [
return s
}
-// Contains the parameters for DescribeSecurityGroups.
type DescribeSecurityGroupsInput struct {
_ struct{} `type:"structure"`
@@ -40309,9 +55719,9 @@ type DescribeSecurityGroupsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters. If using multiple filters for rules, the results include
- // security groups for which any combination of rules - not necessarily a single
- // rule - match all filters.
+ // The filters. If using multiple filters for rules, the results include security
+ // groups for which any combination of rules - not necessarily a single rule
+ // - match all filters.
//
// * description - The description of the security group.
//
@@ -40375,20 +55785,26 @@ type DescribeSecurityGroupsInput struct {
//
// * owner-id - The AWS account ID of the owner of the security group.
//
- // * tag-key - The key of a tag assigned to the security group.
+ // * tag: - 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.
//
- // * tag-value - The value of a tag assigned to the security group.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC specified when the security group was created.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
- // One or more security group IDs. Required for security groups in a nondefault
+ // The IDs of the security groups. Required for security groups in a nondefault
// VPC.
//
// Default: Describes all your security groups.
GroupIds []*string `locationName:"GroupId" locationNameList:"groupId" type:"list"`
- // [EC2-Classic and default VPC only] One or more security group names. You
+ // [EC2-Classic and default VPC only] The names of the security groups. You
// can specify either the security group name or the security group ID. For
// security groups in a nondefault VPC, use the group-name filter to describe
// security groups by name.
@@ -40400,7 +55816,7 @@ type DescribeSecurityGroupsInput struct {
// remaining results, make another request with the returned NextToken value.
// This value can be between 5 and 1000. If this parameter is not specified,
// then all results are returned.
- MaxResults *int64 `type:"integer"`
+ MaxResults *int64 `min:"5" type:"integer"`
// The token to request the next page of results.
NextToken *string `type:"string"`
@@ -40416,6 +55832,19 @@ func (s DescribeSecurityGroupsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeSecurityGroupsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeSecurityGroupsInput"}
+ 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 *DescribeSecurityGroupsInput) SetDryRun(v bool) *DescribeSecurityGroupsInput {
s.DryRun = &v
@@ -40452,7 +55881,6 @@ func (s *DescribeSecurityGroupsInput) SetNextToken(v string) *DescribeSecurityGr
return s
}
-// Contains the output of DescribeSecurityGroups.
type DescribeSecurityGroupsOutput struct {
_ struct{} `type:"structure"`
@@ -40460,7 +55888,7 @@ type DescribeSecurityGroupsOutput struct {
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // Information about one or more security groups.
+ // Information about the security groups.
SecurityGroups []*SecurityGroup `locationName:"securityGroupInfo" locationNameList:"item" type:"list"`
}
@@ -40555,10 +55983,11 @@ func (s *DescribeSnapshotAttributeInput) SetSnapshotId(v string) *DescribeSnapsh
type DescribeSnapshotAttributeOutput struct {
_ struct{} `type:"structure"`
- // A list of permissions for creating volumes from the snapshot.
+ // The users and groups that have the permissions for creating volumes from
+ // the snapshot.
CreateVolumePermissions []*CreateVolumePermission `locationName:"createVolumePermission" locationNameList:"item" type:"list"`
- // A list of product codes.
+ // The product codes.
ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"`
// The ID of the EBS snapshot.
@@ -40593,7 +56022,6 @@ func (s *DescribeSnapshotAttributeOutput) SetSnapshotId(v string) *DescribeSnaps
return s
}
-// Contains the parameters for DescribeSnapshots.
type DescribeSnapshotsInput struct {
_ struct{} `type:"structure"`
@@ -40603,13 +56031,16 @@ type DescribeSnapshotsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * description - A description of the snapshot.
//
- // * owner-alias - Value from an Amazon-maintained list (amazon | aws-marketplace
- // | microsoft) of snapshot owners. Not to be confused with the user-configured
- // AWS account alias, which is set from the IAM console.
+ // * encrypted - Indicates whether the snapshot is encrypted (true | false)
+ //
+ // * owner-alias - Value from an Amazon-maintained list (amazon | self |
+ // all | aws-marketplace | microsoft) of snapshot owners. Not to be confused
+ // with the user-configured AWS account alias, which is set from the IAM
+ // console.
//
// * owner-id - The ID of the AWS account that owns the snapshot.
//
@@ -40622,21 +56053,15 @@ type DescribeSnapshotsInput struct {
//
// * status - The status of the snapshot (pending | completed | error).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * volume-id - The ID of the volume the snapshot is for.
//
@@ -40661,16 +56086,15 @@ type DescribeSnapshotsInput struct {
// to return.
NextToken *string `type:"string"`
- // Returns the snapshots owned by the specified owner. Multiple owners can be
- // specified.
+ // Describes the snapshots owned by these owners.
OwnerIds []*string `locationName:"Owner" locationNameList:"Owner" type:"list"`
- // One or more AWS accounts IDs that can create volumes from the snapshot.
+ // The IDs of the AWS accounts that can create volumes from the snapshot.
RestorableByUserIds []*string `locationName:"RestorableBy" type:"list"`
- // One or more snapshot IDs.
+ // The snapshot IDs.
//
- // Default: Describes snapshots for which you have launch permissions.
+ // Default: Describes the snapshots for which you have create volume permissions.
SnapshotIds []*string `locationName:"SnapshotId" locationNameList:"SnapshotId" type:"list"`
}
@@ -40726,7 +56150,6 @@ func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsI
return s
}
-// Contains the output of DescribeSnapshots.
type DescribeSnapshotsOutput struct {
_ struct{} `type:"structure"`
@@ -40826,7 +56249,7 @@ type DescribeSpotFleetInstancesInput struct {
// The maximum number of results to return in a single call. Specify a value
// between 1 and 1000. The default value is 1000. To retrieve the remaining
// results, make another call with the returned NextToken value.
- MaxResults *int64 `locationName:"maxResults" type:"integer"`
+ MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"`
// The token for the next set of results.
NextToken *string `locationName:"nextToken" type:"string"`
@@ -40850,6 +56273,9 @@ func (s DescribeSpotFleetInstancesInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeSpotFleetInstancesInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetInstancesInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
if s.SpotFleetRequestId == nil {
invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId"))
}
@@ -40890,18 +56316,14 @@ type DescribeSpotFleetInstancesOutput struct {
// The running instances. This list is refreshed periodically and might be out
// of date.
- //
- // ActiveInstances is a required field
- ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list" required:"true"`
+ ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list"`
// The token required to retrieve the next set of results. This value is null
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
}
// String returns the string representation
@@ -40948,7 +56370,7 @@ type DescribeSpotFleetRequestHistoryInput struct {
// The maximum number of results to return in a single call. Specify a value
// between 1 and 1000. The default value is 1000. To retrieve the remaining
// results, make another call with the returned NextToken value.
- MaxResults *int64 `locationName:"maxResults" type:"integer"`
+ MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"`
// The token for the next set of results.
NextToken *string `locationName:"nextToken" type:"string"`
@@ -40961,7 +56383,7 @@ type DescribeSpotFleetRequestHistoryInput struct {
// The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
//
// StartTime is a required field
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"`
}
// String returns the string representation
@@ -40977,6 +56399,9 @@ func (s DescribeSpotFleetRequestHistoryInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeSpotFleetRequestHistoryInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeSpotFleetRequestHistoryInput"}
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
if s.SpotFleetRequestId == nil {
invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestId"))
}
@@ -41031,31 +56456,23 @@ type DescribeSpotFleetRequestHistoryOutput struct {
_ struct{} `type:"structure"`
// Information about the events in the history of the Spot Fleet request.
- //
- // HistoryRecords is a required field
- HistoryRecords []*HistoryRecord `locationName:"historyRecordSet" locationNameList:"item" type:"list" required:"true"`
+ HistoryRecords []*HistoryRecord `locationName:"historyRecordSet" locationNameList:"item" type:"list"`
// The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// All records up to this time were retrieved.
//
// If nextToken indicates that there are more results, this value is not present.
- //
- // LastEvaluatedTime is a required field
- LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp"`
// The token required to retrieve the next set of results. This value is null
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
// The starting date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- //
- // StartTime is a required field
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
}
// String returns the string representation
@@ -41163,9 +56580,7 @@ type DescribeSpotFleetRequestsOutput struct {
NextToken *string `locationName:"nextToken" type:"string"`
// Information about the configuration of your Spot Fleet.
- //
- // SpotFleetRequestConfigs is a required field
- SpotFleetRequestConfigs []*SpotFleetRequestConfig `locationName:"spotFleetRequestConfigSet" locationNameList:"item" type:"list" required:"true"`
+ SpotFleetRequestConfigs []*SpotFleetRequestConfig `locationName:"spotFleetRequestConfigSet" locationNameList:"item" type:"list"`
}
// String returns the string representation
@@ -41282,7 +56697,7 @@ type DescribeSpotInstanceRequestsInput struct {
// * state - The state of the Spot Instance request (open | active | closed
// | cancelled | failed). Spot request status information can help you track
// your Amazon EC2 Spot Instance requests. For more information, see Spot
- // Request Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html)
+ // Request Status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html)
// in the Amazon EC2 User Guide for Linux Instances.
//
// * status-code - The short code describing the most recent evaluation of
@@ -41291,21 +56706,15 @@ type DescribeSpotInstanceRequestsInput struct {
// * status-message - The message explaining the status of the Spot Instance
// request.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * type - The type of Spot Instance request (one-time | persistent).
//
@@ -41314,6 +56723,15 @@ type DescribeSpotInstanceRequestsInput struct {
// * valid-until - The end date of the request.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
+ // The maximum number of results to return in a single call. Specify a value
+ // between 5 and 1000. To retrieve the remaining results, make another call
+ // with the returned NextToken value.
+ MaxResults *int64 `type:"integer"`
+
+ // The token to request the next set of results. This value is null when there
+ // are no more results to return.
+ NextToken *string `type:"string"`
+
// One or more Spot Instance request IDs.
SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list"`
}
@@ -41340,6 +56758,18 @@ func (s *DescribeSpotInstanceRequestsInput) SetFilters(v []*Filter) *DescribeSpo
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeSpotInstanceRequestsInput) SetMaxResults(v int64) *DescribeSpotInstanceRequestsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeSpotInstanceRequestsInput) SetNextToken(v string) *DescribeSpotInstanceRequestsInput {
+ s.NextToken = &v
+ return s
+}
+
// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value.
func (s *DescribeSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *DescribeSpotInstanceRequestsInput {
s.SpotInstanceRequestIds = v
@@ -41350,6 +56780,10 @@ func (s *DescribeSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*strin
type DescribeSpotInstanceRequestsOutput struct {
_ struct{} `type:"structure"`
+ // The token to use to retrieve the next set of results. This value is null
+ // when there are no more results to return.
+ NextToken *string `locationName:"nextToken" type:"string"`
+
// One or more Spot Instance requests.
SpotInstanceRequests []*SpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"`
}
@@ -41364,6 +56798,12 @@ func (s DescribeSpotInstanceRequestsOutput) GoString() string {
return s.String()
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeSpotInstanceRequestsOutput) SetNextToken(v string) *DescribeSpotInstanceRequestsOutput {
+ s.NextToken = &v
+ return s
+}
+
// SetSpotInstanceRequests sets the SpotInstanceRequests field's value.
func (s *DescribeSpotInstanceRequestsOutput) SetSpotInstanceRequests(v []*SpotInstanceRequest) *DescribeSpotInstanceRequestsOutput {
s.SpotInstanceRequests = v
@@ -41385,7 +56825,7 @@ type DescribeSpotPriceHistoryInput struct {
// The date and time, up to the current date, from which to stop retrieving
// the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"`
+ EndTime *time.Time `locationName:"endTime" type:"timestamp"`
// One or more filters.
//
@@ -41422,7 +56862,7 @@ type DescribeSpotPriceHistoryInput struct {
// The date and time, up to the past 90 days, from which to start retrieving
// the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
}
// String returns the string representation
@@ -41526,7 +56966,7 @@ func (s *DescribeSpotPriceHistoryOutput) SetSpotPriceHistory(v []*SpotPrice) *De
type DescribeStaleSecurityGroupsInput struct {
_ struct{} `type:"structure"`
- // Checks whether you have the required permissions for the operation, without
+ // 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.
@@ -41633,7 +57073,6 @@ func (s *DescribeStaleSecurityGroupsOutput) SetStaleSecurityGroupSet(v []*StaleS
return s
}
-// Contains the parameters for DescribeSubnets.
type DescribeSubnetsInput struct {
_ struct{} `type:"structure"`
@@ -41645,18 +57084,21 @@ type DescribeSubnetsInput struct {
// One or more filters.
//
- // * availabilityZone - The Availability Zone for the subnet. You can also
- // use availability-zone as the filter name.
+ // * availability-zone - The Availability Zone for the subnet. You can also
+ // use availabilityZone as the filter name.
+ //
+ // * availability-zone-id - The ID of the Availability Zone for the subnet.
+ // You can also use availabilityZoneId as the filter name.
//
// * available-ip-address-count - The number of IPv4 addresses in the subnet
// that are available.
//
- // * cidrBlock - The IPv4 CIDR block of the subnet. The CIDR block you specify
+ // * cidr-block - The IPv4 CIDR block of the subnet. The CIDR block you specify
// must exactly match the subnet's CIDR block for information to be returned
- // for the subnet. You can also use cidr or cidr-block as the filter names.
+ // for the subnet. You can also use cidr or cidrBlock as the filter names.
//
- // * defaultForAz - Indicates whether this is the default subnet for the
- // Availability Zone. You can also use default-for-az as the filter name.
+ // * default-for-az - Indicates whether this is the default subnet for the
+ // Availability Zone. You can also use defaultForAz as the filter name.
//
// * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated
// with the subnet.
@@ -41667,29 +57109,34 @@ type DescribeSubnetsInput struct {
// * ipv6-cidr-block-association.state - The state of an IPv6 CIDR block
// associated with the subnet.
//
+ // * owner-id - The ID of the AWS account that owns the subnet.
+ //
// * state - The state of the subnet (pending | available).
//
+ // * subnet-arn - The Amazon Resource Name (ARN) of the subnet.
+ //
// * subnet-id - The ID of the subnet.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC for the subnet.
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"`
+
// One or more subnet IDs.
//
// Default: Describes all your subnets.
@@ -41706,6 +57153,19 @@ func (s DescribeSubnetsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeSubnetsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeSubnetsInput"}
+ 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 *DescribeSubnetsInput) SetDryRun(v bool) *DescribeSubnetsInput {
s.DryRun = &v
@@ -41718,16 +57178,31 @@ func (s *DescribeSubnetsInput) SetFilters(v []*Filter) *DescribeSubnetsInput {
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeSubnetsInput) SetMaxResults(v int64) *DescribeSubnetsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeSubnetsInput) SetNextToken(v string) *DescribeSubnetsInput {
+ s.NextToken = &v
+ return s
+}
+
// SetSubnetIds sets the SubnetIds field's value.
func (s *DescribeSubnetsInput) SetSubnetIds(v []*string) *DescribeSubnetsInput {
s.SubnetIds = v
return s
}
-// Contains the output of DescribeSubnets.
type DescribeSubnetsOutput struct {
_ struct{} `type:"structure"`
+ // 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"`
+
// Information about one or more subnets.
Subnets []*Subnet `locationName:"subnetSet" locationNameList:"item" type:"list"`
}
@@ -41742,13 +57217,18 @@ func (s DescribeSubnetsOutput) GoString() string {
return s.String()
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeSubnetsOutput) SetNextToken(v string) *DescribeSubnetsOutput {
+ s.NextToken = &v
+ return s
+}
+
// SetSubnets sets the Subnets field's value.
func (s *DescribeSubnetsOutput) SetSubnets(v []*Subnet) *DescribeSubnetsOutput {
s.Subnets = v
return s
}
-// Contains the parameters for DescribeTags.
type DescribeTagsInput struct {
_ struct{} `type:"structure"`
@@ -41758,17 +57238,22 @@ type DescribeTagsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * key - The tag key.
//
- // * resource-id - The resource ID.
+ // * resource-id - The ID of the resource.
//
- // * resource-type - The resource type (customer-gateway | dhcp-options |
- // elastic-ip | fpga-image | image | instance | internet-gateway | launch-template
- // | natgateway | network-acl | network-interface | reserved-instances |
- // route-table | security-group | snapshot | spot-instances-request | subnet
- // | volume | vpc | vpc-peering-connection | vpn-connection | vpn-gateway).
+ // * resource-type - The resource type (customer-gateway | dedicated-host
+ // | dhcp-options | elastic-ip | fleet | fpga-image | image | instance |
+ // host-reservation | internet-gateway | launch-template | natgateway | network-acl
+ // | network-interface | reserved-instances | route-table | security-group
+ // | snapshot | spot-instances-request | subnet | volume | vpc | vpc-peering-connection
+ // | vpn-connection | vpn-gateway).
+ //
+ // * 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
+ // resources with the tag "Owner=TeamA".
//
// * value - The tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
@@ -41816,15 +57301,14 @@ func (s *DescribeTagsInput) SetNextToken(v string) *DescribeTagsInput {
return s
}
-// Contains the output of DescribeTags.
type DescribeTagsOutput struct {
_ struct{} `type:"structure"`
// The token to use to retrieve the next page of results. This value is null
- // when there are no more results to return..
+ // when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // A list of tags.
+ // The tags.
Tags []*TagDescription `locationName:"tagSet" locationNameList:"item" type:"list"`
}
@@ -41850,12 +57334,893 @@ func (s *DescribeTagsOutput) SetTags(v []*TagDescription) *DescribeTagsOutput {
return s
}
+type DescribeTrafficMirrorFiltersInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * description: The Traffic Mirror filter description.
+ //
+ // * traffic-mirror-filter-id: The ID of the Traffic Mirror filter.
+ 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"`
+
+ // The ID of the Traffic Mirror filter.
+ TrafficMirrorFilterIds []*string `locationName:"TrafficMirrorFilterId" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorFiltersInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorFiltersInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTrafficMirrorFiltersInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTrafficMirrorFiltersInput"}
+ 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 *DescribeTrafficMirrorFiltersInput) SetDryRun(v bool) *DescribeTrafficMirrorFiltersInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTrafficMirrorFiltersInput) SetFilters(v []*Filter) *DescribeTrafficMirrorFiltersInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTrafficMirrorFiltersInput) SetMaxResults(v int64) *DescribeTrafficMirrorFiltersInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorFiltersInput) SetNextToken(v string) *DescribeTrafficMirrorFiltersInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilterIds sets the TrafficMirrorFilterIds field's value.
+func (s *DescribeTrafficMirrorFiltersInput) SetTrafficMirrorFilterIds(v []*string) *DescribeTrafficMirrorFiltersInput {
+ s.TrafficMirrorFilterIds = v
+ return s
+}
+
+type DescribeTrafficMirrorFiltersOutput 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"`
+
+ // Information about one or more Traffic Mirror filters.
+ TrafficMirrorFilters []*TrafficMirrorFilter `locationName:"trafficMirrorFilterSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorFiltersOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorFiltersOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorFiltersOutput) SetNextToken(v string) *DescribeTrafficMirrorFiltersOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorFilters sets the TrafficMirrorFilters field's value.
+func (s *DescribeTrafficMirrorFiltersOutput) SetTrafficMirrorFilters(v []*TrafficMirrorFilter) *DescribeTrafficMirrorFiltersOutput {
+ s.TrafficMirrorFilters = v
+ return s
+}
+
+type DescribeTrafficMirrorSessionsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * description: The Traffic Mirror session description.
+ //
+ // * network-interface-id: The ID of the Traffic Mirror session network interface.
+ //
+ // * owner-id: The ID of the account that owns the Traffic Mirror session.
+ //
+ // * packet-length: The assigned number of packets to mirror.
+ //
+ // * session-number: The assigned session number.
+ //
+ // * traffic-mirror-filter-id: The ID of the Traffic Mirror filter.
+ //
+ // * traffic-mirror-session-id: The ID of the Traffic Mirror session.
+ //
+ // * traffic-mirror-target-id: The ID of the Traffic Mirror target.
+ //
+ // * virtual-network-id: The virtual network ID of the Traffic Mirror session.
+ 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"`
+
+ // The ID of the Traffic Mirror session.
+ TrafficMirrorSessionIds []*string `locationName:"TrafficMirrorSessionId" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorSessionsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorSessionsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTrafficMirrorSessionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTrafficMirrorSessionsInput"}
+ 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 *DescribeTrafficMirrorSessionsInput) SetDryRun(v bool) *DescribeTrafficMirrorSessionsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTrafficMirrorSessionsInput) SetFilters(v []*Filter) *DescribeTrafficMirrorSessionsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTrafficMirrorSessionsInput) SetMaxResults(v int64) *DescribeTrafficMirrorSessionsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorSessionsInput) SetNextToken(v string) *DescribeTrafficMirrorSessionsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorSessionIds sets the TrafficMirrorSessionIds field's value.
+func (s *DescribeTrafficMirrorSessionsInput) SetTrafficMirrorSessionIds(v []*string) *DescribeTrafficMirrorSessionsInput {
+ s.TrafficMirrorSessionIds = v
+ return s
+}
+
+type DescribeTrafficMirrorSessionsOutput 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"`
+
+ // Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror
+ // sessions are described. Alternatively, you can filter the results.
+ TrafficMirrorSessions []*TrafficMirrorSession `locationName:"trafficMirrorSessionSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorSessionsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorSessionsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorSessionsOutput) SetNextToken(v string) *DescribeTrafficMirrorSessionsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorSessions sets the TrafficMirrorSessions field's value.
+func (s *DescribeTrafficMirrorSessionsOutput) SetTrafficMirrorSessions(v []*TrafficMirrorSession) *DescribeTrafficMirrorSessionsOutput {
+ s.TrafficMirrorSessions = v
+ return s
+}
+
+type DescribeTrafficMirrorTargetsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * description: The Traffic Mirror target description.
+ //
+ // * network-interface-id: The ID of the Traffic Mirror session network interface.
+ //
+ // * network-load-balancer-arn: The Amazon Resource Name (ARN) of the Network
+ // Load Balancer that is associated with the session.
+ //
+ // * owner-id: The ID of the account that owns the Traffic Mirror session.
+ //
+ // * traffic-mirror-target-id: The ID of the Traffic Mirror target.
+ 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"`
+
+ // The ID of the Traffic Mirror targets.
+ TrafficMirrorTargetIds []*string `locationName:"TrafficMirrorTargetId" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorTargetsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorTargetsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTrafficMirrorTargetsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTrafficMirrorTargetsInput"}
+ 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 *DescribeTrafficMirrorTargetsInput) SetDryRun(v bool) *DescribeTrafficMirrorTargetsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTrafficMirrorTargetsInput) SetFilters(v []*Filter) *DescribeTrafficMirrorTargetsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTrafficMirrorTargetsInput) SetMaxResults(v int64) *DescribeTrafficMirrorTargetsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorTargetsInput) SetNextToken(v string) *DescribeTrafficMirrorTargetsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorTargetIds sets the TrafficMirrorTargetIds field's value.
+func (s *DescribeTrafficMirrorTargetsInput) SetTrafficMirrorTargetIds(v []*string) *DescribeTrafficMirrorTargetsInput {
+ s.TrafficMirrorTargetIds = v
+ return s
+}
+
+type DescribeTrafficMirrorTargetsOutput 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"`
+
+ // Information about one or more Traffic Mirror targets.
+ TrafficMirrorTargets []*TrafficMirrorTarget `locationName:"trafficMirrorTargetSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTrafficMirrorTargetsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTrafficMirrorTargetsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTrafficMirrorTargetsOutput) SetNextToken(v string) *DescribeTrafficMirrorTargetsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTrafficMirrorTargets sets the TrafficMirrorTargets field's value.
+func (s *DescribeTrafficMirrorTargetsOutput) SetTrafficMirrorTargets(v []*TrafficMirrorTarget) *DescribeTrafficMirrorTargetsOutput {
+ s.TrafficMirrorTargets = v
+ return s
+}
+
+type DescribeTransitGatewayAttachmentsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * association.state - The state of the association (associating | associated
+ // | disassociating).
+ //
+ // * association.transit-gateway-route-table-id - The ID of the route table
+ // for the transit gateway.
+ //
+ // * resource-id - The ID of the resource.
+ //
+ // * resource-owner-id - The ID of the AWS account that owns the resource.
+ //
+ // * resource-type - The resource type (vpc | vpn).
+ //
+ // * state - The state of the attachment (available | deleted | deleting
+ // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected
+ // | rejecting).
+ //
+ // * transit-gateway-attachment-id - The ID of the attachment.
+ //
+ // * transit-gateway-id - The ID of the transit gateway.
+ //
+ // * transit-gateway-owner-id - The ID of the AWS account that owns the transit
+ // gateway.
+ 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"`
+
+ // The IDs of the attachments.
+ TransitGatewayAttachmentIds []*string `type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayAttachmentsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayAttachmentsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTransitGatewayAttachmentsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayAttachmentsInput"}
+ 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 *DescribeTransitGatewayAttachmentsInput) SetDryRun(v bool) *DescribeTransitGatewayAttachmentsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTransitGatewayAttachmentsInput) SetFilters(v []*Filter) *DescribeTransitGatewayAttachmentsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTransitGatewayAttachmentsInput) SetMaxResults(v int64) *DescribeTransitGatewayAttachmentsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayAttachmentsInput) SetNextToken(v string) *DescribeTransitGatewayAttachmentsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentIds sets the TransitGatewayAttachmentIds field's value.
+func (s *DescribeTransitGatewayAttachmentsInput) SetTransitGatewayAttachmentIds(v []*string) *DescribeTransitGatewayAttachmentsInput {
+ s.TransitGatewayAttachmentIds = v
+ return s
+}
+
+type DescribeTransitGatewayAttachmentsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the attachments.
+ TransitGatewayAttachments []*TransitGatewayAttachment `locationName:"transitGatewayAttachments" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayAttachmentsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayAttachmentsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayAttachmentsOutput) SetNextToken(v string) *DescribeTransitGatewayAttachmentsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayAttachments sets the TransitGatewayAttachments field's value.
+func (s *DescribeTransitGatewayAttachmentsOutput) SetTransitGatewayAttachments(v []*TransitGatewayAttachment) *DescribeTransitGatewayAttachmentsOutput {
+ s.TransitGatewayAttachments = v
+ return s
+}
+
+type DescribeTransitGatewayRouteTablesInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * default-association-route-table - Indicates whether this is the default
+ // association route table for the transit gateway (true | false).
+ //
+ // * default-propagation-route-table - Indicates whether this is the default
+ // propagation route table for the transit gateway (true | false).
+ //
+ // * state - The state of the attachment (available | deleted | deleting
+ // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected
+ // | rejecting).
+ //
+ // * transit-gateway-id - The ID of the transit gateway.
+ //
+ // * transit-gateway-route-table-id - The ID of the transit gateway route
+ // table.
+ 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"`
+
+ // The IDs of the transit gateway route tables.
+ TransitGatewayRouteTableIds []*string `locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayRouteTablesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayRouteTablesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTransitGatewayRouteTablesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayRouteTablesInput"}
+ 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 *DescribeTransitGatewayRouteTablesInput) SetDryRun(v bool) *DescribeTransitGatewayRouteTablesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTransitGatewayRouteTablesInput) SetFilters(v []*Filter) *DescribeTransitGatewayRouteTablesInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTransitGatewayRouteTablesInput) SetMaxResults(v int64) *DescribeTransitGatewayRouteTablesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayRouteTablesInput) SetNextToken(v string) *DescribeTransitGatewayRouteTablesInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableIds sets the TransitGatewayRouteTableIds field's value.
+func (s *DescribeTransitGatewayRouteTablesInput) SetTransitGatewayRouteTableIds(v []*string) *DescribeTransitGatewayRouteTablesInput {
+ s.TransitGatewayRouteTableIds = v
+ return s
+}
+
+type DescribeTransitGatewayRouteTablesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the transit gateway route tables.
+ TransitGatewayRouteTables []*TransitGatewayRouteTable `locationName:"transitGatewayRouteTables" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayRouteTablesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayRouteTablesOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayRouteTablesOutput) SetNextToken(v string) *DescribeTransitGatewayRouteTablesOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayRouteTables sets the TransitGatewayRouteTables field's value.
+func (s *DescribeTransitGatewayRouteTablesOutput) SetTransitGatewayRouteTables(v []*TransitGatewayRouteTable) *DescribeTransitGatewayRouteTablesOutput {
+ s.TransitGatewayRouteTables = v
+ return s
+}
+
+type DescribeTransitGatewayVpcAttachmentsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * state - The state of the attachment (available | deleted | deleting
+ // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected
+ // | rejecting).
+ //
+ // * transit-gateway-attachment-id - The ID of the attachment.
+ //
+ // * transit-gateway-id - The ID of the transit gateway.
+ //
+ // * vpc-id - The ID of the VPC.
+ 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"`
+
+ // The IDs of the attachments.
+ TransitGatewayAttachmentIds []*string `type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayVpcAttachmentsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayVpcAttachmentsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTransitGatewayVpcAttachmentsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayVpcAttachmentsInput"}
+ 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 *DescribeTransitGatewayVpcAttachmentsInput) SetDryRun(v bool) *DescribeTransitGatewayVpcAttachmentsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsInput) SetFilters(v []*Filter) *DescribeTransitGatewayVpcAttachmentsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsInput) SetMaxResults(v int64) *DescribeTransitGatewayVpcAttachmentsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsInput) SetNextToken(v string) *DescribeTransitGatewayVpcAttachmentsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentIds sets the TransitGatewayAttachmentIds field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsInput) SetTransitGatewayAttachmentIds(v []*string) *DescribeTransitGatewayVpcAttachmentsInput {
+ s.TransitGatewayAttachmentIds = v
+ return s
+}
+
+type DescribeTransitGatewayVpcAttachmentsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the VPC attachments.
+ TransitGatewayVpcAttachments []*TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachments" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewayVpcAttachmentsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewayVpcAttachmentsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsOutput) SetNextToken(v string) *DescribeTransitGatewayVpcAttachmentsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayVpcAttachments sets the TransitGatewayVpcAttachments field's value.
+func (s *DescribeTransitGatewayVpcAttachmentsOutput) SetTransitGatewayVpcAttachments(v []*TransitGatewayVpcAttachment) *DescribeTransitGatewayVpcAttachmentsOutput {
+ s.TransitGatewayVpcAttachments = v
+ return s
+}
+
+type DescribeTransitGatewaysInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * options.propagation-default-route-table-id - The ID of the default propagation
+ // route table.
+ //
+ // * options.amazon-side-asn - The private ASN for the Amazon side of a BGP
+ // session.
+ //
+ // * options.association-default-route-table-id - The ID of the default association
+ // route table.
+ //
+ // * options.auto-accept-shared-attachments - Indicates whether there is
+ // automatic acceptance of attachment requests (enable | disable).
+ //
+ // * options.default-route-table-association - Indicates whether resource
+ // attachments are automatically associated with the default association
+ // route table (enable | disable).
+ //
+ // * options.default-route-table-propagation - Indicates whether resource
+ // attachments automatically propagate routes to the default propagation
+ // route table (enable | disable).
+ //
+ // * options.dns-support - Indicates whether DNS support is enabled (enable
+ // | disable).
+ //
+ // * options.vpn-ecmp-support - Indicates whether Equal Cost Multipath Protocol
+ // support is enabled (enable | disable).
+ //
+ // * owner-id - The ID of the AWS account that owns the transit gateway.
+ //
+ // * state - The state of the attachment (available | deleted | deleting
+ // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected
+ // | rejecting).
+ //
+ // * transit-gateway-id - The ID of the transit gateway.
+ 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"`
+
+ // The IDs of the transit gateways.
+ TransitGatewayIds []*string `locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewaysInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewaysInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTransitGatewaysInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewaysInput"}
+ 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 *DescribeTransitGatewaysInput) SetDryRun(v bool) *DescribeTransitGatewaysInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *DescribeTransitGatewaysInput) SetFilters(v []*Filter) *DescribeTransitGatewaysInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeTransitGatewaysInput) SetMaxResults(v int64) *DescribeTransitGatewaysInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewaysInput) SetNextToken(v string) *DescribeTransitGatewaysInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayIds sets the TransitGatewayIds field's value.
+func (s *DescribeTransitGatewaysInput) SetTransitGatewayIds(v []*string) *DescribeTransitGatewaysInput {
+ s.TransitGatewayIds = v
+ return s
+}
+
+type DescribeTransitGatewaysOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the transit gateways.
+ TransitGateways []*TransitGateway `locationName:"transitGatewaySet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTransitGatewaysOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTransitGatewaysOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeTransitGatewaysOutput) SetNextToken(v string) *DescribeTransitGatewaysOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGateways sets the TransitGateways field's value.
+func (s *DescribeTransitGatewaysOutput) SetTransitGateways(v []*TransitGateway) *DescribeTransitGatewaysOutput {
+ s.TransitGateways = v
+ return s
+}
+
// Contains the parameters for DescribeVolumeAttribute.
type DescribeVolumeAttributeInput struct {
_ struct{} `type:"structure"`
// The attribute of the volume. This parameter is required.
- Attribute *string `type:"string" enum:"VolumeAttributeName"`
+ //
+ // Attribute is a required field
+ Attribute *string `type:"string" required:"true" enum:"VolumeAttributeName"`
// Checks whether you have the required permissions for the action, without
// actually making the request, and provides an error response. If you have
@@ -41882,6 +58247,9 @@ func (s DescribeVolumeAttributeInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeVolumeAttributeInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "DescribeVolumeAttributeInput"}
+ if s.Attribute == nil {
+ invalidParams.Add(request.NewErrParamRequired("Attribute"))
+ }
if s.VolumeId == nil {
invalidParams.Add(request.NewErrParamRequired("VolumeId"))
}
@@ -41952,7 +58320,6 @@ func (s *DescribeVolumeAttributeOutput) SetVolumeId(v string) *DescribeVolumeAtt
return s
}
-// Contains the parameters for DescribeVolumeStatus.
type DescribeVolumeStatusInput struct {
_ struct{} `type:"structure"`
@@ -41962,7 +58329,7 @@ type DescribeVolumeStatusInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * action.code - The action code for the event (for example, enable-volume-io).
//
@@ -42011,7 +58378,7 @@ type DescribeVolumeStatusInput struct {
// more results to return.
NextToken *string `type:"string"`
- // One or more volume IDs.
+ // The IDs of the volumes.
//
// Default: Describes all your volumes.
VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"`
@@ -42057,7 +58424,6 @@ func (s *DescribeVolumeStatusInput) SetVolumeIds(v []*string) *DescribeVolumeSta
return s
}
-// Contains the output of DescribeVolumeStatus.
type DescribeVolumeStatusOutput struct {
_ struct{} `type:"structure"`
@@ -42065,7 +58431,7 @@ type DescribeVolumeStatusOutput struct {
// when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // A list of volumes.
+ // Information about the status of the volumes.
VolumeStatuses []*VolumeStatusItem `locationName:"volumeStatusSet" locationNameList:"item" type:"list"`
}
@@ -42091,7 +58457,6 @@ func (s *DescribeVolumeStatusOutput) SetVolumeStatuses(v []*VolumeStatusItem) *D
return s
}
-// Contains the parameters for DescribeVolumes.
type DescribeVolumesInput struct {
_ struct{} `type:"structure"`
@@ -42101,7 +58466,7 @@ type DescribeVolumesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more filters.
+ // The filters.
//
// * attachment.attach-time - The time stamp when the attachment initiated.
//
@@ -42120,7 +58485,7 @@ type DescribeVolumesInput struct {
//
// * create-time - The time stamp when the volume was created.
//
- // * encrypted - The encryption status of the volume.
+ // * encrypted - Indicates whether the volume is encrypted (true | false)
//
// * size - The size of the volume, in GiB.
//
@@ -42129,21 +58494,15 @@ type DescribeVolumesInput struct {
// * status - The status of the volume (creating | available | in-use | deleting
// | deleted | error).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * volume-id - The volume ID.
//
@@ -42169,7 +58528,7 @@ type DescribeVolumesInput struct {
// NextToken value. This value is null when there are no more results to return.
NextToken *string `locationName:"nextToken" type:"string"`
- // One or more volume IDs.
+ // The volume IDs.
VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"`
}
@@ -42222,7 +58581,7 @@ type DescribeVolumesModificationsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more filters. Supported filters: volume-id, modification-state, target-size,
+ // The filters. Supported filters: volume-id, modification-state, target-size,
// target-iops, target-volume-type, original-size, original-iops, original-volume-type,
// start-time.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
@@ -42234,7 +58593,7 @@ type DescribeVolumesModificationsInput struct {
// The nextToken value returned by a previous paginated request.
NextToken *string `type:"string"`
- // One or more volume IDs for which in-progress modifications will be described.
+ // The IDs of the volumes for which in-progress modifications will be described.
VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"`
}
@@ -42284,7 +58643,7 @@ type DescribeVolumesModificationsOutput struct {
// Token for pagination, null if there are no more results
NextToken *string `locationName:"nextToken" type:"string"`
- // A list of returned VolumeModification objects.
+ // Information about the volume modifications.
VolumesModifications []*VolumeModification `locationName:"volumeModificationSet" locationNameList:"item" type:"list"`
}
@@ -42310,7 +58669,6 @@ func (s *DescribeVolumesModificationsOutput) SetVolumesModifications(v []*Volume
return s
}
-// Contains the output of DescribeVolumes.
type DescribeVolumesOutput struct {
_ struct{} `type:"structure"`
@@ -42346,7 +58704,6 @@ func (s *DescribeVolumesOutput) SetVolumes(v []*Volume) *DescribeVolumesOutput {
return s
}
-// Contains the parameters for DescribeVpcAttribute.
type DescribeVpcAttributeInput struct {
_ struct{} `type:"structure"`
@@ -42411,7 +58768,6 @@ func (s *DescribeVpcAttributeInput) SetVpcId(v string) *DescribeVpcAttributeInpu
return s
}
-// Contains the output of DescribeVpcAttribute.
type DescribeVpcAttributeOutput struct {
_ struct{} `type:"structure"`
@@ -42457,17 +58813,14 @@ func (s *DescribeVpcAttributeOutput) SetVpcId(v string) *DescribeVpcAttributeOut
return s
}
-// Contains the parameters for DescribeVpcClassicLinkDnsSupport.
type DescribeVpcClassicLinkDnsSupportInput struct {
_ struct{} `type:"structure"`
- // The maximum number of items to return for this request. The request returns
- // a token that you can specify in a subsequent call to get the next set of
- // results.
+ // 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 `locationName:"maxResults" min:"5" type:"integer"`
- // The token for the next set of items to return. (You received this token from
- // a prior call.)
+ // The token for the next page of results.
NextToken *string `locationName:"nextToken" min:"1" type:"string"`
// One or more VPC IDs.
@@ -42518,11 +58871,11 @@ func (s *DescribeVpcClassicLinkDnsSupportInput) SetVpcIds(v []*string) *Describe
return s
}
-// Contains the output of DescribeVpcClassicLinkDnsSupport.
type DescribeVpcClassicLinkDnsSupportOutput struct {
_ struct{} `type:"structure"`
- // The token to use when requesting the next set of items.
+ // 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" min:"1" type:"string"`
// Information about the ClassicLink DNS support status of the VPCs.
@@ -42551,7 +58904,6 @@ func (s *DescribeVpcClassicLinkDnsSupportOutput) SetVpcs(v []*ClassicLinkDnsSupp
return s
}
-// Contains the parameters for DescribeVpcClassicLink.
type DescribeVpcClassicLinkInput struct {
_ struct{} `type:"structure"`
@@ -42566,21 +58918,15 @@ type DescribeVpcClassicLinkInput struct {
// * is-classic-link-enabled - Whether the VPC is enabled for ClassicLink
// (true | false).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// One or more VPCs for which you want to describe the ClassicLink status.
@@ -42615,7 +58961,6 @@ func (s *DescribeVpcClassicLinkInput) SetVpcIds(v []*string) *DescribeVpcClassic
return s
}
-// Contains the output of DescribeVpcClassicLink.
type DescribeVpcClassicLinkOutput struct {
_ struct{} `type:"structure"`
@@ -42864,6 +59209,16 @@ type DescribeVpcEndpointServiceConfigurationsInput struct {
//
// * service-state - The state of the service (Pending | Available | Deleting
// | Deleted | Failed).
+ //
+ // * tag: - 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.
+ //
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of results to return for the request in a single page.
@@ -43085,6 +59440,16 @@ type DescribeVpcEndpointServicesInput struct {
// One or more filters.
//
// * service-name: The name of the service.
+ //
+ // * tag: - 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.
+ //
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of items to return for this request. The request returns
@@ -43205,6 +59570,16 @@ type DescribeVpcEndpointsInput struct {
//
// * vpc-endpoint-state: The state of the endpoint. (pending | available
// | deleting | deleted)
+ //
+ // * tag: - 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.
+ //
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
// The maximum number of items to return for this request. The request returns
@@ -43296,7 +59671,6 @@ func (s *DescribeVpcEndpointsOutput) SetVpcEndpoints(v []*VpcEndpoint) *Describe
return s
}
-// Contains the parameters for DescribeVpcPeeringConnections.
type DescribeVpcPeeringConnectionsInput struct {
_ struct{} `type:"structure"`
@@ -43331,25 +59705,26 @@ type DescribeVpcPeeringConnectionsInput struct {
// * status-message - A message that provides more information about the
// status of the VPC peering connection, if applicable.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-peering-connection-id - The ID of the VPC peering connection.
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"`
+
// One or more VPC peering connection IDs.
//
// Default: Describes all your VPC peering connections.
@@ -43366,6 +59741,19 @@ func (s DescribeVpcPeeringConnectionsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeVpcPeeringConnectionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeVpcPeeringConnectionsInput"}
+ 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 *DescribeVpcPeeringConnectionsInput) SetDryRun(v bool) *DescribeVpcPeeringConnectionsInput {
s.DryRun = &v
@@ -43378,16 +59766,31 @@ func (s *DescribeVpcPeeringConnectionsInput) SetFilters(v []*Filter) *DescribeVp
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeVpcPeeringConnectionsInput) SetMaxResults(v int64) *DescribeVpcPeeringConnectionsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeVpcPeeringConnectionsInput) SetNextToken(v string) *DescribeVpcPeeringConnectionsInput {
+ s.NextToken = &v
+ return s
+}
+
// SetVpcPeeringConnectionIds sets the VpcPeeringConnectionIds field's value.
func (s *DescribeVpcPeeringConnectionsInput) SetVpcPeeringConnectionIds(v []*string) *DescribeVpcPeeringConnectionsInput {
s.VpcPeeringConnectionIds = v
return s
}
-// Contains the output of DescribeVpcPeeringConnections.
type DescribeVpcPeeringConnectionsOutput struct {
_ struct{} `type:"structure"`
+ // 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"`
+
// Information about the VPC peering connections.
VpcPeeringConnections []*VpcPeeringConnection `locationName:"vpcPeeringConnectionSet" locationNameList:"item" type:"list"`
}
@@ -43402,13 +59805,18 @@ func (s DescribeVpcPeeringConnectionsOutput) GoString() string {
return s.String()
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeVpcPeeringConnectionsOutput) SetNextToken(v string) *DescribeVpcPeeringConnectionsOutput {
+ s.NextToken = &v
+ return s
+}
+
// SetVpcPeeringConnections sets the VpcPeeringConnections field's value.
func (s *DescribeVpcPeeringConnectionsOutput) SetVpcPeeringConnections(v []*VpcPeeringConnection) *DescribeVpcPeeringConnectionsOutput {
s.VpcPeeringConnections = v
return s
}
-// Contains the parameters for DescribeVpcs.
type DescribeVpcsInput struct {
_ struct{} `type:"structure"`
@@ -43447,27 +59855,30 @@ type DescribeVpcsInput struct {
//
// * isDefault - Indicates whether the VPC is the default VPC.
//
+ // * owner-id - The ID of the AWS account that owns the VPC.
+ //
// * state - The state of the VPC (pending | available).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * vpc-id - The ID of the VPC.
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"`
+
// One or more VPC IDs.
//
// Default: Describes all your VPCs.
@@ -43484,6 +59895,19 @@ func (s DescribeVpcsInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeVpcsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeVpcsInput"}
+ 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 *DescribeVpcsInput) SetDryRun(v bool) *DescribeVpcsInput {
s.DryRun = &v
@@ -43496,16 +59920,31 @@ func (s *DescribeVpcsInput) SetFilters(v []*Filter) *DescribeVpcsInput {
return s
}
+// SetMaxResults sets the MaxResults field's value.
+func (s *DescribeVpcsInput) SetMaxResults(v int64) *DescribeVpcsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeVpcsInput) SetNextToken(v string) *DescribeVpcsInput {
+ s.NextToken = &v
+ return s
+}
+
// SetVpcIds sets the VpcIds field's value.
func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput {
s.VpcIds = v
return s
}
-// Contains the output of DescribeVpcs.
type DescribeVpcsOutput struct {
_ struct{} `type:"structure"`
+ // 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"`
+
// Information about one or more VPCs.
Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"`
}
@@ -43520,6 +59959,12 @@ func (s DescribeVpcsOutput) GoString() string {
return s.String()
}
+// SetNextToken sets the NextToken field's value.
+func (s *DescribeVpcsOutput) SetNextToken(v string) *DescribeVpcsOutput {
+ s.NextToken = &v
+ return s
+}
+
// SetVpcs sets the Vpcs field's value.
func (s *DescribeVpcsOutput) SetVpcs(v []*Vpc) *DescribeVpcsOutput {
s.Vpcs = v
@@ -43557,21 +60002,15 @@ type DescribeVpnConnectionsInput struct {
// * bgp-asn - The BGP Autonomous System Number (ASN) associated with a BGP
// device.
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * type - The type of VPN connection. Currently the only supported type
// is ipsec.1.
@@ -43666,21 +60105,15 @@ type DescribeVpnGatewaysInput struct {
// * state - The state of the virtual private gateway (pending | available
// | deleting | deleted).
//
- // * tag:key=value - The key/value combination of a tag assigned to the resource.
- // Specify the key of the tag in the filter name and the value of the tag
- // in the filter value. For example, for the tag Purpose=X, specify tag:Purpose
- // for the filter name and X for the filter value.
+ // * tag: - 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.
//
- // * tag-key - The key of a tag assigned to the resource. This filter is
- // independent of the tag-value filter. For example, if you use both the
- // filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources
- // assigned both the tag key Purpose (regardless of what the tag's value
- // is), and the tag value X (regardless of what the tag's key is). If you
- // want to list only resources where Purpose is X, see the tag:key=value
- // filter.
- //
- // * tag-value - The value of a tag assigned to the resource. This filter
- // is independent of the tag-key filter.
+ // * tag-key - The key of a tag assigned to the resource. Use this filter
+ // to find all resources assigned a tag with a specific key, regardless of
+ // the tag value.
//
// * type - The type of virtual private gateway. Currently the only supported
// type is ipsec.1.
@@ -43746,7 +60179,6 @@ func (s *DescribeVpnGatewaysOutput) SetVpnGateways(v []*VpnGateway) *DescribeVpn
return s
}
-// Contains the parameters for DetachClassicLinkVpc.
type DetachClassicLinkVpcInput struct {
_ struct{} `type:"structure"`
@@ -43811,7 +60243,6 @@ func (s *DetachClassicLinkVpcInput) SetVpcId(v string) *DetachClassicLinkVpcInpu
return s
}
-// Contains the output of DetachClassicLinkVpc.
type DetachClassicLinkVpcOutput struct {
_ struct{} `type:"structure"`
@@ -43835,7 +60266,6 @@ func (s *DetachClassicLinkVpcOutput) SetReturn(v bool) *DetachClassicLinkVpcOutp
return s
}
-// Contains the parameters for DetachInternetGateway.
type DetachInternetGatewayInput struct {
_ struct{} `type:"structure"`
@@ -43845,7 +60275,7 @@ type DetachInternetGatewayInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // The ID of the Internet gateway.
+ // The ID of the internet gateway.
//
// InternetGatewayId is a required field
InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"`
@@ -44194,6 +60624,9 @@ type DhcpOptions struct {
// The ID of the set of DHCP options.
DhcpOptionsId *string `locationName:"dhcpOptionsId" type:"string"`
+ // The ID of the AWS account that owns the DHCP options set.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// Any tags assigned to the DHCP options set.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
}
@@ -44220,12 +60653,202 @@ func (s *DhcpOptions) SetDhcpOptionsId(v string) *DhcpOptions {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *DhcpOptions) SetOwnerId(v string) *DhcpOptions {
+ s.OwnerId = &v
+ return s
+}
+
// SetTags sets the Tags field's value.
func (s *DhcpOptions) SetTags(v []*Tag) *DhcpOptions {
s.Tags = v
return s
}
+// Describes an Active Directory.
+type DirectoryServiceAuthentication struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Active Directory used for authentication.
+ DirectoryId *string `locationName:"directoryId" type:"string"`
+}
+
+// String returns the string representation
+func (s DirectoryServiceAuthentication) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DirectoryServiceAuthentication) GoString() string {
+ return s.String()
+}
+
+// SetDirectoryId sets the DirectoryId field's value.
+func (s *DirectoryServiceAuthentication) SetDirectoryId(v string) *DirectoryServiceAuthentication {
+ s.DirectoryId = &v
+ return s
+}
+
+// Describes the Active Directory to be used for client authentication.
+type DirectoryServiceAuthenticationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Active Directory to be used for authentication.
+ DirectoryId *string `type:"string"`
+}
+
+// String returns the string representation
+func (s DirectoryServiceAuthenticationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DirectoryServiceAuthenticationRequest) GoString() string {
+ return s.String()
+}
+
+// SetDirectoryId sets the DirectoryId field's value.
+func (s *DirectoryServiceAuthenticationRequest) SetDirectoryId(v string) *DirectoryServiceAuthenticationRequest {
+ s.DirectoryId = &v
+ return s
+}
+
+type DisableEbsEncryptionByDefaultInput 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
+func (s DisableEbsEncryptionByDefaultInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisableEbsEncryptionByDefaultInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DisableEbsEncryptionByDefaultInput) SetDryRun(v bool) *DisableEbsEncryptionByDefaultInput {
+ s.DryRun = &v
+ return s
+}
+
+type DisableEbsEncryptionByDefaultOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The updated status of encryption by default.
+ EbsEncryptionByDefault *bool `locationName:"ebsEncryptionByDefault" type:"boolean"`
+}
+
+// String returns the string representation
+func (s DisableEbsEncryptionByDefaultOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisableEbsEncryptionByDefaultOutput) GoString() string {
+ return s.String()
+}
+
+// SetEbsEncryptionByDefault sets the EbsEncryptionByDefault field's value.
+func (s *DisableEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) *DisableEbsEncryptionByDefaultOutput {
+ s.EbsEncryptionByDefault = &v
+ return s
+}
+
+type DisableTransitGatewayRouteTablePropagationInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+
+ // The ID of the propagation route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DisableTransitGatewayRouteTablePropagationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisableTransitGatewayRouteTablePropagationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DisableTransitGatewayRouteTablePropagationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DisableTransitGatewayRouteTablePropagationInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DisableTransitGatewayRouteTablePropagationInput) SetDryRun(v bool) *DisableTransitGatewayRouteTablePropagationInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *DisableTransitGatewayRouteTablePropagationInput) SetTransitGatewayAttachmentId(v string) *DisableTransitGatewayRouteTablePropagationInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *DisableTransitGatewayRouteTablePropagationInput) SetTransitGatewayRouteTableId(v string) *DisableTransitGatewayRouteTablePropagationInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type DisableTransitGatewayRouteTablePropagationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about route propagation.
+ Propagation *TransitGatewayPropagation `locationName:"propagation" type:"structure"`
+}
+
+// String returns the string representation
+func (s DisableTransitGatewayRouteTablePropagationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisableTransitGatewayRouteTablePropagationOutput) GoString() string {
+ return s.String()
+}
+
+// SetPropagation sets the Propagation field's value.
+func (s *DisableTransitGatewayRouteTablePropagationOutput) SetPropagation(v *TransitGatewayPropagation) *DisableTransitGatewayRouteTablePropagationOutput {
+ s.Propagation = v
+ return s
+}
+
// Contains the parameters for DisableVgwRoutePropagation.
type DisableVgwRoutePropagationInput struct {
_ struct{} `type:"structure"`
@@ -44293,7 +60916,6 @@ func (s DisableVgwRoutePropagationOutput) GoString() string {
return s.String()
}
-// Contains the parameters for DisableVpcClassicLinkDnsSupport.
type DisableVpcClassicLinkDnsSupportInput struct {
_ struct{} `type:"structure"`
@@ -44317,7 +60939,6 @@ func (s *DisableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *DisableVpcCla
return s
}
-// Contains the output of DisableVpcClassicLinkDnsSupport.
type DisableVpcClassicLinkDnsSupportOutput struct {
_ struct{} `type:"structure"`
@@ -44341,7 +60962,6 @@ func (s *DisableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *DisableVpcCla
return s
}
-// Contains the parameters for DisableVpcClassicLink.
type DisableVpcClassicLinkInput struct {
_ struct{} `type:"structure"`
@@ -44392,7 +61012,6 @@ func (s *DisableVpcClassicLinkInput) SetVpcId(v string) *DisableVpcClassicLinkIn
return s
}
-// Contains the output of DisableVpcClassicLink.
type DisableVpcClassicLinkOutput struct {
_ struct{} `type:"structure"`
@@ -44416,7 +61035,6 @@ func (s *DisableVpcClassicLinkOutput) SetReturn(v bool) *DisableVpcClassicLinkOu
return s
}
-// Contains the parameters for DisassociateAddress.
type DisassociateAddressInput struct {
_ struct{} `type:"structure"`
@@ -44475,6 +61093,102 @@ func (s DisassociateAddressOutput) GoString() string {
return s.String()
}
+type DisassociateClientVpnTargetNetworkInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the target network association.
+ //
+ // AssociationId is a required field
+ AssociationId *string `type:"string" required:"true"`
+
+ // The ID of the Client VPN endpoint from which to disassociate the target network.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s DisassociateClientVpnTargetNetworkInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisassociateClientVpnTargetNetworkInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DisassociateClientVpnTargetNetworkInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DisassociateClientVpnTargetNetworkInput"}
+ if s.AssociationId == nil {
+ invalidParams.Add(request.NewErrParamRequired("AssociationId"))
+ }
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAssociationId sets the AssociationId field's value.
+func (s *DisassociateClientVpnTargetNetworkInput) SetAssociationId(v string) *DisassociateClientVpnTargetNetworkInput {
+ s.AssociationId = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *DisassociateClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *DisassociateClientVpnTargetNetworkInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DisassociateClientVpnTargetNetworkInput) SetDryRun(v bool) *DisassociateClientVpnTargetNetworkInput {
+ s.DryRun = &v
+ return s
+}
+
+type DisassociateClientVpnTargetNetworkOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the target network association.
+ AssociationId *string `locationName:"associationId" type:"string"`
+
+ // The current state of the target network association.
+ Status *AssociationStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s DisassociateClientVpnTargetNetworkOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisassociateClientVpnTargetNetworkOutput) GoString() string {
+ return s.String()
+}
+
+// SetAssociationId sets the AssociationId field's value.
+func (s *DisassociateClientVpnTargetNetworkOutput) SetAssociationId(v string) *DisassociateClientVpnTargetNetworkOutput {
+ s.AssociationId = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *DisassociateClientVpnTargetNetworkOutput) SetStatus(v *AssociationStatus) *DisassociateClientVpnTargetNetworkOutput {
+ s.Status = v
+ return s
+}
+
type DisassociateIamInstanceProfileInput struct {
_ struct{} `type:"structure"`
@@ -44536,7 +61250,6 @@ func (s *DisassociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(
return s
}
-// Contains the parameters for DisassociateRouteTable.
type DisassociateRouteTableInput struct {
_ struct{} `type:"structure"`
@@ -44672,6 +61385,93 @@ func (s *DisassociateSubnetCidrBlockOutput) SetSubnetId(v string) *DisassociateS
return s
}
+type DisassociateTransitGatewayRouteTableInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DisassociateTransitGatewayRouteTableInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisassociateTransitGatewayRouteTableInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DisassociateTransitGatewayRouteTableInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DisassociateTransitGatewayRouteTableInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *DisassociateTransitGatewayRouteTableInput) SetDryRun(v bool) *DisassociateTransitGatewayRouteTableInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *DisassociateTransitGatewayRouteTableInput) SetTransitGatewayAttachmentId(v string) *DisassociateTransitGatewayRouteTableInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *DisassociateTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *DisassociateTransitGatewayRouteTableInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type DisassociateTransitGatewayRouteTableOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the association.
+ Association *TransitGatewayAssociation `locationName:"association" type:"structure"`
+}
+
+// String returns the string representation
+func (s DisassociateTransitGatewayRouteTableOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DisassociateTransitGatewayRouteTableOutput) GoString() string {
+ return s.String()
+}
+
+// SetAssociation sets the Association field's value.
+func (s *DisassociateTransitGatewayRouteTableOutput) SetAssociation(v *TransitGatewayAssociation) *DisassociateTransitGatewayRouteTableOutput {
+ s.Association = v
+ return s
+}
+
type DisassociateVpcCidrBlockInput struct {
_ struct{} `type:"structure"`
@@ -44826,11 +61626,11 @@ type DiskImageDescription struct {
// A presigned URL for the import manifest stored in Amazon S3. For information
// about creating a presigned URL for an Amazon S3 object, read the "Query String
// Request Authentication Alternative" section of the Authenticating REST Requests
- // (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html)
+ // (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html)
// topic in the Amazon Simple Storage Service Developer Guide.
//
// For information about the import manifest referenced by this API action,
- // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
+ // see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
ImportManifestUrl *string `locationName:"importManifestUrl" type:"string"`
// The size of the disk image, in GiB.
@@ -44888,11 +61688,11 @@ type DiskImageDetail struct {
// A presigned URL for the import manifest stored in Amazon S3 and presented
// here as an Amazon S3 presigned URL. For information about creating a presigned
// URL for an Amazon S3 object, read the "Query String Request Authentication
- // Alternative" section of the Authenticating REST Requests (http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html)
+ // Alternative" section of the Authenticating REST Requests (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html)
// topic in the Amazon Simple Storage Service Developer Guide.
//
// For information about the import manifest referenced by this API action,
- // see VM Import Manifest (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
+ // see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html).
//
// ImportManifestUrl is a required field
ImportManifestUrl *string `locationName:"importManifestUrl" type:"string" required:"true"`
@@ -45011,6 +61811,42 @@ func (s *DnsEntry) SetHostedZoneId(v string) *DnsEntry {
return s
}
+// Information about the DNS server to be used.
+type DnsServersOptionsModifyStructure struct {
+ _ struct{} `type:"structure"`
+
+ // The IPv4 address range, in CIDR notation, of the DNS servers to be used.
+ // You can specify up to two DNS servers. Ensure that the DNS servers can be
+ // reached by the clients. The specified values overwrite the existing values.
+ CustomDnsServers []*string `locationNameList:"item" type:"list"`
+
+ // Indicates whether DNS servers should be used. Specify False to delete the
+ // existing DNS servers.
+ Enabled *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s DnsServersOptionsModifyStructure) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DnsServersOptionsModifyStructure) GoString() string {
+ return s.String()
+}
+
+// SetCustomDnsServers sets the CustomDnsServers field's value.
+func (s *DnsServersOptionsModifyStructure) SetCustomDnsServers(v []*string) *DnsServersOptionsModifyStructure {
+ s.CustomDnsServers = v
+ return s
+}
+
+// SetEnabled sets the Enabled field's value.
+func (s *DnsServersOptionsModifyStructure) SetEnabled(v bool) *DnsServersOptionsModifyStructure {
+ s.Enabled = &v
+ return s
+}
+
// Describes a block device for an EBS volume.
type EbsBlockDevice struct {
_ struct{} `type:"structure"`
@@ -45018,34 +61854,44 @@ type EbsBlockDevice struct {
// Indicates whether the EBS volume is deleted on instance termination.
DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"`
- // Indicates whether the EBS volume is encrypted. Encrypted volumes can only
- // be attached to instances that support Amazon EBS encryption. If you are creating
- // a volume from a snapshot, you can't specify an encryption value. This is
- // because only blank volumes can be encrypted on creation.
+ // Indicates whether the encryption state of an EBS volume is changed while
+ // 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 Elastic Compute Cloud 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).
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The number of I/O operations per second (IOPS) that the volume supports.
- // For io1, this represents the number of IOPS that are provisioned for the
- // volume. For gp2, this represents the baseline performance of the volume and
- // the rate at which the volume accumulates I/O credits for bursting. For more
- // information about General Purpose SSD baseline performance, I/O credits,
- // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
+ // For io1 volumes, this represents the number of IOPS that are provisioned
+ // for the volume. For gp2 volumes, this represents the baseline performance
+ // of the volume and the rate at which the volume accumulates I/O credits for
+ // bursting. 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.
//
- // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for
- // gp2 volumes.
+ // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS
+ // for io1 volumes in most Regions. Maximum io1 IOPS of 64,000 is guaranteed
+ // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances).
+ // Other instance families guarantee performance up to 32,000 IOPS. 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.
//
// Condition: This parameter is required for requests to create io1 volumes;
// it is not used in requests to create gp2, st1, sc1, or standard volumes.
Iops *int64 `locationName:"iops" type:"integer"`
- // Identifier (key ID, key alias, ID ARN, or alias ARN) for a user-managed CMK
- // under which the EBS volume is encrypted.
+ // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed
+ // CMK under which the EBS volume is encrypted.
//
- // Note: This parameter is only supported on BlockDeviceMapping objects called
- // by RunInstances (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html),
- // RequestSpotFleet (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html),
- // and RequestSpotInstances (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html).
+ // This parameter is only supported on BlockDeviceMapping objects called by
+ // RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html),
+ // RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html),
+ // and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html).
KmsKeyId *string `type:"string"`
// The ID of the snapshot.
@@ -45053,17 +61899,17 @@ type EbsBlockDevice struct {
// The size of the volume, in GiB.
//
+ // Default: If you're creating the volume from a snapshot and don't specify
+ // a volume size, the default is the snapshot size.
+ //
// Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned
// IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for
// Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify
// a snapshot, the volume size must be equal to or larger than the snapshot
// size.
- //
- // Default: If you're creating the volume from a snapshot and don't specify
- // a volume size, the default is the snapshot size.
VolumeSize *int64 `locationName:"volumeSize" type:"integer"`
- // The volume type: gp2, io1, st1, sc1, or standard.
+ // The volume type. If you set the type to io1, you must also set the Iops property.
//
// Default: standard
VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"`
@@ -45126,7 +61972,7 @@ type EbsInstanceBlockDevice struct {
_ struct{} `type:"structure"`
// The time stamp when the attachment initiated.
- AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"`
+ AttachTime *time.Time `locationName:"attachTime" type:"timestamp"`
// Indicates whether the volume is deleted on instance termination.
DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"`
@@ -45206,14 +62052,14 @@ func (s *EbsInstanceBlockDeviceSpecification) SetVolumeId(v string) *EbsInstance
return s
}
-// Describes an egress-only Internet gateway.
+// Describes an egress-only internet gateway.
type EgressOnlyInternetGateway struct {
_ struct{} `type:"structure"`
- // Information about the attachment of the egress-only Internet gateway.
+ // Information about the attachment of the egress-only internet gateway.
Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"`
- // The ID of the egress-only Internet gateway.
+ // The ID of the egress-only internet gateway.
EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"`
}
@@ -45239,20 +62085,21 @@ func (s *EgressOnlyInternetGateway) SetEgressOnlyInternetGatewayId(v string) *Eg
return s
}
-// Describes the association between an instance and an Elastic GPU.
+// Describes the association between an instance and an Elastic Graphics accelerator.
type ElasticGpuAssociation struct {
_ struct{} `type:"structure"`
// The ID of the association.
ElasticGpuAssociationId *string `locationName:"elasticGpuAssociationId" type:"string"`
- // The state of the association between the instance and the Elastic GPU.
+ // The state of the association between the instance and the Elastic Graphics
+ // accelerator.
ElasticGpuAssociationState *string `locationName:"elasticGpuAssociationState" type:"string"`
- // The time the Elastic GPU was associated with the instance.
+ // The time the Elastic Graphics accelerator was associated with the instance.
ElasticGpuAssociationTime *string `locationName:"elasticGpuAssociationTime" type:"string"`
- // The ID of the Elastic GPU.
+ // The ID of the Elastic Graphics accelerator.
ElasticGpuId *string `locationName:"elasticGpuId" type:"string"`
}
@@ -45290,7 +62137,7 @@ func (s *ElasticGpuAssociation) SetElasticGpuId(v string) *ElasticGpuAssociation
return s
}
-// Describes the status of an Elastic GPU.
+// Describes the status of an Elastic Graphics accelerator.
type ElasticGpuHealth struct {
_ struct{} `type:"structure"`
@@ -45314,11 +62161,11 @@ func (s *ElasticGpuHealth) SetStatus(v string) *ElasticGpuHealth {
return s
}
-// A specification for an Elastic GPU.
+// A specification for an Elastic Graphics accelerator.
type ElasticGpuSpecification struct {
_ struct{} `type:"structure"`
- // The type of Elastic GPU.
+ // The type of Elastic Graphics accelerator.
//
// Type is a required field
Type *string `type:"string" required:"true"`
@@ -45377,26 +62224,26 @@ func (s *ElasticGpuSpecificationResponse) SetType(v string) *ElasticGpuSpecifica
return s
}
-// Describes an Elastic GPU.
+// Describes an Elastic Graphics accelerator.
type ElasticGpus struct {
_ struct{} `type:"structure"`
- // The Availability Zone in the which the Elastic GPU resides.
+ // The Availability Zone in the which the Elastic Graphics accelerator resides.
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
- // The status of the Elastic GPU.
+ // The status of the Elastic Graphics accelerator.
ElasticGpuHealth *ElasticGpuHealth `locationName:"elasticGpuHealth" type:"structure"`
- // The ID of the Elastic GPU.
+ // The ID of the Elastic Graphics accelerator.
ElasticGpuId *string `locationName:"elasticGpuId" type:"string"`
- // The state of the Elastic GPU.
+ // The state of the Elastic Graphics accelerator.
ElasticGpuState *string `locationName:"elasticGpuState" type:"string" enum:"ElasticGpuState"`
- // The type of Elastic GPU.
+ // The type of Elastic Graphics accelerator.
ElasticGpuType *string `locationName:"elasticGpuType" type:"string"`
- // The ID of the instance to which the Elastic GPU is attached.
+ // The ID of the instance to which the Elastic Graphics accelerator is attached.
InstanceId *string `locationName:"instanceId" type:"string"`
}
@@ -45446,16 +62293,247 @@ func (s *ElasticGpus) SetInstanceId(v string) *ElasticGpus {
return s
}
+// Describes an elastic inference accelerator.
+type ElasticInferenceAccelerator struct {
+ _ struct{} `type:"structure"`
+
+ // The type of elastic inference accelerator. The possible values are eia1.small,
+ // eia1.medium, and eia1.large.
+ //
+ // Type is a required field
+ Type *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ElasticInferenceAccelerator) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ElasticInferenceAccelerator) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ElasticInferenceAccelerator) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ElasticInferenceAccelerator"}
+ if s.Type == nil {
+ invalidParams.Add(request.NewErrParamRequired("Type"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetType sets the Type field's value.
+func (s *ElasticInferenceAccelerator) SetType(v string) *ElasticInferenceAccelerator {
+ s.Type = &v
+ return s
+}
+
+// Describes the association between an instance and an elastic inference accelerator.
+type ElasticInferenceAcceleratorAssociation struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the elastic inference accelerator.
+ ElasticInferenceAcceleratorArn *string `locationName:"elasticInferenceAcceleratorArn" type:"string"`
+
+ // The ID of the association.
+ ElasticInferenceAcceleratorAssociationId *string `locationName:"elasticInferenceAcceleratorAssociationId" type:"string"`
+
+ // The state of the elastic inference accelerator.
+ ElasticInferenceAcceleratorAssociationState *string `locationName:"elasticInferenceAcceleratorAssociationState" type:"string"`
+
+ // The time at which the elastic inference accelerator is associated with an
+ // instance.
+ ElasticInferenceAcceleratorAssociationTime *time.Time `locationName:"elasticInferenceAcceleratorAssociationTime" type:"timestamp"`
+}
+
+// String returns the string representation
+func (s ElasticInferenceAcceleratorAssociation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ElasticInferenceAcceleratorAssociation) GoString() string {
+ return s.String()
+}
+
+// SetElasticInferenceAcceleratorArn sets the ElasticInferenceAcceleratorArn field's value.
+func (s *ElasticInferenceAcceleratorAssociation) SetElasticInferenceAcceleratorArn(v string) *ElasticInferenceAcceleratorAssociation {
+ s.ElasticInferenceAcceleratorArn = &v
+ return s
+}
+
+// SetElasticInferenceAcceleratorAssociationId sets the ElasticInferenceAcceleratorAssociationId field's value.
+func (s *ElasticInferenceAcceleratorAssociation) SetElasticInferenceAcceleratorAssociationId(v string) *ElasticInferenceAcceleratorAssociation {
+ s.ElasticInferenceAcceleratorAssociationId = &v
+ return s
+}
+
+// SetElasticInferenceAcceleratorAssociationState sets the ElasticInferenceAcceleratorAssociationState field's value.
+func (s *ElasticInferenceAcceleratorAssociation) SetElasticInferenceAcceleratorAssociationState(v string) *ElasticInferenceAcceleratorAssociation {
+ s.ElasticInferenceAcceleratorAssociationState = &v
+ return s
+}
+
+// SetElasticInferenceAcceleratorAssociationTime sets the ElasticInferenceAcceleratorAssociationTime field's value.
+func (s *ElasticInferenceAcceleratorAssociation) SetElasticInferenceAcceleratorAssociationTime(v time.Time) *ElasticInferenceAcceleratorAssociation {
+ s.ElasticInferenceAcceleratorAssociationTime = &v
+ return s
+}
+
+type EnableEbsEncryptionByDefaultInput 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
+func (s EnableEbsEncryptionByDefaultInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s EnableEbsEncryptionByDefaultInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *EnableEbsEncryptionByDefaultInput) SetDryRun(v bool) *EnableEbsEncryptionByDefaultInput {
+ s.DryRun = &v
+ return s
+}
+
+type EnableEbsEncryptionByDefaultOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The updated status of encryption by default.
+ EbsEncryptionByDefault *bool `locationName:"ebsEncryptionByDefault" type:"boolean"`
+}
+
+// String returns the string representation
+func (s EnableEbsEncryptionByDefaultOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s EnableEbsEncryptionByDefaultOutput) GoString() string {
+ return s.String()
+}
+
+// SetEbsEncryptionByDefault sets the EbsEncryptionByDefault field's value.
+func (s *EnableEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) *EnableEbsEncryptionByDefaultOutput {
+ s.EbsEncryptionByDefault = &v
+ return s
+}
+
+type EnableTransitGatewayRouteTablePropagationInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+
+ // The ID of the propagation route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s EnableTransitGatewayRouteTablePropagationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s EnableTransitGatewayRouteTablePropagationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *EnableTransitGatewayRouteTablePropagationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "EnableTransitGatewayRouteTablePropagationInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *EnableTransitGatewayRouteTablePropagationInput) SetDryRun(v bool) *EnableTransitGatewayRouteTablePropagationInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *EnableTransitGatewayRouteTablePropagationInput) SetTransitGatewayAttachmentId(v string) *EnableTransitGatewayRouteTablePropagationInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *EnableTransitGatewayRouteTablePropagationInput) SetTransitGatewayRouteTableId(v string) *EnableTransitGatewayRouteTablePropagationInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type EnableTransitGatewayRouteTablePropagationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about route propagation.
+ Propagation *TransitGatewayPropagation `locationName:"propagation" type:"structure"`
+}
+
+// String returns the string representation
+func (s EnableTransitGatewayRouteTablePropagationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s EnableTransitGatewayRouteTablePropagationOutput) GoString() string {
+ return s.String()
+}
+
+// SetPropagation sets the Propagation field's value.
+func (s *EnableTransitGatewayRouteTablePropagationOutput) SetPropagation(v *TransitGatewayPropagation) *EnableTransitGatewayRouteTablePropagationOutput {
+ s.Propagation = v
+ return s
+}
+
// Contains the parameters for EnableVgwRoutePropagation.
type EnableVgwRoutePropagationInput struct {
_ struct{} `type:"structure"`
- // The ID of the virtual private gateway.
+ // The ID of the virtual private gateway that is attached to a VPC. The virtual
+ // private gateway must be attached to the same VPC that the routing tables
+ // are associated with.
//
// GatewayId is a required field
GatewayId *string `type:"string" required:"true"`
- // The ID of the route table.
+ // The ID of the route table. The routing table must be associated with the
+ // same VPC that the virtual private gateway is attached to.
//
// RouteTableId is a required field
RouteTableId *string `type:"string" required:"true"`
@@ -45578,7 +62656,6 @@ func (s EnableVolumeIOOutput) GoString() string {
return s.String()
}
-// Contains the parameters for EnableVpcClassicLinkDnsSupport.
type EnableVpcClassicLinkDnsSupportInput struct {
_ struct{} `type:"structure"`
@@ -45602,7 +62679,6 @@ func (s *EnableVpcClassicLinkDnsSupportInput) SetVpcId(v string) *EnableVpcClass
return s
}
-// Contains the output of EnableVpcClassicLinkDnsSupport.
type EnableVpcClassicLinkDnsSupportOutput struct {
_ struct{} `type:"structure"`
@@ -45626,7 +62702,6 @@ func (s *EnableVpcClassicLinkDnsSupportOutput) SetReturn(v bool) *EnableVpcClass
return s
}
-// Contains the parameters for EnableVpcClassicLink.
type EnableVpcClassicLinkInput struct {
_ struct{} `type:"structure"`
@@ -45677,7 +62752,6 @@ func (s *EnableVpcClassicLinkInput) SetVpcId(v string) *EnableVpcClassicLinkInpu
return s
}
-// Contains the output of EnableVpcClassicLink.
type EnableVpcClassicLinkOutput struct {
_ struct{} `type:"structure"`
@@ -45701,7 +62775,7 @@ func (s *EnableVpcClassicLinkOutput) SetReturn(v bool) *EnableVpcClassicLinkOutp
return s
}
-// Describes a Spot Fleet event.
+// Describes an EC2 Fleet or Spot Fleet event.
type EventInformation struct {
_ struct{} `type:"structure"`
@@ -45712,12 +62786,8 @@ type EventInformation struct {
//
// The following are the error events:
//
- // * iamFleetRoleInvalid - The Spot Fleet did not have the required permissions
- // either to launch or terminate an instance.
- //
- // * launchSpecTemporarilyBlacklisted - The configuration is not valid and
- // several attempts to launch instances have failed. For more information,
- // see the description of the event.
+ // * iamFleetRoleInvalid - The EC2 Fleet or Spot Fleet did not have the required
+ // permissions either to launch or terminate an instance.
//
// * spotFleetRequestConfigurationInvalid - The configuration is not valid.
// For more information, see the description of the event.
@@ -45727,33 +62797,35 @@ type EventInformation struct {
//
// The following are the fleetRequestChange events:
//
- // * active - The Spot Fleet has been validated and Amazon EC2 is attempting
- // to maintain the target number of running Spot Instances.
+ // * active - The EC2 Fleet or Spot Fleet request has been validated and
+ // Amazon EC2 is attempting to maintain the target number of running Spot
+ // Instances.
//
- // * cancelled - The Spot Fleet is canceled and has no running Spot Instances.
- // The Spot Fleet will be deleted two days after its instances were terminated.
+ // * cancelled - The EC2 Fleet or Spot Fleet request is canceled and has
+ // no running Spot Instances. The EC2 Fleet or Spot Fleet will be deleted
+ // two days after its instances were terminated.
//
- // * cancelled_running - The Spot Fleet is canceled and does not launch additional
- // Spot Instances. Existing Spot Instances continue to run until they are
- // interrupted or terminated.
+ // * cancelled_running - The EC2 Fleet or Spot Fleet request is canceled
+ // and does not launch additional Spot Instances. Existing Spot Instances
+ // continue to run until they are interrupted or terminated.
//
- // * cancelled_terminating - The Spot Fleet is canceled and its Spot Instances
- // are terminating.
+ // * cancelled_terminating - The EC2 Fleet or Spot Fleet request is canceled
+ // and its Spot Instances are terminating.
//
- // * expired - The Spot Fleet request has expired. A subsequent event indicates
- // that the instances were terminated, if the request was created with TerminateInstancesWithExpiration
- // set.
+ // * expired - The EC2 Fleet or Spot Fleet request has expired. A subsequent
+ // event indicates that the instances were terminated, if the request was
+ // created with TerminateInstancesWithExpiration set.
//
- // * modify_in_progress - A request to modify the Spot Fleet request was
- // accepted and is in progress.
+ // * modify_in_progress - A request to modify the EC2 Fleet or Spot Fleet
+ // request was accepted and is in progress.
//
- // * modify_successful - The Spot Fleet request was modified.
+ // * modify_successful - The EC2 Fleet or Spot Fleet request was modified.
//
// * price_update - The price for a launch configuration was adjusted because
// it was too high. This change is permanent.
//
- // * submitted - The Spot Fleet request is being evaluated and Amazon EC2
- // is preparing to launch the target number of Spot Instances.
+ // * submitted - The EC2 Fleet or Spot Fleet request is being evaluated and
+ // Amazon EC2 is preparing to launch the target number of Spot Instances.
//
// The following are the instanceChange events:
//
@@ -45763,6 +62835,10 @@ type EventInformation struct {
//
// The following are the Information events:
//
+ // * launchSpecTemporarilyBlacklisted - The configuration is not valid and
+ // several attempts to launch instances have failed. For more information,
+ // see the description of the event.
+ //
// * launchSpecUnusable - The price in a launch specification is not valid
// because it is below the Spot price or the Spot price is above the On-Demand
// price.
@@ -45804,6 +62880,161 @@ func (s *EventInformation) SetInstanceId(v string) *EventInformation {
return s
}
+type ExportClientVpnClientCertificateRevocationListInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ExportClientVpnClientCertificateRevocationListInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportClientVpnClientCertificateRevocationListInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ExportClientVpnClientCertificateRevocationListInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ExportClientVpnClientCertificateRevocationListInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ExportClientVpnClientCertificateRevocationListInput) SetClientVpnEndpointId(v string) *ExportClientVpnClientCertificateRevocationListInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ExportClientVpnClientCertificateRevocationListInput) SetDryRun(v bool) *ExportClientVpnClientCertificateRevocationListInput {
+ s.DryRun = &v
+ return s
+}
+
+type ExportClientVpnClientCertificateRevocationListOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the client certificate revocation list.
+ CertificateRevocationList *string `locationName:"certificateRevocationList" type:"string"`
+
+ // The current state of the client certificate revocation list.
+ Status *ClientCertificateRevocationListStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s ExportClientVpnClientCertificateRevocationListOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportClientVpnClientCertificateRevocationListOutput) GoString() string {
+ return s.String()
+}
+
+// SetCertificateRevocationList sets the CertificateRevocationList field's value.
+func (s *ExportClientVpnClientCertificateRevocationListOutput) SetCertificateRevocationList(v string) *ExportClientVpnClientCertificateRevocationListOutput {
+ s.CertificateRevocationList = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *ExportClientVpnClientCertificateRevocationListOutput) SetStatus(v *ClientCertificateRevocationListStatus) *ExportClientVpnClientCertificateRevocationListOutput {
+ s.Status = v
+ return s
+}
+
+type ExportClientVpnClientConfigurationInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ExportClientVpnClientConfigurationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportClientVpnClientConfigurationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ExportClientVpnClientConfigurationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ExportClientVpnClientConfigurationInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ExportClientVpnClientConfigurationInput) SetClientVpnEndpointId(v string) *ExportClientVpnClientConfigurationInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ExportClientVpnClientConfigurationInput) SetDryRun(v bool) *ExportClientVpnClientConfigurationInput {
+ s.DryRun = &v
+ return s
+}
+
+type ExportClientVpnClientConfigurationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The contents of the Client VPN endpoint configuration file.
+ ClientConfiguration *string `locationName:"clientConfiguration" type:"string"`
+}
+
+// String returns the string representation
+func (s ExportClientVpnClientConfigurationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportClientVpnClientConfigurationOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientConfiguration sets the ClientConfiguration field's value.
+func (s *ExportClientVpnClientConfigurationOutput) SetClientConfiguration(v string) *ExportClientVpnClientConfigurationOutput {
+ s.ClientConfiguration = &v
+ return s
+}
+
// Describes an instance export task.
type ExportTask struct {
_ struct{} `type:"structure"`
@@ -45980,6 +63211,128 @@ func (s *ExportToS3TaskSpecification) SetS3Prefix(v string) *ExportToS3TaskSpeci
return s
}
+type ExportTransitGatewayRoutesInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * attachment.transit-gateway-attachment-id - The id of the transit gateway
+ // attachment.
+ //
+ // * attachment.resource-id - The resource id of the transit gateway attachment.
+ //
+ // * route-search.exact-match - The exact match of the specified filter.
+ //
+ // * route-search.longest-prefix-match - The longest prefix that matches
+ // the route.
+ //
+ // * route-search.subnet-of-match - The routes with a subnet that match the
+ // specified CIDR filter.
+ //
+ // * route-search.supernet-of-match - The routes with a CIDR that encompass
+ // the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31
+ // routes in your route table and you specify supernet-of-match as 10.0.1.0/30,
+ // then the result returns 10.0.1.0/29.
+ //
+ // * state - The state of the attachment (available | deleted | deleting
+ // | failed | modifying | pendingAcceptance | pending | rollingBack | rejected
+ // | rejecting).
+ //
+ // * transit-gateway-route-destination-cidr-block - The CIDR range.
+ //
+ // * type - The type of route (active | blackhole).
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"`
+
+ // The name of the S3 bucket.
+ //
+ // S3Bucket is a required field
+ S3Bucket *string `type:"string" required:"true"`
+
+ // The ID of the route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ExportTransitGatewayRoutesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportTransitGatewayRoutesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ExportTransitGatewayRoutesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ExportTransitGatewayRoutesInput"}
+ if s.S3Bucket == nil {
+ invalidParams.Add(request.NewErrParamRequired("S3Bucket"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ExportTransitGatewayRoutesInput) SetDryRun(v bool) *ExportTransitGatewayRoutesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *ExportTransitGatewayRoutesInput) SetFilters(v []*Filter) *ExportTransitGatewayRoutesInput {
+ s.Filters = v
+ return s
+}
+
+// SetS3Bucket sets the S3Bucket field's value.
+func (s *ExportTransitGatewayRoutesInput) SetS3Bucket(v string) *ExportTransitGatewayRoutesInput {
+ s.S3Bucket = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *ExportTransitGatewayRoutesInput) SetTransitGatewayRouteTableId(v string) *ExportTransitGatewayRoutesInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type ExportTransitGatewayRoutesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The URL of the exported file in Amazon S3. For example, s3://bucket_name/VPCTransitGateway/TransitGatewayRouteTables/file_name.
+ S3Location *string `locationName:"s3Location" type:"string"`
+}
+
+// String returns the string representation
+func (s ExportTransitGatewayRoutesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportTransitGatewayRoutesOutput) GoString() string {
+ return s.String()
+}
+
+// SetS3Location sets the S3Location field's value.
+func (s *ExportTransitGatewayRoutesOutput) SetS3Location(v string) *ExportTransitGatewayRoutesOutput {
+ s.S3Location = &v
+ return s
+}
+
// A filter name and value pair that is used to return a more specific list
// of results from a describe operation. Filters can be used to match a set
// of resources by specific criteria, such as tags, attributes, or IDs. The
@@ -46011,7 +63364,7 @@ type Filter struct {
// The name of the filter. Filter names are case-sensitive.
Name *string `type:"string"`
- // One or more filter values. Filter values are case-sensitive.
+ // The filter values. Filter values are case-sensitive.
Values []*string `locationName:"Value" locationNameList:"item" type:"list"`
}
@@ -46049,13 +63402,17 @@ type FleetData struct {
ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"FleetActivityStatus"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
//
// Constraints: Maximum 64 ASCII characters
ClientToken *string `locationName:"clientToken" type:"string"`
// The creation date and time of the EC2 Fleet.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
+
+ // Information about the instances that could not be launched by the fleet.
+ // Valid only when Type is set to instant.
+ Errors []*DescribeFleetError `locationName:"errorSet" locationNameList:"item" type:"list"`
// Indicates whether running instances should be terminated if the target capacity
// of the EC2 Fleet is decreased below the current size of the EC2 Fleet.
@@ -46075,9 +63432,16 @@ type FleetData struct {
// On-Demand capacity.
FulfilledOnDemandCapacity *float64 `locationName:"fulfilledOnDemandCapacity" type:"double"`
+ // Information about the instances that were launched by the fleet. Valid only
+ // when Type is set to instant.
+ Instances []*DescribeFleetsInstances `locationName:"fleetInstanceSet" locationNameList:"item" type:"list"`
+
// The launch template and overrides.
LaunchTemplateConfigs []*FleetLaunchTemplateConfig `locationName:"launchTemplateConfigs" locationNameList:"item" type:"list"`
+ // The allocation strategy of On-Demand Instances in an EC2 Fleet.
+ OnDemandOptions *OnDemandOptions `locationName:"onDemandOptions" type:"structure"`
+
// Indicates whether EC2 Fleet should replace unhealthy instances.
ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"`
@@ -46110,12 +63474,12 @@ type FleetData struct {
// The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// The default is to start fulfilling the request immediately.
- ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"`
+ ValidFrom *time.Time `locationName:"validFrom" type:"timestamp"`
// The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// At this point, no new instance requests are placed or able to fulfill the
// request. The default end date is 7 days from the current date.
- ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"`
}
// String returns the string representation
@@ -46146,6 +63510,12 @@ func (s *FleetData) SetCreateTime(v time.Time) *FleetData {
return s
}
+// SetErrors sets the Errors field's value.
+func (s *FleetData) SetErrors(v []*DescribeFleetError) *FleetData {
+ s.Errors = v
+ return s
+}
+
// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value.
func (s *FleetData) SetExcessCapacityTerminationPolicy(v string) *FleetData {
s.ExcessCapacityTerminationPolicy = &v
@@ -46176,12 +63546,24 @@ func (s *FleetData) SetFulfilledOnDemandCapacity(v float64) *FleetData {
return s
}
+// SetInstances sets the Instances field's value.
+func (s *FleetData) SetInstances(v []*DescribeFleetsInstances) *FleetData {
+ s.Instances = v
+ return s
+}
+
// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value.
func (s *FleetData) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfig) *FleetData {
s.LaunchTemplateConfigs = v
return s
}
+// SetOnDemandOptions sets the OnDemandOptions field's value.
+func (s *FleetData) SetOnDemandOptions(v *OnDemandOptions) *FleetData {
+ s.OnDemandOptions = v
+ return s
+}
+
// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value.
func (s *FleetData) SetReplaceUnhealthyInstances(v bool) *FleetData {
s.ReplaceUnhealthyInstances = &v
@@ -46327,6 +63709,17 @@ type FleetLaunchTemplateOverrides struct {
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
MaxPrice *string `locationName:"maxPrice" type:"string"`
+ // The location where the instance launched, if applicable.
+ Placement *PlacementResponse `locationName:"placement" type:"structure"`
+
+ // The priority for the launch template override. If AllocationStrategy is set
+ // to prioritized, EC2 Fleet uses priority to determine which launch template
+ // override to use first in fulfilling On-Demand capacity. The highest priority
+ // is launched first. Valid values are whole numbers starting at 0. The lower
+ // the number, the higher the priority. If no number is set, the override has
+ // the lowest priority.
+ Priority *float64 `locationName:"priority" type:"double"`
+
// The ID of the subnet in which to launch the instances.
SubnetId *string `locationName:"subnetId" type:"string"`
@@ -46362,6 +63755,18 @@ func (s *FleetLaunchTemplateOverrides) SetMaxPrice(v string) *FleetLaunchTemplat
return s
}
+// SetPlacement sets the Placement field's value.
+func (s *FleetLaunchTemplateOverrides) SetPlacement(v *PlacementResponse) *FleetLaunchTemplateOverrides {
+ s.Placement = v
+ return s
+}
+
+// SetPriority sets the Priority field's value.
+func (s *FleetLaunchTemplateOverrides) SetPriority(v float64) *FleetLaunchTemplateOverrides {
+ s.Priority = &v
+ return s
+}
+
// SetSubnetId sets the SubnetId field's value.
func (s *FleetLaunchTemplateOverrides) SetSubnetId(v string) *FleetLaunchTemplateOverrides {
s.SubnetId = &v
@@ -46387,6 +63792,17 @@ type FleetLaunchTemplateOverridesRequest struct {
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
MaxPrice *string `type:"string"`
+ // The location where the instance launched, if applicable.
+ Placement *Placement `type:"structure"`
+
+ // The priority for the launch template override. If AllocationStrategy is set
+ // to prioritized, EC2 Fleet uses priority to determine which launch template
+ // override to use first in fulfilling On-Demand capacity. The highest priority
+ // is launched first. Valid values are whole numbers starting at 0. The lower
+ // the number, the higher the priority. If no number is set, the launch template
+ // override has the lowest priority.
+ Priority *float64 `type:"double"`
+
// The ID of the subnet in which to launch the instances.
SubnetId *string `type:"string"`
@@ -46422,6 +63838,18 @@ func (s *FleetLaunchTemplateOverridesRequest) SetMaxPrice(v string) *FleetLaunch
return s
}
+// SetPlacement sets the Placement field's value.
+func (s *FleetLaunchTemplateOverridesRequest) SetPlacement(v *Placement) *FleetLaunchTemplateOverridesRequest {
+ s.Placement = v
+ return s
+}
+
+// SetPriority sets the Priority field's value.
+func (s *FleetLaunchTemplateOverridesRequest) SetPriority(v float64) *FleetLaunchTemplateOverridesRequest {
+ s.Priority = &v
+ return s
+}
+
// SetSubnetId sets the SubnetId field's value.
func (s *FleetLaunchTemplateOverridesRequest) SetSubnetId(v string) *FleetLaunchTemplateOverridesRequest {
s.SubnetId = &v
@@ -46446,8 +63874,7 @@ type FleetLaunchTemplateSpecification struct {
// or a template ID.
LaunchTemplateName *string `locationName:"launchTemplateName" min:"3" type:"string"`
- // The version number. By default, the default version of the launch template
- // is used.
+ // The version number of the launch template. You must specify a version number.
Version *string `locationName:"version" type:"string"`
}
@@ -46503,7 +63930,8 @@ type FleetLaunchTemplateSpecificationRequest struct {
// The name of the launch template.
LaunchTemplateName *string `min:"3" type:"string"`
- // The version number of the launch template.
+ // The version number of the launch template. Note: This is a required parameter
+ // and will be updated soon.
Version *string `type:"string"`
}
@@ -46553,14 +63981,14 @@ type FlowLog struct {
_ struct{} `type:"structure"`
// The date and time the flow log was created.
- CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreationTime *time.Time `locationName:"creationTime" type:"timestamp"`
// Information about the error that occurred. Rate limited indicates that CloudWatch
- // logs throttling has been applied for one or more network interfaces, or that
- // you've reached the limit on the number of CloudWatch Logs log groups that
- // you can create. Access error indicates that the IAM role associated with
- // the flow log does not have sufficient permissions to publish to CloudWatch
- // Logs. Unknown error indicates an internal error.
+ // Logs throttling has been applied for one or more network interfaces, or that
+ // you've reached the limit on the number of log groups that you can create.
+ // Access error indicates that the IAM role associated with the flow log does
+ // not have sufficient permissions to publish to CloudWatch Logs. Unknown error
+ // indicates an internal error.
DeliverLogsErrorMessage *string `locationName:"deliverLogsErrorMessage" type:"string"`
// The ARN of the IAM role that posts logs to CloudWatch Logs.
@@ -46575,6 +64003,18 @@ type FlowLog struct {
// The status of the flow log (ACTIVE).
FlowLogStatus *string `locationName:"flowLogStatus" type:"string"`
+ // Specifies the destination to which the flow log data is published. Flow log
+ // data can be published to an CloudWatch Logs log group or an Amazon S3 bucket.
+ // If the flow log publishes to CloudWatch Logs, this element indicates the
+ // Amazon Resource Name (ARN) of the CloudWatch Logs log group to which the
+ // data is published. If the flow log publishes to Amazon S3, this element indicates
+ // the ARN of the Amazon S3 bucket to which the data is published.
+ LogDestination *string `locationName:"logDestination" type:"string"`
+
+ // Specifies the type of destination to which the flow log data is published.
+ // Flow log data can be published to CloudWatch Logs or Amazon S3.
+ LogDestinationType *string `locationName:"logDestinationType" type:"string" enum:"LogDestinationType"`
+
// The name of the flow log group.
LogGroupName *string `locationName:"logGroupName" type:"string"`
@@ -46631,6 +64071,18 @@ func (s *FlowLog) SetFlowLogStatus(v string) *FlowLog {
return s
}
+// SetLogDestination sets the LogDestination field's value.
+func (s *FlowLog) SetLogDestination(v string) *FlowLog {
+ s.LogDestination = &v
+ return s
+}
+
+// SetLogDestinationType sets the LogDestinationType field's value.
+func (s *FlowLog) SetLogDestinationType(v string) *FlowLog {
+ s.LogDestinationType = &v
+ return s
+}
+
// SetLogGroupName sets the LogGroupName field's value.
func (s *FlowLog) SetLogGroupName(v string) *FlowLog {
s.LogGroupName = &v
@@ -46654,7 +64106,10 @@ type FpgaImage struct {
_ struct{} `type:"structure"`
// The date and time the AFI was created.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
+
+ // Indicates whether data retention support is enabled for the AFI.
+ DataRetentionSupport *bool `locationName:"dataRetentionSupport" type:"boolean"`
// The description of the AFI.
Description *string `locationName:"description" type:"string"`
@@ -46693,7 +64148,7 @@ type FpgaImage struct {
Tags []*Tag `locationName:"tags" locationNameList:"item" type:"list"`
// The time of the most recent update to the AFI.
- UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"`
+ UpdateTime *time.Time `locationName:"updateTime" type:"timestamp"`
}
// String returns the string representation
@@ -46712,6 +64167,12 @@ func (s *FpgaImage) SetCreateTime(v time.Time) *FpgaImage {
return s
}
+// SetDataRetentionSupport sets the DataRetentionSupport field's value.
+func (s *FpgaImage) SetDataRetentionSupport(v bool) *FpgaImage {
+ s.DataRetentionSupport = &v
+ return s
+}
+
// SetDescription sets the Description field's value.
func (s *FpgaImage) SetDescription(v string) *FpgaImage {
s.Description = &v
@@ -46800,13 +64261,13 @@ type FpgaImageAttribute struct {
// The ID of the AFI.
FpgaImageId *string `locationName:"fpgaImageId" type:"string"`
- // One or more load permissions.
+ // The load permissions.
LoadPermissions []*LoadPermission `locationName:"loadPermissions" locationNameList:"item" type:"list"`
// The name of the AFI.
Name *string `locationName:"name" type:"string"`
- // One or more product codes.
+ // The product codes.
ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"`
}
@@ -46892,7 +64353,139 @@ func (s *FpgaImageState) SetMessage(v string) *FpgaImageState {
return s
}
-// Contains the parameters for GetConsoleOutput.
+type GetCapacityReservationUsageInput struct {
+ _ struct{} `type:"structure"`
+
+ // CapacityReservationId is a required field
+ CapacityReservationId *string `type:"string" required:"true"`
+
+ DryRun *bool `type:"boolean"`
+
+ MaxResults *int64 `min:"1" type:"integer"`
+
+ NextToken *string `type:"string"`
+}
+
+// String returns the string representation
+func (s GetCapacityReservationUsageInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetCapacityReservationUsageInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetCapacityReservationUsageInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetCapacityReservationUsageInput"}
+ if s.CapacityReservationId == nil {
+ invalidParams.Add(request.NewErrParamRequired("CapacityReservationId"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 1 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *GetCapacityReservationUsageInput) SetCapacityReservationId(v string) *GetCapacityReservationUsageInput {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetCapacityReservationUsageInput) SetDryRun(v bool) *GetCapacityReservationUsageInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *GetCapacityReservationUsageInput) SetMaxResults(v int64) *GetCapacityReservationUsageInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetCapacityReservationUsageInput) SetNextToken(v string) *GetCapacityReservationUsageInput {
+ s.NextToken = &v
+ return s
+}
+
+type GetCapacityReservationUsageOutput struct {
+ _ struct{} `type:"structure"`
+
+ AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"`
+
+ CapacityReservationId *string `locationName:"capacityReservationId" type:"string"`
+
+ InstanceType *string `locationName:"instanceType" type:"string"`
+
+ InstanceUsages []*InstanceUsage `locationName:"instanceUsageSet" locationNameList:"item" type:"list"`
+
+ NextToken *string `locationName:"nextToken" type:"string"`
+
+ State *string `locationName:"state" type:"string" enum:"CapacityReservationState"`
+
+ TotalInstanceCount *int64 `locationName:"totalInstanceCount" type:"integer"`
+}
+
+// String returns the string representation
+func (s GetCapacityReservationUsageOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetCapacityReservationUsageOutput) GoString() string {
+ return s.String()
+}
+
+// SetAvailableInstanceCount sets the AvailableInstanceCount field's value.
+func (s *GetCapacityReservationUsageOutput) SetAvailableInstanceCount(v int64) *GetCapacityReservationUsageOutput {
+ s.AvailableInstanceCount = &v
+ return s
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *GetCapacityReservationUsageOutput) SetCapacityReservationId(v string) *GetCapacityReservationUsageOutput {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *GetCapacityReservationUsageOutput) SetInstanceType(v string) *GetCapacityReservationUsageOutput {
+ s.InstanceType = &v
+ return s
+}
+
+// SetInstanceUsages sets the InstanceUsages field's value.
+func (s *GetCapacityReservationUsageOutput) SetInstanceUsages(v []*InstanceUsage) *GetCapacityReservationUsageOutput {
+ s.InstanceUsages = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetCapacityReservationUsageOutput) SetNextToken(v string) *GetCapacityReservationUsageOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *GetCapacityReservationUsageOutput) SetState(v string) *GetCapacityReservationUsageOutput {
+ s.State = &v
+ return s
+}
+
+// SetTotalInstanceCount sets the TotalInstanceCount field's value.
+func (s *GetCapacityReservationUsageOutput) SetTotalInstanceCount(v int64) *GetCapacityReservationUsageOutput {
+ s.TotalInstanceCount = &v
+ return s
+}
+
type GetConsoleOutputInput struct {
_ struct{} `type:"structure"`
@@ -46954,7 +64547,6 @@ func (s *GetConsoleOutputInput) SetLatest(v bool) *GetConsoleOutputInput {
return s
}
-// Contains the output of GetConsoleOutput.
type GetConsoleOutputOutput struct {
_ struct{} `type:"structure"`
@@ -46966,7 +64558,7 @@ type GetConsoleOutputOutput struct {
Output *string `locationName:"output" type:"string"`
// The time at which the output was last updated.
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -46997,7 +64589,6 @@ func (s *GetConsoleOutputOutput) SetTimestamp(v time.Time) *GetConsoleOutputOutp
return s
}
-// Contains the parameters for the request.
type GetConsoleScreenshotInput struct {
_ struct{} `type:"structure"`
@@ -47058,7 +64649,6 @@ func (s *GetConsoleScreenshotInput) SetWakeUp(v bool) *GetConsoleScreenshotInput
return s
}
-// Contains the output of the request.
type GetConsoleScreenshotOutput struct {
_ struct{} `type:"structure"`
@@ -47091,11 +64681,108 @@ func (s *GetConsoleScreenshotOutput) SetInstanceId(v string) *GetConsoleScreensh
return s
}
+type GetEbsDefaultKmsKeyIdInput 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
+func (s GetEbsDefaultKmsKeyIdInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetEbsDefaultKmsKeyIdInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetEbsDefaultKmsKeyIdInput) SetDryRun(v bool) *GetEbsDefaultKmsKeyIdInput {
+ s.DryRun = &v
+ return s
+}
+
+type GetEbsDefaultKmsKeyIdOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the default CMK for encryption by default.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+}
+
+// String returns the string representation
+func (s GetEbsDefaultKmsKeyIdOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetEbsDefaultKmsKeyIdOutput) GoString() string {
+ return s.String()
+}
+
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *GetEbsDefaultKmsKeyIdOutput) SetKmsKeyId(v string) *GetEbsDefaultKmsKeyIdOutput {
+ s.KmsKeyId = &v
+ return s
+}
+
+type GetEbsEncryptionByDefaultInput 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
+func (s GetEbsEncryptionByDefaultInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetEbsEncryptionByDefaultInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetEbsEncryptionByDefaultInput) SetDryRun(v bool) *GetEbsEncryptionByDefaultInput {
+ s.DryRun = &v
+ return s
+}
+
+type GetEbsEncryptionByDefaultOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether encryption by default is enabled.
+ EbsEncryptionByDefault *bool `locationName:"ebsEncryptionByDefault" type:"boolean"`
+}
+
+// String returns the string representation
+func (s GetEbsEncryptionByDefaultOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetEbsEncryptionByDefaultOutput) GoString() string {
+ return s.String()
+}
+
+// SetEbsEncryptionByDefault sets the EbsEncryptionByDefault field's value.
+func (s *GetEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) *GetEbsEncryptionByDefaultOutput {
+ s.EbsEncryptionByDefault = &v
+ return s
+}
+
type GetHostReservationPurchasePreviewInput struct {
_ struct{} `type:"structure"`
- // The ID/s of the Dedicated Host/s that the reservation will be associated
- // with.
+ // The IDs of the Dedicated Hosts with which the reservation is associated.
//
// HostIdSet is a required field
HostIdSet []*string `locationNameList:"item" type:"list" required:"true"`
@@ -47151,7 +64838,7 @@ type GetHostReservationPurchasePreviewOutput struct {
// are specified. At this time, the only supported currency is USD.
CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCodeValues"`
- // The purchase information of the Dedicated Host Reservation and the Dedicated
+ // The purchase information of the Dedicated Host reservation and the Dedicated
// Hosts associated with it.
Purchase []*Purchase `locationName:"purchase" locationNameList:"item" type:"list"`
@@ -47269,7 +64956,6 @@ func (s *GetLaunchTemplateDataOutput) SetLaunchTemplateData(v *ResponseLaunchTem
return s
}
-// Contains the parameters for GetPasswordData.
type GetPasswordDataInput struct {
_ struct{} `type:"structure"`
@@ -47320,7 +65006,6 @@ func (s *GetPasswordDataInput) SetInstanceId(v string) *GetPasswordDataInput {
return s
}
-// Contains the output of GetPasswordData.
type GetPasswordDataOutput struct {
_ struct{} `type:"structure"`
@@ -47332,7 +65017,7 @@ type GetPasswordDataOutput struct {
PasswordData *string `locationName:"passwordData" type:"string"`
// The time the data was last updated.
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -47445,7 +65130,7 @@ type GetReservedInstancesExchangeQuoteOutput struct {
IsValidExchange *bool `locationName:"isValidExchange" type:"boolean"`
// The new end date of the reservation term.
- OutputReservedInstancesWillExpireAt *time.Time `locationName:"outputReservedInstancesWillExpireAt" type:"timestamp" timestampFormat:"iso8601"`
+ OutputReservedInstancesWillExpireAt *time.Time `locationName:"outputReservedInstancesWillExpireAt" type:"timestamp"`
// The total true upfront charge for the exchange.
PaymentDue *string `locationName:"paymentDue" type:"string"`
@@ -47530,6 +65215,363 @@ func (s *GetReservedInstancesExchangeQuoteOutput) SetValidationFailureReason(v s
return s
}
+type GetTransitGatewayAttachmentPropagationsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * transit-gateway-route-table-id - The ID of the transit gateway route
+ // table.
+ 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"`
+
+ // The ID of the attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetTransitGatewayAttachmentPropagationsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayAttachmentPropagationsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetTransitGatewayAttachmentPropagationsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetTransitGatewayAttachmentPropagationsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetTransitGatewayAttachmentPropagationsInput) SetDryRun(v bool) *GetTransitGatewayAttachmentPropagationsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *GetTransitGatewayAttachmentPropagationsInput) SetFilters(v []*Filter) *GetTransitGatewayAttachmentPropagationsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *GetTransitGatewayAttachmentPropagationsInput) SetMaxResults(v int64) *GetTransitGatewayAttachmentPropagationsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayAttachmentPropagationsInput) SetNextToken(v string) *GetTransitGatewayAttachmentPropagationsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *GetTransitGatewayAttachmentPropagationsInput) SetTransitGatewayAttachmentId(v string) *GetTransitGatewayAttachmentPropagationsInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+type GetTransitGatewayAttachmentPropagationsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the propagation route tables.
+ TransitGatewayAttachmentPropagations []*TransitGatewayAttachmentPropagation `locationName:"transitGatewayAttachmentPropagations" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s GetTransitGatewayAttachmentPropagationsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayAttachmentPropagationsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayAttachmentPropagationsOutput) SetNextToken(v string) *GetTransitGatewayAttachmentPropagationsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentPropagations sets the TransitGatewayAttachmentPropagations field's value.
+func (s *GetTransitGatewayAttachmentPropagationsOutput) SetTransitGatewayAttachmentPropagations(v []*TransitGatewayAttachmentPropagation) *GetTransitGatewayAttachmentPropagationsOutput {
+ s.TransitGatewayAttachmentPropagations = v
+ return s
+}
+
+type GetTransitGatewayRouteTableAssociationsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * resource-id - The ID of the resource.
+ //
+ // * resource-type - The resource type (vpc | vpn).
+ //
+ // * transit-gateway-attachment-id - The ID of the attachment.
+ 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"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetTransitGatewayRouteTableAssociationsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayRouteTableAssociationsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetTransitGatewayRouteTableAssociationsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetTransitGatewayRouteTableAssociationsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetTransitGatewayRouteTableAssociationsInput) SetDryRun(v bool) *GetTransitGatewayRouteTableAssociationsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *GetTransitGatewayRouteTableAssociationsInput) SetFilters(v []*Filter) *GetTransitGatewayRouteTableAssociationsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *GetTransitGatewayRouteTableAssociationsInput) SetMaxResults(v int64) *GetTransitGatewayRouteTableAssociationsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayRouteTableAssociationsInput) SetNextToken(v string) *GetTransitGatewayRouteTableAssociationsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *GetTransitGatewayRouteTableAssociationsInput) SetTransitGatewayRouteTableId(v string) *GetTransitGatewayRouteTableAssociationsInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type GetTransitGatewayRouteTableAssociationsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the associations.
+ Associations []*TransitGatewayRouteTableAssociation `locationName:"associations" 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
+func (s GetTransitGatewayRouteTableAssociationsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayRouteTableAssociationsOutput) GoString() string {
+ return s.String()
+}
+
+// SetAssociations sets the Associations field's value.
+func (s *GetTransitGatewayRouteTableAssociationsOutput) SetAssociations(v []*TransitGatewayRouteTableAssociation) *GetTransitGatewayRouteTableAssociationsOutput {
+ s.Associations = v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayRouteTableAssociationsOutput) SetNextToken(v string) *GetTransitGatewayRouteTableAssociationsOutput {
+ s.NextToken = &v
+ return s
+}
+
+type GetTransitGatewayRouteTablePropagationsInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * resource-id - The ID of the resource.
+ //
+ // * resource-type - The resource type (vpc | vpn).
+ //
+ // * transit-gateway-attachment-id - The ID of the attachment.
+ 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"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetTransitGatewayRouteTablePropagationsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayRouteTablePropagationsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetTransitGatewayRouteTablePropagationsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetTransitGatewayRouteTablePropagationsInput"}
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *GetTransitGatewayRouteTablePropagationsInput) SetDryRun(v bool) *GetTransitGatewayRouteTablePropagationsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *GetTransitGatewayRouteTablePropagationsInput) SetFilters(v []*Filter) *GetTransitGatewayRouteTablePropagationsInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *GetTransitGatewayRouteTablePropagationsInput) SetMaxResults(v int64) *GetTransitGatewayRouteTablePropagationsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayRouteTablePropagationsInput) SetNextToken(v string) *GetTransitGatewayRouteTablePropagationsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *GetTransitGatewayRouteTablePropagationsInput) SetTransitGatewayRouteTableId(v string) *GetTransitGatewayRouteTablePropagationsInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type GetTransitGatewayRouteTablePropagationsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // 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"`
+
+ // Information about the route table propagations.
+ TransitGatewayRouteTablePropagations []*TransitGatewayRouteTablePropagation `locationName:"transitGatewayRouteTablePropagations" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s GetTransitGatewayRouteTablePropagationsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetTransitGatewayRouteTablePropagationsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *GetTransitGatewayRouteTablePropagationsOutput) SetNextToken(v string) *GetTransitGatewayRouteTablePropagationsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetTransitGatewayRouteTablePropagations sets the TransitGatewayRouteTablePropagations field's value.
+func (s *GetTransitGatewayRouteTablePropagationsOutput) SetTransitGatewayRouteTablePropagations(v []*TransitGatewayRouteTablePropagation) *GetTransitGatewayRouteTablePropagationsOutput {
+ s.TransitGatewayRouteTablePropagations = v
+ return s
+}
+
// Describes a security group.
type GroupIdentifier struct {
_ struct{} `type:"structure"`
@@ -47563,14 +65605,71 @@ func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier {
return s
}
+// 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/Hibernate.html#hibernating-prerequisites).
+// Hibernation is currently supported only for Amazon Linux. 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.
+type HibernationOptions struct {
+ _ struct{} `type:"structure"`
+
+ // If this parameter is set to true, your instance is enabled for hibernation;
+ // otherwise, it is not enabled for hibernation.
+ Configured *bool `locationName:"configured" type:"boolean"`
+}
+
+// String returns the string representation
+func (s HibernationOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s HibernationOptions) GoString() string {
+ return s.String()
+}
+
+// SetConfigured sets the Configured field's value.
+func (s *HibernationOptions) SetConfigured(v bool) *HibernationOptions {
+ s.Configured = &v
+ return s
+}
+
+// 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/Hibernate.html#hibernating-prerequisites).
+// Hibernation is currently supported only for Amazon Linux. 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.
+type HibernationOptionsRequest struct {
+ _ struct{} `type:"structure"`
+
+ // If you set this parameter to true, your instance is enabled for hibernation.
+ //
+ // Default: false
+ Configured *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s HibernationOptionsRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s HibernationOptionsRequest) GoString() string {
+ return s.String()
+}
+
+// SetConfigured sets the Configured field's value.
+func (s *HibernationOptionsRequest) SetConfigured(v bool) *HibernationOptionsRequest {
+ s.Configured = &v
+ return s
+}
+
// Describes an event in the history of the Spot Fleet request.
type HistoryRecord struct {
_ struct{} `type:"structure"`
// Information about the event.
- //
- // EventInformation is a required field
- EventInformation *EventInformation `locationName:"eventInformation" type:"structure" required:"true"`
+ EventInformation *EventInformation `locationName:"eventInformation" type:"structure"`
// The event type.
//
@@ -47582,14 +65681,10 @@ type HistoryRecord struct {
// * instanceChange - An instance was launched or terminated.
//
// * Information - An informational event.
- //
- // EventType is a required field
- EventType *string `locationName:"eventType" type:"string" required:"true" enum:"EventType"`
+ EventType *string `locationName:"eventType" type:"string" enum:"EventType"`
// The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- //
- // Timestamp is a required field
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -47620,7 +65715,7 @@ func (s *HistoryRecord) SetTimestamp(v time.Time) *HistoryRecord {
return s
}
-// Describes an event in the history of the EC2 Fleet.
+// Describes an event in the history of an EC2 Fleet.
type HistoryRecordEntry struct {
_ struct{} `type:"structure"`
@@ -47631,7 +65726,7 @@ type HistoryRecordEntry struct {
EventType *string `locationName:"eventType" type:"string" enum:"FleetEventType"`
// The date and time of the event, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -47667,7 +65762,7 @@ type Host struct {
_ struct{} `type:"structure"`
// The time that the Dedicated Host was allocated.
- AllocationTime *time.Time `locationName:"allocationTime" type:"timestamp" timestampFormat:"iso8601"`
+ AllocationTime *time.Time `locationName:"allocationTime" type:"timestamp"`
// Whether auto-placement is on or off.
AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"`
@@ -47678,9 +65773,8 @@ type Host struct {
// The number of new instances that can be launched onto the Dedicated Host.
AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure idempotency of the
- // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // 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).
ClientToken *string `locationName:"clientToken" type:"string"`
// The ID of the Dedicated Host.
@@ -47689,6 +65783,10 @@ type Host struct {
// The hardware specifications of the Dedicated Host.
HostProperties *HostProperties `locationName:"hostProperties" type:"structure"`
+ // Indicates whether host recovery is enabled or disabled for the Dedicated
+ // Host.
+ HostRecovery *string `locationName:"hostRecovery" type:"string" enum:"HostRecovery"`
+
// The reservation ID of the Dedicated Host. This returns a null response if
// the Dedicated Host doesn't have an associated reservation.
HostReservationId *string `locationName:"hostReservationId" type:"string"`
@@ -47697,10 +65795,13 @@ type Host struct {
Instances []*HostInstance `locationName:"instances" locationNameList:"item" type:"list"`
// The time that the Dedicated Host was released.
- ReleaseTime *time.Time `locationName:"releaseTime" type:"timestamp" timestampFormat:"iso8601"`
+ ReleaseTime *time.Time `locationName:"releaseTime" type:"timestamp"`
// The Dedicated Host's state.
State *string `locationName:"state" type:"string" enum:"AllocationState"`
+
+ // Any tags assigned to the Dedicated Host.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
}
// String returns the string representation
@@ -47755,6 +65856,12 @@ func (s *Host) SetHostProperties(v *HostProperties) *Host {
return s
}
+// SetHostRecovery sets the HostRecovery field's value.
+func (s *Host) SetHostRecovery(v string) *Host {
+ s.HostRecovery = &v
+ return s
+}
+
// SetHostReservationId sets the HostReservationId field's value.
func (s *Host) SetHostReservationId(v string) *Host {
s.HostReservationId = &v
@@ -47779,6 +65886,12 @@ func (s *Host) SetState(v string) *Host {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Host) SetTags(v []*Tag) *Host {
+ s.Tags = v
+ return s
+}
+
// Describes an instance running on a Dedicated Host.
type HostInstance struct {
_ struct{} `type:"structure"`
@@ -47957,7 +66070,7 @@ type HostReservation struct {
Duration *int64 `locationName:"duration" type:"integer"`
// The date and time that the reservation ends.
- End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"`
+ End *time.Time `locationName:"end" type:"timestamp"`
// The IDs of the Dedicated Hosts associated with the reservation.
HostIdSet []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"`
@@ -47981,11 +66094,14 @@ type HostReservation struct {
PaymentOption *string `locationName:"paymentOption" type:"string" enum:"PaymentOption"`
// The date and time that the reservation started.
- Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"`
+ Start *time.Time `locationName:"start" type:"timestamp"`
// The state of the reservation.
State *string `locationName:"state" type:"string" enum:"ReservationState"`
+ // Any tags assigned to the Dedicated Host Reservation.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
// The upfront price of the reservation.
UpfrontPrice *string `locationName:"upfrontPrice" type:"string"`
}
@@ -48072,6 +66188,12 @@ func (s *HostReservation) SetState(v string) *HostReservation {
return s
}
+// SetTags sets the Tags field's value.
+func (s *HostReservation) SetTags(v []*Tag) *HostReservation {
+ s.Tags = v
+ return s
+}
+
// SetUpfrontPrice sets the UpfrontPrice field's value.
func (s *HostReservation) SetUpfrontPrice(v string) *HostReservation {
s.UpfrontPrice = &v
@@ -48128,7 +66250,7 @@ type IamInstanceProfileAssociation struct {
State *string `locationName:"state" type:"string" enum:"IamInstanceProfileAssociationState"`
// The time the IAM instance profile was associated with the instance.
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -48244,7 +66366,7 @@ type IdFormat struct {
// The date in UTC at which you are permanently switched over to using longer
// IDs. If a deadline is not yet available for this resource type, this field
// is not returned.
- Deadline *time.Time `locationName:"deadline" type:"timestamp" timestampFormat:"iso8601"`
+ Deadline *time.Time `locationName:"deadline" type:"timestamp"`
// The type of resource.
Resource *string `locationName:"resource" type:"string"`
@@ -48326,7 +66448,7 @@ type Image struct {
// The AWS account ID of the image owner.
OwnerId *string `locationName:"imageOwnerId" type:"string"`
- // The value is Windows for Windows AMIs; otherwise blank.
+ // This value is set to windows for Windows AMIs; otherwise, it is blank.
Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"`
// Any product codes associated with the AMI.
@@ -48592,13 +66714,102 @@ func (s *ImageDiskContainer) SetUserBucket(v *UserBucket) *ImageDiskContainer {
return s
}
-// Contains the parameters for ImportImage.
+type ImportClientVpnClientCertificateRevocationListInput struct {
+ _ struct{} `type:"structure"`
+
+ // The client certificate revocation list file. For more information, see Generate
+ // a Client Certificate Revocation List (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-certificates.html#cvpn-working-certificates-generate)
+ // in the AWS Client VPN Administrator Guide.
+ //
+ // CertificateRevocationList is a required field
+ CertificateRevocationList *string `type:"string" required:"true"`
+
+ // The ID of the Client VPN endpoint to which the client certificate revocation
+ // list applies.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ImportClientVpnClientCertificateRevocationListInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ImportClientVpnClientCertificateRevocationListInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ImportClientVpnClientCertificateRevocationListInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ImportClientVpnClientCertificateRevocationListInput"}
+ if s.CertificateRevocationList == nil {
+ invalidParams.Add(request.NewErrParamRequired("CertificateRevocationList"))
+ }
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCertificateRevocationList sets the CertificateRevocationList field's value.
+func (s *ImportClientVpnClientCertificateRevocationListInput) SetCertificateRevocationList(v string) *ImportClientVpnClientCertificateRevocationListInput {
+ s.CertificateRevocationList = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ImportClientVpnClientCertificateRevocationListInput) SetClientVpnEndpointId(v string) *ImportClientVpnClientCertificateRevocationListInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ImportClientVpnClientCertificateRevocationListInput) SetDryRun(v bool) *ImportClientVpnClientCertificateRevocationListInput {
+ s.DryRun = &v
+ return s
+}
+
+type ImportClientVpnClientCertificateRevocationListOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation
+func (s ImportClientVpnClientCertificateRevocationListOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ImportClientVpnClientCertificateRevocationListOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *ImportClientVpnClientCertificateRevocationListOutput) SetReturn(v bool) *ImportClientVpnClientCertificateRevocationListOutput {
+ s.Return = &v
+ return s
+}
+
type ImportImageInput struct {
_ struct{} `type:"structure"`
// The architecture of the virtual machine.
//
- // Valid values: i386 | x86_64
+ // Valid values: i386 | x86_64 | arm64
Architecture *string `type:"string"`
// The client-specific data.
@@ -48619,19 +66830,58 @@ type ImportImageInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
+ // Specifies whether the destination AMI of the imported image should be encrypted.
+ // The default CMK for EBS is used unless you specify a non-default AWS Key
+ // Management Service (AWS KMS) CMK using KmsKeyId. 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.
+ Encrypted *bool `type:"boolean"`
+
// The target hypervisor platform.
//
// Valid values: xen
Hypervisor *string `type:"string"`
+ // An identifier for the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) to use when creating the encrypted AMI. This parameter is only
+ // required if you want to use a non-default CMK; if this parameter is not specified,
+ // the default CMK for EBS is used. If a KmsKeyId is specified, the Encrypted
+ // flag must also be set.
+ //
+ // The CMK identifier may be provided in any of the following formats:
+ //
+ // * Key ID
+ //
+ // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed
+ // by the Region of the CMK, the AWS account ID of the CMK owner, the alias
+ // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ //
+ // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed
+ // by the Region of the CMK, the AWS account ID of the CMK owner, the key
+ // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
+ //
+ // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace,
+ // followed by the Region of the CMK, the AWS account ID of the CMK owner,
+ // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ //
+ // AWS parses KmsKeyId asynchronously, meaning that the action you call may
+ // appear to complete even though you provided an invalid identifier. This action
+ // will eventually report failure.
+ //
+ // The specified CMK must exist in the Region that the AMI is being copied to.
+ KmsKeyId *string `type:"string"`
+
// The license type to be used for the Amazon Machine Image (AMI) after importing.
//
- // Note: You may only use BYOL if you have existing licenses with rights to
- // use these licenses in a third party cloud like AWS. For more information,
- // see Prerequisites (http://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#prerequisites-image)
- // in the VM Import/Export User Guide.
+ // By default, we detect the source-system operating system (OS) and apply the
+ // appropriate license. Specify AWS to replace the source-system license with
+ // an AWS license, if appropriate. Specify BYOL to retain the source-system
+ // license, if appropriate.
//
- // Valid values: AWS | BYOL
+ // To use BYOL, you must have existing licenses with rights to use these licenses
+ // in a third party cloud, such as AWS. For more information, see Prerequisites
+ // (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html#prerequisites-image)
+ // in the VM Import/Export User Guide.
LicenseType *string `type:"string"`
// The operating system of the virtual machine.
@@ -48689,12 +66939,24 @@ func (s *ImportImageInput) SetDryRun(v bool) *ImportImageInput {
return s
}
+// SetEncrypted sets the Encrypted field's value.
+func (s *ImportImageInput) SetEncrypted(v bool) *ImportImageInput {
+ s.Encrypted = &v
+ return s
+}
+
// SetHypervisor sets the Hypervisor field's value.
func (s *ImportImageInput) SetHypervisor(v string) *ImportImageInput {
s.Hypervisor = &v
return s
}
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ImportImageInput) SetKmsKeyId(v string) *ImportImageInput {
+ s.KmsKeyId = &v
+ return s
+}
+
// SetLicenseType sets the LicenseType field's value.
func (s *ImportImageInput) SetLicenseType(v string) *ImportImageInput {
s.LicenseType = &v
@@ -48713,7 +66975,6 @@ func (s *ImportImageInput) SetRoleName(v string) *ImportImageInput {
return s
}
-// Contains the output for ImportImage.
type ImportImageOutput struct {
_ struct{} `type:"structure"`
@@ -48723,6 +66984,9 @@ type ImportImageOutput struct {
// A description of the import task.
Description *string `locationName:"description" type:"string"`
+ // Indicates whether the AMI is encypted.
+ Encrypted *bool `locationName:"encrypted" type:"boolean"`
+
// The target hypervisor of the import task.
Hypervisor *string `locationName:"hypervisor" type:"string"`
@@ -48732,6 +66996,10 @@ type ImportImageOutput struct {
// The task ID of the import image task.
ImportTaskId *string `locationName:"importTaskId" type:"string"`
+ // The identifier for the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) that was used to create the encrypted AMI.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+
// The license type of the virtual machine.
LicenseType *string `locationName:"licenseType" type:"string"`
@@ -48773,6 +67041,12 @@ func (s *ImportImageOutput) SetDescription(v string) *ImportImageOutput {
return s
}
+// SetEncrypted sets the Encrypted field's value.
+func (s *ImportImageOutput) SetEncrypted(v bool) *ImportImageOutput {
+ s.Encrypted = &v
+ return s
+}
+
// SetHypervisor sets the Hypervisor field's value.
func (s *ImportImageOutput) SetHypervisor(v string) *ImportImageOutput {
s.Hypervisor = &v
@@ -48791,6 +67065,12 @@ func (s *ImportImageOutput) SetImportTaskId(v string) *ImportImageOutput {
return s
}
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ImportImageOutput) SetKmsKeyId(v string) *ImportImageOutput {
+ s.KmsKeyId = &v
+ return s
+}
+
// SetLicenseType sets the LicenseType field's value.
func (s *ImportImageOutput) SetLicenseType(v string) *ImportImageOutput {
s.LicenseType = &v
@@ -48833,12 +67113,15 @@ type ImportImageTask struct {
// The architecture of the virtual machine.
//
- // Valid values: i386 | x86_64
+ // Valid values: i386 | x86_64 | arm64
Architecture *string `locationName:"architecture" type:"string"`
// A description of the import task.
Description *string `locationName:"description" type:"string"`
+ // Indicates whether the image is encrypted.
+ Encrypted *bool `locationName:"encrypted" type:"boolean"`
+
// The target hypervisor for the import task.
//
// Valid values: xen
@@ -48850,6 +67133,10 @@ type ImportImageTask struct {
// The ID of the import image task.
ImportTaskId *string `locationName:"importTaskId" type:"string"`
+ // The identifier for the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) that was used to create the encrypted image.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+
// The license type of the virtual machine.
LicenseType *string `locationName:"licenseType" type:"string"`
@@ -48891,6 +67178,12 @@ func (s *ImportImageTask) SetDescription(v string) *ImportImageTask {
return s
}
+// SetEncrypted sets the Encrypted field's value.
+func (s *ImportImageTask) SetEncrypted(v bool) *ImportImageTask {
+ s.Encrypted = &v
+ return s
+}
+
// SetHypervisor sets the Hypervisor field's value.
func (s *ImportImageTask) SetHypervisor(v string) *ImportImageTask {
s.Hypervisor = &v
@@ -48909,6 +67202,12 @@ func (s *ImportImageTask) SetImportTaskId(v string) *ImportImageTask {
return s
}
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ImportImageTask) SetKmsKeyId(v string) *ImportImageTask {
+ s.KmsKeyId = &v
+ return s
+}
+
// SetLicenseType sets the LicenseType field's value.
func (s *ImportImageTask) SetLicenseType(v string) *ImportImageTask {
s.LicenseType = &v
@@ -48945,7 +67244,6 @@ func (s *ImportImageTask) SetStatusMessage(v string) *ImportImageTask {
return s
}
-// Contains the parameters for ImportInstance.
type ImportInstanceInput struct {
_ struct{} `type:"structure"`
@@ -49043,10 +67341,10 @@ type ImportInstanceLaunchSpecification struct {
// The architecture of the instance.
Architecture *string `locationName:"architecture" type:"string" enum:"ArchitectureValues"`
- // One or more security group IDs.
+ // The security group IDs.
GroupIds []*string `locationName:"GroupId" locationNameList:"SecurityGroupId" type:"list"`
- // One or more security group names.
+ // The security group names.
GroupNames []*string `locationName:"GroupName" locationNameList:"SecurityGroup" type:"list"`
// Indicates whether an instance stops or terminates when you initiate shutdown
@@ -49054,7 +67352,7 @@ type ImportInstanceLaunchSpecification struct {
InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"`
// The instance type. For more information about the instance types that you
- // can import, see Instance Types (http://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-instance-types)
+ // can import, see Instance Types (https://docs.aws.amazon.com/vm-import/latest/userguide/vmie_prereqs.html#vmimport-instance-types)
// in the VM Import/Export User Guide.
InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
@@ -49150,7 +67448,6 @@ func (s *ImportInstanceLaunchSpecification) SetUserData(v *UserData) *ImportInst
return s
}
-// Contains the output for ImportInstance.
type ImportInstanceOutput struct {
_ struct{} `type:"structure"`
@@ -49187,7 +67484,7 @@ type ImportInstanceTaskDetails struct {
// The instance operating system.
Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"`
- // One or more volumes.
+ // The volumes.
Volumes []*ImportInstanceVolumeDetailItem `locationName:"volumes" locationNameList:"item" type:"list"`
}
@@ -49230,35 +67527,25 @@ type ImportInstanceVolumeDetailItem struct {
_ struct{} `type:"structure"`
// The Availability Zone where the resulting instance will reside.
- //
- // AvailabilityZone is a required field
- AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"`
+ AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
// The number of bytes converted so far.
- //
- // BytesConverted is a required field
- BytesConverted *int64 `locationName:"bytesConverted" type:"long" required:"true"`
+ BytesConverted *int64 `locationName:"bytesConverted" type:"long"`
// A description of the task.
Description *string `locationName:"description" type:"string"`
// The image.
- //
- // Image is a required field
- Image *DiskImageDescription `locationName:"image" type:"structure" required:"true"`
+ Image *DiskImageDescription `locationName:"image" type:"structure"`
// The status of the import of this particular disk image.
- //
- // Status is a required field
- Status *string `locationName:"status" type:"string" required:"true"`
+ Status *string `locationName:"status" type:"string"`
// The status information or errors related to the disk image.
StatusMessage *string `locationName:"statusMessage" type:"string"`
// The volume.
- //
- // Volume is a required field
- Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure" required:"true"`
+ Volume *DiskImageVolumeDescription `locationName:"volume" type:"structure"`
}
// String returns the string representation
@@ -49313,7 +67600,6 @@ func (s *ImportInstanceVolumeDetailItem) SetVolume(v *DiskImageVolumeDescription
return s
}
-// Contains the parameters for ImportKeyPair.
type ImportKeyPairInput struct {
_ struct{} `type:"structure"`
@@ -49381,7 +67667,6 @@ func (s *ImportKeyPairInput) SetPublicKeyMaterial(v []byte) *ImportKeyPairInput
return s
}
-// Contains the output of ImportKeyPair.
type ImportKeyPairOutput struct {
_ struct{} `type:"structure"`
@@ -49414,7 +67699,6 @@ func (s *ImportKeyPairOutput) SetKeyName(v string) *ImportKeyPairOutput {
return s
}
-// Contains the parameters for ImportSnapshot.
type ImportSnapshotInput struct {
_ struct{} `type:"structure"`
@@ -49436,6 +67720,43 @@ type ImportSnapshotInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
+ // Specifies whether the destination snapshot of the imported image should be
+ // encrypted. The default CMK for EBS is used unless you specify a non-default
+ // AWS Key Management Service (AWS KMS) CMK using KmsKeyId. 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.
+ Encrypted *bool `type:"boolean"`
+
+ // An identifier for the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) to use when creating the encrypted snapshot. This parameter is
+ // only required if you want to use a non-default CMK; if this parameter is
+ // not specified, the default CMK for EBS is used. If a KmsKeyId is specified,
+ // the Encrypted flag must also be set.
+ //
+ // The CMK identifier may be provided in any of the following formats:
+ //
+ // * Key ID
+ //
+ // * Key alias. The alias ARN contains the arn:aws:kms namespace, followed
+ // by the Region of the CMK, the AWS account ID of the CMK owner, the alias
+ // namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ //
+ // * ARN using key ID. The ID ARN contains the arn:aws:kms namespace, followed
+ // by the Region of the CMK, the AWS account ID of the CMK owner, the key
+ // namespace, and then the CMK ID. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
+ //
+ // * ARN using key alias. The alias ARN contains the arn:aws:kms namespace,
+ // followed by the Region of the CMK, the AWS account ID of the CMK owner,
+ // the alias namespace, and then the CMK alias. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ //
+ // AWS parses KmsKeyId asynchronously, meaning that the action you call may
+ // appear to complete even though you provided an invalid identifier. This action
+ // will eventually report failure.
+ //
+ // The specified CMK must exist in the Region that the snapshot is being copied
+ // to.
+ KmsKeyId *string `type:"string"`
+
// The name of the role to use when not using the default role, 'vmimport'.
RoleName *string `type:"string"`
}
@@ -49480,13 +67801,24 @@ func (s *ImportSnapshotInput) SetDryRun(v bool) *ImportSnapshotInput {
return s
}
+// SetEncrypted sets the Encrypted field's value.
+func (s *ImportSnapshotInput) SetEncrypted(v bool) *ImportSnapshotInput {
+ s.Encrypted = &v
+ return s
+}
+
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ImportSnapshotInput) SetKmsKeyId(v string) *ImportSnapshotInput {
+ s.KmsKeyId = &v
+ return s
+}
+
// SetRoleName sets the RoleName field's value.
func (s *ImportSnapshotInput) SetRoleName(v string) *ImportSnapshotInput {
s.RoleName = &v
return s
}
-// Contains the output for ImportSnapshot.
type ImportSnapshotOutput struct {
_ struct{} `type:"structure"`
@@ -49570,7 +67902,6 @@ func (s *ImportSnapshotTask) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *Impor
return s
}
-// Contains the parameters for ImportVolume.
type ImportVolumeInput struct {
_ struct{} `type:"structure"`
@@ -49668,7 +67999,6 @@ func (s *ImportVolumeInput) SetVolume(v *VolumeDetail) *ImportVolumeInput {
return s
}
-// Contains the output for ImportVolume.
type ImportVolumeOutput struct {
_ struct{} `type:"structure"`
@@ -49766,6 +68096,12 @@ type Instance struct {
// Any block device mapping entries for the instance.
BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
+ // The ID of the Capacity Reservation.
+ CapacityReservationId *string `locationName:"capacityReservationId" type:"string"`
+
+ // Information about the Capacity Reservation targeting option.
+ CapacityReservationSpecification *CapacityReservationSpecificationResponse `locationName:"capacityReservationSpecification" type:"structure"`
+
// The idempotency token you provided when you launched the instance, if applicable.
ClientToken *string `locationName:"clientToken" type:"string"`
@@ -49782,9 +68118,15 @@ type Instance struct {
// The Elastic GPU associated with the instance.
ElasticGpuAssociations []*ElasticGpuAssociation `locationName:"elasticGpuAssociationSet" locationNameList:"item" type:"list"`
+ // The elastic inference accelerator associated with the instance.
+ ElasticInferenceAcceleratorAssociations []*ElasticInferenceAcceleratorAssociation `locationName:"elasticInferenceAcceleratorAssociationSet" locationNameList:"item" type:"list"`
+
// Specifies whether enhanced networking with ENA is enabled.
EnaSupport *bool `locationName:"enaSupport" type:"boolean"`
+ // Indicates whether the instance is enabled for hibernation.
+ HibernationOptions *HibernationOptions `locationName:"hibernationOptions" type:"structure"`
+
// The hypervisor type of the instance.
Hypervisor *string `locationName:"hypervisor" type:"string" enum:"HypervisorType"`
@@ -49811,12 +68153,15 @@ type Instance struct {
KeyName *string `locationName:"keyName" type:"string"`
// The time the instance was launched.
- LaunchTime *time.Time `locationName:"launchTime" type:"timestamp" timestampFormat:"iso8601"`
+ LaunchTime *time.Time `locationName:"launchTime" type:"timestamp"`
+
+ // The license configurations.
+ Licenses []*LicenseConfiguration `locationName:"licenseSet" locationNameList:"item" type:"list"`
// The monitoring for the instance.
Monitoring *Monitoring `locationName:"monitoring" type:"structure"`
- // [EC2-VPC] One or more network interfaces for the instance.
+ // [EC2-VPC] The network interfaces for the instance.
NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"`
// The location where the instance launched, if applicable.
@@ -49859,14 +68204,14 @@ type Instance struct {
// instance store volume.
RootDeviceType *string `locationName:"rootDeviceType" type:"string" enum:"DeviceType"`
- // One or more security groups for the instance.
+ // The security groups for the instance.
SecurityGroups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"`
// Specifies whether to enable an instance launched in a VPC to perform NAT.
// This controls whether source/destination checking is enabled on the instance.
// A value of true means that checking is enabled, and false means that checking
// is disabled. The value must be false for the instance to perform NAT. For
- // more information, see NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
+ // more information, see NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
// in the Amazon Virtual Private Cloud User Guide.
SourceDestCheck *bool `locationName:"sourceDestCheck" type:"boolean"`
@@ -49927,6 +68272,18 @@ func (s *Instance) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *Inst
return s
}
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *Instance) SetCapacityReservationId(v string) *Instance {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetCapacityReservationSpecification sets the CapacityReservationSpecification field's value.
+func (s *Instance) SetCapacityReservationSpecification(v *CapacityReservationSpecificationResponse) *Instance {
+ s.CapacityReservationSpecification = v
+ return s
+}
+
// SetClientToken sets the ClientToken field's value.
func (s *Instance) SetClientToken(v string) *Instance {
s.ClientToken = &v
@@ -49951,12 +68308,24 @@ func (s *Instance) SetElasticGpuAssociations(v []*ElasticGpuAssociation) *Instan
return s
}
+// SetElasticInferenceAcceleratorAssociations sets the ElasticInferenceAcceleratorAssociations field's value.
+func (s *Instance) SetElasticInferenceAcceleratorAssociations(v []*ElasticInferenceAcceleratorAssociation) *Instance {
+ s.ElasticInferenceAcceleratorAssociations = v
+ return s
+}
+
// SetEnaSupport sets the EnaSupport field's value.
func (s *Instance) SetEnaSupport(v bool) *Instance {
s.EnaSupport = &v
return s
}
+// SetHibernationOptions sets the HibernationOptions field's value.
+func (s *Instance) SetHibernationOptions(v *HibernationOptions) *Instance {
+ s.HibernationOptions = v
+ return s
+}
+
// SetHypervisor sets the Hypervisor field's value.
func (s *Instance) SetHypervisor(v string) *Instance {
s.Hypervisor = &v
@@ -50011,6 +68380,12 @@ func (s *Instance) SetLaunchTime(v time.Time) *Instance {
return s
}
+// SetLicenses sets the Licenses field's value.
+func (s *Instance) SetLicenses(v []*LicenseConfiguration) *Instance {
+ s.Licenses = v
+ return s
+}
+
// SetMonitoring sets the Monitoring field's value.
func (s *Instance) SetMonitoring(v *Monitoring) *Instance {
s.Monitoring = v
@@ -50310,7 +68685,7 @@ func (s *InstanceCount) SetState(v string) *InstanceCount {
return s
}
-// Describes the credit option for CPU usage of a T2 instance.
+// Describes the credit option for CPU usage of a T2 or T3 instance.
type InstanceCreditSpecification struct {
_ struct{} `type:"structure"`
@@ -50344,7 +68719,7 @@ func (s *InstanceCreditSpecification) SetInstanceId(v string) *InstanceCreditSpe
return s
}
-// Describes the credit option for CPU usage of a T2 instance.
+// Describes the credit option for CPU usage of a T2 or T3 instance.
type InstanceCreditSpecificationRequest struct {
_ struct{} `type:"structure"`
@@ -50542,6 +68917,11 @@ type InstanceNetworkInterface struct {
// One or more security groups.
Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"`
+ // Describes the type of network interface.
+ //
+ // Valid values: interface | efa
+ InterfaceType *string `locationName:"interfaceType" type:"string"`
+
// One or more IPv6 addresses associated with the network interface.
Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" locationNameList:"item" type:"list"`
@@ -50610,6 +68990,12 @@ func (s *InstanceNetworkInterface) SetGroups(v []*GroupIdentifier) *InstanceNetw
return s
}
+// SetInterfaceType sets the InterfaceType field's value.
+func (s *InstanceNetworkInterface) SetInterfaceType(v string) *InstanceNetworkInterface {
+ s.InterfaceType = &v
+ return s
+}
+
// SetIpv6Addresses sets the Ipv6Addresses field's value.
func (s *InstanceNetworkInterface) SetIpv6Addresses(v []*InstanceIpv6Address) *InstanceNetworkInterface {
s.Ipv6Addresses = v
@@ -50723,7 +69109,7 @@ type InstanceNetworkInterfaceAttachment struct {
_ struct{} `type:"structure"`
// The time stamp when the attachment initiated.
- AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"`
+ AttachTime *time.Time `locationName:"attachTime" type:"timestamp"`
// The ID of the network interface attachment.
AttachmentId *string `locationName:"attachmentId" type:"string"`
@@ -50798,15 +69184,26 @@ type InstanceNetworkInterfaceSpecification struct {
// interface when launching an instance.
Description *string `locationName:"description" type:"string"`
- // The index of the device on the instance for the network interface attachment.
- // If you are specifying a network interface in a RunInstances request, you
- // must provide the device index.
+ // The position of the network interface in the attachment order. A primary
+ // network interface has a device index of 0.
+ //
+ // If you specify a network interface when launching an instance, you must specify
+ // the device index.
DeviceIndex *int64 `locationName:"deviceIndex" type:"integer"`
// The IDs of the security groups for the network interface. Applies only if
// creating a network interface when launching an instance.
Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
+ // 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.
+ //
+ // If you are not creating an EFA, specify interface or omit this parameter.
+ //
+ // Valid values: interface | efa
+ InterfaceType *string `type:"string"`
+
// A number of IPv6 addresses to assign to the network interface. Amazon EC2
// chooses the IPv6 addresses from the range of the subnet. You cannot specify
// this option and the option to assign specific IPv6 addresses in the same
@@ -50825,19 +69222,22 @@ type InstanceNetworkInterfaceSpecification struct {
// The private IPv4 address of the network interface. Applies only if creating
// a network interface when launching an instance. You cannot specify this option
- // if you're launching more than one instance in a RunInstances request.
+ // if you're launching more than one instance in a RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html)
+ // request.
PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
// One or more private IPv4 addresses to assign to the network interface. Only
// one private IPv4 address can be designated as primary. You cannot specify
// this option if you're launching more than one instance in a RunInstances
+ // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html)
// request.
PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddressesSet" queryName:"PrivateIpAddresses" locationNameList:"item" type:"list"`
// The number of secondary private IPv4 addresses. You can't specify this option
// and specify more than one private IP address using the private IP addresses
// option. You cannot specify this option if you're launching more than one
- // instance in a RunInstances request.
+ // instance in a RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html)
+ // request.
SecondaryPrivateIpAddressCount *int64 `locationName:"secondaryPrivateIpAddressCount" type:"integer"`
// The ID of the subnet associated with the network string. Applies only if
@@ -50855,26 +69255,6 @@ func (s InstanceNetworkInterfaceSpecification) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *InstanceNetworkInterfaceSpecification) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "InstanceNetworkInterfaceSpecification"}
- if s.PrivateIpAddresses != nil {
- for i, v := range s.PrivateIpAddresses {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams))
- }
- }
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value.
func (s *InstanceNetworkInterfaceSpecification) SetAssociatePublicIpAddress(v bool) *InstanceNetworkInterfaceSpecification {
s.AssociatePublicIpAddress = &v
@@ -50905,6 +69285,12 @@ func (s *InstanceNetworkInterfaceSpecification) SetGroups(v []*string) *Instance
return s
}
+// SetInterfaceType sets the InterfaceType field's value.
+func (s *InstanceNetworkInterfaceSpecification) SetInterfaceType(v string) *InstanceNetworkInterfaceSpecification {
+ s.InterfaceType = &v
+ return s
+}
+
// SetIpv6AddressCount sets the Ipv6AddressCount field's value.
func (s *InstanceNetworkInterfaceSpecification) SetIpv6AddressCount(v int64) *InstanceNetworkInterfaceSpecification {
s.Ipv6AddressCount = &v
@@ -50999,12 +69385,54 @@ func (s *InstancePrivateIpAddress) SetPrivateIpAddress(v string) *InstancePrivat
return s
}
+// The instance details to specify which volumes should be snapshotted.
+type InstanceSpecification struct {
+ _ struct{} `type:"structure"`
+
+ // Excludes the root volume from being snapshotted.
+ ExcludeBootVolume *bool `type:"boolean"`
+
+ // The instance to specify which volumes should be snapshotted.
+ InstanceId *string `type:"string"`
+}
+
+// String returns the string representation
+func (s InstanceSpecification) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s InstanceSpecification) GoString() string {
+ return s.String()
+}
+
+// SetExcludeBootVolume sets the ExcludeBootVolume field's value.
+func (s *InstanceSpecification) SetExcludeBootVolume(v bool) *InstanceSpecification {
+ s.ExcludeBootVolume = &v
+ return s
+}
+
+// SetInstanceId sets the InstanceId field's value.
+func (s *InstanceSpecification) SetInstanceId(v string) *InstanceSpecification {
+ s.InstanceId = &v
+ return s
+}
+
// Describes the current state of an instance.
type InstanceState struct {
_ struct{} `type:"structure"`
- // The low byte represents the state. The high byte is an opaque internal value
- // and should be ignored.
+ // The state of the instance as a 16-bit unsigned integer.
+ //
+ // The high byte is all of the bits between 2^8 and (2^16)-1, which equals decimal
+ // values between 256 and 65,535. These numerical values are used for internal
+ // purposes and should be ignored.
+ //
+ // The low byte is all of the bits between 2^0 and (2^8)-1, which equals decimal
+ // values between 0 and 255.
+ //
+ // The valid values for instance-state-code will all be in the range of the
+ // low byte and they are:
//
// * 0 : pending
//
@@ -51017,6 +69445,9 @@ type InstanceState struct {
// * 64 : stopping
//
// * 80 : stopped
+ //
+ // You can ignore the high byte value by zeroing out all of the bits above 2^8
+ // or 256 in decimal.
Code *int64 `locationName:"code" type:"integer"`
// The current state of the instance.
@@ -51166,7 +69597,7 @@ type InstanceStatusDetails struct {
// The time when a status check failed. For an instance that was launched and
// impaired, this is the time when the instance was launched.
- ImpairedSince *time.Time `locationName:"impairedSince" type:"timestamp" timestampFormat:"iso8601"`
+ ImpairedSince *time.Time `locationName:"impairedSince" type:"timestamp"`
// The type of instance status.
Name *string `locationName:"name" type:"string" enum:"StatusName"`
@@ -51217,11 +69648,17 @@ type InstanceStatusEvent struct {
// following text: [Completed].
Description *string `locationName:"description" type:"string"`
+ // The ID of the event.
+ InstanceEventId *string `locationName:"instanceEventId" type:"string"`
+
// The latest scheduled end time for the event.
- NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"`
+ NotAfter *time.Time `locationName:"notAfter" type:"timestamp"`
// The earliest scheduled start time for the event.
- NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"`
+ NotBefore *time.Time `locationName:"notBefore" type:"timestamp"`
+
+ // The deadline for starting the event.
+ NotBeforeDeadline *time.Time `locationName:"notBeforeDeadline" type:"timestamp"`
}
// String returns the string representation
@@ -51246,6 +69683,12 @@ func (s *InstanceStatusEvent) SetDescription(v string) *InstanceStatusEvent {
return s
}
+// SetInstanceEventId sets the InstanceEventId field's value.
+func (s *InstanceStatusEvent) SetInstanceEventId(v string) *InstanceStatusEvent {
+ s.InstanceEventId = &v
+ return s
+}
+
// SetNotAfter sets the NotAfter field's value.
func (s *InstanceStatusEvent) SetNotAfter(v time.Time) *InstanceStatusEvent {
s.NotAfter = &v
@@ -51258,6 +69701,12 @@ func (s *InstanceStatusEvent) SetNotBefore(v time.Time) *InstanceStatusEvent {
return s
}
+// SetNotBeforeDeadline sets the NotBeforeDeadline field's value.
+func (s *InstanceStatusEvent) SetNotBeforeDeadline(v time.Time) *InstanceStatusEvent {
+ s.NotBeforeDeadline = &v
+ return s
+}
+
// Describes the status of an instance.
type InstanceStatusSummary struct {
_ struct{} `type:"structure"`
@@ -51291,17 +69740,50 @@ func (s *InstanceStatusSummary) SetStatus(v string) *InstanceStatusSummary {
return s
}
-// Describes an Internet gateway.
+type InstanceUsage struct {
+ _ struct{} `type:"structure"`
+
+ AccountId *string `locationName:"accountId" type:"string"`
+
+ UsedInstanceCount *int64 `locationName:"usedInstanceCount" type:"integer"`
+}
+
+// String returns the string representation
+func (s InstanceUsage) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s InstanceUsage) GoString() string {
+ return s.String()
+}
+
+// SetAccountId sets the AccountId field's value.
+func (s *InstanceUsage) SetAccountId(v string) *InstanceUsage {
+ s.AccountId = &v
+ return s
+}
+
+// SetUsedInstanceCount sets the UsedInstanceCount field's value.
+func (s *InstanceUsage) SetUsedInstanceCount(v int64) *InstanceUsage {
+ s.UsedInstanceCount = &v
+ return s
+}
+
+// Describes an internet gateway.
type InternetGateway struct {
_ struct{} `type:"structure"`
- // Any VPCs attached to the Internet gateway.
+ // Any VPCs attached to the internet gateway.
Attachments []*InternetGatewayAttachment `locationName:"attachmentSet" locationNameList:"item" type:"list"`
- // The ID of the Internet gateway.
+ // The ID of the internet gateway.
InternetGatewayId *string `locationName:"internetGatewayId" type:"string"`
- // Any tags assigned to the Internet gateway.
+ // The ID of the AWS account that owns the internet gateway.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // Any tags assigned to the internet gateway.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
}
@@ -51327,18 +69809,24 @@ func (s *InternetGateway) SetInternetGatewayId(v string) *InternetGateway {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *InternetGateway) SetOwnerId(v string) *InternetGateway {
+ s.OwnerId = &v
+ return s
+}
+
// SetTags sets the Tags field's value.
func (s *InternetGateway) SetTags(v []*Tag) *InternetGateway {
s.Tags = v
return s
}
-// Describes the attachment of a VPC to an Internet gateway or an egress-only
-// Internet gateway.
+// Describes the attachment of a VPC to an internet gateway or an egress-only
+// internet gateway.
type InternetGatewayAttachment struct {
_ struct{} `type:"structure"`
- // The current state of the attachment. For an Internet gateway, the state is
+ // The current state of the attachment. For an internet gateway, the state is
// available when attached to a VPC; otherwise, this value is not returned.
State *string `locationName:"state" type:"string" enum:"AttachmentStatus"`
@@ -51377,35 +69865,34 @@ type IpPermission struct {
// all ICMP/ICMPv6 types, you must specify all codes.
FromPort *int64 `locationName:"fromPort" type:"integer"`
- // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)).
+ // The IP protocol name (tcp, udp, icmp, icmpv6) or number (see Protocol Numbers
+ // (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)).
//
- // [EC2-VPC only] Use -1 to specify all protocols. When authorizing security
- // group rules, specifying -1 or a protocol number other than tcp, udp, icmp,
- // or 58 (ICMPv6) allows traffic on all ports, regardless of any port range
- // you specify. For tcp, udp, and icmp, you must specify a port range. For 58
- // (ICMPv6), you can optionally specify a port range; if you don't, traffic
- // for all types and codes is allowed when authorizing rules.
+ // [VPC only] Use -1 to specify all protocols. When authorizing security group
+ // rules, specifying -1 or a protocol number other than tcp, udp, icmp, or icmpv6
+ // allows traffic on all ports, regardless of any port range you specify. For
+ // tcp, udp, and icmp, you must specify a port range. For icmpv6, the port range
+ // is optional; if you omit the port range, traffic for all types and codes
+ // is allowed.
IpProtocol *string `locationName:"ipProtocol" type:"string"`
- // One or more IPv4 ranges.
+ // The IPv4 ranges.
IpRanges []*IpRange `locationName:"ipRanges" locationNameList:"item" type:"list"`
- // [EC2-VPC only] One or more IPv6 ranges.
+ // [VPC only] The IPv6 ranges.
Ipv6Ranges []*Ipv6Range `locationName:"ipv6Ranges" locationNameList:"item" type:"list"`
- // (EC2-VPC only; valid for AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress
- // and DescribeSecurityGroups only) One or more prefix list IDs for an AWS service.
- // In an AuthorizeSecurityGroupEgress request, this is the AWS service that
- // you want to access through a VPC endpoint from instances associated with
- // the security group.
+ // [VPC only] The prefix list IDs for an AWS service. With outbound rules, this
+ // is the AWS service to access through a VPC endpoint from instances associated
+ // with the security group.
PrefixListIds []*PrefixListId `locationName:"prefixListIds" locationNameList:"item" type:"list"`
// The end of port range for the TCP and UDP protocols, or an ICMP/ICMPv6 code.
- // A value of -1 indicates all ICMP/ICMPv6 codes for the specified ICMP type.
- // If you specify all ICMP/ICMPv6 types, you must specify all codes.
+ // A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6
+ // types, you must specify all codes.
ToPort *int64 `locationName:"toPort" type:"integer"`
- // One or more security group and AWS account ID pairs.
+ // The security group and AWS account ID pairs.
UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"`
}
@@ -51828,7 +70315,7 @@ type LaunchTemplate struct {
_ struct{} `type:"structure"`
// The time launch template was created.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The principal that created the launch template.
CreatedBy *string `locationName:"createdBy" type:"string"`
@@ -51901,6 +70388,40 @@ func (s *LaunchTemplate) SetTags(v []*Tag) *LaunchTemplate {
return s
}
+// Describes a launch template and overrides.
+type LaunchTemplateAndOverridesResponse struct {
+ _ struct{} `type:"structure"`
+
+ // The launch template.
+ LaunchTemplateSpecification *FleetLaunchTemplateSpecification `locationName:"launchTemplateSpecification" type:"structure"`
+
+ // Any parameters that you specify override the same parameters in the launch
+ // template.
+ Overrides *FleetLaunchTemplateOverrides `locationName:"overrides" type:"structure"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateAndOverridesResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateAndOverridesResponse) GoString() string {
+ return s.String()
+}
+
+// SetLaunchTemplateSpecification sets the LaunchTemplateSpecification field's value.
+func (s *LaunchTemplateAndOverridesResponse) SetLaunchTemplateSpecification(v *FleetLaunchTemplateSpecification) *LaunchTemplateAndOverridesResponse {
+ s.LaunchTemplateSpecification = v
+ return s
+}
+
+// SetOverrides sets the Overrides field's value.
+func (s *LaunchTemplateAndOverridesResponse) SetOverrides(v *FleetLaunchTemplateOverrides) *LaunchTemplateAndOverridesResponse {
+ s.Overrides = v
+ return s
+}
+
// Describes a block device mapping.
type LaunchTemplateBlockDeviceMapping struct {
_ struct{} `type:"structure"`
@@ -52010,6 +70531,91 @@ func (s *LaunchTemplateBlockDeviceMappingRequest) SetVirtualName(v string) *Laun
return s
}
+// Describes an instance's Capacity Reservation targeting option. You can specify
+// only one option at a time. Use the CapacityReservationPreference parameter
+// to configure the instance to run in On-Demand capacity or to run in any open
+// Capacity Reservation that has matching attributes (instance type, platform,
+// Availability Zone). Use the CapacityReservationTarget parameter to explicitly
+// target a specific Capacity Reservation.
+type LaunchTemplateCapacityReservationSpecificationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates the instance's Capacity Reservation preferences. Possible preferences
+ // include:
+ //
+ // * open - The instance can run in any open Capacity Reservation that has
+ // matching attributes (instance type, platform, Availability Zone).
+ //
+ // * none - The instance avoids running in a Capacity Reservation even if
+ // one is available. The instance runs in On-Demand capacity.
+ CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"`
+
+ // Information about the target Capacity Reservation.
+ CapacityReservationTarget *CapacityReservationTarget `type:"structure"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateCapacityReservationSpecificationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateCapacityReservationSpecificationRequest) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationPreference sets the CapacityReservationPreference field's value.
+func (s *LaunchTemplateCapacityReservationSpecificationRequest) SetCapacityReservationPreference(v string) *LaunchTemplateCapacityReservationSpecificationRequest {
+ s.CapacityReservationPreference = &v
+ return s
+}
+
+// SetCapacityReservationTarget sets the CapacityReservationTarget field's value.
+func (s *LaunchTemplateCapacityReservationSpecificationRequest) SetCapacityReservationTarget(v *CapacityReservationTarget) *LaunchTemplateCapacityReservationSpecificationRequest {
+ s.CapacityReservationTarget = v
+ return s
+}
+
+// Information about the Capacity Reservation targeting option.
+type LaunchTemplateCapacityReservationSpecificationResponse struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates the instance's Capacity Reservation preferences. Possible preferences
+ // include:
+ //
+ // * open - The instance can run in any open Capacity Reservation that has
+ // matching attributes (instance type, platform, Availability Zone).
+ //
+ // * none - The instance avoids running in a Capacity Reservation even if
+ // one is available. The instance runs in On-Demand capacity.
+ CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"`
+
+ // Information about the target Capacity Reservation.
+ CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" type:"structure"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateCapacityReservationSpecificationResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateCapacityReservationSpecificationResponse) GoString() string {
+ return s.String()
+}
+
+// SetCapacityReservationPreference sets the CapacityReservationPreference field's value.
+func (s *LaunchTemplateCapacityReservationSpecificationResponse) SetCapacityReservationPreference(v string) *LaunchTemplateCapacityReservationSpecificationResponse {
+ s.CapacityReservationPreference = &v
+ return s
+}
+
+// SetCapacityReservationTarget sets the CapacityReservationTarget field's value.
+func (s *LaunchTemplateCapacityReservationSpecificationResponse) SetCapacityReservationTarget(v *CapacityReservationTargetResponse) *LaunchTemplateCapacityReservationSpecificationResponse {
+ s.CapacityReservationTarget = v
+ return s
+}
+
// Describes a launch template and overrides.
type LaunchTemplateConfig struct {
_ struct{} `type:"structure"`
@@ -52059,6 +70665,75 @@ func (s *LaunchTemplateConfig) SetOverrides(v []*LaunchTemplateOverrides) *Launc
return s
}
+// The CPU options for the instance.
+type LaunchTemplateCpuOptions struct {
+ _ struct{} `type:"structure"`
+
+ // The number of CPU cores for the instance.
+ CoreCount *int64 `locationName:"coreCount" type:"integer"`
+
+ // The number of threads per CPU core.
+ ThreadsPerCore *int64 `locationName:"threadsPerCore" type:"integer"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateCpuOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateCpuOptions) GoString() string {
+ return s.String()
+}
+
+// SetCoreCount sets the CoreCount field's value.
+func (s *LaunchTemplateCpuOptions) SetCoreCount(v int64) *LaunchTemplateCpuOptions {
+ s.CoreCount = &v
+ return s
+}
+
+// SetThreadsPerCore sets the ThreadsPerCore field's value.
+func (s *LaunchTemplateCpuOptions) SetThreadsPerCore(v int64) *LaunchTemplateCpuOptions {
+ s.ThreadsPerCore = &v
+ return s
+}
+
+// The CPU options for the instance. Both the core count and threads per core
+// must be specified in the request.
+type LaunchTemplateCpuOptionsRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The number of CPU cores for the instance.
+ CoreCount *int64 `type:"integer"`
+
+ // The number of threads per CPU core. To disable Intel Hyper-Threading Technology
+ // for the instance, specify a value of 1. Otherwise, specify the default value
+ // of 2.
+ ThreadsPerCore *int64 `type:"integer"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateCpuOptionsRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateCpuOptionsRequest) GoString() string {
+ return s.String()
+}
+
+// SetCoreCount sets the CoreCount field's value.
+func (s *LaunchTemplateCpuOptionsRequest) SetCoreCount(v int64) *LaunchTemplateCpuOptionsRequest {
+ s.CoreCount = &v
+ return s
+}
+
+// SetThreadsPerCore sets the ThreadsPerCore field's value.
+func (s *LaunchTemplateCpuOptionsRequest) SetThreadsPerCore(v int64) *LaunchTemplateCpuOptionsRequest {
+ s.ThreadsPerCore = &v
+ return s
+}
+
// Describes a block device for an EBS volume.
type LaunchTemplateEbsBlockDevice struct {
_ struct{} `type:"structure"`
@@ -52154,8 +70829,8 @@ type LaunchTemplateEbsBlockDeviceRequest struct {
// volume. For gp2, this represents the baseline performance of the volume and
// the rate at which the volume accumulates I/O credits for bursting. For more
// information about General Purpose SSD baseline performance, I/O credits,
- // and bursting, see Amazon EBS Volume Types in the Amazon Elastic Compute Cloud
- // User Guide.
+ // and bursting, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
+ // in the Amazon Elastic Compute Cloud User Guide.
//
// Condition: This parameter is required for requests to create io1 volumes;
// it is not used in requests to create gp2, st1, sc1, or standard volumes.
@@ -52229,6 +70904,124 @@ func (s *LaunchTemplateEbsBlockDeviceRequest) SetVolumeType(v string) *LaunchTem
return s
}
+// Describes an elastic inference accelerator.
+type LaunchTemplateElasticInferenceAccelerator struct {
+ _ struct{} `type:"structure"`
+
+ // The type of elastic inference accelerator. The possible values are eia1.medium,
+ // eia1.large, and eia1.xlarge.
+ //
+ // Type is a required field
+ Type *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateElasticInferenceAccelerator) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateElasticInferenceAccelerator) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *LaunchTemplateElasticInferenceAccelerator) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateElasticInferenceAccelerator"}
+ if s.Type == nil {
+ invalidParams.Add(request.NewErrParamRequired("Type"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetType sets the Type field's value.
+func (s *LaunchTemplateElasticInferenceAccelerator) SetType(v string) *LaunchTemplateElasticInferenceAccelerator {
+ s.Type = &v
+ return s
+}
+
+// Describes an elastic inference accelerator.
+type LaunchTemplateElasticInferenceAcceleratorResponse struct {
+ _ struct{} `type:"structure"`
+
+ // The type of elastic inference accelerator. The possible values are eia1.medium,
+ // eia1.large, and eia1.xlarge.
+ Type *string `locationName:"type" type:"string"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateElasticInferenceAcceleratorResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateElasticInferenceAcceleratorResponse) GoString() string {
+ return s.String()
+}
+
+// SetType sets the Type field's value.
+func (s *LaunchTemplateElasticInferenceAcceleratorResponse) SetType(v string) *LaunchTemplateElasticInferenceAcceleratorResponse {
+ s.Type = &v
+ return s
+}
+
+// Indicates whether an instance is configured for hibernation.
+type LaunchTemplateHibernationOptions struct {
+ _ struct{} `type:"structure"`
+
+ // If this parameter is set to true, the instance is enabled for hibernation;
+ // otherwise, it is not enabled for hibernation.
+ Configured *bool `locationName:"configured" type:"boolean"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateHibernationOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateHibernationOptions) GoString() string {
+ return s.String()
+}
+
+// SetConfigured sets the Configured field's value.
+func (s *LaunchTemplateHibernationOptions) SetConfigured(v bool) *LaunchTemplateHibernationOptions {
+ s.Configured = &v
+ return s
+}
+
+// Indicates whether the 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/Hibernate.html#hibernating-prerequisites).
+// Hibernation is currently supported only for Amazon Linux.
+type LaunchTemplateHibernationOptionsRequest struct {
+ _ struct{} `type:"structure"`
+
+ // If you set this parameter to true, the instance is enabled for hibernation.
+ //
+ // Default: false
+ Configured *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateHibernationOptionsRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateHibernationOptionsRequest) GoString() string {
+ return s.String()
+}
+
+// SetConfigured sets the Configured field's value.
+func (s *LaunchTemplateHibernationOptionsRequest) SetConfigured(v bool) *LaunchTemplateHibernationOptionsRequest {
+ s.Configured = &v
+ return s
+}
+
// Describes an IAM instance profile.
type LaunchTemplateIamInstanceProfileSpecification struct {
_ struct{} `type:"structure"`
@@ -52381,6 +71174,9 @@ type LaunchTemplateInstanceNetworkInterfaceSpecification struct {
// The IDs of one or more security groups.
Groups []*string `locationName:"groupSet" locationNameList:"groupId" type:"list"`
+ // The type of network interface.
+ InterfaceType *string `locationName:"interfaceType" type:"string"`
+
// The number of IPv6 addresses for the network interface.
Ipv6AddressCount *int64 `locationName:"ipv6AddressCount" type:"integer"`
@@ -52443,6 +71239,12 @@ func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetGroups(v []*str
return s
}
+// SetInterfaceType sets the InterfaceType field's value.
+func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetInterfaceType(v string) *LaunchTemplateInstanceNetworkInterfaceSpecification {
+ s.InterfaceType = &v
+ return s
+}
+
// SetIpv6AddressCount sets the Ipv6AddressCount field's value.
func (s *LaunchTemplateInstanceNetworkInterfaceSpecification) SetIpv6AddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecification {
s.Ipv6AddressCount = &v
@@ -52504,6 +71306,15 @@ type LaunchTemplateInstanceNetworkInterfaceSpecificationRequest struct {
// The IDs of one or more security groups.
Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
+ // 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.
+ //
+ // If you are not creating an EFA, specify interface or omit this parameter.
+ //
+ // Valid values: interface | efa
+ InterfaceType *string `type:"string"`
+
// The number of IPv6 addresses to assign to a network interface. Amazon EC2
// automatically selects the IPv6 addresses from the subnet range. You can't
// use this option if specifying specific IPv6 addresses.
@@ -52539,26 +71350,6 @@ func (s LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) GoString() s
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateInstanceNetworkInterfaceSpecificationRequest"}
- if s.PrivateIpAddresses != nil {
- for i, v := range s.PrivateIpAddresses {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PrivateIpAddresses", i), err.(request.ErrInvalidParams))
- }
- }
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetAssociatePublicIpAddress sets the AssociatePublicIpAddress field's value.
func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetAssociatePublicIpAddress(v bool) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest {
s.AssociatePublicIpAddress = &v
@@ -52589,6 +71380,12 @@ func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetGroups(v
return s
}
+// SetInterfaceType sets the InterfaceType field's value.
+func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetInterfaceType(v string) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest {
+ s.InterfaceType = &v
+ return s
+}
+
// SetIpv6AddressCount sets the Ipv6AddressCount field's value.
func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetIpv6AddressCount(v int64) *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest {
s.Ipv6AddressCount = &v
@@ -52631,6 +71428,54 @@ func (s *LaunchTemplateInstanceNetworkInterfaceSpecificationRequest) SetSubnetId
return s
}
+// Describes a license configuration.
+type LaunchTemplateLicenseConfiguration struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the license configuration.
+ LicenseConfigurationArn *string `locationName:"licenseConfigurationArn" type:"string"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateLicenseConfiguration) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateLicenseConfiguration) GoString() string {
+ return s.String()
+}
+
+// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value.
+func (s *LaunchTemplateLicenseConfiguration) SetLicenseConfigurationArn(v string) *LaunchTemplateLicenseConfiguration {
+ s.LicenseConfigurationArn = &v
+ return s
+}
+
+// Describes a license configuration.
+type LaunchTemplateLicenseConfigurationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the license configuration.
+ LicenseConfigurationArn *string `type:"string"`
+}
+
+// String returns the string representation
+func (s LaunchTemplateLicenseConfigurationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LaunchTemplateLicenseConfigurationRequest) GoString() string {
+ return s.String()
+}
+
+// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value.
+func (s *LaunchTemplateLicenseConfigurationRequest) SetLicenseConfigurationArn(v string) *LaunchTemplateLicenseConfigurationRequest {
+ s.LicenseConfigurationArn = &v
+ return s
+}
+
// Describes overrides for a launch template.
type LaunchTemplateOverrides struct {
_ struct{} `type:"structure"`
@@ -52641,6 +71486,14 @@ type LaunchTemplateOverrides struct {
// The instance type.
InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"`
+ // The priority for the launch template override. If OnDemandAllocationStrategy
+ // is set to prioritized, Spot Fleet uses priority to determine which launch
+ // template override to use first in fulfilling On-Demand capacity. The highest
+ // priority is launched first. Valid values are whole numbers starting at 0.
+ // The lower the number, the higher the priority. If no number is set, the launch
+ // template override has the lowest priority.
+ Priority *float64 `locationName:"priority" type:"double"`
+
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
SpotPrice *string `locationName:"spotPrice" type:"string"`
@@ -52673,6 +71526,12 @@ func (s *LaunchTemplateOverrides) SetInstanceType(v string) *LaunchTemplateOverr
return s
}
+// SetPriority sets the Priority field's value.
+func (s *LaunchTemplateOverrides) SetPriority(v float64) *LaunchTemplateOverrides {
+ s.Priority = &v
+ return s
+}
+
// SetSpotPrice sets the SpotPrice field's value.
func (s *LaunchTemplateOverrides) SetSpotPrice(v string) *LaunchTemplateOverrides {
s.SpotPrice = &v
@@ -52761,7 +71620,7 @@ func (s *LaunchTemplatePlacement) SetTenancy(v string) *LaunchTemplatePlacement
return s
}
-// The placement for the instance.
+// Describes the placement of an instance.
type LaunchTemplatePlacementRequest struct {
_ struct{} `type:"structure"`
@@ -52898,7 +71757,7 @@ type LaunchTemplateSpotMarketOptions struct {
// active until all instances launch, the request is canceled, or this date
// is reached. If the request is persistent, it remains active until it is canceled
// or this date and time is reached.
- ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"`
}
// String returns the string representation
@@ -52964,7 +71823,7 @@ type LaunchTemplateSpotMarketOptionsRequest struct {
// is reached. If the request is persistent, it remains active until it is canceled
// or this date and time is reached. The default end date is 7 days from the
// current date.
- ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -53045,7 +71904,8 @@ type LaunchTemplateTagSpecificationRequest struct {
_ struct{} `type:"structure"`
// The type of resource to tag. Currently, the resource types that support tagging
- // on creation are instance and volume.
+ // on creation are instance and 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"`
// The tags to apply to the resource.
@@ -53079,7 +71939,7 @@ type LaunchTemplateVersion struct {
_ struct{} `type:"structure"`
// The time the version was created.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The principal that created the version.
CreatedBy *string `locationName:"createdBy" type:"string"`
@@ -53211,6 +72071,54 @@ func (s *LaunchTemplatesMonitoringRequest) SetEnabled(v bool) *LaunchTemplatesMo
return s
}
+// Describes a license configuration.
+type LicenseConfiguration struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the license configuration.
+ LicenseConfigurationArn *string `locationName:"licenseConfigurationArn" type:"string"`
+}
+
+// String returns the string representation
+func (s LicenseConfiguration) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LicenseConfiguration) GoString() string {
+ return s.String()
+}
+
+// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value.
+func (s *LicenseConfiguration) SetLicenseConfigurationArn(v string) *LicenseConfiguration {
+ s.LicenseConfigurationArn = &v
+ return s
+}
+
+// Describes a license configuration.
+type LicenseConfigurationRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the license configuration.
+ LicenseConfigurationArn *string `type:"string"`
+}
+
+// String returns the string representation
+func (s LicenseConfigurationRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LicenseConfigurationRequest) GoString() string {
+ return s.String()
+}
+
+// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value.
+func (s *LicenseConfigurationRequest) SetLicenseConfigurationArn(v string) *LicenseConfigurationRequest {
+ s.LicenseConfigurationArn = &v
+ return s
+}
+
// Describes the Classic Load Balancers and target groups to attach to a Spot
// Fleet request.
type LoadBalancersConfig struct {
@@ -53364,6 +72272,348 @@ func (s *LoadPermissionRequest) SetUserId(v string) *LoadPermissionRequest {
return s
}
+type ModifyCapacityReservationInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Capacity Reservation.
+ //
+ // CapacityReservationId is a required field
+ CapacityReservationId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The date and time at which the Capacity Reservation expires. When a Capacity
+ // Reservation expires, the reserved capacity is released and you can no longer
+ // launch instances into it. The Capacity Reservation's state changes to expired
+ // when it reaches its end date and time.
+ //
+ // The Capacity Reservation is cancelled within an hour from the specified time.
+ // For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation
+ // is guaranteed to end between 13:30:55 and 14:30:55 on 5/31/2019.
+ //
+ // You must provide an EndDate value if EndDateType is limited. Omit EndDate
+ // if EndDateType is unlimited.
+ EndDate *time.Time `type:"timestamp"`
+
+ // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation
+ // can have one of the following end types:
+ //
+ // * unlimited - The Capacity Reservation remains active until you explicitly
+ // cancel it. Do not provide an EndDate value if EndDateType is unlimited.
+ //
+ // * limited - The Capacity Reservation expires automatically at a specified
+ // date and time. You must provide an EndDate value if EndDateType is limited.
+ EndDateType *string `type:"string" enum:"EndDateType"`
+
+ // The number of instances for which to reserve capacity.
+ InstanceCount *int64 `type:"integer"`
+}
+
+// String returns the string representation
+func (s ModifyCapacityReservationInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyCapacityReservationInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyCapacityReservationInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyCapacityReservationInput"}
+ if s.CapacityReservationId == nil {
+ invalidParams.Add(request.NewErrParamRequired("CapacityReservationId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCapacityReservationId sets the CapacityReservationId field's value.
+func (s *ModifyCapacityReservationInput) SetCapacityReservationId(v string) *ModifyCapacityReservationInput {
+ s.CapacityReservationId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyCapacityReservationInput) SetDryRun(v bool) *ModifyCapacityReservationInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetEndDate sets the EndDate field's value.
+func (s *ModifyCapacityReservationInput) SetEndDate(v time.Time) *ModifyCapacityReservationInput {
+ s.EndDate = &v
+ return s
+}
+
+// SetEndDateType sets the EndDateType field's value.
+func (s *ModifyCapacityReservationInput) SetEndDateType(v string) *ModifyCapacityReservationInput {
+ s.EndDateType = &v
+ return s
+}
+
+// SetInstanceCount sets the InstanceCount field's value.
+func (s *ModifyCapacityReservationInput) SetInstanceCount(v int64) *ModifyCapacityReservationInput {
+ s.InstanceCount = &v
+ return s
+}
+
+type ModifyCapacityReservationOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Capacity Reservation.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation
+func (s ModifyCapacityReservationOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyCapacityReservationOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *ModifyCapacityReservationOutput) SetReturn(v bool) *ModifyCapacityReservationOutput {
+ s.Return = &v
+ return s
+}
+
+type ModifyClientVpnEndpointInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint to modify.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"true"`
+
+ // Information about the client connection logging options.
+ //
+ // If you enable client connection logging, data about client connections is
+ // sent to a Cloudwatch Logs log stream. The following information is logged:
+ //
+ // * Client connection requests
+ //
+ // * Client connection results (successful and unsuccessful)
+ //
+ // * Reasons for unsuccessful client connection requests
+ //
+ // * Client connection termination time
+ ConnectionLogOptions *ConnectionLogOptions `type:"structure"`
+
+ // A brief description of the Client VPN endpoint.
+ Description *string `type:"string"`
+
+ // Information about the DNS servers to be used by Client VPN connections. A
+ // Client VPN endpoint can have up to two DNS servers.
+ DnsServers *DnsServersOptionsModifyStructure `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 ARN of the server certificate to be used. The server certificate must
+ // be provisioned in AWS Certificate Manager (ACM).
+ ServerCertificateArn *string `type:"string"`
+
+ // Indicates whether the VPN is split-tunnel.
+ //
+ // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client
+ // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html)
+ // in the AWS Client VPN Administrator Guide.
+ SplitTunnel *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s ModifyClientVpnEndpointInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyClientVpnEndpointInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyClientVpnEndpointInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyClientVpnEndpointInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *ModifyClientVpnEndpointInput) SetClientVpnEndpointId(v string) *ModifyClientVpnEndpointInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetConnectionLogOptions sets the ConnectionLogOptions field's value.
+func (s *ModifyClientVpnEndpointInput) SetConnectionLogOptions(v *ConnectionLogOptions) *ModifyClientVpnEndpointInput {
+ s.ConnectionLogOptions = v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *ModifyClientVpnEndpointInput) SetDescription(v string) *ModifyClientVpnEndpointInput {
+ s.Description = &v
+ return s
+}
+
+// SetDnsServers sets the DnsServers field's value.
+func (s *ModifyClientVpnEndpointInput) SetDnsServers(v *DnsServersOptionsModifyStructure) *ModifyClientVpnEndpointInput {
+ s.DnsServers = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyClientVpnEndpointInput) SetDryRun(v bool) *ModifyClientVpnEndpointInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetServerCertificateArn sets the ServerCertificateArn field's value.
+func (s *ModifyClientVpnEndpointInput) SetServerCertificateArn(v string) *ModifyClientVpnEndpointInput {
+ s.ServerCertificateArn = &v
+ return s
+}
+
+// SetSplitTunnel sets the SplitTunnel field's value.
+func (s *ModifyClientVpnEndpointInput) SetSplitTunnel(v bool) *ModifyClientVpnEndpointInput {
+ s.SplitTunnel = &v
+ return s
+}
+
+type ModifyClientVpnEndpointOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation
+func (s ModifyClientVpnEndpointOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyClientVpnEndpointOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *ModifyClientVpnEndpointOutput) SetReturn(v bool) *ModifyClientVpnEndpointOutput {
+ s.Return = &v
+ return s
+}
+
+type ModifyEbsDefaultKmsKeyIdInput 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 identifier of the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified,
+ // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted
+ // state must be true.
+ //
+ // You can specify the CMK using any of the following:
+ //
+ // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab.
+ //
+ // * Key alias. For example, alias/ExampleAlias.
+ //
+ // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef.
+ //
+ // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias.
+ //
+ // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID,
+ // alias, or ARN that is not valid, the action can appear to complete, but eventually
+ // fails.
+ //
+ // KmsKeyId is a required field
+ KmsKeyId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyEbsDefaultKmsKeyIdInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyEbsDefaultKmsKeyIdInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyEbsDefaultKmsKeyIdInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyEbsDefaultKmsKeyIdInput"}
+ if s.KmsKeyId == nil {
+ invalidParams.Add(request.NewErrParamRequired("KmsKeyId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyEbsDefaultKmsKeyIdInput) SetDryRun(v bool) *ModifyEbsDefaultKmsKeyIdInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ModifyEbsDefaultKmsKeyIdInput) SetKmsKeyId(v string) *ModifyEbsDefaultKmsKeyIdInput {
+ s.KmsKeyId = &v
+ return s
+}
+
+type ModifyEbsDefaultKmsKeyIdOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the default CMK for encryption by default.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+}
+
+// String returns the string representation
+func (s ModifyEbsDefaultKmsKeyIdOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyEbsDefaultKmsKeyIdOutput) GoString() string {
+ return s.String()
+}
+
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ModifyEbsDefaultKmsKeyIdOutput) SetKmsKeyId(v string) *ModifyEbsDefaultKmsKeyIdOutput {
+ s.KmsKeyId = &v
+ return s
+}
+
type ModifyFleetInput struct {
_ struct{} `type:"structure"`
@@ -53496,17 +72746,16 @@ type ModifyFpgaImageAttributeInput struct {
// The operation type.
OperationType *string `type:"string" enum:"OperationType"`
- // One or more product codes. After you add a product code to an AFI, it can't
- // be removed. This parameter is valid only when modifying the productCodes
- // attribute.
+ // The product codes. After you add a product code to an AFI, it can't be removed.
+ // This parameter is valid only when modifying the productCodes attribute.
ProductCodes []*string `locationName:"ProductCode" locationNameList:"ProductCode" type:"list"`
- // One or more user groups. This parameter is valid only when modifying the
- // loadPermission attribute.
+ // The user groups. This parameter is valid only when modifying the loadPermission
+ // attribute.
UserGroups []*string `locationName:"UserGroup" locationNameList:"UserGroup" type:"list"`
- // One or more AWS account IDs. This parameter is valid only when modifying
- // the loadPermission attribute.
+ // The AWS account IDs. This parameter is valid only when modifying the loadPermission
+ // attribute.
UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"`
}
@@ -53616,19 +72865,21 @@ func (s *ModifyFpgaImageAttributeOutput) SetFpgaImageAttribute(v *FpgaImageAttri
return s
}
-// Contains the parameters for ModifyHosts.
type ModifyHostsInput struct {
_ struct{} `type:"structure"`
// Specify whether to enable or disable auto-placement.
- //
- // AutoPlacement is a required field
- AutoPlacement *string `locationName:"autoPlacement" type:"string" required:"true" enum:"AutoPlacement"`
+ AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"`
- // The host IDs of the Dedicated Hosts you want to modify.
+ // The IDs of the Dedicated Hosts to modify.
//
// HostIds is a required field
HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"`
+
+ // Indicates whether to enable or disable host recovery for the Dedicated Host.
+ // For more information, see Host Recovery (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html)
+ // in the Amazon Elastic Compute Cloud User Guide.
+ HostRecovery *string `type:"string" enum:"HostRecovery"`
}
// String returns the string representation
@@ -53644,9 +72895,6 @@ func (s ModifyHostsInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *ModifyHostsInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ModifyHostsInput"}
- if s.AutoPlacement == nil {
- invalidParams.Add(request.NewErrParamRequired("AutoPlacement"))
- }
if s.HostIds == nil {
invalidParams.Add(request.NewErrParamRequired("HostIds"))
}
@@ -53669,7 +72917,12 @@ func (s *ModifyHostsInput) SetHostIds(v []*string) *ModifyHostsInput {
return s
}
-// Contains the output of ModifyHosts.
+// SetHostRecovery sets the HostRecovery field's value.
+func (s *ModifyHostsInput) SetHostRecovery(v string) *ModifyHostsInput {
+ s.HostRecovery = &v
+ return s
+}
+
type ModifyHostsOutput struct {
_ struct{} `type:"structure"`
@@ -53703,7 +72956,6 @@ func (s *ModifyHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ModifyHostsO
return s
}
-// Contains the parameters of ModifyIdFormat.
type ModifyIdFormatInput struct {
_ struct{} `type:"structure"`
@@ -53779,7 +73031,6 @@ func (s ModifyIdFormatOutput) GoString() string {
return s.String()
}
-// Contains the parameters of ModifyIdentityIdFormat.
type ModifyIdentityIdFormatInput struct {
_ struct{} `type:"structure"`
@@ -53900,16 +73151,16 @@ type ModifyImageAttributeInput struct {
// is launchPermission.
OperationType *string `type:"string" enum:"OperationType"`
- // One or more DevPay product codes. After you add a product code to an AMI,
- // it can't be removed.
+ // The DevPay product codes. After you add a product code to an AMI, it can't
+ // be removed.
ProductCodes []*string `locationName:"ProductCode" locationNameList:"ProductCode" type:"list"`
- // One or more user groups. This parameter can be used only when the Attribute
- // parameter is launchPermission.
+ // The user groups. This parameter can be used only when the Attribute parameter
+ // is launchPermission.
UserGroups []*string `locationName:"UserGroup" locationNameList:"UserGroup" type:"list"`
- // One or more AWS account IDs. This parameter can be used only when the Attribute
- // parameter is launchPermission.
+ // The AWS account IDs. This parameter can be used only when the Attribute parameter
+ // is launchPermission.
UserIds []*string `locationName:"UserId" locationNameList:"UserId" type:"list"`
// The value of the attribute being modified. This parameter can be used only
@@ -54014,7 +73265,6 @@ func (s ModifyImageAttributeOutput) GoString() string {
return s.String()
}
-// Contains the parameters for ModifyInstanceAttribute.
type ModifyInstanceAttributeInput struct {
_ struct{} `type:"structure"`
@@ -54028,7 +73278,7 @@ type ModifyInstanceAttributeInput struct {
//
// To add instance store volumes to an Amazon EBS-backed instance, you must
// add them when you launch the instance. For more information, see Updating
- // the Block Device Mapping when Launching an Instance (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM)
+ // the Block Device Mapping when Launching an Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html#Using_OverridingAMIBDM)
// in the Amazon Elastic Compute Cloud User Guide.
BlockDeviceMappings []*InstanceBlockDeviceMappingSpecification `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
@@ -54071,18 +73321,18 @@ type ModifyInstanceAttributeInput struct {
InstanceInitiatedShutdownBehavior *AttributeValue `locationName:"instanceInitiatedShutdownBehavior" type:"structure"`
// Changes the instance type to the specified value. For more information, see
- // Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).
+ // Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).
// If the instance type is not valid, the error returned is InvalidInstanceAttributeValue.
InstanceType *AttributeValue `locationName:"instanceType" type:"structure"`
// Changes the instance's kernel to the specified value. We recommend that you
// use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB
- // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html).
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html).
Kernel *AttributeValue `locationName:"kernel" type:"structure"`
// Changes the instance's RAM disk to the specified value. We recommend that
// you use PV-GRUB instead of kernels and RAM disks. For more information, see
- // PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html).
+ // PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedKernels.html).
Ramdisk *AttributeValue `locationName:"ramdisk" type:"structure"`
// Specifies whether source/destination checking is enabled. A value of true
@@ -54244,12 +73494,99 @@ func (s ModifyInstanceAttributeOutput) GoString() string {
return s.String()
}
+type ModifyInstanceCapacityReservationAttributesInput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Capacity Reservation targeting option.
+ //
+ // CapacityReservationSpecification is a required field
+ CapacityReservationSpecification *CapacityReservationSpecification `type:"structure" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the instance to be modified.
+ //
+ // InstanceId is a required field
+ InstanceId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyInstanceCapacityReservationAttributesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyInstanceCapacityReservationAttributesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyInstanceCapacityReservationAttributesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceCapacityReservationAttributesInput"}
+ if s.CapacityReservationSpecification == nil {
+ invalidParams.Add(request.NewErrParamRequired("CapacityReservationSpecification"))
+ }
+ if s.InstanceId == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCapacityReservationSpecification sets the CapacityReservationSpecification field's value.
+func (s *ModifyInstanceCapacityReservationAttributesInput) SetCapacityReservationSpecification(v *CapacityReservationSpecification) *ModifyInstanceCapacityReservationAttributesInput {
+ s.CapacityReservationSpecification = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyInstanceCapacityReservationAttributesInput) SetDryRun(v bool) *ModifyInstanceCapacityReservationAttributesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetInstanceId sets the InstanceId field's value.
+func (s *ModifyInstanceCapacityReservationAttributesInput) SetInstanceId(v string) *ModifyInstanceCapacityReservationAttributesInput {
+ s.InstanceId = &v
+ return s
+}
+
+type ModifyInstanceCapacityReservationAttributesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Returns true if the request succeeds; otherwise, it returns an error.
+ Return *bool `locationName:"return" type:"boolean"`
+}
+
+// String returns the string representation
+func (s ModifyInstanceCapacityReservationAttributesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyInstanceCapacityReservationAttributesOutput) GoString() string {
+ return s.String()
+}
+
+// SetReturn sets the Return field's value.
+func (s *ModifyInstanceCapacityReservationAttributesOutput) SetReturn(v bool) *ModifyInstanceCapacityReservationAttributesOutput {
+ s.Return = &v
+ return s
+}
+
type ModifyInstanceCreditSpecificationInput 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
- // (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -54339,7 +73676,107 @@ func (s *ModifyInstanceCreditSpecificationOutput) SetUnsuccessfulInstanceCreditS
return s
}
-// Contains the parameters for ModifyInstancePlacement.
+type ModifyInstanceEventStartTimeInput 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 event whose date and time you are modifying.
+ //
+ // InstanceEventId is a required field
+ InstanceEventId *string `type:"string" required:"true"`
+
+ // The ID of the instance with the scheduled event.
+ //
+ // InstanceId is a required field
+ InstanceId *string `type:"string" required:"true"`
+
+ // The new date and time when the event will take place.
+ //
+ // NotBefore is a required field
+ NotBefore *time.Time `type:"timestamp" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyInstanceEventStartTimeInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyInstanceEventStartTimeInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyInstanceEventStartTimeInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceEventStartTimeInput"}
+ if s.InstanceEventId == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceEventId"))
+ }
+ if s.InstanceId == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceId"))
+ }
+ if s.NotBefore == nil {
+ invalidParams.Add(request.NewErrParamRequired("NotBefore"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyInstanceEventStartTimeInput) SetDryRun(v bool) *ModifyInstanceEventStartTimeInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetInstanceEventId sets the InstanceEventId field's value.
+func (s *ModifyInstanceEventStartTimeInput) SetInstanceEventId(v string) *ModifyInstanceEventStartTimeInput {
+ s.InstanceEventId = &v
+ return s
+}
+
+// SetInstanceId sets the InstanceId field's value.
+func (s *ModifyInstanceEventStartTimeInput) SetInstanceId(v string) *ModifyInstanceEventStartTimeInput {
+ s.InstanceId = &v
+ return s
+}
+
+// SetNotBefore sets the NotBefore field's value.
+func (s *ModifyInstanceEventStartTimeInput) SetNotBefore(v time.Time) *ModifyInstanceEventStartTimeInput {
+ s.NotBefore = &v
+ return s
+}
+
+type ModifyInstanceEventStartTimeOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Describes a scheduled event for an instance.
+ Event *InstanceStatusEvent `locationName:"event" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyInstanceEventStartTimeOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyInstanceEventStartTimeOutput) GoString() string {
+ return s.String()
+}
+
+// SetEvent sets the Event field's value.
+func (s *ModifyInstanceEventStartTimeOutput) SetEvent(v *InstanceStatusEvent) *ModifyInstanceEventStartTimeOutput {
+ s.Event = v
+ return s
+}
+
type ModifyInstancePlacementInput struct {
_ struct{} `type:"structure"`
@@ -54348,7 +73785,8 @@ type ModifyInstancePlacementInput struct {
// The name of the placement group in which to place the instance. For spread
// placement groups, the instance must have a tenancy of default. For cluster
- // placement groups, the instance must have a tenancy of default or dedicated.
+ // and partition placement groups, the instance must have a tenancy of default
+ // or dedicated.
//
// To remove an instance from a placement group, specify an empty string ("").
GroupName *string `type:"string"`
@@ -54361,6 +73799,9 @@ type ModifyInstancePlacementInput struct {
// InstanceId is a required field
InstanceId *string `locationName:"instanceId" type:"string" required:"true"`
+ // Reserved for future use.
+ PartitionNumber *int64 `type:"integer"`
+
// The tenancy for the instance.
Tenancy *string `locationName:"tenancy" type:"string" enum:"HostTenancy"`
}
@@ -54412,13 +73853,18 @@ func (s *ModifyInstancePlacementInput) SetInstanceId(v string) *ModifyInstancePl
return s
}
+// SetPartitionNumber sets the PartitionNumber field's value.
+func (s *ModifyInstancePlacementInput) SetPartitionNumber(v int64) *ModifyInstancePlacementInput {
+ s.PartitionNumber = &v
+ return s
+}
+
// SetTenancy sets the Tenancy field's value.
func (s *ModifyInstancePlacementInput) SetTenancy(v string) *ModifyInstancePlacementInput {
s.Tenancy = &v
return s
}
-// Contains the output of ModifyInstancePlacement.
type ModifyInstancePlacementOutput struct {
_ struct{} `type:"structure"`
@@ -54446,7 +73892,9 @@ type ModifyLaunchTemplateInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ //
+ // Constraint: Maximum 128 ASCII characters.
ClientToken *string `type:"string"`
// The version number of the launch template to set as the default version.
@@ -54574,7 +74022,7 @@ type ModifyNetworkInterfaceAttributeInput struct {
// Indicates whether source/destination checking is enabled. A value of true
// means checking is enabled, and false means checking is disabled. This value
// must be false for a NAT instance to perform NAT. For more information, see
- // NAT Instances (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
+ // NAT Instances (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html)
// in the Amazon Virtual Private Cloud User Guide.
SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"`
}
@@ -54657,7 +74105,7 @@ type ModifyReservedInstancesInput struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive token you provide to ensure idempotency of your
- // modification request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // modification request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// The IDs of the Reserved Instances to modify.
@@ -54743,9 +74191,8 @@ func (s *ModifyReservedInstancesOutput) SetReservedInstancesModificationId(v str
type ModifySnapshotAttributeInput struct {
_ struct{} `type:"structure"`
- // The snapshot attribute to modify.
- //
- // Only volume creation permissions may be modified at the customer level.
+ // The snapshot attribute to modify. Only volume creation permissions can be
+ // modified.
Attribute *string `type:"string" enum:"SnapshotAttributeName"`
// A JSON representation of the snapshot attribute modification.
@@ -54860,6 +74307,9 @@ type ModifySpotFleetRequestInput struct {
// the Spot Fleet.
ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"`
+ // The number of On-Demand Instances in the fleet.
+ OnDemandTargetCapacity *int64 `type:"integer"`
+
// The ID of the Spot Fleet request.
//
// SpotFleetRequestId is a required field
@@ -54898,6 +74348,12 @@ func (s *ModifySpotFleetRequestInput) SetExcessCapacityTerminationPolicy(v strin
return s
}
+// SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value.
+func (s *ModifySpotFleetRequestInput) SetOnDemandTargetCapacity(v int64) *ModifySpotFleetRequestInput {
+ s.OnDemandTargetCapacity = &v
+ return s
+}
+
// SetSpotFleetRequestId sets the SpotFleetRequestId field's value.
func (s *ModifySpotFleetRequestInput) SetSpotFleetRequestId(v string) *ModifySpotFleetRequestInput {
s.SpotFleetRequestId = &v
@@ -54934,7 +74390,6 @@ func (s *ModifySpotFleetRequestOutput) SetReturn(v bool) *ModifySpotFleetRequest
return s
}
-// Contains the parameters for ModifySubnetAttribute.
type ModifySubnetAttributeInput struct {
_ struct{} `type:"structure"`
@@ -54948,10 +74403,8 @@ type ModifySubnetAttributeInput struct {
// or later of the Amazon EC2 API.
AssignIpv6AddressOnCreation *AttributeBooleanValue `type:"structure"`
- // Specify true to indicate that network interfaces created in the specified
- // subnet should be assigned a public IPv4 address. This includes a network
- // interface that's created when launching an instance into the subnet (the
- // instance therefore receives a public IPv4 address).
+ // Specify true to indicate that ENIs attached to instances created in the specified
+ // subnet should be assigned a public IPv4 address.
MapPublicIpOnLaunch *AttributeBooleanValue `type:"structure"`
// The ID of the subnet.
@@ -55015,6 +74468,547 @@ func (s ModifySubnetAttributeOutput) GoString() string {
return s.String()
}
+type ModifyTrafficMirrorFilterNetworkServicesInput struct {
+ _ struct{} `type:"structure"`
+
+ // The network service, for example Amazon DNS, that you want to mirror.
+ AddNetworkServices []*string `locationName:"AddNetworkService" locationNameList:"item" type:"list"`
+
+ // 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 network service, for example Amazon DNS, that you no longer want to mirror.
+ RemoveNetworkServices []*string `locationName:"RemoveNetworkService" locationNameList:"item" type:"list"`
+
+ // The ID of the Traffic Mirror filter.
+ //
+ // TrafficMirrorFilterId is a required field
+ TrafficMirrorFilterId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorFilterNetworkServicesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorFilterNetworkServicesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyTrafficMirrorFilterNetworkServicesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyTrafficMirrorFilterNetworkServicesInput"}
+ if s.TrafficMirrorFilterId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAddNetworkServices sets the AddNetworkServices field's value.
+func (s *ModifyTrafficMirrorFilterNetworkServicesInput) SetAddNetworkServices(v []*string) *ModifyTrafficMirrorFilterNetworkServicesInput {
+ s.AddNetworkServices = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyTrafficMirrorFilterNetworkServicesInput) SetDryRun(v bool) *ModifyTrafficMirrorFilterNetworkServicesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetRemoveNetworkServices sets the RemoveNetworkServices field's value.
+func (s *ModifyTrafficMirrorFilterNetworkServicesInput) SetRemoveNetworkServices(v []*string) *ModifyTrafficMirrorFilterNetworkServicesInput {
+ s.RemoveNetworkServices = v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *ModifyTrafficMirrorFilterNetworkServicesInput) SetTrafficMirrorFilterId(v string) *ModifyTrafficMirrorFilterNetworkServicesInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+type ModifyTrafficMirrorFilterNetworkServicesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The Traffic Mirror filter that the network service is associated with.
+ TrafficMirrorFilter *TrafficMirrorFilter `locationName:"trafficMirrorFilter" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorFilterNetworkServicesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorFilterNetworkServicesOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorFilter sets the TrafficMirrorFilter field's value.
+func (s *ModifyTrafficMirrorFilterNetworkServicesOutput) SetTrafficMirrorFilter(v *TrafficMirrorFilter) *ModifyTrafficMirrorFilterNetworkServicesOutput {
+ s.TrafficMirrorFilter = v
+ return s
+}
+
+type ModifyTrafficMirrorFilterRuleInput struct {
+ _ struct{} `type:"structure"`
+
+ // The description to assign to the Traffic Mirror rule.
+ Description *string `type:"string"`
+
+ // The destination CIDR block to assign to the Traffic Mirror rule.
+ DestinationCidrBlock *string `type:"string"`
+
+ // The destination ports that are associated with the Traffic Mirror rule.
+ DestinationPortRange *TrafficMirrorPortRangeRequest `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 protocol, for example TCP, to assign to the Traffic Mirror rule.
+ Protocol *int64 `type:"integer"`
+
+ // The properties that you want to remove from the Traffic Mirror filter rule.
+ //
+ // When you remove a property from a Traffic Mirror filter rule, the property
+ // is set to the default.
+ RemoveFields []*string `locationName:"RemoveField" type:"list"`
+
+ // The action to assign to the rule.
+ RuleAction *string `type:"string" enum:"TrafficMirrorRuleAction"`
+
+ // The number of the Traffic Mirror rule. This number must be unique for each
+ // Traffic Mirror rule in a given direction. The rules are processed in ascending
+ // order by rule number.
+ RuleNumber *int64 `type:"integer"`
+
+ // The source CIDR block to assign to the Traffic Mirror rule.
+ SourceCidrBlock *string `type:"string"`
+
+ // The port range to assign to the Traffic Mirror rule.
+ SourcePortRange *TrafficMirrorPortRangeRequest `type:"structure"`
+
+ // The type of traffic (ingress | egress) to assign to the rule.
+ TrafficDirection *string `type:"string" enum:"TrafficDirection"`
+
+ // The ID of the Traffic Mirror rule.
+ //
+ // TrafficMirrorFilterRuleId is a required field
+ TrafficMirrorFilterRuleId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorFilterRuleInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorFilterRuleInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyTrafficMirrorFilterRuleInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyTrafficMirrorFilterRuleInput"}
+ if s.TrafficMirrorFilterRuleId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterRuleId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDescription sets the Description field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetDescription(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetDestinationCidrBlock(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDestinationPortRange sets the DestinationPortRange field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetDestinationPortRange(v *TrafficMirrorPortRangeRequest) *ModifyTrafficMirrorFilterRuleInput {
+ s.DestinationPortRange = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetDryRun(v bool) *ModifyTrafficMirrorFilterRuleInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetProtocol sets the Protocol field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetProtocol(v int64) *ModifyTrafficMirrorFilterRuleInput {
+ s.Protocol = &v
+ return s
+}
+
+// SetRemoveFields sets the RemoveFields field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetRemoveFields(v []*string) *ModifyTrafficMirrorFilterRuleInput {
+ s.RemoveFields = v
+ return s
+}
+
+// SetRuleAction sets the RuleAction field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetRuleAction(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.RuleAction = &v
+ return s
+}
+
+// SetRuleNumber sets the RuleNumber field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetRuleNumber(v int64) *ModifyTrafficMirrorFilterRuleInput {
+ s.RuleNumber = &v
+ return s
+}
+
+// SetSourceCidrBlock sets the SourceCidrBlock field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetSourceCidrBlock(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.SourceCidrBlock = &v
+ return s
+}
+
+// SetSourcePortRange sets the SourcePortRange field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetSourcePortRange(v *TrafficMirrorPortRangeRequest) *ModifyTrafficMirrorFilterRuleInput {
+ s.SourcePortRange = v
+ return s
+}
+
+// SetTrafficDirection sets the TrafficDirection field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetTrafficDirection(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.TrafficDirection = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value.
+func (s *ModifyTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterRuleId(v string) *ModifyTrafficMirrorFilterRuleInput {
+ s.TrafficMirrorFilterRuleId = &v
+ return s
+}
+
+type ModifyTrafficMirrorFilterRuleOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Modifies a Traffic Mirror rule.
+ TrafficMirrorFilterRule *TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRule" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorFilterRuleOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorFilterRuleOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorFilterRule sets the TrafficMirrorFilterRule field's value.
+func (s *ModifyTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRule(v *TrafficMirrorFilterRule) *ModifyTrafficMirrorFilterRuleOutput {
+ s.TrafficMirrorFilterRule = v
+ return s
+}
+
+type ModifyTrafficMirrorSessionInput struct {
+ _ struct{} `type:"structure"`
+
+ // The description to assign to the Traffic Mirror session.
+ Description *string `type:"string"`
+
+ // 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 number of bytes in each packet to mirror. These are bytes after the VXLAN
+ // header. To mirror a subset, set this to the length (in bytes) to mirror.
+ // For example, if you set this value to 100, then the first 100 bytes that
+ // meet the filter criteria are copied to the target. Do not specify this parameter
+ // when you want to mirror the entire packet.
+ PacketLength *int64 `type:"integer"`
+
+ // The properties that you want to remove from the Traffic Mirror session.
+ //
+ // When you remove a property from a Traffic Mirror session, the property is
+ // set to the default.
+ RemoveFields []*string `locationName:"RemoveField" type:"list"`
+
+ // The session number determines the order in which sessions are evaluated when
+ // an interface is used by multiple sessions. The first session with a matching
+ // filter is the one that mirrors the packets.
+ //
+ // Valid values are 1-32766.
+ SessionNumber *int64 `type:"integer"`
+
+ // The ID of the Traffic Mirror filter.
+ TrafficMirrorFilterId *string `type:"string"`
+
+ // The ID of the Traffic Mirror session.
+ //
+ // TrafficMirrorSessionId is a required field
+ TrafficMirrorSessionId *string `type:"string" required:"true"`
+
+ // The Traffic Mirror target. The target must be in the same VPC as the source,
+ // or have a VPC peering connection with the source.
+ TrafficMirrorTargetId *string `type:"string"`
+
+ // The virtual network ID of the Traffic Mirror session.
+ VirtualNetworkId *int64 `type:"integer"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorSessionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorSessionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyTrafficMirrorSessionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyTrafficMirrorSessionInput"}
+ if s.TrafficMirrorSessionId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TrafficMirrorSessionId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDescription sets the Description field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetDescription(v string) *ModifyTrafficMirrorSessionInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetDryRun(v bool) *ModifyTrafficMirrorSessionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetPacketLength sets the PacketLength field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetPacketLength(v int64) *ModifyTrafficMirrorSessionInput {
+ s.PacketLength = &v
+ return s
+}
+
+// SetRemoveFields sets the RemoveFields field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetRemoveFields(v []*string) *ModifyTrafficMirrorSessionInput {
+ s.RemoveFields = v
+ return s
+}
+
+// SetSessionNumber sets the SessionNumber field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetSessionNumber(v int64) *ModifyTrafficMirrorSessionInput {
+ s.SessionNumber = &v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetTrafficMirrorFilterId(v string) *ModifyTrafficMirrorSessionInput {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetTrafficMirrorSessionId(v string) *ModifyTrafficMirrorSessionInput {
+ s.TrafficMirrorSessionId = &v
+ return s
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetTrafficMirrorTargetId(v string) *ModifyTrafficMirrorSessionInput {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+// SetVirtualNetworkId sets the VirtualNetworkId field's value.
+func (s *ModifyTrafficMirrorSessionInput) SetVirtualNetworkId(v int64) *ModifyTrafficMirrorSessionInput {
+ s.VirtualNetworkId = &v
+ return s
+}
+
+type ModifyTrafficMirrorSessionOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Traffic Mirror session.
+ TrafficMirrorSession *TrafficMirrorSession `locationName:"trafficMirrorSession" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyTrafficMirrorSessionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTrafficMirrorSessionOutput) GoString() string {
+ return s.String()
+}
+
+// SetTrafficMirrorSession sets the TrafficMirrorSession field's value.
+func (s *ModifyTrafficMirrorSessionOutput) SetTrafficMirrorSession(v *TrafficMirrorSession) *ModifyTrafficMirrorSessionOutput {
+ s.TrafficMirrorSession = v
+ return s
+}
+
+type ModifyTransitGatewayVpcAttachmentInput struct {
+ _ struct{} `type:"structure"`
+
+ // The IDs of one or more subnets to add. You can specify at most one subnet
+ // per Availability Zone.
+ AddSubnetIds []*string `locationNameList:"item" type:"list"`
+
+ // 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 new VPC attachment options.
+ Options *ModifyTransitGatewayVpcAttachmentRequestOptions `type:"structure"`
+
+ // The IDs of one or more subnets to remove.
+ RemoveSubnetIds []*string `locationNameList:"item" type:"list"`
+
+ // The ID of the attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyTransitGatewayVpcAttachmentInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyTransitGatewayVpcAttachmentInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAddSubnetIds sets the AddSubnetIds field's value.
+func (s *ModifyTransitGatewayVpcAttachmentInput) SetAddSubnetIds(v []*string) *ModifyTransitGatewayVpcAttachmentInput {
+ s.AddSubnetIds = v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *ModifyTransitGatewayVpcAttachmentInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetOptions sets the Options field's value.
+func (s *ModifyTransitGatewayVpcAttachmentInput) SetOptions(v *ModifyTransitGatewayVpcAttachmentRequestOptions) *ModifyTransitGatewayVpcAttachmentInput {
+ s.Options = v
+ return s
+}
+
+// SetRemoveSubnetIds sets the RemoveSubnetIds field's value.
+func (s *ModifyTransitGatewayVpcAttachmentInput) SetRemoveSubnetIds(v []*string) *ModifyTransitGatewayVpcAttachmentInput {
+ s.RemoveSubnetIds = v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *ModifyTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *ModifyTransitGatewayVpcAttachmentInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+type ModifyTransitGatewayVpcAttachmentOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the modified attachment.
+ TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value.
+func (s *ModifyTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *ModifyTransitGatewayVpcAttachmentOutput {
+ s.TransitGatewayVpcAttachment = v
+ return s
+}
+
+// Describes the options for a VPC attachment.
+type ModifyTransitGatewayVpcAttachmentRequestOptions struct {
+ _ struct{} `type:"structure"`
+
+ // Enable or disable DNS support. The default is enable.
+ DnsSupport *string `type:"string" enum:"DnsSupportValue"`
+
+ // Enable or disable IPv6 support. The default is enable.
+ Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"`
+}
+
+// String returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentRequestOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyTransitGatewayVpcAttachmentRequestOptions) GoString() string {
+ return s.String()
+}
+
+// SetDnsSupport sets the DnsSupport field's value.
+func (s *ModifyTransitGatewayVpcAttachmentRequestOptions) SetDnsSupport(v string) *ModifyTransitGatewayVpcAttachmentRequestOptions {
+ s.DnsSupport = &v
+ return s
+}
+
+// SetIpv6Support sets the Ipv6Support field's value.
+func (s *ModifyTransitGatewayVpcAttachmentRequestOptions) SetIpv6Support(v string) *ModifyTransitGatewayVpcAttachmentRequestOptions {
+ s.Ipv6Support = &v
+ return s
+}
+
// Contains the parameters for ModifyVolumeAttribute.
type ModifyVolumeAttributeInput struct {
_ struct{} `type:"structure"`
@@ -55098,19 +75092,17 @@ type ModifyVolumeInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // Target IOPS rate of the volume to be modified.
+ // The target IOPS rate of the volume.
//
- // Only valid for Provisioned IOPS SSD (io1) volumes. For more information about
- // io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops
- // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops).
+ // This is only valid for Provisioned IOPS SSD (io1) volumes. For more information,
+ // see Provisioned IOPS SSD (io1) Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops).
//
// Default: If no IOPS value is specified, the existing value is retained.
Iops *int64 `type:"integer"`
- // Target size in GiB of the volume to be modified. Target volume size must
- // be greater than or equal to than the existing size of the volume. For information
- // about available EBS volume sizes, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
- // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
+ // The target size of the volume, in GiB. The target volume size must be greater
+ // than or equal to than the existing size of the volume. For information about
+ // available EBS volume sizes, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html).
//
// Default: If no size is specified, the existing size is retained.
Size *int64 `type:"integer"`
@@ -55120,10 +75112,7 @@ type ModifyVolumeInput struct {
// VolumeId is a required field
VolumeId *string `type:"string" required:"true"`
- // Target EBS volume type of the volume to be modified
- //
- // The API does not support modifications for volume type standard. You also
- // cannot change the type of a volume to standard.
+ // The target EBS volume type of the volume.
//
// Default: If no type is specified, the existing type is retained.
VolumeType *string `type:"string" enum:"VolumeType"`
@@ -55185,7 +75174,7 @@ func (s *ModifyVolumeInput) SetVolumeType(v string) *ModifyVolumeInput {
type ModifyVolumeOutput struct {
_ struct{} `type:"structure"`
- // A VolumeModification object.
+ // Information about the volume modification.
VolumeModification *VolumeModification `locationName:"volumeModification" type:"structure"`
}
@@ -55205,7 +75194,6 @@ func (s *ModifyVolumeOutput) SetVolumeModification(v *VolumeModification) *Modif
return s
}
-// Contains the parameters for ModifyVpcAttribute.
type ModifyVpcAttributeInput struct {
_ struct{} `type:"structure"`
@@ -55220,8 +75208,8 @@ type ModifyVpcAttributeInput struct {
// Indicates whether the DNS resolution is supported for the VPC. If enabled,
// queries to the Amazon provided DNS server at the 169.254.169.253 IP address,
// or the reserved IP address at the base of the VPC network range "plus two"
- // will succeed. If disabled, the Amazon provided DNS service in the VPC that
- // resolves public DNS hostnames to IP addresses is not enabled.
+ // succeed. If disabled, the Amazon provided DNS service in the VPC that resolves
+ // public DNS hostnames to IP addresses is not enabled.
//
// You cannot modify the DNS resolution and DNS hostnames attributes in the
// same request. Use separate requests for each attribute.
@@ -55400,8 +75388,9 @@ type ModifyVpcEndpointInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // (Gateway endpoint) A policy document to attach to the endpoint. The policy
- // must be in valid JSON format.
+ // A policy to attach to the endpoint that controls access to the service. The
+ // policy must be in valid JSON format. If this parameter is not specified,
+ // we attach a default policy that allows full access to the service.
PolicyDocument *string `type:"string"`
// (Interface endpoint) Indicate whether a private hosted zone is associated
@@ -55645,8 +75634,9 @@ func (s *ModifyVpcEndpointServiceConfigurationOutput) SetReturn(v bool) *ModifyV
type ModifyVpcEndpointServicePermissionsInput struct {
_ struct{} `type:"structure"`
- // One or more Amazon Resource Names (ARNs) of principals for which to allow
- // permission. Specify * to allow all principals.
+ // The Amazon Resource Names (ARN) of one or more principals. Permissions are
+ // granted to the principals in this list. To grant permissions to all principals,
+ // specify an asterisk (*).
AddAllowedPrincipals []*string `locationNameList:"item" type:"list"`
// Checks whether you have the required permissions for the action, without
@@ -55655,8 +75645,8 @@ type ModifyVpcEndpointServicePermissionsInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more Amazon Resource Names (ARNs) of principals for which to remove
- // permission.
+ // The Amazon Resource Names (ARN) of one or more principals. Permissions are
+ // revoked for principals in this list.
RemoveAllowedPrincipals []*string `locationNameList:"item" type:"list"`
// The ID of the service.
@@ -55741,7 +75731,7 @@ type ModifyVpcPeeringConnectionOptionsInput struct {
// The VPC peering connection options for the accepter VPC.
AccepterPeeringConnectionOptions *PeeringConnectionOptionsRequest `type:"structure"`
- // Checks whether you have the required permissions for the operation, without
+ // 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.
@@ -55835,11 +75825,10 @@ func (s *ModifyVpcPeeringConnectionOptionsOutput) SetRequesterPeeringConnectionO
return s
}
-// Contains the parameters for ModifyVpcTenancy.
type ModifyVpcTenancyInput struct {
_ struct{} `type:"structure"`
- // Checks whether you have the required permissions for the operation, without
+ // 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.
@@ -55900,7 +75889,6 @@ func (s *ModifyVpcTenancyInput) SetVpcId(v string) *ModifyVpcTenancyInput {
return s
}
-// Contains the output of ModifyVpcTenancy.
type ModifyVpcTenancyOutput struct {
_ struct{} `type:"structure"`
@@ -55924,7 +75912,97 @@ func (s *ModifyVpcTenancyOutput) SetReturnValue(v bool) *ModifyVpcTenancyOutput
return s
}
-// Contains the parameters for MonitorInstances.
+type ModifyVpnConnectionInput 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 transit gateway.
+ TransitGatewayId *string `type:"string"`
+
+ // The ID of the VPN connection.
+ //
+ // VpnConnectionId is a required field
+ VpnConnectionId *string `type:"string" required:"true"`
+
+ // The ID of the virtual private gateway at the AWS side of the VPN connection.
+ VpnGatewayId *string `type:"string"`
+}
+
+// String returns the string representation
+func (s ModifyVpnConnectionInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyVpnConnectionInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ModifyVpnConnectionInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ModifyVpnConnectionInput"}
+ if s.VpnConnectionId == nil {
+ invalidParams.Add(request.NewErrParamRequired("VpnConnectionId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ModifyVpnConnectionInput) SetDryRun(v bool) *ModifyVpnConnectionInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *ModifyVpnConnectionInput) SetTransitGatewayId(v string) *ModifyVpnConnectionInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// SetVpnConnectionId sets the VpnConnectionId field's value.
+func (s *ModifyVpnConnectionInput) SetVpnConnectionId(v string) *ModifyVpnConnectionInput {
+ s.VpnConnectionId = &v
+ return s
+}
+
+// SetVpnGatewayId sets the VpnGatewayId field's value.
+func (s *ModifyVpnConnectionInput) SetVpnGatewayId(v string) *ModifyVpnConnectionInput {
+ s.VpnGatewayId = &v
+ return s
+}
+
+type ModifyVpnConnectionOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Describes a VPN connection.
+ VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"`
+}
+
+// String returns the string representation
+func (s ModifyVpnConnectionOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ModifyVpnConnectionOutput) GoString() string {
+ return s.String()
+}
+
+// SetVpnConnection sets the VpnConnection field's value.
+func (s *ModifyVpnConnectionOutput) SetVpnConnection(v *VpnConnection) *ModifyVpnConnectionOutput {
+ s.VpnConnection = v
+ return s
+}
+
type MonitorInstancesInput struct {
_ struct{} `type:"structure"`
@@ -55934,7 +76012,7 @@ type MonitorInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more instance IDs.
+ // The IDs of the instances.
//
// InstanceIds is a required field
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"`
@@ -55975,7 +76053,6 @@ func (s *MonitorInstancesInput) SetInstanceIds(v []*string) *MonitorInstancesInp
return s
}
-// Contains the output of MonitorInstances.
type MonitorInstancesOutput struct {
_ struct{} `type:"structure"`
@@ -56024,7 +76101,6 @@ func (s *Monitoring) SetState(v string) *Monitoring {
return s
}
-// Contains the parameters for MoveAddressToVpc.
type MoveAddressToVpcInput struct {
_ struct{} `type:"structure"`
@@ -56075,7 +76151,6 @@ func (s *MoveAddressToVpcInput) SetPublicIp(v string) *MoveAddressToVpcInput {
return s
}
-// Contains the output of MoveAddressToVpc.
type MoveAddressToVpcOutput struct {
_ struct{} `type:"structure"`
@@ -56147,10 +76222,10 @@ type NatGateway struct {
_ struct{} `type:"structure"`
// The date and time the NAT gateway was created.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The date and time the NAT gateway was deleted, if applicable.
- DeleteTime *time.Time `locationName:"deleteTime" type:"timestamp" timestampFormat:"iso8601"`
+ DeleteTime *time.Time `locationName:"deleteTime" type:"timestamp"`
// If the NAT gateway could not be created, specifies the error code for the
// failure. (InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound
@@ -56187,7 +76262,7 @@ type NatGateway struct {
NatGatewayId *string `locationName:"natGatewayId" type:"string"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
ProvisionedBandwidth *ProvisionedBandwidth `locationName:"provisionedBandwidth" type:"structure"`
@@ -56364,6 +76439,9 @@ type NetworkAcl struct {
// The ID of the network ACL.
NetworkAclId *string `locationName:"networkAclId" type:"string"`
+ // The ID of the AWS account that owns the network ACL.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// Any tags assigned to the network ACL.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
@@ -56405,6 +76483,12 @@ func (s *NetworkAcl) SetNetworkAclId(v string) *NetworkAcl {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *NetworkAcl) SetOwnerId(v string) *NetworkAcl {
+ s.OwnerId = &v
+ return s
+}
+
// SetTags sets the Tags field's value.
func (s *NetworkAcl) SetTags(v []*Tag) *NetworkAcl {
s.Tags = v
@@ -56479,7 +76563,7 @@ type NetworkAclEntry struct {
// TCP or UDP protocols: The range of ports the rule applies to.
PortRange *PortRange `locationName:"portRange" type:"structure"`
- // The protocol. A value of -1 means all protocols.
+ // The protocol number. A value of "-1" means all protocols.
Protocol *string `locationName:"protocol" type:"string"`
// Indicates whether to allow or deny the traffic that matches the rule.
@@ -56568,7 +76652,7 @@ type NetworkInterface struct {
// Any security groups for the network interface.
Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"`
- // The type of interface.
+ // The type of network interface.
InterfaceType *string `locationName:"interfaceType" type:"string" enum:"NetworkInterfaceType"`
// The IPv6 addresses associated with the network interface.
@@ -56810,7 +76894,7 @@ type NetworkInterfaceAttachment struct {
_ struct{} `type:"structure"`
// The timestamp indicating when the attachment initiated.
- AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"`
+ AttachTime *time.Time `locationName:"attachTime" type:"timestamp"`
// The ID of the network interface attachment.
AttachmentId *string `locationName:"attachmentId" type:"string"`
@@ -57125,6 +77209,144 @@ func (s *NewDhcpConfiguration) SetValues(v []*string) *NewDhcpConfiguration {
return s
}
+// Describes the configuration of On-Demand Instances in an EC2 Fleet.
+type OnDemandOptions struct {
+ _ struct{} `type:"structure"`
+
+ // The order of the launch template overrides to use in fulfilling On-Demand
+ // capacity. If you specify lowest-price, EC2 Fleet uses price to determine
+ // the order, launching the lowest price first. If you specify prioritized,
+ // EC2 Fleet uses the priority that you assigned to each launch template override,
+ // launching the highest priority first. If you do not specify a value, EC2
+ // Fleet defaults to lowest-price.
+ AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"FleetOnDemandAllocationStrategy"`
+
+ // The maximum amount per hour for On-Demand Instances that you're willing to
+ // pay.
+ 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.
+ MinTargetCapacity *int64 `locationName:"minTargetCapacity" type:"integer"`
+
+ // Indicates that the fleet launches all On-Demand Instances into a single Availability
+ // Zone.
+ SingleAvailabilityZone *bool `locationName:"singleAvailabilityZone" type:"boolean"`
+
+ // Indicates that the fleet uses a single instance type to launch all On-Demand
+ // Instances in the fleet.
+ SingleInstanceType *bool `locationName:"singleInstanceType" type:"boolean"`
+}
+
+// String returns the string representation
+func (s OnDemandOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s OnDemandOptions) GoString() string {
+ return s.String()
+}
+
+// SetAllocationStrategy sets the AllocationStrategy field's value.
+func (s *OnDemandOptions) SetAllocationStrategy(v string) *OnDemandOptions {
+ s.AllocationStrategy = &v
+ return s
+}
+
+// SetMaxTotalPrice sets the MaxTotalPrice field's value.
+func (s *OnDemandOptions) SetMaxTotalPrice(v string) *OnDemandOptions {
+ s.MaxTotalPrice = &v
+ return s
+}
+
+// SetMinTargetCapacity sets the MinTargetCapacity field's value.
+func (s *OnDemandOptions) SetMinTargetCapacity(v int64) *OnDemandOptions {
+ s.MinTargetCapacity = &v
+ return s
+}
+
+// SetSingleAvailabilityZone sets the SingleAvailabilityZone field's value.
+func (s *OnDemandOptions) SetSingleAvailabilityZone(v bool) *OnDemandOptions {
+ s.SingleAvailabilityZone = &v
+ return s
+}
+
+// SetSingleInstanceType sets the SingleInstanceType field's value.
+func (s *OnDemandOptions) SetSingleInstanceType(v bool) *OnDemandOptions {
+ s.SingleInstanceType = &v
+ return s
+}
+
+// Describes the configuration of On-Demand Instances in an EC2 Fleet.
+type OnDemandOptionsRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The order of the launch template overrides to use in fulfilling On-Demand
+ // capacity. If you specify lowest-price, EC2 Fleet uses price to determine
+ // the order, launching the lowest price first. If you specify prioritized,
+ // EC2 Fleet uses the priority that you assigned to each launch template override,
+ // launching the highest priority first. If you do not specify a value, EC2
+ // Fleet defaults to lowest-price.
+ AllocationStrategy *string `type:"string" enum:"FleetOnDemandAllocationStrategy"`
+
+ // The maximum amount per hour for On-Demand Instances that you're willing to
+ // pay.
+ 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.
+ MinTargetCapacity *int64 `type:"integer"`
+
+ // Indicates that the fleet launches all On-Demand Instances into a single Availability
+ // Zone.
+ SingleAvailabilityZone *bool `type:"boolean"`
+
+ // Indicates that the fleet uses a single instance type to launch all On-Demand
+ // Instances in the fleet.
+ SingleInstanceType *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s OnDemandOptionsRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s OnDemandOptionsRequest) GoString() string {
+ return s.String()
+}
+
+// SetAllocationStrategy sets the AllocationStrategy field's value.
+func (s *OnDemandOptionsRequest) SetAllocationStrategy(v string) *OnDemandOptionsRequest {
+ s.AllocationStrategy = &v
+ return s
+}
+
+// SetMaxTotalPrice sets the MaxTotalPrice field's value.
+func (s *OnDemandOptionsRequest) SetMaxTotalPrice(v string) *OnDemandOptionsRequest {
+ s.MaxTotalPrice = &v
+ return s
+}
+
+// SetMinTargetCapacity sets the MinTargetCapacity field's value.
+func (s *OnDemandOptionsRequest) SetMinTargetCapacity(v int64) *OnDemandOptionsRequest {
+ s.MinTargetCapacity = &v
+ return s
+}
+
+// SetSingleAvailabilityZone sets the SingleAvailabilityZone field's value.
+func (s *OnDemandOptionsRequest) SetSingleAvailabilityZone(v bool) *OnDemandOptionsRequest {
+ s.SingleAvailabilityZone = &v
+ return s
+}
+
+// SetSingleInstanceType sets the SingleInstanceType field's value.
+func (s *OnDemandOptionsRequest) SetSingleInstanceType(v bool) *OnDemandOptionsRequest {
+ s.SingleInstanceType = &v
+ return s
+}
+
// Describes the data that identifies an Amazon FPGA image (AFI) on the PCI
// bus.
type PciId struct {
@@ -57186,11 +77408,11 @@ type PeeringConnectionOptions struct {
AllowDnsResolutionFromRemoteVpc *bool `locationName:"allowDnsResolutionFromRemoteVpc" type:"boolean"`
// If true, enables outbound communication from an EC2-Classic instance that's
- // linked to a local VPC via ClassicLink to instances in a peer VPC.
+ // linked to a local VPC using ClassicLink to instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc *bool `locationName:"allowEgressFromLocalClassicLinkToRemoteVpc" type:"boolean"`
// If true, enables outbound communication from instances in a local VPC to
- // an EC2-Classic instance that's linked to a peer VPC via ClassicLink.
+ // an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
AllowEgressFromLocalVpcToRemoteClassicLink *bool `locationName:"allowEgressFromLocalVpcToRemoteClassicLink" type:"boolean"`
}
@@ -57231,11 +77453,11 @@ type PeeringConnectionOptionsRequest struct {
AllowDnsResolutionFromRemoteVpc *bool `type:"boolean"`
// If true, enables outbound communication from an EC2-Classic instance that's
- // linked to a local VPC via ClassicLink to instances in a peer VPC.
+ // linked to a local VPC using ClassicLink to instances in a peer VPC.
AllowEgressFromLocalClassicLinkToRemoteVpc *bool `type:"boolean"`
// If true, enables outbound communication from instances in a local VPC to
- // an EC2-Classic instance that's linked to a peer VPC via ClassicLink.
+ // an EC2-Classic instance that's linked to a peer VPC using ClassicLink.
AllowEgressFromLocalVpcToRemoteClassicLink *bool `type:"boolean"`
}
@@ -57276,15 +77498,22 @@ type Placement struct {
Affinity *string `locationName:"affinity" type:"string"`
// The Availability Zone of the instance.
+ //
+ // If not specified, an Availability Zone will be automatically chosen for you
+ // based on the load balancing criteria for the Region.
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
- // The name of the placement group the instance is in (for cluster compute instances).
+ // The name of the placement group the instance is in.
GroupName *string `locationName:"groupName" type:"string"`
// The ID of the Dedicated Host on which the instance resides. This parameter
// is not supported for the ImportInstance command.
HostId *string `locationName:"hostId" type:"string"`
+ // The number of the partition the instance is in. Valid only if the placement
+ // group strategy is set to partition.
+ PartitionNumber *int64 `locationName:"partitionNumber" type:"integer"`
+
// Reserved for future use.
SpreadDomain *string `locationName:"spreadDomain" type:"string"`
@@ -57328,6 +77557,12 @@ func (s *Placement) SetHostId(v string) *Placement {
return s
}
+// SetPartitionNumber sets the PartitionNumber field's value.
+func (s *Placement) SetPartitionNumber(v int64) *Placement {
+ s.PartitionNumber = &v
+ return s
+}
+
// SetSpreadDomain sets the SpreadDomain field's value.
func (s *Placement) SetSpreadDomain(v string) *Placement {
s.SpreadDomain = &v
@@ -57347,6 +77582,9 @@ type PlacementGroup struct {
// The name of the placement group.
GroupName *string `locationName:"groupName" type:"string"`
+ // The number of partitions. Valid only if strategy is set to partition.
+ PartitionCount *int64 `locationName:"partitionCount" type:"integer"`
+
// The state of the placement group.
State *string `locationName:"state" type:"string" enum:"PlacementGroupState"`
@@ -57370,6 +77608,12 @@ func (s *PlacementGroup) SetGroupName(v string) *PlacementGroup {
return s
}
+// SetPartitionCount sets the PartitionCount field's value.
+func (s *PlacementGroup) SetPartitionCount(v int64) *PlacementGroup {
+ s.PartitionCount = &v
+ return s
+}
+
// SetState sets the State field's value.
func (s *PlacementGroup) SetState(v string) *PlacementGroup {
s.State = &v
@@ -57382,6 +77626,30 @@ func (s *PlacementGroup) SetStrategy(v string) *PlacementGroup {
return s
}
+// Describes the placement of an instance.
+type PlacementResponse struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the placement group the instance is in.
+ GroupName *string `locationName:"groupName" type:"string"`
+}
+
+// String returns the string representation
+func (s PlacementResponse) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PlacementResponse) GoString() string {
+ return s.String()
+}
+
+// SetGroupName sets the GroupName field's value.
+func (s *PlacementResponse) SetGroupName(v string) *PlacementResponse {
+ s.GroupName = &v
+ return s
+}
+
// Describes a range of ports.
type PortRange struct {
_ struct{} `type:"structure"`
@@ -57457,7 +77725,7 @@ func (s *PrefixList) SetPrefixListName(v string) *PrefixList {
return s
}
-// [EC2-VPC only] The ID of the prefix.
+// Describes a prefix list ID.
type PrefixListId struct {
_ struct{} `type:"structure"`
@@ -57675,9 +77943,7 @@ type PrivateIpAddressSpecification struct {
Primary *bool `locationName:"primary" type:"boolean"`
// The private IPv4 addresses.
- //
- // PrivateIpAddress is a required field
- PrivateIpAddress *string `locationName:"privateIpAddress" type:"string" required:"true"`
+ PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
}
// String returns the string representation
@@ -57690,19 +77956,6 @@ func (s PrivateIpAddressSpecification) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *PrivateIpAddressSpecification) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "PrivateIpAddressSpecification"}
- if s.PrivateIpAddress == nil {
- invalidParams.Add(request.NewErrParamRequired("PrivateIpAddress"))
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetPrimary sets the Primary field's value.
func (s *PrivateIpAddressSpecification) SetPrimary(v bool) *PrivateIpAddressSpecification {
s.Primary = &v
@@ -57752,7 +78005,7 @@ func (s *ProductCode) SetProductCodeType(v string) *ProductCode {
type PropagatingVgw struct {
_ struct{} `type:"structure"`
- // The ID of the virtual private gateway (VGW).
+ // The ID of the virtual private gateway.
GatewayId *string `locationName:"gatewayId" type:"string"`
}
@@ -57772,34 +78025,133 @@ func (s *PropagatingVgw) SetGatewayId(v string) *PropagatingVgw {
return s
}
+type ProvisionByoipCidrInput struct {
+ _ struct{} `type:"structure"`
+
+ // The public IPv4 address range, in CIDR notation. The most specific prefix
+ // that you can specify is /24. 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"`
+
+ // A signed document that proves that you are authorized to bring the specified
+ // IP address range to Amazon using BYOIP.
+ CidrAuthorizationContext *CidrAuthorizationContext `type:"structure"`
+
+ // A description for the address range and the address pool.
+ Description *string `type:"string"`
+
+ // 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
+func (s ProvisionByoipCidrInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ProvisionByoipCidrInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ProvisionByoipCidrInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ProvisionByoipCidrInput"}
+ if s.Cidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cidr"))
+ }
+ if s.CidrAuthorizationContext != nil {
+ if err := s.CidrAuthorizationContext.Validate(); err != nil {
+ invalidParams.AddNested("CidrAuthorizationContext", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCidr sets the Cidr field's value.
+func (s *ProvisionByoipCidrInput) SetCidr(v string) *ProvisionByoipCidrInput {
+ s.Cidr = &v
+ return s
+}
+
+// SetCidrAuthorizationContext sets the CidrAuthorizationContext field's value.
+func (s *ProvisionByoipCidrInput) SetCidrAuthorizationContext(v *CidrAuthorizationContext) *ProvisionByoipCidrInput {
+ s.CidrAuthorizationContext = v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *ProvisionByoipCidrInput) SetDescription(v string) *ProvisionByoipCidrInput {
+ s.Description = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ProvisionByoipCidrInput) SetDryRun(v bool) *ProvisionByoipCidrInput {
+ s.DryRun = &v
+ return s
+}
+
+type ProvisionByoipCidrOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the address pool.
+ ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"`
+}
+
+// String returns the string representation
+func (s ProvisionByoipCidrOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ProvisionByoipCidrOutput) GoString() string {
+ return s.String()
+}
+
+// SetByoipCidr sets the ByoipCidr field's value.
+func (s *ProvisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *ProvisionByoipCidrOutput {
+ s.ByoipCidr = v
+ return s
+}
+
// Reserved. If you need to sustain traffic greater than the documented limits
-// (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+// (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?).
type ProvisionedBandwidth struct {
_ struct{} `type:"structure"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
- ProvisionTime *time.Time `locationName:"provisionTime" type:"timestamp" timestampFormat:"iso8601"`
+ ProvisionTime *time.Time `locationName:"provisionTime" type:"timestamp"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
Provisioned *string `locationName:"provisioned" type:"string"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
- RequestTime *time.Time `locationName:"requestTime" type:"timestamp" timestampFormat:"iso8601"`
+ RequestTime *time.Time `locationName:"requestTime" type:"timestamp"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
Requested *string `locationName:"requested" type:"string"`
// Reserved. If you need to sustain traffic greater than the documented limits
- // (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html),
+ // (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?).
Status *string `locationName:"status" type:"string"`
}
@@ -57844,6 +78196,117 @@ func (s *ProvisionedBandwidth) SetStatus(v string) *ProvisionedBandwidth {
return s
}
+// Describes an address pool.
+type PublicIpv4Pool struct {
+ _ struct{} `type:"structure"`
+
+ // A description of the address pool.
+ Description *string `locationName:"description" type:"string"`
+
+ // The address ranges.
+ PoolAddressRanges []*PublicIpv4PoolRange `locationName:"poolAddressRangeSet" locationNameList:"item" type:"list"`
+
+ // The ID of the IPv4 address pool.
+ PoolId *string `locationName:"poolId" type:"string"`
+
+ // The total number of addresses.
+ TotalAddressCount *int64 `locationName:"totalAddressCount" type:"integer"`
+
+ // The total number of available addresses.
+ TotalAvailableAddressCount *int64 `locationName:"totalAvailableAddressCount" type:"integer"`
+}
+
+// String returns the string representation
+func (s PublicIpv4Pool) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PublicIpv4Pool) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *PublicIpv4Pool) SetDescription(v string) *PublicIpv4Pool {
+ s.Description = &v
+ return s
+}
+
+// SetPoolAddressRanges sets the PoolAddressRanges field's value.
+func (s *PublicIpv4Pool) SetPoolAddressRanges(v []*PublicIpv4PoolRange) *PublicIpv4Pool {
+ s.PoolAddressRanges = v
+ return s
+}
+
+// SetPoolId sets the PoolId field's value.
+func (s *PublicIpv4Pool) SetPoolId(v string) *PublicIpv4Pool {
+ s.PoolId = &v
+ return s
+}
+
+// SetTotalAddressCount sets the TotalAddressCount field's value.
+func (s *PublicIpv4Pool) SetTotalAddressCount(v int64) *PublicIpv4Pool {
+ s.TotalAddressCount = &v
+ return s
+}
+
+// SetTotalAvailableAddressCount sets the TotalAvailableAddressCount field's value.
+func (s *PublicIpv4Pool) SetTotalAvailableAddressCount(v int64) *PublicIpv4Pool {
+ s.TotalAvailableAddressCount = &v
+ return s
+}
+
+// Describes an address range of an IPv4 address pool.
+type PublicIpv4PoolRange struct {
+ _ struct{} `type:"structure"`
+
+ // The number of addresses in the range.
+ AddressCount *int64 `locationName:"addressCount" type:"integer"`
+
+ // The number of available addresses in the range.
+ AvailableAddressCount *int64 `locationName:"availableAddressCount" type:"integer"`
+
+ // The first IP address in the range.
+ FirstAddress *string `locationName:"firstAddress" type:"string"`
+
+ // The last IP address in the range.
+ LastAddress *string `locationName:"lastAddress" type:"string"`
+}
+
+// String returns the string representation
+func (s PublicIpv4PoolRange) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PublicIpv4PoolRange) GoString() string {
+ return s.String()
+}
+
+// SetAddressCount sets the AddressCount field's value.
+func (s *PublicIpv4PoolRange) SetAddressCount(v int64) *PublicIpv4PoolRange {
+ s.AddressCount = &v
+ return s
+}
+
+// SetAvailableAddressCount sets the AvailableAddressCount field's value.
+func (s *PublicIpv4PoolRange) SetAvailableAddressCount(v int64) *PublicIpv4PoolRange {
+ s.AvailableAddressCount = &v
+ return s
+}
+
+// SetFirstAddress sets the FirstAddress field's value.
+func (s *PublicIpv4PoolRange) SetFirstAddress(v string) *PublicIpv4PoolRange {
+ s.FirstAddress = &v
+ return s
+}
+
+// SetLastAddress sets the LastAddress field's value.
+func (s *PublicIpv4PoolRange) SetLastAddress(v string) *PublicIpv4PoolRange {
+ s.LastAddress = &v
+ return s
+}
+
// Describes the result of the purchase.
type Purchase struct {
_ struct{} `type:"structure"`
@@ -57936,17 +78399,15 @@ func (s *Purchase) SetUpfrontPrice(v string) *Purchase {
type PurchaseHostReservationInput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure idempotency of the
- // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
- // in the Amazon Elastic Compute Cloud User Guide.
+ // 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).
ClientToken *string `type:"string"`
// The currency in which the totalUpfrontPrice, LimitPrice, and totalHourlyPrice
// amounts are specified. At this time, the only supported currency is USD.
CurrencyCode *string `type:"string" enum:"CurrencyCodeValues"`
- // The ID/s of the Dedicated Host/s that the reservation will be associated
- // with.
+ // The IDs of the Dedicated Hosts with which the reservation will be associated.
//
// HostIdSet is a required field
HostIdSet []*string `locationNameList:"item" type:"list" required:"true"`
@@ -57954,10 +78415,9 @@ type PurchaseHostReservationInput struct {
// The specified limit is checked against the total upfront cost of the reservation
// (calculated as the offering's upfront cost multiplied by the host count).
// If the total upfront cost is greater than the specified price limit, the
- // request will fail. This is used to ensure that the purchase does not exceed
- // the expected upfront cost of the purchase. At this time, the only supported
- // currency is USD. For example, to indicate a limit price of USD 100, specify
- // 100.00.
+ // request fails. This is used to ensure that the purchase does not exceed the
+ // expected upfront cost of the purchase. At this time, the only supported currency
+ // is USD. For example, to indicate a limit price of USD 100, specify 100.00.
LimitPrice *string `type:"string"`
// The ID of the offering.
@@ -58025,9 +78485,8 @@ func (s *PurchaseHostReservationInput) SetOfferingId(v string) *PurchaseHostRese
type PurchaseHostReservationOutput struct {
_ struct{} `type:"structure"`
- // Unique, case-sensitive identifier you provide to ensure idempotency of the
- // request. For more information, see How to Ensure Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
- // in the Amazon Elastic Compute Cloud User Guide
+ // 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).
ClientToken *string `locationName:"clientToken" type:"string"`
// The currency in which the totalUpfrontPrice and totalHourlyPrice amounts
@@ -58040,8 +78499,7 @@ type PurchaseHostReservationOutput struct {
// The total hourly price of the reservation calculated per hour.
TotalHourlyPrice *string `locationName:"totalHourlyPrice" type:"string"`
- // The total amount that will be charged to your account when you purchase the
- // reservation.
+ // The total amount charged to your account when you purchase the reservation.
TotalUpfrontPrice *string `locationName:"totalUpfrontPrice" type:"string"`
}
@@ -58243,7 +78701,7 @@ type PurchaseScheduledInstancesInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that ensures the idempotency of the request.
- // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -58252,7 +78710,7 @@ type PurchaseScheduledInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `type:"boolean"`
- // One or more purchase requests.
+ // The purchase requests.
//
// PurchaseRequests is a required field
PurchaseRequests []*PurchaseRequest `locationName:"PurchaseRequest" locationNameList:"PurchaseRequest" min:"1" type:"list" required:"true"`
@@ -58336,7 +78794,6 @@ func (s *PurchaseScheduledInstancesOutput) SetScheduledInstanceSet(v []*Schedule
return s
}
-// Contains the parameters for RebootInstances.
type RebootInstancesInput struct {
_ struct{} `type:"structure"`
@@ -58346,7 +78803,7 @@ type RebootInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more instance IDs.
+ // The instance IDs.
//
// InstanceIds is a required field
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"`
@@ -58434,14 +78891,18 @@ func (s *RecurringCharge) SetFrequency(v string) *RecurringCharge {
return s
}
-// Describes a region.
+// Describes a Region.
type Region struct {
_ struct{} `type:"structure"`
- // The region service endpoint.
+ // The Region service endpoint.
Endpoint *string `locationName:"regionEndpoint" type:"string"`
- // The name of the region.
+ // The Region opt-in status. The possible values are opt-in-not-required, opted-in,
+ // and not-opted-in.
+ OptInStatus *string `locationName:"optInStatus" type:"string"`
+
+ // The name of the Region.
RegionName *string `locationName:"regionName" type:"string"`
}
@@ -58461,6 +78922,12 @@ func (s *Region) SetEndpoint(v string) *Region {
return s
}
+// SetOptInStatus sets the OptInStatus field's value.
+func (s *Region) SetOptInStatus(v string) *Region {
+ s.OptInStatus = &v
+ return s
+}
+
// SetRegionName sets the RegionName field's value.
func (s *Region) SetRegionName(v string) *Region {
s.RegionName = &v
@@ -58482,7 +78949,7 @@ type RegisterImageInput struct {
// use of an AMI.
BillingProducts []*string `locationName:"BillingProduct" locationNameList:"item" type:"list"`
- // One or more block device mapping entries.
+ // The block device mapping entries.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
// A description for your AMI.
@@ -58501,7 +78968,10 @@ type RegisterImageInput struct {
// PV AMI can make instances launched from the AMI unreachable.
EnaSupport *bool `locationName:"enaSupport" type:"boolean"`
- // The full path to your AMI manifest in Amazon S3 storage.
+ // The full path to your AMI manifest in Amazon S3 storage. The specified bucket
+ // must have the aws-exec-read canned access control list (ACL) to ensure that
+ // it can be accessed by Amazon EC2. For more information, see Canned ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl)
+ // in the Amazon S3 Service Developer Guide.
ImageLocation *string `type:"string"`
// The ID of the kernel.
@@ -58663,6 +79133,79 @@ func (s *RegisterImageOutput) SetImageId(v string) *RegisterImageOutput {
return s
}
+type RejectTransitGatewayVpcAttachmentInput 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 attachment.
+ //
+ // TransitGatewayAttachmentId is a required field
+ TransitGatewayAttachmentId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s RejectTransitGatewayVpcAttachmentInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RejectTransitGatewayVpcAttachmentInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *RejectTransitGatewayVpcAttachmentInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "RejectTransitGatewayVpcAttachmentInput"}
+ if s.TransitGatewayAttachmentId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *RejectTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *RejectTransitGatewayVpcAttachmentInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *RejectTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *RejectTransitGatewayVpcAttachmentInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+type RejectTransitGatewayVpcAttachmentOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the attachment.
+ TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"`
+}
+
+// String returns the string representation
+func (s RejectTransitGatewayVpcAttachmentOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RejectTransitGatewayVpcAttachmentOutput) GoString() string {
+ return s.String()
+}
+
+// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value.
+func (s *RejectTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *RejectTransitGatewayVpcAttachmentOutput {
+ s.TransitGatewayVpcAttachment = v
+ return s
+}
+
type RejectVpcEndpointConnectionsInput struct {
_ struct{} `type:"structure"`
@@ -58750,7 +79293,6 @@ func (s *RejectVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulIt
return s
}
-// Contains the parameters for RejectVpcPeeringConnection.
type RejectVpcPeeringConnectionInput struct {
_ struct{} `type:"structure"`
@@ -58801,7 +79343,6 @@ func (s *RejectVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *R
return s
}
-// Contains the output of RejectVpcPeeringConnection.
type RejectVpcPeeringConnectionOutput struct {
_ struct{} `type:"structure"`
@@ -58825,7 +79366,6 @@ func (s *RejectVpcPeeringConnectionOutput) SetReturn(v bool) *RejectVpcPeeringCo
return s
}
-// Contains the parameters for ReleaseAddress.
type ReleaseAddressInput struct {
_ struct{} `type:"structure"`
@@ -58884,11 +79424,10 @@ func (s ReleaseAddressOutput) GoString() string {
return s.String()
}
-// Contains the parameters for ReleaseHosts.
type ReleaseHostsInput struct {
_ struct{} `type:"structure"`
- // The IDs of the Dedicated Hosts you want to release.
+ // The IDs of the Dedicated Hosts to release.
//
// HostIds is a required field
HostIds []*string `locationName:"hostId" locationNameList:"item" type:"list" required:"true"`
@@ -58923,7 +79462,6 @@ func (s *ReleaseHostsInput) SetHostIds(v []*string) *ReleaseHostsInput {
return s
}
-// Contains the output of ReleaseHosts.
type ReleaseHostsOutput struct {
_ struct{} `type:"structure"`
@@ -59032,7 +79570,6 @@ func (s *ReplaceIamInstanceProfileAssociationOutput) SetIamInstanceProfileAssoci
return s
}
-// Contains the parameters for ReplaceNetworkAclAssociation.
type ReplaceNetworkAclAssociationInput struct {
_ struct{} `type:"structure"`
@@ -59098,7 +79635,6 @@ func (s *ReplaceNetworkAclAssociationInput) SetNetworkAclId(v string) *ReplaceNe
return s
}
-// Contains the output of ReplaceNetworkAclAssociation.
type ReplaceNetworkAclAssociationOutput struct {
_ struct{} `type:"structure"`
@@ -59122,7 +79658,6 @@ func (s *ReplaceNetworkAclAssociationOutput) SetNewAssociationId(v string) *Repl
return s
}
-// Contains the parameters for ReplaceNetworkAclEntry.
type ReplaceNetworkAclEntryInput struct {
_ struct{} `type:"structure"`
@@ -59142,8 +79677,8 @@ type ReplaceNetworkAclEntryInput struct {
// Egress is a required field
Egress *bool `locationName:"egress" type:"boolean" required:"true"`
- // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying the
- // ICMP (1) protocol, or protocol 58 (ICMPv6) with an IPv6 CIDR block.
+ // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol
+ // 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block.
IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"`
// The IPv6 network range to allow or deny, in CIDR notation (for example 2001:bd8:1234:1a00::/64).
@@ -59155,16 +79690,16 @@ type ReplaceNetworkAclEntryInput struct {
NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"`
// TCP or UDP protocols: The range of ports the rule applies to. Required if
- // specifying TCP (6) or UDP (17) for the protocol.
+ // specifying protocol 6 (TCP) or 17 (UDP).
PortRange *PortRange `locationName:"portRange" type:"structure"`
- // The IP protocol. You can specify all or -1 to mean all protocols. If you
- // specify all, -1, or a protocol number other than tcp, udp, or icmp, traffic
- // on all ports is allowed, regardless of any ports or ICMP types or codes you
- // specify. If you specify protocol 58 (ICMPv6) and specify an IPv4 CIDR block,
- // traffic for all ICMP types and codes allowed, regardless of any that you
- // specify. If you specify protocol 58 (ICMPv6) and specify an IPv6 CIDR block,
- // you must specify an ICMP type and code.
+ // The protocol number. A value of "-1" means all protocols. If you specify
+ // "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP),
+ // traffic on all ports is allowed, regardless of any ports or ICMP types or
+ // codes that you specify. If you specify protocol "58" (ICMPv6) and specify
+ // an IPv4 CIDR block, traffic for all ICMP types and codes allowed, regardless
+ // of any that you specify. If you specify protocol "58" (ICMPv6) and specify
+ // an IPv6 CIDR block, you must specify an ICMP type and code.
//
// Protocol is a required field
Protocol *string `locationName:"protocol" type:"string" required:"true"`
@@ -59289,16 +79824,15 @@ func (s ReplaceNetworkAclEntryOutput) GoString() string {
return s.String()
}
-// Contains the parameters for ReplaceRoute.
type ReplaceRouteInput struct {
_ struct{} `type:"structure"`
- // The IPv4 CIDR address block used for the destination match. The value you
- // provide must match the CIDR of an existing route in the table.
+ // The IPv4 CIDR address block used for the destination match. The value that
+ // you provide must match the CIDR of an existing route in the table.
DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"`
- // The IPv6 CIDR address block used for the destination match. The value you
- // provide must match the CIDR of an existing route in the table.
+ // The IPv6 CIDR address block used for the destination match. The value that
+ // you provide must match the CIDR of an existing route in the table.
DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"`
// Checks whether you have the required permissions for the action, without
@@ -59307,10 +79841,10 @@ type ReplaceRouteInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // [IPv6 traffic only] The ID of an egress-only Internet gateway.
+ // [IPv6 traffic only] The ID of an egress-only internet gateway.
EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"`
- // The ID of an Internet gateway or virtual private gateway.
+ // The ID of an internet gateway or virtual private gateway.
GatewayId *string `locationName:"gatewayId" type:"string"`
// The ID of a NAT instance in your VPC.
@@ -59327,6 +79861,9 @@ type ReplaceRouteInput struct {
// RouteTableId is a required field
RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"`
+ // The ID of a transit gateway.
+ TransitGatewayId *string `type:"string"`
+
// The ID of a VPC peering connection.
VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"`
}
@@ -59408,6 +79945,12 @@ func (s *ReplaceRouteInput) SetRouteTableId(v string) *ReplaceRouteInput {
return s
}
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *ReplaceRouteInput) SetTransitGatewayId(v string) *ReplaceRouteInput {
+ s.TransitGatewayId = &v
+ return s
+}
+
// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value.
func (s *ReplaceRouteInput) SetVpcPeeringConnectionId(v string) *ReplaceRouteInput {
s.VpcPeeringConnectionId = &v
@@ -59428,7 +79971,6 @@ func (s ReplaceRouteOutput) GoString() string {
return s.String()
}
-// Contains the parameters for ReplaceRouteTableAssociation.
type ReplaceRouteTableAssociationInput struct {
_ struct{} `type:"structure"`
@@ -59493,7 +80035,6 @@ func (s *ReplaceRouteTableAssociationInput) SetRouteTableId(v string) *ReplaceRo
return s
}
-// Contains the output of ReplaceRouteTableAssociation.
type ReplaceRouteTableAssociationOutput struct {
_ struct{} `type:"structure"`
@@ -59517,7 +80058,112 @@ func (s *ReplaceRouteTableAssociationOutput) SetNewAssociationId(v string) *Repl
return s
}
-// Contains the parameters for ReportInstanceStatus.
+type ReplaceTransitGatewayRouteInput struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether traffic matching this route is to be dropped.
+ Blackhole *bool `type:"boolean"`
+
+ // The CIDR range used for the destination match. Routing decisions are based
+ // on the most specific match.
+ //
+ // DestinationCidrBlock is a required field
+ DestinationCidrBlock *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `type:"string"`
+
+ // The ID of the route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ReplaceTransitGatewayRouteInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ReplaceTransitGatewayRouteInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ReplaceTransitGatewayRouteInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ReplaceTransitGatewayRouteInput"}
+ if s.DestinationCidrBlock == nil {
+ invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock"))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetBlackhole sets the Blackhole field's value.
+func (s *ReplaceTransitGatewayRouteInput) SetBlackhole(v bool) *ReplaceTransitGatewayRouteInput {
+ s.Blackhole = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *ReplaceTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *ReplaceTransitGatewayRouteInput {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ReplaceTransitGatewayRouteInput) SetDryRun(v bool) *ReplaceTransitGatewayRouteInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *ReplaceTransitGatewayRouteInput) SetTransitGatewayAttachmentId(v string) *ReplaceTransitGatewayRouteInput {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *ReplaceTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *ReplaceTransitGatewayRouteInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type ReplaceTransitGatewayRouteOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the modified route.
+ Route *TransitGatewayRoute `locationName:"route" type:"structure"`
+}
+
+// String returns the string representation
+func (s ReplaceTransitGatewayRouteOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ReplaceTransitGatewayRouteOutput) GoString() string {
+ return s.String()
+}
+
+// SetRoute sets the Route field's value.
+func (s *ReplaceTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *ReplaceTransitGatewayRouteOutput {
+ s.Route = v
+ return s
+}
+
type ReportInstanceStatusInput struct {
_ struct{} `type:"structure"`
@@ -59531,14 +80177,14 @@ type ReportInstanceStatusInput struct {
DryRun *bool `locationName:"dryRun" type:"boolean"`
// The time at which the reported instance health state ended.
- EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"`
+ EndTime *time.Time `locationName:"endTime" type:"timestamp"`
- // One or more instances.
+ // The instances.
//
// Instances is a required field
Instances []*string `locationName:"instanceId" locationNameList:"InstanceId" type:"list" required:"true"`
- // One or more reason codes that describe the health state of your instance.
+ // The reason codes that describe the health state of your instance.
//
// * instance-stuck-in-state: My instance is stuck in a state.
//
@@ -59565,7 +80211,7 @@ type ReportInstanceStatusInput struct {
ReasonCodes []*string `locationName:"reasonCode" locationNameList:"item" type:"list" required:"true"`
// The time at which the reported instance health state began.
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// The status of all instances listed.
//
@@ -59671,11 +80317,26 @@ type RequestLaunchTemplateData struct {
// cannot be changed using this action.
BlockDeviceMappings []*LaunchTemplateBlockDeviceMappingRequest `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
- // The credit option for CPU usage of the instance. Valid for T2 instances only.
+ // The Capacity Reservation targeting option. If you do not specify this parameter,
+ // the instance's Capacity Reservation preference defaults to open, which enables
+ // it to run in any open Capacity Reservation that has matching attributes (instance
+ // 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.
+ CpuOptions *LaunchTemplateCpuOptionsRequest `type:"structure"`
+
+ // The credit option for CPU usage of the instance. Valid for T2 or T3 instances
+ // only.
CreditSpecification *CreditSpecificationRequest `type:"structure"`
- // If set to true, you can't terminate the instance using the Amazon EC2 console,
- // CLI, or API. To change this attribute to false after launch, use ModifyInstanceAttribute.
+ // If you set this parameter to true, you can't terminate the instance using
+ // the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute
+ // after launch, use ModifyInstanceAttribute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html).
+ // Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate,
+ // you can terminate the instance by running the shutdown command from the instance.
DisableApiTermination *bool `type:"boolean"`
// Indicates whether the instance is optimized for Amazon EBS I/O. This optimization
@@ -59688,10 +80349,20 @@ type RequestLaunchTemplateData struct {
// An elastic GPU to associate with the instance.
ElasticGpuSpecifications []*ElasticGpuSpecification `locationName:"ElasticGpuSpecification" locationNameList:"ElasticGpuSpecification" type:"list"`
+ // The elastic inference accelerator for the instance.
+ ElasticInferenceAccelerators []*LaunchTemplateElasticInferenceAccelerator `locationName:"ElasticInferenceAccelerator" locationNameList:"item" type:"list"`
+
+ // 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/Hibernate.html#hibernating-prerequisites).
+ // Hibernation is currently supported only for Amazon Linux. 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.
+ HibernationOptions *LaunchTemplateHibernationOptionsRequest `type:"structure"`
+
// The IAM instance profile.
IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecificationRequest `type:"structure"`
- // The ID of the AMI, which you can get by using DescribeImages.
+ // The ID of the AMI.
ImageId *string `type:"string"`
// Indicates whether an instance stops or terminates when you initiate shutdown
@@ -59703,28 +80374,32 @@ type RequestLaunchTemplateData struct {
// The market (purchasing) option for the instances.
InstanceMarketOptions *LaunchTemplateInstanceMarketOptionsRequest `type:"structure"`
- // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // 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.
InstanceType *string `type:"string" enum:"InstanceType"`
// The ID of the kernel.
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
- // information, see User Provided Kernels (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
+ // information, see User Provided Kernels (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
// in the Amazon Elastic Compute Cloud User Guide.
KernelId *string `type:"string"`
- // The name of the key pair. You can create a key pair using CreateKeyPair or
- // ImportKeyPair.
+ // 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)
+ // or ImportKeyPair (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html).
//
// If you do not specify a key pair, you can't connect to the instance unless
// you choose an AMI that is configured to allow users another way to log in.
KeyName *string `type:"string"`
+ // The license configurations.
+ LicenseSpecifications []*LaunchTemplateLicenseConfigurationRequest `locationName:"LicenseSpecification" locationNameList:"item" type:"list"`
+
// The monitoring for the instance.
Monitoring *LaunchTemplatesMonitoringRequest `type:"structure"`
- // One or more network interfaces.
+ // 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.
NetworkInterfaces []*LaunchTemplateInstanceNetworkInterfaceSpecificationRequest `locationName:"NetworkInterface" locationNameList:"InstanceNetworkInterfaceSpecification" type:"list"`
// The placement for the instance.
@@ -59733,11 +80408,12 @@ type RequestLaunchTemplateData struct {
// The ID of the RAM disk.
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
- // information, see User Provided Kernels (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
+ // information, see User Provided Kernels (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
// in the Amazon Elastic Compute Cloud User Guide.
RamDiskId *string `type:"string"`
- // One or more security group IDs. You can create a security group using CreateSecurityGroup.
+ // 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).
// You cannot specify both a security group ID and security name in the same
// request.
SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
@@ -59747,14 +80423,15 @@ type RequestLaunchTemplateData struct {
// group ID and security name in the same request.
SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"`
- // The tags to apply to the resources during launch. You can tag instances and
- // volumes. The specified tags are applied to all instances or volumes that
- // are created during launch.
+ // The tags to apply to the resources during launch. You can only tag instances
+ // and volumes on launch. The specified tags are applied to all instances or
+ // volumes that are created during launch. To tag a resource after it has been
+ // created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html).
TagSpecifications []*LaunchTemplateTagSpecificationRequest `locationName:"TagSpecification" locationNameList:"LaunchTemplateTagSpecificationRequest" type:"list"`
// The Base64-encoded user data to make available to the instance. For more
- // information, see Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
- // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data)
+ // information, see Running Commands on Your Linux Instance at Launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
+ // (Linux) and Adding User Data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data)
// (Windows).
UserData *string `type:"string"`
}
@@ -59787,13 +80464,13 @@ func (s *RequestLaunchTemplateData) Validate() error {
}
}
}
- if s.NetworkInterfaces != nil {
- for i, v := range s.NetworkInterfaces {
+ if s.ElasticInferenceAccelerators != nil {
+ for i, v := range s.ElasticInferenceAccelerators {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams))
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ElasticInferenceAccelerators", i), err.(request.ErrInvalidParams))
}
}
}
@@ -59810,6 +80487,18 @@ func (s *RequestLaunchTemplateData) SetBlockDeviceMappings(v []*LaunchTemplateBl
return s
}
+// SetCapacityReservationSpecification sets the CapacityReservationSpecification field's value.
+func (s *RequestLaunchTemplateData) SetCapacityReservationSpecification(v *LaunchTemplateCapacityReservationSpecificationRequest) *RequestLaunchTemplateData {
+ s.CapacityReservationSpecification = v
+ return s
+}
+
+// SetCpuOptions sets the CpuOptions field's value.
+func (s *RequestLaunchTemplateData) SetCpuOptions(v *LaunchTemplateCpuOptionsRequest) *RequestLaunchTemplateData {
+ s.CpuOptions = v
+ return s
+}
+
// SetCreditSpecification sets the CreditSpecification field's value.
func (s *RequestLaunchTemplateData) SetCreditSpecification(v *CreditSpecificationRequest) *RequestLaunchTemplateData {
s.CreditSpecification = v
@@ -59834,6 +80523,18 @@ func (s *RequestLaunchTemplateData) SetElasticGpuSpecifications(v []*ElasticGpuS
return s
}
+// SetElasticInferenceAccelerators sets the ElasticInferenceAccelerators field's value.
+func (s *RequestLaunchTemplateData) SetElasticInferenceAccelerators(v []*LaunchTemplateElasticInferenceAccelerator) *RequestLaunchTemplateData {
+ s.ElasticInferenceAccelerators = v
+ return s
+}
+
+// SetHibernationOptions sets the HibernationOptions field's value.
+func (s *RequestLaunchTemplateData) SetHibernationOptions(v *LaunchTemplateHibernationOptionsRequest) *RequestLaunchTemplateData {
+ s.HibernationOptions = v
+ return s
+}
+
// SetIamInstanceProfile sets the IamInstanceProfile field's value.
func (s *RequestLaunchTemplateData) SetIamInstanceProfile(v *LaunchTemplateIamInstanceProfileSpecificationRequest) *RequestLaunchTemplateData {
s.IamInstanceProfile = v
@@ -59876,6 +80577,12 @@ func (s *RequestLaunchTemplateData) SetKeyName(v string) *RequestLaunchTemplateD
return s
}
+// SetLicenseSpecifications sets the LicenseSpecifications field's value.
+func (s *RequestLaunchTemplateData) SetLicenseSpecifications(v []*LaunchTemplateLicenseConfigurationRequest) *RequestLaunchTemplateData {
+ s.LicenseSpecifications = v
+ return s
+}
+
// SetMonitoring sets the Monitoring field's value.
func (s *RequestLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoringRequest) *RequestLaunchTemplateData {
s.Monitoring = v
@@ -59985,9 +80692,7 @@ type RequestSpotFleetOutput struct {
_ struct{} `type:"structure"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
}
// String returns the string representation
@@ -60045,7 +80750,7 @@ 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 (http://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/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html)
// in the Amazon EC2 User Guide for Linux Instances.
ClientToken *string `locationName:"clientToken" type:"string"`
@@ -60086,14 +80791,14 @@ type RequestSpotInstancesInput struct {
// launch, the request expires, or the request is canceled. If the request is
// persistent, the request becomes active at this date and time and remains
// active until it expires or is canceled.
- ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"`
+ ValidFrom *time.Time `locationName:"validFrom" type:"timestamp"`
// The end date of the request. If this is a one-time request, the request remains
// active until all instances launch, the request is canceled, or this date
// is reached. If the request is persistent, it remains active until it is canceled
// or this date is reached. The default end date is 7 days from the current
// date.
- ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"`
}
// String returns the string representation
@@ -60280,7 +80985,8 @@ type RequestSpotLaunchSpecification struct {
// The ID of the subnet in which to launch the instance.
SubnetId *string `locationName:"subnetId" type:"string"`
- // The Base64-encoded user data for the instance.
+ // The Base64-encoded user data for the instance. User data is limited to 16
+ // KB.
UserData *string `locationName:"userData" type:"string"`
}
@@ -60302,16 +81008,6 @@ func (s *RequestSpotLaunchSpecification) Validate() error {
invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams))
}
}
- if s.NetworkInterfaces != nil {
- for i, v := range s.NetworkInterfaces {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams))
- }
- }
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -60419,10 +81115,10 @@ func (s *RequestSpotLaunchSpecification) SetUserData(v string) *RequestSpotLaunc
type Reservation struct {
_ struct{} `type:"structure"`
- // [EC2-Classic only] One or more security groups.
+ // [EC2-Classic only] The security groups.
Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"`
- // One or more instances.
+ // The instances.
Instances []*Instance `locationName:"instancesSet" locationNameList:"item" type:"list"`
// The ID of the AWS account that owns the reservation.
@@ -60602,7 +81298,7 @@ type ReservedInstances struct {
Duration *int64 `locationName:"duration" type:"long"`
// The time when the Reserved Instance expires.
- End *time.Time `locationName:"end" type:"timestamp" timestampFormat:"iso8601"`
+ End *time.Time `locationName:"end" type:"timestamp"`
// The purchase price of the Reserved Instance.
FixedPrice *float64 `locationName:"fixedPrice" type:"float"`
@@ -60635,7 +81331,7 @@ type ReservedInstances struct {
Scope *string `locationName:"scope" type:"string" enum:"scope"`
// The date and time the Reserved Instance started.
- Start *time.Time `locationName:"start" type:"timestamp" timestampFormat:"iso8601"`
+ Start *time.Time `locationName:"start" type:"timestamp"`
// The state of the Reserved Instance purchase.
State *string `locationName:"state" type:"string" enum:"ReservedInstanceState"`
@@ -60773,6 +81469,8 @@ type ReservedInstancesConfiguration struct {
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
// The number of modified Reserved Instances.
+ //
+ // This is a required field for a request.
InstanceCount *int64 `locationName:"instanceCount" type:"integer"`
// The instance type for the modified Reserved Instances.
@@ -60782,7 +81480,7 @@ type ReservedInstancesConfiguration struct {
// EC2-Classic or EC2-VPC.
Platform *string `locationName:"platform" type:"string"`
- // Whether the Reserved Instance is applied to instances in a region or instances
+ // Whether the Reserved Instance is applied to instances in a Region or instances
// in a specific Availability Zone.
Scope *string `locationName:"scope" type:"string" enum:"scope"`
}
@@ -60856,11 +81554,11 @@ type ReservedInstancesListing struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive key supplied by the client to ensure that the request
- // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // is idempotent. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// The time the listing was created.
- CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"`
+ CreateDate *time.Time `locationName:"createDate" type:"timestamp"`
// The number of instances in this state.
InstanceCounts []*InstanceCount `locationName:"instanceCounts" locationNameList:"item" type:"list"`
@@ -60885,7 +81583,7 @@ type ReservedInstancesListing struct {
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
// The last modified timestamp of the listing.
- UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"`
+ UpdateDate *time.Time `locationName:"updateDate" type:"timestamp"`
}
// String returns the string representation
@@ -60963,14 +81661,14 @@ type ReservedInstancesModification struct {
_ struct{} `type:"structure"`
// A unique, case-sensitive key supplied by the client to ensure that the request
- // is idempotent. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // is idempotent. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
// The time when the modification request was created.
- CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"`
+ CreateDate *time.Time `locationName:"createDate" type:"timestamp"`
// The time for the modification to become effective.
- EffectiveDate *time.Time `locationName:"effectiveDate" type:"timestamp" timestampFormat:"iso8601"`
+ EffectiveDate *time.Time `locationName:"effectiveDate" type:"timestamp"`
// Contains target configurations along with their corresponding new Reserved
// Instance IDs.
@@ -60989,7 +81687,7 @@ type ReservedInstancesModification struct {
StatusMessage *string `locationName:"statusMessage" type:"string"`
// The time when the modification request was last updated.
- UpdateDate *time.Time `locationName:"updateDate" type:"timestamp" timestampFormat:"iso8601"`
+ UpdateDate *time.Time `locationName:"updateDate" type:"timestamp"`
}
// String returns the string representation
@@ -61141,7 +81839,7 @@ type ReservedInstancesOffering struct {
// GetReservedInstancesExchangeQuote to confirm that an exchange can be made.
ReservedInstancesOfferingId *string `locationName:"reservedInstancesOfferingId" type:"string"`
- // Whether the Reserved Instance is applied to instances in a region or an Availability
+ // Whether the Reserved Instance is applied to instances in a Region or an Availability
// Zone.
Scope *string `locationName:"scope" type:"string" enum:"scope"`
@@ -61249,6 +81947,55 @@ func (s *ReservedInstancesOffering) SetUsagePrice(v float64) *ReservedInstancesO
return s
}
+type ResetEbsDefaultKmsKeyIdInput 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
+func (s ResetEbsDefaultKmsKeyIdInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ResetEbsDefaultKmsKeyIdInput) GoString() string {
+ return s.String()
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *ResetEbsDefaultKmsKeyIdInput) SetDryRun(v bool) *ResetEbsDefaultKmsKeyIdInput {
+ s.DryRun = &v
+ return s
+}
+
+type ResetEbsDefaultKmsKeyIdOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the default CMK for EBS encryption by default.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+}
+
+// String returns the string representation
+func (s ResetEbsDefaultKmsKeyIdOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ResetEbsDefaultKmsKeyIdOutput) GoString() string {
+ return s.String()
+}
+
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *ResetEbsDefaultKmsKeyIdOutput) SetKmsKeyId(v string) *ResetEbsDefaultKmsKeyIdOutput {
+ s.KmsKeyId = &v
+ return s
+}
+
type ResetFpgaImageAttributeInput struct {
_ struct{} `type:"structure"`
@@ -61411,7 +82158,6 @@ func (s ResetImageAttributeOutput) GoString() string {
return s.String()
}
-// Contains the parameters for ResetInstanceAttribute.
type ResetInstanceAttributeInput struct {
_ struct{} `type:"structure"`
@@ -61688,6 +82434,14 @@ type ResponseLaunchTemplateData struct {
// The block device mappings.
BlockDeviceMappings []*LaunchTemplateBlockDeviceMapping `locationName:"blockDeviceMappingSet" locationNameList:"item" type:"list"`
+ // 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
+ // Options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
+ // in the Amazon Elastic Compute Cloud User Guide.
+ CpuOptions *LaunchTemplateCpuOptions `locationName:"cpuOptions" type:"structure"`
+
// The credit option for CPU usage of the instance.
CreditSpecification *CreditSpecification `locationName:"creditSpecification" type:"structure"`
@@ -61701,6 +82455,14 @@ type ResponseLaunchTemplateData struct {
// The elastic GPU specification.
ElasticGpuSpecifications []*ElasticGpuSpecificationResponse `locationName:"elasticGpuSpecificationSet" locationNameList:"item" type:"list"`
+ // The elastic inference accelerator for the instance.
+ ElasticInferenceAccelerators []*LaunchTemplateElasticInferenceAcceleratorResponse `locationName:"elasticInferenceAcceleratorSet" locationNameList:"item" type:"list"`
+
+ // 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.
+ HibernationOptions *LaunchTemplateHibernationOptions `locationName:"hibernationOptions" type:"structure"`
+
// The IAM instance profile.
IamInstanceProfile *LaunchTemplateIamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"`
@@ -61723,6 +82485,9 @@ type ResponseLaunchTemplateData struct {
// The name of the key pair.
KeyName *string `locationName:"keyName" type:"string"`
+ // The license configurations.
+ LicenseSpecifications []*LaunchTemplateLicenseConfiguration `locationName:"licenseSet" locationNameList:"item" type:"list"`
+
// The monitoring for the instance.
Monitoring *LaunchTemplatesMonitoring `locationName:"monitoring" type:"structure"`
@@ -61764,6 +82529,18 @@ func (s *ResponseLaunchTemplateData) SetBlockDeviceMappings(v []*LaunchTemplateB
return s
}
+// SetCapacityReservationSpecification sets the CapacityReservationSpecification field's value.
+func (s *ResponseLaunchTemplateData) SetCapacityReservationSpecification(v *LaunchTemplateCapacityReservationSpecificationResponse) *ResponseLaunchTemplateData {
+ s.CapacityReservationSpecification = v
+ return s
+}
+
+// SetCpuOptions sets the CpuOptions field's value.
+func (s *ResponseLaunchTemplateData) SetCpuOptions(v *LaunchTemplateCpuOptions) *ResponseLaunchTemplateData {
+ s.CpuOptions = v
+ return s
+}
+
// SetCreditSpecification sets the CreditSpecification field's value.
func (s *ResponseLaunchTemplateData) SetCreditSpecification(v *CreditSpecification) *ResponseLaunchTemplateData {
s.CreditSpecification = v
@@ -61788,6 +82565,18 @@ func (s *ResponseLaunchTemplateData) SetElasticGpuSpecifications(v []*ElasticGpu
return s
}
+// SetElasticInferenceAccelerators sets the ElasticInferenceAccelerators field's value.
+func (s *ResponseLaunchTemplateData) SetElasticInferenceAccelerators(v []*LaunchTemplateElasticInferenceAcceleratorResponse) *ResponseLaunchTemplateData {
+ s.ElasticInferenceAccelerators = v
+ return s
+}
+
+// SetHibernationOptions sets the HibernationOptions field's value.
+func (s *ResponseLaunchTemplateData) SetHibernationOptions(v *LaunchTemplateHibernationOptions) *ResponseLaunchTemplateData {
+ s.HibernationOptions = v
+ return s
+}
+
// SetIamInstanceProfile sets the IamInstanceProfile field's value.
func (s *ResponseLaunchTemplateData) SetIamInstanceProfile(v *LaunchTemplateIamInstanceProfileSpecification) *ResponseLaunchTemplateData {
s.IamInstanceProfile = v
@@ -61830,6 +82619,12 @@ func (s *ResponseLaunchTemplateData) SetKeyName(v string) *ResponseLaunchTemplat
return s
}
+// SetLicenseSpecifications sets the LicenseSpecifications field's value.
+func (s *ResponseLaunchTemplateData) SetLicenseSpecifications(v []*LaunchTemplateLicenseConfiguration) *ResponseLaunchTemplateData {
+ s.LicenseSpecifications = v
+ return s
+}
+
// SetMonitoring sets the Monitoring field's value.
func (s *ResponseLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoring) *ResponseLaunchTemplateData {
s.Monitoring = v
@@ -61878,7 +82673,6 @@ func (s *ResponseLaunchTemplateData) SetUserData(v string) *ResponseLaunchTempla
return s
}
-// Contains the parameters for RestoreAddressToClassic.
type RestoreAddressToClassicInput struct {
_ struct{} `type:"structure"`
@@ -61929,7 +82723,6 @@ func (s *RestoreAddressToClassicInput) SetPublicIp(v string) *RestoreAddressToCl
return s
}
-// Contains the output of RestoreAddressToClassic.
type RestoreAddressToClassicOutput struct {
_ struct{} `type:"structure"`
@@ -61962,7 +82755,112 @@ func (s *RestoreAddressToClassicOutput) SetStatus(v string) *RestoreAddressToCla
return s
}
-// Contains the parameters for RevokeSecurityGroupEgress.
+type RevokeClientVpnIngressInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Active Directory group for which to revoke access.
+ AccessGroupId *string `type:"string"`
+
+ // The ID of the Client VPN endpoint with which the authorization rule is associated.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+
+ // Indicates whether access should be revoked for all clients.
+ RevokeAllGroups *bool `type:"boolean"`
+
+ // The IPv4 address range, in CIDR notation, of the network for which access
+ // is being removed.
+ //
+ // TargetNetworkCidr is a required field
+ TargetNetworkCidr *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s RevokeClientVpnIngressInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RevokeClientVpnIngressInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *RevokeClientVpnIngressInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "RevokeClientVpnIngressInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+ if s.TargetNetworkCidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetNetworkCidr"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAccessGroupId sets the AccessGroupId field's value.
+func (s *RevokeClientVpnIngressInput) SetAccessGroupId(v string) *RevokeClientVpnIngressInput {
+ s.AccessGroupId = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *RevokeClientVpnIngressInput) SetClientVpnEndpointId(v string) *RevokeClientVpnIngressInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *RevokeClientVpnIngressInput) SetDryRun(v bool) *RevokeClientVpnIngressInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetRevokeAllGroups sets the RevokeAllGroups field's value.
+func (s *RevokeClientVpnIngressInput) SetRevokeAllGroups(v bool) *RevokeClientVpnIngressInput {
+ s.RevokeAllGroups = &v
+ return s
+}
+
+// SetTargetNetworkCidr sets the TargetNetworkCidr field's value.
+func (s *RevokeClientVpnIngressInput) SetTargetNetworkCidr(v string) *RevokeClientVpnIngressInput {
+ s.TargetNetworkCidr = &v
+ return s
+}
+
+type RevokeClientVpnIngressOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current state of the authorization rule.
+ Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"`
+}
+
+// String returns the string representation
+func (s RevokeClientVpnIngressOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RevokeClientVpnIngressOutput) GoString() string {
+ return s.String()
+}
+
+// SetStatus sets the Status field's value.
+func (s *RevokeClientVpnIngressOutput) SetStatus(v *ClientVpnAuthorizationRuleStatus) *RevokeClientVpnIngressOutput {
+ s.Status = v
+ return s
+}
+
type RevokeSecurityGroupEgressInput struct {
_ struct{} `type:"structure"`
@@ -61983,8 +82881,8 @@ type RevokeSecurityGroupEgressInput struct {
// GroupId is a required field
GroupId *string `locationName:"groupId" type:"string" required:"true"`
- // One or more 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 sets of IP permissions. You can't specify a destination security group
+ // and a CIDR IP address range in the same set of permissions.
IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"`
// Not supported. Use a set of IP permissions to specify the protocol name or
@@ -62094,7 +82992,6 @@ func (s RevokeSecurityGroupEgressOutput) GoString() string {
return s.String()
}
-// Contains the parameters for RevokeSecurityGroupIngress.
type RevokeSecurityGroupIngressInput struct {
_ struct{} `type:"structure"`
@@ -62121,8 +83018,8 @@ type RevokeSecurityGroupIngressInput struct {
// either the security group ID or the security group name in the request.
GroupName *string `type:"string"`
- // One or more sets of IP permissions. You can't specify a source security group
- // and a CIDR IP address range in the same set of permissions.
+ // The sets of IP permissions. You can't specify a source security group and
+ // a CIDR IP address range in the same set of permissions.
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)).
@@ -62247,7 +83144,7 @@ type Route struct {
// The prefix of the AWS service.
DestinationPrefixListId *string `locationName:"destinationPrefixListId" type:"string"`
- // The ID of the egress-only Internet gateway.
+ // The ID of the egress-only internet gateway.
EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"`
// The ID of a gateway attached to your VPC.
@@ -62280,7 +83177,10 @@ type Route struct {
// VPC, or the specified NAT instance has been terminated).
State *string `locationName:"state" type:"string" enum:"RouteState"`
- // The ID of the VPC peering connection.
+ // The ID of a transit gateway.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+
+ // The ID of a VPC peering connection.
VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"`
}
@@ -62360,6 +83260,12 @@ func (s *Route) SetState(v string) *Route {
return s
}
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *Route) SetTransitGatewayId(v string) *Route {
+ s.TransitGatewayId = &v
+ return s
+}
+
// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value.
func (s *Route) SetVpcPeeringConnectionId(v string) *Route {
s.VpcPeeringConnectionId = &v
@@ -62373,6 +83279,9 @@ type RouteTable struct {
// The associations between the route table and one or more subnets.
Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"`
+ // The ID of the AWS account that owns the route table.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// Any virtual private gateway (VGW) propagating routes.
PropagatingVgws []*PropagatingVgw `locationName:"propagatingVgwSet" locationNameList:"item" type:"list"`
@@ -62405,6 +83314,12 @@ func (s *RouteTable) SetAssociations(v []*RouteTableAssociation) *RouteTable {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *RouteTable) SetOwnerId(v string) *RouteTable {
+ s.OwnerId = &v
+ return s
+}
+
// SetPropagatingVgws sets the PropagatingVgws field's value.
func (s *RouteTable) SetPropagatingVgws(v []*PropagatingVgw) *RouteTable {
s.PropagatingVgws = v
@@ -62486,43 +83401,46 @@ func (s *RouteTableAssociation) SetSubnetId(v string) *RouteTableAssociation {
return s
}
-// Contains the parameters for RunInstances.
type RunInstancesInput struct {
_ struct{} `type:"structure"`
// Reserved.
AdditionalInfo *string `locationName:"additionalInfo" type:"string"`
- // One or more block device mapping entries. You can't specify both a snapshot
- // ID and an encryption value. This is because only blank volumes can be encrypted
- // on creation. If a snapshot is the basis for a volume, it is not blank and
- // its encryption status is used for the volume encryption status.
+ // The block device mapping entries.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
+ // Information about the Capacity Reservation targeting option. If you do not
+ // specify this parameter, the instance's Capacity Reservation preference defaults
+ // to open, which enables it to run in any open Capacity Reservation that has
+ // matching attributes (instance type, platform, Availability Zone).
+ CapacityReservationSpecification *CapacityReservationSpecification `type:"structure"`
+
// Unique, case-sensitive identifier you provide to ensure the idempotency of
- // the request. For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
//
// Constraints: Maximum 64 ASCII characters
ClientToken *string `locationName:"clientToken" type:"string"`
// The CPU options for the instance. For more information, see Optimizing CPU
- // Options (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
+ // Options (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html)
// in the Amazon Elastic Compute Cloud User Guide.
CpuOptions *CpuOptionsRequest `type:"structure"`
- // The credit option for CPU usage of the instance. Valid values are standard
- // and unlimited. To change this attribute after launch, use ModifyInstanceCreditSpecification.
- // For more information, see T2 Instances (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html)
+ // The credit option for CPU usage of the T2 or T3 instance. Valid values are
+ // standard and unlimited. To change this attribute after launch, use ModifyInstanceCreditSpecification
+ // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html).
+ // For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
- // Default: standard
+ // Default: standard (T2 instances) or unlimited (T3 instances)
CreditSpecification *CreditSpecificationRequest `type:"structure"`
// If you set this parameter to true, you can't terminate the instance using
// the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute
- // to false after launch, use ModifyInstanceAttribute. Alternatively, if you
- // set InstanceInitiatedShutdownBehavior to terminate, you can terminate the
- // instance by running the shutdown command from the instance.
+ // after launch, use ModifyInstanceAttribute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceAttribute.html).
+ // Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate,
+ // you can terminate the instance by running the shutdown command from the instance.
//
// Default: false
DisableApiTermination *bool `locationName:"disableApiTermination" type:"boolean"`
@@ -62542,15 +83460,27 @@ type RunInstancesInput struct {
// Default: false
EbsOptimized *bool `locationName:"ebsOptimized" type:"boolean"`
- // An elastic GPU to associate with the instance.
+ // 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 Elastic Compute Cloud User Guide.
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.
+ ElasticInferenceAccelerators []*ElasticInferenceAccelerator `locationName:"ElasticInferenceAccelerator" locationNameList:"item" type:"list"`
+
+ // Indicates whether an instance is enabled 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.
+ HibernationOptions *HibernationOptionsRequest `type:"structure"`
+
// The IAM instance profile.
IamInstanceProfile *IamInstanceProfileSpecification `locationName:"iamInstanceProfile" type:"structure"`
- // The ID of the AMI, which you can get by calling DescribeImages. An AMI is
- // required to launch an instance and must be specified here or in a launch
- // template.
+ // The ID of the AMI. An AMI ID is required to launch an instance and must be
+ // specified here or in a launch template.
ImageId *string `type:"string"`
// Indicates whether an instance stops or terminates when you initiate shutdown
@@ -62560,37 +83490,45 @@ type RunInstancesInput struct {
InstanceInitiatedShutdownBehavior *string `locationName:"instanceInitiatedShutdownBehavior" type:"string" enum:"ShutdownBehavior"`
// The market (purchasing) option for the instances.
+ //
+ // For RunInstances, persistent Spot Instance requests are only supported when
+ // InstanceInterruptionBehavior is set to either hibernate or stop.
InstanceMarketOptions *InstanceMarketOptionsRequest `type:"structure"`
- // The instance type. For more information, see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
+ // 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.
//
// Default: m1.small
InstanceType *string `type:"string" enum:"InstanceType"`
- // [EC2-VPC] A number of IPv6 addresses to associate with the primary network
+ // [EC2-VPC] The number of IPv6 addresses to associate with the primary network
// interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.
// You cannot specify this option and the option to assign specific IPv6 addresses
// in the same request. You can specify this option if you've specified a minimum
// number of instances to launch.
+ //
+ // You cannot specify this option and the network interfaces option in the same
+ // request.
Ipv6AddressCount *int64 `type:"integer"`
- // [EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet
- // to associate with the primary network interface. You cannot specify this
- // option and the option to assign a number of IPv6 addresses in the same request.
- // You cannot specify this option if you've specified a minimum number of instances
- // to launch.
+ // [EC2-VPC] The IPv6 addresses from the range of the subnet to associate with
+ // the primary network interface. You cannot specify this option and the option
+ // to assign a number of IPv6 addresses in the same request. You cannot specify
+ // this option if you've specified a minimum number of instances to launch.
+ //
+ // You cannot specify this option and the network interfaces option in the same
+ // request.
Ipv6Addresses []*InstanceIpv6Address `locationName:"Ipv6Address" locationNameList:"item" type:"list"`
// The ID of the kernel.
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
- // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
+ // information, see PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
// in the Amazon Elastic Compute Cloud User Guide.
KernelId *string `type:"string"`
- // The name of the key pair. You can create a key pair using CreateKeyPair or
- // ImportKeyPair.
+ // 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)
+ // or ImportKeyPair (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ImportKeyPair.html).
//
// If you do not specify a key pair, you can't connect to the instance unless
// you choose an AMI that is configured to allow users another way to log in.
@@ -62601,6 +83539,9 @@ type RunInstancesInput struct {
// You can specify either the name or ID of a launch template, but not both.
LaunchTemplate *LaunchTemplateSpecification `type:"structure"`
+ // The license configurations.
+ LicenseSpecifications []*LicenseConfigurationRequest `locationName:"LicenseSpecification" locationNameList:"item" type:"list"`
+
// 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.
@@ -62625,10 +83566,12 @@ type RunInstancesInput struct {
// MinCount is a required field
MinCount *int64 `type:"integer" required:"true"`
- // The monitoring for the instance.
+ // Specifies whether detailed monitoring is enabled for the instance.
Monitoring *RunInstancesMonitoringEnabled `type:"structure"`
- // One or more network interfaces.
+ // 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.
NetworkInterfaces []*InstanceNetworkInterfaceSpecification `locationName:"networkInterface" locationNameList:"item" type:"list"`
// The placement for the instance.
@@ -62641,40 +83584,55 @@ type RunInstancesInput struct {
// this option if you've specified the option to designate a private IP address
// as the primary IP address in a network interface specification. You cannot
// specify this option if you're launching more than one instance in the request.
+ //
+ // You cannot specify this option and the network interfaces option in the same
+ // request.
PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"`
- // The ID of the RAM disk.
+ // The ID of the RAM disk to select. Some kernels require additional drivers
+ // at launch. Check the kernel requirements for information about whether you
+ // need to specify a RAM disk. To find kernel requirements, go to the AWS Resource
+ // Center and search for the kernel ID.
//
// We recommend that you use PV-GRUB instead of kernels and RAM disks. For more
- // information, see PV-GRUB (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
+ // information, see PV-GRUB (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/UserProvidedkernels.html)
// in the Amazon Elastic Compute Cloud User Guide.
RamdiskId *string `type:"string"`
- // One or more security group IDs. You can create a security group using CreateSecurityGroup.
+ // The IDs of the security groups. You can create a security group using CreateSecurityGroup
+ // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html).
//
- // Default: Amazon EC2 uses the default security group.
+ // If you specify a network interface, you must specify any security groups
+ // as part of the network interface.
SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
- // [EC2-Classic, default VPC] One or more security group names. For a nondefault
+ // [EC2-Classic, default VPC] 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.
+ //
// Default: Amazon EC2 uses the default security group.
SecurityGroups []*string `locationName:"SecurityGroup" locationNameList:"SecurityGroup" type:"list"`
// [EC2-VPC] 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.
SubnetId *string `type:"string"`
- // The tags to apply to the resources during launch. You can tag instances and
- // volumes. The specified tags are applied to all instances or volumes that
- // are created during launch.
+ // The tags to apply to the resources during launch. You can only tag instances
+ // and volumes on launch. The specified tags are applied to all instances or
+ // volumes that are created during launch. 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 to make available to the instance. For more information, see
- // Running Commands on Your Linux Instance at Launch (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
- // (Linux) and Adding User Data (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data)
+ // Running Commands on Your Linux Instance at Launch (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
+ // (Linux) and Adding User Data (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-instance-metadata.html#instancedata-add-user-data)
// (Windows). 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.
+ // base64-encoded text. User data is limited to 16 KB.
UserData *string `type:"string"`
}
@@ -62712,21 +83670,21 @@ func (s *RunInstancesInput) Validate() error {
}
}
}
- if s.Monitoring != nil {
- if err := s.Monitoring.Validate(); err != nil {
- invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams))
- }
- }
- if s.NetworkInterfaces != nil {
- for i, v := range s.NetworkInterfaces {
+ if s.ElasticInferenceAccelerators != nil {
+ for i, v := range s.ElasticInferenceAccelerators {
if v == nil {
continue
}
if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams))
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ElasticInferenceAccelerators", i), err.(request.ErrInvalidParams))
}
}
}
+ if s.Monitoring != nil {
+ if err := s.Monitoring.Validate(); err != nil {
+ invalidParams.AddNested("Monitoring", err.(request.ErrInvalidParams))
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -62746,6 +83704,12 @@ func (s *RunInstancesInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *Run
return s
}
+// SetCapacityReservationSpecification sets the CapacityReservationSpecification field's value.
+func (s *RunInstancesInput) SetCapacityReservationSpecification(v *CapacityReservationSpecification) *RunInstancesInput {
+ s.CapacityReservationSpecification = v
+ return s
+}
+
// SetClientToken sets the ClientToken field's value.
func (s *RunInstancesInput) SetClientToken(v string) *RunInstancesInput {
s.ClientToken = &v
@@ -62788,6 +83752,18 @@ func (s *RunInstancesInput) SetElasticGpuSpecification(v []*ElasticGpuSpecificat
return s
}
+// SetElasticInferenceAccelerators sets the ElasticInferenceAccelerators field's value.
+func (s *RunInstancesInput) SetElasticInferenceAccelerators(v []*ElasticInferenceAccelerator) *RunInstancesInput {
+ s.ElasticInferenceAccelerators = v
+ return s
+}
+
+// SetHibernationOptions sets the HibernationOptions field's value.
+func (s *RunInstancesInput) SetHibernationOptions(v *HibernationOptionsRequest) *RunInstancesInput {
+ s.HibernationOptions = v
+ return s
+}
+
// SetIamInstanceProfile sets the IamInstanceProfile field's value.
func (s *RunInstancesInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *RunInstancesInput {
s.IamInstanceProfile = v
@@ -62848,6 +83824,12 @@ func (s *RunInstancesInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *R
return s
}
+// SetLicenseSpecifications sets the LicenseSpecifications field's value.
+func (s *RunInstancesInput) SetLicenseSpecifications(v []*LicenseConfigurationRequest) *RunInstancesInput {
+ s.LicenseSpecifications = v
+ return s
+}
+
// SetMaxCount sets the MaxCount field's value.
func (s *RunInstancesInput) SetMaxCount(v int64) *RunInstancesInput {
s.MaxCount = &v
@@ -62965,7 +83947,7 @@ type RunScheduledInstancesInput struct {
_ struct{} `type:"structure"`
// Unique, case-sensitive identifier that ensures the idempotency of the request.
- // For more information, see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `type:"string" idempotencyToken:"true"`
// Checks whether you have the required permissions for the action, without
@@ -63083,7 +84065,7 @@ type S3Storage struct {
// The access key ID of the owner of the bucket. Before you specify a value
// for your access key ID, review and follow the guidance in Best Practices
- // for Managing AWS Access Keys (http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html).
+ // for Managing AWS Access Keys (https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html).
AWSAccessKeyId *string `type:"string"`
// The bucket in which to store the AMI. You can specify a bucket that you already
@@ -63152,7 +84134,7 @@ type ScheduledInstance struct {
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
// The date when the Scheduled Instance was purchased.
- CreateDate *time.Time `locationName:"createDate" type:"timestamp" timestampFormat:"iso8601"`
+ CreateDate *time.Time `locationName:"createDate" type:"timestamp"`
// The hourly price for a single instance.
HourlyPrice *string `locationName:"hourlyPrice" type:"string"`
@@ -63167,13 +84149,13 @@ type ScheduledInstance struct {
NetworkPlatform *string `locationName:"networkPlatform" type:"string"`
// The time for the next schedule to start.
- NextSlotStartTime *time.Time `locationName:"nextSlotStartTime" type:"timestamp" timestampFormat:"iso8601"`
+ NextSlotStartTime *time.Time `locationName:"nextSlotStartTime" type:"timestamp"`
// The platform (Linux/UNIX or Windows).
Platform *string `locationName:"platform" type:"string"`
// The time that the previous schedule ended or will end.
- PreviousSlotEndTime *time.Time `locationName:"previousSlotEndTime" type:"timestamp" timestampFormat:"iso8601"`
+ PreviousSlotEndTime *time.Time `locationName:"previousSlotEndTime" type:"timestamp"`
// The schedule recurrence.
Recurrence *ScheduledInstanceRecurrence `locationName:"recurrence" type:"structure"`
@@ -63185,10 +84167,10 @@ type ScheduledInstance struct {
SlotDurationInHours *int64 `locationName:"slotDurationInHours" type:"integer"`
// The end date for the Scheduled Instance.
- TermEndDate *time.Time `locationName:"termEndDate" type:"timestamp" timestampFormat:"iso8601"`
+ TermEndDate *time.Time `locationName:"termEndDate" type:"timestamp"`
// The start date for the Scheduled Instance.
- TermStartDate *time.Time `locationName:"termStartDate" type:"timestamp" timestampFormat:"iso8601"`
+ TermStartDate *time.Time `locationName:"termStartDate" type:"timestamp"`
// The total number of hours for a single instance for the entire term.
TotalScheduledInstanceHours *int64 `locationName:"totalScheduledInstanceHours" type:"integer"`
@@ -63305,7 +84287,7 @@ type ScheduledInstanceAvailability struct {
AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"`
// The time period for the first schedule to start.
- FirstSlotStartTime *time.Time `locationName:"firstSlotStartTime" type:"timestamp" timestampFormat:"iso8601"`
+ FirstSlotStartTime *time.Time `locationName:"firstSlotStartTime" type:"timestamp"`
// The hourly price for a single instance.
HourlyPrice *string `locationName:"hourlyPrice" type:"string"`
@@ -63636,7 +84618,7 @@ type ScheduledInstancesEbs struct {
// for the volume. For gp2 volumes, this represents the baseline performance
// of the volume and the rate at which the volume accumulates I/O credits for
// bursting. For more information about gp2 baseline performance, I/O credits,
- // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
+ // and bursting, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
// in the Amazon Elastic Compute Cloud User Guide.
//
// Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for
@@ -63773,7 +84755,7 @@ func (s *ScheduledInstancesIpv6Address) SetIpv6Address(v string) *ScheduledInsta
type ScheduledInstancesLaunchSpecification struct {
_ struct{} `type:"structure"`
- // One or more block device mapping entries.
+ // The block device mapping entries.
BlockDeviceMappings []*ScheduledInstancesBlockDeviceMapping `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"`
// Indicates whether the instances are optimized for EBS I/O. This optimization
@@ -63805,7 +84787,7 @@ type ScheduledInstancesLaunchSpecification struct {
// Enable or disable monitoring for the instances.
Monitoring *ScheduledInstancesMonitoring `type:"structure"`
- // One or more network interfaces.
+ // The network interfaces.
NetworkInterfaces []*ScheduledInstancesNetworkInterface `locationName:"NetworkInterface" locationNameList:"NetworkInterface" type:"list"`
// The placement information.
@@ -63814,7 +84796,7 @@ type ScheduledInstancesLaunchSpecification struct {
// The ID of the RAM disk.
RamdiskId *string `type:"string"`
- // The IDs of one or more security groups.
+ // The IDs of the security groups.
SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"`
// The ID of the subnet in which to launch the instances.
@@ -63975,14 +84957,14 @@ type ScheduledInstancesNetworkInterface struct {
// The index of the device for the network interface attachment.
DeviceIndex *int64 `type:"integer"`
- // The IDs of one or more security groups.
+ // The IDs of the security groups.
Groups []*string `locationName:"Group" locationNameList:"SecurityGroupId" type:"list"`
// The number of IPv6 addresses to assign to the network interface. The IPv6
// addresses are automatically selected from the subnet range.
Ipv6AddressCount *int64 `type:"integer"`
- // One or more specific IPv6 addresses from the subnet range.
+ // The specific IPv6 addresses from the subnet range.
Ipv6Addresses []*ScheduledInstancesIpv6Address `locationName:"Ipv6Address" locationNameList:"Ipv6Address" type:"list"`
// The ID of the network interface.
@@ -64150,6 +85132,138 @@ func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrivateIpAddress(v string)
return s
}
+type SearchTransitGatewayRoutesInput 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"`
+
+ // One or more filters. The possible values are:
+ //
+ // * attachment.transit-gateway-attachment-id- The id of the transit gateway
+ // attachment.
+ //
+ // * attachment.resource-id - The resource id of the transit gateway attachment.
+ //
+ // * attachment.resource-type - The attachment resource type (vpc | vpn).
+ //
+ // * route-search.exact-match - The exact match of the specified filter.
+ //
+ // * route-search.longest-prefix-match - The longest prefix that matches
+ // the route.
+ //
+ // * route-search.subnet-of-match - The routes with a subnet that match the
+ // specified CIDR filter.
+ //
+ // * route-search.supernet-of-match - The routes with a CIDR that encompass
+ // the CIDR filter. For example, if you have 10.0.1.0/29 and 10.0.1.0/31
+ // routes in your route table and you specify supernet-of-match as 10.0.1.0/30,
+ // then the result returns 10.0.1.0/29.
+ //
+ // * state - The state of the route (active | blackhole).
+ //
+ // * type - The type of roue (propagated | static).
+ //
+ // Filters is a required field
+ Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list" required:"true"`
+
+ // The maximum number of routes to return.
+ MaxResults *int64 `min:"5" type:"integer"`
+
+ // The ID of the transit gateway route table.
+ //
+ // TransitGatewayRouteTableId is a required field
+ TransitGatewayRouteTableId *string `type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s SearchTransitGatewayRoutesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SearchTransitGatewayRoutesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *SearchTransitGatewayRoutesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "SearchTransitGatewayRoutesInput"}
+ if s.Filters == nil {
+ invalidParams.Add(request.NewErrParamRequired("Filters"))
+ }
+ if s.MaxResults != nil && *s.MaxResults < 5 {
+ invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5))
+ }
+ if s.TransitGatewayRouteTableId == nil {
+ invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *SearchTransitGatewayRoutesInput) SetDryRun(v bool) *SearchTransitGatewayRoutesInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetFilters sets the Filters field's value.
+func (s *SearchTransitGatewayRoutesInput) SetFilters(v []*Filter) *SearchTransitGatewayRoutesInput {
+ s.Filters = v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *SearchTransitGatewayRoutesInput) SetMaxResults(v int64) *SearchTransitGatewayRoutesInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *SearchTransitGatewayRoutesInput) SetTransitGatewayRouteTableId(v string) *SearchTransitGatewayRoutesInput {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+type SearchTransitGatewayRoutesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether there are additional routes available.
+ AdditionalRoutesAvailable *bool `locationName:"additionalRoutesAvailable" type:"boolean"`
+
+ // Information about the routes.
+ Routes []*TransitGatewayRoute `locationName:"routeSet" locationNameList:"item" type:"list"`
+}
+
+// String returns the string representation
+func (s SearchTransitGatewayRoutesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SearchTransitGatewayRoutesOutput) GoString() string {
+ return s.String()
+}
+
+// SetAdditionalRoutesAvailable sets the AdditionalRoutesAvailable field's value.
+func (s *SearchTransitGatewayRoutesOutput) SetAdditionalRoutesAvailable(v bool) *SearchTransitGatewayRoutesOutput {
+ s.AdditionalRoutesAvailable = &v
+ return s
+}
+
+// SetRoutes sets the Routes field's value.
+func (s *SearchTransitGatewayRoutesOutput) SetRoutes(v []*TransitGatewayRoute) *SearchTransitGatewayRoutesOutput {
+ s.Routes = v
+ return s
+}
+
// Describes a security group
type SecurityGroup struct {
_ struct{} `type:"structure"`
@@ -64163,10 +85277,10 @@ type SecurityGroup struct {
// The name of the security group.
GroupName *string `locationName:"groupName" type:"string"`
- // One or more inbound rules associated with the security group.
+ // The inbound rules associated with the security group.
IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"`
- // [EC2-VPC] One or more outbound rules associated with the security group.
+ // [VPC only] The outbound rules associated with the security group.
IpPermissionsEgress []*IpPermission `locationName:"ipPermissionsEgress" locationNameList:"item" type:"list"`
// The AWS account ID of the owner of the security group.
@@ -64175,7 +85289,7 @@ type SecurityGroup struct {
// Any tags assigned to the security group.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
- // [EC2-VPC] The ID of the VPC for the security group.
+ // [VPC only] The ID of the VPC for the security group.
VpcId *string `locationName:"vpcId" type:"string"`
}
@@ -64275,14 +85389,10 @@ type SecurityGroupReference struct {
_ struct{} `type:"structure"`
// The ID of your security group.
- //
- // GroupId is a required field
- GroupId *string `locationName:"groupId" type:"string" required:"true"`
+ GroupId *string `locationName:"groupId" type:"string"`
// The ID of the VPC with the referencing security group.
- //
- // ReferencingVpcId is a required field
- ReferencingVpcId *string `locationName:"referencingVpcId" type:"string" required:"true"`
+ ReferencingVpcId *string `locationName:"referencingVpcId" type:"string"`
// The ID of the VPC peering connection.
VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"`
@@ -64330,6 +85440,10 @@ type ServiceConfiguration struct {
// The DNS names for the service.
BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"`
+ // Indicates whether the service manages it's VPC endpoints. Management of the
+ // service VPC endpoints using the VPC endpoint API is restricted.
+ ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"`
+
// The Amazon Resource Names (ARNs) of the Network Load Balancers for the service.
NetworkLoadBalancerArns []*string `locationName:"networkLoadBalancerArnSet" locationNameList:"item" type:"list"`
@@ -64347,6 +85461,9 @@ type ServiceConfiguration struct {
// The type of service.
ServiceType []*ServiceTypeDetail `locationName:"serviceType" locationNameList:"item" type:"list"`
+
+ // Any tags assigned to the service.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
}
// String returns the string representation
@@ -64377,6 +85494,12 @@ func (s *ServiceConfiguration) SetBaseEndpointDnsNames(v []*string) *ServiceConf
return s
}
+// SetManagesVpcEndpoints sets the ManagesVpcEndpoints field's value.
+func (s *ServiceConfiguration) SetManagesVpcEndpoints(v bool) *ServiceConfiguration {
+ s.ManagesVpcEndpoints = &v
+ return s
+}
+
// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value.
func (s *ServiceConfiguration) SetNetworkLoadBalancerArns(v []*string) *ServiceConfiguration {
s.NetworkLoadBalancerArns = v
@@ -64413,6 +85536,12 @@ func (s *ServiceConfiguration) SetServiceType(v []*ServiceTypeDetail) *ServiceCo
return s
}
+// SetTags sets the Tags field's value.
+func (s *ServiceConfiguration) SetTags(v []*Tag) *ServiceConfiguration {
+ s.Tags = v
+ return s
+}
+
// Describes a VPC endpoint service.
type ServiceDetail struct {
_ struct{} `type:"structure"`
@@ -64427,18 +85556,28 @@ type ServiceDetail struct {
// The DNS names for the service.
BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"`
+ // Indicates whether the service manages it's VPC endpoints. Management of the
+ // service VPC endpoints using the VPC endpoint API is restricted.
+ ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"`
+
// The AWS account ID of the service owner.
Owner *string `locationName:"owner" type:"string"`
// The private DNS name for the service.
PrivateDnsName *string `locationName:"privateDnsName" type:"string"`
+ // The ID of the endpoint service.
+ ServiceId *string `locationName:"serviceId" type:"string"`
+
// The Amazon Resource Name (ARN) of the service.
ServiceName *string `locationName:"serviceName" type:"string"`
// The type of service.
ServiceType []*ServiceTypeDetail `locationName:"serviceType" locationNameList:"item" type:"list"`
+ // Any tags assigned to the service.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
// Indicates whether the service supports endpoint policies.
VpcEndpointPolicySupported *bool `locationName:"vpcEndpointPolicySupported" type:"boolean"`
}
@@ -64471,6 +85610,12 @@ func (s *ServiceDetail) SetBaseEndpointDnsNames(v []*string) *ServiceDetail {
return s
}
+// SetManagesVpcEndpoints sets the ManagesVpcEndpoints field's value.
+func (s *ServiceDetail) SetManagesVpcEndpoints(v bool) *ServiceDetail {
+ s.ManagesVpcEndpoints = &v
+ return s
+}
+
// SetOwner sets the Owner field's value.
func (s *ServiceDetail) SetOwner(v string) *ServiceDetail {
s.Owner = &v
@@ -64483,6 +85628,12 @@ func (s *ServiceDetail) SetPrivateDnsName(v string) *ServiceDetail {
return s
}
+// SetServiceId sets the ServiceId field's value.
+func (s *ServiceDetail) SetServiceId(v string) *ServiceDetail {
+ s.ServiceId = &v
+ return s
+}
+
// SetServiceName sets the ServiceName field's value.
func (s *ServiceDetail) SetServiceName(v string) *ServiceDetail {
s.ServiceName = &v
@@ -64495,6 +85646,12 @@ func (s *ServiceDetail) SetServiceType(v []*ServiceTypeDetail) *ServiceDetail {
return s
}
+// SetTags sets the Tags field's value.
+func (s *ServiceDetail) SetTags(v []*Tag) *ServiceDetail {
+ s.Tags = v
+ return s
+}
+
// SetVpcEndpointPolicySupported sets the VpcEndpointPolicySupported field's value.
func (s *ServiceDetail) SetVpcEndpointPolicySupported(v bool) *ServiceDetail {
s.VpcEndpointPolicySupported = &v
@@ -64533,14 +85690,14 @@ type SlotDateTimeRangeRequest struct {
// The earliest date and time, in UTC, for the Scheduled Instance to start.
//
// EarliestTime is a required field
- EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ EarliestTime *time.Time `type:"timestamp" required:"true"`
// The latest date and time, in UTC, for the Scheduled Instance to start. This
// value must be later than or equal to the earliest date and at most three
// months in the future.
//
// LatestTime is a required field
- LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ LatestTime *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@@ -64586,10 +85743,10 @@ type SlotStartTimeRangeRequest struct {
_ struct{} `type:"structure"`
// The earliest date and time, in UTC, for the Scheduled Instance to start.
- EarliestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ EarliestTime *time.Time `type:"timestamp"`
// The latest date and time, in UTC, for the Scheduled Instance to start.
- LatestTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ LatestTime *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -64623,7 +85780,7 @@ type Snapshot struct {
// the original volume or snapshot copy. Because data encryption keys are inherited
// by volumes created from snapshots, and vice versa, if snapshots share the
// same data encryption key identifier, then they belong to the same volume/snapshot
- // lineage. This parameter is only returned by the DescribeSnapshots API operation.
+ // lineage. This parameter is only returned by DescribeSnapshots.
DataEncryptionKeyId *string `locationName:"dataEncryptionKeyId" type:"string"`
// The description for the snapshot.
@@ -64632,14 +85789,14 @@ type Snapshot struct {
// Indicates whether the snapshot is encrypted.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
- // The full ARN of the AWS Key Management Service (AWS KMS) customer master
- // key (CMK) that was used to protect the volume encryption key for the parent
- // volume.
+ // The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
+ // customer master key (CMK) that was used to protect the volume encryption
+ // key for the parent volume.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
- // Value from an Amazon-maintained list (amazon | aws-marketplace | microsoft)
- // of snapshot owners. Not to be confused with the user-configured AWS account
- // alias, which is set from the IAM console.
+ // Value from an Amazon-maintained list (amazon | self | all | aws-marketplace
+ // | microsoft) of snapshot owners. Not to be confused with the user-configured
+ // AWS account alias, which is set from the IAM console.
OwnerAlias *string `locationName:"ownerAlias" type:"string"`
// The AWS account ID of the EBS snapshot owner.
@@ -64653,7 +85810,7 @@ type Snapshot struct {
SnapshotId *string `locationName:"snapshotId" type:"string"`
// The time stamp when the snapshot was initiated.
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
// The snapshot state.
State *string `locationName:"status" type:"string" enum:"SnapshotState"`
@@ -64662,7 +85819,7 @@ type Snapshot struct {
// operation fails (for example, if the proper AWS Key Management Service (AWS
// 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 the DescribeSnapshots API operation.
+ // by DescribeSnapshots.
StateMessage *string `locationName:"statusMessage" type:"string"`
// Any tags assigned to the snapshot.
@@ -64885,7 +86042,7 @@ type SnapshotDiskContainer struct {
// The format of the disk image being imported.
//
- // Valid values: VHD | VMDK | OVA
+ // Valid values: VHD | VMDK
Format *string `type:"string"`
// The URL to the Amazon S3-based disk image being imported. It can either be
@@ -64930,6 +86087,113 @@ func (s *SnapshotDiskContainer) SetUserBucket(v *UserBucket) *SnapshotDiskContai
return s
}
+// Information about a snapshot.
+type SnapshotInfo struct {
+ _ struct{} `type:"structure"`
+
+ // Description specified by the CreateSnapshotRequest that has been applied
+ // to all snapshots.
+ Description *string `locationName:"description" type:"string"`
+
+ // Indicates whether the snapshot is encrypted.
+ Encrypted *bool `locationName:"encrypted" type:"boolean"`
+
+ // Account id used when creating this snapshot.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // Progress this snapshot has made towards completing.
+ Progress *string `locationName:"progress" type:"string"`
+
+ // Snapshot id that can be used to describe this snapshot.
+ SnapshotId *string `locationName:"snapshotId" type:"string"`
+
+ // Time this snapshot was started. This is the same for all snapshots initiated
+ // by the same request.
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
+
+ // Current state of the snapshot.
+ State *string `locationName:"state" type:"string" enum:"SnapshotState"`
+
+ // Tags associated with this snapshot.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // Source volume from which this snapshot was created.
+ VolumeId *string `locationName:"volumeId" type:"string"`
+
+ // Size of the volume from which this snapshot was created.
+ VolumeSize *int64 `locationName:"volumeSize" type:"integer"`
+}
+
+// String returns the string representation
+func (s SnapshotInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SnapshotInfo) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *SnapshotInfo) SetDescription(v string) *SnapshotInfo {
+ s.Description = &v
+ return s
+}
+
+// SetEncrypted sets the Encrypted field's value.
+func (s *SnapshotInfo) SetEncrypted(v bool) *SnapshotInfo {
+ s.Encrypted = &v
+ return s
+}
+
+// SetOwnerId sets the OwnerId field's value.
+func (s *SnapshotInfo) SetOwnerId(v string) *SnapshotInfo {
+ s.OwnerId = &v
+ return s
+}
+
+// SetProgress sets the Progress field's value.
+func (s *SnapshotInfo) SetProgress(v string) *SnapshotInfo {
+ s.Progress = &v
+ return s
+}
+
+// SetSnapshotId sets the SnapshotId field's value.
+func (s *SnapshotInfo) SetSnapshotId(v string) *SnapshotInfo {
+ s.SnapshotId = &v
+ return s
+}
+
+// SetStartTime sets the StartTime field's value.
+func (s *SnapshotInfo) SetStartTime(v time.Time) *SnapshotInfo {
+ s.StartTime = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *SnapshotInfo) SetState(v string) *SnapshotInfo {
+ s.State = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *SnapshotInfo) SetTags(v []*Tag) *SnapshotInfo {
+ s.Tags = v
+ return s
+}
+
+// SetVolumeId sets the VolumeId field's value.
+func (s *SnapshotInfo) SetVolumeId(v string) *SnapshotInfo {
+ s.VolumeId = &v
+ return s
+}
+
+// SetVolumeSize sets the VolumeSize field's value.
+func (s *SnapshotInfo) SetVolumeSize(v int64) *SnapshotInfo {
+ s.VolumeSize = &v
+ return s
+}
+
// Details about the import snapshot task.
type SnapshotTaskDetail struct {
_ struct{} `type:"structure"`
@@ -64940,9 +86204,16 @@ type SnapshotTaskDetail struct {
// The size of the disk in the snapshot, in GiB.
DiskImageSize *float64 `locationName:"diskImageSize" type:"double"`
+ // Indicates whether the snapshot is encrypted.
+ Encrypted *bool `locationName:"encrypted" type:"boolean"`
+
// The format of the disk image from which the snapshot is created.
Format *string `locationName:"format" type:"string"`
+ // The identifier for the AWS Key Management Service (AWS KMS) customer master
+ // key (CMK) that was used to create the encrypted snapshot.
+ KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
+
// The percentage of completion for the import snapshot task.
Progress *string `locationName:"progress" type:"string"`
@@ -64984,12 +86255,24 @@ func (s *SnapshotTaskDetail) SetDiskImageSize(v float64) *SnapshotTaskDetail {
return s
}
+// SetEncrypted sets the Encrypted field's value.
+func (s *SnapshotTaskDetail) SetEncrypted(v bool) *SnapshotTaskDetail {
+ s.Encrypted = &v
+ return s
+}
+
// SetFormat sets the Format field's value.
func (s *SnapshotTaskDetail) SetFormat(v string) *SnapshotTaskDetail {
s.Format = &v
return s
}
+// SetKmsKeyId sets the KmsKeyId field's value.
+func (s *SnapshotTaskDetail) SetKmsKeyId(v string) *SnapshotTaskDetail {
+ s.KmsKeyId = &v
+ return s
+}
+
// SetProgress sets the Progress field's value.
func (s *SnapshotTaskDetail) SetProgress(v string) *SnapshotTaskDetail {
s.Progress = &v
@@ -65086,17 +86369,20 @@ func (s *SpotDatafeedSubscription) SetState(v string) *SpotDatafeedSubscription
return s
}
-// Describes the launch specification for one or more Spot Instances.
+// Describes the launch specification for one or more Spot Instances. If you
+// include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification;
+// you must use LaunchTemplateConfig (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_LaunchTemplateConfig.html).
type SpotFleetLaunchSpecification struct {
_ struct{} `type:"structure"`
// Deprecated.
AddressingType *string `locationName:"addressingType" type:"string"`
- // One or more block device mapping entries. You can't specify both a snapshot
- // ID and an encryption value. This is because only blank volumes can be encrypted
- // on creation. If a snapshot is the basis for a volume, it is not blank and
- // its encryption status is used for the volume encryption status.
+ // One or more block devices that are mapped to the Spot instances. You can't
+ // specify both a snapshot ID and an encryption value. This is because only
+ // blank volumes can be encrypted on creation. If a snapshot is the basis for
+ // a volume, it is not blank and its encryption status is used for the volume
+ // encryption status.
BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"`
// Indicates whether the instances are optimized for EBS I/O. This optimization
@@ -65133,7 +86419,10 @@ type SpotFleetLaunchSpecification struct {
// The placement information.
Placement *SpotPlacement `locationName:"placement" type:"structure"`
- // The ID of the RAM disk.
+ // The ID of the RAM disk. Some kernels require additional drivers at launch.
+ // Check the kernel requirements for information about whether you need to specify
+ // a RAM disk. To find kernel requirements, refer to the AWS Resource Center
+ // and search for the kernel ID.
RamdiskId *string `locationName:"ramdiskId" type:"string"`
// One or more security groups. When requesting instances in a VPC, you must
@@ -65154,16 +86443,16 @@ type SpotFleetLaunchSpecification struct {
// The tags to apply during creation.
TagSpecifications []*SpotFleetTagSpecification `locationName:"tagSpecificationSet" locationNameList:"item" type:"list"`
- // The Base64-encoded user data to make available to the instances.
+ // The Base64-encoded user data that instances use when starting up.
UserData *string `locationName:"userData" type:"string"`
// 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 (instances
- // or a performance characteristic such as vCPUs, memory, or I/O).
+ // 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, we round
- // the number of instances to the next whole number. If this value is not specified,
- // the default is 1.
+ // 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.
WeightedCapacity *float64 `locationName:"weightedCapacity" type:"double"`
}
@@ -65177,26 +86466,6 @@ func (s SpotFleetLaunchSpecification) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *SpotFleetLaunchSpecification) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "SpotFleetLaunchSpecification"}
- if s.NetworkInterfaces != nil {
- for i, v := range s.NetworkInterfaces {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams))
- }
- }
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetAddressingType sets the AddressingType field's value.
func (s *SpotFleetLaunchSpecification) SetAddressingType(v string) *SpotFleetLaunchSpecification {
s.AddressingType = &v
@@ -65343,24 +86612,16 @@ type SpotFleetRequestConfig struct {
ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"ActivityStatus"`
// The creation date and time of the request.
- //
- // CreateTime is a required field
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The configuration of the Spot Fleet request.
- //
- // SpotFleetRequestConfig is a required field
- SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure" required:"true"`
+ SpotFleetRequestConfig *SpotFleetRequestConfigData `locationName:"spotFleetRequestConfig" type:"structure"`
// The ID of the Spot Fleet request.
- //
- // SpotFleetRequestId is a required field
- SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string" required:"true"`
+ SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"`
// The state of the Spot Fleet request.
- //
- // SpotFleetRequestState is a required field
- SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" required:"true" enum:"BatchState"`
+ SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" enum:"BatchState"`
}
// String returns the string representation
@@ -65413,21 +86674,26 @@ type SpotFleetRequestConfigData struct {
// A unique, case-sensitive identifier that you provide to ensure the idempotency
// of your listings. This helps to avoid duplicate listings. For more information,
- // see Ensuring Idempotency (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
+ // see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html).
ClientToken *string `locationName:"clientToken" type:"string"`
- // Indicates whether running Spot Instances should be terminated if the target
- // capacity of the Spot Fleet request is decreased below the current size of
- // the Spot Fleet.
+ // Indicates whether running Spot Instances should be terminated if you decrease
+ // the target capacity of the Spot Fleet request below the current size of the
+ // Spot Fleet.
ExcessCapacityTerminationPolicy *string `locationName:"excessCapacityTerminationPolicy" type:"string" enum:"ExcessCapacityTerminationPolicy"`
// The number of units fulfilled by this request compared to the set target
- // capacity.
+ // capacity. You cannot set this value.
FulfilledCapacity *float64 `locationName:"fulfilledCapacity" type:"double"`
- // Grants the Spot Fleet permission to terminate Spot Instances on your behalf
- // when you cancel its Spot Fleet request using CancelSpotFleetRequests or when
- // the Spot Fleet request expires, if you set terminateInstancesWithExpiration.
+ // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM)
+ // role that grants the Spot Fleet the permission to request, launch, terminate,
+ // and tag instances on your behalf. For more information, see Spot Fleet Prerequisites
+ // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html#spot-fleet-prerequisites)
+ // in the Amazon EC2 User Guide for Linux Instances. Spot Fleet can terminate
+ // Spot Instances on your behalf when you cancel its Spot Fleet request using
+ // CancelSpotFleetRequests or when the Spot Fleet request expires, if you set
+ // TerminateInstancesWithExpiration.
//
// IamFleetRole is a required field
IamFleetRole *string `locationName:"iamFleetRole" type:"string" required:"true"`
@@ -65435,10 +86701,20 @@ type SpotFleetRequestConfigData struct {
// The behavior when a Spot Instance is interrupted. The default is terminate.
InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"InstanceInterruptionBehavior"`
- // The launch specifications for the Spot Fleet request.
+ // The number of Spot pools across which to allocate your target Spot capacity.
+ // Valid only when Spot AllocationStrategy is set to lowest-price. Spot Fleet
+ // selects the cheapest Spot pools and evenly allocates your target Spot capacity
+ // across the number of Spot pools that you specify.
+ InstancePoolsToUseCount *int64 `locationName:"instancePoolsToUseCount" type:"integer"`
+
+ // 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.
LaunchSpecifications []*SpotFleetLaunchSpecification `locationName:"launchSpecifications" locationNameList:"item" type:"list"`
- // The launch template and overrides.
+ // The launch template and overrides. If you specify LaunchTemplateConfigs,
+ // you can't specify LaunchSpecifications. If you include On-Demand capacity
+ // in your request, you must use LaunchTemplateConfigs.
LaunchTemplateConfigs []*LaunchTemplateConfig `locationName:"launchTemplateConfigs" locationNameList:"item" type:"list"`
// One or more Classic Load Balancers and target groups to attach to the Spot
@@ -65450,10 +86726,28 @@ type SpotFleetRequestConfigData struct {
// HS1, M1, M2, M3, and T1.
LoadBalancersConfig *LoadBalancersConfig `locationName:"loadBalancersConfig" type:"structure"`
+ // The order of the launch template overrides to use in fulfilling On-Demand
+ // capacity. If you specify lowestPrice, Spot Fleet uses price to determine
+ // the order, launching the lowest price first. If you specify prioritized,
+ // Spot Fleet uses the priority that you assign to each Spot Fleet launch template
+ // override, launching the highest priority first. If you do not specify a value,
+ // Spot Fleet defaults to lowestPrice.
+ OnDemandAllocationStrategy *string `locationName:"onDemandAllocationStrategy" type:"string" enum:"OnDemandAllocationStrategy"`
+
// The number of On-Demand units fulfilled by this request compared to the set
// target On-Demand capacity.
OnDemandFulfilledCapacity *float64 `locationName:"onDemandFulfilledCapacity" type:"double"`
+ // The maximum amount per hour for On-Demand Instances that you're willing to
+ // pay. You can use the onDemandMaxTotalPrice parameter, the spotMaxTotalPrice
+ // parameter, or both parameters to ensure that your fleet cost does not exceed
+ // your budget. If you set a maximum price per hour for the On-Demand Instances
+ // and Spot Instances in your request, Spot Fleet will launch instances until
+ // it reaches the maximum amount you're willing to pay. When the maximum amount
+ // you're willing to pay is reached, the fleet stops launching instances even
+ // if it hasn’t met the target capacity.
+ OnDemandMaxTotalPrice *string `locationName:"onDemandMaxTotalPrice" type:"string"`
+
// The number of On-Demand units to request. You can choose to set the target
// capacity in terms of instances or a performance characteristic that is important
// to your application workload, such as vCPUs, memory, or I/O. If the request
@@ -65464,40 +86758,52 @@ type SpotFleetRequestConfigData struct {
// Indicates whether Spot Fleet should replace unhealthy instances.
ReplaceUnhealthyInstances *bool `locationName:"replaceUnhealthyInstances" type:"boolean"`
+ // The maximum amount per hour for Spot Instances that you're willing to pay.
+ // You can use the spotdMaxTotalPrice parameter, the onDemandMaxTotalPrice parameter,
+ // or both parameters to ensure that your fleet cost does not exceed your budget.
+ // If you set a maximum price per hour for the On-Demand Instances and Spot
+ // Instances in your request, Spot Fleet will launch instances until it reaches
+ // the maximum amount you're willing to pay. When the maximum amount you're
+ // willing to pay is reached, the fleet stops launching instances even if it
+ // hasn’t met the target capacity.
+ SpotMaxTotalPrice *string `locationName:"spotMaxTotalPrice" type:"string"`
+
// The maximum price per unit hour that you are willing to pay for a Spot Instance.
// The default is the On-Demand price.
SpotPrice *string `locationName:"spotPrice" type:"string"`
- // The number of units to request. You can choose to set the target capacity
- // in terms of instances or a performance characteristic that is important to
- // your application workload, such as vCPUs, memory, or I/O. If the request
- // type is maintain, you can specify a target capacity of 0 and add capacity
- // later.
+ // The number of units to request for the Spot Fleet. You can choose to set
+ // the target capacity in terms of instances or a performance characteristic
+ // that is important to your application workload, such as vCPUs, memory, or
+ // I/O. If the request type is maintain, you can specify a target capacity of
+ // 0 and add capacity later.
//
// TargetCapacity is a required field
TargetCapacity *int64 `locationName:"targetCapacity" type:"integer" required:"true"`
- // Indicates whether running Spot Instances should be terminated when the Spot
- // Fleet request expires.
+ // Indicates whether running Spot Instances are terminated when the Spot Fleet
+ // request expires.
TerminateInstancesWithExpiration *bool `locationName:"terminateInstancesWithExpiration" type:"boolean"`
// The type of request. Indicates whether the Spot Fleet only requests the target
// capacity or also attempts to maintain it. When this value is request, the
// Spot Fleet only places the required requests. It does not attempt to replenish
// Spot Instances if capacity is diminished, nor does it submit requests in
- // alternative Spot pools if capacity is not available. To maintain a certain
- // target capacity, the Spot Fleet places the required requests to meet capacity
- // and automatically replenishes any interrupted instances. Default: maintain.
+ // alternative Spot pools if capacity is not available. When this value is maintain,
+ // the Spot Fleet maintains the target capacity. The Spot Fleet places the required
+ // requests to meet capacity and automatically replenishes any interrupted instances.
+ // Default: maintain. instant is listed but is not used by Spot Fleet.
Type *string `locationName:"type" type:"string" enum:"FleetType"`
- // The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- // The default is to start fulfilling the request immediately.
- ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"`
+ // The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
+ // By default, Amazon EC2 starts fulfilling the request immediately.
+ ValidFrom *time.Time `locationName:"validFrom" type:"timestamp"`
- // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- // At this point, no new Spot Instance requests are placed or able to fulfill
- // the request. The default end date is 7 days from the current date.
- ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"`
+ // The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
+ // After the end date and time, no new Spot Instance requests are placed or
+ // able to fulfill the request. If no value is specified, the Spot Fleet request
+ // remains until you cancel it.
+ ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"`
}
// String returns the string representation
@@ -65519,16 +86825,6 @@ func (s *SpotFleetRequestConfigData) Validate() error {
if s.TargetCapacity == nil {
invalidParams.Add(request.NewErrParamRequired("TargetCapacity"))
}
- if s.LaunchSpecifications != nil {
- for i, v := range s.LaunchSpecifications {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchSpecifications", i), err.(request.ErrInvalidParams))
- }
- }
- }
if s.LaunchTemplateConfigs != nil {
for i, v := range s.LaunchTemplateConfigs {
if v == nil {
@@ -65587,6 +86883,12 @@ func (s *SpotFleetRequestConfigData) SetInstanceInterruptionBehavior(v string) *
return s
}
+// SetInstancePoolsToUseCount sets the InstancePoolsToUseCount field's value.
+func (s *SpotFleetRequestConfigData) SetInstancePoolsToUseCount(v int64) *SpotFleetRequestConfigData {
+ s.InstancePoolsToUseCount = &v
+ return s
+}
+
// SetLaunchSpecifications sets the LaunchSpecifications field's value.
func (s *SpotFleetRequestConfigData) SetLaunchSpecifications(v []*SpotFleetLaunchSpecification) *SpotFleetRequestConfigData {
s.LaunchSpecifications = v
@@ -65605,12 +86907,24 @@ func (s *SpotFleetRequestConfigData) SetLoadBalancersConfig(v *LoadBalancersConf
return s
}
+// SetOnDemandAllocationStrategy sets the OnDemandAllocationStrategy field's value.
+func (s *SpotFleetRequestConfigData) SetOnDemandAllocationStrategy(v string) *SpotFleetRequestConfigData {
+ s.OnDemandAllocationStrategy = &v
+ return s
+}
+
// SetOnDemandFulfilledCapacity sets the OnDemandFulfilledCapacity field's value.
func (s *SpotFleetRequestConfigData) SetOnDemandFulfilledCapacity(v float64) *SpotFleetRequestConfigData {
s.OnDemandFulfilledCapacity = &v
return s
}
+// SetOnDemandMaxTotalPrice sets the OnDemandMaxTotalPrice field's value.
+func (s *SpotFleetRequestConfigData) SetOnDemandMaxTotalPrice(v string) *SpotFleetRequestConfigData {
+ s.OnDemandMaxTotalPrice = &v
+ return s
+}
+
// SetOnDemandTargetCapacity sets the OnDemandTargetCapacity field's value.
func (s *SpotFleetRequestConfigData) SetOnDemandTargetCapacity(v int64) *SpotFleetRequestConfigData {
s.OnDemandTargetCapacity = &v
@@ -65623,6 +86937,12 @@ func (s *SpotFleetRequestConfigData) SetReplaceUnhealthyInstances(v bool) *SpotF
return s
}
+// SetSpotMaxTotalPrice sets the SpotMaxTotalPrice field's value.
+func (s *SpotFleetRequestConfigData) SetSpotMaxTotalPrice(v string) *SpotFleetRequestConfigData {
+ s.SpotMaxTotalPrice = &v
+ return s
+}
+
// SetSpotPrice sets the SpotPrice field's value.
func (s *SpotFleetRequestConfigData) SetSpotPrice(v string) *SpotFleetRequestConfigData {
s.SpotPrice = &v
@@ -65711,7 +87031,7 @@ type SpotInstanceRequest struct {
// The date and time when the Spot Instance request was created, in UTC format
// (for example, YYYY-MM-DDTHH:MM:SSZ).
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
// The fault codes for the Spot Instance request, if any.
Fault *SpotInstanceStateFault `locationName:"fault" type:"structure"`
@@ -65743,7 +87063,7 @@ type SpotInstanceRequest struct {
SpotPrice *string `locationName:"spotPrice" type:"string"`
// The state of the Spot Instance request. Spot status information helps track
- // your Spot Instance requests. For more information, see Spot Status (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html)
+ // your Spot Instance requests. For more information, see Spot Status (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html)
// in the Amazon EC2 User Guide for Linux Instances.
State *string `locationName:"state" type:"string" enum:"SpotInstanceState"`
@@ -65758,14 +87078,14 @@ type SpotInstanceRequest struct {
// The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// The request becomes active at this date and time.
- ValidFrom *time.Time `locationName:"validFrom" type:"timestamp" timestampFormat:"iso8601"`
+ ValidFrom *time.Time `locationName:"validFrom" type:"timestamp"`
// The end date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
// If this is a one-time request, it remains active until all instances launch,
// the request is canceled, or this date is reached. If the request is persistent,
// it remains active until it is canceled or this date is reached. The default
// end date is 7 days from the current date.
- ValidUntil *time.Time `locationName:"validUntil" type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `locationName:"validUntil" type:"timestamp"`
}
// String returns the string representation
@@ -65929,7 +87249,7 @@ func (s *SpotInstanceStateFault) SetMessage(v string) *SpotInstanceStateFault {
type SpotInstanceStatus struct {
_ struct{} `type:"structure"`
- // The status code. For a list of status codes, see Spot Status Codes (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand)
+ // The status code. For a list of status codes, see Spot Status Codes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html#spot-instance-bid-status-understand)
// in the Amazon EC2 User Guide for Linux Instances.
Code *string `locationName:"code" type:"string"`
@@ -65938,7 +87258,7 @@ type SpotInstanceStatus struct {
// The date and time of the most recent status update, in UTC format (for example,
// YYYY-MM-DDTHH:MM:SSZ).
- UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"`
+ UpdateTime *time.Time `locationName:"updateTime" type:"timestamp"`
}
// String returns the string representation
@@ -65985,7 +87305,9 @@ type SpotMarketOptions struct {
// default is the On-Demand price.
MaxPrice *string `type:"string"`
- // The Spot Instance request type.
+ // The Spot Instance request type. For RunInstances, persistent Spot Instance
+ // requests are only supported when InstanceInterruptionBehavior is set to either
+ // hibernate or stop.
SpotInstanceType *string `type:"string" enum:"SpotInstanceType"`
// The end date of the request. For a one-time request, the request remains
@@ -65993,7 +87315,7 @@ type SpotMarketOptions struct {
// is reached. If the request is persistent, it remains active until it is canceled
// or this date and time is reached. The default end date is 7 days from the
// current date.
- ValidUntil *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ ValidUntil *time.Time `type:"timestamp"`
}
// String returns the string representation
@@ -66041,11 +87363,32 @@ type SpotOptions struct {
_ struct{} `type:"structure"`
// Indicates how to allocate the target capacity across the Spot pools specified
- // by the Spot Fleet request. The default is lowestPrice.
+ // by the Spot Fleet request. The default is lowest-price.
AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"SpotAllocationStrategy"`
// The behavior when a Spot Instance is interrupted. The default is terminate.
InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"SpotInstanceInterruptionBehavior"`
+
+ // The number of Spot pools across which to allocate your target Spot capacity.
+ // Valid only when AllocationStrategy is set to lowestPrice. EC2 Fleet selects
+ // the cheapest Spot pools and evenly allocates your target Spot capacity across
+ // the number of Spot pools that you specify.
+ InstancePoolsToUseCount *int64 `locationName:"instancePoolsToUseCount" type:"integer"`
+
+ // The maximum amount per hour for Spot Instances that you're willing to pay.
+ 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.
+ MinTargetCapacity *int64 `locationName:"minTargetCapacity" type:"integer"`
+
+ // Indicates that the fleet launches all Spot Instances into a single Availability
+ // Zone.
+ SingleAvailabilityZone *bool `locationName:"singleAvailabilityZone" type:"boolean"`
+
+ // Indicates that the fleet uses a single instance type to launch all Spot Instances
+ // in the fleet.
+ SingleInstanceType *bool `locationName:"singleInstanceType" type:"boolean"`
}
// String returns the string representation
@@ -66070,6 +87413,36 @@ func (s *SpotOptions) SetInstanceInterruptionBehavior(v string) *SpotOptions {
return s
}
+// SetInstancePoolsToUseCount sets the InstancePoolsToUseCount field's value.
+func (s *SpotOptions) SetInstancePoolsToUseCount(v int64) *SpotOptions {
+ s.InstancePoolsToUseCount = &v
+ return s
+}
+
+// SetMaxTotalPrice sets the MaxTotalPrice field's value.
+func (s *SpotOptions) SetMaxTotalPrice(v string) *SpotOptions {
+ s.MaxTotalPrice = &v
+ return s
+}
+
+// SetMinTargetCapacity sets the MinTargetCapacity field's value.
+func (s *SpotOptions) SetMinTargetCapacity(v int64) *SpotOptions {
+ s.MinTargetCapacity = &v
+ return s
+}
+
+// SetSingleAvailabilityZone sets the SingleAvailabilityZone field's value.
+func (s *SpotOptions) SetSingleAvailabilityZone(v bool) *SpotOptions {
+ s.SingleAvailabilityZone = &v
+ return s
+}
+
+// SetSingleInstanceType sets the SingleInstanceType field's value.
+func (s *SpotOptions) SetSingleInstanceType(v bool) *SpotOptions {
+ s.SingleInstanceType = &v
+ return s
+}
+
// Describes the configuration of Spot Instances in an EC2 Fleet request.
type SpotOptionsRequest struct {
_ struct{} `type:"structure"`
@@ -66080,6 +87453,27 @@ type SpotOptionsRequest struct {
// The behavior when a Spot Instance is interrupted. The default is terminate.
InstanceInterruptionBehavior *string `type:"string" enum:"SpotInstanceInterruptionBehavior"`
+
+ // The number of Spot pools across which to allocate your target Spot capacity.
+ // Valid only when Spot AllocationStrategy is set to lowest-price. EC2 Fleet
+ // selects the cheapest Spot pools and evenly allocates your target Spot capacity
+ // across the number of Spot pools that you specify.
+ InstancePoolsToUseCount *int64 `type:"integer"`
+
+ // The maximum amount per hour for Spot Instances that you're willing to pay.
+ 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.
+ MinTargetCapacity *int64 `type:"integer"`
+
+ // Indicates that the fleet launches all Spot Instances into a single Availability
+ // Zone.
+ SingleAvailabilityZone *bool `type:"boolean"`
+
+ // Indicates that the fleet uses a single instance type to launch all Spot Instances
+ // in the fleet.
+ SingleInstanceType *bool `type:"boolean"`
}
// String returns the string representation
@@ -66104,6 +87498,36 @@ func (s *SpotOptionsRequest) SetInstanceInterruptionBehavior(v string) *SpotOpti
return s
}
+// SetInstancePoolsToUseCount sets the InstancePoolsToUseCount field's value.
+func (s *SpotOptionsRequest) SetInstancePoolsToUseCount(v int64) *SpotOptionsRequest {
+ s.InstancePoolsToUseCount = &v
+ return s
+}
+
+// SetMaxTotalPrice sets the MaxTotalPrice field's value.
+func (s *SpotOptionsRequest) SetMaxTotalPrice(v string) *SpotOptionsRequest {
+ s.MaxTotalPrice = &v
+ return s
+}
+
+// SetMinTargetCapacity sets the MinTargetCapacity field's value.
+func (s *SpotOptionsRequest) SetMinTargetCapacity(v int64) *SpotOptionsRequest {
+ s.MinTargetCapacity = &v
+ return s
+}
+
+// SetSingleAvailabilityZone sets the SingleAvailabilityZone field's value.
+func (s *SpotOptionsRequest) SetSingleAvailabilityZone(v bool) *SpotOptionsRequest {
+ s.SingleAvailabilityZone = &v
+ return s
+}
+
+// SetSingleInstanceType sets the SingleInstanceType field's value.
+func (s *SpotOptionsRequest) SetSingleInstanceType(v bool) *SpotOptionsRequest {
+ s.SingleInstanceType = &v
+ return s
+}
+
// Describes Spot Instance placement.
type SpotPlacement struct {
_ struct{} `type:"structure"`
@@ -66169,7 +87593,7 @@ type SpotPrice struct {
SpotPrice *string `locationName:"spotPrice" type:"string"`
// The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
}
// String returns the string representation
@@ -66224,19 +87648,19 @@ type StaleIpPermission struct {
// (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
IpProtocol *string `locationName:"ipProtocol" type:"string"`
- // One or more IP ranges. Not applicable for stale security group rules.
+ // The IP ranges. Not applicable for stale security group rules.
IpRanges []*string `locationName:"ipRanges" locationNameList:"item" type:"list"`
- // One or more prefix list IDs for an AWS service. Not applicable for stale
- // security group rules.
+ // The prefix list IDs for an AWS service. 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.
ToPort *int64 `locationName:"toPort" type:"integer"`
- // One or more security group pairs. Returns the ID of the referenced security
- // group and VPC, and the ID and status of the VPC peering connection.
+ // The security group pairs. Returns the ID of the referenced security group
+ // and VPC, and the ID and status of the VPC peering connection.
UserIdGroupPairs []*UserIdGroupPair `locationName:"groups" locationNameList:"item" type:"list"`
}
@@ -66294,9 +87718,7 @@ type StaleSecurityGroup struct {
Description *string `locationName:"description" type:"string"`
// The ID of the security group.
- //
- // GroupId is a required field
- GroupId *string `locationName:"groupId" type:"string" required:"true"`
+ GroupId *string `locationName:"groupId" type:"string"`
// The name of the security group.
GroupName *string `locationName:"groupName" type:"string"`
@@ -66357,7 +87779,6 @@ func (s *StaleSecurityGroup) SetVpcId(v string) *StaleSecurityGroup {
return s
}
-// Contains the parameters for StartInstances.
type StartInstancesInput struct {
_ struct{} `type:"structure"`
@@ -66370,7 +87791,7 @@ type StartInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more instance IDs.
+ // The IDs of the instances.
//
// InstanceIds is a required field
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"`
@@ -66417,11 +87838,10 @@ func (s *StartInstancesInput) SetInstanceIds(v []*string) *StartInstancesInput {
return s
}
-// Contains the output of StartInstances.
type StartInstancesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more started instances.
+ // Information about the started instances.
StartingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"`
}
@@ -66450,19 +87870,23 @@ type StateReason struct {
// The message for the state change.
//
- // * Server.InsufficientInstanceCapacity: There was insufficient instance
- // capacity to satisfy the launch request.
+ // * Server.InsufficientInstanceCapacity: There was insufficient capacity
+ // available to satisfy the launch request.
//
- // * Server.InternalError: An internal error occurred during instance launch,
- // resulting in termination.
+ // * Server.InternalError: An internal error caused the instance to terminate
+ // during launch.
//
// * Server.ScheduledStop: The instance was stopped due to a scheduled retirement.
//
- // * Server.SpotInstanceTermination: A Spot Instance was terminated due to
- // an increase in the Spot price.
+ // * Server.SpotInstanceShutdown: The instance was stopped because the number
+ // of Spot requests with a maximum price equal to or higher than the Spot
+ // price exceeded available capacity or because of an increase in the Spot
+ // price.
//
- // * Client.InternalError: A client error caused the instance to terminate
- // on launch.
+ // * Server.SpotInstanceTermination: The instance was terminated because
+ // the number of Spot requests with a maximum price equal to or higher than
+ // the Spot price exceeded available capacity or because of an increase in
+ // the Spot price.
//
// * Client.InstanceInitiatedShutdown: The instance was shut down using the
// shutdown -h command from the instance.
@@ -66470,14 +87894,19 @@ type StateReason struct {
// * Client.InstanceTerminated: The instance was terminated or rebooted during
// AMI creation.
//
+ // * Client.InternalError: A client error caused the instance to terminate
+ // during launch.
+ //
+ // * Client.InvalidSnapshot.NotFound: The specified snapshot was not found.
+ //
+ // * Client.UserInitiatedHibernate: Hibernation was initiated on the instance.
+ //
// * Client.UserInitiatedShutdown: The instance was shut down using the Amazon
// EC2 API.
//
// * Client.VolumeLimitExceeded: The limit on the number of EBS volumes or
// total storage was exceeded. Decrease usage or request an increase in your
- // limits.
- //
- // * Client.InvalidSnapshot.NotFound: The specified snapshot was not found.
+ // account limits.
Message *string `locationName:"message" type:"string"`
}
@@ -66503,7 +87932,6 @@ func (s *StateReason) SetMessage(v string) *StateReason {
return s
}
-// Contains the parameters for StopInstances.
type StopInstancesInput struct {
_ struct{} `type:"structure"`
@@ -66521,7 +87949,15 @@ type StopInstancesInput struct {
// Default: false
Force *bool `locationName:"force" type:"boolean"`
- // One or more instance IDs.
+ // Hibernates the instance if the instance was enabled for hibernation at launch.
+ // If the instance cannot hibernate successfully, a normal shutdown occurs.
+ // 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.
+ //
+ // Default: false
+ Hibernate *bool `type:"boolean"`
+
+ // The IDs of the instances.
//
// InstanceIds is a required field
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"`
@@ -66562,17 +87998,22 @@ func (s *StopInstancesInput) SetForce(v bool) *StopInstancesInput {
return s
}
+// SetHibernate sets the Hibernate field's value.
+func (s *StopInstancesInput) SetHibernate(v bool) *StopInstancesInput {
+ s.Hibernate = &v
+ return s
+}
+
// SetInstanceIds sets the InstanceIds field's value.
func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput {
s.InstanceIds = v
return s
}
-// Contains the output of StopInstances.
type StopInstancesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more stopped instances.
+ // Information about the stopped instances.
StoppingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"`
}
@@ -66660,8 +88101,11 @@ type Subnet struct {
// The Availability Zone of the subnet.
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
- // The number of unused private IPv4 addresses in the subnet. Note that the
- // IPv4 addresses for any stopped instances are considered unavailable.
+ // The AZ ID of the subnet.
+ AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"`
+
+ // The number of unused private IPv4 addresses in the subnet. The IPv4 addresses
+ // for any stopped instances are considered unavailable.
AvailableIpAddressCount *int64 `locationName:"availableIpAddressCount" type:"integer"`
// The IPv4 CIDR block assigned to the subnet.
@@ -66677,9 +88121,15 @@ type Subnet struct {
// address.
MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"`
+ // The ID of the AWS account that owns the subnet.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// The current state of the subnet.
State *string `locationName:"state" type:"string" enum:"SubnetState"`
+ // The Amazon Resource Name (ARN) of the subnet.
+ SubnetArn *string `locationName:"subnetArn" type:"string"`
+
// The ID of the subnet.
SubnetId *string `locationName:"subnetId" type:"string"`
@@ -66712,6 +88162,12 @@ func (s *Subnet) SetAvailabilityZone(v string) *Subnet {
return s
}
+// SetAvailabilityZoneId sets the AvailabilityZoneId field's value.
+func (s *Subnet) SetAvailabilityZoneId(v string) *Subnet {
+ s.AvailabilityZoneId = &v
+ return s
+}
+
// SetAvailableIpAddressCount sets the AvailableIpAddressCount field's value.
func (s *Subnet) SetAvailableIpAddressCount(v int64) *Subnet {
s.AvailableIpAddressCount = &v
@@ -66742,12 +88198,24 @@ func (s *Subnet) SetMapPublicIpOnLaunch(v bool) *Subnet {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *Subnet) SetOwnerId(v string) *Subnet {
+ s.OwnerId = &v
+ return s
+}
+
// SetState sets the State field's value.
func (s *Subnet) SetState(v string) *Subnet {
s.State = &v
return s
}
+// SetSubnetArn sets the SubnetArn field's value.
+func (s *Subnet) SetSubnetArn(v string) *Subnet {
+ s.SubnetArn = &v
+ return s
+}
+
// SetSubnetId sets the SubnetId field's value.
func (s *Subnet) SetSubnetId(v string) *Subnet {
s.SubnetId = &v
@@ -66841,7 +88309,7 @@ func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *SubnetCidrBloc
return s
}
-// Describes the T2 instance whose credit option for CPU usage was successfully
+// Describes the T2 or T3 instance whose credit option for CPU usage was successfully
// modified.
type SuccessfulInstanceCreditSpecificationItem struct {
_ struct{} `type:"structure"`
@@ -66873,7 +88341,7 @@ type Tag struct {
// The key of the tag.
//
// Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode
- // characters. May not begin with aws:
+ // characters. May not begin with aws:.
Key *string `locationName:"key" type:"string"`
// The value of the tag.
@@ -66912,7 +88380,7 @@ type TagDescription struct {
// The tag key.
Key *string `locationName:"key" type:"string"`
- // The ID of the resource. For example, ami-1a2b3c4d.
+ // The ID of the resource.
ResourceId *string `locationName:"resourceId" type:"string"`
// The resource type.
@@ -66961,7 +88429,11 @@ type TagSpecification struct {
_ struct{} `type:"structure"`
// The type of resource to tag. Currently, the resource types that support tagging
- // on creation are instance, snapshot, and volume.
+ // on creation are: capacity-reservation | client-vpn-endpoint | dedicated-host
+ // | fleet | instance | launch-template | snapshot | transit-gateway | transit-gateway-attachment
+ // | transit-gateway-route-table | volume.
+ //
+ // To tag a resource after it has been created, see CreateTags.
ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"`
// The tags to apply to the resource.
@@ -66995,16 +88467,27 @@ func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification {
// your application workload, such as vCPUs, memory, or I/O. If the request
// type is maintain, you can specify a target capacity of 0 and add capacity
// later.
+//
+// You can use the On-Demand Instance MaxTotalPrice parameter, the Spot Instance
+// MaxTotalPrice, or both to ensure your fleet cost does not exceed your budget.
+// If you set a maximum price per hour for the On-Demand Instances and Spot
+// Instances in your request, EC2 Fleet will launch instances until it reaches
+// the maximum amount you're willing to pay. When the maximum amount you're
+// willing to pay is reached, the fleet stops launching instances even if it
+// hasn’t met the target capacity. The MaxTotalPrice parameters are located
+// in and
type TargetCapacitySpecification struct {
_ struct{} `type:"structure"`
// The default TotalTargetCapacity, which is either Spot or On-Demand.
DefaultTargetCapacityType *string `locationName:"defaultTargetCapacityType" type:"string" enum:"DefaultTargetCapacityType"`
- // The number of On-Demand units to request.
+ // The number of On-Demand units to request. If you specify a target capacity
+ // for Spot units, you cannot specify a target capacity for On-Demand units.
OnDemandTargetCapacity *int64 `locationName:"onDemandTargetCapacity" type:"integer"`
- // The maximum number of Spot units to launch.
+ // The maximum number of Spot units to launch. If you specify a target capacity
+ // for On-Demand units, you cannot specify a target capacity for Spot units.
SpotTargetCapacity *int64 `locationName:"spotTargetCapacity" type:"integer"`
// The number of units to request, filled using DefaultTargetCapacityType.
@@ -67046,10 +88529,19 @@ func (s *TargetCapacitySpecification) SetTotalTargetCapacity(v int64) *TargetCap
}
// The number of units to request. You can choose to set the target capacity
-// in terms of instances or a performance characteristic that is important to
-// your application workload, such as vCPUs, memory, or I/O. If the request
-// type is maintain, you can specify a target capacity of 0 and add capacity
-// later.
+// as the number of instances. Or you can set the target capacity to a performance
+// characteristic that is important to your application workload, such as vCPUs,
+// memory, or I/O. If the request type is maintain, you can specify a target
+// capacity of 0 and add capacity later.
+//
+// You can use the On-Demand Instance MaxTotalPrice parameter, the Spot Instance
+// MaxTotalPrice parameter, or both parameters to ensure that your fleet cost
+// does not exceed your budget. If you set a maximum price per hour for the
+// On-Demand Instances and Spot Instances in your request, EC2 Fleet will launch
+// instances until it reaches the maximum amount you're willing to pay. When
+// the maximum amount you're willing to pay is reached, the fleet stops launching
+// instances even if it hasn’t met the target capacity. The MaxTotalPrice
+// parameters are located in and .
type TargetCapacitySpecificationRequest struct {
_ struct{} `type:"structure"`
@@ -67203,9 +88695,7 @@ type TargetGroup struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the target group.
- //
- // Arn is a required field
- Arn *string `locationName:"arn" type:"string" required:"true"`
+ Arn *string `locationName:"arn" type:"string"`
}
// String returns the string representation
@@ -67218,19 +88708,6 @@ func (s TargetGroup) GoString() string {
return s.String()
}
-// Validate inspects the fields of the type to determine if they are valid.
-func (s *TargetGroup) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "TargetGroup"}
- if s.Arn == nil {
- invalidParams.Add(request.NewErrParamRequired("Arn"))
- }
-
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
-}
-
// SetArn sets the Arn field's value.
func (s *TargetGroup) SetArn(v string) *TargetGroup {
s.Arn = &v
@@ -67243,9 +88720,7 @@ type TargetGroupsConfig struct {
_ struct{} `type:"structure"`
// One or more target groups.
- //
- // TargetGroups is a required field
- TargetGroups []*TargetGroup `locationName:"targetGroups" locationNameList:"item" min:"1" type:"list" required:"true"`
+ TargetGroups []*TargetGroup `locationName:"targetGroups" locationNameList:"item" min:"1" type:"list"`
}
// String returns the string representation
@@ -67261,22 +88736,9 @@ func (s TargetGroupsConfig) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *TargetGroupsConfig) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "TargetGroupsConfig"}
- if s.TargetGroups == nil {
- invalidParams.Add(request.NewErrParamRequired("TargetGroups"))
- }
if s.TargetGroups != nil && len(s.TargetGroups) < 1 {
invalidParams.Add(request.NewErrParamMinLen("TargetGroups", 1))
}
- if s.TargetGroups != nil {
- for i, v := range s.TargetGroups {
- if v == nil {
- continue
- }
- if err := v.Validate(); err != nil {
- invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGroups", i), err.(request.ErrInvalidParams))
- }
- }
- }
if invalidParams.Len() > 0 {
return invalidParams
@@ -67290,6 +88752,75 @@ func (s *TargetGroupsConfig) SetTargetGroups(v []*TargetGroup) *TargetGroupsConf
return s
}
+// Describes a target network associated with a Client VPN endpoint.
+type TargetNetwork struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the association.
+ AssociationId *string `locationName:"associationId" type:"string"`
+
+ // The ID of the Client VPN endpoint with which the target network is associated.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // The IDs of the security groups applied to the target network association.
+ SecurityGroups []*string `locationName:"securityGroups" locationNameList:"item" type:"list"`
+
+ // The current state of the target network association.
+ Status *AssociationStatus `locationName:"status" type:"structure"`
+
+ // The ID of the subnet specified as the target network.
+ TargetNetworkId *string `locationName:"targetNetworkId" type:"string"`
+
+ // The ID of the VPC in which the target network (subnet) is located.
+ VpcId *string `locationName:"vpcId" type:"string"`
+}
+
+// String returns the string representation
+func (s TargetNetwork) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TargetNetwork) GoString() string {
+ return s.String()
+}
+
+// SetAssociationId sets the AssociationId field's value.
+func (s *TargetNetwork) SetAssociationId(v string) *TargetNetwork {
+ s.AssociationId = &v
+ return s
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *TargetNetwork) SetClientVpnEndpointId(v string) *TargetNetwork {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetSecurityGroups sets the SecurityGroups field's value.
+func (s *TargetNetwork) SetSecurityGroups(v []*string) *TargetNetwork {
+ s.SecurityGroups = v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *TargetNetwork) SetStatus(v *AssociationStatus) *TargetNetwork {
+ s.Status = v
+ return s
+}
+
+// SetTargetNetworkId sets the TargetNetworkId field's value.
+func (s *TargetNetwork) SetTargetNetworkId(v string) *TargetNetwork {
+ s.TargetNetworkId = &v
+ return s
+}
+
+// SetVpcId sets the VpcId field's value.
+func (s *TargetNetwork) SetVpcId(v string) *TargetNetwork {
+ s.VpcId = &v
+ return s
+}
+
// The total value of the new Convertible Reserved Instances.
type TargetReservationValue struct {
_ struct{} `type:"structure"`
@@ -67326,7 +88857,159 @@ func (s *TargetReservationValue) SetTargetConfiguration(v *TargetConfiguration)
return s
}
-// Contains the parameters for TerminateInstances.
+type TerminateClientVpnConnectionsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint to which the client is connected.
+ //
+ // ClientVpnEndpointId is a required field
+ ClientVpnEndpointId *string `type:"string" required:"true"`
+
+ // The ID of the client connection to be terminated.
+ ConnectionId *string `type:"string"`
+
+ // 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 name of the user who initiated the connection. Use this option to terminate
+ // all active connections for the specified user. This option can only be used
+ // if the user has established up to five connections.
+ Username *string `type:"string"`
+}
+
+// String returns the string representation
+func (s TerminateClientVpnConnectionsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TerminateClientVpnConnectionsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TerminateClientVpnConnectionsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TerminateClientVpnConnectionsInput"}
+ if s.ClientVpnEndpointId == nil {
+ invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *TerminateClientVpnConnectionsInput) SetClientVpnEndpointId(v string) *TerminateClientVpnConnectionsInput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetConnectionId sets the ConnectionId field's value.
+func (s *TerminateClientVpnConnectionsInput) SetConnectionId(v string) *TerminateClientVpnConnectionsInput {
+ s.ConnectionId = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *TerminateClientVpnConnectionsInput) SetDryRun(v bool) *TerminateClientVpnConnectionsInput {
+ s.DryRun = &v
+ return s
+}
+
+// SetUsername sets the Username field's value.
+func (s *TerminateClientVpnConnectionsInput) SetUsername(v string) *TerminateClientVpnConnectionsInput {
+ s.Username = &v
+ return s
+}
+
+type TerminateClientVpnConnectionsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the Client VPN endpoint.
+ ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"`
+
+ // The current state of the client connections.
+ ConnectionStatuses []*TerminateConnectionStatus `locationName:"connectionStatuses" locationNameList:"item" type:"list"`
+
+ // The user who established the terminated client connections.
+ Username *string `locationName:"username" type:"string"`
+}
+
+// String returns the string representation
+func (s TerminateClientVpnConnectionsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TerminateClientVpnConnectionsOutput) GoString() string {
+ return s.String()
+}
+
+// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value.
+func (s *TerminateClientVpnConnectionsOutput) SetClientVpnEndpointId(v string) *TerminateClientVpnConnectionsOutput {
+ s.ClientVpnEndpointId = &v
+ return s
+}
+
+// SetConnectionStatuses sets the ConnectionStatuses field's value.
+func (s *TerminateClientVpnConnectionsOutput) SetConnectionStatuses(v []*TerminateConnectionStatus) *TerminateClientVpnConnectionsOutput {
+ s.ConnectionStatuses = v
+ return s
+}
+
+// SetUsername sets the Username field's value.
+func (s *TerminateClientVpnConnectionsOutput) SetUsername(v string) *TerminateClientVpnConnectionsOutput {
+ s.Username = &v
+ return s
+}
+
+// Information about a terminated Client VPN endpoint client connection.
+type TerminateConnectionStatus struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the client connection.
+ ConnectionId *string `locationName:"connectionId" type:"string"`
+
+ // A message about the status of the client connection, if applicable.
+ CurrentStatus *ClientVpnConnectionStatus `locationName:"currentStatus" type:"structure"`
+
+ // The state of the client connection.
+ PreviousStatus *ClientVpnConnectionStatus `locationName:"previousStatus" type:"structure"`
+}
+
+// String returns the string representation
+func (s TerminateConnectionStatus) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TerminateConnectionStatus) GoString() string {
+ return s.String()
+}
+
+// SetConnectionId sets the ConnectionId field's value.
+func (s *TerminateConnectionStatus) SetConnectionId(v string) *TerminateConnectionStatus {
+ s.ConnectionId = &v
+ return s
+}
+
+// SetCurrentStatus sets the CurrentStatus field's value.
+func (s *TerminateConnectionStatus) SetCurrentStatus(v *ClientVpnConnectionStatus) *TerminateConnectionStatus {
+ s.CurrentStatus = v
+ return s
+}
+
+// SetPreviousStatus sets the PreviousStatus field's value.
+func (s *TerminateConnectionStatus) SetPreviousStatus(v *ClientVpnConnectionStatus) *TerminateConnectionStatus {
+ s.PreviousStatus = v
+ return s
+}
+
type TerminateInstancesInput struct {
_ struct{} `type:"structure"`
@@ -67336,7 +89019,7 @@ type TerminateInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more instance IDs.
+ // The IDs of the instances.
//
// Constraints: Up to 1000 instance IDs. We recommend breaking up this request
// into smaller batches.
@@ -67380,11 +89063,10 @@ func (s *TerminateInstancesInput) SetInstanceIds(v []*string) *TerminateInstance
return s
}
-// Contains the output of TerminateInstances.
type TerminateInstancesOutput struct {
_ struct{} `type:"structure"`
- // Information about one or more terminated instances.
+ // Information about the terminated instances.
TerminatingInstances []*InstanceStateChange `locationName:"instancesSet" locationNameList:"item" type:"list"`
}
@@ -67404,6 +89086,1400 @@ func (s *TerminateInstancesOutput) SetTerminatingInstances(v []*InstanceStateCha
return s
}
+// Describes the Traffic Mirror filter.
+type TrafficMirrorFilter struct {
+ _ struct{} `type:"structure"`
+
+ // The description of the Traffic Mirror filter.
+ Description *string `locationName:"description" type:"string"`
+
+ // Information about the egress rules that are associated with the Traffic Mirror
+ // filter.
+ EgressFilterRules []*TrafficMirrorFilterRule `locationName:"egressFilterRuleSet" locationNameList:"item" type:"list"`
+
+ // Information about the ingress rules that are associated with the Traffic
+ // Mirror filter.
+ IngressFilterRules []*TrafficMirrorFilterRule `locationName:"ingressFilterRuleSet" locationNameList:"item" type:"list"`
+
+ // The network service traffic that is associated with the Traffic Mirror filter.
+ NetworkServices []*string `locationName:"networkServiceSet" locationNameList:"item" type:"list"`
+
+ // The tags assigned to the Traffic Mirror filter.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the Traffic Mirror filter.
+ TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorFilter) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorFilter) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *TrafficMirrorFilter) SetDescription(v string) *TrafficMirrorFilter {
+ s.Description = &v
+ return s
+}
+
+// SetEgressFilterRules sets the EgressFilterRules field's value.
+func (s *TrafficMirrorFilter) SetEgressFilterRules(v []*TrafficMirrorFilterRule) *TrafficMirrorFilter {
+ s.EgressFilterRules = v
+ return s
+}
+
+// SetIngressFilterRules sets the IngressFilterRules field's value.
+func (s *TrafficMirrorFilter) SetIngressFilterRules(v []*TrafficMirrorFilterRule) *TrafficMirrorFilter {
+ s.IngressFilterRules = v
+ return s
+}
+
+// SetNetworkServices sets the NetworkServices field's value.
+func (s *TrafficMirrorFilter) SetNetworkServices(v []*string) *TrafficMirrorFilter {
+ s.NetworkServices = v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TrafficMirrorFilter) SetTags(v []*Tag) *TrafficMirrorFilter {
+ s.Tags = v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *TrafficMirrorFilter) SetTrafficMirrorFilterId(v string) *TrafficMirrorFilter {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// Describes the Traffic Mirror rule.
+type TrafficMirrorFilterRule struct {
+ _ struct{} `type:"structure"`
+
+ // The description of the Traffic Mirror rule.
+ Description *string `locationName:"description" type:"string"`
+
+ // The destination CIDR block assigned to the Traffic Mirror rule.
+ DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"`
+
+ // The destination port range assigned to the Traffic Mirror rule.
+ DestinationPortRange *TrafficMirrorPortRange `locationName:"destinationPortRange" type:"structure"`
+
+ // The protocol assigned to the Traffic Mirror rule.
+ Protocol *int64 `locationName:"protocol" type:"integer"`
+
+ // The action assigned to the Traffic Mirror rule.
+ RuleAction *string `locationName:"ruleAction" type:"string" enum:"TrafficMirrorRuleAction"`
+
+ // The rule number of the Traffic Mirror rule.
+ RuleNumber *int64 `locationName:"ruleNumber" type:"integer"`
+
+ // The source CIDR block assigned to the Traffic Mirror rule.
+ SourceCidrBlock *string `locationName:"sourceCidrBlock" type:"string"`
+
+ // The source port range assigned to the Traffic Mirror rule.
+ SourcePortRange *TrafficMirrorPortRange `locationName:"sourcePortRange" type:"structure"`
+
+ // The traffic direction assigned to the Traffic Mirror rule.
+ TrafficDirection *string `locationName:"trafficDirection" type:"string" enum:"TrafficDirection"`
+
+ // The ID of the Traffic Mirror filter that the rule is associated with.
+ TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"`
+
+ // The ID of the Traffic Mirror rule.
+ TrafficMirrorFilterRuleId *string `locationName:"trafficMirrorFilterRuleId" type:"string"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorFilterRule) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorFilterRule) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *TrafficMirrorFilterRule) SetDescription(v string) *TrafficMirrorFilterRule {
+ s.Description = &v
+ return s
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *TrafficMirrorFilterRule) SetDestinationCidrBlock(v string) *TrafficMirrorFilterRule {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetDestinationPortRange sets the DestinationPortRange field's value.
+func (s *TrafficMirrorFilterRule) SetDestinationPortRange(v *TrafficMirrorPortRange) *TrafficMirrorFilterRule {
+ s.DestinationPortRange = v
+ return s
+}
+
+// SetProtocol sets the Protocol field's value.
+func (s *TrafficMirrorFilterRule) SetProtocol(v int64) *TrafficMirrorFilterRule {
+ s.Protocol = &v
+ return s
+}
+
+// SetRuleAction sets the RuleAction field's value.
+func (s *TrafficMirrorFilterRule) SetRuleAction(v string) *TrafficMirrorFilterRule {
+ s.RuleAction = &v
+ return s
+}
+
+// SetRuleNumber sets the RuleNumber field's value.
+func (s *TrafficMirrorFilterRule) SetRuleNumber(v int64) *TrafficMirrorFilterRule {
+ s.RuleNumber = &v
+ return s
+}
+
+// SetSourceCidrBlock sets the SourceCidrBlock field's value.
+func (s *TrafficMirrorFilterRule) SetSourceCidrBlock(v string) *TrafficMirrorFilterRule {
+ s.SourceCidrBlock = &v
+ return s
+}
+
+// SetSourcePortRange sets the SourcePortRange field's value.
+func (s *TrafficMirrorFilterRule) SetSourcePortRange(v *TrafficMirrorPortRange) *TrafficMirrorFilterRule {
+ s.SourcePortRange = v
+ return s
+}
+
+// SetTrafficDirection sets the TrafficDirection field's value.
+func (s *TrafficMirrorFilterRule) SetTrafficDirection(v string) *TrafficMirrorFilterRule {
+ s.TrafficDirection = &v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *TrafficMirrorFilterRule) SetTrafficMirrorFilterId(v string) *TrafficMirrorFilterRule {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value.
+func (s *TrafficMirrorFilterRule) SetTrafficMirrorFilterRuleId(v string) *TrafficMirrorFilterRule {
+ s.TrafficMirrorFilterRuleId = &v
+ return s
+}
+
+// Describes the Traffic Mirror port range.
+type TrafficMirrorPortRange struct {
+ _ struct{} `type:"structure"`
+
+ // The start of the Traffic Mirror port range. This applies to the TCP and UDP
+ // protocols.
+ FromPort *int64 `locationName:"fromPort" type:"integer"`
+
+ // The end of the Traffic Mirror port range. This applies to the TCP and UDP
+ // protocols.
+ ToPort *int64 `locationName:"toPort" type:"integer"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorPortRange) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorPortRange) GoString() string {
+ return s.String()
+}
+
+// SetFromPort sets the FromPort field's value.
+func (s *TrafficMirrorPortRange) SetFromPort(v int64) *TrafficMirrorPortRange {
+ s.FromPort = &v
+ return s
+}
+
+// SetToPort sets the ToPort field's value.
+func (s *TrafficMirrorPortRange) SetToPort(v int64) *TrafficMirrorPortRange {
+ s.ToPort = &v
+ return s
+}
+
+// Information about the Traffic Mirror filter rule port range.
+type TrafficMirrorPortRangeRequest struct {
+ _ struct{} `type:"structure"`
+
+ // The first port in the Traffic Mirror port range. This applies to the TCP
+ // and UDP protocols.
+ FromPort *int64 `type:"integer"`
+
+ // The last port in the Traffic Mirror port range. This applies to the TCP and
+ // UDP protocols.
+ ToPort *int64 `type:"integer"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorPortRangeRequest) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorPortRangeRequest) GoString() string {
+ return s.String()
+}
+
+// SetFromPort sets the FromPort field's value.
+func (s *TrafficMirrorPortRangeRequest) SetFromPort(v int64) *TrafficMirrorPortRangeRequest {
+ s.FromPort = &v
+ return s
+}
+
+// SetToPort sets the ToPort field's value.
+func (s *TrafficMirrorPortRangeRequest) SetToPort(v int64) *TrafficMirrorPortRangeRequest {
+ s.ToPort = &v
+ return s
+}
+
+// Describes a Traffic Mirror session.
+type TrafficMirrorSession struct {
+ _ struct{} `type:"structure"`
+
+ // The description of the Traffic Mirror session.
+ Description *string `locationName:"description" type:"string"`
+
+ // The ID of the Traffic Mirror session's network interface.
+ NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"`
+
+ // The ID of the account that owns the Traffic Mirror session.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // The number of bytes in each packet to mirror. These are the bytes after the
+ // VXLAN header. To mirror a subset, set this to the length (in bytes) to mirror.
+ // For example, if you set this value to 100, then the first 100 bytes that
+ // meet the filter criteria are copied to the target. Do not specify this parameter
+ // when you want to mirror the entire packet
+ PacketLength *int64 `locationName:"packetLength" type:"integer"`
+
+ // The session number determines the order in which sessions are evaluated when
+ // an interface is used by multiple sessions. The first session with a matching
+ // filter is the one that mirrors the packets.
+ //
+ // Valid values are 1-32766.
+ SessionNumber *int64 `locationName:"sessionNumber" type:"integer"`
+
+ // The tags assigned to the Traffic Mirror session.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the Traffic Mirror filter.
+ TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"`
+
+ // The ID for the Traffic Mirror session.
+ TrafficMirrorSessionId *string `locationName:"trafficMirrorSessionId" type:"string"`
+
+ // The ID of the Traffic Mirror target.
+ TrafficMirrorTargetId *string `locationName:"trafficMirrorTargetId" type:"string"`
+
+ // The virtual network ID associated with the Traffic Mirror session.
+ VirtualNetworkId *int64 `locationName:"virtualNetworkId" type:"integer"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorSession) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorSession) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *TrafficMirrorSession) SetDescription(v string) *TrafficMirrorSession {
+ s.Description = &v
+ return s
+}
+
+// SetNetworkInterfaceId sets the NetworkInterfaceId field's value.
+func (s *TrafficMirrorSession) SetNetworkInterfaceId(v string) *TrafficMirrorSession {
+ s.NetworkInterfaceId = &v
+ return s
+}
+
+// SetOwnerId sets the OwnerId field's value.
+func (s *TrafficMirrorSession) SetOwnerId(v string) *TrafficMirrorSession {
+ s.OwnerId = &v
+ return s
+}
+
+// SetPacketLength sets the PacketLength field's value.
+func (s *TrafficMirrorSession) SetPacketLength(v int64) *TrafficMirrorSession {
+ s.PacketLength = &v
+ return s
+}
+
+// SetSessionNumber sets the SessionNumber field's value.
+func (s *TrafficMirrorSession) SetSessionNumber(v int64) *TrafficMirrorSession {
+ s.SessionNumber = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TrafficMirrorSession) SetTags(v []*Tag) *TrafficMirrorSession {
+ s.Tags = v
+ return s
+}
+
+// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value.
+func (s *TrafficMirrorSession) SetTrafficMirrorFilterId(v string) *TrafficMirrorSession {
+ s.TrafficMirrorFilterId = &v
+ return s
+}
+
+// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value.
+func (s *TrafficMirrorSession) SetTrafficMirrorSessionId(v string) *TrafficMirrorSession {
+ s.TrafficMirrorSessionId = &v
+ return s
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *TrafficMirrorSession) SetTrafficMirrorTargetId(v string) *TrafficMirrorSession {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+// SetVirtualNetworkId sets the VirtualNetworkId field's value.
+func (s *TrafficMirrorSession) SetVirtualNetworkId(v int64) *TrafficMirrorSession {
+ s.VirtualNetworkId = &v
+ return s
+}
+
+// Describes a Traffic Mirror target.
+type TrafficMirrorTarget struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the Traffic Mirror target.
+ Description *string `locationName:"description" type:"string"`
+
+ // The network interface ID that is attached to the target.
+ NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"`
+
+ // The Amazon Resource Name (ARN) of the Network Load Balancer.
+ NetworkLoadBalancerArn *string `locationName:"networkLoadBalancerArn" type:"string"`
+
+ // The ID of the account that owns the Traffic Mirror target.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // The tags assigned to the Traffic Mirror target.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the Traffic Mirror target.
+ TrafficMirrorTargetId *string `locationName:"trafficMirrorTargetId" type:"string"`
+
+ // The type of Traffic Mirror target.
+ Type *string `locationName:"type" type:"string" enum:"TrafficMirrorTargetType"`
+}
+
+// String returns the string representation
+func (s TrafficMirrorTarget) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TrafficMirrorTarget) GoString() string {
+ return s.String()
+}
+
+// SetDescription sets the Description field's value.
+func (s *TrafficMirrorTarget) SetDescription(v string) *TrafficMirrorTarget {
+ s.Description = &v
+ return s
+}
+
+// SetNetworkInterfaceId sets the NetworkInterfaceId field's value.
+func (s *TrafficMirrorTarget) SetNetworkInterfaceId(v string) *TrafficMirrorTarget {
+ s.NetworkInterfaceId = &v
+ return s
+}
+
+// SetNetworkLoadBalancerArn sets the NetworkLoadBalancerArn field's value.
+func (s *TrafficMirrorTarget) SetNetworkLoadBalancerArn(v string) *TrafficMirrorTarget {
+ s.NetworkLoadBalancerArn = &v
+ return s
+}
+
+// SetOwnerId sets the OwnerId field's value.
+func (s *TrafficMirrorTarget) SetOwnerId(v string) *TrafficMirrorTarget {
+ s.OwnerId = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TrafficMirrorTarget) SetTags(v []*Tag) *TrafficMirrorTarget {
+ s.Tags = v
+ return s
+}
+
+// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value.
+func (s *TrafficMirrorTarget) SetTrafficMirrorTargetId(v string) *TrafficMirrorTarget {
+ s.TrafficMirrorTargetId = &v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *TrafficMirrorTarget) SetType(v string) *TrafficMirrorTarget {
+ s.Type = &v
+ return s
+}
+
+// Describes a transit gateway.
+type TransitGateway struct {
+ _ struct{} `type:"structure"`
+
+ // The creation time.
+ CreationTime *time.Time `locationName:"creationTime" type:"timestamp"`
+
+ // The description of the transit gateway.
+ Description *string `locationName:"description" type:"string"`
+
+ // The transit gateway options.
+ Options *TransitGatewayOptions `locationName:"options" type:"structure"`
+
+ // The ID of the AWS account ID that owns the transit gateway.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
+ // The state of the transit gateway.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayState"`
+
+ // The tags for the transit gateway.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The Amazon Resource Name (ARN) of the transit gateway.
+ TransitGatewayArn *string `locationName:"transitGatewayArn" type:"string"`
+
+ // The ID of the transit gateway.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGateway) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGateway) GoString() string {
+ return s.String()
+}
+
+// SetCreationTime sets the CreationTime field's value.
+func (s *TransitGateway) SetCreationTime(v time.Time) *TransitGateway {
+ s.CreationTime = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *TransitGateway) SetDescription(v string) *TransitGateway {
+ s.Description = &v
+ return s
+}
+
+// SetOptions sets the Options field's value.
+func (s *TransitGateway) SetOptions(v *TransitGatewayOptions) *TransitGateway {
+ s.Options = v
+ return s
+}
+
+// SetOwnerId sets the OwnerId field's value.
+func (s *TransitGateway) SetOwnerId(v string) *TransitGateway {
+ s.OwnerId = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGateway) SetState(v string) *TransitGateway {
+ s.State = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TransitGateway) SetTags(v []*Tag) *TransitGateway {
+ s.Tags = v
+ return s
+}
+
+// SetTransitGatewayArn sets the TransitGatewayArn field's value.
+func (s *TransitGateway) SetTransitGatewayArn(v string) *TransitGateway {
+ s.TransitGatewayArn = &v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *TransitGateway) SetTransitGatewayId(v string) *TransitGateway {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// Describes an association between a resource attachment and a transit gateway
+// route table.
+type TransitGatewayAssociation struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The state of the association.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayAssociationState"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+
+ // The ID of the transit gateway route table.
+ TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayAssociation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayAssociation) GoString() string {
+ return s.String()
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayAssociation) SetResourceId(v string) *TransitGatewayAssociation {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayAssociation) SetResourceType(v string) *TransitGatewayAssociation {
+ s.ResourceType = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayAssociation) SetState(v string) *TransitGatewayAssociation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayAssociation) SetTransitGatewayAttachmentId(v string) *TransitGatewayAssociation {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *TransitGatewayAssociation) SetTransitGatewayRouteTableId(v string) *TransitGatewayAssociation {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+// Describes an attachment between a resource and a transit gateway.
+type TransitGatewayAttachment struct {
+ _ struct{} `type:"structure"`
+
+ // The association.
+ Association *TransitGatewayAttachmentAssociation `locationName:"association" type:"structure"`
+
+ // The creation time.
+ CreationTime *time.Time `locationName:"creationTime" type:"timestamp"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The ID of the AWS account that owns the resource.
+ ResourceOwnerId *string `locationName:"resourceOwnerId" type:"string"`
+
+ // The resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The attachment state.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"`
+
+ // The tags for the attachment.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+
+ // The ID of the transit gateway.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+
+ // The ID of the AWS account that owns the transit gateway.
+ TransitGatewayOwnerId *string `locationName:"transitGatewayOwnerId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayAttachment) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayAttachment) GoString() string {
+ return s.String()
+}
+
+// SetAssociation sets the Association field's value.
+func (s *TransitGatewayAttachment) SetAssociation(v *TransitGatewayAttachmentAssociation) *TransitGatewayAttachment {
+ s.Association = v
+ return s
+}
+
+// SetCreationTime sets the CreationTime field's value.
+func (s *TransitGatewayAttachment) SetCreationTime(v time.Time) *TransitGatewayAttachment {
+ s.CreationTime = &v
+ return s
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayAttachment) SetResourceId(v string) *TransitGatewayAttachment {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceOwnerId sets the ResourceOwnerId field's value.
+func (s *TransitGatewayAttachment) SetResourceOwnerId(v string) *TransitGatewayAttachment {
+ s.ResourceOwnerId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayAttachment) SetResourceType(v string) *TransitGatewayAttachment {
+ s.ResourceType = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayAttachment) SetState(v string) *TransitGatewayAttachment {
+ s.State = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TransitGatewayAttachment) SetTags(v []*Tag) *TransitGatewayAttachment {
+ s.Tags = v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayAttachment) SetTransitGatewayAttachmentId(v string) *TransitGatewayAttachment {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *TransitGatewayAttachment) SetTransitGatewayId(v string) *TransitGatewayAttachment {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// SetTransitGatewayOwnerId sets the TransitGatewayOwnerId field's value.
+func (s *TransitGatewayAttachment) SetTransitGatewayOwnerId(v string) *TransitGatewayAttachment {
+ s.TransitGatewayOwnerId = &v
+ return s
+}
+
+// Describes an association.
+type TransitGatewayAttachmentAssociation struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the association.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayAssociationState"`
+
+ // The ID of the route table for the transit gateway.
+ TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayAttachmentAssociation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayAttachmentAssociation) GoString() string {
+ return s.String()
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayAttachmentAssociation) SetState(v string) *TransitGatewayAttachmentAssociation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *TransitGatewayAttachmentAssociation) SetTransitGatewayRouteTableId(v string) *TransitGatewayAttachmentAssociation {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+// Describes a propagation route table.
+type TransitGatewayAttachmentPropagation struct {
+ _ struct{} `type:"structure"`
+
+ // The state of the propagation route table.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayPropagationState"`
+
+ // The ID of the propagation route table.
+ TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayAttachmentPropagation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayAttachmentPropagation) GoString() string {
+ return s.String()
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayAttachmentPropagation) SetState(v string) *TransitGatewayAttachmentPropagation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *TransitGatewayAttachmentPropagation) SetTransitGatewayRouteTableId(v string) *TransitGatewayAttachmentPropagation {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+// Describes the options for a transit gateway.
+type TransitGatewayOptions struct {
+ _ struct{} `type:"structure"`
+
+ // A private Autonomous System Number (ASN) for the Amazon side of a BGP session.
+ // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294
+ // for 32-bit ASNs.
+ AmazonSideAsn *int64 `locationName:"amazonSideAsn" type:"long"`
+
+ // The ID of the default association route table.
+ AssociationDefaultRouteTableId *string `locationName:"associationDefaultRouteTableId" type:"string"`
+
+ // Indicates whether attachment requests are automatically accepted.
+ AutoAcceptSharedAttachments *string `locationName:"autoAcceptSharedAttachments" type:"string" enum:"AutoAcceptSharedAttachmentsValue"`
+
+ // Indicates whether resource attachments are automatically associated with
+ // the default association route table.
+ DefaultRouteTableAssociation *string `locationName:"defaultRouteTableAssociation" type:"string" enum:"DefaultRouteTableAssociationValue"`
+
+ // Indicates whether resource attachments automatically propagate routes to
+ // the default propagation route table.
+ DefaultRouteTablePropagation *string `locationName:"defaultRouteTablePropagation" type:"string" enum:"DefaultRouteTablePropagationValue"`
+
+ // Indicates whether DNS support is enabled.
+ DnsSupport *string `locationName:"dnsSupport" type:"string" enum:"DnsSupportValue"`
+
+ // The ID of the default propagation route table.
+ PropagationDefaultRouteTableId *string `locationName:"propagationDefaultRouteTableId" type:"string"`
+
+ // Indicates whether Equal Cost Multipath Protocol support is enabled.
+ VpnEcmpSupport *string `locationName:"vpnEcmpSupport" type:"string" enum:"VpnEcmpSupportValue"`
+}
+
+// String returns the string representation
+func (s TransitGatewayOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayOptions) GoString() string {
+ return s.String()
+}
+
+// SetAmazonSideAsn sets the AmazonSideAsn field's value.
+func (s *TransitGatewayOptions) SetAmazonSideAsn(v int64) *TransitGatewayOptions {
+ s.AmazonSideAsn = &v
+ return s
+}
+
+// SetAssociationDefaultRouteTableId sets the AssociationDefaultRouteTableId field's value.
+func (s *TransitGatewayOptions) SetAssociationDefaultRouteTableId(v string) *TransitGatewayOptions {
+ s.AssociationDefaultRouteTableId = &v
+ return s
+}
+
+// SetAutoAcceptSharedAttachments sets the AutoAcceptSharedAttachments field's value.
+func (s *TransitGatewayOptions) SetAutoAcceptSharedAttachments(v string) *TransitGatewayOptions {
+ s.AutoAcceptSharedAttachments = &v
+ return s
+}
+
+// SetDefaultRouteTableAssociation sets the DefaultRouteTableAssociation field's value.
+func (s *TransitGatewayOptions) SetDefaultRouteTableAssociation(v string) *TransitGatewayOptions {
+ s.DefaultRouteTableAssociation = &v
+ return s
+}
+
+// SetDefaultRouteTablePropagation sets the DefaultRouteTablePropagation field's value.
+func (s *TransitGatewayOptions) SetDefaultRouteTablePropagation(v string) *TransitGatewayOptions {
+ s.DefaultRouteTablePropagation = &v
+ return s
+}
+
+// SetDnsSupport sets the DnsSupport field's value.
+func (s *TransitGatewayOptions) SetDnsSupport(v string) *TransitGatewayOptions {
+ s.DnsSupport = &v
+ return s
+}
+
+// SetPropagationDefaultRouteTableId sets the PropagationDefaultRouteTableId field's value.
+func (s *TransitGatewayOptions) SetPropagationDefaultRouteTableId(v string) *TransitGatewayOptions {
+ s.PropagationDefaultRouteTableId = &v
+ return s
+}
+
+// SetVpnEcmpSupport sets the VpnEcmpSupport field's value.
+func (s *TransitGatewayOptions) SetVpnEcmpSupport(v string) *TransitGatewayOptions {
+ s.VpnEcmpSupport = &v
+ return s
+}
+
+// Describes route propagation.
+type TransitGatewayPropagation struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The state.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayPropagationState"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+
+ // The ID of the transit gateway route table.
+ TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayPropagation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayPropagation) GoString() string {
+ return s.String()
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayPropagation) SetResourceId(v string) *TransitGatewayPropagation {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayPropagation) SetResourceType(v string) *TransitGatewayPropagation {
+ s.ResourceType = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayPropagation) SetState(v string) *TransitGatewayPropagation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayPropagation) SetTransitGatewayAttachmentId(v string) *TransitGatewayPropagation {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *TransitGatewayPropagation) SetTransitGatewayRouteTableId(v string) *TransitGatewayPropagation {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+// Describes the options for a transit gateway.
+type TransitGatewayRequestOptions struct {
+ _ struct{} `type:"structure"`
+
+ // A private Autonomous System Number (ASN) for the Amazon side of a BGP session.
+ // The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294
+ // for 32-bit ASNs.
+ AmazonSideAsn *int64 `type:"long"`
+
+ // Enable or disable automatic acceptance of attachment requests. The default
+ // is disable.
+ AutoAcceptSharedAttachments *string `type:"string" enum:"AutoAcceptSharedAttachmentsValue"`
+
+ // Enable or disable automatic association with the default association route
+ // table. The default is enable.
+ DefaultRouteTableAssociation *string `type:"string" enum:"DefaultRouteTableAssociationValue"`
+
+ // Enable or disable automatic propagation of routes to the default propagation
+ // route table. The default is enable.
+ DefaultRouteTablePropagation *string `type:"string" enum:"DefaultRouteTablePropagationValue"`
+
+ // Enable or disable DNS support.
+ DnsSupport *string `type:"string" enum:"DnsSupportValue"`
+
+ // Enable or disable Equal Cost Multipath Protocol support.
+ VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRequestOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRequestOptions) GoString() string {
+ return s.String()
+}
+
+// SetAmazonSideAsn sets the AmazonSideAsn field's value.
+func (s *TransitGatewayRequestOptions) SetAmazonSideAsn(v int64) *TransitGatewayRequestOptions {
+ s.AmazonSideAsn = &v
+ return s
+}
+
+// SetAutoAcceptSharedAttachments sets the AutoAcceptSharedAttachments field's value.
+func (s *TransitGatewayRequestOptions) SetAutoAcceptSharedAttachments(v string) *TransitGatewayRequestOptions {
+ s.AutoAcceptSharedAttachments = &v
+ return s
+}
+
+// SetDefaultRouteTableAssociation sets the DefaultRouteTableAssociation field's value.
+func (s *TransitGatewayRequestOptions) SetDefaultRouteTableAssociation(v string) *TransitGatewayRequestOptions {
+ s.DefaultRouteTableAssociation = &v
+ return s
+}
+
+// SetDefaultRouteTablePropagation sets the DefaultRouteTablePropagation field's value.
+func (s *TransitGatewayRequestOptions) SetDefaultRouteTablePropagation(v string) *TransitGatewayRequestOptions {
+ s.DefaultRouteTablePropagation = &v
+ return s
+}
+
+// SetDnsSupport sets the DnsSupport field's value.
+func (s *TransitGatewayRequestOptions) SetDnsSupport(v string) *TransitGatewayRequestOptions {
+ s.DnsSupport = &v
+ return s
+}
+
+// SetVpnEcmpSupport sets the VpnEcmpSupport field's value.
+func (s *TransitGatewayRequestOptions) SetVpnEcmpSupport(v string) *TransitGatewayRequestOptions {
+ s.VpnEcmpSupport = &v
+ return s
+}
+
+// Describes a route for a transit gateway route table.
+type TransitGatewayRoute struct {
+ _ struct{} `type:"structure"`
+
+ // The CIDR block used for destination matches.
+ DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"`
+
+ // The state of the route.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayRouteState"`
+
+ // The attachments.
+ TransitGatewayAttachments []*TransitGatewayRouteAttachment `locationName:"transitGatewayAttachments" locationNameList:"item" type:"list"`
+
+ // The route type.
+ Type *string `locationName:"type" type:"string" enum:"TransitGatewayRouteType"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRoute) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRoute) GoString() string {
+ return s.String()
+}
+
+// SetDestinationCidrBlock sets the DestinationCidrBlock field's value.
+func (s *TransitGatewayRoute) SetDestinationCidrBlock(v string) *TransitGatewayRoute {
+ s.DestinationCidrBlock = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayRoute) SetState(v string) *TransitGatewayRoute {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayAttachments sets the TransitGatewayAttachments field's value.
+func (s *TransitGatewayRoute) SetTransitGatewayAttachments(v []*TransitGatewayRouteAttachment) *TransitGatewayRoute {
+ s.TransitGatewayAttachments = v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *TransitGatewayRoute) SetType(v string) *TransitGatewayRoute {
+ s.Type = &v
+ return s
+}
+
+// Describes a route attachment.
+type TransitGatewayRouteAttachment struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRouteAttachment) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRouteAttachment) GoString() string {
+ return s.String()
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayRouteAttachment) SetResourceId(v string) *TransitGatewayRouteAttachment {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayRouteAttachment) SetResourceType(v string) *TransitGatewayRouteAttachment {
+ s.ResourceType = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayRouteAttachment) SetTransitGatewayAttachmentId(v string) *TransitGatewayRouteAttachment {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// Describes a transit gateway route table.
+type TransitGatewayRouteTable struct {
+ _ struct{} `type:"structure"`
+
+ // The creation time.
+ CreationTime *time.Time `locationName:"creationTime" type:"timestamp"`
+
+ // Indicates whether this is the default association route table for the transit
+ // gateway.
+ DefaultAssociationRouteTable *bool `locationName:"defaultAssociationRouteTable" type:"boolean"`
+
+ // Indicates whether this is the default propagation route table for the transit
+ // gateway.
+ DefaultPropagationRouteTable *bool `locationName:"defaultPropagationRouteTable" type:"boolean"`
+
+ // The state of the transit gateway route table.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayRouteTableState"`
+
+ // Any tags assigned to the route table.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the transit gateway.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+
+ // The ID of the transit gateway route table.
+ TransitGatewayRouteTableId *string `locationName:"transitGatewayRouteTableId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRouteTable) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRouteTable) GoString() string {
+ return s.String()
+}
+
+// SetCreationTime sets the CreationTime field's value.
+func (s *TransitGatewayRouteTable) SetCreationTime(v time.Time) *TransitGatewayRouteTable {
+ s.CreationTime = &v
+ return s
+}
+
+// SetDefaultAssociationRouteTable sets the DefaultAssociationRouteTable field's value.
+func (s *TransitGatewayRouteTable) SetDefaultAssociationRouteTable(v bool) *TransitGatewayRouteTable {
+ s.DefaultAssociationRouteTable = &v
+ return s
+}
+
+// SetDefaultPropagationRouteTable sets the DefaultPropagationRouteTable field's value.
+func (s *TransitGatewayRouteTable) SetDefaultPropagationRouteTable(v bool) *TransitGatewayRouteTable {
+ s.DefaultPropagationRouteTable = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayRouteTable) SetState(v string) *TransitGatewayRouteTable {
+ s.State = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TransitGatewayRouteTable) SetTags(v []*Tag) *TransitGatewayRouteTable {
+ s.Tags = v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *TransitGatewayRouteTable) SetTransitGatewayId(v string) *TransitGatewayRouteTable {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value.
+func (s *TransitGatewayRouteTable) SetTransitGatewayRouteTableId(v string) *TransitGatewayRouteTable {
+ s.TransitGatewayRouteTableId = &v
+ return s
+}
+
+// Describes an association between a route table and a resource attachment.
+type TransitGatewayRouteTableAssociation struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The state of the association.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayAssociationState"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRouteTableAssociation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRouteTableAssociation) GoString() string {
+ return s.String()
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayRouteTableAssociation) SetResourceId(v string) *TransitGatewayRouteTableAssociation {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayRouteTableAssociation) SetResourceType(v string) *TransitGatewayRouteTableAssociation {
+ s.ResourceType = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayRouteTableAssociation) SetState(v string) *TransitGatewayRouteTableAssociation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayRouteTableAssociation) SetTransitGatewayAttachmentId(v string) *TransitGatewayRouteTableAssociation {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// Describes a route table propagation.
+type TransitGatewayRouteTablePropagation struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource.
+ ResourceId *string `locationName:"resourceId" type:"string"`
+
+ // The type of resource.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"`
+
+ // The state of the resource.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayPropagationState"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayRouteTablePropagation) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayRouteTablePropagation) GoString() string {
+ return s.String()
+}
+
+// SetResourceId sets the ResourceId field's value.
+func (s *TransitGatewayRouteTablePropagation) SetResourceId(v string) *TransitGatewayRouteTablePropagation {
+ s.ResourceId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *TransitGatewayRouteTablePropagation) SetResourceType(v string) *TransitGatewayRouteTablePropagation {
+ s.ResourceType = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayRouteTablePropagation) SetState(v string) *TransitGatewayRouteTablePropagation {
+ s.State = &v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayRouteTablePropagation) SetTransitGatewayAttachmentId(v string) *TransitGatewayRouteTablePropagation {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// Describes a VPC attachment.
+type TransitGatewayVpcAttachment struct {
+ _ struct{} `type:"structure"`
+
+ // The creation time.
+ CreationTime *time.Time `locationName:"creationTime" type:"timestamp"`
+
+ // The VPC attachment options.
+ Options *TransitGatewayVpcAttachmentOptions `locationName:"options" type:"structure"`
+
+ // The state of the VPC attachment.
+ State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"`
+
+ // The IDs of the subnets.
+ SubnetIds []*string `locationName:"subnetIds" locationNameList:"item" type:"list"`
+
+ // The tags for the VPC attachment.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
+ // The ID of the attachment.
+ TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"`
+
+ // The ID of the transit gateway.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+
+ // The ID of the VPC.
+ VpcId *string `locationName:"vpcId" type:"string"`
+
+ // The ID of the AWS account that owns the VPC.
+ VpcOwnerId *string `locationName:"vpcOwnerId" type:"string"`
+}
+
+// String returns the string representation
+func (s TransitGatewayVpcAttachment) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayVpcAttachment) GoString() string {
+ return s.String()
+}
+
+// SetCreationTime sets the CreationTime field's value.
+func (s *TransitGatewayVpcAttachment) SetCreationTime(v time.Time) *TransitGatewayVpcAttachment {
+ s.CreationTime = &v
+ return s
+}
+
+// SetOptions sets the Options field's value.
+func (s *TransitGatewayVpcAttachment) SetOptions(v *TransitGatewayVpcAttachmentOptions) *TransitGatewayVpcAttachment {
+ s.Options = v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *TransitGatewayVpcAttachment) SetState(v string) *TransitGatewayVpcAttachment {
+ s.State = &v
+ return s
+}
+
+// SetSubnetIds sets the SubnetIds field's value.
+func (s *TransitGatewayVpcAttachment) SetSubnetIds(v []*string) *TransitGatewayVpcAttachment {
+ s.SubnetIds = v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TransitGatewayVpcAttachment) SetTags(v []*Tag) *TransitGatewayVpcAttachment {
+ s.Tags = v
+ return s
+}
+
+// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value.
+func (s *TransitGatewayVpcAttachment) SetTransitGatewayAttachmentId(v string) *TransitGatewayVpcAttachment {
+ s.TransitGatewayAttachmentId = &v
+ return s
+}
+
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *TransitGatewayVpcAttachment) SetTransitGatewayId(v string) *TransitGatewayVpcAttachment {
+ s.TransitGatewayId = &v
+ return s
+}
+
+// SetVpcId sets the VpcId field's value.
+func (s *TransitGatewayVpcAttachment) SetVpcId(v string) *TransitGatewayVpcAttachment {
+ s.VpcId = &v
+ return s
+}
+
+// SetVpcOwnerId sets the VpcOwnerId field's value.
+func (s *TransitGatewayVpcAttachment) SetVpcOwnerId(v string) *TransitGatewayVpcAttachment {
+ s.VpcOwnerId = &v
+ return s
+}
+
+// Describes the VPC attachment options.
+type TransitGatewayVpcAttachmentOptions struct {
+ _ struct{} `type:"structure"`
+
+ // Indicates whether DNS support is enabled.
+ DnsSupport *string `locationName:"dnsSupport" type:"string" enum:"DnsSupportValue"`
+
+ // Indicates whether IPv6 support is enabled.
+ Ipv6Support *string `locationName:"ipv6Support" type:"string" enum:"Ipv6SupportValue"`
+}
+
+// String returns the string representation
+func (s TransitGatewayVpcAttachmentOptions) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TransitGatewayVpcAttachmentOptions) GoString() string {
+ return s.String()
+}
+
+// SetDnsSupport sets the DnsSupport field's value.
+func (s *TransitGatewayVpcAttachmentOptions) SetDnsSupport(v string) *TransitGatewayVpcAttachmentOptions {
+ s.DnsSupport = &v
+ return s
+}
+
+// SetIpv6Support sets the Ipv6Support field's value.
+func (s *TransitGatewayVpcAttachmentOptions) SetIpv6Support(v string) *TransitGatewayVpcAttachmentOptions {
+ s.Ipv6Support = &v
+ return s
+}
+
type UnassignIpv6AddressesInput struct {
_ struct{} `type:"structure"`
@@ -67556,7 +90632,6 @@ func (s UnassignPrivateIpAddressesOutput) GoString() string {
return s.String()
}
-// Contains the parameters for UnmonitorInstances.
type UnmonitorInstancesInput struct {
_ struct{} `type:"structure"`
@@ -67566,7 +90641,7 @@ type UnmonitorInstancesInput struct {
// it is UnauthorizedOperation.
DryRun *bool `locationName:"dryRun" type:"boolean"`
- // One or more instance IDs.
+ // The IDs of the instances.
//
// InstanceIds is a required field
InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list" required:"true"`
@@ -67607,7 +90682,6 @@ func (s *UnmonitorInstancesInput) SetInstanceIds(v []*string) *UnmonitorInstance
return s
}
-// Contains the output of UnmonitorInstances.
type UnmonitorInstancesOutput struct {
_ struct{} `type:"structure"`
@@ -67631,12 +90705,13 @@ func (s *UnmonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitorin
return s
}
-// Describes the T2 instance whose credit option for CPU usage was not modified.
+// Describes the T2 or T3 instance whose credit option for CPU usage was not
+// modified.
type UnsuccessfulInstanceCreditSpecificationItem struct {
_ struct{} `type:"structure"`
- // The applicable error for the T2 instance whose credit option for CPU usage
- // was not modified.
+ // The applicable error for the T2 or T3 instance whose credit option for CPU
+ // usage was not modified.
Error *UnsuccessfulInstanceCreditSpecificationItemError `locationName:"error" type:"structure"`
// The ID of the instance.
@@ -67665,8 +90740,8 @@ func (s *UnsuccessfulInstanceCreditSpecificationItem) SetInstanceId(v string) *U
return s
}
-// Information about the error for the T2 instance whose credit option for CPU
-// usage was not modified.
+// Information about the error for the T2 or T3 instance whose credit option
+// for CPU usage was not modified.
type UnsuccessfulInstanceCreditSpecificationItemError struct {
_ struct{} `type:"structure"`
@@ -67704,9 +90779,7 @@ type UnsuccessfulItem struct {
_ struct{} `type:"structure"`
// Information about the error.
- //
- // Error is a required field
- Error *UnsuccessfulItemError `locationName:"error" type:"structure" required:"true"`
+ Error *UnsuccessfulItemError `locationName:"error" type:"structure"`
// The ID of the resource.
ResourceId *string `locationName:"resourceId" type:"string"`
@@ -67735,19 +90808,15 @@ func (s *UnsuccessfulItem) SetResourceId(v string) *UnsuccessfulItem {
}
// Information about the error that occurred. For more information about errors,
-// see Error Codes (http://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html).
+// see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html).
type UnsuccessfulItemError struct {
_ struct{} `type:"structure"`
// The error code.
- //
- // Code is a required field
- Code *string `locationName:"code" type:"string" required:"true"`
+ Code *string `locationName:"code" type:"string"`
// The error message accompanying the error code.
- //
- // Message is a required field
- Message *string `locationName:"message" type:"string" required:"true"`
+ Message *string `locationName:"message" type:"string"`
}
// String returns the string representation
@@ -67772,7 +90841,6 @@ func (s *UnsuccessfulItemError) SetMessage(v string) *UnsuccessfulItemError {
return s
}
-// Contains the parameters for UpdateSecurityGroupRuleDescriptionsEgress.
type UpdateSecurityGroupRuleDescriptionsEgressInput struct {
_ struct{} `type:"structure"`
@@ -67844,7 +90912,6 @@ func (s *UpdateSecurityGroupRuleDescriptionsEgressInput) SetIpPermissions(v []*I
return s
}
-// Contains the output of UpdateSecurityGroupRuleDescriptionsEgress.
type UpdateSecurityGroupRuleDescriptionsEgressOutput struct {
_ struct{} `type:"structure"`
@@ -67868,7 +90935,6 @@ func (s *UpdateSecurityGroupRuleDescriptionsEgressOutput) SetReturn(v bool) *Upd
return s
}
-// Contains the parameters for UpdateSecurityGroupRuleDescriptionsIngress.
type UpdateSecurityGroupRuleDescriptionsIngressInput struct {
_ struct{} `type:"structure"`
@@ -67940,7 +91006,6 @@ func (s *UpdateSecurityGroupRuleDescriptionsIngressInput) SetIpPermissions(v []*
return s
}
-// Contains the output of UpdateSecurityGroupRuleDescriptionsIngress.
type UpdateSecurityGroupRuleDescriptionsIngressOutput struct {
_ struct{} `type:"structure"`
@@ -68158,7 +91223,7 @@ type VgwTelemetry struct {
AcceptedRouteCount *int64 `locationName:"acceptedRouteCount" type:"integer"`
// The date and time of the last change in status.
- LastStatusChange *time.Time `locationName:"lastStatusChange" type:"timestamp" timestampFormat:"iso8601"`
+ LastStatusChange *time.Time `locationName:"lastStatusChange" type:"timestamp"`
// The Internet-routable IP address of the virtual private gateway's outside
// interface.
@@ -68222,28 +91287,31 @@ type Volume struct {
AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
// The time stamp when volume creation was initiated.
- CreateTime *time.Time `locationName:"createTime" type:"timestamp" timestampFormat:"iso8601"`
+ CreateTime *time.Time `locationName:"createTime" type:"timestamp"`
- // Indicates whether the volume will be encrypted.
+ // Indicates whether the volume is encrypted.
Encrypted *bool `locationName:"encrypted" type:"boolean"`
// The number of I/O operations per second (IOPS) that the volume supports.
// For Provisioned IOPS SSD volumes, this represents the number of IOPS that
// are provisioned for the volume. For General Purpose SSD volumes, this represents
// the baseline performance of the volume and the rate at which the volume accumulates
- // I/O credits for bursting. For more information on General Purpose SSD baseline
- // performance, I/O credits, and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)
+ // I/O credits for bursting. 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.
//
- // Constraint: Range is 100-32000 IOPS for io1 volumes and 100-10000 IOPS for
- // gp2 volumes.
+ // Constraints: Range is 100-16,000 IOPS for gp2 volumes and 100 to 64,000IOPS
+ // for io1 volumes, in most Regions. The maximum IOPS for io1 of 64,000 is guaranteed
+ // only on Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances).
+ // Other instance families guarantee performance up to 32,000 IOPS.
//
// Condition: This parameter is required for requests to create io1 volumes;
// it is not used in requests to create gp2, st1, sc1, or standard volumes.
Iops *int64 `locationName:"iops" type:"integer"`
- // The full ARN of the AWS Key Management Service (AWS KMS) customer master
- // key (CMK) that was used to protect the volume encryption key for the volume.
+ // The Amazon Resource Name (ARN) of the AWS Key Management Service (AWS KMS)
+ // customer master key (CMK) that was used to protect the volume encryption
+ // key for the volume.
KmsKeyId *string `locationName:"kmsKeyId" type:"string"`
// The size of the volume, in GiBs.
@@ -68354,7 +91422,7 @@ type VolumeAttachment struct {
_ struct{} `type:"structure"`
// The time stamp when the attachment initiated.
- AttachTime *time.Time `locationName:"attachTime" type:"timestamp" timestampFormat:"iso8601"`
+ AttachTime *time.Time `locationName:"attachTime" type:"timestamp"`
// Indicates whether the EBS volume is deleted on instance termination.
DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"`
@@ -68463,41 +91531,41 @@ func (s *VolumeDetail) SetSize(v int64) *VolumeDetail {
type VolumeModification struct {
_ struct{} `type:"structure"`
- // Modification completion or failure time.
- EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"`
+ // The modification completion or failure time.
+ EndTime *time.Time `locationName:"endTime" type:"timestamp"`
- // Current state of modification. Modification state is null for unmodified
+ // The current modification state. The modification state is null for unmodified
// volumes.
ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"`
- // Original IOPS rate of the volume being modified.
+ // The original IOPS rate of the volume.
OriginalIops *int64 `locationName:"originalIops" type:"integer"`
- // Original size of the volume being modified.
+ // The original size of the volume.
OriginalSize *int64 `locationName:"originalSize" type:"integer"`
- // Original EBS volume type of the volume being modified.
+ // The original EBS volume type of the volume.
OriginalVolumeType *string `locationName:"originalVolumeType" type:"string" enum:"VolumeType"`
- // Modification progress from 0 to 100%.
+ // The modification progress, from 0 to 100 percent complete.
Progress *int64 `locationName:"progress" type:"long"`
- // Modification start time
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"`
+ // The modification start time.
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
- // Generic status message on modification progress or failure.
+ // A status message about the modification progress or failure.
StatusMessage *string `locationName:"statusMessage" type:"string"`
- // Target IOPS rate of the volume being modified.
+ // The target IOPS rate of the volume.
TargetIops *int64 `locationName:"targetIops" type:"integer"`
- // Target size of the volume being modified.
+ // The target size of the volume, in GiB.
TargetSize *int64 `locationName:"targetSize" type:"integer"`
- // Target EBS volume type of the volume being modified.
+ // The target EBS volume type of the volume.
TargetVolumeType *string `locationName:"targetVolumeType" type:"string" enum:"VolumeType"`
- // ID of the volume being modified.
+ // The ID of the volume.
VolumeId *string `locationName:"volumeId" type:"string"`
}
@@ -68681,10 +91749,10 @@ type VolumeStatusEvent struct {
EventType *string `locationName:"eventType" type:"string"`
// The latest end time of the event.
- NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"iso8601"`
+ NotAfter *time.Time `locationName:"notAfter" type:"timestamp"`
// The earliest start time of the event.
- NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"iso8601"`
+ NotBefore *time.Time `locationName:"notBefore" type:"timestamp"`
}
// String returns the string representation
@@ -68843,6 +91911,9 @@ type Vpc struct {
// Indicates whether the VPC is the default VPC.
IsDefault *bool `locationName:"isDefault" type:"boolean"`
+ // The ID of the AWS account that owns the VPC.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// The current state of the VPC.
State *string `locationName:"state" type:"string" enum:"VpcState"`
@@ -68899,6 +91970,12 @@ func (s *Vpc) SetIsDefault(v bool) *Vpc {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *Vpc) SetOwnerId(v string) *Vpc {
+ s.OwnerId = &v
+ return s
+}
+
// SetState sets the State field's value.
func (s *Vpc) SetState(v string) *Vpc {
s.State = &v
@@ -69072,7 +92149,7 @@ type VpcEndpoint struct {
_ struct{} `type:"structure"`
// The date and time the VPC endpoint was created.
- CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"`
+ CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp"`
// (Interface endpoint) The DNS entries for the endpoint.
DnsEntries []*DnsEntry `locationName:"dnsEntrySet" locationNameList:"item" type:"list"`
@@ -69084,6 +92161,9 @@ type VpcEndpoint struct {
// (Interface endpoint) One or more network interfaces for the endpoint.
NetworkInterfaceIds []*string `locationName:"networkInterfaceIdSet" locationNameList:"item" type:"list"`
+ // The ID of the AWS account that owns the VPC endpoint.
+ OwnerId *string `locationName:"ownerId" type:"string"`
+
// The policy document associated with the endpoint, if applicable.
PolicyDocument *string `locationName:"policyDocument" type:"string"`
@@ -69091,6 +92171,9 @@ type VpcEndpoint struct {
// hosted zone.
PrivateDnsEnabled *bool `locationName:"privateDnsEnabled" type:"boolean"`
+ // Indicates whether the VPC endpoint is being managed by its service.
+ RequesterManaged *bool `locationName:"requesterManaged" type:"boolean"`
+
// (Gateway endpoint) One or more route tables associated with the endpoint.
RouteTableIds []*string `locationName:"routeTableIdSet" locationNameList:"item" type:"list"`
@@ -69103,6 +92186,9 @@ type VpcEndpoint struct {
// (Interface endpoint) One or more subnets in which the endpoint is located.
SubnetIds []*string `locationName:"subnetIdSet" locationNameList:"item" type:"list"`
+ // Any tags assigned to the VPC endpoint.
+ Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+
// The ID of the VPC endpoint.
VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"`
@@ -69147,6 +92233,12 @@ func (s *VpcEndpoint) SetNetworkInterfaceIds(v []*string) *VpcEndpoint {
return s
}
+// SetOwnerId sets the OwnerId field's value.
+func (s *VpcEndpoint) SetOwnerId(v string) *VpcEndpoint {
+ s.OwnerId = &v
+ return s
+}
+
// SetPolicyDocument sets the PolicyDocument field's value.
func (s *VpcEndpoint) SetPolicyDocument(v string) *VpcEndpoint {
s.PolicyDocument = &v
@@ -69159,6 +92251,12 @@ func (s *VpcEndpoint) SetPrivateDnsEnabled(v bool) *VpcEndpoint {
return s
}
+// SetRequesterManaged sets the RequesterManaged field's value.
+func (s *VpcEndpoint) SetRequesterManaged(v bool) *VpcEndpoint {
+ s.RequesterManaged = &v
+ return s
+}
+
// SetRouteTableIds sets the RouteTableIds field's value.
func (s *VpcEndpoint) SetRouteTableIds(v []*string) *VpcEndpoint {
s.RouteTableIds = v
@@ -69183,6 +92281,12 @@ func (s *VpcEndpoint) SetSubnetIds(v []*string) *VpcEndpoint {
return s
}
+// SetTags sets the Tags field's value.
+func (s *VpcEndpoint) SetTags(v []*Tag) *VpcEndpoint {
+ s.Tags = v
+ return s
+}
+
// SetVpcEndpointId sets the VpcEndpointId field's value.
func (s *VpcEndpoint) SetVpcEndpointId(v string) *VpcEndpoint {
s.VpcEndpointId = &v
@@ -69206,7 +92310,13 @@ type VpcEndpointConnection struct {
_ struct{} `type:"structure"`
// The date and time the VPC endpoint was created.
- CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" timestampFormat:"iso8601"`
+ CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp"`
+
+ // The DNS entries for the VPC endpoint.
+ DnsEntries []*DnsEntry `locationName:"dnsEntrySet" locationNameList:"item" type:"list"`
+
+ // The Amazon Resource Names (ARNs) of the network load balancers for the service.
+ NetworkLoadBalancerArns []*string `locationName:"networkLoadBalancerArnSet" locationNameList:"item" type:"list"`
// The ID of the service to which the endpoint is connected.
ServiceId *string `locationName:"serviceId" type:"string"`
@@ -69237,6 +92347,18 @@ func (s *VpcEndpointConnection) SetCreationTimestamp(v time.Time) *VpcEndpointCo
return s
}
+// SetDnsEntries sets the DnsEntries field's value.
+func (s *VpcEndpointConnection) SetDnsEntries(v []*DnsEntry) *VpcEndpointConnection {
+ s.DnsEntries = v
+ return s
+}
+
+// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value.
+func (s *VpcEndpointConnection) SetNetworkLoadBalancerArns(v []*string) *VpcEndpointConnection {
+ s.NetworkLoadBalancerArns = v
+ return s
+}
+
// SetServiceId sets the ServiceId field's value.
func (s *VpcEndpointConnection) SetServiceId(v string) *VpcEndpointConnection {
s.ServiceId = &v
@@ -69312,7 +92434,7 @@ type VpcPeeringConnection struct {
AccepterVpcInfo *VpcPeeringConnectionVpcInfo `locationName:"accepterVpcInfo" type:"structure"`
// The time that an unaccepted VPC peering connection will expire.
- ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"`
+ ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp"`
// Information about the requester VPC. CIDR block information is only returned
// when describing an active VPC peering connection.
@@ -69472,7 +92594,7 @@ type VpcPeeringConnectionVpcInfo struct {
// requester VPC.
PeeringOptions *VpcPeeringConnectionOptionsDescription `locationName:"peeringOptions" type:"structure"`
- // The region in which the VPC is located.
+ // The Region in which the VPC is located.
Region *string `locationName:"region" type:"string"`
// The ID of the VPC.
@@ -69536,9 +92658,7 @@ type VpnConnection struct {
_ struct{} `type:"structure"`
// The category of the VPN connection. A value of VPN indicates an AWS VPN connection.
- // A value of VPN-Classic indicates an AWS Classic VPN connection. For more
- // information, see AWS Managed VPN Categories (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_VPN.html#vpn-categories)
- // in the Amazon Virtual Private Cloud User Guide.
+ // A value of VPN-Classic indicates an AWS Classic VPN connection.
Category *string `locationName:"category" type:"string"`
// The configuration information for the VPN connection's customer gateway (in
@@ -69562,6 +92682,9 @@ type VpnConnection struct {
// Any tags assigned to the VPN connection.
Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"`
+ // The ID of the transit gateway associated with the VPN connection.
+ TransitGatewayId *string `locationName:"transitGatewayId" type:"string"`
+
// The type of VPN connection.
Type *string `locationName:"type" type:"string" enum:"GatewayType"`
@@ -69627,6 +92750,12 @@ func (s *VpnConnection) SetTags(v []*Tag) *VpnConnection {
return s
}
+// SetTransitGatewayId sets the TransitGatewayId field's value.
+func (s *VpnConnection) SetTransitGatewayId(v string) *VpnConnection {
+ s.TransitGatewayId = &v
+ return s
+}
+
// SetType sets the Type field's value.
func (s *VpnConnection) SetType(v string) *VpnConnection {
s.Type = &v
@@ -69890,6 +93019,79 @@ func (s *VpnTunnelOptionsSpecification) SetTunnelInsideCidr(v string) *VpnTunnel
return s
}
+type WithdrawByoipCidrInput struct {
+ _ struct{} `type:"structure"`
+
+ // The public IPv4 address range, in CIDR notation.
+ //
+ // Cidr is a required field
+ Cidr *string `type:"string" required:"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,
+ // it is UnauthorizedOperation.
+ DryRun *bool `type:"boolean"`
+}
+
+// String returns the string representation
+func (s WithdrawByoipCidrInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s WithdrawByoipCidrInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *WithdrawByoipCidrInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "WithdrawByoipCidrInput"}
+ if s.Cidr == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cidr"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCidr sets the Cidr field's value.
+func (s *WithdrawByoipCidrInput) SetCidr(v string) *WithdrawByoipCidrInput {
+ s.Cidr = &v
+ return s
+}
+
+// SetDryRun sets the DryRun field's value.
+func (s *WithdrawByoipCidrInput) SetDryRun(v bool) *WithdrawByoipCidrInput {
+ s.DryRun = &v
+ return s
+}
+
+type WithdrawByoipCidrOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about the address pool.
+ ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"`
+}
+
+// String returns the string representation
+func (s WithdrawByoipCidrOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s WithdrawByoipCidrOutput) GoString() string {
+ return s.String()
+}
+
+// SetByoipCidr sets the ByoipCidr field's value.
+func (s *WithdrawByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *WithdrawByoipCidrOutput {
+ s.ByoipCidr = v
+ return s
+}
+
const (
// AccountAttributeNameSupportedPlatforms is a AccountAttributeName enum value
AccountAttributeNameSupportedPlatforms = "supported-platforms"
@@ -69935,6 +93137,9 @@ const (
// AllocationStateReleasedPermanentFailure is a AllocationState enum value
AllocationStateReleasedPermanentFailure = "released-permanent-failure"
+
+ // AllocationStatePending is a AllocationState enum value
+ AllocationStatePending = "pending"
)
const (
@@ -69951,6 +93156,31 @@ const (
// ArchitectureValuesX8664 is a ArchitectureValues enum value
ArchitectureValuesX8664 = "x86_64"
+
+ // ArchitectureValuesArm64 is a ArchitectureValues enum value
+ ArchitectureValuesArm64 = "arm64"
+)
+
+const (
+ // AssociatedNetworkTypeVpc is a AssociatedNetworkType enum value
+ AssociatedNetworkTypeVpc = "vpc"
+)
+
+const (
+ // AssociationStatusCodeAssociating is a AssociationStatusCode enum value
+ AssociationStatusCodeAssociating = "associating"
+
+ // AssociationStatusCodeAssociated is a AssociationStatusCode enum value
+ AssociationStatusCodeAssociated = "associated"
+
+ // AssociationStatusCodeAssociationFailed is a AssociationStatusCode enum value
+ AssociationStatusCodeAssociationFailed = "association-failed"
+
+ // AssociationStatusCodeDisassociating is a AssociationStatusCode enum value
+ AssociationStatusCodeDisassociating = "disassociating"
+
+ // AssociationStatusCodeDisassociated is a AssociationStatusCode enum value
+ AssociationStatusCodeDisassociated = "disassociated"
)
const (
@@ -69967,6 +93197,14 @@ const (
AttachmentStatusDetached = "detached"
)
+const (
+ // AutoAcceptSharedAttachmentsValueEnable is a AutoAcceptSharedAttachmentsValue enum value
+ AutoAcceptSharedAttachmentsValueEnable = "enable"
+
+ // AutoAcceptSharedAttachmentsValueDisable is a AutoAcceptSharedAttachmentsValue enum value
+ AutoAcceptSharedAttachmentsValueDisable = "disable"
+)
+
const (
// AutoPlacementOn is a AutoPlacement enum value
AutoPlacementOn = "on"
@@ -70035,6 +93273,29 @@ const (
BundleTaskStateFailed = "failed"
)
+const (
+ // ByoipCidrStateAdvertised is a ByoipCidrState enum value
+ ByoipCidrStateAdvertised = "advertised"
+
+ // ByoipCidrStateDeprovisioned is a ByoipCidrState enum value
+ ByoipCidrStateDeprovisioned = "deprovisioned"
+
+ // ByoipCidrStateFailedDeprovision is a ByoipCidrState enum value
+ ByoipCidrStateFailedDeprovision = "failed-deprovision"
+
+ // ByoipCidrStateFailedProvision is a ByoipCidrState enum value
+ ByoipCidrStateFailedProvision = "failed-provision"
+
+ // ByoipCidrStatePendingDeprovision is a ByoipCidrState enum value
+ ByoipCidrStatePendingDeprovision = "pending-deprovision"
+
+ // ByoipCidrStatePendingProvision is a ByoipCidrState enum value
+ ByoipCidrStatePendingProvision = "pending-provision"
+
+ // ByoipCidrStateProvisioned is a ByoipCidrState enum value
+ ByoipCidrStateProvisioned = "provisioned"
+)
+
const (
// CancelBatchErrorCodeFleetRequestIdDoesNotExist is a CancelBatchErrorCode enum value
CancelBatchErrorCodeFleetRequestIdDoesNotExist = "fleetRequestIdDoesNotExist"
@@ -70066,6 +93327,146 @@ const (
CancelSpotInstanceRequestStateCompleted = "completed"
)
+const (
+ // CapacityReservationInstancePlatformLinuxUnix is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformLinuxUnix = "Linux/UNIX"
+
+ // CapacityReservationInstancePlatformRedHatEnterpriseLinux is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformRedHatEnterpriseLinux = "Red Hat Enterprise Linux"
+
+ // CapacityReservationInstancePlatformSuselinux is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformSuselinux = "SUSE Linux"
+
+ // CapacityReservationInstancePlatformWindows is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformWindows = "Windows"
+
+ // CapacityReservationInstancePlatformWindowswithSqlserver is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformWindowswithSqlserver = "Windows with SQL Server"
+
+ // CapacityReservationInstancePlatformWindowswithSqlserverEnterprise is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformWindowswithSqlserverEnterprise = "Windows with SQL Server Enterprise"
+
+ // CapacityReservationInstancePlatformWindowswithSqlserverStandard is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformWindowswithSqlserverStandard = "Windows with SQL Server Standard"
+
+ // CapacityReservationInstancePlatformWindowswithSqlserverWeb is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformWindowswithSqlserverWeb = "Windows with SQL Server Web"
+
+ // CapacityReservationInstancePlatformLinuxwithSqlserverStandard is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformLinuxwithSqlserverStandard = "Linux with SQL Server Standard"
+
+ // CapacityReservationInstancePlatformLinuxwithSqlserverWeb is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformLinuxwithSqlserverWeb = "Linux with SQL Server Web"
+
+ // CapacityReservationInstancePlatformLinuxwithSqlserverEnterprise is a CapacityReservationInstancePlatform enum value
+ CapacityReservationInstancePlatformLinuxwithSqlserverEnterprise = "Linux with SQL Server Enterprise"
+)
+
+const (
+ // CapacityReservationPreferenceOpen is a CapacityReservationPreference enum value
+ CapacityReservationPreferenceOpen = "open"
+
+ // CapacityReservationPreferenceNone is a CapacityReservationPreference enum value
+ CapacityReservationPreferenceNone = "none"
+)
+
+const (
+ // CapacityReservationStateActive is a CapacityReservationState enum value
+ CapacityReservationStateActive = "active"
+
+ // CapacityReservationStateExpired is a CapacityReservationState enum value
+ CapacityReservationStateExpired = "expired"
+
+ // CapacityReservationStateCancelled is a CapacityReservationState enum value
+ CapacityReservationStateCancelled = "cancelled"
+
+ // CapacityReservationStatePending is a CapacityReservationState enum value
+ CapacityReservationStatePending = "pending"
+
+ // CapacityReservationStateFailed is a CapacityReservationState enum value
+ CapacityReservationStateFailed = "failed"
+)
+
+const (
+ // CapacityReservationTenancyDefault is a CapacityReservationTenancy enum value
+ CapacityReservationTenancyDefault = "default"
+
+ // CapacityReservationTenancyDedicated is a CapacityReservationTenancy enum value
+ CapacityReservationTenancyDedicated = "dedicated"
+)
+
+const (
+ // ClientCertificateRevocationListStatusCodePending is a ClientCertificateRevocationListStatusCode enum value
+ ClientCertificateRevocationListStatusCodePending = "pending"
+
+ // ClientCertificateRevocationListStatusCodeActive is a ClientCertificateRevocationListStatusCode enum value
+ ClientCertificateRevocationListStatusCodeActive = "active"
+)
+
+const (
+ // ClientVpnAuthenticationTypeCertificateAuthentication is a ClientVpnAuthenticationType enum value
+ ClientVpnAuthenticationTypeCertificateAuthentication = "certificate-authentication"
+
+ // ClientVpnAuthenticationTypeDirectoryServiceAuthentication is a ClientVpnAuthenticationType enum value
+ ClientVpnAuthenticationTypeDirectoryServiceAuthentication = "directory-service-authentication"
+)
+
+const (
+ // ClientVpnAuthorizationRuleStatusCodeAuthorizing is a ClientVpnAuthorizationRuleStatusCode enum value
+ ClientVpnAuthorizationRuleStatusCodeAuthorizing = "authorizing"
+
+ // ClientVpnAuthorizationRuleStatusCodeActive is a ClientVpnAuthorizationRuleStatusCode enum value
+ ClientVpnAuthorizationRuleStatusCodeActive = "active"
+
+ // ClientVpnAuthorizationRuleStatusCodeFailed is a ClientVpnAuthorizationRuleStatusCode enum value
+ ClientVpnAuthorizationRuleStatusCodeFailed = "failed"
+
+ // ClientVpnAuthorizationRuleStatusCodeRevoking is a ClientVpnAuthorizationRuleStatusCode enum value
+ ClientVpnAuthorizationRuleStatusCodeRevoking = "revoking"
+)
+
+const (
+ // ClientVpnConnectionStatusCodeActive is a ClientVpnConnectionStatusCode enum value
+ ClientVpnConnectionStatusCodeActive = "active"
+
+ // ClientVpnConnectionStatusCodeFailedToTerminate is a ClientVpnConnectionStatusCode enum value
+ ClientVpnConnectionStatusCodeFailedToTerminate = "failed-to-terminate"
+
+ // ClientVpnConnectionStatusCodeTerminating is a ClientVpnConnectionStatusCode enum value
+ ClientVpnConnectionStatusCodeTerminating = "terminating"
+
+ // ClientVpnConnectionStatusCodeTerminated is a ClientVpnConnectionStatusCode enum value
+ ClientVpnConnectionStatusCodeTerminated = "terminated"
+)
+
+const (
+ // ClientVpnEndpointStatusCodePendingAssociate is a ClientVpnEndpointStatusCode enum value
+ ClientVpnEndpointStatusCodePendingAssociate = "pending-associate"
+
+ // ClientVpnEndpointStatusCodeAvailable is a ClientVpnEndpointStatusCode enum value
+ ClientVpnEndpointStatusCodeAvailable = "available"
+
+ // ClientVpnEndpointStatusCodeDeleting is a ClientVpnEndpointStatusCode enum value
+ ClientVpnEndpointStatusCodeDeleting = "deleting"
+
+ // ClientVpnEndpointStatusCodeDeleted is a ClientVpnEndpointStatusCode enum value
+ ClientVpnEndpointStatusCodeDeleted = "deleted"
+)
+
+const (
+ // ClientVpnRouteStatusCodeCreating is a ClientVpnRouteStatusCode enum value
+ ClientVpnRouteStatusCodeCreating = "creating"
+
+ // ClientVpnRouteStatusCodeActive is a ClientVpnRouteStatusCode enum value
+ ClientVpnRouteStatusCodeActive = "active"
+
+ // ClientVpnRouteStatusCodeFailed is a ClientVpnRouteStatusCode enum value
+ ClientVpnRouteStatusCodeFailed = "failed"
+
+ // ClientVpnRouteStatusCodeDeleting is a ClientVpnRouteStatusCode enum value
+ ClientVpnRouteStatusCodeDeleting = "deleting"
+)
+
const (
// ConnectionNotificationStateEnabled is a ConnectionNotificationState enum value
ConnectionNotificationStateEnabled = "Enabled"
@@ -70098,6 +93499,11 @@ const (
ConversionTaskStateCompleted = "completed"
)
+const (
+ // CopyTagsFromSourceVolume is a CopyTagsFromSource enum value
+ CopyTagsFromSourceVolume = "volume"
+)
+
const (
// CurrencyCodeValuesUsd is a CurrencyCodeValues enum value
CurrencyCodeValuesUsd = "USD"
@@ -70111,6 +93517,22 @@ const (
DatafeedSubscriptionStateInactive = "Inactive"
)
+const (
+ // DefaultRouteTableAssociationValueEnable is a DefaultRouteTableAssociationValue enum value
+ DefaultRouteTableAssociationValueEnable = "enable"
+
+ // DefaultRouteTableAssociationValueDisable is a DefaultRouteTableAssociationValue enum value
+ DefaultRouteTableAssociationValueDisable = "disable"
+)
+
+const (
+ // DefaultRouteTablePropagationValueEnable is a DefaultRouteTablePropagationValue enum value
+ DefaultRouteTablePropagationValueEnable = "enable"
+
+ // DefaultRouteTablePropagationValueDisable is a DefaultRouteTablePropagationValue enum value
+ DefaultRouteTablePropagationValueDisable = "disable"
+)
+
const (
// DefaultTargetCapacityTypeSpot is a DefaultTargetCapacityType enum value
DefaultTargetCapacityTypeSpot = "spot"
@@ -70152,6 +93574,14 @@ const (
DiskImageFormatVhd = "VHD"
)
+const (
+ // DnsSupportValueEnable is a DnsSupportValue enum value
+ DnsSupportValueEnable = "enable"
+
+ // DnsSupportValueDisable is a DnsSupportValue enum value
+ DnsSupportValueDisable = "disable"
+)
+
const (
// DomainTypeVpc is a DomainType enum value
DomainTypeVpc = "vpc"
@@ -70173,6 +93603,14 @@ const (
ElasticGpuStatusImpaired = "IMPAIRED"
)
+const (
+ // EndDateTypeUnlimited is a EndDateType enum value
+ EndDateTypeUnlimited = "unlimited"
+
+ // EndDateTypeLimited is a EndDateType enum value
+ EndDateTypeLimited = "limited"
+)
+
const (
// EventCodeInstanceReboot is a EventCode enum value
EventCodeInstanceReboot = "instance-reboot"
@@ -70199,6 +93637,9 @@ const (
// EventTypeError is a EventType enum value
EventTypeError = "error"
+
+ // EventTypeInformation is a EventType enum value
+ EventTypeInformation = "information"
)
const (
@@ -70267,6 +93708,14 @@ const (
FleetExcessCapacityTerminationPolicyTermination = "termination"
)
+const (
+ // FleetOnDemandAllocationStrategyLowestPrice is a FleetOnDemandAllocationStrategy enum value
+ FleetOnDemandAllocationStrategyLowestPrice = "lowest-price"
+
+ // FleetOnDemandAllocationStrategyPrioritized is a FleetOnDemandAllocationStrategy enum value
+ FleetOnDemandAllocationStrategyPrioritized = "prioritized"
+)
+
const (
// FleetStateCodeSubmitted is a FleetStateCode enum value
FleetStateCodeSubmitted = "submitted"
@@ -70296,6 +93745,9 @@ const (
// FleetTypeMaintain is a FleetType enum value
FleetTypeMaintain = "maintain"
+
+ // FleetTypeInstant is a FleetType enum value
+ FleetTypeInstant = "instant"
)
const (
@@ -70342,6 +93794,14 @@ const (
GatewayTypeIpsec1 = "ipsec.1"
)
+const (
+ // HostRecoveryOn is a HostRecovery enum value
+ HostRecoveryOn = "on"
+
+ // HostRecoveryOff is a HostRecovery enum value
+ HostRecoveryOff = "off"
+)
+
const (
// HostTenancyDedicated is a HostTenancy enum value
HostTenancyDedicated = "dedicated"
@@ -70492,6 +93952,14 @@ const (
InstanceInterruptionBehaviorTerminate = "terminate"
)
+const (
+ // InstanceLifecycleSpot is a InstanceLifecycle enum value
+ InstanceLifecycleSpot = "spot"
+
+ // InstanceLifecycleOnDemand is a InstanceLifecycle enum value
+ InstanceLifecycleOnDemand = "on-demand"
+)
+
const (
// InstanceLifecycleTypeSpot is a InstanceLifecycleType enum value
InstanceLifecycleTypeSpot = "spot"
@@ -70500,6 +93968,14 @@ const (
InstanceLifecycleTypeScheduled = "scheduled"
)
+const (
+ // InstanceMatchCriteriaOpen is a InstanceMatchCriteria enum value
+ InstanceMatchCriteriaOpen = "open"
+
+ // InstanceMatchCriteriaTargeted is a InstanceMatchCriteria enum value
+ InstanceMatchCriteriaTargeted = "targeted"
+)
+
const (
// InstanceStateNamePending is a InstanceStateName enum value
InstanceStateNamePending = "pending"
@@ -70545,6 +94021,48 @@ const (
// InstanceTypeT22xlarge is a InstanceType enum value
InstanceTypeT22xlarge = "t2.2xlarge"
+ // InstanceTypeT3Nano is a InstanceType enum value
+ InstanceTypeT3Nano = "t3.nano"
+
+ // InstanceTypeT3Micro is a InstanceType enum value
+ InstanceTypeT3Micro = "t3.micro"
+
+ // InstanceTypeT3Small is a InstanceType enum value
+ InstanceTypeT3Small = "t3.small"
+
+ // InstanceTypeT3Medium is a InstanceType enum value
+ InstanceTypeT3Medium = "t3.medium"
+
+ // InstanceTypeT3Large is a InstanceType enum value
+ InstanceTypeT3Large = "t3.large"
+
+ // InstanceTypeT3Xlarge is a InstanceType enum value
+ InstanceTypeT3Xlarge = "t3.xlarge"
+
+ // InstanceTypeT32xlarge is a InstanceType enum value
+ InstanceTypeT32xlarge = "t3.2xlarge"
+
+ // InstanceTypeT3aNano is a InstanceType enum value
+ InstanceTypeT3aNano = "t3a.nano"
+
+ // InstanceTypeT3aMicro is a InstanceType enum value
+ InstanceTypeT3aMicro = "t3a.micro"
+
+ // InstanceTypeT3aSmall is a InstanceType enum value
+ InstanceTypeT3aSmall = "t3a.small"
+
+ // InstanceTypeT3aMedium is a InstanceType enum value
+ InstanceTypeT3aMedium = "t3a.medium"
+
+ // InstanceTypeT3aLarge is a InstanceType enum value
+ InstanceTypeT3aLarge = "t3a.large"
+
+ // InstanceTypeT3aXlarge is a InstanceType enum value
+ InstanceTypeT3aXlarge = "t3a.xlarge"
+
+ // InstanceTypeT3a2xlarge is a InstanceType enum value
+ InstanceTypeT3a2xlarge = "t3a.2xlarge"
+
// InstanceTypeM1Small is a InstanceType enum value
InstanceTypeM1Small = "m1.small"
@@ -70632,6 +94150,108 @@ const (
// InstanceTypeR416xlarge is a InstanceType enum value
InstanceTypeR416xlarge = "r4.16xlarge"
+ // InstanceTypeR5Large is a InstanceType enum value
+ InstanceTypeR5Large = "r5.large"
+
+ // InstanceTypeR5Xlarge is a InstanceType enum value
+ InstanceTypeR5Xlarge = "r5.xlarge"
+
+ // InstanceTypeR52xlarge is a InstanceType enum value
+ InstanceTypeR52xlarge = "r5.2xlarge"
+
+ // InstanceTypeR54xlarge is a InstanceType enum value
+ InstanceTypeR54xlarge = "r5.4xlarge"
+
+ // InstanceTypeR58xlarge is a InstanceType enum value
+ InstanceTypeR58xlarge = "r5.8xlarge"
+
+ // InstanceTypeR512xlarge is a InstanceType enum value
+ InstanceTypeR512xlarge = "r5.12xlarge"
+
+ // InstanceTypeR516xlarge is a InstanceType enum value
+ InstanceTypeR516xlarge = "r5.16xlarge"
+
+ // InstanceTypeR524xlarge is a InstanceType enum value
+ InstanceTypeR524xlarge = "r5.24xlarge"
+
+ // InstanceTypeR5Metal is a InstanceType enum value
+ InstanceTypeR5Metal = "r5.metal"
+
+ // InstanceTypeR5aLarge is a InstanceType enum value
+ InstanceTypeR5aLarge = "r5a.large"
+
+ // InstanceTypeR5aXlarge is a InstanceType enum value
+ InstanceTypeR5aXlarge = "r5a.xlarge"
+
+ // InstanceTypeR5a2xlarge is a InstanceType enum value
+ InstanceTypeR5a2xlarge = "r5a.2xlarge"
+
+ // InstanceTypeR5a4xlarge is a InstanceType enum value
+ InstanceTypeR5a4xlarge = "r5a.4xlarge"
+
+ // InstanceTypeR5a8xlarge is a InstanceType enum value
+ InstanceTypeR5a8xlarge = "r5a.8xlarge"
+
+ // InstanceTypeR5a12xlarge is a InstanceType enum value
+ InstanceTypeR5a12xlarge = "r5a.12xlarge"
+
+ // InstanceTypeR5a16xlarge is a InstanceType enum value
+ InstanceTypeR5a16xlarge = "r5a.16xlarge"
+
+ // InstanceTypeR5a24xlarge is a InstanceType enum value
+ InstanceTypeR5a24xlarge = "r5a.24xlarge"
+
+ // InstanceTypeR5dLarge is a InstanceType enum value
+ InstanceTypeR5dLarge = "r5d.large"
+
+ // InstanceTypeR5dXlarge is a InstanceType enum value
+ InstanceTypeR5dXlarge = "r5d.xlarge"
+
+ // InstanceTypeR5d2xlarge is a InstanceType enum value
+ InstanceTypeR5d2xlarge = "r5d.2xlarge"
+
+ // InstanceTypeR5d4xlarge is a InstanceType enum value
+ InstanceTypeR5d4xlarge = "r5d.4xlarge"
+
+ // InstanceTypeR5d8xlarge is a InstanceType enum value
+ InstanceTypeR5d8xlarge = "r5d.8xlarge"
+
+ // InstanceTypeR5d12xlarge is a InstanceType enum value
+ InstanceTypeR5d12xlarge = "r5d.12xlarge"
+
+ // InstanceTypeR5d16xlarge is a InstanceType enum value
+ InstanceTypeR5d16xlarge = "r5d.16xlarge"
+
+ // InstanceTypeR5d24xlarge is a InstanceType enum value
+ InstanceTypeR5d24xlarge = "r5d.24xlarge"
+
+ // InstanceTypeR5dMetal is a InstanceType enum value
+ InstanceTypeR5dMetal = "r5d.metal"
+
+ // InstanceTypeR5adLarge is a InstanceType enum value
+ InstanceTypeR5adLarge = "r5ad.large"
+
+ // InstanceTypeR5adXlarge is a InstanceType enum value
+ InstanceTypeR5adXlarge = "r5ad.xlarge"
+
+ // InstanceTypeR5ad2xlarge is a InstanceType enum value
+ InstanceTypeR5ad2xlarge = "r5ad.2xlarge"
+
+ // InstanceTypeR5ad4xlarge is a InstanceType enum value
+ InstanceTypeR5ad4xlarge = "r5ad.4xlarge"
+
+ // InstanceTypeR5ad8xlarge is a InstanceType enum value
+ InstanceTypeR5ad8xlarge = "r5ad.8xlarge"
+
+ // InstanceTypeR5ad12xlarge is a InstanceType enum value
+ InstanceTypeR5ad12xlarge = "r5ad.12xlarge"
+
+ // InstanceTypeR5ad16xlarge is a InstanceType enum value
+ InstanceTypeR5ad16xlarge = "r5ad.16xlarge"
+
+ // InstanceTypeR5ad24xlarge is a InstanceType enum value
+ InstanceTypeR5ad24xlarge = "r5ad.24xlarge"
+
// InstanceTypeX116xlarge is a InstanceType enum value
InstanceTypeX116xlarge = "x1.16xlarge"
@@ -70689,6 +94309,27 @@ const (
// InstanceTypeI3Metal is a InstanceType enum value
InstanceTypeI3Metal = "i3.metal"
+ // InstanceTypeI3enLarge is a InstanceType enum value
+ InstanceTypeI3enLarge = "i3en.large"
+
+ // InstanceTypeI3enXlarge is a InstanceType enum value
+ InstanceTypeI3enXlarge = "i3en.xlarge"
+
+ // InstanceTypeI3en2xlarge is a InstanceType enum value
+ InstanceTypeI3en2xlarge = "i3en.2xlarge"
+
+ // InstanceTypeI3en3xlarge is a InstanceType enum value
+ InstanceTypeI3en3xlarge = "i3en.3xlarge"
+
+ // InstanceTypeI3en6xlarge is a InstanceType enum value
+ InstanceTypeI3en6xlarge = "i3en.6xlarge"
+
+ // InstanceTypeI3en12xlarge is a InstanceType enum value
+ InstanceTypeI3en12xlarge = "i3en.12xlarge"
+
+ // InstanceTypeI3en24xlarge is a InstanceType enum value
+ InstanceTypeI3en24xlarge = "i3en.24xlarge"
+
// InstanceTypeHi14xlarge is a InstanceType enum value
InstanceTypeHi14xlarge = "hi1.4xlarge"
@@ -70746,9 +94387,18 @@ const (
// InstanceTypeC59xlarge is a InstanceType enum value
InstanceTypeC59xlarge = "c5.9xlarge"
+ // InstanceTypeC512xlarge is a InstanceType enum value
+ InstanceTypeC512xlarge = "c5.12xlarge"
+
// InstanceTypeC518xlarge is a InstanceType enum value
InstanceTypeC518xlarge = "c5.18xlarge"
+ // InstanceTypeC524xlarge is a InstanceType enum value
+ InstanceTypeC524xlarge = "c5.24xlarge"
+
+ // InstanceTypeC5Metal is a InstanceType enum value
+ InstanceTypeC5Metal = "c5.metal"
+
// InstanceTypeC5dLarge is a InstanceType enum value
InstanceTypeC5dLarge = "c5d.large"
@@ -70767,6 +94417,24 @@ const (
// InstanceTypeC5d18xlarge is a InstanceType enum value
InstanceTypeC5d18xlarge = "c5d.18xlarge"
+ // InstanceTypeC5nLarge is a InstanceType enum value
+ InstanceTypeC5nLarge = "c5n.large"
+
+ // InstanceTypeC5nXlarge is a InstanceType enum value
+ InstanceTypeC5nXlarge = "c5n.xlarge"
+
+ // InstanceTypeC5n2xlarge is a InstanceType enum value
+ InstanceTypeC5n2xlarge = "c5n.2xlarge"
+
+ // InstanceTypeC5n4xlarge is a InstanceType enum value
+ InstanceTypeC5n4xlarge = "c5n.4xlarge"
+
+ // InstanceTypeC5n9xlarge is a InstanceType enum value
+ InstanceTypeC5n9xlarge = "c5n.9xlarge"
+
+ // InstanceTypeC5n18xlarge is a InstanceType enum value
+ InstanceTypeC5n18xlarge = "c5n.18xlarge"
+
// InstanceTypeCc14xlarge is a InstanceType enum value
InstanceTypeCc14xlarge = "cc1.4xlarge"
@@ -70788,6 +94456,9 @@ const (
// InstanceTypeG316xlarge is a InstanceType enum value
InstanceTypeG316xlarge = "g3.16xlarge"
+ // InstanceTypeG3sXlarge is a InstanceType enum value
+ InstanceTypeG3sXlarge = "g3s.xlarge"
+
// InstanceTypeCg14xlarge is a InstanceType enum value
InstanceTypeCg14xlarge = "cg1.4xlarge"
@@ -70809,6 +94480,9 @@ const (
// InstanceTypeP316xlarge is a InstanceType enum value
InstanceTypeP316xlarge = "p3.16xlarge"
+ // InstanceTypeP3dn24xlarge is a InstanceType enum value
+ InstanceTypeP3dn24xlarge = "p3dn.24xlarge"
+
// InstanceTypeD2Xlarge is a InstanceType enum value
InstanceTypeD2Xlarge = "d2.xlarge"
@@ -70824,6 +94498,9 @@ const (
// InstanceTypeF12xlarge is a InstanceType enum value
InstanceTypeF12xlarge = "f1.2xlarge"
+ // InstanceTypeF14xlarge is a InstanceType enum value
+ InstanceTypeF14xlarge = "f1.4xlarge"
+
// InstanceTypeF116xlarge is a InstanceType enum value
InstanceTypeF116xlarge = "f1.16xlarge"
@@ -70839,12 +94516,96 @@ const (
// InstanceTypeM54xlarge is a InstanceType enum value
InstanceTypeM54xlarge = "m5.4xlarge"
+ // InstanceTypeM58xlarge is a InstanceType enum value
+ InstanceTypeM58xlarge = "m5.8xlarge"
+
// InstanceTypeM512xlarge is a InstanceType enum value
InstanceTypeM512xlarge = "m5.12xlarge"
+ // InstanceTypeM516xlarge is a InstanceType enum value
+ InstanceTypeM516xlarge = "m5.16xlarge"
+
// InstanceTypeM524xlarge is a InstanceType enum value
InstanceTypeM524xlarge = "m5.24xlarge"
+ // InstanceTypeM5Metal is a InstanceType enum value
+ InstanceTypeM5Metal = "m5.metal"
+
+ // InstanceTypeM5aLarge is a InstanceType enum value
+ InstanceTypeM5aLarge = "m5a.large"
+
+ // InstanceTypeM5aXlarge is a InstanceType enum value
+ InstanceTypeM5aXlarge = "m5a.xlarge"
+
+ // InstanceTypeM5a2xlarge is a InstanceType enum value
+ InstanceTypeM5a2xlarge = "m5a.2xlarge"
+
+ // InstanceTypeM5a4xlarge is a InstanceType enum value
+ InstanceTypeM5a4xlarge = "m5a.4xlarge"
+
+ // InstanceTypeM5a8xlarge is a InstanceType enum value
+ InstanceTypeM5a8xlarge = "m5a.8xlarge"
+
+ // InstanceTypeM5a12xlarge is a InstanceType enum value
+ InstanceTypeM5a12xlarge = "m5a.12xlarge"
+
+ // InstanceTypeM5a16xlarge is a InstanceType enum value
+ InstanceTypeM5a16xlarge = "m5a.16xlarge"
+
+ // InstanceTypeM5a24xlarge is a InstanceType enum value
+ InstanceTypeM5a24xlarge = "m5a.24xlarge"
+
+ // InstanceTypeM5dLarge is a InstanceType enum value
+ InstanceTypeM5dLarge = "m5d.large"
+
+ // InstanceTypeM5dXlarge is a InstanceType enum value
+ InstanceTypeM5dXlarge = "m5d.xlarge"
+
+ // InstanceTypeM5d2xlarge is a InstanceType enum value
+ InstanceTypeM5d2xlarge = "m5d.2xlarge"
+
+ // InstanceTypeM5d4xlarge is a InstanceType enum value
+ InstanceTypeM5d4xlarge = "m5d.4xlarge"
+
+ // InstanceTypeM5d8xlarge is a InstanceType enum value
+ InstanceTypeM5d8xlarge = "m5d.8xlarge"
+
+ // InstanceTypeM5d12xlarge is a InstanceType enum value
+ InstanceTypeM5d12xlarge = "m5d.12xlarge"
+
+ // InstanceTypeM5d16xlarge is a InstanceType enum value
+ InstanceTypeM5d16xlarge = "m5d.16xlarge"
+
+ // InstanceTypeM5d24xlarge is a InstanceType enum value
+ InstanceTypeM5d24xlarge = "m5d.24xlarge"
+
+ // InstanceTypeM5dMetal is a InstanceType enum value
+ InstanceTypeM5dMetal = "m5d.metal"
+
+ // InstanceTypeM5adLarge is a InstanceType enum value
+ InstanceTypeM5adLarge = "m5ad.large"
+
+ // InstanceTypeM5adXlarge is a InstanceType enum value
+ InstanceTypeM5adXlarge = "m5ad.xlarge"
+
+ // InstanceTypeM5ad2xlarge is a InstanceType enum value
+ InstanceTypeM5ad2xlarge = "m5ad.2xlarge"
+
+ // InstanceTypeM5ad4xlarge is a InstanceType enum value
+ InstanceTypeM5ad4xlarge = "m5ad.4xlarge"
+
+ // InstanceTypeM5ad8xlarge is a InstanceType enum value
+ InstanceTypeM5ad8xlarge = "m5ad.8xlarge"
+
+ // InstanceTypeM5ad12xlarge is a InstanceType enum value
+ InstanceTypeM5ad12xlarge = "m5ad.12xlarge"
+
+ // InstanceTypeM5ad16xlarge is a InstanceType enum value
+ InstanceTypeM5ad16xlarge = "m5ad.16xlarge"
+
+ // InstanceTypeM5ad24xlarge is a InstanceType enum value
+ InstanceTypeM5ad24xlarge = "m5ad.24xlarge"
+
// InstanceTypeH12xlarge is a InstanceType enum value
InstanceTypeH12xlarge = "h1.2xlarge"
@@ -70856,6 +94617,51 @@ const (
// InstanceTypeH116xlarge is a InstanceType enum value
InstanceTypeH116xlarge = "h1.16xlarge"
+
+ // InstanceTypeZ1dLarge is a InstanceType enum value
+ InstanceTypeZ1dLarge = "z1d.large"
+
+ // InstanceTypeZ1dXlarge is a InstanceType enum value
+ InstanceTypeZ1dXlarge = "z1d.xlarge"
+
+ // InstanceTypeZ1d2xlarge is a InstanceType enum value
+ InstanceTypeZ1d2xlarge = "z1d.2xlarge"
+
+ // InstanceTypeZ1d3xlarge is a InstanceType enum value
+ InstanceTypeZ1d3xlarge = "z1d.3xlarge"
+
+ // InstanceTypeZ1d6xlarge is a InstanceType enum value
+ InstanceTypeZ1d6xlarge = "z1d.6xlarge"
+
+ // InstanceTypeZ1d12xlarge is a InstanceType enum value
+ InstanceTypeZ1d12xlarge = "z1d.12xlarge"
+
+ // InstanceTypeZ1dMetal is a InstanceType enum value
+ InstanceTypeZ1dMetal = "z1d.metal"
+
+ // InstanceTypeU6tb1Metal is a InstanceType enum value
+ InstanceTypeU6tb1Metal = "u-6tb1.metal"
+
+ // InstanceTypeU9tb1Metal is a InstanceType enum value
+ InstanceTypeU9tb1Metal = "u-9tb1.metal"
+
+ // InstanceTypeU12tb1Metal is a InstanceType enum value
+ InstanceTypeU12tb1Metal = "u-12tb1.metal"
+
+ // InstanceTypeA1Medium is a InstanceType enum value
+ InstanceTypeA1Medium = "a1.medium"
+
+ // InstanceTypeA1Large is a InstanceType enum value
+ InstanceTypeA1Large = "a1.large"
+
+ // InstanceTypeA1Xlarge is a InstanceType enum value
+ InstanceTypeA1Xlarge = "a1.xlarge"
+
+ // InstanceTypeA12xlarge is a InstanceType enum value
+ InstanceTypeA12xlarge = "a1.2xlarge"
+
+ // InstanceTypeA14xlarge is a InstanceType enum value
+ InstanceTypeA14xlarge = "a1.4xlarge"
)
const (
@@ -70866,6 +94672,14 @@ const (
InterfacePermissionTypeEipAssociate = "EIP-ASSOCIATE"
)
+const (
+ // Ipv6SupportValueEnable is a Ipv6SupportValue enum value
+ Ipv6SupportValueEnable = "enable"
+
+ // Ipv6SupportValueDisable is a Ipv6SupportValue enum value
+ Ipv6SupportValueDisable = "disable"
+)
+
const (
// LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist is a LaunchTemplateErrorCode enum value
LaunchTemplateErrorCodeLaunchTemplateIdDoesNotExist = "launchTemplateIdDoesNotExist"
@@ -70914,6 +94728,14 @@ const (
ListingStatusClosed = "closed"
)
+const (
+ // LogDestinationTypeCloudWatchLogs is a LogDestinationType enum value
+ LogDestinationTypeCloudWatchLogs = "cloud-watch-logs"
+
+ // LogDestinationTypeS3 is a LogDestinationType enum value
+ LogDestinationTypeS3 = "s3"
+)
+
const (
// MarketTypeSpot is a MarketType enum value
MarketTypeSpot = "spot"
@@ -70972,6 +94794,11 @@ const (
NetworkInterfaceAttributeAttachment = "attachment"
)
+const (
+ // NetworkInterfaceCreationTypeEfa is a NetworkInterfaceCreationType enum value
+ NetworkInterfaceCreationTypeEfa = "efa"
+)
+
const (
// NetworkInterfacePermissionStateCodePending is a NetworkInterfacePermissionStateCode enum value
NetworkInterfacePermissionStateCodePending = "pending"
@@ -71009,6 +94836,9 @@ const (
// NetworkInterfaceTypeNatGateway is a NetworkInterfaceType enum value
NetworkInterfaceTypeNatGateway = "natGateway"
+
+ // NetworkInterfaceTypeEfa is a NetworkInterfaceType enum value
+ NetworkInterfaceTypeEfa = "efa"
)
const (
@@ -71039,6 +94869,14 @@ const (
OfferingTypeValuesAllUpfront = "All Upfront"
)
+const (
+ // OnDemandAllocationStrategyLowestPrice is a OnDemandAllocationStrategy enum value
+ OnDemandAllocationStrategyLowestPrice = "lowestPrice"
+
+ // OnDemandAllocationStrategyPrioritized is a OnDemandAllocationStrategy enum value
+ OnDemandAllocationStrategyPrioritized = "prioritized"
+)
+
const (
// OperationTypeAdd is a OperationType enum value
OperationTypeAdd = "add"
@@ -71083,6 +94921,9 @@ const (
// PlacementStrategySpread is a PlacementStrategy enum value
PlacementStrategySpread = "spread"
+
+ // PlacementStrategyPartition is a PlacementStrategy enum value
+ PlacementStrategyPartition = "partition"
)
const (
@@ -71213,12 +95054,30 @@ const (
)
const (
+ // ResourceTypeClientVpnEndpoint is a ResourceType enum value
+ ResourceTypeClientVpnEndpoint = "client-vpn-endpoint"
+
// ResourceTypeCustomerGateway is a ResourceType enum value
ResourceTypeCustomerGateway = "customer-gateway"
+ // ResourceTypeDedicatedHost is a ResourceType enum value
+ ResourceTypeDedicatedHost = "dedicated-host"
+
// ResourceTypeDhcpOptions is a ResourceType enum value
ResourceTypeDhcpOptions = "dhcp-options"
+ // ResourceTypeElasticIp is a ResourceType enum value
+ ResourceTypeElasticIp = "elastic-ip"
+
+ // ResourceTypeFleet is a ResourceType enum value
+ ResourceTypeFleet = "fleet"
+
+ // ResourceTypeFpgaImage is a ResourceType enum value
+ ResourceTypeFpgaImage = "fpga-image"
+
+ // ResourceTypeHostReservation is a ResourceType enum value
+ ResourceTypeHostReservation = "host-reservation"
+
// ResourceTypeImage is a ResourceType enum value
ResourceTypeImage = "image"
@@ -71228,6 +95087,12 @@ const (
// ResourceTypeInternetGateway is a ResourceType enum value
ResourceTypeInternetGateway = "internet-gateway"
+ // ResourceTypeLaunchTemplate is a ResourceType enum value
+ ResourceTypeLaunchTemplate = "launch-template"
+
+ // ResourceTypeNatgateway is a ResourceType enum value
+ ResourceTypeNatgateway = "natgateway"
+
// ResourceTypeNetworkAcl is a ResourceType enum value
ResourceTypeNetworkAcl = "network-acl"
@@ -71240,6 +95105,9 @@ const (
// ResourceTypeRouteTable is a ResourceType enum value
ResourceTypeRouteTable = "route-table"
+ // ResourceTypeSecurityGroup is a ResourceType enum value
+ ResourceTypeSecurityGroup = "security-group"
+
// ResourceTypeSnapshot is a ResourceType enum value
ResourceTypeSnapshot = "snapshot"
@@ -71249,8 +95117,23 @@ const (
// ResourceTypeSubnet is a ResourceType enum value
ResourceTypeSubnet = "subnet"
- // ResourceTypeSecurityGroup is a ResourceType enum value
- ResourceTypeSecurityGroup = "security-group"
+ // ResourceTypeTrafficMirrorFilter is a ResourceType enum value
+ ResourceTypeTrafficMirrorFilter = "traffic-mirror-filter"
+
+ // ResourceTypeTrafficMirrorSession is a ResourceType enum value
+ ResourceTypeTrafficMirrorSession = "traffic-mirror-session"
+
+ // ResourceTypeTrafficMirrorTarget is a ResourceType enum value
+ ResourceTypeTrafficMirrorTarget = "traffic-mirror-target"
+
+ // ResourceTypeTransitGateway is a ResourceType enum value
+ ResourceTypeTransitGateway = "transit-gateway"
+
+ // ResourceTypeTransitGatewayAttachment is a ResourceType enum value
+ ResourceTypeTransitGatewayAttachment = "transit-gateway-attachment"
+
+ // ResourceTypeTransitGatewayRouteTable is a ResourceType enum value
+ ResourceTypeTransitGatewayRouteTable = "transit-gateway-route-table"
// ResourceTypeVolume is a ResourceType enum value
ResourceTypeVolume = "volume"
@@ -71258,6 +95141,9 @@ const (
// ResourceTypeVpc is a ResourceType enum value
ResourceTypeVpc = "vpc"
+ // ResourceTypeVpcPeeringConnection is a ResourceType enum value
+ ResourceTypeVpcPeeringConnection = "vpc-peering-connection"
+
// ResourceTypeVpnConnection is a ResourceType enum value
ResourceTypeVpnConnection = "vpn-connection"
@@ -71508,6 +95394,60 @@ const (
TenancyHost = "host"
)
+const (
+ // TrafficDirectionIngress is a TrafficDirection enum value
+ TrafficDirectionIngress = "ingress"
+
+ // TrafficDirectionEgress is a TrafficDirection enum value
+ TrafficDirectionEgress = "egress"
+)
+
+const (
+ // TrafficMirrorFilterRuleFieldDestinationPortRange is a TrafficMirrorFilterRuleField enum value
+ TrafficMirrorFilterRuleFieldDestinationPortRange = "destination-port-range"
+
+ // TrafficMirrorFilterRuleFieldSourcePortRange is a TrafficMirrorFilterRuleField enum value
+ TrafficMirrorFilterRuleFieldSourcePortRange = "source-port-range"
+
+ // TrafficMirrorFilterRuleFieldProtocol is a TrafficMirrorFilterRuleField enum value
+ TrafficMirrorFilterRuleFieldProtocol = "protocol"
+
+ // TrafficMirrorFilterRuleFieldDescription is a TrafficMirrorFilterRuleField enum value
+ TrafficMirrorFilterRuleFieldDescription = "description"
+)
+
+const (
+ // TrafficMirrorNetworkServiceAmazonDns is a TrafficMirrorNetworkService enum value
+ TrafficMirrorNetworkServiceAmazonDns = "amazon-dns"
+)
+
+const (
+ // TrafficMirrorRuleActionAccept is a TrafficMirrorRuleAction enum value
+ TrafficMirrorRuleActionAccept = "accept"
+
+ // TrafficMirrorRuleActionReject is a TrafficMirrorRuleAction enum value
+ TrafficMirrorRuleActionReject = "reject"
+)
+
+const (
+ // TrafficMirrorSessionFieldPacketLength is a TrafficMirrorSessionField enum value
+ TrafficMirrorSessionFieldPacketLength = "packet-length"
+
+ // TrafficMirrorSessionFieldDescription is a TrafficMirrorSessionField enum value
+ TrafficMirrorSessionFieldDescription = "description"
+
+ // TrafficMirrorSessionFieldVirtualNetworkId is a TrafficMirrorSessionField enum value
+ TrafficMirrorSessionFieldVirtualNetworkId = "virtual-network-id"
+)
+
+const (
+ // TrafficMirrorTargetTypeNetworkInterface is a TrafficMirrorTargetType enum value
+ TrafficMirrorTargetTypeNetworkInterface = "network-interface"
+
+ // TrafficMirrorTargetTypeNetworkLoadBalancer is a TrafficMirrorTargetType enum value
+ TrafficMirrorTargetTypeNetworkLoadBalancer = "network-load-balancer"
+)
+
const (
// TrafficTypeAccept is a TrafficType enum value
TrafficTypeAccept = "ACCEPT"
@@ -71519,6 +95459,144 @@ const (
TrafficTypeAll = "ALL"
)
+const (
+ // TransitGatewayAssociationStateAssociating is a TransitGatewayAssociationState enum value
+ TransitGatewayAssociationStateAssociating = "associating"
+
+ // TransitGatewayAssociationStateAssociated is a TransitGatewayAssociationState enum value
+ TransitGatewayAssociationStateAssociated = "associated"
+
+ // TransitGatewayAssociationStateDisassociating is a TransitGatewayAssociationState enum value
+ TransitGatewayAssociationStateDisassociating = "disassociating"
+
+ // TransitGatewayAssociationStateDisassociated is a TransitGatewayAssociationState enum value
+ TransitGatewayAssociationStateDisassociated = "disassociated"
+)
+
+const (
+ // TransitGatewayAttachmentResourceTypeVpc is a TransitGatewayAttachmentResourceType enum value
+ TransitGatewayAttachmentResourceTypeVpc = "vpc"
+
+ // TransitGatewayAttachmentResourceTypeVpn is a TransitGatewayAttachmentResourceType enum value
+ TransitGatewayAttachmentResourceTypeVpn = "vpn"
+
+ // TransitGatewayAttachmentResourceTypeDirectConnectGateway is a TransitGatewayAttachmentResourceType enum value
+ TransitGatewayAttachmentResourceTypeDirectConnectGateway = "direct-connect-gateway"
+)
+
+const (
+ // TransitGatewayAttachmentStatePendingAcceptance is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStatePendingAcceptance = "pendingAcceptance"
+
+ // TransitGatewayAttachmentStateRollingBack is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateRollingBack = "rollingBack"
+
+ // TransitGatewayAttachmentStatePending is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStatePending = "pending"
+
+ // TransitGatewayAttachmentStateAvailable is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateAvailable = "available"
+
+ // TransitGatewayAttachmentStateModifying is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateModifying = "modifying"
+
+ // TransitGatewayAttachmentStateDeleting is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateDeleting = "deleting"
+
+ // TransitGatewayAttachmentStateDeleted is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateDeleted = "deleted"
+
+ // TransitGatewayAttachmentStateFailed is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateFailed = "failed"
+
+ // TransitGatewayAttachmentStateRejected is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateRejected = "rejected"
+
+ // TransitGatewayAttachmentStateRejecting is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateRejecting = "rejecting"
+
+ // TransitGatewayAttachmentStateFailing is a TransitGatewayAttachmentState enum value
+ TransitGatewayAttachmentStateFailing = "failing"
+)
+
+const (
+ // TransitGatewayPropagationStateEnabling is a TransitGatewayPropagationState enum value
+ TransitGatewayPropagationStateEnabling = "enabling"
+
+ // TransitGatewayPropagationStateEnabled is a TransitGatewayPropagationState enum value
+ TransitGatewayPropagationStateEnabled = "enabled"
+
+ // TransitGatewayPropagationStateDisabling is a TransitGatewayPropagationState enum value
+ TransitGatewayPropagationStateDisabling = "disabling"
+
+ // TransitGatewayPropagationStateDisabled is a TransitGatewayPropagationState enum value
+ TransitGatewayPropagationStateDisabled = "disabled"
+)
+
+const (
+ // TransitGatewayRouteStatePending is a TransitGatewayRouteState enum value
+ TransitGatewayRouteStatePending = "pending"
+
+ // TransitGatewayRouteStateActive is a TransitGatewayRouteState enum value
+ TransitGatewayRouteStateActive = "active"
+
+ // TransitGatewayRouteStateBlackhole is a TransitGatewayRouteState enum value
+ TransitGatewayRouteStateBlackhole = "blackhole"
+
+ // TransitGatewayRouteStateDeleting is a TransitGatewayRouteState enum value
+ TransitGatewayRouteStateDeleting = "deleting"
+
+ // TransitGatewayRouteStateDeleted is a TransitGatewayRouteState enum value
+ TransitGatewayRouteStateDeleted = "deleted"
+)
+
+const (
+ // TransitGatewayRouteTableStatePending is a TransitGatewayRouteTableState enum value
+ TransitGatewayRouteTableStatePending = "pending"
+
+ // TransitGatewayRouteTableStateAvailable is a TransitGatewayRouteTableState enum value
+ TransitGatewayRouteTableStateAvailable = "available"
+
+ // TransitGatewayRouteTableStateDeleting is a TransitGatewayRouteTableState enum value
+ TransitGatewayRouteTableStateDeleting = "deleting"
+
+ // TransitGatewayRouteTableStateDeleted is a TransitGatewayRouteTableState enum value
+ TransitGatewayRouteTableStateDeleted = "deleted"
+)
+
+const (
+ // TransitGatewayRouteTypeStatic is a TransitGatewayRouteType enum value
+ TransitGatewayRouteTypeStatic = "static"
+
+ // TransitGatewayRouteTypePropagated is a TransitGatewayRouteType enum value
+ TransitGatewayRouteTypePropagated = "propagated"
+)
+
+const (
+ // TransitGatewayStatePending is a TransitGatewayState enum value
+ TransitGatewayStatePending = "pending"
+
+ // TransitGatewayStateAvailable is a TransitGatewayState enum value
+ TransitGatewayStateAvailable = "available"
+
+ // TransitGatewayStateModifying is a TransitGatewayState enum value
+ TransitGatewayStateModifying = "modifying"
+
+ // TransitGatewayStateDeleting is a TransitGatewayState enum value
+ TransitGatewayStateDeleting = "deleting"
+
+ // TransitGatewayStateDeleted is a TransitGatewayState enum value
+ TransitGatewayStateDeleted = "deleted"
+)
+
+const (
+ // TransportProtocolTcp is a TransportProtocol enum value
+ TransportProtocolTcp = "tcp"
+
+ // TransportProtocolUdp is a TransportProtocol enum value
+ TransportProtocolUdp = "udp"
+)
+
const (
// UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value
UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed = "InvalidInstanceID.Malformed"
@@ -71714,6 +95792,19 @@ const (
VpcTenancyDefault = "default"
)
+const (
+ // VpnEcmpSupportValueEnable is a VpnEcmpSupportValue enum value
+ VpnEcmpSupportValueEnable = "enable"
+
+ // VpnEcmpSupportValueDisable is a VpnEcmpSupportValue enum value
+ VpnEcmpSupportValueDisable = "disable"
+)
+
+const (
+ // VpnProtocolOpenvpn is a VpnProtocol enum value
+ VpnProtocolOpenvpn = "openvpn"
+)
+
const (
// VpnStatePending is a VpnState enum value
VpnStatePending = "pending"
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 909e05a14..e403b84a4 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,9 +3,23 @@
// Package ec2 provides the client and types for making API
// requests to Amazon Elastic Compute Cloud.
//
-// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity
-// in the AWS Cloud. Using Amazon EC2 eliminates the need to invest in hardware
-// up front, so you can develop and deploy applications faster.
+// Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing
+// capacity in the AWS cloud. Using Amazon EC2 eliminates the need to invest
+// in hardware up front, so you can develop and deploy applications faster.
+//
+// To learn more, see the following resources:
+//
+// * Amazon EC2: Amazon EC2 product page (http://aws.amazon.com/ec2), Amazon
+// EC2 documentation (http://aws.amazon.com/documentation/ec2)
+//
+// * Amazon EBS: Amazon EBS product page (http://aws.amazon.com/ebs), Amazon
+// EBS documentation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html)
+//
+// * Amazon VPC: Amazon VPC product page (http://aws.amazon.com/vpc), Amazon
+// VPC documentation (http://aws.amazon.com/documentation/vpc)
+//
+// * AWS VPN: AWS VPN product page (http://aws.amazon.com/vpn), AWS VPN documentation
+// (http://aws.amazon.com/documentation/vpn)
//
// 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/ec2/service.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
index ba4433d38..6acbc43fe 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "ec2" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "ec2" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "EC2" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the EC2 client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go
index d0b0b4dba..493f71971 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go
@@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/protocol"
+ "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opCreateCluster = "CreateCluster"
@@ -16,7 +18,7 @@ const opCreateCluster = "CreateCluster"
// CreateClusterRequest generates a "aws/request.Request" representing the
// client's request for the CreateCluster operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -64,7 +66,7 @@ func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ
// AWS services can be managed on your behalf. However, if the IAM user that
// makes the call does not have permissions to create the service-linked role,
// it is not created. For more information, see Using Service-Linked Roles for
-// Amazon ECS (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
+// Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -114,7 +116,7 @@ const opCreateService = "CreateService"
// CreateServiceRequest generates a "aws/request.Request" representing the
// client's request for the CreateService operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -154,43 +156,86 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ
// CreateService API operation for Amazon EC2 Container Service.
//
// Runs and maintains a desired number of tasks from a specified task definition.
-// If the number of tasks running in a service drops below desiredCount, Amazon
-// ECS spawns another copy of the task in the specified cluster. To update an
-// existing service, see UpdateService.
+// If the number of tasks running in a service drops below the desiredCount,
+// Amazon ECS spawns another copy of the task in the specified cluster. To update
+// an existing service, see UpdateService.
//
// In addition to maintaining the desired count of tasks in your service, you
// can optionally run your service behind a load balancer. The load balancer
// distributes traffic across the tasks that are associated with the service.
-// For more information, see Service Load Balancing (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html)
+// For more information, see Service Load Balancing (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html)
// in the Amazon Elastic Container Service Developer Guide.
//
-// You can optionally specify a deployment configuration for your service. During
-// a deployment, the service scheduler uses the minimumHealthyPercent and maximumPercent
-// parameters to determine the deployment strategy. The deployment is triggered
-// by changing the task definition or the desired count of a service with an
-// UpdateService operation.
+// Tasks for services that do not use a load balancer are considered healthy
+// if they're in the RUNNING state. Tasks for services that do use a load balancer
+// are considered healthy if they're in the RUNNING state and the container
+// instance that they're hosted on is reported as healthy by the load balancer.
//
-// The minimumHealthyPercent represents a lower limit on the number of your
-// service's tasks that must remain in the RUNNING state during a deployment,
-// as a percentage of the desiredCount (rounded up to the nearest integer).
-// This parameter enables you to deploy without using additional cluster capacity.
-// For example, if your service has a desiredCount of four tasks and a minimumHealthyPercent
-// of 50%, the scheduler can stop two existing tasks to free up cluster capacity
-// before starting two new tasks. Tasks for services that do not use a load
-// balancer are considered healthy if they are in the RUNNING state. Tasks for
-// services that do use a load balancer are considered healthy if they are in
-// the RUNNING state and the container instance they are hosted on is reported
-// as healthy by the load balancer. The default value for minimumHealthyPercent
-// is 50% in the console and 100% for the AWS CLI, the AWS SDKs, and the APIs.
+// There are two service scheduler strategies available:
//
-// The maximumPercent parameter represents an upper limit on the number of your
-// service's tasks that are allowed in the RUNNING or PENDING state during a
-// deployment, as a percentage of the desiredCount (rounded down to the nearest
-// integer). This parameter enables you to define the deployment batch size.
-// For example, if your service has a desiredCount of four tasks and a maximumPercent
-// value of 200%, the scheduler can start four new tasks before stopping the
-// four older tasks (provided that the cluster resources required to do this
-// are available). The default value for maximumPercent is 200%.
+// * REPLICA - The replica scheduling strategy places and maintains the desired
+// number of tasks across your cluster. By default, the service scheduler
+// spreads tasks across Availability Zones. You can use task placement strategies
+// and constraints to customize task placement decisions. For more information,
+// see Service Scheduler Concepts (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// * DAEMON - The daemon scheduling strategy deploys exactly one task on
+// each active container instance that meets all of the task placement constraints
+// that you specify in your cluster. When using this strategy, you don't
+// need to specify a desired number of tasks, a task placement strategy,
+// or use Service Auto Scaling policies. For more information, see Service
+// Scheduler Concepts (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// You can optionally specify a deployment configuration for your service. The
+// deployment is triggered by changing properties, such as the task definition
+// or the desired count of a service, with an UpdateService operation. The default
+// value for a replica service for minimumHealthyPercent is 100%. The default
+// value for a daemon service for minimumHealthyPercent is 0%.
+//
+// If a service is using the ECS deployment controller, the minimum healthy
+// percent represents a lower limit on the number of tasks in a service that
+// must remain in the RUNNING state during a deployment, as a percentage of
+// the desired number of tasks (rounded up to the nearest integer), and while
+// any container instances are in the DRAINING state if the service contains
+// tasks using the EC2 launch type. This parameter enables you to deploy without
+// using additional cluster capacity. For example, if your service has a desired
+// number of four tasks and a minimum healthy percent of 50%, the scheduler
+// might stop two existing tasks to free up cluster capacity before starting
+// two new tasks. Tasks for services that do not use a load balancer are considered
+// healthy if they're in the RUNNING state. Tasks for services that do use a
+// load balancer are considered healthy if they're in the RUNNING state and
+// they're reported as healthy by the load balancer. The default value for minimum
+// healthy percent is 100%.
+//
+// If a service is using the ECS deployment controller, the maximum percent
+// parameter represents an upper limit on the number of tasks in a service that
+// are allowed in the RUNNING or PENDING state during a deployment, as a percentage
+// of the desired number of tasks (rounded down to the nearest integer), and
+// while any container instances are in the DRAINING state if the service contains
+// tasks using the EC2 launch type. This parameter enables you to define the
+// deployment batch size. For example, if your service has a desired number
+// of four tasks and a maximum percent value of 200%, the scheduler may start
+// four new tasks before stopping the four older tasks (provided that the cluster
+// resources required to do this are available). The default value for maximum
+// percent is 200%.
+//
+// If a service is using either the CODE_DEPLOY or EXTERNAL deployment controller
+// types and tasks that use the EC2 launch type, the minimum healthy percent
+// and maximum percent values are used only to define the lower and upper limit
+// on the number of the tasks in the service that remain in the RUNNING state
+// while the container instances are in the DRAINING state. If the tasks in
+// the service use the Fargate launch type, the minimum healthy percent and
+// maximum percent values aren't used, although they're currently visible when
+// describing your service.
+//
+// When creating a service that uses the EXTERNAL deployment controller, you
+// can specify only parameters that aren't controlled at the task set level.
+// The only required parameter is the service name. You control your services
+// using the CreateTaskSet operation. For more information, see Amazon ECS Deployment
+// Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer Guide.
//
// When the service scheduler launches new tasks, it determines task placement
// in your cluster using the following logic:
@@ -201,17 +246,14 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ
//
// * By default, the service scheduler attempts to balance tasks across Availability
// Zones in this manner (although you can choose a different placement strategy)
-// with the placementStrategy parameter):
-//
-// Sort the valid container instances, giving priority to instances that have
-// the fewest number of running tasks for this service in their respective
-// Availability Zone. For example, if zone A has one running service task
-// and zones B and C each have zero, valid container instances in either
-// zone B or C are considered optimal for placement.
-//
-// Place the new service task on a valid container instance in an optimal Availability
-// Zone (based on the previous steps), favoring container instances with
-// the fewest number of running tasks for this service.
+// with the placementStrategy parameter): Sort the valid container instances,
+// giving priority to instances that have the fewest number of running tasks
+// for this service in their respective Availability Zone. For example, if
+// zone A has one running service task and zones B and C each have zero,
+// valid container instances in either zone B or C are considered optimal
+// for placement. Place the new service task on a valid container instance
+// in an optimal Availability Zone (based on the previous steps), favoring
+// container instances with the fewest number of running tasks for this service.
//
// 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
@@ -235,16 +277,16 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
-// The specified task is not supported in this region.
+// The specified task is not supported in this Region.
//
// * ErrCodePlatformUnknownException "PlatformUnknownException"
// The specified platform version does not exist.
//
// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException"
-// The specified platform version does not satisfy the task definition’s required
+// The specified platform version does not satisfy the task definition's required
// capabilities.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
@@ -272,12 +314,217 @@ func (c *ECS) CreateServiceWithContext(ctx aws.Context, input *CreateServiceInpu
return out, req.Send()
}
+const opCreateTaskSet = "CreateTaskSet"
+
+// CreateTaskSetRequest generates a "aws/request.Request" representing the
+// client's request for the CreateTaskSet 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 CreateTaskSet for more information on using the CreateTaskSet
+// 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 CreateTaskSetRequest method.
+// req, resp := client.CreateTaskSetRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateTaskSet
+func (c *ECS) CreateTaskSetRequest(input *CreateTaskSetInput) (req *request.Request, output *CreateTaskSetOutput) {
+ op := &request.Operation{
+ Name: opCreateTaskSet,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateTaskSetInput{}
+ }
+
+ output = &CreateTaskSetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateTaskSet API operation for Amazon EC2 Container Service.
+//
+// Create a task set in the specified cluster and service. This is used when
+// a service uses the EXTERNAL deployment controller type. For more information,
+// see Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation CreateTaskSet for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
+// The specified task is not supported in this Region.
+//
+// * ErrCodePlatformUnknownException "PlatformUnknownException"
+// The specified platform version does not exist.
+//
+// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException"
+// The specified platform version does not satisfy the task definition's required
+// capabilities.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
+// The specified service could not be found. You can view your available services
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
+//
+// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
+// The specified service is not active. You can't update a service that is inactive.
+// If you have previously deleted a service, you can re-create it with CreateService.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateTaskSet
+func (c *ECS) CreateTaskSet(input *CreateTaskSetInput) (*CreateTaskSetOutput, error) {
+ req, out := c.CreateTaskSetRequest(input)
+ return out, req.Send()
+}
+
+// CreateTaskSetWithContext is the same as CreateTaskSet with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateTaskSet 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 *ECS) CreateTaskSetWithContext(ctx aws.Context, input *CreateTaskSetInput, opts ...request.Option) (*CreateTaskSetOutput, error) {
+ req, out := c.CreateTaskSetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteAccountSetting = "DeleteAccountSetting"
+
+// DeleteAccountSettingRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteAccountSetting 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 DeleteAccountSetting for more information on using the DeleteAccountSetting
+// 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 DeleteAccountSettingRequest method.
+// req, resp := client.DeleteAccountSettingRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAccountSetting
+func (c *ECS) DeleteAccountSettingRequest(input *DeleteAccountSettingInput) (req *request.Request, output *DeleteAccountSettingOutput) {
+ op := &request.Operation{
+ Name: opDeleteAccountSetting,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteAccountSettingInput{}
+ }
+
+ output = &DeleteAccountSettingOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteAccountSetting API operation for Amazon EC2 Container Service.
+//
+// Disables an account setting for a specified IAM user, IAM role, or the root
+// user for an 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
+// the error.
+//
+// See the AWS API reference guide for Amazon EC2 Container Service's
+// API operation DeleteAccountSetting for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteAccountSetting
+func (c *ECS) DeleteAccountSetting(input *DeleteAccountSettingInput) (*DeleteAccountSettingOutput, error) {
+ req, out := c.DeleteAccountSettingRequest(input)
+ return out, req.Send()
+}
+
+// DeleteAccountSettingWithContext is the same as DeleteAccountSetting with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteAccountSetting 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 *ECS) DeleteAccountSettingWithContext(ctx aws.Context, input *DeleteAccountSettingInput, opts ...request.Option) (*DeleteAccountSettingOutput, error) {
+ req, out := c.DeleteAccountSettingRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteAttributes = "DeleteAttributes"
// DeleteAttributesRequest generates a "aws/request.Request" representing the
// client's request for the DeleteAttributes operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -328,12 +575,12 @@ func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) (req *reques
// Returned Error Codes:
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeTargetNotFoundException "TargetNotFoundException"
// The specified target could not be found. You can view your available container
// instances with ListContainerInstances. Amazon ECS container instances are
-// cluster-specific and region-specific.
+// cluster-specific and Region-specific.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// The specified parameter is invalid. Review the available parameters for the
@@ -366,7 +613,7 @@ const opDeleteCluster = "DeleteCluster"
// DeleteClusterRequest generates a "aws/request.Request" representing the
// client's request for the DeleteCluster operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -431,17 +678,17 @@ func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeClusterContainsContainerInstancesException "ClusterContainsContainerInstancesException"
-// You cannot delete a cluster that has registered container instances. You
-// must first deregister the container instances before you can delete the cluster.
-// For more information, see DeregisterContainerInstance.
+// You cannot delete a cluster that has registered container instances. First,
+// deregister the container instances before you can delete the cluster. For
+// more information, see DeregisterContainerInstance.
//
// * ErrCodeClusterContainsServicesException "ClusterContainsServicesException"
-// You cannot delete a cluster that contains services. You must first update
-// the service to reduce its desired task count to 0 and then delete the service.
-// For more information, see UpdateService and DeleteService.
+// You cannot delete a cluster that contains services. First, update the service
+// to reduce its desired task count to 0 and then delete the service. For more
+// information, see UpdateService and DeleteService.
//
// * ErrCodeClusterContainsTasksException "ClusterContainsTasksException"
// You cannot delete a cluster that has active tasks.
@@ -473,7 +720,7 @@ const opDeleteService = "DeleteService"
// DeleteServiceRequest generates a "aws/request.Request" representing the
// client's request for the DeleteService operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -520,12 +767,16 @@ func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Requ
//
// When you delete a service, if there are still running tasks that require
// cleanup, the service status moves from ACTIVE to DRAINING, and the service
-// is no longer visible in the console or in ListServices API operations. After
-// the tasks have stopped, then the service status moves from DRAINING to INACTIVE.
-// Services in the DRAINING or INACTIVE status can still be viewed with DescribeServices
-// API operations. However, in the future, INACTIVE services may be cleaned
-// up and purged from Amazon ECS record keeping, and DescribeServices API operations
-// on those services return a ServiceNotFoundException error.
+// is no longer visible in the console or in the ListServices API operation.
+// After the tasks have stopped, then the service status moves from DRAINING
+// to INACTIVE. Services in the DRAINING or INACTIVE status can still be viewed
+// with the DescribeServices API operation. However, in the future, INACTIVE
+// services may be cleaned up and purged from Amazon ECS record keeping, and
+// DescribeServices calls on those services return a ServiceNotFoundException
+// error.
+//
+// If you attempt to create a new service with the same name as an existing
+// service in either ACTIVE or DRAINING status, you receive an error.
//
// 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
@@ -549,11 +800,11 @@ func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Requ
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
// The specified service could not be found. You can view your available services
-// with ListServices. Amazon ECS services are cluster-specific and region-specific.
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteService
func (c *ECS) DeleteService(input *DeleteServiceInput) (*DeleteServiceOutput, error) {
@@ -577,12 +828,126 @@ func (c *ECS) DeleteServiceWithContext(ctx aws.Context, input *DeleteServiceInpu
return out, req.Send()
}
+const opDeleteTaskSet = "DeleteTaskSet"
+
+// DeleteTaskSetRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteTaskSet 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 DeleteTaskSet for more information on using the DeleteTaskSet
+// 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 DeleteTaskSetRequest method.
+// req, resp := client.DeleteTaskSetRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteTaskSet
+func (c *ECS) DeleteTaskSetRequest(input *DeleteTaskSetInput) (req *request.Request, output *DeleteTaskSetOutput) {
+ op := &request.Operation{
+ Name: opDeleteTaskSet,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteTaskSetInput{}
+ }
+
+ output = &DeleteTaskSetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteTaskSet API operation for Amazon EC2 Container Service.
+//
+// Deletes a specified task set within a service. This is used when a service
+// uses the EXTERNAL deployment controller type. For more information, see Amazon
+// ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation DeleteTaskSet for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
+// The specified task is not supported in this Region.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
+// The specified service could not be found. You can view your available services
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
+//
+// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
+// The specified service is not active. You can't update a service that is inactive.
+// If you have previously deleted a service, you can re-create it with CreateService.
+//
+// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException"
+// The specified task set could not be found. You can view your available container
+// instances with DescribeTaskSets. Task sets are specific to each cluster,
+// service and Region.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteTaskSet
+func (c *ECS) DeleteTaskSet(input *DeleteTaskSetInput) (*DeleteTaskSetOutput, error) {
+ req, out := c.DeleteTaskSetRequest(input)
+ return out, req.Send()
+}
+
+// DeleteTaskSetWithContext is the same as DeleteTaskSet with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteTaskSet 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 *ECS) DeleteTaskSetWithContext(ctx aws.Context, input *DeleteTaskSetInput, opts ...request.Option) (*DeleteTaskSetOutput, error) {
+ req, out := c.DeleteTaskSetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeregisterContainerInstance = "DeregisterContainerInstance"
// DeregisterContainerInstanceRequest generates a "aws/request.Request" representing the
// client's request for the DeregisterContainerInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -630,7 +995,7 @@ func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInsta
// resources.
//
// Deregistering a container instance removes the instance from a cluster, but
-// it does not terminate the EC2 instance; if you are finished using the instance,
+// it does not terminate the EC2 instance. If you are finished using the instance,
// be sure to terminate it in the Amazon EC2 console to stop billing.
//
// If you terminate a running container instance, Amazon ECS automatically deregisters
@@ -659,7 +1024,7 @@ func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInsta
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeregisterContainerInstance
func (c *ECS) DeregisterContainerInstance(input *DeregisterContainerInstanceInput) (*DeregisterContainerInstanceOutput, error) {
@@ -688,7 +1053,7 @@ const opDeregisterTaskDefinition = "DeregisterTaskDefinition"
// DeregisterTaskDefinitionRequest generates a "aws/request.Request" representing the
// client's request for the DeregisterTaskDefinition operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -735,11 +1100,11 @@ func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInp
//
// You cannot use an INACTIVE task definition to run new tasks or create new
// services, and you cannot update an existing service to reference an INACTIVE
-// task definition (although there may be up to a 10-minute window following
-// deregistration where these restrictions have not yet taken effect).
+// task definition. However, there may be up to a 10-minute window following
+// deregistration where these restrictions have not yet taken effect.
//
// At this time, INACTIVE task definitions remain discoverable in your account
-// indefinitely; however, this behavior is subject to change in the future,
+// indefinitely. However, this behavior is subject to change in the future,
// so you should not rely on INACTIVE task definitions persisting beyond the
// lifecycle of any associated tasks and services.
//
@@ -790,7 +1155,7 @@ const opDescribeClusters = "DescribeClusters"
// DescribeClustersRequest generates a "aws/request.Request" representing the
// client's request for the DescribeClusters operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -878,7 +1243,7 @@ const opDescribeContainerInstances = "DescribeContainerInstances"
// DescribeContainerInstancesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeContainerInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -942,7 +1307,7 @@ func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstance
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeContainerInstances
func (c *ECS) DescribeContainerInstances(input *DescribeContainerInstancesInput) (*DescribeContainerInstancesOutput, error) {
@@ -971,7 +1336,7 @@ const opDescribeServices = "DescribeServices"
// DescribeServicesRequest generates a "aws/request.Request" representing the
// client's request for the DescribeServices operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1034,7 +1399,7 @@ func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) (req *reques
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeServices
func (c *ECS) DescribeServices(input *DescribeServicesInput) (*DescribeServicesOutput, error) {
@@ -1063,7 +1428,7 @@ const opDescribeTaskDefinition = "DescribeTaskDefinition"
// DescribeTaskDefinitionRequest generates a "aws/request.Request" representing the
// client's request for the DescribeTaskDefinition operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1151,12 +1516,121 @@ func (c *ECS) DescribeTaskDefinitionWithContext(ctx aws.Context, input *Describe
return out, req.Send()
}
+const opDescribeTaskSets = "DescribeTaskSets"
+
+// DescribeTaskSetsRequest generates a "aws/request.Request" representing the
+// client's request for the DescribeTaskSets 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 DescribeTaskSets for more information on using the DescribeTaskSets
+// 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 DescribeTaskSetsRequest method.
+// req, resp := client.DescribeTaskSetsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskSets
+func (c *ECS) DescribeTaskSetsRequest(input *DescribeTaskSetsInput) (req *request.Request, output *DescribeTaskSetsOutput) {
+ op := &request.Operation{
+ Name: opDescribeTaskSets,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DescribeTaskSetsInput{}
+ }
+
+ output = &DescribeTaskSetsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DescribeTaskSets API operation for Amazon EC2 Container Service.
+//
+// Describes the task sets in the specified cluster and service. This is used
+// when a service uses the EXTERNAL deployment controller type. For more information,
+// see Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation DescribeTaskSets for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
+// The specified task is not supported in this Region.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
+// The specified service could not be found. You can view your available services
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
+//
+// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
+// The specified service is not active. You can't update a service that is inactive.
+// If you have previously deleted a service, you can re-create it with CreateService.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTaskSets
+func (c *ECS) DescribeTaskSets(input *DescribeTaskSetsInput) (*DescribeTaskSetsOutput, error) {
+ req, out := c.DescribeTaskSetsRequest(input)
+ return out, req.Send()
+}
+
+// DescribeTaskSetsWithContext is the same as DescribeTaskSets with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DescribeTaskSets 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 *ECS) DescribeTaskSetsWithContext(ctx aws.Context, input *DescribeTaskSetsInput, opts ...request.Option) (*DescribeTaskSetsOutput, error) {
+ req, out := c.DescribeTaskSetsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDescribeTasks = "DescribeTasks"
// DescribeTasksRequest generates a "aws/request.Request" representing the
// client's request for the DescribeTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1219,7 +1693,7 @@ func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Requ
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeTasks
func (c *ECS) DescribeTasks(input *DescribeTasksInput) (*DescribeTasksOutput, error) {
@@ -1248,7 +1722,7 @@ const opDiscoverPollEndpoint = "DiscoverPollEndpoint"
// DiscoverPollEndpointRequest generates a "aws/request.Request" representing the
// client's request for the DiscoverPollEndpoint operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1287,6 +1761,7 @@ func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) (req
// DiscoverPollEndpoint API operation for Amazon EC2 Container Service.
//
+//
// This action is only used by the Amazon ECS agent, and it is not intended
// for use outside of the agent.
//
@@ -1330,12 +1805,100 @@ func (c *ECS) DiscoverPollEndpointWithContext(ctx aws.Context, input *DiscoverPo
return out, req.Send()
}
+const opListAccountSettings = "ListAccountSettings"
+
+// ListAccountSettingsRequest generates a "aws/request.Request" representing the
+// client's request for the ListAccountSettings 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 ListAccountSettings for more information on using the ListAccountSettings
+// 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 ListAccountSettingsRequest method.
+// req, resp := client.ListAccountSettingsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAccountSettings
+func (c *ECS) ListAccountSettingsRequest(input *ListAccountSettingsInput) (req *request.Request, output *ListAccountSettingsOutput) {
+ op := &request.Operation{
+ Name: opListAccountSettings,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ListAccountSettingsInput{}
+ }
+
+ output = &ListAccountSettingsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ListAccountSettings API operation for Amazon EC2 Container Service.
+//
+// Lists the account settings for a specified principal.
+//
+// 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 EC2 Container Service's
+// API operation ListAccountSettings for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListAccountSettings
+func (c *ECS) ListAccountSettings(input *ListAccountSettingsInput) (*ListAccountSettingsOutput, error) {
+ req, out := c.ListAccountSettingsRequest(input)
+ return out, req.Send()
+}
+
+// ListAccountSettingsWithContext is the same as ListAccountSettings with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ListAccountSettings 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 *ECS) ListAccountSettingsWithContext(ctx aws.Context, input *ListAccountSettingsInput, opts ...request.Option) (*ListAccountSettingsOutput, error) {
+ req, out := c.ListAccountSettingsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opListAttributes = "ListAttributes"
// ListAttributesRequest generates a "aws/request.Request" representing the
// client's request for the ListAttributes operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1392,7 +1955,7 @@ func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Re
// Returned Error Codes:
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeInvalidParameterException "InvalidParameterException"
// The specified parameter is invalid. Review the available parameters for the
@@ -1425,7 +1988,7 @@ const opListClusters = "ListClusters"
// ListClustersRequest generates a "aws/request.Request" representing the
// client's request for the ListClusters operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1525,7 +2088,7 @@ func (c *ECS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput,
// // Example iterating over at most 3 pages of a ListClusters operation.
// pageNum := 0
// err := client.ListClustersPages(params,
-// func(page *ListClustersOutput, lastPage bool) bool {
+// func(page *ecs.ListClustersOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -1569,7 +2132,7 @@ const opListContainerInstances = "ListContainerInstances"
// ListContainerInstancesRequest generates a "aws/request.Request" representing the
// client's request for the ListContainerInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1617,7 +2180,7 @@ func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput)
// Returns a list of container instances in a specified cluster. You can filter
// the results of a ListContainerInstances operation with cluster query language
// statements inside the filter parameter. For more information, see Cluster
-// Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
+// Query Language (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -1642,7 +2205,7 @@ func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput)
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListContainerInstances
func (c *ECS) ListContainerInstances(input *ListContainerInstancesInput) (*ListContainerInstancesOutput, error) {
@@ -1677,7 +2240,7 @@ func (c *ECS) ListContainerInstancesWithContext(ctx aws.Context, input *ListCont
// // Example iterating over at most 3 pages of a ListContainerInstances operation.
// pageNum := 0
// err := client.ListContainerInstancesPages(params,
-// func(page *ListContainerInstancesOutput, lastPage bool) bool {
+// func(page *ecs.ListContainerInstancesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -1721,7 +2284,7 @@ const opListServices = "ListServices"
// ListServicesRequest generates a "aws/request.Request" representing the
// client's request for the ListServices operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1790,7 +2353,7 @@ func (c *ECS) ListServicesRequest(input *ListServicesInput) (req *request.Reques
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListServices
func (c *ECS) ListServices(input *ListServicesInput) (*ListServicesOutput, error) {
@@ -1825,7 +2388,7 @@ func (c *ECS) ListServicesWithContext(ctx aws.Context, input *ListServicesInput,
// // Example iterating over at most 3 pages of a ListServices operation.
// pageNum := 0
// err := client.ListServicesPages(params,
-// func(page *ListServicesOutput, lastPage bool) bool {
+// func(page *ecs.ListServicesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -1864,12 +2427,104 @@ func (c *ECS) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesI
return p.Err()
}
+const opListTagsForResource = "ListTagsForResource"
+
+// ListTagsForResourceRequest generates a "aws/request.Request" representing the
+// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource
+// 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 ListTagsForResourceRequest method.
+// req, resp := client.ListTagsForResourceRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTagsForResource
+func (c *ECS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) {
+ op := &request.Operation{
+ Name: opListTagsForResource,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ListTagsForResourceInput{}
+ }
+
+ output = &ListTagsForResourceOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ListTagsForResource API operation for Amazon EC2 Container Service.
+//
+// List the tags for an Amazon ECS resource.
+//
+// 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 EC2 Container Service's
+// API operation ListTagsForResource for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTagsForResource
+func (c *ECS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) {
+ req, out := c.ListTagsForResourceRequest(input)
+ return out, req.Send()
+}
+
+// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ListTagsForResource 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 *ECS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {
+ req, out := c.ListTagsForResourceRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opListTaskDefinitionFamilies = "ListTaskDefinitionFamilies"
// ListTaskDefinitionFamiliesRequest generates a "aws/request.Request" representing the
// client's request for the ListTaskDefinitionFamilies operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1975,7 +2630,7 @@ func (c *ECS) ListTaskDefinitionFamiliesWithContext(ctx aws.Context, input *List
// // Example iterating over at most 3 pages of a ListTaskDefinitionFamilies operation.
// pageNum := 0
// err := client.ListTaskDefinitionFamiliesPages(params,
-// func(page *ListTaskDefinitionFamiliesOutput, lastPage bool) bool {
+// func(page *ecs.ListTaskDefinitionFamiliesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -2019,7 +2674,7 @@ const opListTaskDefinitions = "ListTaskDefinitions"
// ListTaskDefinitionsRequest generates a "aws/request.Request" representing the
// client's request for the ListTaskDefinitions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2121,7 +2776,7 @@ func (c *ECS) ListTaskDefinitionsWithContext(ctx aws.Context, input *ListTaskDef
// // Example iterating over at most 3 pages of a ListTaskDefinitions operation.
// pageNum := 0
// err := client.ListTaskDefinitionsPages(params,
-// func(page *ListTaskDefinitionsOutput, lastPage bool) bool {
+// func(page *ecs.ListTaskDefinitionsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -2165,7 +2820,7 @@ const opListTasks = "ListTasks"
// ListTasksRequest generates a "aws/request.Request" representing the
// client's request for the ListTasks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2239,11 +2894,11 @@ func (c *ECS) ListTasksRequest(input *ListTasksInput) (req *request.Request, out
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
// The specified service could not be found. You can view your available services
-// with ListServices. Amazon ECS services are cluster-specific and region-specific.
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks
func (c *ECS) ListTasks(input *ListTasksInput) (*ListTasksOutput, error) {
@@ -2278,7 +2933,7 @@ func (c *ECS) ListTasksWithContext(ctx aws.Context, input *ListTasksInput, opts
// // Example iterating over at most 3 pages of a ListTasks operation.
// pageNum := 0
// err := client.ListTasksPages(params,
-// func(page *ListTasksOutput, lastPage bool) bool {
+// func(page *ecs.ListTasksOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -2317,12 +2972,216 @@ func (c *ECS) ListTasksPagesWithContext(ctx aws.Context, input *ListTasksInput,
return p.Err()
}
+const opPutAccountSetting = "PutAccountSetting"
+
+// PutAccountSettingRequest generates a "aws/request.Request" representing the
+// client's request for the PutAccountSetting 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 PutAccountSetting for more information on using the PutAccountSetting
+// 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 PutAccountSettingRequest method.
+// req, resp := client.PutAccountSettingRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAccountSetting
+func (c *ECS) PutAccountSettingRequest(input *PutAccountSettingInput) (req *request.Request, output *PutAccountSettingOutput) {
+ op := &request.Operation{
+ Name: opPutAccountSetting,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &PutAccountSettingInput{}
+ }
+
+ output = &PutAccountSettingOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// PutAccountSetting API operation for Amazon EC2 Container Service.
+//
+// Modifies an account setting. If you change the account setting for the root
+// user, the default settings for all of the IAM users and roles for which no
+// individual account setting has been specified are reset. For more information,
+// see Account Settings (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-account-settings.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// When serviceLongArnFormat, taskLongArnFormat, or containerInstanceLongArnFormat
+// are specified, the Amazon Resource Name (ARN) and resource ID format of the
+// resource type for a specified IAM user, IAM role, or the root user for an
+// account is affected. The opt-in and opt-out account setting must be set for
+// each Amazon ECS resource separately. The ARN and resource ID format of a
+// resource will be defined by the opt-in status of the IAM user or role that
+// created the resource. You must enable this setting to use Amazon ECS features
+// such as resource tagging.
+//
+// When awsvpcTrunking is specified, the elastic network interface (ENI) limit
+// for any new container instances that support the feature is changed. If awsvpcTrunking
+// is enabled, any new container instances that support the feature are launched
+// have the increased ENI limits available to them. For more information, see
+// Elastic Network Interface Trunking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-eni.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// When containerInsights is specified, the default setting indicating whether
+// CloudWatch Container Insights is enabled for your clusters is changed. If
+// containerInsights is enabled, any new clusters that are created will have
+// Container Insights enabled unless you disable it during cluster creation.
+// For more information, see CloudWatch Container Insights (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-container-insights.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation PutAccountSetting for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAccountSetting
+func (c *ECS) PutAccountSetting(input *PutAccountSettingInput) (*PutAccountSettingOutput, error) {
+ req, out := c.PutAccountSettingRequest(input)
+ return out, req.Send()
+}
+
+// PutAccountSettingWithContext is the same as PutAccountSetting with the addition of
+// the ability to pass a context and additional request options.
+//
+// See PutAccountSetting 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 *ECS) PutAccountSettingWithContext(ctx aws.Context, input *PutAccountSettingInput, opts ...request.Option) (*PutAccountSettingOutput, error) {
+ req, out := c.PutAccountSettingRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opPutAccountSettingDefault = "PutAccountSettingDefault"
+
+// PutAccountSettingDefaultRequest generates a "aws/request.Request" representing the
+// client's request for the PutAccountSettingDefault 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 PutAccountSettingDefault for more information on using the PutAccountSettingDefault
+// 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 PutAccountSettingDefaultRequest method.
+// req, resp := client.PutAccountSettingDefaultRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAccountSettingDefault
+func (c *ECS) PutAccountSettingDefaultRequest(input *PutAccountSettingDefaultInput) (req *request.Request, output *PutAccountSettingDefaultOutput) {
+ op := &request.Operation{
+ Name: opPutAccountSettingDefault,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &PutAccountSettingDefaultInput{}
+ }
+
+ output = &PutAccountSettingDefaultOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// PutAccountSettingDefault API operation for Amazon EC2 Container Service.
+//
+// Modifies an account setting for all IAM users on an account for whom no individual
+// account setting has been specified.
+//
+// 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 EC2 Container Service's
+// API operation PutAccountSettingDefault for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutAccountSettingDefault
+func (c *ECS) PutAccountSettingDefault(input *PutAccountSettingDefaultInput) (*PutAccountSettingDefaultOutput, error) {
+ req, out := c.PutAccountSettingDefaultRequest(input)
+ return out, req.Send()
+}
+
+// PutAccountSettingDefaultWithContext is the same as PutAccountSettingDefault with the addition of
+// the ability to pass a context and additional request options.
+//
+// See PutAccountSettingDefault 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 *ECS) PutAccountSettingDefaultWithContext(ctx aws.Context, input *PutAccountSettingDefaultInput, opts ...request.Option) (*PutAccountSettingDefaultOutput, error) {
+ req, out := c.PutAccountSettingDefaultRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opPutAttributes = "PutAttributes"
// PutAttributesRequest generates a "aws/request.Request" representing the
// client's request for the PutAttributes operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2364,7 +3223,7 @@ func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Requ
// Create or update an attribute on an Amazon ECS resource. If the attribute
// does not exist, it is created. If the attribute exists, its value is replaced
// with the specified value. To delete an attribute, use DeleteAttributes. For
-// more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes)
+// more information, see Attributes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2377,12 +3236,12 @@ func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Requ
// Returned Error Codes:
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeTargetNotFoundException "TargetNotFoundException"
// The specified target could not be found. You can view your available container
// instances with ListContainerInstances. Amazon ECS container instances are
-// cluster-specific and region-specific.
+// cluster-specific and Region-specific.
//
// * ErrCodeAttributeLimitExceededException "AttributeLimitExceededException"
// You can apply up to 10 custom attributes per resource. You can view the attributes
@@ -2420,7 +3279,7 @@ const opRegisterContainerInstance = "RegisterContainerInstance"
// RegisterContainerInstanceRequest generates a "aws/request.Request" representing the
// client's request for the RegisterContainerInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2459,6 +3318,7 @@ func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceI
// RegisterContainerInstance API operation for Amazon EC2 Container Service.
//
+//
// This action is only used by the Amazon ECS agent, and it is not intended
// for use outside of the agent.
//
@@ -2512,7 +3372,7 @@ const opRegisterTaskDefinition = "RegisterTaskDefinition"
// RegisterTaskDefinitionRequest generates a "aws/request.Request" representing the
// client's request for the RegisterTaskDefinition operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2554,23 +3414,23 @@ func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput)
// Registers a new task definition from the supplied family and containerDefinitions.
// Optionally, you can add data volumes to your containers with the volumes
// parameter. For more information about task definition parameters and defaults,
-// see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html)
+// see Amazon ECS Task Definitions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// You can specify an IAM role for your task with the taskRoleArn parameter.
// When you specify an IAM role for a task, its containers can then use the
// latest versions of the AWS CLI or SDKs to make API requests to the AWS services
// that are specified in the IAM policy associated with the role. For more information,
-// see IAM Roles for Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
+// see IAM Roles for Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// You can specify a Docker networking mode for the containers in your task
// definition with the networkMode parameter. The available network modes correspond
// to those described in Network settings (https://docs.docker.com/engine/reference/run/#/network-settings)
// in the Docker run reference. If you specify the awsvpc network mode, the
-// task is allocated an Elastic Network Interface, and you must specify a NetworkConfiguration
+// task is allocated an elastic network interface, and you must specify a NetworkConfiguration
// when you create a service or run a task with the task definition. For more
-// information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+// information, see Task Networking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2620,7 +3480,7 @@ const opRunTask = "RunTask"
// RunTaskRequest generates a "aws/request.Request" representing the
// client's request for the RunTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2663,7 +3523,7 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output
//
// You can allow Amazon ECS to place tasks for you, or you can customize how
// Amazon ECS places tasks using placement constraints and placement strategies.
-// For more information, see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html)
+// For more information, see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Alternatively, you can use StartTask to use your own scheduler or place tasks
@@ -2672,9 +3532,8 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output
// The Amazon ECS API follows an eventual consistency model, due to the distributed
// nature of the system supporting the API. This means that the result of an
// API command you run that affects your Amazon ECS resources might not be immediately
-// visible to all subsequent commands you run. You should keep this in mind
-// when you carry out an API command that immediately follows a previous API
-// command.
+// visible to all subsequent commands you run. Keep this in mind when you carry
+// out an API command that immediately follows a previous API command.
//
// To manage eventual consistency, you can do the following:
//
@@ -2682,7 +3541,7 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output
// it. Run the DescribeTasks command using an exponential backoff algorithm
// to ensure that you allow enough time for the previous command to propagate
// through the system. To do this, run the DescribeTasks command repeatedly,
-// starting with a couple of seconds of wait time, and increasing gradually
+// starting with a couple of seconds of wait time and increasing gradually
// up to five minutes of wait time.
//
// * Add wait time between subsequent commands, even if the DescribeTasks
@@ -2712,24 +3571,24 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
-// The specified task is not supported in this region.
+// The specified task is not supported in this Region.
//
// * ErrCodePlatformUnknownException "PlatformUnknownException"
// The specified platform version does not exist.
//
// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException"
-// The specified platform version does not satisfy the task definition’s required
+// The specified platform version does not satisfy the task definition's required
// capabilities.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You do not have authorization to perform the requested action.
//
// * ErrCodeBlockedException "BlockedException"
-// Your AWS account has been blocked. Contact AWS Support (http://aws.amazon.com/contact-us/)
-// for more information.
+// Your AWS account has been blocked. For more information, contact AWS Support
+// (http://aws.amazon.com/contact-us/).
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RunTask
func (c *ECS) RunTask(input *RunTaskInput) (*RunTaskOutput, error) {
@@ -2758,7 +3617,7 @@ const opStartTask = "StartTask"
// StartTaskRequest generates a "aws/request.Request" representing the
// client's request for the StartTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2801,7 +3660,7 @@ func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, out
// instance or instances.
//
// Alternatively, you can use RunTask to place tasks for you. For more information,
-// see Scheduling Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html)
+// see Scheduling Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2826,7 +3685,7 @@ func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, out
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StartTask
func (c *ECS) StartTask(input *StartTaskInput) (*StartTaskOutput, error) {
@@ -2855,7 +3714,7 @@ const opStopTask = "StopTask"
// StopTaskRequest generates a "aws/request.Request" representing the
// client's request for the StopTask operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2894,17 +3753,18 @@ func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, outpu
// StopTask API operation for Amazon EC2 Container Service.
//
-// Stops a running task.
+// Stops a running task. Any tags associated with the task will be deleted.
//
// When StopTask is called on a task, the equivalent of docker stop is issued
-// to the containers running in the task. This results in a SIGTERM and a default
-// 30-second timeout, after which SIGKILL is sent and the containers are forcibly
-// stopped. If the container handles the SIGTERM gracefully and exits within
-// 30 seconds from receiving it, no SIGKILL is sent.
+// to the containers running in the task. This results in a SIGTERM value and
+// a default 30-second timeout, after which the SIGKILL value is sent and the
+// containers are forcibly stopped. If the container handles the SIGTERM value
+// gracefully and exits within 30 seconds from receiving it, no SIGKILL value
+// is sent.
//
// The default 30-second timeout can be configured on the Amazon ECS container
// agent with the ECS_CONTAINER_STOP_TIMEOUT variable. For more information,
-// see Amazon ECS Container Agent Configuration (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
+// see Amazon ECS Container Agent Configuration (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2929,7 +3789,7 @@ func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, outpu
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/StopTask
func (c *ECS) StopTask(input *StopTaskInput) (*StopTaskOutput, error) {
@@ -2953,12 +3813,107 @@ func (c *ECS) StopTaskWithContext(ctx aws.Context, input *StopTaskInput, opts ..
return out, req.Send()
}
+const opSubmitAttachmentStateChanges = "SubmitAttachmentStateChanges"
+
+// SubmitAttachmentStateChangesRequest generates a "aws/request.Request" representing the
+// client's request for the SubmitAttachmentStateChanges 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 SubmitAttachmentStateChanges for more information on using the SubmitAttachmentStateChanges
+// 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 SubmitAttachmentStateChangesRequest method.
+// req, resp := client.SubmitAttachmentStateChangesRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitAttachmentStateChanges
+func (c *ECS) SubmitAttachmentStateChangesRequest(input *SubmitAttachmentStateChangesInput) (req *request.Request, output *SubmitAttachmentStateChangesOutput) {
+ op := &request.Operation{
+ Name: opSubmitAttachmentStateChanges,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &SubmitAttachmentStateChangesInput{}
+ }
+
+ output = &SubmitAttachmentStateChangesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// SubmitAttachmentStateChanges API operation for Amazon EC2 Container Service.
+//
+//
+// This action is only used by the Amazon ECS agent, and it is not intended
+// for use outside of the agent.
+//
+// Sent to acknowledge that an attachment changed states.
+//
+// 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 EC2 Container Service's
+// API operation SubmitAttachmentStateChanges for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitAttachmentStateChanges
+func (c *ECS) SubmitAttachmentStateChanges(input *SubmitAttachmentStateChangesInput) (*SubmitAttachmentStateChangesOutput, error) {
+ req, out := c.SubmitAttachmentStateChangesRequest(input)
+ return out, req.Send()
+}
+
+// SubmitAttachmentStateChangesWithContext is the same as SubmitAttachmentStateChanges with the addition of
+// the ability to pass a context and additional request options.
+//
+// See SubmitAttachmentStateChanges 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 *ECS) SubmitAttachmentStateChangesWithContext(ctx aws.Context, input *SubmitAttachmentStateChangesInput, opts ...request.Option) (*SubmitAttachmentStateChangesOutput, error) {
+ req, out := c.SubmitAttachmentStateChangesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opSubmitContainerStateChange = "SubmitContainerStateChange"
// SubmitContainerStateChangeRequest generates a "aws/request.Request" representing the
// client's request for the SubmitContainerStateChange operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2997,6 +3952,7 @@ func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChang
// SubmitContainerStateChange API operation for Amazon EC2 Container Service.
//
+//
// This action is only used by the Amazon ECS agent, and it is not intended
// for use outside of the agent.
//
@@ -3048,7 +4004,7 @@ const opSubmitTaskStateChange = "SubmitTaskStateChange"
// SubmitTaskStateChangeRequest generates a "aws/request.Request" representing the
// client's request for the SubmitTaskStateChange operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3087,6 +4043,7 @@ func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) (r
// SubmitTaskStateChange API operation for Amazon EC2 Container Service.
//
+//
// This action is only used by the Amazon ECS agent, and it is not intended
// for use outside of the agent.
//
@@ -3133,12 +4090,207 @@ func (c *ECS) SubmitTaskStateChangeWithContext(ctx aws.Context, input *SubmitTas
return out, req.Send()
}
+const opTagResource = "TagResource"
+
+// TagResourceRequest generates a "aws/request.Request" representing the
+// client's request for the TagResource 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 TagResource for more information on using the TagResource
+// 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 TagResourceRequest method.
+// req, resp := client.TagResourceRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/TagResource
+func (c *ECS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) {
+ op := &request.Operation{
+ Name: opTagResource,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &TagResourceInput{}
+ }
+
+ output = &TagResourceOutput{}
+ req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
+ return
+}
+
+// TagResource API operation for Amazon EC2 Container Service.
+//
+// Associates the specified tags to a resource with the specified resourceArn.
+// If existing tags on a resource are not specified in the request parameters,
+// they are not changed. When a resource is deleted, the tags associated with
+// that resource are deleted as well.
+//
+// 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 EC2 Container Service's
+// API operation TagResource for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
+// The specified resource could not be found.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/TagResource
+func (c *ECS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
+ req, out := c.TagResourceRequest(input)
+ return out, req.Send()
+}
+
+// TagResourceWithContext is the same as TagResource with the addition of
+// the ability to pass a context and additional request options.
+//
+// See TagResource 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 *ECS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {
+ req, out := c.TagResourceRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opUntagResource = "UntagResource"
+
+// UntagResourceRequest generates a "aws/request.Request" representing the
+// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource
+// 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 UntagResourceRequest method.
+// req, resp := client.UntagResourceRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UntagResource
+func (c *ECS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) {
+ op := &request.Operation{
+ Name: opUntagResource,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UntagResourceInput{}
+ }
+
+ output = &UntagResourceOutput{}
+ req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
+ return
+}
+
+// UntagResource API operation for Amazon EC2 Container Service.
+//
+// Deletes specified tags from a resource.
+//
+// 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 EC2 Container Service's
+// API operation UntagResource for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeResourceNotFoundException "ResourceNotFoundException"
+// The specified resource could not be found.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UntagResource
+func (c *ECS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) {
+ req, out := c.UntagResourceRequest(input)
+ return out, req.Send()
+}
+
+// UntagResourceWithContext is the same as UntagResource with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UntagResource 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 *ECS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {
+ req, out := c.UntagResourceRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opUpdateContainerAgent = "UpdateContainerAgent"
// UpdateContainerAgentRequest generates a "aws/request.Request" representing the
// client's request for the UpdateContainerAgent operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3186,7 +4338,7 @@ func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req
// UpdateContainerAgent requires the Amazon ECS-optimized AMI or Amazon Linux
// with the ecs-init service installed and running. For help updating the Amazon
// ECS container agent on other operating systems, see Manually Updating the
-// Amazon ECS Container Agent (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent)
+// Amazon ECS Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent)
// in the Amazon Elastic Container Service Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -3211,7 +4363,7 @@ func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeUpdateInProgressException "UpdateInProgressException"
// There is already a current Amazon ECS container agent update in progress
@@ -3258,7 +4410,7 @@ const opUpdateContainerInstancesState = "UpdateContainerInstancesState"
// UpdateContainerInstancesStateRequest generates a "aws/request.Request" representing the
// client's request for the UpdateContainerInstancesState operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3299,9 +4451,13 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc
//
// Modifies the status of an Amazon ECS container instance.
//
-// You can change the status of a container instance to DRAINING to manually
-// remove an instance from a cluster, for example to perform system updates,
-// update the Docker daemon, or scale down the cluster size.
+// Once a container instance has reached an ACTIVE state, you can change the
+// status of a container instance to DRAINING to manually remove an instance
+// from a cluster, for example to perform system updates, update the Docker
+// daemon, or scale down the cluster size.
+//
+// A container instance cannot be changed to DRAINING until it has reached an
+// ACTIVE status. If the instance is in any other status, an error will be received.
//
// When you set a container instance to DRAINING, Amazon ECS prevents new tasks
// from being scheduled for placement on the container instance and replacement
@@ -3327,20 +4483,21 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc
//
// * The maximumPercent parameter represents an upper limit on the number
// of running tasks during task replacement, which enables you to define
-// the replacement batch size. For example, if desiredCount of four tasks,
+// the replacement batch size. For example, if desiredCount is four tasks,
// a maximum of 200% starts four new tasks before stopping the four tasks
-// to be drained (provided that the cluster resources required to do this
-// are available). If the maximum is 100%, then replacement tasks can't start
+// to be drained, provided that the cluster resources required to do this
+// are available. If the maximum is 100%, then replacement tasks can't start
// until the draining tasks have stopped.
//
-// Any PENDING or RUNNING tasks that do not belong to a service are not affected;
-// you must wait for them to finish or stop them manually.
+// Any PENDING or RUNNING tasks that do not belong to a service are not affected.
+// You must wait for them to finish or stop them manually.
//
// A container instance has completed draining when it has no more RUNNING tasks.
// You can verify this using ListTasks.
//
-// When you set a container instance to ACTIVE, the Amazon ECS scheduler can
-// begin scheduling tasks on the instance again.
+// When a container instance has been drained, you can set a container instance
+// to ACTIVE status and once it has reached that status the Amazon ECS scheduler
+// can begin scheduling tasks on the instance again.
//
// 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
@@ -3364,7 +4521,7 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateContainerInstancesState
func (c *ECS) UpdateContainerInstancesState(input *UpdateContainerInstancesStateInput) (*UpdateContainerInstancesStateOutput, error) {
@@ -3393,7 +4550,7 @@ const opUpdateService = "UpdateService"
// UpdateServiceRequest generates a "aws/request.Request" representing the
// client's request for the UpdateService operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3432,8 +4589,24 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ
// UpdateService API operation for Amazon EC2 Container Service.
//
-// Modifies the desired count, deployment configuration, network configuration,
-// or task definition used in a service.
+// Modifies the parameters of a service.
+//
+// For services using the rolling update (ECS) deployment controller, the desired
+// count, deployment configuration, network configuration, or task definition
+// used can be updated.
+//
+// For services using the blue/green (CODE_DEPLOY) deployment controller, only
+// the desired count, deployment configuration, and health check grace period
+// can be updated using this API. If the network configuration, platform version,
+// or task definition need to be updated, a new AWS CodeDeploy deployment should
+// be created. For more information, see CreateDeployment (https://docs.aws.amazon.com/codedeploy/latest/APIReference/API_CreateDeployment.html)
+// in the AWS CodeDeploy API Reference.
+//
+// For services using an external deployment controller, you can update only
+// the desired count and health check grace period using this API. If the launch
+// type, load balancer, network configuration, platform version, or task definition
+// need to be updated, you should create a new task set. For more information,
+// see CreateTaskSet.
//
// You can add to or subtract from the number of instantiations of a task definition
// in a service by specifying the cluster that the service is running in and
@@ -3486,16 +4659,13 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ
//
// * By default, the service scheduler attempts to balance tasks across Availability
// Zones in this manner (although you can choose a different placement strategy):
-//
-// Sort the valid container instances by the fewest number of running tasks
+// Sort the valid container instances by the fewest number of running tasks
// for this service in the same Availability Zone as the instance. For example,
// if zone A has one running service task and zones B and C each have zero,
// valid container instances in either zone B or C are considered optimal
-// for placement.
-//
-// Place the new service task on a valid container instance in an optimal Availability
-// Zone (based on the previous steps), favoring container instances with
-// the fewest number of running tasks for this service.
+// for placement. Place the new service task on a valid container instance
+// in an optimal Availability Zone (based on the previous steps), favoring
+// container instances with the fewest number of running tasks for this service.
//
// When the service scheduler stops running tasks, it attempts to maintain balance
// across the Availability Zones in your cluster using the following logic:
@@ -3531,11 +4701,11 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ
//
// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
// The specified cluster could not be found. You can view your available clusters
-// with ListClusters. Amazon ECS clusters are region-specific.
+// with ListClusters. Amazon ECS clusters are Region-specific.
//
// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
// The specified service could not be found. You can view your available services
-// with ListServices. Amazon ECS services are cluster-specific and region-specific.
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
//
// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
// The specified service is not active. You can't update a service that is inactive.
@@ -3545,7 +4715,7 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ
// The specified platform version does not exist.
//
// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException"
-// The specified platform version does not satisfy the task definition’s required
+// The specified platform version does not satisfy the task definition's required
// capabilities.
//
// * ErrCodeAccessDeniedException "AccessDeniedException"
@@ -3573,11 +4743,242 @@ func (c *ECS) UpdateServiceWithContext(ctx aws.Context, input *UpdateServiceInpu
return out, req.Send()
}
+const opUpdateServicePrimaryTaskSet = "UpdateServicePrimaryTaskSet"
+
+// UpdateServicePrimaryTaskSetRequest generates a "aws/request.Request" representing the
+// client's request for the UpdateServicePrimaryTaskSet 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 UpdateServicePrimaryTaskSet for more information on using the UpdateServicePrimaryTaskSet
+// 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 UpdateServicePrimaryTaskSetRequest method.
+// req, resp := client.UpdateServicePrimaryTaskSetRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateServicePrimaryTaskSet
+func (c *ECS) UpdateServicePrimaryTaskSetRequest(input *UpdateServicePrimaryTaskSetInput) (req *request.Request, output *UpdateServicePrimaryTaskSetOutput) {
+ op := &request.Operation{
+ Name: opUpdateServicePrimaryTaskSet,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UpdateServicePrimaryTaskSetInput{}
+ }
+
+ output = &UpdateServicePrimaryTaskSetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// UpdateServicePrimaryTaskSet API operation for Amazon EC2 Container Service.
+//
+// Modifies which task set in a service is the primary task set. Any parameters
+// that are updated on the primary task set in a service will transition to
+// the service. This is used when a service uses the EXTERNAL deployment controller
+// type. For more information, see Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation UpdateServicePrimaryTaskSet for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
+// The specified task is not supported in this Region.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
+// The specified service could not be found. You can view your available services
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
+//
+// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
+// The specified service is not active. You can't update a service that is inactive.
+// If you have previously deleted a service, you can re-create it with CreateService.
+//
+// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException"
+// The specified task set could not be found. You can view your available container
+// instances with DescribeTaskSets. Task sets are specific to each cluster,
+// service and Region.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateServicePrimaryTaskSet
+func (c *ECS) UpdateServicePrimaryTaskSet(input *UpdateServicePrimaryTaskSetInput) (*UpdateServicePrimaryTaskSetOutput, error) {
+ req, out := c.UpdateServicePrimaryTaskSetRequest(input)
+ return out, req.Send()
+}
+
+// UpdateServicePrimaryTaskSetWithContext is the same as UpdateServicePrimaryTaskSet with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UpdateServicePrimaryTaskSet 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 *ECS) UpdateServicePrimaryTaskSetWithContext(ctx aws.Context, input *UpdateServicePrimaryTaskSetInput, opts ...request.Option) (*UpdateServicePrimaryTaskSetOutput, error) {
+ req, out := c.UpdateServicePrimaryTaskSetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opUpdateTaskSet = "UpdateTaskSet"
+
+// UpdateTaskSetRequest generates a "aws/request.Request" representing the
+// client's request for the UpdateTaskSet 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 UpdateTaskSet for more information on using the UpdateTaskSet
+// 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 UpdateTaskSetRequest method.
+// req, resp := client.UpdateTaskSetRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateTaskSet
+func (c *ECS) UpdateTaskSetRequest(input *UpdateTaskSetInput) (req *request.Request, output *UpdateTaskSetOutput) {
+ op := &request.Operation{
+ Name: opUpdateTaskSet,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UpdateTaskSetInput{}
+ }
+
+ output = &UpdateTaskSetOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// UpdateTaskSet API operation for Amazon EC2 Container Service.
+//
+// Modifies a task set. This is used when a service uses the EXTERNAL deployment
+// controller type. For more information, see Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer 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 EC2 Container Service's
+// API operation UpdateTaskSet for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServerException "ServerException"
+// These errors are usually caused by a server issue.
+//
+// * ErrCodeClientException "ClientException"
+// These errors are usually caused by a client action, such as using an action
+// or resource on behalf of a user that doesn't have permissions to use the
+// action or resource, or specifying an identifier that is not valid.
+//
+// * ErrCodeInvalidParameterException "InvalidParameterException"
+// The specified parameter is invalid. Review the available parameters for the
+// API request.
+//
+// * ErrCodeClusterNotFoundException "ClusterNotFoundException"
+// The specified cluster could not be found. You can view your available clusters
+// with ListClusters. Amazon ECS clusters are Region-specific.
+//
+// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException"
+// The specified task is not supported in this Region.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// You do not have authorization to perform the requested action.
+//
+// * ErrCodeServiceNotFoundException "ServiceNotFoundException"
+// The specified service could not be found. You can view your available services
+// with ListServices. Amazon ECS services are cluster-specific and Region-specific.
+//
+// * ErrCodeServiceNotActiveException "ServiceNotActiveException"
+// The specified service is not active. You can't update a service that is inactive.
+// If you have previously deleted a service, you can re-create it with CreateService.
+//
+// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException"
+// The specified task set could not be found. You can view your available container
+// instances with DescribeTaskSets. Task sets are specific to each cluster,
+// service and Region.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateTaskSet
+func (c *ECS) UpdateTaskSet(input *UpdateTaskSetInput) (*UpdateTaskSetOutput, error) {
+ req, out := c.UpdateTaskSetRequest(input)
+ return out, req.Send()
+}
+
+// UpdateTaskSetWithContext is the same as UpdateTaskSet with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UpdateTaskSet 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 *ECS) UpdateTaskSetWithContext(ctx aws.Context, input *UpdateTaskSetInput, opts ...request.Option) (*UpdateTaskSetOutput, error) {
+ req, out := c.UpdateTaskSetRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
// An object representing a container instance or task attachment.
type Attachment struct {
_ struct{} `type:"structure"`
- // Details of the attachment. For Elastic Network Interfaces, this includes
+ // Details of the attachment. For elastic network interfaces, this includes
// the network interface ID, the MAC address, the subnet ID, and the private
// IPv4 address.
Details []*KeyValuePair `locationName:"details" type:"list"`
@@ -3682,7 +5083,7 @@ func (s *AttachmentStateChange) SetStatus(v string) *AttachmentStateChange {
// An attribute is a name-value pair associated with an Amazon ECS object. Attributes
// enable you to extend the Amazon ECS data model by adding custom metadata
-// to your resources. For more information, see Attributes (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes)
+// to your resources. For more information, see Attributes (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html#attributes)
// in the Amazon Elastic Container Service Developer Guide.
type Attribute struct {
_ struct{} `type:"structure"`
@@ -3760,15 +5161,20 @@ type AwsVpcConfiguration struct {
_ struct{} `type:"structure"`
// Whether the task's elastic network interface receives a public IP address.
+ // The default value is DISABLED.
AssignPublicIp *string `locationName:"assignPublicIp" type:"string" enum:"AssignPublicIp"`
// The security groups associated with the task or service. If you do not specify
// a security group, the default security group for the VPC is used. There is
- // a limit of 5 security groups able to be specified per AwsVpcConfiguration.
+ // a limit of 5 security groups that can be specified per AwsVpcConfiguration.
+ //
+ // All specified security groups must be from the same VPC.
SecurityGroups []*string `locationName:"securityGroups" type:"list"`
- // The subnets associated with the task or service. There is a limit of 10 subnets
- // able to be specified per AwsVpcConfiguration.
+ // The subnets associated with the task or service. There is a limit of 16 subnets
+ // that can be specified per AwsVpcConfiguration.
+ //
+ // All specified subnets must be from the same VPC.
//
// Subnets is a required field
Subnets []*string `locationName:"subnets" type:"list" required:"true"`
@@ -3827,9 +5233,9 @@ type Cluster struct {
ActiveServicesCount *int64 `locationName:"activeServicesCount" type:"integer"`
// The Amazon Resource Name (ARN) that identifies the cluster. The ARN contains
- // the arn:aws:ecs namespace, followed by the region of the cluster, the AWS
+ // the arn:aws:ecs namespace, followed by the Region of the cluster, the AWS
// account ID of the cluster owner, the cluster namespace, and then the cluster
- // name. For example, arn:aws:ecs:region:012345678910:cluster/test..
+ // name. For example, arn:aws:ecs:region:012345678910:cluster/test.
ClusterArn *string `locationName:"clusterArn" type:"string"`
// A user-generated string that you use to identify your cluster.
@@ -3838,12 +5244,17 @@ type Cluster struct {
// The number of tasks in the cluster that are in the PENDING state.
PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"`
- // The number of container instances registered into the cluster.
+ // The number of container instances registered into the cluster. This includes
+ // container instances in both ACTIVE and DRAINING status.
RegisteredContainerInstancesCount *int64 `locationName:"registeredContainerInstancesCount" type:"integer"`
// The number of tasks in the cluster that are in the RUNNING state.
RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"`
+ // The settings for the cluster. This parameter indicates whether CloudWatch
+ // Container Insights is enabled or disabled for a cluster.
+ Settings []*ClusterSetting `locationName:"settings" type:"list"`
+
// Additional information about your clusters that are separated by launch type,
// including:
//
@@ -3868,6 +5279,12 @@ type Cluster struct {
// indicates that you can register container instances with the cluster and
// the associated instances can accept tasks.
Status *string `locationName:"status" type:"string"`
+
+ // The metadata that you apply to the cluster to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -3916,6 +5333,12 @@ func (s *Cluster) SetRunningTasksCount(v int64) *Cluster {
return s
}
+// SetSettings sets the Settings field's value.
+func (s *Cluster) SetSettings(v []*ClusterSetting) *Cluster {
+ s.Settings = v
+ return s
+}
+
// SetStatistics sets the Statistics field's value.
func (s *Cluster) SetStatistics(v []*KeyValuePair) *Cluster {
s.Statistics = v
@@ -3928,6 +5351,50 @@ func (s *Cluster) SetStatus(v string) *Cluster {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Cluster) SetTags(v []*Tag) *Cluster {
+ s.Tags = v
+ return s
+}
+
+// The settings to use when creating a cluster. This parameter is used to enable
+// CloudWatch Container Insights for a cluster.
+type ClusterSetting struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the cluster setting. The only supported value is containerInsights.
+ Name *string `locationName:"name" type:"string" enum:"ClusterSettingName"`
+
+ // The value to set for the cluster setting. The supported values are enabled
+ // and disabled. If enabled is specified, CloudWatch Container Insights will
+ // be enabled for the cluster, otherwise it will be disabled unless the containerInsights
+ // account setting is enabled. If a cluster value is specified, it will override
+ // the containerInsights value set with PutAccountSetting or PutAccountSettingDefault.
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s ClusterSetting) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ClusterSetting) GoString() string {
+ return s.String()
+}
+
+// SetName sets the Name field's value.
+func (s *ClusterSetting) SetName(v string) *ClusterSetting {
+ s.Name = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *ClusterSetting) SetValue(v string) *ClusterSetting {
+ s.Value = &v
+ return s
+}
+
// A Docker container that is part of a task.
type Container struct {
_ struct{} `type:"structure"`
@@ -3935,16 +5402,31 @@ type Container struct {
// The Amazon Resource Name (ARN) of the container.
ContainerArn *string `locationName:"containerArn" type:"string"`
+ // The number of CPU units set for the container. The value will be 0 if no
+ // value was specified in the container definition when the task definition
+ // was registered.
+ Cpu *string `locationName:"cpu" type:"string"`
+
// The exit code returned from the container.
ExitCode *int64 `locationName:"exitCode" type:"integer"`
+ // The IDs of each GPU assigned to the container.
+ GpuIds []*string `locationName:"gpuIds" type:"list"`
+
// The health status of the container. If health checks are not configured for
- // this container in its task definition, then it reports health status as UNKNOWN.
+ // this container in its task definition, then it reports the health status
+ // as UNKNOWN.
HealthStatus *string `locationName:"healthStatus" type:"string" enum:"HealthStatus"`
// The last known status of the container.
LastStatus *string `locationName:"lastStatus" type:"string"`
+ // The hard limit (in MiB) of memory set for the container.
+ Memory *string `locationName:"memory" type:"string"`
+
+ // The soft limit (in MiB) of memory set for the container.
+ MemoryReservation *string `locationName:"memoryReservation" type:"string"`
+
// The name of the container.
Name *string `locationName:"name" type:"string"`
@@ -3978,12 +5460,24 @@ func (s *Container) SetContainerArn(v string) *Container {
return s
}
+// SetCpu sets the Cpu field's value.
+func (s *Container) SetCpu(v string) *Container {
+ s.Cpu = &v
+ return s
+}
+
// SetExitCode sets the ExitCode field's value.
func (s *Container) SetExitCode(v int64) *Container {
s.ExitCode = &v
return s
}
+// SetGpuIds sets the GpuIds field's value.
+func (s *Container) SetGpuIds(v []*string) *Container {
+ s.GpuIds = v
+ return s
+}
+
// SetHealthStatus sets the HealthStatus field's value.
func (s *Container) SetHealthStatus(v string) *Container {
s.HealthStatus = &v
@@ -3996,6 +5490,18 @@ func (s *Container) SetLastStatus(v string) *Container {
return s
}
+// SetMemory sets the Memory field's value.
+func (s *Container) SetMemory(v string) *Container {
+ s.Memory = &v
+ return s
+}
+
+// SetMemoryReservation sets the MemoryReservation field's value.
+func (s *Container) SetMemoryReservation(v string) *Container {
+ s.MemoryReservation = &v
+ return s
+}
+
// SetName sets the Name field's value.
func (s *Container) SetName(v string) *Container {
s.Name = &v
@@ -4032,16 +5538,17 @@ type ContainerDefinition struct {
_ struct{} `type:"structure"`
// The command that is passed to the container. This parameter maps to Cmd in
- // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the COMMAND parameter to docker run (https://docs.docker.com/engine/reference/run/).
// For more information, see https://docs.docker.com/engine/reference/builder/#cmd
- // (https://docs.docker.com/engine/reference/builder/#cmd).
+ // (https://docs.docker.com/engine/reference/builder/#cmd). If there are multiple
+ // arguments, each argument should be a separated string in the array.
Command []*string `locationName:"command" type:"list"`
// The number of cpu units reserved for the container. This parameter maps to
- // CpuShares in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // CpuShares in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --cpu-shares option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This field is optional for tasks using the Fargate launch type, and the only
@@ -4077,7 +5584,7 @@ type ContainerDefinition struct {
// uses the CPU value to calculate the relative CPU share ratios for running
// containers. For more information, see CPU share constraint (https://docs.docker.com/engine/reference/run/#cpu-share-constraint)
// in the Docker documentation. The minimum valid CPU share value that the Linux
- // kernel allows is 2; however, the CPU parameter is not required, and you can
+ // kernel allows is 2. However, the CPU parameter is not required, and you can
// use CPU values below 2 in your container definitions. For CPU values below
// 2 (including null), the behavior varies based on your Amazon ECS container
// agent version:
@@ -4085,7 +5592,7 @@ type ContainerDefinition struct {
// * Agent versions less than or equal to 1.1.0: Null and zero CPU values
// are passed to Docker as 0, which Docker then converts to 1,024 CPU shares.
// CPU values of 1 are passed to Docker as 1, which the Linux kernel converts
- // to 2 CPU shares.
+ // to two CPU shares.
//
// * Agent versions greater than or equal to 1.2.0: Null, zero, and CPU values
// of 1 are passed to Docker as 2.
@@ -4095,72 +5602,95 @@ type ContainerDefinition struct {
// of CPU that is described in the task definition.
Cpu *int64 `locationName:"cpu" type:"integer"`
+ // The dependencies defined for container startup and shutdown. A container
+ // can contain multiple dependencies. When a dependency is defined for container
+ // startup, for container shutdown it is reversed.
+ //
+ // For tasks using the EC2 launch type, the container instances require at least
+ // version 1.26.0 of the container agent to enable container dependencies. However,
+ // we recommend using the latest container agent version. For information about
+ // checking your agent version and updating to the latest version, see Updating
+ // the Amazon ECS Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html)
+ // in the Amazon Elastic Container Service Developer Guide. If you are using
+ // an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1
+ // of the ecs-init package. If your container instances are launched from version
+ // 20190301 or later, then they contain the required versions of the container
+ // agent and ecs-init. For more information, see Amazon ECS-optimized Linux
+ // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ //
+ // This parameter is available for tasks using the Fargate launch type in the
+ // Ohio (us-east-2) region only and the task or service requires platform version
+ // 1.3.0 or later.
+ DependsOn []*ContainerDependency `locationName:"dependsOn" type:"list"`
+
// When this parameter is true, networking is disabled within the container.
- // This parameter maps to NetworkDisabled in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/).
+ // This parameter maps to NetworkDisabled in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/).
//
// This parameter is not supported for Windows containers.
DisableNetworking *bool `locationName:"disableNetworking" type:"boolean"`
// A list of DNS search domains that are presented to the container. This parameter
- // maps to DnsSearch in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // maps to DnsSearch in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --dns-search option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This parameter is not supported for Windows containers.
DnsSearchDomains []*string `locationName:"dnsSearchDomains" type:"list"`
// A list of DNS servers that are presented to the container. This parameter
- // maps to Dns in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // maps to Dns in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --dns option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This parameter is not supported for Windows containers.
DnsServers []*string `locationName:"dnsServers" type:"list"`
// A key/value map of labels to add to the container. This parameter maps to
- // Labels in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // Labels in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --label option to docker run (https://docs.docker.com/engine/reference/run/).
// This parameter requires version 1.18 of the Docker Remote API or greater
// on your container instance. To check the Docker Remote API version on your
// container instance, log in to your container instance and run the following
- // command: sudo docker version | grep "Server API version"
+ // command: sudo docker version --format '{{.Server.APIVersion}}'
DockerLabels map[string]*string `locationName:"dockerLabels" type:"map"`
// A list of strings to provide custom labels for SELinux and AppArmor multi-level
// security systems. This field is not valid for containers in tasks using the
// Fargate launch type.
//
- // This parameter maps to SecurityOpt in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // This parameter maps to SecurityOpt in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --security-opt option to docker run (https://docs.docker.com/engine/reference/run/).
//
// The Amazon ECS container agent running on a container instance must register
// with the ECS_SELINUX_CAPABLE=true or ECS_APPARMOR_CAPABLE=true environment
// variables before containers placed on that instance can use these security
// options. For more information, see Amazon ECS Container Agent Configuration
- // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// This parameter is not supported for Windows containers.
DockerSecurityOptions []*string `locationName:"dockerSecurityOptions" type:"list"`
+ //
// Early versions of the Amazon ECS container agent do not properly handle entryPoint
// parameters. If you have problems using entryPoint, update your container
// agent or enter your commands and arguments as command array items instead.
//
// The entry point that is passed to the container. This parameter maps to Entrypoint
- // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --entrypoint option to docker run (https://docs.docker.com/engine/reference/run/).
// For more information, see https://docs.docker.com/engine/reference/builder/#entrypoint
// (https://docs.docker.com/engine/reference/builder/#entrypoint).
EntryPoint []*string `locationName:"entryPoint" type:"list"`
// The environment variables to pass to a container. This parameter maps to
- // Env in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // Env in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --env option to docker run (https://docs.docker.com/engine/reference/run/).
//
// We do not recommend using plaintext environment variables for sensitive information,
@@ -4177,43 +5707,44 @@ type ContainerDefinition struct {
// that is composed of multiple containers, you should group containers that
// are used for a common purpose into components, and separate the different
// components into multiple task definitions. For more information, see Application
- // Architecture (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html)
+ // Architecture (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html)
// in the Amazon Elastic Container Service Developer Guide.
Essential *bool `locationName:"essential" type:"boolean"`
// A list of hostnames and IP address mappings to append to the /etc/hosts file
- // on the container. If using the Fargate launch type, this may be used to list
- // non-Fargate hosts you want the container to talk to. This parameter maps
- // to ExtraHosts in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
- // and the --add-host option to docker run (https://docs.docker.com/engine/reference/run/).
+ // on the container. This parameter maps to ExtraHosts in the Create a container
+ // (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section
+ // of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) and
+ // the --add-host option to docker run (https://docs.docker.com/engine/reference/run/).
//
- // This parameter is not supported for Windows containers.
+ // This parameter is not supported for Windows containers or tasks that use
+ // the awsvpc network mode.
ExtraHosts []*HostEntry `locationName:"extraHosts" type:"list"`
// The health check command and associated configuration parameters for the
- // container. This parameter maps to HealthCheck in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // container. This parameter maps to HealthCheck in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the HEALTHCHECK parameter of docker run (https://docs.docker.com/engine/reference/run/).
HealthCheck *HealthCheck `locationName:"healthCheck" type:"structure"`
// The hostname to use for your container. This parameter maps to Hostname in
- // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --hostname option to docker run (https://docs.docker.com/engine/reference/run/).
//
- // The hostname parameter is not supported if using the awsvpc networkMode.
+ // The hostname parameter is not supported if you are using the awsvpc network
+ // mode.
Hostname *string `locationName:"hostname" type:"string"`
// The image used to start a container. This string is passed directly to the
// Docker daemon. Images in the Docker Hub registry are available by default.
// Other repositories are specified with either repository-url/image:tag or
- // repository-url/image@digest. Up to 255 letters (uppercase and lowercase),
+ // repository-url/image@digest . Up to 255 letters (uppercase and lowercase),
// numbers, hyphens, underscores, colons, periods, forward slashes, and number
// signs are allowed. This parameter maps to Image in the Create a container
- // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
- // and the IMAGE parameter of docker run (https://docs.docker.com/engine/reference/run/).
+ // (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section
+ // of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) and
+ // the IMAGE parameter of docker run (https://docs.docker.com/engine/reference/run/).
//
// * When a new task starts, the Amazon ECS container agent pulls the latest
// version of the specified image and tag for the container to use. However,
@@ -4225,7 +5756,6 @@ type ContainerDefinition struct {
// 012345678910.dkr.ecr..amazonaws.com/:latest
// or 012345678910.dkr.ecr..amazonaws.com/@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE.
//
- //
// * Images in official repositories on Docker Hub use a single name (for
// example, ubuntu or mongo).
//
@@ -4236,16 +5766,23 @@ type ContainerDefinition struct {
// name (for example, quay.io/assemblyline/ubuntu).
Image *string `locationName:"image" type:"string"`
- // The link parameter allows containers to communicate with each other without
- // the need for port mappings. Only supported if the network mode of a task
- // definition is set to bridge. The name:internalName construct is analogous
+ // When this parameter is true, this allows you to deploy containerized applications
+ // that require stdin or a tty to be allocated. This parameter maps to OpenStdin
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the --interactive option to docker run (https://docs.docker.com/engine/reference/run/).
+ Interactive *bool `locationName:"interactive" type:"boolean"`
+
+ // The links parameter allows containers to communicate with each other without
+ // the need for port mappings. This parameter is only supported if the network
+ // mode of a task definition is bridge. The name:internalName construct is analogous
// to name:alias in Docker links. Up to 255 letters (uppercase and lowercase),
- // numbers, hyphens, and underscores are allowed. For more information about
- // linking Docker containers, go to https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/
- // (https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/).
- // This parameter maps to Links in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
- // and the --link option to docker run (https://docs.docker.com/engine/reference/commandline/run/).
+ // numbers, and hyphens are allowed. For more information about linking Docker
+ // containers, go to Legacy container links (https://docs.docker.com/network/links/)
+ // in the Docker documentation. This parameter maps to Links in the Create a
+ // container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the --link option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This parameter is not supported for Windows containers.
//
@@ -4256,20 +5793,24 @@ type ContainerDefinition struct {
Links []*string `locationName:"links" type:"list"`
// Linux-specific modifications that are applied to the container, such as Linux
- // KernelCapabilities.
+ // kernel capabilities. For more information see KernelCapabilities.
//
// This parameter is not supported for Windows containers.
LinuxParameters *LinuxParameters `locationName:"linuxParameters" type:"structure"`
// The log configuration specification for the container.
//
- // If using the Fargate launch type, the only supported value is awslogs.
+ // For tasks using the Fargate launch type, the supported log drivers are awslogs
+ // and splunk.
//
- // This parameter maps to LogConfig in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // For tasks using the EC2 launch type, the supported log drivers are awslogs,
+ // syslog, gelf, fluentd, splunk, journald, and json-file.
+ //
+ // This parameter maps to LogConfig in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --log-driver option to docker run (https://docs.docker.com/engine/reference/run/).
// By default, containers use the same logging driver that the Docker daemon
- // uses; however the container may use a different logging driver than the Docker
+ // uses. However the container may use a different logging driver than the Docker
// daemon by specifying a log driver with this parameter in the container definition.
// To use a different logging driver for a container, the log system must be
// configured properly on the container instance (or on a different log server
@@ -4284,32 +5825,33 @@ type ContainerDefinition struct {
// This parameter requires version 1.18 of the Docker Remote API or greater
// on your container instance. To check the Docker Remote API version on your
// container instance, log in to your container instance and run the following
- // command: sudo docker version | grep "Server API version"
+ // command: sudo docker version --format '{{.Server.APIVersion}}'
//
// The Amazon ECS container agent running on a container instance must register
// the logging drivers available on that instance with the ECS_AVAILABLE_LOGGING_DRIVERS
// environment variable before containers placed on that instance can use these
// log configuration options. For more information, see Amazon ECS Container
- // Agent Configuration (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
+ // Agent Configuration (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html)
// in the Amazon Elastic Container Service Developer Guide.
LogConfiguration *LogConfiguration `locationName:"logConfiguration" type:"structure"`
- // The hard limit (in MiB) of memory to present to the container. If your container
- // attempts to exceed the memory specified here, the container is killed. This
- // parameter maps to Memory in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // The amount (in MiB) of memory to present to the container. If your container
+ // attempts to exceed the memory specified here, the container is killed. The
+ // total amount of memory reserved for all containers within a task must be
+ // lower than the task memory value, if one is specified. This parameter maps
+ // to Memory in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --memory option to docker run (https://docs.docker.com/engine/reference/run/).
//
// If your containers are part of a task using the Fargate launch type, this
- // field is optional and the only requirement is that the total amount of memory
- // reserved for all containers within a task be lower than the task memory value.
+ // field is optional.
//
// For containers that are part of a task using the EC2 launch type, you must
// specify a non-zero integer for one or both of memory or memoryReservation
// in container definitions. If you specify both, memory must be greater than
// memoryReservation. If you specify memoryReservation, then that value is subtracted
// from the available memory resources for the container instance on which the
- // container is placed; otherwise, the value of memory is used.
+ // container is placed. Otherwise, the value of memory is used.
//
// The Docker daemon reserves a minimum of 4 MiB of memory for a container,
// so you should not specify fewer than 4 MiB of memory for your containers.
@@ -4317,19 +5859,19 @@ type ContainerDefinition struct {
// The soft limit (in MiB) of memory to reserve for the container. When system
// memory is under heavy contention, Docker attempts to keep the container memory
- // to this soft limit; however, your container can consume more memory when
+ // to this soft limit. However, your container can consume more memory when
// it needs to, up to either the hard limit specified with the memory parameter
// (if applicable), or all of the available memory on the container instance,
// whichever comes first. This parameter maps to MemoryReservation in the Create
- // a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --memory-reservation option to docker run (https://docs.docker.com/engine/reference/run/).
//
// You must specify a non-zero integer for one or both of memory or memoryReservation
// in container definitions. If you specify both, memory must be greater than
// memoryReservation. If you specify memoryReservation, then that value is subtracted
// from the available memory resources for the container instance on which the
- // container is placed; otherwise, the value of memory is used.
+ // container is placed. Otherwise, the value of memory is used.
//
// For example, if your container normally uses 128 MiB of memory, but occasionally
// bursts to 256 MiB of memory for short periods of time, you can set a memoryReservation
@@ -4344,8 +5886,8 @@ type ContainerDefinition struct {
// The mount points for data volumes in your container.
//
- // This parameter maps to Volumes in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // This parameter maps to Volumes in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --volume option to docker run (https://docs.docker.com/engine/reference/run/).
//
// Windows containers can mount whole directories on the same drive as $env:ProgramData.
@@ -4356,9 +5898,9 @@ type ContainerDefinition struct {
// The name of a container. If you are linking multiple containers together
// in a task definition, the name of one container can be entered in the links
// of another container to connect the containers. Up to 255 letters (uppercase
- // and lowercase), numbers, hyphens, and underscores are allowed. This parameter
- // maps to name in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // and lowercase), numbers, and hyphens are allowed. This parameter maps to
+ // name in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --name option to docker run (https://docs.docker.com/engine/reference/run/).
Name *string `locationName:"name" type:"string"`
@@ -4373,8 +5915,8 @@ type ContainerDefinition struct {
// There is no loopback for port mappings on Windows, so you cannot access a
// container's mapped port from the host itself.
//
- // This parameter maps to PortBindings in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // This parameter maps to PortBindings in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --publish option to docker run (https://docs.docker.com/engine/reference/run/).
// If the network mode of a task definition is set to none, then you can't specify
// port mappings. If the network mode of a task definition is set to host, then
@@ -4383,59 +5925,152 @@ type ContainerDefinition struct {
//
// After a task reaches the RUNNING status, manual and automatic host and container
// port assignments are visible in the Network Bindings section of a container
- // description for a selected task in the Amazon ECS console, or the networkBindings
- // section DescribeTasks responses.
+ // description for a selected task in the Amazon ECS console. The assignments
+ // are also visible in the networkBindings section DescribeTasks responses.
PortMappings []*PortMapping `locationName:"portMappings" type:"list"`
// When this parameter is true, the container is given elevated privileges on
// the host container instance (similar to the root user). This parameter maps
- // to Privileged in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // to Privileged in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --privileged option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This parameter is not supported for Windows containers or tasks using the
// Fargate launch type.
Privileged *bool `locationName:"privileged" type:"boolean"`
+ // When this parameter is true, a TTY is allocated. This parameter maps to Tty
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the --tty option to docker run (https://docs.docker.com/engine/reference/run/).
+ PseudoTerminal *bool `locationName:"pseudoTerminal" type:"boolean"`
+
// When this parameter is true, the container is given read-only access to its
// root file system. This parameter maps to ReadonlyRootfs in the Create a container
- // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
- // and the --read-only option to docker run.
+ // (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) section
+ // of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) and
+ // the --read-only option to docker run (https://docs.docker.com/engine/reference/run/).
//
// This parameter is not supported for Windows containers.
ReadonlyRootFilesystem *bool `locationName:"readonlyRootFilesystem" type:"boolean"`
+ // The private repository authentication credentials to use.
+ RepositoryCredentials *RepositoryCredentials `locationName:"repositoryCredentials" type:"structure"`
+
+ // The type and amount of a resource to assign to a container. The only supported
+ // resource is a GPU.
+ ResourceRequirements []*ResourceRequirement `locationName:"resourceRequirements" type:"list"`
+
+ // The secrets to pass to the container. For more information, see Specifying
+ // Sensitive Data (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ Secrets []*Secret `locationName:"secrets" type:"list"`
+
+ // Time duration to wait before giving up on resolving dependencies for a container.
+ // For example, you specify two containers in a task definition with containerA
+ // having a dependency on containerB reaching a COMPLETE, SUCCESS, or HEALTHY
+ // status. If a startTimeout value is specified for containerB and it does not
+ // reach the desired status within that time then containerA will give up and
+ // not start. This results in the task transitioning to a STOPPED state.
+ //
+ // For tasks using the EC2 launch type, the container instances require at least
+ // version 1.26.0 of the container agent to enable a container start timeout
+ // value. However, we recommend using the latest container agent version. For
+ // information about checking your agent version and updating to the latest
+ // version, see Updating the Amazon ECS Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html)
+ // in the Amazon Elastic Container Service Developer Guide. If you are using
+ // an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1
+ // of the ecs-init package. If your container instances are launched from version
+ // 20190301 or later, then they contain the required versions of the container
+ // agent and ecs-init. For more information, see Amazon ECS-optimized Linux
+ // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ //
+ // This parameter is available for tasks using the Fargate launch type in the
+ // Ohio (us-east-2) region only and the task or service requires platform version
+ // 1.3.0 or later.
+ StartTimeout *int64 `locationName:"startTimeout" type:"integer"`
+
+ // Time duration to wait before the container is forcefully killed if it doesn't
+ // exit normally on its own. For tasks using the Fargate launch type, the max
+ // stopTimeout value is 2 minutes. This parameter is available for tasks using
+ // the Fargate launch type in the Ohio (us-east-2) region only and the task
+ // or service requires platform version 1.3.0 or later.
+ //
+ // For tasks using the EC2 launch type, the stop timeout value for the container
+ // takes precedence over the ECS_CONTAINER_STOP_TIMEOUT container agent configuration
+ // parameter, if used. Container instances require at least version 1.26.0 of
+ // the container agent to enable a container stop timeout value. However, we
+ // recommend using the latest container agent version. For information about
+ // checking your agent version and updating to the latest version, see Updating
+ // the Amazon ECS Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html)
+ // in the Amazon Elastic Container Service Developer Guide. If you are using
+ // an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1
+ // of the ecs-init package. If your container instances are launched from version
+ // 20190301 or later, then they contain the required versions of the container
+ // agent and ecs-init. For more information, see Amazon ECS-optimized Linux
+ // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ StopTimeout *int64 `locationName:"stopTimeout" type:"integer"`
+
+ // A list of namespaced kernel parameters to set in the container. This parameter
+ // maps to Sysctls in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the --sysctl option to docker run (https://docs.docker.com/engine/reference/run/).
+ //
+ // It is not recommended that you specify network-related systemControls parameters
+ // for multiple containers in a single task that also uses either the awsvpc
+ // or host network modes. For tasks that use the awsvpc network mode, the container
+ // that is started last determines which systemControls parameters take effect.
+ // For tasks that use the host network mode, it changes the container instance's
+ // namespaced kernel parameters as well as the containers.
+ SystemControls []*SystemControl `locationName:"systemControls" type:"list"`
+
// A list of ulimits to set in the container. This parameter maps to Ulimits
- // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --ulimit option to docker run (https://docs.docker.com/engine/reference/run/).
// Valid naming values are displayed in the Ulimit data type. This parameter
// requires version 1.18 of the Docker Remote API or greater on your container
// instance. To check the Docker Remote API version on your container instance,
// log in to your container instance and run the following command: sudo docker
- // version | grep "Server API version"
+ // version --format '{{.Server.APIVersion}}'
//
// This parameter is not supported for Windows containers.
Ulimits []*Ulimit `locationName:"ulimits" type:"list"`
// The user name to use inside the container. This parameter maps to User in
- // the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --user option to docker run (https://docs.docker.com/engine/reference/run/).
//
+ // You can use the following formats. If specifying a UID or GID, you must specify
+ // it as a positive integer.
+ //
+ // * user
+ //
+ // * user:group
+ //
+ // * uid
+ //
+ // * uid:gid
+ //
+ // * user:gid
+ //
+ // * uid:group
+ //
// This parameter is not supported for Windows containers.
User *string `locationName:"user" type:"string"`
// Data volumes to mount from another container. This parameter maps to VolumesFrom
- // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --volumes-from option to docker run (https://docs.docker.com/engine/reference/run/).
VolumesFrom []*VolumeFrom `locationName:"volumesFrom" type:"list"`
// The working directory in which to run commands inside the container. This
- // parameter maps to WorkingDir in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // parameter maps to WorkingDir in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --workdir option to docker run (https://docs.docker.com/engine/reference/run/).
WorkingDirectory *string `locationName:"workingDirectory" type:"string"`
}
@@ -4453,6 +6088,16 @@ func (s ContainerDefinition) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *ContainerDefinition) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "ContainerDefinition"}
+ if s.DependsOn != nil {
+ for i, v := range s.DependsOn {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DependsOn", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if s.ExtraHosts != nil {
for i, v := range s.ExtraHosts {
if v == nil {
@@ -4478,6 +6123,31 @@ func (s *ContainerDefinition) Validate() error {
invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams))
}
}
+ if s.RepositoryCredentials != nil {
+ if err := s.RepositoryCredentials.Validate(); err != nil {
+ invalidParams.AddNested("RepositoryCredentials", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.ResourceRequirements != nil {
+ for i, v := range s.ResourceRequirements {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRequirements", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+ if s.Secrets != nil {
+ for i, v := range s.Secrets {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Secrets", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if s.Ulimits != nil {
for i, v := range s.Ulimits {
if v == nil {
@@ -4507,6 +6177,12 @@ func (s *ContainerDefinition) SetCpu(v int64) *ContainerDefinition {
return s
}
+// SetDependsOn sets the DependsOn field's value.
+func (s *ContainerDefinition) SetDependsOn(v []*ContainerDependency) *ContainerDefinition {
+ s.DependsOn = v
+ return s
+}
+
// SetDisableNetworking sets the DisableNetworking field's value.
func (s *ContainerDefinition) SetDisableNetworking(v bool) *ContainerDefinition {
s.DisableNetworking = &v
@@ -4579,6 +6255,12 @@ func (s *ContainerDefinition) SetImage(v string) *ContainerDefinition {
return s
}
+// SetInteractive sets the Interactive field's value.
+func (s *ContainerDefinition) SetInteractive(v bool) *ContainerDefinition {
+ s.Interactive = &v
+ return s
+}
+
// SetLinks sets the Links field's value.
func (s *ContainerDefinition) SetLinks(v []*string) *ContainerDefinition {
s.Links = v
@@ -4633,12 +6315,54 @@ func (s *ContainerDefinition) SetPrivileged(v bool) *ContainerDefinition {
return s
}
+// SetPseudoTerminal sets the PseudoTerminal field's value.
+func (s *ContainerDefinition) SetPseudoTerminal(v bool) *ContainerDefinition {
+ s.PseudoTerminal = &v
+ return s
+}
+
// SetReadonlyRootFilesystem sets the ReadonlyRootFilesystem field's value.
func (s *ContainerDefinition) SetReadonlyRootFilesystem(v bool) *ContainerDefinition {
s.ReadonlyRootFilesystem = &v
return s
}
+// SetRepositoryCredentials sets the RepositoryCredentials field's value.
+func (s *ContainerDefinition) SetRepositoryCredentials(v *RepositoryCredentials) *ContainerDefinition {
+ s.RepositoryCredentials = v
+ return s
+}
+
+// SetResourceRequirements sets the ResourceRequirements field's value.
+func (s *ContainerDefinition) SetResourceRequirements(v []*ResourceRequirement) *ContainerDefinition {
+ s.ResourceRequirements = v
+ return s
+}
+
+// SetSecrets sets the Secrets field's value.
+func (s *ContainerDefinition) SetSecrets(v []*Secret) *ContainerDefinition {
+ s.Secrets = v
+ return s
+}
+
+// SetStartTimeout sets the StartTimeout field's value.
+func (s *ContainerDefinition) SetStartTimeout(v int64) *ContainerDefinition {
+ s.StartTimeout = &v
+ return s
+}
+
+// SetStopTimeout sets the StopTimeout field's value.
+func (s *ContainerDefinition) SetStopTimeout(v int64) *ContainerDefinition {
+ s.StopTimeout = &v
+ return s
+}
+
+// SetSystemControls sets the SystemControls field's value.
+func (s *ContainerDefinition) SetSystemControls(v []*SystemControl) *ContainerDefinition {
+ s.SystemControls = v
+ return s
+}
+
// SetUlimits sets the Ulimits field's value.
func (s *ContainerDefinition) SetUlimits(v []*Ulimit) *ContainerDefinition {
s.Ulimits = v
@@ -4663,21 +6387,109 @@ func (s *ContainerDefinition) SetWorkingDirectory(v string) *ContainerDefinition
return s
}
+// The dependencies defined for container startup and shutdown. A container
+// can contain multiple dependencies. When a dependency is defined for container
+// startup, for container shutdown it is reversed.
+//
+// Your Amazon ECS container instances require at least version 1.26.0 of the
+// container agent to enable container dependencies. However, we recommend using
+// the latest container agent version. For information about checking your agent
+// version and updating to the latest version, see Updating the Amazon ECS Container
+// Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html)
+// in the Amazon Elastic Container Service Developer Guide. If you are using
+// an Amazon ECS-optimized Linux AMI, your instance needs at least version 1.26.0-1
+// of the ecs-init package. If your container instances are launched from version
+// 20190301 or later, then they contain the required versions of the container
+// agent and ecs-init. For more information, see Amazon ECS-optimized Linux
+// AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// If you are using tasks that use the Fargate launch type, container dependency
+// parameters are not supported.
+type ContainerDependency struct {
+ _ struct{} `type:"structure"`
+
+ // The dependency condition of the container. The following are the available
+ // conditions and their behavior:
+ //
+ // * START - This condition emulates the behavior of links and volumes today.
+ // It validates that a dependent container is started before permitting other
+ // containers to start.
+ //
+ // * COMPLETE - This condition validates that a dependent container runs
+ // to completion (exits) before permitting other containers to start. This
+ // can be useful for nonessential containers that run a script and then exit.
+ //
+ // * SUCCESS - This condition is the same as COMPLETE, but it also requires
+ // that the container exits with a zero status.
+ //
+ // * HEALTHY - This condition validates that the dependent container passes
+ // its Docker health check before permitting other containers to start. This
+ // requires that the dependent container has health checks configured. This
+ // condition is confirmed only at task startup.
+ //
+ // Condition is a required field
+ Condition *string `locationName:"condition" type:"string" required:"true" enum:"ContainerCondition"`
+
+ // The name of a container.
+ //
+ // ContainerName is a required field
+ ContainerName *string `locationName:"containerName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ContainerDependency) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ContainerDependency) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ContainerDependency) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ContainerDependency"}
+ if s.Condition == nil {
+ invalidParams.Add(request.NewErrParamRequired("Condition"))
+ }
+ if s.ContainerName == nil {
+ invalidParams.Add(request.NewErrParamRequired("ContainerName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCondition sets the Condition field's value.
+func (s *ContainerDependency) SetCondition(v string) *ContainerDependency {
+ s.Condition = &v
+ return s
+}
+
+// SetContainerName sets the ContainerName field's value.
+func (s *ContainerDependency) SetContainerName(v string) *ContainerDependency {
+ s.ContainerName = &v
+ return s
+}
+
// An EC2 instance that is running the Amazon ECS agent and has been registered
// with a cluster.
type ContainerInstance struct {
_ struct{} `type:"structure"`
// This parameter returns true if the agent is connected to Amazon ECS. Registered
- // instances with an agent that may be unhealthy or stopped return false. Instances
- // without a connected agent can't accept placement requests.
+ // instances with an agent that may be unhealthy or stopped return false. Only
+ // instances connected to an agent can accept placement requests.
AgentConnected *bool `locationName:"agentConnected" type:"boolean"`
// The status of the most recent agent update. If an update has never been requested,
// this value is NULL.
AgentUpdateStatus *string `locationName:"agentUpdateStatus" type:"string" enum:"AgentUpdateStatus"`
- // The Elastic Network Interfaces associated with the container instance.
+ // The resources attached to a container instance, such as elastic network interfaces.
Attachments []*Attachment `locationName:"attachments" type:"list"`
// The attributes set for the container instance, either by the Amazon ECS container
@@ -4685,7 +6497,7 @@ type ContainerInstance struct {
Attributes []*Attribute `locationName:"attributes" type:"list"`
// The Amazon Resource Name (ARN) of the container instance. The ARN contains
- // the arn:aws:ecs namespace, followed by the region of the container instance,
+ // the arn:aws:ecs namespace, followed by the Region of the container instance,
// the AWS account ID of the container instance owner, the container-instance
// namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID.
ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"`
@@ -4696,12 +6508,12 @@ type ContainerInstance struct {
// The number of tasks on the container instance that are in the PENDING status.
PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"`
- // The Unix time stamp for when the container instance was registered.
- RegisteredAt *time.Time `locationName:"registeredAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the container instance was registered.
+ RegisteredAt *time.Time `locationName:"registeredAt" type:"timestamp"`
// For CPU and memory resource types, this parameter describes the amount of
// each resource that was available on the container instance when the container
- // agent registered it with Amazon ECS; this value represents the total amount
+ // agent registered it with Amazon ECS. This value represents the total amount
// of CPU and memory that can be allocated on this container instance to tasks.
// For port resource types, this parameter describes the ports that were reserved
// by the Amazon ECS container agent when it registered the container instance
@@ -4720,14 +6532,35 @@ type ContainerInstance struct {
// The number of tasks on the container instance that are in the RUNNING status.
RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"`
- // The status of the container instance. The valid values are ACTIVE, INACTIVE,
- // or DRAINING. ACTIVE indicates that the container instance can accept tasks.
- // DRAINING indicates that new tasks are not placed on the container instance
+ // The status of the container instance. The valid values are REGISTERING, REGISTRATION_FAILED,
+ // ACTIVE, INACTIVE, DEREGISTERING, or DRAINING.
+ //
+ // If your account has opted in to the awsvpcTrunking account setting, then
+ // any newly registered container instance will transition to a REGISTERING
+ // status while the trunk elastic network interface is provisioned for the instance.
+ // If the registration fails, the instance will transition to a REGISTRATION_FAILED
+ // status. You can describe the container instance and see the reason for failure
+ // in the statusReason parameter. Once the container instance is terminated,
+ // the instance transitions to a DEREGISTERING status while the trunk elastic
+ // network interface is deprovisioned. The instance then transitions to an INACTIVE
+ // status.
+ //
+ // The ACTIVE status indicates that the container instance can accept tasks.
+ // The DRAINING indicates that new tasks are not placed on the container instance
// and any service tasks running on the container instance are removed if possible.
- // For more information, see Container Instance Draining (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html)
+ // For more information, see Container Instance Draining (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html)
// in the Amazon Elastic Container Service Developer Guide.
Status *string `locationName:"status" type:"string"`
+ // The reason that the container instance reached its current status.
+ StatusReason *string `locationName:"statusReason" type:"string"`
+
+ // The metadata that you apply to the container instance to help you categorize
+ // and organize them. Each tag consists of a key and an optional value, both
+ // of which you define. Tag keys can have a maximum character length of 128
+ // characters, and tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The version counter for the container instance. Every time a container instance
// experiences a change that triggers a CloudWatch event, the version counter
// is incremented. If you are replicating your Amazon ECS container instance
@@ -4824,6 +6657,18 @@ func (s *ContainerInstance) SetStatus(v string) *ContainerInstance {
return s
}
+// SetStatusReason sets the StatusReason field's value.
+func (s *ContainerInstance) SetStatusReason(v string) *ContainerInstance {
+ s.StatusReason = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *ContainerInstance) SetTags(v []*Tag) *ContainerInstance {
+ s.Tags = v
+ return s
+}
+
// SetVersion sets the Version field's value.
func (s *ContainerInstance) SetVersion(v int64) *ContainerInstance {
s.Version = &v
@@ -4836,7 +6681,10 @@ func (s *ContainerInstance) SetVersionInfo(v *VersionInfo) *ContainerInstance {
return s
}
-// The overrides that should be sent to a container.
+// The overrides that should be sent to a container. An empty container override
+// can be passed in. An example of an empty container override would be {"containerOverrides":
+// [ ] }. If a non-empty container override is specified, the name parameter
+// must be included.
type ContainerOverride struct {
_ struct{} `type:"structure"`
@@ -4869,6 +6717,11 @@ type ContainerOverride struct {
// The name of the container that receives the override. This parameter is required
// if any override is specified.
Name *string `locationName:"name" type:"string"`
+
+ // The type and amount of a resource to assign to a container, instead of the
+ // default value from the task definition. The only supported resource is a
+ // GPU.
+ ResourceRequirements []*ResourceRequirement `locationName:"resourceRequirements" type:"list"`
}
// String returns the string representation
@@ -4881,6 +6734,26 @@ func (s ContainerOverride) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ContainerOverride) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ContainerOverride"}
+ if s.ResourceRequirements != nil {
+ for i, v := range s.ResourceRequirements {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRequirements", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetCommand sets the Command field's value.
func (s *ContainerOverride) SetCommand(v []*string) *ContainerOverride {
s.Command = v
@@ -4917,6 +6790,12 @@ func (s *ContainerOverride) SetName(v string) *ContainerOverride {
return s
}
+// SetResourceRequirements sets the ResourceRequirements field's value.
+func (s *ContainerOverride) SetResourceRequirements(v []*ResourceRequirement) *ContainerOverride {
+ s.ResourceRequirements = v
+ return s
+}
+
// An object representing a change in state for a container.
type ContainerStateChange struct {
_ struct{} `type:"structure"`
@@ -4983,8 +6862,20 @@ type CreateClusterInput struct {
// The name of your cluster. If you do not specify a name for your cluster,
// you create a cluster named default. Up to 255 letters (uppercase and lowercase),
- // numbers, hyphens, and underscores are allowed.
+ // numbers, and hyphens are allowed.
ClusterName *string `locationName:"clusterName" type:"string"`
+
+ // The setting to use when creating a cluster. This parameter is used to enable
+ // CloudWatch Container Insights for a cluster. If this value is specified,
+ // it will override the containerInsights value set with PutAccountSetting or
+ // PutAccountSettingDefault.
+ Settings []*ClusterSetting `locationName:"settings" type:"list"`
+
+ // The metadata that you apply to the cluster to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -4997,12 +6888,44 @@ func (s CreateClusterInput) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateClusterInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"}
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetClusterName sets the ClusterName field's value.
func (s *CreateClusterInput) SetClusterName(v string) *CreateClusterInput {
s.ClusterName = &v
return s
}
+// SetSettings sets the Settings field's value.
+func (s *CreateClusterInput) SetSettings(v []*ClusterSetting) *CreateClusterInput {
+ s.Settings = v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CreateClusterInput) SetTags(v []*Tag) *CreateClusterInput {
+ s.Tags = v
+ return s
+}
+
type CreateClusterOutput struct {
_ struct{} `type:"structure"`
@@ -5042,30 +6965,55 @@ type CreateServiceInput struct {
// deployment and the ordering of stopping and starting tasks.
DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"`
+ // The deployment controller to use for the service.
+ DeploymentController *DeploymentController `locationName:"deploymentController" type:"structure"`
+
// The number of instantiations of the specified task definition to place and
// keep running on your cluster.
- //
- // DesiredCount is a required field
- DesiredCount *int64 `locationName:"desiredCount" type:"integer" required:"true"`
+ DesiredCount *int64 `locationName:"desiredCount" type:"integer"`
+
+ // Specifies whether to enable Amazon ECS managed tags for the tasks within
+ // the service. For more information, see Tagging Your Amazon ECS Resources
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ EnableECSManagedTags *bool `locationName:"enableECSManagedTags" type:"boolean"`
// The period of time, in seconds, that the Amazon ECS service scheduler should
// ignore unhealthy Elastic Load Balancing target health checks after a task
// has first started. This is only valid if your service is configured to use
// a load balancer. If your service's tasks take a while to start and respond
// to Elastic Load Balancing health checks, you can specify a health check grace
- // period of up to 1,800 seconds during which the ECS service scheduler ignores
- // health check status. This grace period can prevent the ECS service scheduler
- // from marking tasks as unhealthy and stopping them before they have time to
- // come up.
+ // period of up to 2,147,483,647 seconds. During that time, the ECS service
+ // scheduler ignores health check status. This grace period can prevent the
+ // ECS service scheduler from marking tasks as unhealthy and stopping them before
+ // they have time to come up.
HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"`
- // The launch type on which to run your service.
+ // The launch type on which to run your service. For more information, see Amazon
+ // ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// A load balancer object representing the load balancer to use with your service.
- // Currently, you are limited to one load balancer or target group per service.
- // After you create a service, the load balancer name or target group ARN, container
- // name, and container port specified in the service definition are immutable.
+ //
+ // If the service is using the ECS deployment controller, you are limited to
+ // one load balancer or target group.
+ //
+ // If the service is using the CODE_DEPLOY deployment controller, the service
+ // is required to use either an Application Load Balancer or Network Load Balancer.
+ // When creating an AWS CodeDeploy deployment group, you specify two target
+ // groups (referred to as a targetGroupPair). During a deployment, AWS CodeDeploy
+ // determines which task set in your service has the status PRIMARY and associates
+ // one target group with it, and then associates the other target group with
+ // the replacement task set. The load balancer can also have up to two listeners:
+ // a required listener for production traffic and an optional listener that
+ // allows you perform validation tests with Lambda functions before routing
+ // production traffic to it.
+ //
+ // After you create a service using the ECS deployment controller, the load
+ // balancer name or target group ARN, container name, and container port specified
+ // in the service definition are immutable. If you are using the CODE_DEPLOY
+ // deployment controller, these values can be changed when updating the service.
//
// For Classic Load Balancers, this object must contain the load balancer name,
// the container name (as it appears in a container definition), and the container
@@ -5082,32 +7030,42 @@ type CreateServiceInput struct {
//
// Services with tasks that use the awsvpc network mode (for example, those
// with the Fargate launch type) only support Application Load Balancers and
- // Network Load Balancers; Classic Load Balancers are not supported. Also, when
+ // Network Load Balancers. Classic Load Balancers are not supported. Also, when
// you create any target groups for these services, you must choose ip as the
// target type, not instance, because tasks that use the awsvpc network mode
// are associated with an elastic network interface, not an Amazon EC2 instance.
LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"`
// The network configuration for the service. This parameter is required for
- // task definitions that use the awsvpc network mode to receive their own Elastic
- // Network Interface, and it is not supported for other network modes. For more
- // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+ // task definitions that use the awsvpc network mode to receive their own elastic
+ // network interface, and it is not supported for other network modes. For more
+ // information, see Task Networking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
// An array of placement constraint objects to use for tasks in your service.
// You can specify a maximum of 10 constraints per task (this limit includes
- // constraints in the task definition and those specified at run time).
+ // constraints in the task definition and those specified at runtime).
PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"`
// The placement strategy objects to use for tasks in your service. You can
// specify a maximum of five strategy rules per service.
PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"`
- // The platform version on which to run your service. If one is not specified,
- // the latest version is used by default.
+ // The platform version that your tasks in the service are running on. A platform
+ // version is specified only for tasks using the Fargate launch type. If one
+ // isn't specified, the LATEST platform version is used by default. For more
+ // information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
+ // Specifies whether to propagate the tags from the task definition or the service
+ // to the tasks in the service. If no value is specified, the tags are not propagated.
+ // Tags can only be propagated to the tasks within the service during service
+ // creation. To add tags to a task after service creation, use the TagResource
+ // API action.
+ PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"`
+
// The name or full Amazon Resource Name (ARN) of the IAM role that allows Amazon
// ECS to make calls to your load balancer on your behalf. This parameter is
// only permitted if you are using a load balancer with your service and your
@@ -5119,39 +7077,68 @@ type CreateServiceInput struct {
// role is used by default for your service unless you specify a role here.
// The service-linked role is required if your task definition uses the awsvpc
// network mode, in which case you should not specify a role here. For more
- // information, see Using Service-Linked Roles for Amazon ECS (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
+ // information, see Using Service-Linked Roles for Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// If your specified role has a path other than /, then you must either specify
// the full role ARN (this is recommended) or prefix the role name with the
// path. For example, if a role with the name bar has a path of /foo/ then you
// would specify /foo/bar as the role name. For more information, see Friendly
- // Names and Paths (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names)
+ // Names and Paths (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names)
// in the IAM User Guide.
Role *string `locationName:"role" type:"string"`
+ // The scheduling strategy to use for the service. For more information, see
+ // Services (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
+ //
+ // There are two service scheduler strategies available:
+ //
+ // * REPLICA-The replica scheduling strategy places and maintains the desired
+ // number of tasks across your cluster. By default, the service scheduler
+ // spreads tasks across Availability Zones. You can use task placement strategies
+ // and constraints to customize task placement decisions. This scheduler
+ // strategy is required if the service is using the CODE_DEPLOY or EXTERNAL
+ // deployment controller types.
+ //
+ // * DAEMON-The daemon scheduling strategy deploys exactly one task on each
+ // active container instance that meets all of the task placement constraints
+ // that you specify in your cluster. When you're using this strategy, you
+ // don't need to specify a desired number of tasks, a task placement strategy,
+ // or use Service Auto Scaling policies. Tasks using the Fargate launch type
+ // or the CODE_DEPLOY or EXTERNAL deployment controller types don't support
+ // the DAEMON scheduling strategy.
+ SchedulingStrategy *string `locationName:"schedulingStrategy" type:"string" enum:"SchedulingStrategy"`
+
// The name of your service. Up to 255 letters (uppercase and lowercase), numbers,
- // hyphens, and underscores are allowed. Service names must be unique within
- // a cluster, but you can have similarly named services in multiple clusters
- // within a region or across multiple regions.
+ // and hyphens are allowed. Service names must be unique within a cluster, but
+ // you can have similarly named services in multiple clusters within a Region
+ // or across multiple Regions.
//
// ServiceName is a required field
ServiceName *string `locationName:"serviceName" type:"string" required:"true"`
- // The details of the service discovery registries you want to assign to this
- // service. For more information, see Service Discovery (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
+ // The details of the service discovery registries to assign to this service.
+ // For more information, see Service Discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
//
- // Service discovery is supported for Fargate tasks if using platform version
- // v1.1.0 or later. For more information, see AWS Fargate Platform Versions
- // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
+ // Service discovery is supported for Fargate tasks if you are using platform
+ // version v1.1.0 or later. For more information, see AWS Fargate Platform Versions
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"`
+ // The metadata that you apply to the service to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. When a service is deleted, the tags are deleted as well. Tag keys
+ // can have a maximum character length of 128 characters, and tag values can
+ // have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The family and revision (family:revision) or full ARN of the task definition
// to run in your service. If a revision is not specified, the latest ACTIVE
// revision is used.
//
- // TaskDefinition is a required field
- TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"`
+ // A task definition must be specified if the service is using the ECS deployment
+ // controller.
+ TaskDefinition *string `locationName:"taskDefinition" type:"string"`
}
// String returns the string representation
@@ -5167,20 +7154,29 @@ func (s CreateServiceInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateServiceInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateServiceInput"}
- if s.DesiredCount == nil {
- invalidParams.Add(request.NewErrParamRequired("DesiredCount"))
- }
if s.ServiceName == nil {
invalidParams.Add(request.NewErrParamRequired("ServiceName"))
}
- if s.TaskDefinition == nil {
- invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
+ if s.DeploymentController != nil {
+ if err := s.DeploymentController.Validate(); err != nil {
+ invalidParams.AddNested("DeploymentController", err.(request.ErrInvalidParams))
+ }
}
if s.NetworkConfiguration != nil {
if err := s.NetworkConfiguration.Validate(); err != nil {
invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams))
}
}
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -5206,12 +7202,24 @@ func (s *CreateServiceInput) SetDeploymentConfiguration(v *DeploymentConfigurati
return s
}
+// SetDeploymentController sets the DeploymentController field's value.
+func (s *CreateServiceInput) SetDeploymentController(v *DeploymentController) *CreateServiceInput {
+ s.DeploymentController = v
+ return s
+}
+
// SetDesiredCount sets the DesiredCount field's value.
func (s *CreateServiceInput) SetDesiredCount(v int64) *CreateServiceInput {
s.DesiredCount = &v
return s
}
+// SetEnableECSManagedTags sets the EnableECSManagedTags field's value.
+func (s *CreateServiceInput) SetEnableECSManagedTags(v bool) *CreateServiceInput {
+ s.EnableECSManagedTags = &v
+ return s
+}
+
// SetHealthCheckGracePeriodSeconds sets the HealthCheckGracePeriodSeconds field's value.
func (s *CreateServiceInput) SetHealthCheckGracePeriodSeconds(v int64) *CreateServiceInput {
s.HealthCheckGracePeriodSeconds = &v
@@ -5254,12 +7262,24 @@ func (s *CreateServiceInput) SetPlatformVersion(v string) *CreateServiceInput {
return s
}
+// SetPropagateTags sets the PropagateTags field's value.
+func (s *CreateServiceInput) SetPropagateTags(v string) *CreateServiceInput {
+ s.PropagateTags = &v
+ return s
+}
+
// SetRole sets the Role field's value.
func (s *CreateServiceInput) SetRole(v string) *CreateServiceInput {
s.Role = &v
return s
}
+// SetSchedulingStrategy sets the SchedulingStrategy field's value.
+func (s *CreateServiceInput) SetSchedulingStrategy(v string) *CreateServiceInput {
+ s.SchedulingStrategy = &v
+ return s
+}
+
// SetServiceName sets the ServiceName field's value.
func (s *CreateServiceInput) SetServiceName(v string) *CreateServiceInput {
s.ServiceName = &v
@@ -5272,6 +7292,12 @@ func (s *CreateServiceInput) SetServiceRegistries(v []*ServiceRegistry) *CreateS
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateServiceInput) SetTags(v []*Tag) *CreateServiceInput {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *CreateServiceInput) SetTaskDefinition(v string) *CreateServiceInput {
s.TaskDefinition = &v
@@ -5282,6 +7308,13 @@ type CreateServiceOutput struct {
_ struct{} `type:"structure"`
// The full description of your service following the create call.
+ //
+ // If a service is using the ECS deployment controller, the deploymentController
+ // and taskSets parameters will not be returned.
+ //
+ // If the service is using the CODE_DEPLOY deployment controller, the deploymentController,
+ // taskSets and deployments parameters will be returned, however the deployments
+ // parameter will be an empty list.
Service *Service `locationName:"service" type:"structure"`
}
@@ -5301,6 +7334,268 @@ func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput {
return s
}
+type CreateTaskSetInput struct {
+ _ struct{} `type:"structure"`
+
+ // Unique, case-sensitive identifier that you provide to ensure the idempotency
+ // of the request. Up to 32 ASCII characters are allowed.
+ ClientToken *string `locationName:"clientToken" type:"string"`
+
+ // The short name or full Amazon Resource Name (ARN) of the cluster that hosts
+ // the service to create the task set in.
+ //
+ // Cluster is a required field
+ Cluster *string `locationName:"cluster" type:"string" required:"true"`
+
+ // An optional non-unique tag that identifies this task set in external systems.
+ // If the task set is associated with a service discovery registry, the tasks
+ // in this task set will have the ECS_TASK_SET_EXTERNAL_ID AWS Cloud Map attribute
+ // set to the provided value.
+ ExternalId *string `locationName:"externalId" type:"string"`
+
+ // The launch type that new tasks in the task set will use. For more information,
+ // see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
+
+ // A load balancer object representing the load balancer to use with the task
+ // set. The supported load balancer types are either an Application Load Balancer
+ // or a Network Load Balancer.
+ LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"`
+
+ // An object representing the network configuration for a task or service.
+ NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
+
+ // The platform version that the tasks in the task set should use. A platform
+ // version is specified only for tasks using the Fargate launch type. If one
+ // isn't specified, the LATEST platform version is used by default.
+ PlatformVersion *string `locationName:"platformVersion" type:"string"`
+
+ // A floating-point percentage of the desired number of tasks to place and keep
+ // running in the task set.
+ Scale *Scale `locationName:"scale" type:"structure"`
+
+ // The short name or full Amazon Resource Name (ARN) of the service to create
+ // the task set in.
+ //
+ // Service is a required field
+ Service *string `locationName:"service" type:"string" required:"true"`
+
+ // The details of the service discovery registries to assign to this task set.
+ // For more information, see Service Discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
+ ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"`
+
+ // The task definition for the tasks in the task set to use.
+ //
+ // TaskDefinition is a required field
+ TaskDefinition *string `locationName:"taskDefinition" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateTaskSetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTaskSetInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateTaskSetInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateTaskSetInput"}
+ if s.Cluster == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cluster"))
+ }
+ if s.Service == nil {
+ invalidParams.Add(request.NewErrParamRequired("Service"))
+ }
+ if s.TaskDefinition == nil {
+ invalidParams.Add(request.NewErrParamRequired("TaskDefinition"))
+ }
+ if s.NetworkConfiguration != nil {
+ if err := s.NetworkConfiguration.Validate(); err != nil {
+ invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams))
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetClientToken sets the ClientToken field's value.
+func (s *CreateTaskSetInput) SetClientToken(v string) *CreateTaskSetInput {
+ s.ClientToken = &v
+ return s
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *CreateTaskSetInput) SetCluster(v string) *CreateTaskSetInput {
+ s.Cluster = &v
+ return s
+}
+
+// SetExternalId sets the ExternalId field's value.
+func (s *CreateTaskSetInput) SetExternalId(v string) *CreateTaskSetInput {
+ s.ExternalId = &v
+ return s
+}
+
+// SetLaunchType sets the LaunchType field's value.
+func (s *CreateTaskSetInput) SetLaunchType(v string) *CreateTaskSetInput {
+ s.LaunchType = &v
+ return s
+}
+
+// SetLoadBalancers sets the LoadBalancers field's value.
+func (s *CreateTaskSetInput) SetLoadBalancers(v []*LoadBalancer) *CreateTaskSetInput {
+ s.LoadBalancers = v
+ return s
+}
+
+// SetNetworkConfiguration sets the NetworkConfiguration field's value.
+func (s *CreateTaskSetInput) SetNetworkConfiguration(v *NetworkConfiguration) *CreateTaskSetInput {
+ s.NetworkConfiguration = v
+ return s
+}
+
+// SetPlatformVersion sets the PlatformVersion field's value.
+func (s *CreateTaskSetInput) SetPlatformVersion(v string) *CreateTaskSetInput {
+ s.PlatformVersion = &v
+ return s
+}
+
+// SetScale sets the Scale field's value.
+func (s *CreateTaskSetInput) SetScale(v *Scale) *CreateTaskSetInput {
+ s.Scale = v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *CreateTaskSetInput) SetService(v string) *CreateTaskSetInput {
+ s.Service = &v
+ return s
+}
+
+// SetServiceRegistries sets the ServiceRegistries field's value.
+func (s *CreateTaskSetInput) SetServiceRegistries(v []*ServiceRegistry) *CreateTaskSetInput {
+ s.ServiceRegistries = v
+ return s
+}
+
+// SetTaskDefinition sets the TaskDefinition field's value.
+func (s *CreateTaskSetInput) SetTaskDefinition(v string) *CreateTaskSetInput {
+ s.TaskDefinition = &v
+ return s
+}
+
+type CreateTaskSetOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+ // an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+ // desired number of tasks, how many tasks are running, and whether the task
+ // set serves production traffic.
+ TaskSet *TaskSet `locationName:"taskSet" type:"structure"`
+}
+
+// String returns the string representation
+func (s CreateTaskSetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateTaskSetOutput) GoString() string {
+ return s.String()
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *CreateTaskSetOutput) SetTaskSet(v *TaskSet) *CreateTaskSetOutput {
+ s.TaskSet = v
+ return s
+}
+
+type DeleteAccountSettingInput struct {
+ _ struct{} `type:"structure"`
+
+ // The resource name for which to disable the account setting. If serviceLongArnFormat
+ // is specified, the ARN for your Amazon ECS services is affected. If taskLongArnFormat
+ // is specified, the ARN and resource ID for your Amazon ECS tasks is affected.
+ // If containerInstanceLongArnFormat is specified, the ARN and resource ID for
+ // your Amazon ECS container instances is affected. If awsvpcTrunking is specified,
+ // the ENI limit for your Amazon ECS container instances is affected.
+ //
+ // Name is a required field
+ Name *string `locationName:"name" type:"string" required:"true" enum:"SettingName"`
+
+ // The ARN of the principal, which can be an IAM user, IAM role, or the root
+ // user. If you specify the root user, it disables the account setting for all
+ // IAM users, IAM roles, and the root user of the account unless an IAM user
+ // or role explicitly overrides these settings. If this field is omitted, the
+ // setting is changed only for the authenticated user.
+ PrincipalArn *string `locationName:"principalArn" type:"string"`
+}
+
+// String returns the string representation
+func (s DeleteAccountSettingInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteAccountSettingInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteAccountSettingInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteAccountSettingInput"}
+ if s.Name == nil {
+ invalidParams.Add(request.NewErrParamRequired("Name"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetName sets the Name field's value.
+func (s *DeleteAccountSettingInput) SetName(v string) *DeleteAccountSettingInput {
+ s.Name = &v
+ return s
+}
+
+// SetPrincipalArn sets the PrincipalArn field's value.
+func (s *DeleteAccountSettingInput) SetPrincipalArn(v string) *DeleteAccountSettingInput {
+ s.PrincipalArn = &v
+ return s
+}
+
+type DeleteAccountSettingOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The account setting for the specified principal ARN.
+ Setting *Setting `locationName:"setting" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteAccountSettingOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteAccountSettingOutput) GoString() string {
+ return s.String()
+}
+
+// SetSetting sets the Setting field's value.
+func (s *DeleteAccountSettingOutput) SetSetting(v *Setting) *DeleteAccountSettingOutput {
+ s.Setting = v
+ return s
+}
+
type DeleteAttributesInput struct {
_ struct{} `type:"structure"`
@@ -5455,6 +7750,11 @@ type DeleteServiceInput struct {
// is assumed.
Cluster *string `locationName:"cluster" type:"string"`
+ // If true, allows you to delete a service even if it has not been scaled down
+ // to zero tasks. It is only necessary to use this if the service is using the
+ // REPLICA scheduling strategy.
+ Force *bool `locationName:"force" type:"boolean"`
+
// The name of the service to delete.
//
// Service is a required field
@@ -5490,6 +7790,12 @@ func (s *DeleteServiceInput) SetCluster(v string) *DeleteServiceInput {
return s
}
+// SetForce sets the Force field's value.
+func (s *DeleteServiceInput) SetForce(v bool) *DeleteServiceInput {
+ s.Force = &v
+ return s
+}
+
// SetService sets the Service field's value.
func (s *DeleteServiceInput) SetService(v string) *DeleteServiceInput {
s.Service = &v
@@ -5519,12 +7825,117 @@ func (s *DeleteServiceOutput) SetService(v *Service) *DeleteServiceOutput {
return s
}
-// The details of an Amazon ECS service deployment.
+type DeleteTaskSetInput struct {
+ _ struct{} `type:"structure"`
+
+ // The short name or full Amazon Resource Name (ARN) of the cluster that hosts
+ // the service that the task set exists in to delete.
+ //
+ // Cluster is a required field
+ Cluster *string `locationName:"cluster" type:"string" required:"true"`
+
+ // If true, this allows you to delete a task set even if it hasn't been scaled
+ // down to zero.
+ Force *bool `locationName:"force" type:"boolean"`
+
+ // The short name or full Amazon Resource Name (ARN) of the service that hosts
+ // the task set to delete.
+ //
+ // Service is a required field
+ Service *string `locationName:"service" type:"string" required:"true"`
+
+ // The task set ID or full Amazon Resource Name (ARN) of the task set to delete.
+ //
+ // TaskSet is a required field
+ TaskSet *string `locationName:"taskSet" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteTaskSetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTaskSetInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteTaskSetInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteTaskSetInput"}
+ if s.Cluster == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cluster"))
+ }
+ if s.Service == nil {
+ invalidParams.Add(request.NewErrParamRequired("Service"))
+ }
+ if s.TaskSet == nil {
+ invalidParams.Add(request.NewErrParamRequired("TaskSet"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *DeleteTaskSetInput) SetCluster(v string) *DeleteTaskSetInput {
+ s.Cluster = &v
+ return s
+}
+
+// SetForce sets the Force field's value.
+func (s *DeleteTaskSetInput) SetForce(v bool) *DeleteTaskSetInput {
+ s.Force = &v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *DeleteTaskSetInput) SetService(v string) *DeleteTaskSetInput {
+ s.Service = &v
+ return s
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *DeleteTaskSetInput) SetTaskSet(v string) *DeleteTaskSetInput {
+ s.TaskSet = &v
+ return s
+}
+
+type DeleteTaskSetOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+ // an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+ // desired number of tasks, how many tasks are running, and whether the task
+ // set serves production traffic.
+ TaskSet *TaskSet `locationName:"taskSet" type:"structure"`
+}
+
+// String returns the string representation
+func (s DeleteTaskSetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteTaskSetOutput) GoString() string {
+ return s.String()
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *DeleteTaskSetOutput) SetTaskSet(v *TaskSet) *DeleteTaskSetOutput {
+ s.TaskSet = v
+ return s
+}
+
+// The details of an Amazon ECS service deployment. This is used only when a
+// service uses the ECS deployment controller type.
type Deployment struct {
_ struct{} `type:"structure"`
- // The Unix time stamp for when the service was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the service deployment was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The most recent desired count of tasks that was specified for the service
// to deploy or maintain.
@@ -5533,33 +7944,50 @@ type Deployment struct {
// The ID of the deployment.
Id *string `locationName:"id" type:"string"`
- // The launch type on which your service is running.
+ // The launch type the tasks in the service are using. For more information,
+ // see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// The VPC subnet and security group configuration for tasks that receive their
- // own Elastic Network Interface by using the awsvpc networking mode.
+ // own elastic network interface by using the awsvpc networking mode.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
// The number of tasks in the deployment that are in the PENDING status.
PendingCount *int64 `locationName:"pendingCount" type:"integer"`
- // The platform version on which your service is running.
+ // The platform version on which your tasks in the service are running. A platform
+ // version is only specified for tasks using the Fargate launch type. If one
+ // is not specified, the LATEST platform version is used by default. For more
+ // information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
// The number of tasks in the deployment that are in the RUNNING status.
RunningCount *int64 `locationName:"runningCount" type:"integer"`
- // The status of the deployment. Valid values are PRIMARY (for the most recent
- // deployment), ACTIVE (for previous deployments that still have tasks running,
- // but are being replaced with the PRIMARY deployment), and INACTIVE (for deployments
- // that have been completely replaced).
+ // The status of the deployment. The following describes each state:
+ //
+ // PRIMARY
+ //
+ // The most recent deployment of a service.
+ //
+ // ACTIVE
+ //
+ // A service deployment that still has running tasks, but are in the process
+ // of being replaced with a new PRIMARY deployment.
+ //
+ // INACTIVE
+ //
+ // A deployment that has been completely replaced.
Status *string `locationName:"status" type:"string"`
- // The most recent task definition that was specified for the service to use.
+ // The most recent task definition that was specified for the tasks in the service
+ // to use.
TaskDefinition *string `locationName:"taskDefinition" type:"string"`
- // The Unix time stamp for when the service was last updated.
- UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the service deployment was last updated.
+ UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"`
}
// String returns the string representation
@@ -5638,22 +8066,54 @@ func (s *Deployment) SetUpdatedAt(v time.Time) *Deployment {
return s
}
-// Optional deployment parameters that control how many tasks run during the
-// deployment and the ordering of stopping and starting tasks.
+// Optional deployment parameters that control how many tasks run during a deployment
+// and the ordering of stopping and starting tasks.
type DeploymentConfiguration struct {
_ struct{} `type:"structure"`
- // The upper limit (as a percentage of the service's desiredCount) of the number
- // of tasks that are allowed in the RUNNING or PENDING state in a service during
- // a deployment. The maximum number of tasks during a deployment is the desiredCount
- // multiplied by maximumPercent/100, rounded down to the nearest integer value.
+ // If a service is using the rolling update (ECS) deployment type, the maximum
+ // percent parameter represents an upper limit on the number of tasks in a service
+ // that are allowed in the RUNNING or PENDING state during a deployment, as
+ // a percentage of the desired number of tasks (rounded down to the nearest
+ // integer), and while any container instances are in the DRAINING state if
+ // the service contains tasks using the EC2 launch type. This parameter enables
+ // you to define the deployment batch size. For example, if your service has
+ // a desired number of four tasks and a maximum percent value of 200%, the scheduler
+ // may start four new tasks before stopping the four older tasks (provided that
+ // the cluster resources required to do this are available). The default value
+ // for maximum percent is 200%.
+ //
+ // If a service is using the blue/green (CODE_DEPLOY) or EXTERNAL deployment
+ // types and tasks that use the EC2 launch type, the maximum percent value is
+ // set to the default value and is used to define the upper limit on the number
+ // of the tasks in the service that remain in the RUNNING state while the container
+ // instances are in the DRAINING state. If the tasks in the service use the
+ // Fargate launch type, the maximum percent value is not used, although it is
+ // returned when describing your service.
MaximumPercent *int64 `locationName:"maximumPercent" type:"integer"`
- // The lower limit (as a percentage of the service's desiredCount) of the number
- // of running tasks that must remain in the RUNNING state in a service during
- // a deployment. The minimum number of healthy tasks during a deployment is
- // the desiredCount multiplied by minimumHealthyPercent/100, rounded up to the
- // nearest integer value.
+ // If a service is using the rolling update (ECS) deployment type, the minimum
+ // healthy percent represents a lower limit on the number of tasks in a service
+ // that must remain in the RUNNING state during a deployment, as a percentage
+ // of the desired number of tasks (rounded up to the nearest integer), and while
+ // any container instances are in the DRAINING state if the service contains
+ // tasks using the EC2 launch type. This parameter enables you to deploy without
+ // using additional cluster capacity. For example, if your service has a desired
+ // number of four tasks and a minimum healthy percent of 50%, the scheduler
+ // may stop two existing tasks to free up cluster capacity before starting two
+ // new tasks. Tasks for services that do not use a load balancer are considered
+ // healthy if they are in the RUNNING state; tasks for services that do use
+ // a load balancer are considered healthy if they are in the RUNNING state and
+ // they are reported as healthy by the load balancer. The default value for
+ // minimum healthy percent is 100%.
+ //
+ // If a service is using the blue/green (CODE_DEPLOY) or EXTERNAL deployment
+ // types and tasks that use the EC2 launch type, the minimum healthy percent
+ // value is set to the default value and is used to define the lower limit on
+ // the number of the tasks in the service that remain in the RUNNING state while
+ // the container instances are in the DRAINING state. If the tasks in the service
+ // use the Fargate launch type, the minimum healthy percent value is not used,
+ // although it is returned when describing your service.
MinimumHealthyPercent *int64 `locationName:"minimumHealthyPercent" type:"integer"`
}
@@ -5679,6 +8139,69 @@ func (s *DeploymentConfiguration) SetMinimumHealthyPercent(v int64) *DeploymentC
return s
}
+// The deployment controller to use for the service. For more information, see
+// Amazon ECS Deployment Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html)
+// in the Amazon Elastic Container Service Developer Guide.
+type DeploymentController struct {
+ _ struct{} `type:"structure"`
+
+ // The deployment controller type to use.
+ //
+ // There are three deployment controller types available:
+ //
+ // ECS
+ //
+ // The rolling update (ECS) deployment type involves replacing the current running
+ // version of the container with the latest version. The number of containers
+ // Amazon ECS adds or removes from the service during a rolling update is controlled
+ // by adjusting the minimum and maximum number of healthy tasks allowed during
+ // a service deployment, as specified in the DeploymentConfiguration.
+ //
+ // CODE_DEPLOY
+ //
+ // The blue/green (CODE_DEPLOY) deployment type uses the blue/green deployment
+ // model powered by AWS CodeDeploy, which allows you to verify a new deployment
+ // of a service before sending production traffic to it.
+ //
+ // EXTERNAL
+ //
+ // The external (EXTERNAL) deployment type enables you to use any third-party
+ // deployment controller for full control over the deployment process for an
+ // Amazon ECS service.
+ //
+ // Type is a required field
+ Type *string `locationName:"type" type:"string" required:"true" enum:"DeploymentControllerType"`
+}
+
+// String returns the string representation
+func (s DeploymentController) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeploymentController) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeploymentController) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeploymentController"}
+ if s.Type == nil {
+ invalidParams.Add(request.NewErrParamRequired("Type"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetType sets the Type field's value.
+func (s *DeploymentController) SetType(v string) *DeploymentController {
+ s.Type = &v
+ return s
+}
+
type DeregisterContainerInstanceInput struct {
_ struct{} `type:"structure"`
@@ -5688,7 +8211,7 @@ type DeregisterContainerInstanceInput struct {
Cluster *string `locationName:"cluster" type:"string"`
// The container instance ID or full ARN of the container instance to deregister.
- // The ARN contains the arn:aws:ecs namespace, followed by the region of the
+ // The ARN contains the arn:aws:ecs namespace, followed by the Region of the
// container instance, the AWS account ID of the container instance owner, the
// container-instance namespace, and then the container instance ID. For example,
// arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID.
@@ -5924,7 +8447,9 @@ type DescribeContainerInstancesInput struct {
// The short name or full Amazon Resource Name (ARN) of the cluster that hosts
// the container instances to describe. If you do not specify a cluster, the
- // default cluster is assumed.
+ // default cluster is assumed. This parameter is required if the container instance
+ // or container instances you are describing were launched in any cluster other
+ // than the default cluster.
Cluster *string `locationName:"cluster" type:"string"`
// A list of up to 100 container instance IDs or full Amazon Resource Name (ARN)
@@ -5932,6 +8457,11 @@ type DescribeContainerInstancesInput struct {
//
// ContainerInstances is a required field
ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"`
+
+ // Specifies whether you want to see the resource tags for the container instance.
+ // If TAGS is specified, the tags are included in the response. If this field
+ // is omitted, tags are not included in the response.
+ Include []*string `locationName:"include" type:"list"`
}
// String returns the string representation
@@ -5969,6 +8499,12 @@ func (s *DescribeContainerInstancesInput) SetContainerInstances(v []*string) *De
return s
}
+// SetInclude sets the Include field's value.
+func (s *DescribeContainerInstancesInput) SetInclude(v []*string) *DescribeContainerInstancesInput {
+ s.Include = v
+ return s
+}
+
type DescribeContainerInstancesOutput struct {
_ struct{} `type:"structure"`
@@ -6006,9 +8542,15 @@ type DescribeServicesInput struct {
// The short name or full Amazon Resource Name (ARN)the cluster that hosts the
// service to describe. If you do not specify a cluster, the default cluster
- // is assumed.
+ // is assumed. This parameter is required if the service or services you are
+ // describing were launched in any cluster other than the default cluster.
Cluster *string `locationName:"cluster" type:"string"`
+ // Specifies whether you want to see the resource tags for the service. If TAGS
+ // is specified, the tags are included in the response. If this field is omitted,
+ // tags are not included in the response.
+ Include []*string `locationName:"include" type:"list"`
+
// A list of services to describe. You may specify up to 10 services to describe
// in a single operation.
//
@@ -6045,6 +8587,12 @@ func (s *DescribeServicesInput) SetCluster(v string) *DescribeServicesInput {
return s
}
+// SetInclude sets the Include field's value.
+func (s *DescribeServicesInput) SetInclude(v []*string) *DescribeServicesInput {
+ s.Include = v
+ return s
+}
+
// SetServices sets the Services field's value.
func (s *DescribeServicesInput) SetServices(v []*string) *DescribeServicesInput {
s.Services = v
@@ -6086,6 +8634,11 @@ func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutp
type DescribeTaskDefinitionInput struct {
_ struct{} `type:"structure"`
+ // Specifies whether to see the resource tags for the task definition. If TAGS
+ // is specified, the tags are included in the response. If this field is omitted,
+ // tags are not included in the response.
+ Include []*string `locationName:"include" type:"list"`
+
// The family for the latest ACTIVE revision, family and revision (family:revision)
// for a specific revision in the family, or full Amazon Resource Name (ARN)
// of the task definition to describe.
@@ -6117,6 +8670,12 @@ func (s *DescribeTaskDefinitionInput) Validate() error {
return nil
}
+// SetInclude sets the Include field's value.
+func (s *DescribeTaskDefinitionInput) SetInclude(v []*string) *DescribeTaskDefinitionInput {
+ s.Include = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *DescribeTaskDefinitionInput) SetTaskDefinition(v string) *DescribeTaskDefinitionInput {
s.TaskDefinition = &v
@@ -6126,6 +8685,12 @@ func (s *DescribeTaskDefinitionInput) SetTaskDefinition(v string) *DescribeTaskD
type DescribeTaskDefinitionOutput struct {
_ struct{} `type:"structure"`
+ // The metadata that is applied to the task definition to help you categorize
+ // and organize them. Each tag consists of a key and an optional value, both
+ // of which you define. Tag keys can have a maximum character length of 128
+ // characters, and tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The full task definition description.
TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"`
}
@@ -6140,20 +8705,127 @@ func (s DescribeTaskDefinitionOutput) GoString() string {
return s.String()
}
+// SetTags sets the Tags field's value.
+func (s *DescribeTaskDefinitionOutput) SetTags(v []*Tag) *DescribeTaskDefinitionOutput {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *DescribeTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *DescribeTaskDefinitionOutput {
s.TaskDefinition = v
return s
}
+type DescribeTaskSetsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The short name or full Amazon Resource Name (ARN) of the cluster that hosts
+ // the service that the task sets exist in.
+ //
+ // Cluster is a required field
+ Cluster *string `locationName:"cluster" type:"string" required:"true"`
+
+ // The short name or full Amazon Resource Name (ARN) of the service that the
+ // task sets exist in.
+ //
+ // Service is a required field
+ Service *string `locationName:"service" type:"string" required:"true"`
+
+ // The ID or full Amazon Resource Name (ARN) of task sets to describe.
+ TaskSets []*string `locationName:"taskSets" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTaskSetsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTaskSetsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DescribeTaskSetsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DescribeTaskSetsInput"}
+ if s.Cluster == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cluster"))
+ }
+ if s.Service == nil {
+ invalidParams.Add(request.NewErrParamRequired("Service"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *DescribeTaskSetsInput) SetCluster(v string) *DescribeTaskSetsInput {
+ s.Cluster = &v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *DescribeTaskSetsInput) SetService(v string) *DescribeTaskSetsInput {
+ s.Service = &v
+ return s
+}
+
+// SetTaskSets sets the TaskSets field's value.
+func (s *DescribeTaskSetsInput) SetTaskSets(v []*string) *DescribeTaskSetsInput {
+ s.TaskSets = v
+ return s
+}
+
+type DescribeTaskSetsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Any failures associated with the call.
+ Failures []*Failure `locationName:"failures" type:"list"`
+
+ // The list of task sets described.
+ TaskSets []*TaskSet `locationName:"taskSets" type:"list"`
+}
+
+// String returns the string representation
+func (s DescribeTaskSetsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DescribeTaskSetsOutput) GoString() string {
+ return s.String()
+}
+
+// SetFailures sets the Failures field's value.
+func (s *DescribeTaskSetsOutput) SetFailures(v []*Failure) *DescribeTaskSetsOutput {
+ s.Failures = v
+ return s
+}
+
+// SetTaskSets sets the TaskSets field's value.
+func (s *DescribeTaskSetsOutput) SetTaskSets(v []*TaskSet) *DescribeTaskSetsOutput {
+ s.TaskSets = v
+ return s
+}
+
type DescribeTasksInput struct {
_ struct{} `type:"structure"`
// The short name or full Amazon Resource Name (ARN) of the cluster that hosts
- // the task to describe. If you do not specify a cluster, the default cluster
- // is assumed.
+ // the task or tasks to describe. If you do not specify a cluster, the default
+ // cluster is assumed. This parameter is required if the task or tasks you are
+ // describing were launched in any cluster other than the default cluster.
Cluster *string `locationName:"cluster" type:"string"`
+ // Specifies whether you want to see the resource tags for the task. If TAGS
+ // is specified, the tags are included in the response. If this field is omitted,
+ // tags are not included in the response.
+ Include []*string `locationName:"include" type:"list"`
+
// A list of up to 100 task IDs or full ARN entries.
//
// Tasks is a required field
@@ -6189,6 +8861,12 @@ func (s *DescribeTasksInput) SetCluster(v string) *DescribeTasksInput {
return s
}
+// SetInclude sets the Include field's value.
+func (s *DescribeTasksInput) SetInclude(v []*string) *DescribeTasksInput {
+ s.Include = v
+ return s
+}
+
// SetTasks sets the Tasks field's value.
func (s *DescribeTasksInput) SetTasks(v []*string) *DescribeTasksInput {
s.Tasks = v
@@ -6288,12 +8966,12 @@ func (s *Device) SetPermissions(v []*string) *Device {
type DiscoverPollEndpointInput struct {
_ struct{} `type:"structure"`
- // The short name or full Amazon Resource Name (ARN) of the cluster that the
- // container instance belongs to.
+ // The short name or full Amazon Resource Name (ARN) of the cluster to which
+ // the container instance belongs.
Cluster *string `locationName:"cluster" type:"string"`
// The container instance ID or full ARN of the container instance. The ARN
- // contains the arn:aws:ecs namespace, followed by the region of the container
+ // contains the arn:aws:ecs namespace, followed by the Region of the container
// instance, the AWS account ID of the container instance owner, the container-instance
// namespace, and then the container instance ID. For example, arn:aws:ecs:region:aws_account_id:container-instance/container_instance_ID.
ContainerInstance *string `locationName:"containerInstance" type:"string"`
@@ -6353,6 +9031,89 @@ func (s *DiscoverPollEndpointOutput) SetTelemetryEndpoint(v string) *DiscoverPol
return s
}
+// This parameter is specified when you are using Docker volumes. Docker volumes
+// are only supported when you are using the EC2 launch type. Windows containers
+// only support the use of the local driver. To use bind mounts, specify a host
+// instead.
+type DockerVolumeConfiguration struct {
+ _ struct{} `type:"structure"`
+
+ // If this value is true, the Docker volume is created if it does not already
+ // exist.
+ //
+ // This field is only used if the scope is shared.
+ Autoprovision *bool `locationName:"autoprovision" type:"boolean"`
+
+ // The Docker volume driver to use. The driver value must match the driver name
+ // provided by Docker because it is used for task placement. If the driver was
+ // installed using the Docker plugin CLI, use docker plugin ls to retrieve the
+ // driver name from your container instance. If the driver was installed using
+ // another method, use Docker plugin discovery to retrieve the driver name.
+ // For more information, see Docker plugin discovery (https://docs.docker.com/engine/extend/plugin_api/#plugin-discovery).
+ // This parameter maps to Driver in the Create a volume (https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the xxdriver option to docker volume create (https://docs.docker.com/engine/reference/commandline/volume_create/).
+ Driver *string `locationName:"driver" type:"string"`
+
+ // A map of Docker driver-specific options passed through. This parameter maps
+ // to DriverOpts in the Create a volume (https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the xxopt option to docker volume create (https://docs.docker.com/engine/reference/commandline/volume_create/).
+ DriverOpts map[string]*string `locationName:"driverOpts" type:"map"`
+
+ // Custom metadata to add to your Docker volume. This parameter maps to Labels
+ // in the Create a volume (https://docs.docker.com/engine/api/v1.35/#operation/VolumeCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+ // and the xxlabel option to docker volume create (https://docs.docker.com/engine/reference/commandline/volume_create/).
+ Labels map[string]*string `locationName:"labels" type:"map"`
+
+ // The scope for the Docker volume that determines its lifecycle. Docker volumes
+ // that are scoped to a task are automatically provisioned when the task starts
+ // and destroyed when the task stops. Docker volumes that are scoped as shared
+ // persist after the task stops.
+ Scope *string `locationName:"scope" type:"string" enum:"Scope"`
+}
+
+// String returns the string representation
+func (s DockerVolumeConfiguration) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DockerVolumeConfiguration) GoString() string {
+ return s.String()
+}
+
+// SetAutoprovision sets the Autoprovision field's value.
+func (s *DockerVolumeConfiguration) SetAutoprovision(v bool) *DockerVolumeConfiguration {
+ s.Autoprovision = &v
+ return s
+}
+
+// SetDriver sets the Driver field's value.
+func (s *DockerVolumeConfiguration) SetDriver(v string) *DockerVolumeConfiguration {
+ s.Driver = &v
+ return s
+}
+
+// SetDriverOpts sets the DriverOpts field's value.
+func (s *DockerVolumeConfiguration) SetDriverOpts(v map[string]*string) *DockerVolumeConfiguration {
+ s.DriverOpts = v
+ return s
+}
+
+// SetLabels sets the Labels field's value.
+func (s *DockerVolumeConfiguration) SetLabels(v map[string]*string) *DockerVolumeConfiguration {
+ s.Labels = v
+ return s
+}
+
+// SetScope sets the Scope field's value.
+func (s *DockerVolumeConfiguration) SetScope(v string) *DockerVolumeConfiguration {
+ s.Scope = &v
+ return s
+}
+
// A failed resource.
type Failure struct {
_ struct{} `type:"structure"`
@@ -6390,6 +9151,19 @@ func (s *Failure) SetReason(v string) *Failure {
// that are specified in a container definition override any Docker health checks
// that exist in the container image (such as those specified in a parent image
// or from the image's Dockerfile).
+//
+// The following are notes about container health check support:
+//
+// * Container health checks require version 1.17.0 or greater of the Amazon
+// ECS container agent. For more information, see Updating the Amazon ECS
+// Container Agent (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html).
+//
+// * Container health checks are supported for Fargate tasks if you are using
+// platform version 1.1.0 or greater. For more information, see AWS Fargate
+// Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html).
+//
+// * Container health checks are not supported for tasks that are part of
+// a service that is configured to use a Classic Load Balancer.
type HealthCheck struct {
_ struct{} `type:"structure"`
@@ -6401,8 +9175,8 @@ type HealthCheck struct {
// [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]
//
// An exit code of 0 indicates success, and non-zero exit code indicates failure.
- // For more information, see HealthCheck in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/).
+ // For more information, see HealthCheck in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/).
//
// Command is a required field
Command []*string `locationName:"command" type:"list" required:"true"`
@@ -6413,7 +9187,7 @@ type HealthCheck struct {
// The number of times to retry a failed health check before the container is
// considered unhealthy. You may specify between 1 and 10 retries. The default
- // value is 3 retries.
+ // value is 3.
Retries *int64 `locationName:"retries" type:"integer"`
// The optional grace period within which to provide containers time to bootstrap
@@ -6428,7 +9202,7 @@ type HealthCheck struct {
// The time period in seconds to wait for a health check to succeed before it
// is considered a failure. You may specify between 2 and 60 seconds. The default
- // value is 5 seconds.
+ // value is 5.
Timeout *int64 `locationName:"timeout" type:"integer"`
}
@@ -6539,17 +9313,18 @@ func (s *HostEntry) SetIpAddress(v string) *HostEntry {
return s
}
-// Details on a container instance host volume.
+// Details on a container instance bind mount host volume.
type HostVolumeProperties struct {
_ struct{} `type:"structure"`
- // The path on the host container instance that is presented to the container.
- // If this parameter is empty, then the Docker daemon has assigned a host path
- // for you. If the host parameter contains a sourcePath file location, then
- // the data volume persists at the specified location on the host container
- // instance until you delete it manually. If the sourcePath value does not exist
- // on the host container instance, the Docker daemon creates it. If the location
- // does exist, the contents of the source path folder are exported.
+ // When the host parameter is used, specify a sourcePath to declare the path
+ // on the host container instance that is presented to the container. If this
+ // parameter is empty, then the Docker daemon has assigned a host path for you.
+ // If the host parameter contains a sourcePath file location, then the data
+ // volume persists at the specified location on the host container instance
+ // until you delete it manually. If the sourcePath value does not exist on the
+ // host container instance, the Docker daemon creates it. If the location does
+ // exist, the contents of the source path folder are exported.
//
// If you are using the Fargate launch type, the sourcePath parameter is not
// supported.
@@ -6584,8 +9359,8 @@ type KernelCapabilities struct {
// The Linux capabilities for the container that have been added to the default
// configuration provided by Docker. This parameter maps to CapAdd in the Create
- // a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --cap-add option to docker run (https://docs.docker.com/engine/reference/run/).
//
// If you are using tasks that use the Fargate launch type, the add parameter
@@ -6603,8 +9378,8 @@ type KernelCapabilities struct {
// The Linux capabilities for the container that have been removed from the
// default configuration provided by Docker. This parameter maps to CapDrop
- // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --cap-drop option to docker run (https://docs.docker.com/engine/reference/run/).
//
// Valid values: "ALL" | "AUDIT_CONTROL" | "AUDIT_WRITE" | "BLOCK_SUSPEND" |
@@ -6640,15 +9415,15 @@ func (s *KernelCapabilities) SetDrop(v []*string) *KernelCapabilities {
return s
}
-// A key and value pair object.
+// A key-value pair object.
type KeyValuePair struct {
_ struct{} `type:"structure"`
- // The name of the key value pair. For environment variables, this is the name
+ // The name of the key-value pair. For environment variables, this is the name
// of the environment variable.
Name *string `locationName:"name" type:"string"`
- // The value of the key value pair. For environment variables, this is the value
+ // The value of the key-value pair. For environment variables, this is the value
// of the environment variable.
Value *string `locationName:"value" type:"string"`
}
@@ -6687,8 +9462,8 @@ type LinuxParameters struct {
Capabilities *KernelCapabilities `locationName:"capabilities" type:"structure"`
// Any host devices to expose to the container. This parameter maps to Devices
- // in the Create a container (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/#create-a-container)
- // section of the Docker Remote API (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.27/)
+ // in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+ // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
// and the --device option to docker run (https://docs.docker.com/engine/reference/run/).
//
// If you are using tasks that use the Fargate launch type, the devices parameter
@@ -6700,7 +9475,7 @@ type LinuxParameters struct {
// This parameter requires version 1.25 of the Docker Remote API or greater
// on your container instance. To check the Docker Remote API version on your
// container instance, log in to your container instance and run the following
- // command: sudo docker version | grep "Server API version"
+ // command: sudo docker version --format '{{.Server.APIVersion}}'
InitProcessEnabled *bool `locationName:"initProcessEnabled" type:"boolean"`
// The value for the size (in MiB) of the /dev/shm volume. This parameter maps
@@ -6788,6 +9563,127 @@ func (s *LinuxParameters) SetTmpfs(v []*Tmpfs) *LinuxParameters {
return s
}
+type ListAccountSettingsInput struct {
+ _ struct{} `type:"structure"`
+
+ // Specifies whether to return the effective settings. If true, the account
+ // settings for the root user or the default setting for the principalArn are
+ // returned. If false, the account settings for the principalArn are returned
+ // if they are set. Otherwise, no account settings are returned.
+ EffectiveSettings *bool `locationName:"effectiveSettings" type:"boolean"`
+
+ // The maximum number of account setting results returned by ListAccountSettings
+ // in paginated output. When this parameter is used, ListAccountSettings only
+ // returns maxResults results in a single page along with a nextToken response
+ // element. The remaining results of the initial request can be seen by sending
+ // another ListAccountSettings request with the returned nextToken value. This
+ // value can be between 1 and 10. If this parameter is not used, then ListAccountSettings
+ // returns up to 10 results and a nextToken value if applicable.
+ MaxResults *int64 `locationName:"maxResults" type:"integer"`
+
+ // The resource name you want to list the account settings for.
+ Name *string `locationName:"name" type:"string" enum:"SettingName"`
+
+ // The nextToken value returned from a previous paginated ListAccountSettings
+ // request where maxResults was used and the results exceeded the value of that
+ // parameter. Pagination continues from the end of the previous results that
+ // returned the nextToken value.
+ //
+ // This token should be treated as an opaque identifier that is only used to
+ // retrieve the next items in a list and not for other programmatic purposes.
+ NextToken *string `locationName:"nextToken" type:"string"`
+
+ // The ARN of the principal, which can be an IAM user, IAM role, or the root
+ // user. If this field is omitted, the account settings are listed only for
+ // the authenticated user.
+ PrincipalArn *string `locationName:"principalArn" type:"string"`
+
+ // The value of the account settings with which to filter results. You must
+ // also specify an account setting name to use this parameter.
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s ListAccountSettingsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ListAccountSettingsInput) GoString() string {
+ return s.String()
+}
+
+// SetEffectiveSettings sets the EffectiveSettings field's value.
+func (s *ListAccountSettingsInput) SetEffectiveSettings(v bool) *ListAccountSettingsInput {
+ s.EffectiveSettings = &v
+ return s
+}
+
+// SetMaxResults sets the MaxResults field's value.
+func (s *ListAccountSettingsInput) SetMaxResults(v int64) *ListAccountSettingsInput {
+ s.MaxResults = &v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *ListAccountSettingsInput) SetName(v string) *ListAccountSettingsInput {
+ s.Name = &v
+ return s
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *ListAccountSettingsInput) SetNextToken(v string) *ListAccountSettingsInput {
+ s.NextToken = &v
+ return s
+}
+
+// SetPrincipalArn sets the PrincipalArn field's value.
+func (s *ListAccountSettingsInput) SetPrincipalArn(v string) *ListAccountSettingsInput {
+ s.PrincipalArn = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *ListAccountSettingsInput) SetValue(v string) *ListAccountSettingsInput {
+ s.Value = &v
+ return s
+}
+
+type ListAccountSettingsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The nextToken value to include in a future ListAccountSettings request. When
+ // the results of a ListAccountSettings request exceed maxResults, this value
+ // can be used 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"`
+
+ // The account settings for the resource.
+ Settings []*Setting `locationName:"settings" type:"list"`
+}
+
+// String returns the string representation
+func (s ListAccountSettingsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ListAccountSettingsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextToken sets the NextToken field's value.
+func (s *ListAccountSettingsOutput) SetNextToken(v string) *ListAccountSettingsOutput {
+ s.NextToken = &v
+ return s
+}
+
+// SetSettings sets the Settings field's value.
+func (s *ListAccountSettingsOutput) SetSettings(v []*Setting) *ListAccountSettingsOutput {
+ s.Settings = v
+ return s
+}
+
type ListAttributesInput struct {
_ struct{} `type:"structure"`
@@ -7010,7 +9906,7 @@ type ListContainerInstancesInput struct {
// You can filter the results of a ListContainerInstances operation with cluster
// query language statements. For more information, see Cluster Query Language
- // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
// in the Amazon Elastic Container Service Developer Guide.
Filter *string `locationName:"filter" type:"string"`
@@ -7036,8 +9932,8 @@ type ListContainerInstancesInput struct {
// Filters the container instances by status. For example, if you specify the
// DRAINING status, the results include only container instances that have been
// set to DRAINING using UpdateContainerInstancesState. If you do not specify
- // this parameter, the default is to include container instances set to ACTIVE
- // and DRAINING.
+ // this parameter, the default is to include container instances set to all
+ // states other than INACTIVE.
Status *string `locationName:"status" type:"string" enum:"ContainerInstanceStatus"`
}
@@ -7125,7 +10021,7 @@ type ListServicesInput struct {
// is assumed.
Cluster *string `locationName:"cluster" type:"string"`
- // The launch type for services you want to list.
+ // The launch type for the services to list.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// The maximum number of service results returned by ListServices in paginated
@@ -7133,7 +10029,7 @@ type ListServicesInput struct {
// results in a single page along with a nextToken response element. The remaining
// results of the initial request can be seen by sending another ListServices
// request with the returned nextToken value. This value can be between 1 and
- // 10. If this parameter is not used, then ListServices returns up to 10 results
+ // 100. If this parameter is not used, then ListServices returns up to 10 results
// and a nextToken value if applicable.
MaxResults *int64 `locationName:"maxResults" type:"integer"`
@@ -7145,6 +10041,9 @@ type ListServicesInput struct {
// This token should be treated as an opaque identifier that is only used to
// retrieve the next items in a list and not for other programmatic purposes.
NextToken *string `locationName:"nextToken" type:"string"`
+
+ // The scheduling strategy for services to list.
+ SchedulingStrategy *string `locationName:"schedulingStrategy" type:"string" enum:"SchedulingStrategy"`
}
// String returns the string representation
@@ -7181,6 +10080,12 @@ func (s *ListServicesInput) SetNextToken(v string) *ListServicesInput {
return s
}
+// SetSchedulingStrategy sets the SchedulingStrategy field's value.
+func (s *ListServicesInput) SetSchedulingStrategy(v string) *ListServicesInput {
+ s.SchedulingStrategy = &v
+ return s
+}
+
type ListServicesOutput struct {
_ struct{} `type:"structure"`
@@ -7217,6 +10122,69 @@ func (s *ListServicesOutput) SetServiceArns(v []*string) *ListServicesOutput {
return s
}
+type ListTagsForResourceInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) that identifies the resource for which to
+ // list the tags. Currently, the supported resources are Amazon ECS tasks, services,
+ // task definitions, clusters, and container instances.
+ //
+ // ResourceArn is a required field
+ ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ListTagsForResourceInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ListTagsForResourceInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ListTagsForResourceInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"}
+ if s.ResourceArn == nil {
+ invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetResourceArn sets the ResourceArn field's value.
+func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput {
+ s.ResourceArn = &v
+ return s
+}
+
+type ListTagsForResourceOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The tags for the resource.
+ Tags []*Tag `locationName:"tags" type:"list"`
+}
+
+// String returns the string representation
+func (s ListTagsForResourceOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ListTagsForResourceOutput) GoString() string {
+ return s.String()
+}
+
+// SetTags sets the Tags field's value.
+func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput {
+ s.Tags = v
+ return s
+}
+
type ListTaskDefinitionFamiliesInput struct {
_ struct{} `type:"structure"`
@@ -7457,21 +10425,21 @@ type ListTasksInput struct {
// The task desired status with which to filter the ListTasks results. Specifying
// a desiredStatus of STOPPED limits the results to tasks that Amazon ECS has
- // set the desired status to STOPPED, which can be useful for debugging tasks
+ // set the desired status to STOPPED. This can be useful for debugging tasks
// that are not starting properly or have died or finished. The default status
// filter is RUNNING, which shows tasks that Amazon ECS has set the desired
// status to RUNNING.
//
// Although you can filter results based on a desired status of PENDING, this
- // does not return any results because Amazon ECS never sets the desired status
- // of a task to that value (only a task's lastStatus may have a value of PENDING).
+ // does not return any results. Amazon ECS never sets the desired status of
+ // a task to that value (only a task's lastStatus may have a value of PENDING).
DesiredStatus *string `locationName:"desiredStatus" type:"string" enum:"DesiredStatus"`
// The name of the family with which to filter the ListTasks results. Specifying
// a family limits the results to tasks that belong to that family.
Family *string `locationName:"family" type:"string"`
- // The launch type for services you want to list.
+ // The launch type for services to list.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// The maximum number of task results returned by ListTasks in paginated output.
@@ -7600,14 +10568,26 @@ func (s *ListTasksOutput) SetTaskArns(v []*string) *ListTasksOutput {
return s
}
-// Details on a load balancer that is used with a service.
+// Details on a load balancer to be used with a service or task set.
+//
+// If the service is using the ECS deployment controller, you are limited to
+// one load balancer or target group.
+//
+// If the service is using the CODE_DEPLOY deployment controller, the service
+// is required to use either an Application Load Balancer or Network Load Balancer.
+// When you are creating an AWS CodeDeploy deployment group, you specify two
+// target groups (referred to as a targetGroupPair). Each target group binds
+// to a separate task set in the deployment. The load balancer can also have
+// up to two listeners, a required listener for production traffic and an optional
+// listener that allows you to test new revisions of the service before routing
+// production traffic to it.
//
// Services with tasks that use the awsvpc network mode (for example, those
// with the Fargate launch type) only support Application Load Balancers and
-// Network Load Balancers; Classic Load Balancers are not supported. Also, when
+// Network Load Balancers. Classic Load Balancers are not supported. Also, when
// you create any target groups for these services, you must choose ip as the
-// target type, not instance, because tasks that use the awsvpc network mode
-// are associated with an elastic network interface, not an Amazon EC2 instance.
+// target type, not instance. Tasks that use the awsvpc network mode are associated
+// with an elastic network interface, not an Amazon EC2 instance.
type LoadBalancer struct {
_ struct{} `type:"structure"`
@@ -7621,11 +10601,24 @@ type LoadBalancer struct {
// mapping.
ContainerPort *int64 `locationName:"containerPort" type:"integer"`
- // The name of a load balancer.
+ // The name of the load balancer to associate with the Amazon ECS service or
+ // task set.
+ //
+ // A load balancer name is only specified when using a classic load balancer.
+ // If you are using an application load balancer or a network load balancer
+ // this should be omitted.
LoadBalancerName *string `locationName:"loadBalancerName" type:"string"`
// The full Amazon Resource Name (ARN) of the Elastic Load Balancing target
- // group associated with a service.
+ // group or groups associated with a service or task set.
+ //
+ // A target group ARN is only specified when using an application load balancer
+ // or a network load balancer. If you are using a classic load balancer this
+ // should be omitted.
+ //
+ // For services using the ECS deployment controller, you are limited to one
+ // target group. For services using the CODE_DEPLOY deployment controller, you
+ // are required to define two target groups for the load balancer.
//
// If your service's task definition uses the awsvpc network mode (which is
// required for the Fargate launch type), you must choose ip as the target type,
@@ -7674,9 +10667,16 @@ type LogConfiguration struct {
// The log driver to use for the container. The valid values listed for this
// parameter are log drivers that the Amazon ECS container agent can communicate
- // with by default. If using the Fargate launch type, the only supported value
- // is awslogs. For more information about using the awslogs driver, see Using
- // the awslogs Log Driver (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html)
+ // with by default.
+ //
+ // For tasks using the Fargate launch type, the supported log drivers are awslogs
+ // and splunk.
+ //
+ // For tasks using the EC2 launch type, the supported log drivers are awslogs,
+ // syslog, gelf, fluentd, splunk, journald, and json-file.
+ //
+ // For more information about using the awslogs log driver, see Using the awslogs
+ // Log Driver (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// If you have a custom driver that is not listed above that you would like
@@ -7689,7 +10689,7 @@ type LogConfiguration struct {
// This parameter requires version 1.18 of the Docker Remote API or greater
// on your container instance. To check the Docker Remote API version on your
// container instance, log in to your container instance and run the following
- // command: sudo docker version | grep "Server API version"
+ // command: sudo docker version --format '{{.Server.APIVersion}}'
//
// LogDriver is a required field
LogDriver *string `locationName:"logDriver" type:"string" required:"true" enum:"LogDriver"`
@@ -7698,8 +10698,11 @@ type LogConfiguration struct {
// version 1.19 of the Docker Remote API or greater on your container instance.
// To check the Docker Remote API version on your container instance, log in
// to your container instance and run the following command: sudo docker version
- // | grep "Server API version"
+ // --format '{{.Server.APIVersion}}'
Options map[string]*string `locationName:"options" type:"map"`
+
+ // The secrets to pass to the log configuration.
+ SecretOptions []*Secret `locationName:"secretOptions" type:"list"`
}
// String returns the string representation
@@ -7718,6 +10721,16 @@ func (s *LogConfiguration) Validate() error {
if s.LogDriver == nil {
invalidParams.Add(request.NewErrParamRequired("LogDriver"))
}
+ if s.SecretOptions != nil {
+ for i, v := range s.SecretOptions {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecretOptions", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -7737,6 +10750,12 @@ func (s *LogConfiguration) SetOptions(v map[string]*string) *LogConfiguration {
return s
}
+// SetSecretOptions sets the SecretOptions field's value.
+func (s *LogConfiguration) SetSecretOptions(v []*Secret) *LogConfiguration {
+ s.SecretOptions = v
+ return s
+}
+
// Details on a volume mount point that is used in a container definition.
type MountPoint struct {
_ struct{} `type:"structure"`
@@ -7749,7 +10768,8 @@ type MountPoint struct {
// value is false.
ReadOnly *bool `locationName:"readOnly" type:"boolean"`
- // The name of the volume to mount.
+ // The name of the volume to mount. Must be a volume name referenced in the
+ // name parameter of task definition volume.
SourceVolume *string `locationName:"sourceVolume" type:"string"`
}
@@ -7840,6 +10860,8 @@ type NetworkConfiguration struct {
_ struct{} `type:"structure"`
// The VPC subnets and security groups associated with a task.
+ //
+ // All specified subnets and security groups must be from the same VPC.
AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" type:"structure"`
}
@@ -7874,7 +10896,7 @@ func (s *NetworkConfiguration) SetAwsvpcConfiguration(v *AwsVpcConfiguration) *N
return s
}
-// An object representing the Elastic Network Interface for tasks that use the
+// An object representing the elastic network interface for tasks that use the
// awsvpc network mode.
type NetworkInterface struct {
_ struct{} `type:"structure"`
@@ -7918,14 +10940,14 @@ func (s *NetworkInterface) SetPrivateIpv4Address(v string) *NetworkInterface {
}
// An object representing a constraint on task placement. For more information,
-// see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html)
+// see Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html)
// in the Amazon Elastic Container Service Developer Guide.
type PlacementConstraint struct {
_ struct{} `type:"structure"`
- // A cluster query language expression to apply to the constraint. Note you
- // cannot specify an expression if the constraint type is distinctInstance.
- // For more information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
+ // A cluster query language expression to apply to the constraint. You cannot
+ // specify an expression if the constraint type is distinctInstance. For more
+ // information, see Cluster Query Language (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
// in the Amazon Elastic Container Service Developer Guide.
Expression *string `locationName:"expression" type:"string"`
@@ -7959,7 +10981,7 @@ func (s *PlacementConstraint) SetType(v string) *PlacementConstraint {
}
// The task placement strategy for a task or service. For more information,
-// see Task Placement Strategies (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html)
+// see Task Placement Strategies (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html)
// in the Amazon Elastic Container Service Developer Guide.
type PlacementStrategy struct {
_ struct{} `type:"structure"`
@@ -8004,13 +11026,70 @@ func (s *PlacementStrategy) SetType(v string) *PlacementStrategy {
return s
}
+// The devices that are available on the container instance. The only supported
+// device type is a GPU.
+type PlatformDevice struct {
+ _ struct{} `type:"structure"`
+
+ // The ID for the GPU(s) on the container instance. The available GPU IDs can
+ // also be obtained on the container instance in the /var/lib/ecs/gpu/nvidia_gpu_info.json
+ // file.
+ //
+ // Id is a required field
+ Id *string `locationName:"id" type:"string" required:"true"`
+
+ // The type of device that is available on the container instance. The only
+ // supported value is GPU.
+ //
+ // Type is a required field
+ Type *string `locationName:"type" type:"string" required:"true" enum:"PlatformDeviceType"`
+}
+
+// String returns the string representation
+func (s PlatformDevice) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PlatformDevice) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *PlatformDevice) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "PlatformDevice"}
+ if s.Id == nil {
+ invalidParams.Add(request.NewErrParamRequired("Id"))
+ }
+ if s.Type == nil {
+ invalidParams.Add(request.NewErrParamRequired("Type"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetId sets the Id field's value.
+func (s *PlatformDevice) SetId(v string) *PlatformDevice {
+ s.Id = &v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *PlatformDevice) SetType(v string) *PlatformDevice {
+ s.Type = &v
+ return s
+}
+
// Port mappings allow containers to access ports on the host container instance
// to send or receive traffic. Port mappings are specified as part of the container
// definition.
//
-// If using containers in a task with the awsvpc or host network mode, exposed
-// ports should be specified using containerPort. The hostPort can be left blank
-// or it must be the same value as the containerPort.
+// If you are using containers in a task with the awsvpc or host network mode,
+// exposed ports should be specified using containerPort. The hostPort can be
+// left blank or it must be the same value as the containerPort.
//
// After a task reaches the RUNNING status, manual and automatic host and container
// port assignments are visible in the networkBindings section of DescribeTasks
@@ -8021,45 +11100,48 @@ type PortMapping struct {
// The port number on the container that is bound to the user-specified or automatically
// assigned host port.
//
- // If using containers in a task with the awsvpc or host network mode, exposed
- // ports should be specified using containerPort.
+ // If you are using containers in a task with the awsvpc or host network mode,
+ // exposed ports should be specified using containerPort.
//
- // If using containers in a task with the bridge network mode and you specify
- // a container port and not a host port, your container automatically receives
- // a host port in the ephemeral port range (for more information, see hostPort).
- // Port mappings that are automatically assigned in this way do not count toward
- // the 100 reserved ports limit of a container instance.
+ // If you are using containers in a task with the bridge network mode and you
+ // specify a container port and not a host port, your container automatically
+ // receives a host port in the ephemeral port range. For more information, see
+ // hostPort. Port mappings that are automatically assigned in this way do not
+ // count toward the 100 reserved ports limit of a container instance.
+ //
+ // You cannot expose the same container port for multiple protocols. An error
+ // will be returned if this is attempted.
ContainerPort *int64 `locationName:"containerPort" type:"integer"`
// The port number on the container instance to reserve for your container.
//
- // If using containers in a task with the awsvpc or host network mode, the hostPort
- // can either be left blank or set to the same value as the containerPort.
+ // If you are using containers in a task with the awsvpc or host network mode,
+ // the hostPort can either be left blank or set to the same value as the containerPort.
//
- // If using containers in a task with the bridge network mode, you can specify
- // a non-reserved host port for your container port mapping, or you can omit
- // the hostPort (or set it to 0) while specifying a containerPort and your container
- // automatically receives a port in the ephemeral port range for your container
- // instance operating system and Docker version.
+ // If you are using containers in a task with the bridge network mode, you can
+ // specify a non-reserved host port for your container port mapping, or you
+ // can omit the hostPort (or set it to 0) while specifying a containerPort and
+ // your container automatically receives a port in the ephemeral port range
+ // for your container instance operating system and Docker version.
//
// The default ephemeral port range for Docker version 1.6.0 and later is listed
- // on the instance under /proc/sys/net/ipv4/ip_local_port_range; if this kernel
+ // on the instance under /proc/sys/net/ipv4/ip_local_port_range. If this kernel
// parameter is unavailable, the default ephemeral port range from 49153 through
- // 65535 is used. You should not attempt to specify a host port in the ephemeral
- // port range as these are reserved for automatic assignment. In general, ports
- // below 32768 are outside of the ephemeral port range.
+ // 65535 is used. Do not attempt to specify a host port in the ephemeral port
+ // range as these are reserved for automatic assignment. In general, ports below
+ // 32768 are outside of the ephemeral port range.
//
// The default ephemeral port range from 49153 through 65535 is always used
// for Docker versions before 1.6.0.
//
// The default reserved ports are 22 for SSH, the Docker ports 2375 and 2376,
- // and the Amazon ECS container agent ports 51678 and 51679. Any host port that
+ // and the Amazon ECS container agent ports 51678-51680. Any host port that
// was previously specified in a running task is also reserved while the task
// is running (after a task stops, the host port is released). The current reserved
// ports are displayed in the remainingResources of DescribeContainerInstances
- // output, and a container instance may have up to 100 reserved ports at a time,
- // including the default reserved ports (automatically assigned ports do not
- // count toward the 100 reserved ports limit).
+ // output. A container instance can have up to 100 reserved ports at a time,
+ // including the default reserved ports. Automatically assigned ports don't
+ // count toward the 100 reserved ports limit.
HostPort *int64 `locationName:"hostPort" type:"integer"`
// The protocol used for the port mapping. Valid values are tcp and udp. The
@@ -8095,6 +11177,282 @@ func (s *PortMapping) SetProtocol(v string) *PortMapping {
return s
}
+// The configuration details for the App Mesh proxy.
+//
+// For tasks using the EC2 launch type, the container instances require at least
+// version 1.26.0 of the container agent and at least version 1.26.0-1 of the
+// ecs-init package to enable a proxy configuration. If your container instances
+// are launched from the Amazon ECS-optimized AMI version 20190301 or later,
+// then they contain the required versions of the container agent and ecs-init.
+// For more information, see Amazon ECS-optimized Linux AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+// in the Amazon Elastic Container Service Developer Guide.
+//
+// For tasks using the Fargate launch type, the task or service requires platform
+// version 1.3.0 or later.
+type ProxyConfiguration struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the container that will serve as the App Mesh proxy.
+ //
+ // ContainerName is a required field
+ ContainerName *string `locationName:"containerName" type:"string" required:"true"`
+
+ // The set of network configuration parameters to provide the Container Network
+ // Interface (CNI) plugin, specified as key-value pairs.
+ //
+ // * IgnoredUID - (Required) The user ID (UID) of the proxy container as
+ // defined by the user parameter in a container definition. This is used
+ // to ensure the proxy ignores its own traffic. If IgnoredGID is specified,
+ // this field can be empty.
+ //
+ // * IgnoredGID - (Required) The group ID (GID) of the proxy container as
+ // defined by the user parameter in a container definition. This is used
+ // to ensure the proxy ignores its own traffic. If IgnoredUID is specified,
+ // this field can be empty.
+ //
+ // * AppPorts - (Required) The list of ports that the application uses. Network
+ // traffic to these ports is forwarded to the ProxyIngressPort and ProxyEgressPort.
+ //
+ // * ProxyIngressPort - (Required) Specifies the port that incoming traffic
+ // to the AppPorts is directed to.
+ //
+ // * ProxyEgressPort - (Required) Specifies the port that outgoing traffic
+ // from the AppPorts is directed to.
+ //
+ // * EgressIgnoredPorts - (Required) The egress traffic going to the specified
+ // ports is ignored and not redirected to the ProxyEgressPort. It can be
+ // an empty list.
+ //
+ // * EgressIgnoredIPs - (Required) The egress traffic going to the specified
+ // IP addresses is ignored and not redirected to the ProxyEgressPort. It
+ // can be an empty list.
+ Properties []*KeyValuePair `locationName:"properties" type:"list"`
+
+ // The proxy type. The only supported value is APPMESH.
+ Type *string `locationName:"type" type:"string" enum:"ProxyConfigurationType"`
+}
+
+// String returns the string representation
+func (s ProxyConfiguration) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ProxyConfiguration) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ProxyConfiguration) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ProxyConfiguration"}
+ if s.ContainerName == nil {
+ invalidParams.Add(request.NewErrParamRequired("ContainerName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetContainerName sets the ContainerName field's value.
+func (s *ProxyConfiguration) SetContainerName(v string) *ProxyConfiguration {
+ s.ContainerName = &v
+ return s
+}
+
+// SetProperties sets the Properties field's value.
+func (s *ProxyConfiguration) SetProperties(v []*KeyValuePair) *ProxyConfiguration {
+ s.Properties = v
+ return s
+}
+
+// SetType sets the Type field's value.
+func (s *ProxyConfiguration) SetType(v string) *ProxyConfiguration {
+ s.Type = &v
+ return s
+}
+
+type PutAccountSettingDefaultInput struct {
+ _ struct{} `type:"structure"`
+
+ // The resource name for which to modify the account setting. If serviceLongArnFormat
+ // is specified, the ARN for your Amazon ECS services is affected. If taskLongArnFormat
+ // is specified, the ARN and resource ID for your Amazon ECS tasks is affected.
+ // If containerInstanceLongArnFormat is specified, the ARN and resource ID for
+ // your Amazon ECS container instances is affected. If awsvpcTrunking is specified,
+ // the ENI limit for your Amazon ECS container instances is affected. If containerInsights
+ // is specified, the default setting for CloudWatch Container Insights for your
+ // clusters is affected.
+ //
+ // Name is a required field
+ Name *string `locationName:"name" type:"string" required:"true" enum:"SettingName"`
+
+ // The account setting value for the specified principal ARN. Accepted values
+ // are enabled and disabled.
+ //
+ // Value is a required field
+ Value *string `locationName:"value" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s PutAccountSettingDefaultInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PutAccountSettingDefaultInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *PutAccountSettingDefaultInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "PutAccountSettingDefaultInput"}
+ if s.Name == nil {
+ invalidParams.Add(request.NewErrParamRequired("Name"))
+ }
+ if s.Value == nil {
+ invalidParams.Add(request.NewErrParamRequired("Value"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetName sets the Name field's value.
+func (s *PutAccountSettingDefaultInput) SetName(v string) *PutAccountSettingDefaultInput {
+ s.Name = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *PutAccountSettingDefaultInput) SetValue(v string) *PutAccountSettingDefaultInput {
+ s.Value = &v
+ return s
+}
+
+type PutAccountSettingDefaultOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current account setting for a resource.
+ Setting *Setting `locationName:"setting" type:"structure"`
+}
+
+// String returns the string representation
+func (s PutAccountSettingDefaultOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PutAccountSettingDefaultOutput) GoString() string {
+ return s.String()
+}
+
+// SetSetting sets the Setting field's value.
+func (s *PutAccountSettingDefaultOutput) SetSetting(v *Setting) *PutAccountSettingDefaultOutput {
+ s.Setting = v
+ return s
+}
+
+type PutAccountSettingInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon ECS resource name for which to modify the account setting. If
+ // serviceLongArnFormat is specified, the ARN for your Amazon ECS services is
+ // affected. If taskLongArnFormat is specified, the ARN and resource ID for
+ // your Amazon ECS tasks is affected. If containerInstanceLongArnFormat is specified,
+ // the ARN and resource ID for your Amazon ECS container instances is affected.
+ // If awsvpcTrunking is specified, the elastic network interface (ENI) limit
+ // for your Amazon ECS container instances is affected. If containerInsights
+ // is specified, the default setting for CloudWatch Container Insights for your
+ // clusters is affected.
+ //
+ // Name is a required field
+ Name *string `locationName:"name" type:"string" required:"true" enum:"SettingName"`
+
+ // The ARN of the principal, which can be an IAM user, IAM role, or the root
+ // user. If you specify the root user, it modifies the account setting for all
+ // IAM users, IAM roles, and the root user of the account unless an IAM user
+ // or role explicitly overrides these settings. If this field is omitted, the
+ // setting is changed only for the authenticated user.
+ PrincipalArn *string `locationName:"principalArn" type:"string"`
+
+ // The account setting value for the specified principal ARN. Accepted values
+ // are enabled and disabled.
+ //
+ // Value is a required field
+ Value *string `locationName:"value" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s PutAccountSettingInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PutAccountSettingInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *PutAccountSettingInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "PutAccountSettingInput"}
+ if s.Name == nil {
+ invalidParams.Add(request.NewErrParamRequired("Name"))
+ }
+ if s.Value == nil {
+ invalidParams.Add(request.NewErrParamRequired("Value"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetName sets the Name field's value.
+func (s *PutAccountSettingInput) SetName(v string) *PutAccountSettingInput {
+ s.Name = &v
+ return s
+}
+
+// SetPrincipalArn sets the PrincipalArn field's value.
+func (s *PutAccountSettingInput) SetPrincipalArn(v string) *PutAccountSettingInput {
+ s.PrincipalArn = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *PutAccountSettingInput) SetValue(v string) *PutAccountSettingInput {
+ s.Value = &v
+ return s
+}
+
+type PutAccountSettingOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The current account setting for a resource.
+ Setting *Setting `locationName:"setting" type:"structure"`
+}
+
+// String returns the string representation
+func (s PutAccountSettingOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PutAccountSettingOutput) GoString() string {
+ return s.String()
+}
+
+// SetSetting sets the Setting field's value.
+func (s *PutAccountSettingOutput) SetSetting(v *Setting) *PutAccountSettingOutput {
+ s.Setting = v
+ return s
+}
+
type PutAttributesInput struct {
_ struct{} `type:"structure"`
@@ -8202,6 +11560,16 @@ type RegisterContainerInstanceInput struct {
// curl http://169.254.169.254/latest/dynamic/instance-identity/signature/
InstanceIdentityDocumentSignature *string `locationName:"instanceIdentityDocumentSignature" type:"string"`
+ // The devices that are available on the container instance. The only supported
+ // device type is a GPU.
+ PlatformDevices []*PlatformDevice `locationName:"platformDevices" type:"list"`
+
+ // The metadata that you apply to the container instance to help you categorize
+ // and organize them. Each tag consists of a key and an optional value, both
+ // of which you define. Tag keys can have a maximum character length of 128
+ // characters, and tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The resources available on the instance.
TotalResources []*Resource `locationName:"totalResources" type:"list"`
@@ -8233,6 +11601,26 @@ func (s *RegisterContainerInstanceInput) Validate() error {
}
}
}
+ if s.PlatformDevices != nil {
+ for i, v := range s.PlatformDevices {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PlatformDevices", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8270,6 +11658,18 @@ func (s *RegisterContainerInstanceInput) SetInstanceIdentityDocumentSignature(v
return s
}
+// SetPlatformDevices sets the PlatformDevices field's value.
+func (s *RegisterContainerInstanceInput) SetPlatformDevices(v []*PlatformDevice) *RegisterContainerInstanceInput {
+ s.PlatformDevices = v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *RegisterContainerInstanceInput) SetTags(v []*Tag) *RegisterContainerInstanceInput {
+ s.Tags = v
+ return s
+}
+
// SetTotalResources sets the TotalResources field's value.
func (s *RegisterContainerInstanceInput) SetTotalResources(v []*Resource) *RegisterContainerInstanceInput {
s.TotalResources = v
@@ -8316,18 +11716,18 @@ type RegisterTaskDefinitionInput struct {
// The number of CPU units used by the task. It can be expressed as an integer
// using CPU units, for example 1024, or as a string using vCPUs, for example
- // 1 vCPU or 1 vcpu, in a task definition but will be converted to an integer
- // indicating the CPU units when the task definition is registered.
+ // 1 vCPU or 1 vcpu, in a task definition. String values are converted to an
+ // integer indicating the CPU units when the task definition is registered.
//
// Task-level CPU and memory parameters are ignored for Windows containers.
// We recommend specifying container-level resources for Windows containers.
//
- // If using the EC2 launch type, this field is optional. Supported values are
- // between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs).
+ // If you are using the EC2 launch type, this field is optional. Supported values
+ // are between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs).
//
- // If using the Fargate launch type, this field is required and you must use
- // one of the following values, which determines your range of supported values
- // for the memory parameter:
+ // If you are using the Fargate launch type, this field is required and you
+ // must use one of the following values, which determines your range of supported
+ // values for the memory parameter:
//
// * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB),
// 2048 (2 GB)
@@ -8352,15 +11752,46 @@ type RegisterTaskDefinitionInput struct {
// You must specify a family for a task definition, which allows you to track
// multiple versions of the same task definition. The family is used as a name
// for your task definition. Up to 255 letters (uppercase and lowercase), numbers,
- // hyphens, and underscores are allowed.
+ // and hyphens are allowed.
//
// Family is a required field
Family *string `locationName:"family" type:"string" required:"true"`
+ // The IPC resource namespace to use for the containers in the task. The valid
+ // values are host, task, or none. If host is specified, then all containers
+ // within the tasks that specified the host IPC mode on the same container instance
+ // share the same IPC resources with the host Amazon EC2 instance. If task is
+ // specified, all containers within the specified task share the same IPC resources.
+ // If none is specified, then IPC resources within the containers of a task
+ // are private and not shared with other containers in a task or on the container
+ // instance. If no value is specified, then the IPC resource namespace sharing
+ // depends on the Docker daemon setting on the container instance. For more
+ // information, see IPC settings (https://docs.docker.com/engine/reference/run/#ipc-settings---ipc)
+ // in the Docker run reference.
+ //
+ // If the host IPC mode is used, be aware that there is a heightened risk of
+ // undesired IPC namespace expose. For more information, see Docker security
+ // (https://docs.docker.com/engine/security/security/).
+ //
+ // If you are setting namespaced kernel parameters using systemControls for
+ // the containers in the task, the following will apply to your IPC resource
+ // namespace. For more information, see System Controls (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ //
+ // * For tasks that use the host IPC mode, IPC namespace related systemControls
+ // are not supported.
+ //
+ // * For tasks that use the task IPC mode, IPC namespace related systemControls
+ // will apply to all containers within a task.
+ //
+ // This parameter is not supported for Windows containers or tasks using the
+ // Fargate launch type.
+ IpcMode *string `locationName:"ipcMode" type:"string" enum:"IpcMode"`
+
// The amount of memory (in MiB) used by the task. It can be expressed as an
// integer using MiB, for example 1024, or as a string using GB, for example
- // 1GB or 1 GB, in a task definition but will be converted to an integer indicating
- // the MiB when the task definition is registered.
+ // 1GB or 1 GB, in a task definition. String values are converted to an integer
+ // indicating the MiB when the task definition is registered.
//
// Task-level CPU and memory parameters are ignored for Windows containers.
// We recommend specifying container-level resources for Windows containers.
@@ -8389,49 +11820,91 @@ type RegisterTaskDefinitionInput struct {
// The Docker networking mode to use for the containers in the task. The valid
// values are none, bridge, awsvpc, and host. The default Docker network mode
- // is bridge. If using the Fargate launch type, the awsvpc network mode is required.
- // If using the EC2 launch type, any network mode can be used. If the network
- // mode is set to none, you can't specify port mappings in your container definitions,
- // and the task's containers do not have external connectivity. The host and
- // awsvpc network modes offer the highest networking performance for containers
- // because they use the EC2 network stack instead of the virtualized network
- // stack provided by the bridge mode.
+ // is bridge. If you are using the Fargate launch type, the awsvpc network mode
+ // is required. If you are using the EC2 launch type, any network mode can be
+ // used. If the network mode is set to none, you cannot specify port mappings
+ // in your container definitions, and the tasks containers do not have external
+ // connectivity. The host and awsvpc network modes offer the highest networking
+ // performance for containers because they use the EC2 network stack instead
+ // of the virtualized network stack provided by the bridge mode.
//
// With the host and awsvpc network modes, exposed container ports are mapped
// directly to the corresponding host port (for the host network mode) or the
// attached elastic network interface port (for the awsvpc network mode), so
// you cannot take advantage of dynamic host port mappings.
//
- // If the network mode is awsvpc, the task is allocated an Elastic Network Interface,
- // and you must specify a NetworkConfiguration when you create a service or
- // run a task with the task definition. For more information, see Task Networking
- // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+ // If the network mode is awsvpc, the task is allocated an elastic network interface,
+ // and you must specify a NetworkConfiguration value when you create a service
+ // or run a task with the task definition. For more information, see Task Networking
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
//
- // If the network mode is host, you can't run multiple instantiations of the
+ // Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with
+ // the ecs-init package, or AWS Fargate infrastructure support the awsvpc network
+ // mode.
+ //
+ // If the network mode is host, you cannot run multiple instantiations of the
// same task on a single container instance when port mappings are used.
//
// Docker for Windows uses different network modes than Docker for Linux. When
// you register a task definition with Windows containers, you must not specify
- // a network mode.
+ // a network mode. If you use the console to register a task definition with
+ // Windows containers, you must choose the network mode object.
//
// For more information, see Network settings (https://docs.docker.com/engine/reference/run/#network-settings)
// in the Docker run reference.
NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"`
+ // The process namespace to use for the containers in the task. The valid values
+ // are host or task. If host is specified, then all containers within the tasks
+ // that specified the host PID mode on the same container instance share the
+ // same IPC resources with the host Amazon EC2 instance. If task is specified,
+ // all containers within the specified task share the same process namespace.
+ // If no value is specified, the default is a private namespace. For more information,
+ // see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid)
+ // in the Docker run reference.
+ //
+ // If the host PID mode is used, be aware that there is a heightened risk of
+ // undesired process namespace expose. For more information, see Docker security
+ // (https://docs.docker.com/engine/security/security/).
+ //
+ // This parameter is not supported for Windows containers or tasks using the
+ // Fargate launch type.
+ PidMode *string `locationName:"pidMode" type:"string" enum:"PidMode"`
+
// An array of placement constraint objects to use for the task. You can specify
// a maximum of 10 constraints per task (this limit includes constraints in
- // the task definition and those specified at run time).
+ // the task definition and those specified at runtime).
PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"`
+ // The configuration details for the App Mesh proxy.
+ //
+ // For tasks using the EC2 launch type, the container instances require at least
+ // version 1.26.0 of the container agent and at least version 1.26.0-1 of the
+ // ecs-init package to enable a proxy configuration. If your container instances
+ // are launched from the Amazon ECS-optimized AMI version 20190301 or later,
+ // then they contain the required versions of the container agent and ecs-init.
+ // For more information, see Amazon ECS-optimized Linux AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ //
+ // For tasks using the Fargate launch type, the task or service requires platform
+ // version 1.3.0 or later.
+ ProxyConfiguration *ProxyConfiguration `locationName:"proxyConfiguration" type:"structure"`
+
// The launch type required by the task. If no value is specified, it defaults
// to EC2.
RequiresCompatibilities []*string `locationName:"requiresCompatibilities" type:"list"`
+ // The metadata that you apply to the task definition to help you categorize
+ // and organize them. Each tag consists of a key and an optional value, both
+ // of which you define. Tag keys can have a maximum character length of 128
+ // characters, and tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The short name or full Amazon Resource Name (ARN) of the IAM role that containers
// in this task can assume. All containers in this task are granted the permissions
// that are specified in this role. For more information, see IAM Roles for
- // Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
+ // Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
// in the Amazon Elastic Container Service Developer Guide.
TaskRoleArn *string `locationName:"taskRoleArn" type:"string"`
@@ -8469,6 +11942,21 @@ func (s *RegisterTaskDefinitionInput) Validate() error {
}
}
}
+ if s.ProxyConfiguration != nil {
+ if err := s.ProxyConfiguration.Validate(); err != nil {
+ invalidParams.AddNested("ProxyConfiguration", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8500,6 +11988,12 @@ func (s *RegisterTaskDefinitionInput) SetFamily(v string) *RegisterTaskDefinitio
return s
}
+// SetIpcMode sets the IpcMode field's value.
+func (s *RegisterTaskDefinitionInput) SetIpcMode(v string) *RegisterTaskDefinitionInput {
+ s.IpcMode = &v
+ return s
+}
+
// SetMemory sets the Memory field's value.
func (s *RegisterTaskDefinitionInput) SetMemory(v string) *RegisterTaskDefinitionInput {
s.Memory = &v
@@ -8512,18 +12006,36 @@ func (s *RegisterTaskDefinitionInput) SetNetworkMode(v string) *RegisterTaskDefi
return s
}
+// SetPidMode sets the PidMode field's value.
+func (s *RegisterTaskDefinitionInput) SetPidMode(v string) *RegisterTaskDefinitionInput {
+ s.PidMode = &v
+ return s
+}
+
// SetPlacementConstraints sets the PlacementConstraints field's value.
func (s *RegisterTaskDefinitionInput) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *RegisterTaskDefinitionInput {
s.PlacementConstraints = v
return s
}
+// SetProxyConfiguration sets the ProxyConfiguration field's value.
+func (s *RegisterTaskDefinitionInput) SetProxyConfiguration(v *ProxyConfiguration) *RegisterTaskDefinitionInput {
+ s.ProxyConfiguration = v
+ return s
+}
+
// SetRequiresCompatibilities sets the RequiresCompatibilities field's value.
func (s *RegisterTaskDefinitionInput) SetRequiresCompatibilities(v []*string) *RegisterTaskDefinitionInput {
s.RequiresCompatibilities = v
return s
}
+// SetTags sets the Tags field's value.
+func (s *RegisterTaskDefinitionInput) SetTags(v []*Tag) *RegisterTaskDefinitionInput {
+ s.Tags = v
+ return s
+}
+
// SetTaskRoleArn sets the TaskRoleArn field's value.
func (s *RegisterTaskDefinitionInput) SetTaskRoleArn(v string) *RegisterTaskDefinitionInput {
s.TaskRoleArn = &v
@@ -8539,6 +12051,9 @@ func (s *RegisterTaskDefinitionInput) SetVolumes(v []*Volume) *RegisterTaskDefin
type RegisterTaskDefinitionOutput struct {
_ struct{} `type:"structure"`
+ // The list of tags associated with the task definition.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The full description of the registered task definition.
TaskDefinition *TaskDefinition `locationName:"taskDefinition" type:"structure"`
}
@@ -8553,12 +12068,63 @@ func (s RegisterTaskDefinitionOutput) GoString() string {
return s.String()
}
+// SetTags sets the Tags field's value.
+func (s *RegisterTaskDefinitionOutput) SetTags(v []*Tag) *RegisterTaskDefinitionOutput {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *RegisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *RegisterTaskDefinitionOutput {
s.TaskDefinition = v
return s
}
+// The repository credentials for private registry authentication.
+type RepositoryCredentials struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the secret containing the private repository
+ // credentials.
+ //
+ // When you are using the Amazon ECS API, AWS CLI, or AWS SDK, if the secret
+ // exists in the same Region as the task that you are launching then you can
+ // use either the full ARN or the name of the secret. When you are using the
+ // AWS Management Console, you must specify the full ARN of the secret.
+ //
+ // CredentialsParameter is a required field
+ CredentialsParameter *string `locationName:"credentialsParameter" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s RepositoryCredentials) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RepositoryCredentials) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *RepositoryCredentials) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "RepositoryCredentials"}
+ if s.CredentialsParameter == nil {
+ invalidParams.Add(request.NewErrParamRequired("CredentialsParameter"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCredentialsParameter sets the CredentialsParameter field's value.
+func (s *RepositoryCredentials) SetCredentialsParameter(v string) *RepositoryCredentials {
+ s.CredentialsParameter = &v
+ return s
+}
+
// Describes the resources available for a container instance.
type Resource struct {
_ struct{} `type:"structure"`
@@ -8632,6 +12198,66 @@ func (s *Resource) SetType(v string) *Resource {
return s
}
+// The type and amount of a resource to assign to a container. The only supported
+// resource is a GPU. For more information, see Working with GPUs on Amazon
+// ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html)
+// in the Amazon Elastic Container Service Developer Guide
+type ResourceRequirement struct {
+ _ struct{} `type:"structure"`
+
+ // The type of resource to assign to a container. The only supported value is
+ // GPU.
+ //
+ // Type is a required field
+ Type *string `locationName:"type" type:"string" required:"true" enum:"ResourceType"`
+
+ // The number of physical GPUs the Amazon ECS container agent will reserve for
+ // the container. The number of GPUs reserved for all containers in a task should
+ // not exceed the number of available GPUs on the container instance the task
+ // is launched on.
+ //
+ // Value is a required field
+ Value *string `locationName:"value" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ResourceRequirement) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ResourceRequirement) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ResourceRequirement) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ResourceRequirement"}
+ if s.Type == nil {
+ invalidParams.Add(request.NewErrParamRequired("Type"))
+ }
+ if s.Value == nil {
+ invalidParams.Add(request.NewErrParamRequired("Value"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetType sets the Type field's value.
+func (s *ResourceRequirement) SetType(v string) *ResourceRequirement {
+ s.Type = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *ResourceRequirement) SetValue(v string) *ResourceRequirement {
+ s.Value = &v
+ return s
+}
+
type RunTaskInput struct {
_ struct{} `type:"structure"`
@@ -8644,17 +12270,24 @@ type RunTaskInput struct {
// You can specify up to 10 tasks per call.
Count *int64 `locationName:"count" type:"integer"`
+ // Specifies whether to enable Amazon ECS managed tags for the task. For more
+ // information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ EnableECSManagedTags *bool `locationName:"enableECSManagedTags" type:"boolean"`
+
// The name of the task group to associate with the task. The default value
// is the family name of the task definition (for example, family:my-family-name).
Group *string `locationName:"group" type:"string"`
- // The launch type on which to run your task.
+ // The launch type on which to run your task. For more information, see Amazon
+ // ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// The network configuration for the task. This parameter is required for task
- // definitions that use the awsvpc network mode to receive their own Elastic
- // Network Interface, and it is not supported for other network modes. For more
- // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+ // definitions that use the awsvpc network mode to receive their own elastic
+ // network interface, and it is not supported for other network modes. For more
+ // information, see Task Networking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
@@ -8672,18 +12305,30 @@ type RunTaskInput struct {
// An array of placement constraint objects to use for the task. You can specify
// up to 10 constraints per task (including constraints in the task definition
- // and those specified at run time).
+ // and those specified at runtime).
PlacementConstraints []*PlacementConstraint `locationName:"placementConstraints" type:"list"`
// The placement strategy objects to use for the task. You can specify a maximum
// of five strategy rules per task.
PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"`
- // The platform version on which to run your task. If one is not specified,
- // the latest version is used by default.
+ // The platform version the task should run. A platform version is only specified
+ // for tasks using the Fargate launch type. If one is not specified, the LATEST
+ // platform version is used by default. For more information, see AWS Fargate
+ // Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
- // An optional tag specified when a task is started. For example if you automatically
+ // Specifies whether to propagate the tags from the task definition to the task.
+ // If no value is specified, the tags are not propagated. Tags can only be propagated
+ // to the task during task creation. To add tags to a task after task creation,
+ // use the TagResource API action.
+ //
+ // An error will be received if you specify the SERVICE option when running
+ // a task.
+ PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"`
+
+ // An optional tag specified when a task is started. For example, if you automatically
// trigger a task to run a batch process job, you could apply a unique identifier
// for that job to your task with the startedBy parameter. You can then identify
// which tasks belong to that job by filtering the results of a ListTasks call
@@ -8694,6 +12339,12 @@ type RunTaskInput struct {
// contains the deployment ID of the service that starts it.
StartedBy *string `locationName:"startedBy" type:"string"`
+ // The metadata that you apply to the task to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The family and revision (family:revision) or full ARN of the task definition
// to run. If a revision is not specified, the latest ACTIVE revision is used.
//
@@ -8722,6 +12373,21 @@ func (s *RunTaskInput) Validate() error {
invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams))
}
}
+ if s.Overrides != nil {
+ if err := s.Overrides.Validate(); err != nil {
+ invalidParams.AddNested("Overrides", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8741,6 +12407,12 @@ func (s *RunTaskInput) SetCount(v int64) *RunTaskInput {
return s
}
+// SetEnableECSManagedTags sets the EnableECSManagedTags field's value.
+func (s *RunTaskInput) SetEnableECSManagedTags(v bool) *RunTaskInput {
+ s.EnableECSManagedTags = &v
+ return s
+}
+
// SetGroup sets the Group field's value.
func (s *RunTaskInput) SetGroup(v string) *RunTaskInput {
s.Group = &v
@@ -8783,12 +12455,24 @@ func (s *RunTaskInput) SetPlatformVersion(v string) *RunTaskInput {
return s
}
+// SetPropagateTags sets the PropagateTags field's value.
+func (s *RunTaskInput) SetPropagateTags(v string) *RunTaskInput {
+ s.PropagateTags = &v
+ return s
+}
+
// SetStartedBy sets the StartedBy field's value.
func (s *RunTaskInput) SetStartedBy(v string) *RunTaskInput {
s.StartedBy = &v
return s
}
+// SetTags sets the Tags field's value.
+func (s *RunTaskInput) SetTags(v []*Tag) *RunTaskInput {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *RunTaskInput) SetTaskDefinition(v string) *RunTaskInput {
s.TaskDefinition = &v
@@ -8828,6 +12512,111 @@ func (s *RunTaskOutput) SetTasks(v []*Task) *RunTaskOutput {
return s
}
+// A floating-point percentage of the desired number of tasks to place and keep
+// running in the task set.
+type Scale struct {
+ _ struct{} `type:"structure"`
+
+ // The unit of measure for the scale value.
+ Unit *string `locationName:"unit" type:"string" enum:"ScaleUnit"`
+
+ // The value, specified as a percent total of a service's desiredCount, to scale
+ // the task set. Accepted values are numbers between 0 and 100.
+ Value *float64 `locationName:"value" type:"double"`
+}
+
+// String returns the string representation
+func (s Scale) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Scale) GoString() string {
+ return s.String()
+}
+
+// SetUnit sets the Unit field's value.
+func (s *Scale) SetUnit(v string) *Scale {
+ s.Unit = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *Scale) SetValue(v float64) *Scale {
+ s.Value = &v
+ return s
+}
+
+// An object representing the secret to expose to your container. Secrets can
+// be exposed to a container in the following ways:
+//
+// * To inject sensitive data into your containers as environment variables,
+// use the secrets container definition parameter.
+//
+// * To reference sensitive information in the log configuration of a container,
+// use the secretOptions container definition parameter.
+//
+// For more information, see Specifying Sensitive Data (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html)
+// in the Amazon Elastic Container Service Developer Guide.
+type Secret struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the secret.
+ //
+ // Name is a required field
+ Name *string `locationName:"name" type:"string" required:"true"`
+
+ // The secret to expose to the container. The supported values are either the
+ // full ARN of the AWS Secrets Manager secret or the full ARN of the parameter
+ // in the AWS Systems Manager Parameter Store.
+ //
+ // If the AWS Systems Manager Parameter Store parameter exists in the same Region
+ // as the task you are launching, then you can use either the full ARN or name
+ // of the parameter. If the parameter exists in a different Region, then the
+ // full ARN must be specified.
+ //
+ // ValueFrom is a required field
+ ValueFrom *string `locationName:"valueFrom" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s Secret) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Secret) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Secret) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Secret"}
+ if s.Name == nil {
+ invalidParams.Add(request.NewErrParamRequired("Name"))
+ }
+ if s.ValueFrom == nil {
+ invalidParams.Add(request.NewErrParamRequired("ValueFrom"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetName sets the Name field's value.
+func (s *Secret) SetName(v string) *Secret {
+ s.Name = &v
+ return s
+}
+
+// SetValueFrom sets the ValueFrom field's value.
+func (s *Secret) SetValueFrom(v string) *Secret {
+ s.ValueFrom = &v
+ return s
+}
+
// Details on a service within a cluster
type Service struct {
_ struct{} `type:"structure"`
@@ -8835,13 +12624,19 @@ type Service struct {
// The Amazon Resource Name (ARN) of the cluster that hosts the service.
ClusterArn *string `locationName:"clusterArn" type:"string"`
- // The Unix time stamp for when the service was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the service was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The principal that created the service.
+ CreatedBy *string `locationName:"createdBy" type:"string"`
// Optional deployment parameters that control how many tasks run during the
// deployment and the ordering of stopping and starting tasks.
DeploymentConfiguration *DeploymentConfiguration `locationName:"deploymentConfiguration" type:"structure"`
+ // The deployment controller type the service is using.
+ DeploymentController *DeploymentController `locationName:"deploymentController" type:"structure"`
+
// The current state of deployments for the service.
Deployments []*Deployment `locationName:"deployments" type:"list"`
@@ -8850,6 +12645,11 @@ type Service struct {
// CreateService, and it can be modified with UpdateService.
DesiredCount *int64 `locationName:"desiredCount" type:"integer"`
+ // Specifies whether to enable Amazon ECS managed tags for the tasks in the
+ // service. For more information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ EnableECSManagedTags *bool `locationName:"enableECSManagedTags" type:"boolean"`
+
// The event stream for your service. A maximum of 100 of the latest events
// are displayed.
Events []*ServiceEvent `locationName:"events" type:"list"`
@@ -8859,7 +12659,10 @@ type Service struct {
// started.
HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"`
- // The launch type on which your service is running.
+ // The launch type on which your service is running. If no value is specified,
+ // it will default to EC2. Valid values include EC2 and FARGATE. For more information,
+ // see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
// A list of Elastic Load Balancing load balancer objects, containing the load
@@ -8868,14 +12671,14 @@ type Service struct {
//
// Services with tasks that use the awsvpc network mode (for example, those
// with the Fargate launch type) only support Application Load Balancers and
- // Network Load Balancers; Classic Load Balancers are not supported. Also, when
+ // Network Load Balancers. Classic Load Balancers are not supported. Also, when
// you create any target groups for these services, you must choose ip as the
- // target type, not instance, because tasks that use the awsvpc network mode
- // are associated with an elastic network interface, not an Amazon EC2 instance.
+ // target type, not instance. Tasks that use the awsvpc network mode are associated
+ // with an elastic network interface, not an Amazon EC2 instance.
LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"`
// The VPC subnet and security group configuration for tasks that receive their
- // own Elastic Network Interface by using the awsvpc networking mode.
+ // own elastic network interface by using the awsvpc networking mode.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
// The number of tasks in the cluster that are in the PENDING state.
@@ -8887,11 +12690,17 @@ type Service struct {
// The placement strategy that determines how tasks for the service are placed.
PlacementStrategy []*PlacementStrategy `locationName:"placementStrategy" type:"list"`
- // The platform version on which your task is running. For more information,
- // see AWS Fargate Platform Versions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // The platform version on which to run your service. A platform version is
+ // only specified for tasks using the Fargate launch type. If one is not specified,
+ // the LATEST platform version is used by default. For more information, see
+ // AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
// in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
+ // Specifies whether to propagate the tags from the task definition or the service
+ // to the task. If no value is specified, the tags are not propagated.
+ PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"`
+
// The ARN of the IAM role associated with the service that allows the Amazon
// ECS container agent to register container instances with an Elastic Load
// Balancing load balancer.
@@ -8900,26 +12709,56 @@ type Service struct {
// The number of tasks in the cluster that are in the RUNNING state.
RunningCount *int64 `locationName:"runningCount" type:"integer"`
+ // The scheduling strategy to use for the service. For more information, see
+ // Services (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
+ //
+ // There are two service scheduler strategies available:
+ //
+ // * REPLICA-The replica scheduling strategy places and maintains the desired
+ // number of tasks across your cluster. By default, the service scheduler
+ // spreads tasks across Availability Zones. You can use task placement strategies
+ // and constraints to customize task placement decisions.
+ //
+ // * DAEMON-The daemon scheduling strategy deploys exactly one task on each
+ // container instance in your cluster. When you are using this strategy,
+ // do not specify a desired number of tasks or any task placement strategies.
+ // Fargate tasks do not support the DAEMON scheduling strategy.
+ SchedulingStrategy *string `locationName:"schedulingStrategy" type:"string" enum:"SchedulingStrategy"`
+
// The ARN that identifies the service. The ARN contains the arn:aws:ecs namespace,
- // followed by the region of the service, the AWS account ID of the service
+ // followed by the Region of the service, the AWS account ID of the service
// owner, the service namespace, and then the service name. For example, arn:aws:ecs:region:012345678910:service/my-service.
ServiceArn *string `locationName:"serviceArn" type:"string"`
// The name of your service. Up to 255 letters (uppercase and lowercase), numbers,
- // hyphens, and underscores are allowed. Service names must be unique within
- // a cluster, but you can have similarly named services in multiple clusters
- // within a region or across multiple regions.
+ // and hyphens are allowed. Service names must be unique within a cluster, but
+ // you can have similarly named services in multiple clusters within a Region
+ // or across multiple Regions.
ServiceName *string `locationName:"serviceName" type:"string"`
+ // The details of the service discovery registries to assign to this service.
+ // For more information, see Service Discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"`
// The status of the service. The valid values are ACTIVE, DRAINING, or INACTIVE.
Status *string `locationName:"status" type:"string"`
+ // The metadata that you apply to the service to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The task definition to use for tasks in the service. This value is specified
// when the service is created with CreateService, and it can be modified with
// UpdateService.
TaskDefinition *string `locationName:"taskDefinition" type:"string"`
+
+ // Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+ // an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+ // desired number of tasks, how many tasks are running, and whether the task
+ // set serves production traffic.
+ TaskSets []*TaskSet `locationName:"taskSets" type:"list"`
}
// String returns the string representation
@@ -8944,12 +12783,24 @@ func (s *Service) SetCreatedAt(v time.Time) *Service {
return s
}
+// SetCreatedBy sets the CreatedBy field's value.
+func (s *Service) SetCreatedBy(v string) *Service {
+ s.CreatedBy = &v
+ return s
+}
+
// SetDeploymentConfiguration sets the DeploymentConfiguration field's value.
func (s *Service) SetDeploymentConfiguration(v *DeploymentConfiguration) *Service {
s.DeploymentConfiguration = v
return s
}
+// SetDeploymentController sets the DeploymentController field's value.
+func (s *Service) SetDeploymentController(v *DeploymentController) *Service {
+ s.DeploymentController = v
+ return s
+}
+
// SetDeployments sets the Deployments field's value.
func (s *Service) SetDeployments(v []*Deployment) *Service {
s.Deployments = v
@@ -8962,6 +12813,12 @@ func (s *Service) SetDesiredCount(v int64) *Service {
return s
}
+// SetEnableECSManagedTags sets the EnableECSManagedTags field's value.
+func (s *Service) SetEnableECSManagedTags(v bool) *Service {
+ s.EnableECSManagedTags = &v
+ return s
+}
+
// SetEvents sets the Events field's value.
func (s *Service) SetEvents(v []*ServiceEvent) *Service {
s.Events = v
@@ -9016,6 +12873,12 @@ func (s *Service) SetPlatformVersion(v string) *Service {
return s
}
+// SetPropagateTags sets the PropagateTags field's value.
+func (s *Service) SetPropagateTags(v string) *Service {
+ s.PropagateTags = &v
+ return s
+}
+
// SetRoleArn sets the RoleArn field's value.
func (s *Service) SetRoleArn(v string) *Service {
s.RoleArn = &v
@@ -9028,6 +12891,12 @@ func (s *Service) SetRunningCount(v int64) *Service {
return s
}
+// SetSchedulingStrategy sets the SchedulingStrategy field's value.
+func (s *Service) SetSchedulingStrategy(v string) *Service {
+ s.SchedulingStrategy = &v
+ return s
+}
+
// SetServiceArn sets the ServiceArn field's value.
func (s *Service) SetServiceArn(v string) *Service {
s.ServiceArn = &v
@@ -9052,18 +12921,30 @@ func (s *Service) SetStatus(v string) *Service {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Service) SetTags(v []*Tag) *Service {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *Service) SetTaskDefinition(v string) *Service {
s.TaskDefinition = &v
return s
}
+// SetTaskSets sets the TaskSets field's value.
+func (s *Service) SetTaskSets(v []*TaskSet) *Service {
+ s.TaskSets = v
+ return s
+}
+
// Details on an event associated with a service.
type ServiceEvent struct {
_ struct{} `type:"structure"`
- // The Unix time stamp for when the event was triggered.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the event was triggered.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The ID string of the event.
Id *string `locationName:"id" type:"string"`
@@ -9123,13 +13004,13 @@ type ServiceRegistry struct {
ContainerPort *int64 `locationName:"containerPort" type:"integer"`
// The port value used if your service discovery service specified an SRV record.
- // This field is required if both the awsvpc network mode and SRV records are
+ // This field may be used if both the awsvpc network mode and SRV records are
// used.
Port *int64 `locationName:"port" type:"integer"`
// The Amazon Resource Name (ARN) of the service registry. The currently supported
- // service registry is Amazon Route 53 Auto Naming. For more information, see
- // Service (https://docs.aws.amazon.com/Route53/latest/APIReference/API_autonaming_Service.html).
+ // service registry is AWS Cloud Map. For more information, see CreateService
+ // (https://docs.aws.amazon.com/cloud-map/latest/api/API_CreateService.html).
RegistryArn *string `locationName:"registryArn" type:"string"`
}
@@ -9167,6 +13048,49 @@ func (s *ServiceRegistry) SetRegistryArn(v string) *ServiceRegistry {
return s
}
+// The current account setting for a resource.
+type Setting struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon ECS resource name.
+ Name *string `locationName:"name" type:"string" enum:"SettingName"`
+
+ // The ARN of the principal, which can be an IAM user, IAM role, or the root
+ // user. If this field is omitted, the authenticated user is assumed.
+ PrincipalArn *string `locationName:"principalArn" type:"string"`
+
+ // Whether the account setting is enabled or disabled for the specified resource.
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s Setting) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Setting) GoString() string {
+ return s.String()
+}
+
+// SetName sets the Name field's value.
+func (s *Setting) SetName(v string) *Setting {
+ s.Name = &v
+ return s
+}
+
+// SetPrincipalArn sets the PrincipalArn field's value.
+func (s *Setting) SetPrincipalArn(v string) *Setting {
+ s.PrincipalArn = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *Setting) SetValue(v string) *Setting {
+ s.Value = &v
+ return s
+}
+
type StartTaskInput struct {
_ struct{} `type:"structure"`
@@ -9182,12 +13106,17 @@ type StartTaskInput struct {
// ContainerInstances is a required field
ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"`
+ // Specifies whether to enable Amazon ECS managed tags for the task. For more
+ // information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ EnableECSManagedTags *bool `locationName:"enableECSManagedTags" type:"boolean"`
+
// The name of the task group to associate with the task. The default value
// is the family name of the task definition (for example, family:my-family-name).
Group *string `locationName:"group" type:"string"`
// The VPC subnet and security group configuration for tasks that receive their
- // own Elastic Network Interface by using the awsvpc networking mode.
+ // own elastic network interface by using the awsvpc networking mode.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
// A list of container overrides in JSON format that specify the name of a container
@@ -9202,7 +13131,11 @@ type StartTaskInput struct {
// the JSON formatting characters of the override structure.
Overrides *TaskOverride `locationName:"overrides" type:"structure"`
- // An optional tag specified when a task is started. For example if you automatically
+ // Specifies whether to propagate the tags from the task definition or the service
+ // to the task. If no value is specified, the tags are not propagated.
+ PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"`
+
+ // An optional tag specified when a task is started. For example, if you automatically
// trigger a task to run a batch process job, you could apply a unique identifier
// for that job to your task with the startedBy parameter. You can then identify
// which tasks belong to that job by filtering the results of a ListTasks call
@@ -9213,6 +13146,12 @@ type StartTaskInput struct {
// contains the deployment ID of the service that starts it.
StartedBy *string `locationName:"startedBy" type:"string"`
+ // The metadata that you apply to the task to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The family and revision (family:revision) or full ARN of the task definition
// to start. If a revision is not specified, the latest ACTIVE revision is used.
//
@@ -9244,6 +13183,21 @@ func (s *StartTaskInput) Validate() error {
invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams))
}
}
+ if s.Overrides != nil {
+ if err := s.Overrides.Validate(); err != nil {
+ invalidParams.AddNested("Overrides", err.(request.ErrInvalidParams))
+ }
+ }
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9263,6 +13217,12 @@ func (s *StartTaskInput) SetContainerInstances(v []*string) *StartTaskInput {
return s
}
+// SetEnableECSManagedTags sets the EnableECSManagedTags field's value.
+func (s *StartTaskInput) SetEnableECSManagedTags(v bool) *StartTaskInput {
+ s.EnableECSManagedTags = &v
+ return s
+}
+
// SetGroup sets the Group field's value.
func (s *StartTaskInput) SetGroup(v string) *StartTaskInput {
s.Group = &v
@@ -9281,12 +13241,24 @@ func (s *StartTaskInput) SetOverrides(v *TaskOverride) *StartTaskInput {
return s
}
+// SetPropagateTags sets the PropagateTags field's value.
+func (s *StartTaskInput) SetPropagateTags(v string) *StartTaskInput {
+ s.PropagateTags = &v
+ return s
+}
+
// SetStartedBy sets the StartedBy field's value.
func (s *StartTaskInput) SetStartedBy(v string) *StartTaskInput {
s.StartedBy = &v
return s
}
+// SetTags sets the Tags field's value.
+func (s *StartTaskInput) SetTags(v []*Tag) *StartTaskInput {
+ s.Tags = v
+ return s
+}
+
// SetTaskDefinition sets the TaskDefinition field's value.
func (s *StartTaskInput) SetTaskDefinition(v string) *StartTaskInput {
s.TaskDefinition = &v
@@ -9340,7 +13312,7 @@ type StopTaskInput struct {
// API operations on this task. Up to 255 characters are allowed in this message.
Reason *string `locationName:"reason" type:"string"`
- // The task ID or full ARN entry of the task to stop.
+ // The task ID or full Amazon Resource Name (ARN) of the task to stop.
//
// Task is a required field
Task *string `locationName:"task" type:"string" required:"true"`
@@ -9410,6 +13382,87 @@ func (s *StopTaskOutput) SetTask(v *Task) *StopTaskOutput {
return s
}
+type SubmitAttachmentStateChangesInput struct {
+ _ struct{} `type:"structure"`
+
+ // Any attachments associated with the state change request.
+ //
+ // Attachments is a required field
+ Attachments []*AttachmentStateChange `locationName:"attachments" type:"list" required:"true"`
+
+ // The short name or full ARN of the cluster that hosts the container instance
+ // the attachment belongs to.
+ Cluster *string `locationName:"cluster" type:"string"`
+}
+
+// String returns the string representation
+func (s SubmitAttachmentStateChangesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SubmitAttachmentStateChangesInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *SubmitAttachmentStateChangesInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "SubmitAttachmentStateChangesInput"}
+ if s.Attachments == nil {
+ invalidParams.Add(request.NewErrParamRequired("Attachments"))
+ }
+ if s.Attachments != nil {
+ for i, v := range s.Attachments {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attachments", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAttachments sets the Attachments field's value.
+func (s *SubmitAttachmentStateChangesInput) SetAttachments(v []*AttachmentStateChange) *SubmitAttachmentStateChangesInput {
+ s.Attachments = v
+ return s
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *SubmitAttachmentStateChangesInput) SetCluster(v string) *SubmitAttachmentStateChangesInput {
+ s.Cluster = &v
+ return s
+}
+
+type SubmitAttachmentStateChangesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Acknowledgement of the state change.
+ Acknowledgment *string `locationName:"acknowledgment" type:"string"`
+}
+
+// String returns the string representation
+func (s SubmitAttachmentStateChangesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SubmitAttachmentStateChangesOutput) GoString() string {
+ return s.String()
+}
+
+// SetAcknowledgment sets the Acknowledgment field's value.
+func (s *SubmitAttachmentStateChangesOutput) SetAcknowledgment(v string) *SubmitAttachmentStateChangesOutput {
+ s.Acknowledgment = &v
+ return s
+}
+
type SubmitContainerStateChangeInput struct {
_ struct{} `type:"structure"`
@@ -9524,14 +13577,14 @@ type SubmitTaskStateChangeInput struct {
// Any containers associated with the state change request.
Containers []*ContainerStateChange `locationName:"containers" type:"list"`
- // The Unix time stamp for when the task execution stopped.
- ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the task execution stopped.
+ ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp"`
- // The Unix time stamp for when the container image pull began.
- PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the container image pull began.
+ PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp"`
- // The Unix time stamp for when the container image pull completed.
- PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the container image pull completed.
+ PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp"`
// The reason for the state change request.
Reason *string `locationName:"reason" type:"string"`
@@ -9650,6 +13703,186 @@ func (s *SubmitTaskStateChangeOutput) SetAcknowledgment(v string) *SubmitTaskSta
return s
}
+// A list of namespaced kernel parameters to set in the container. This parameter
+// maps to Sysctls in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate)
+// section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/)
+// and the --sysctl option to docker run (https://docs.docker.com/engine/reference/run/).
+//
+// It is not recommended that you specify network-related systemControls parameters
+// for multiple containers in a single task that also uses either the awsvpc
+// or host network mode for the following reasons:
+//
+// * For tasks that use the awsvpc network mode, if you set systemControls
+// for any container, it applies to all containers in the task. If you set
+// different systemControls for multiple containers in a single task, the
+// container that is started last determines which systemControls take effect.
+//
+// * For tasks that use the host network mode, the systemControls parameter
+// applies to the container instance's kernel parameter as well as that of
+// all containers of any tasks running on that container instance.
+type SystemControl struct {
+ _ struct{} `type:"structure"`
+
+ // The namespaced kernel parameter for which to set a value.
+ Namespace *string `locationName:"namespace" type:"string"`
+
+ // The value for the namespaced kernel parameter specified in namespace.
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s SystemControl) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s SystemControl) GoString() string {
+ return s.String()
+}
+
+// SetNamespace sets the Namespace field's value.
+func (s *SystemControl) SetNamespace(v string) *SystemControl {
+ s.Namespace = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *SystemControl) SetValue(v string) *SystemControl {
+ s.Value = &v
+ return s
+}
+
+// The metadata that you apply to a resource to help you categorize and organize
+// them. Each tag consists of a key and an optional value, both of which you
+// define. Tag keys can have a maximum character length of 128 characters, and
+// tag values can have a maximum length of 256 characters.
+type Tag struct {
+ _ struct{} `type:"structure"`
+
+ // One part of a key-value pair that make up a tag. A key is a general label
+ // that acts like a category for more specific tag values.
+ Key *string `locationName:"key" min:"1" type:"string"`
+
+ // The optional part of a key-value pair that make up a tag. A value acts as
+ // a descriptor within a tag category (key).
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s Tag) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Tag) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *Tag) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "Tag"}
+ if s.Key != nil && len(*s.Key) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Key", 1))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetKey sets the Key field's value.
+func (s *Tag) SetKey(v string) *Tag {
+ s.Key = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *Tag) SetValue(v string) *Tag {
+ s.Value = &v
+ return s
+}
+
+type TagResourceInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the resource to which to add tags. Currently,
+ // the supported resources are Amazon ECS tasks, services, task definitions,
+ // clusters, and container instances.
+ //
+ // ResourceArn is a required field
+ ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"`
+
+ // The tags to add to the resource. A tag is an array of key-value pairs. Tag
+ // keys can have a maximum character length of 128 characters, and tag values
+ // can have a maximum length of 256 characters.
+ //
+ // Tags is a required field
+ Tags []*Tag `locationName:"tags" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s TagResourceInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TagResourceInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TagResourceInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"}
+ if s.ResourceArn == nil {
+ invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
+ }
+ if s.Tags == nil {
+ invalidParams.Add(request.NewErrParamRequired("Tags"))
+ }
+ if s.Tags != nil {
+ for i, v := range s.Tags {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetResourceArn sets the ResourceArn field's value.
+func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput {
+ s.ResourceArn = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput {
+ s.Tags = v
+ return s
+}
+
+type TagResourceOutput struct {
+ _ struct{} `type:"structure"`
+}
+
+// String returns the string representation
+func (s TagResourceOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TagResourceOutput) GoString() string {
+ return s.String()
+}
+
// Details on a task in a cluster.
type Task struct {
_ struct{} `type:"structure"`
@@ -9664,8 +13897,8 @@ type Task struct {
// The connectivity status of a task.
Connectivity *string `locationName:"connectivity" type:"string" enum:"Connectivity"`
- // The Unix time stamp for when the task last went into CONNECTED status.
- ConnectivityAt *time.Time `locationName:"connectivityAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the task last went into CONNECTED status.
+ ConnectivityAt *time.Time `locationName:"connectivityAt" type:"timestamp"`
// The ARN of the container instances that host the task.
ContainerInstanceArn *string `locationName:"containerInstanceArn" type:"string"`
@@ -9673,17 +13906,18 @@ type Task struct {
// The containers associated with the task.
Containers []*Container `locationName:"containers" type:"list"`
- // The number of CPU units used by the task. It can be expressed as an integer
- // using CPU units, for example 1024, or as a string using vCPUs, for example
- // 1 vCPU or 1 vcpu, in a task definition but is converted to an integer indicating
- // the CPU units when the task definition is registered.
+ // The number of CPU units used by the task as expressed in a task definition.
+ // It can be expressed as an integer using CPU units, for example 1024. It can
+ // also be expressed as a string using vCPUs, for example 1 vCPU or 1 vcpu.
+ // String values are converted to an integer indicating the CPU units when the
+ // task definition is registered.
//
- // If using the EC2 launch type, this field is optional. Supported values are
- // between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs).
+ // If you are using the EC2 launch type, this field is optional. Supported values
+ // are between 128 CPU units (0.125 vCPUs) and 10240 CPU units (10 vCPUs).
//
- // If using the Fargate launch type, this field is required and you must use
- // one of the following values, which determines your range of supported values
- // for the memory parameter:
+ // If you are using the Fargate launch type, this field is required and you
+ // must use one of the following values, which determines your range of supported
+ // values for the memory parameter:
//
// * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB),
// 2048 (2 GB)
@@ -9701,15 +13935,16 @@ type Task struct {
// (30 GB) in increments of 1024 (1 GB)
Cpu *string `locationName:"cpu" type:"string"`
- // The Unix time stamp for when the task was created (the task entered the PENDING
+ // The Unix timestamp for when the task was created (the task entered the PENDING
// state).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
- // The desired status of the task.
+ // The desired status of the task. For more information, see Task Lifecycle
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle.html).
DesiredStatus *string `locationName:"desiredStatus" type:"string"`
- // The Unix time stamp for when the task execution stopped.
- ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the task execution stopped.
+ ExecutionStoppedAt *time.Time `locationName:"executionStoppedAt" type:"timestamp"`
// The name of the task group associated with the task.
Group *string `locationName:"group" type:"string"`
@@ -9727,22 +13962,26 @@ type Task struct {
// override any Docker health checks that exist in the container image.
HealthStatus *string `locationName:"healthStatus" type:"string" enum:"HealthStatus"`
- // The last known status of the task.
+ // The last known status of the task. For more information, see Task Lifecycle
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle.html).
LastStatus *string `locationName:"lastStatus" type:"string"`
- // The launch type on which your task is running.
+ // The launch type on which your task is running. For more information, see
+ // Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
- // The amount of memory (in MiB) used by the task. It can be expressed as an
- // integer using MiB, for example 1024, or as a string using GB, for example
- // 1GB or 1 GB, in a task definition but is converted to an integer indicating
- // the MiB when the task definition is registered.
+ // The amount of memory (in MiB) used by the task as expressed in a task definition.
+ // It can be expressed as an integer using MiB, for example 1024. It can also
+ // be expressed as a string using GB, for example 1GB or 1 GB. String values
+ // are converted to an integer indicating the MiB when the task definition is
+ // registered.
//
- // If using the EC2 launch type, this field is optional.
+ // If you are using the EC2 launch type, this field is optional.
//
- // If using the Fargate launch type, this field is required and you must use
- // one of the following values, which determines your range of supported values
- // for the cpu parameter:
+ // If you are using the Fargate launch type, this field is required and you
+ // must use one of the following values, which determines your range of supported
+ // values for the cpu parameter:
//
// * 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25
// vCPU)
@@ -9763,36 +14002,48 @@ type Task struct {
// One or more container overrides.
Overrides *TaskOverride `locationName:"overrides" type:"structure"`
- // The platform version on which your task is running. For more information,
- // see AWS Fargate Platform Versions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // The platform version on which your task is running. A platform version is
+ // only specified for tasks using the Fargate launch type. If one is not specified,
+ // the LATEST platform version is used by default. For more information, see
+ // AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
// in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
- // The Unix time stamp for when the container image pull began.
- PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the container image pull began.
+ PullStartedAt *time.Time `locationName:"pullStartedAt" type:"timestamp"`
- // The Unix time stamp for when the container image pull completed.
- PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp" timestampFormat:"unix"`
+ // The Unix timestamp for when the container image pull completed.
+ PullStoppedAt *time.Time `locationName:"pullStoppedAt" type:"timestamp"`
- // The Unix time stamp for when the task started (the task transitioned from
+ // The Unix timestamp for when the task started (the task transitioned from
// the PENDING state to the RUNNING state).
- StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"unix"`
+ StartedAt *time.Time `locationName:"startedAt" type:"timestamp"`
// The tag specified when a task is started. If the task is started by an Amazon
// ECS service, then the startedBy parameter contains the deployment ID of the
// service that starts it.
StartedBy *string `locationName:"startedBy" type:"string"`
- // The Unix time stamp for when the task was stopped (the task transitioned
- // from the RUNNING state to the STOPPED state).
- StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"unix"`
+ // The stop code indicating why a task was stopped. The stoppedReason may contain
+ // additional details.
+ StopCode *string `locationName:"stopCode" type:"string" enum:"TaskStopCode"`
- // The reason the task was stopped.
+ // The Unix timestamp for when the task was stopped (the task transitioned from
+ // the RUNNING state to the STOPPED state).
+ StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp"`
+
+ // The reason that the task was stopped.
StoppedReason *string `locationName:"stoppedReason" type:"string"`
- // The Unix time stamp for when the task will stop (transitions from the RUNNING
+ // The Unix timestamp for when the task stops (transitions from the RUNNING
// state to STOPPED).
- StoppingAt *time.Time `locationName:"stoppingAt" type:"timestamp" timestampFormat:"unix"`
+ StoppingAt *time.Time `locationName:"stoppingAt" type:"timestamp"`
+
+ // The metadata that you apply to the task to help you categorize and organize
+ // them. Each tag consists of a key and an optional value, both of which you
+ // define. Tag keys can have a maximum character length of 128 characters, and
+ // tag values can have a maximum length of 256 characters.
+ Tags []*Tag `locationName:"tags" type:"list"`
// The Amazon Resource Name (ARN) of the task.
TaskArn *string `locationName:"taskArn" type:"string"`
@@ -9803,9 +14054,9 @@ type Task struct {
// The version counter for the task. Every time a task experiences a change
// that triggers a CloudWatch event, the version counter is incremented. If
// you are replicating your Amazon ECS task state with CloudWatch Events, you
- // can compare the version of a task reported by the Amazon ECS APIs with the
- // version reported in CloudWatch Events for the task (inside the detail object)
- // to verify that the version in your event stream is current.
+ // can compare the version of a task reported by the Amazon ECS API actionss
+ // with the version reported in CloudWatch Events for the task (inside the detail
+ // object) to verify that the version in your event stream is current.
Version *int64 `locationName:"version" type:"long"`
}
@@ -9945,6 +14196,12 @@ func (s *Task) SetStartedBy(v string) *Task {
return s
}
+// SetStopCode sets the StopCode field's value.
+func (s *Task) SetStopCode(v string) *Task {
+ s.StopCode = &v
+ return s
+}
+
// SetStoppedAt sets the StoppedAt field's value.
func (s *Task) SetStoppedAt(v time.Time) *Task {
s.StoppedAt = &v
@@ -9963,6 +14220,12 @@ func (s *Task) SetStoppingAt(v time.Time) *Task {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Task) SetTags(v []*Tag) *Task {
+ s.Tags = v
+ return s
+}
+
// SetTaskArn sets the TaskArn field's value.
func (s *Task) SetTaskArn(v string) *Task {
s.TaskArn = &v
@@ -9981,25 +14244,30 @@ func (s *Task) SetVersion(v int64) *Task {
return s
}
-// Details of a task definition.
+// The details of a task definition which describes the container and volume
+// definitions of an Amazon Elastic Container Service task. You can specify
+// which Docker images to use, the required resources, and other configurations
+// related to launching the task definition through an Amazon ECS service or
+// task.
type TaskDefinition struct {
_ struct{} `type:"structure"`
// The launch type to use with your task. For more information, see Amazon ECS
- // Launch Types (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
// in the Amazon Elastic Container Service Developer Guide.
Compatibilities []*string `locationName:"compatibilities" type:"list"`
// A list of container definitions in JSON format that describe the different
// containers that make up your task. For more information about container definition
- // parameters and defaults, see Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html)
+ // parameters and defaults, see Amazon ECS Task Definitions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html)
// in the Amazon Elastic Container Service Developer Guide.
ContainerDefinitions []*ContainerDefinition `locationName:"containerDefinitions" type:"list"`
- // The number of cpu units used by the task. If using the EC2 launch type, this
- // field is optional and any value can be used. If using the Fargate launch
- // type, this field is required and you must use one of the following values,
- // which determines your range of valid values for the memory parameter:
+ // The number of cpu units used by the task. If you are using the EC2 launch
+ // type, this field is optional and any value can be used. If you are using
+ // the Fargate launch type, this field is required and you must use one of the
+ // following values, which determines your range of valid values for the memory
+ // parameter:
//
// * 256 (.25 vCPU) - Available memory values: 512 (0.5 GB), 1024 (1 GB),
// 2048 (2 GB)
@@ -10017,13 +14285,48 @@ type TaskDefinition struct {
// (30 GB) in increments of 1024 (1 GB)
Cpu *string `locationName:"cpu" type:"string"`
- // The Amazon Resource Name (ARN) of the task execution role that the Amazon
- // ECS container agent and the Docker daemon can assume.
+ // The Amazon Resource Name (ARN) of the task execution role that containers
+ // in this task can assume. All containers in this task are granted the permissions
+ // that are specified in this role.
ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"`
- // The family of your task definition, used as the definition name.
+ // The name of a family that this task definition is registered to. A family
+ // groups multiple versions of a task definition. Amazon ECS gives the first
+ // task definition that you registered to a family a revision number of 1. Amazon
+ // ECS gives sequential revision numbers to each task definition that you add.
Family *string `locationName:"family" type:"string"`
+ // The IPC resource namespace to use for the containers in the task. The valid
+ // values are host, task, or none. If host is specified, then all containers
+ // within the tasks that specified the host IPC mode on the same container instance
+ // share the same IPC resources with the host Amazon EC2 instance. If task is
+ // specified, all containers within the specified task share the same IPC resources.
+ // If none is specified, then IPC resources within the containers of a task
+ // are private and not shared with other containers in a task or on the container
+ // instance. If no value is specified, then the IPC resource namespace sharing
+ // depends on the Docker daemon setting on the container instance. For more
+ // information, see IPC settings (https://docs.docker.com/engine/reference/run/#ipc-settings---ipc)
+ // in the Docker run reference.
+ //
+ // If the host IPC mode is used, be aware that there is a heightened risk of
+ // undesired IPC namespace expose. For more information, see Docker security
+ // (https://docs.docker.com/engine/security/security/).
+ //
+ // If you are setting namespaced kernel parameters using systemControls for
+ // the containers in the task, the following will apply to your IPC resource
+ // namespace. For more information, see System Controls (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ //
+ // * For tasks that use the host IPC mode, IPC namespace related systemControls
+ // are not supported.
+ //
+ // * For tasks that use the task IPC mode, IPC namespace related systemControls
+ // will apply to all containers within a task.
+ //
+ // This parameter is not supported for Windows containers or tasks using the
+ // Fargate launch type.
+ IpcMode *string `locationName:"ipcMode" type:"string" enum:"IpcMode"`
+
// The amount (in MiB) of memory used by the task. If using the EC2 launch type,
// this field is optional and any value can be used. If using the Fargate launch
// type, this field is required and you must use one of the following values,
@@ -10047,30 +14350,30 @@ type TaskDefinition struct {
// The Docker networking mode to use for the containers in the task. The valid
// values are none, bridge, awsvpc, and host. The default Docker network mode
- // is bridge. If using the Fargate launch type, the awsvpc network mode is required.
- // If using the EC2 launch type, any network mode can be used. If the network
- // mode is set to none, you can't specify port mappings in your container definitions,
- // and the task's containers do not have external connectivity. The host and
- // awsvpc network modes offer the highest networking performance for containers
- // because they use the EC2 network stack instead of the virtualized network
- // stack provided by the bridge mode.
+ // is bridge. If you are using the Fargate launch type, the awsvpc network mode
+ // is required. If you are using the EC2 launch type, any network mode can be
+ // used. If the network mode is set to none, you cannot specify port mappings
+ // in your container definitions, and the tasks containers do not have external
+ // connectivity. The host and awsvpc network modes offer the highest networking
+ // performance for containers because they use the EC2 network stack instead
+ // of the virtualized network stack provided by the bridge mode.
//
// With the host and awsvpc network modes, exposed container ports are mapped
// directly to the corresponding host port (for the host network mode) or the
// attached elastic network interface port (for the awsvpc network mode), so
// you cannot take advantage of dynamic host port mappings.
//
- // If the network mode is awsvpc, the task is allocated an Elastic Network Interface,
- // and you must specify a NetworkConfiguration when you create a service or
- // run a task with the task definition. For more information, see Task Networking
- // (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+ // If the network mode is awsvpc, the task is allocated an elastic network interface,
+ // and you must specify a NetworkConfiguration value when you create a service
+ // or run a task with the task definition. For more information, see Task Networking
+ // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
//
- // Currently, only the Amazon ECS-optimized AMI, other Amazon Linux variants
- // with the ecs-init package, or AWS Fargate infrastructure support the awsvpc
- // network mode.
+ // Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants with
+ // the ecs-init package, or AWS Fargate infrastructure support the awsvpc network
+ // mode.
//
- // If the network mode is host, you can't run multiple instantiations of the
+ // If the network mode is host, you cannot run multiple instantiations of the
// same task on a single container instance when port mappings are used.
//
// Docker for Windows uses different network modes than Docker for Linux. When
@@ -10082,22 +14385,52 @@ type TaskDefinition struct {
// in the Docker run reference.
NetworkMode *string `locationName:"networkMode" type:"string" enum:"NetworkMode"`
+ // The process namespace to use for the containers in the task. The valid values
+ // are host or task. If host is specified, then all containers within the tasks
+ // that specified the host PID mode on the same container instance share the
+ // same IPC resources with the host Amazon EC2 instance. If task is specified,
+ // all containers within the specified task share the same process namespace.
+ // If no value is specified, the default is a private namespace. For more information,
+ // see PID settings (https://docs.docker.com/engine/reference/run/#pid-settings---pid)
+ // in the Docker run reference.
+ //
+ // If the host PID mode is used, be aware that there is a heightened risk of
+ // undesired process namespace expose. For more information, see Docker security
+ // (https://docs.docker.com/engine/security/security/).
+ //
+ // This parameter is not supported for Windows containers or tasks using the
+ // Fargate launch type.
+ PidMode *string `locationName:"pidMode" type:"string" enum:"PidMode"`
+
// An array of placement constraint objects to use for tasks. This field is
- // not valid if using the Fargate launch type for your task.
+ // not valid if you are using the Fargate launch type for your task.
PlacementConstraints []*TaskDefinitionPlacementConstraint `locationName:"placementConstraints" type:"list"`
+ // The configuration details for the App Mesh proxy.
+ //
+ // Your Amazon ECS container instances require at least version 1.26.0 of the
+ // container agent and at least version 1.26.0-1 of the ecs-init package to
+ // enable a proxy configuration. If your container instances are launched from
+ // the Amazon ECS-optimized AMI version 20190301 or later, then they contain
+ // the required versions of the container agent and ecs-init. For more information,
+ // see Amazon ECS-optimized Linux AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ ProxyConfiguration *ProxyConfiguration `locationName:"proxyConfiguration" type:"structure"`
+
// The container instance attributes required by your task. This field is not
- // valid if using the Fargate launch type for your task.
+ // valid if you are using the Fargate launch type for your task.
RequiresAttributes []*Attribute `locationName:"requiresAttributes" type:"list"`
- // The launch type the task is using.
+ // The launch type the task requires. If no value is specified, it will default
+ // to EC2. Valid values include EC2 and FARGATE.
RequiresCompatibilities []*string `locationName:"requiresCompatibilities" type:"list"`
// The revision of the task in a particular family. The revision is a version
// number of a task definition in a family. When you register a task definition
- // for the first time, the revision is 1; each time you register a new revision
- // of a task definition in the same family, the revision value always increases
- // by one (even if you have deregistered previous revisions in this family).
+ // for the first time, the revision is 1. Each time that you register a new
+ // revision of a task definition in the same family, the revision value always
+ // increases by one, even if you have deregistered previous revisions in this
+ // family.
Revision *int64 `locationName:"revision" type:"integer"`
// The status of the task definition.
@@ -10106,23 +14439,25 @@ type TaskDefinition struct {
// The full Amazon Resource Name (ARN) of the task definition.
TaskDefinitionArn *string `locationName:"taskDefinitionArn" type:"string"`
- // The ARN of the IAM role that containers in this task can assume. All containers
- // in this task are granted the permissions that are specified in this role.
+ // The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM)
+ // role that grants containers in the task permission to call AWS APIs on your
+ // behalf. For more information, see Amazon ECS Task Role (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_IAM_role.html)
+ // in the Amazon Elastic Container Service Developer Guide.
//
// IAM roles for tasks on Windows require that the -EnableTaskIAMRole option
// is set when you launch the Amazon ECS-optimized Windows AMI. Your containers
// must also run some configuration code in order to take advantage of the feature.
- // For more information, see Windows IAM Roles for Tasks (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html)
+ // For more information, see Windows IAM Roles for Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows_task_IAM_roles.html)
// in the Amazon Elastic Container Service Developer Guide.
TaskRoleArn *string `locationName:"taskRoleArn" type:"string"`
- // The list of volumes in a task.
+ // The list of volume definitions for the task.
//
- // If you are using the Fargate launch type, the host and sourcePath parameters
- // are not supported.
+ // If your tasks are using the Fargate launch type, the host and sourcePath
+ // parameters are not supported.
//
// For more information about volume definition parameters and defaults, see
- // Amazon ECS Task Definitions (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
+ // Amazon ECS Task Definitions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html)
// in the Amazon Elastic Container Service Developer Guide.
Volumes []*Volume `locationName:"volumes" type:"list"`
}
@@ -10167,6 +14502,12 @@ func (s *TaskDefinition) SetFamily(v string) *TaskDefinition {
return s
}
+// SetIpcMode sets the IpcMode field's value.
+func (s *TaskDefinition) SetIpcMode(v string) *TaskDefinition {
+ s.IpcMode = &v
+ return s
+}
+
// SetMemory sets the Memory field's value.
func (s *TaskDefinition) SetMemory(v string) *TaskDefinition {
s.Memory = &v
@@ -10179,12 +14520,24 @@ func (s *TaskDefinition) SetNetworkMode(v string) *TaskDefinition {
return s
}
+// SetPidMode sets the PidMode field's value.
+func (s *TaskDefinition) SetPidMode(v string) *TaskDefinition {
+ s.PidMode = &v
+ return s
+}
+
// SetPlacementConstraints sets the PlacementConstraints field's value.
func (s *TaskDefinition) SetPlacementConstraints(v []*TaskDefinitionPlacementConstraint) *TaskDefinition {
s.PlacementConstraints = v
return s
}
+// SetProxyConfiguration sets the ProxyConfiguration field's value.
+func (s *TaskDefinition) SetProxyConfiguration(v *ProxyConfiguration) *TaskDefinition {
+ s.ProxyConfiguration = v
+ return s
+}
+
// SetRequiresAttributes sets the RequiresAttributes field's value.
func (s *TaskDefinition) SetRequiresAttributes(v []*Attribute) *TaskDefinition {
s.RequiresAttributes = v
@@ -10232,13 +14585,13 @@ func (s *TaskDefinition) SetVolumes(v []*Volume) *TaskDefinition {
// If you are using the Fargate launch type, task placement constraints are
// not supported.
//
-// For more information, see Task Placement Constraints (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html)
+// For more information, see Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html)
// in the Amazon Elastic Container Service Developer Guide.
type TaskDefinitionPlacementConstraint struct {
_ struct{} `type:"structure"`
// A cluster query language expression to apply to the constraint. For more
- // information, see Cluster Query Language (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
+ // information, see Cluster Query Language (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html)
// in the Amazon Elastic Container Service Developer Guide.
Expression *string `locationName:"expression" type:"string"`
@@ -10297,6 +14650,26 @@ func (s TaskOverride) GoString() string {
return s.String()
}
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TaskOverride) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TaskOverride"}
+ if s.ContainerOverrides != nil {
+ for i, v := range s.ContainerOverrides {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContainerOverrides", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
// SetContainerOverrides sets the ContainerOverrides field's value.
func (s *TaskOverride) SetContainerOverrides(v []*ContainerOverride) *TaskOverride {
s.ContainerOverrides = v
@@ -10315,11 +14688,273 @@ func (s *TaskOverride) SetTaskRoleArn(v string) *TaskOverride {
return s
}
+// Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+// an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+// desired number of tasks, how many tasks are running, and whether the task
+// set serves production traffic.
+type TaskSet struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the cluster that the service that hosts
+ // the task set exists in.
+ ClusterArn *string `locationName:"clusterArn" type:"string"`
+
+ // The computed desired count for the task set. This is calculated by multiplying
+ // the service's desiredCount by the task set's scale percentage. The result
+ // is always rounded up. For example, if the computed desired count is 1.2,
+ // it rounds up to 2 tasks.
+ ComputedDesiredCount *int64 `locationName:"computedDesiredCount" type:"integer"`
+
+ // The Unix timestamp for when the task set was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The external ID associated with the task set.
+ //
+ // If a task set is created by an AWS CodeDeploy deployment, the externalId
+ // parameter contains the AWS CodeDeploy deployment ID.
+ //
+ // If a task set is created for an external deployment and is associated with
+ // a service discovery registry, the externalId parameter contains the ECS_TASK_SET_EXTERNAL_ID
+ // AWS Cloud Map attribute.
+ ExternalId *string `locationName:"externalId" type:"string"`
+
+ // The ID of the task set.
+ Id *string `locationName:"id" type:"string"`
+
+ // The launch type the tasks in the task set are using. For more information,
+ // see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"`
+
+ // Details on a load balancer that is used with a task set.
+ LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"`
+
+ // The network configuration for the task set.
+ NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
+
+ // The number of tasks in the task set that are in the PENDING status during
+ // a deployment. A task in the PENDING state is preparing to enter the RUNNING
+ // state. A task set enters the PENDING status when it launches for the first
+ // time or when it is restarted after being in the STOPPED state.
+ PendingCount *int64 `locationName:"pendingCount" type:"integer"`
+
+ // The platform version on which the tasks in the task set are running. A platform
+ // version is only specified for tasks using the Fargate launch type. If one
+ // is not specified, the LATEST platform version is used by default. For more
+ // information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // in the Amazon Elastic Container Service Developer Guide.
+ PlatformVersion *string `locationName:"platformVersion" type:"string"`
+
+ // The number of tasks in the task set that are in the RUNNING status during
+ // a deployment. A task in the RUNNING state is running and ready for use.
+ RunningCount *int64 `locationName:"runningCount" type:"integer"`
+
+ // A floating-point percentage of the desired number of tasks to place and keep
+ // running in the task set.
+ Scale *Scale `locationName:"scale" type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the service the task set exists in.
+ ServiceArn *string `locationName:"serviceArn" type:"string"`
+
+ // The details of the service discovery registries to assign to this task set.
+ // For more information, see Service Discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
+ ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"`
+
+ // The stability status, which indicates whether the task set has reached a
+ // steady state. If the following conditions are met, the task set will be in
+ // STEADY_STATE:
+ //
+ // * The task runningCount is equal to the computedDesiredCount.
+ //
+ // * The pendingCount is 0.
+ //
+ // * There are no tasks running on container instances in the DRAINING status.
+ //
+ // * All tasks are reporting a healthy status from the load balancers, service
+ // discovery, and container health checks. If a healthCheckGracePeriodSeconds
+ // value was set when the service was created, you may see a STEADY_STATE
+ // reached since unhealthy Elastic Load Balancing target health checks will
+ // be ignored until it expires.
+ //
+ // If any of those conditions are not met, the stability status returns STABILIZING.
+ StabilityStatus *string `locationName:"stabilityStatus" type:"string" enum:"StabilityStatus"`
+
+ // The Unix timestamp for when the task set stability status was retrieved.
+ StabilityStatusAt *time.Time `locationName:"stabilityStatusAt" type:"timestamp"`
+
+ // The tag specified when a task set is started. If the task set is created
+ // by an AWS CodeDeploy deployment, the startedBy parameter is CODE_DEPLOY.
+ // For a task set created for an external deployment, the startedBy field isn't
+ // used.
+ StartedBy *string `locationName:"startedBy" type:"string"`
+
+ // The status of the task set. The following describes each state:
+ //
+ // PRIMARY
+ //
+ // The task set is serving production traffic.
+ //
+ // ACTIVE
+ //
+ // The task set is not serving production traffic.
+ //
+ // DRAINING
+ //
+ // The tasks in the task set are being stopped and their corresponding targets
+ // are being deregistered from their target group.
+ Status *string `locationName:"status" type:"string"`
+
+ // The task definition the task set is using.
+ TaskDefinition *string `locationName:"taskDefinition" type:"string"`
+
+ // The Amazon Resource Name (ARN) of the task set.
+ TaskSetArn *string `locationName:"taskSetArn" type:"string"`
+
+ // The Unix timestamp for when the task set was last updated.
+ UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"`
+}
+
+// String returns the string representation
+func (s TaskSet) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TaskSet) GoString() string {
+ return s.String()
+}
+
+// SetClusterArn sets the ClusterArn field's value.
+func (s *TaskSet) SetClusterArn(v string) *TaskSet {
+ s.ClusterArn = &v
+ return s
+}
+
+// SetComputedDesiredCount sets the ComputedDesiredCount field's value.
+func (s *TaskSet) SetComputedDesiredCount(v int64) *TaskSet {
+ s.ComputedDesiredCount = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *TaskSet) SetCreatedAt(v time.Time) *TaskSet {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetExternalId sets the ExternalId field's value.
+func (s *TaskSet) SetExternalId(v string) *TaskSet {
+ s.ExternalId = &v
+ return s
+}
+
+// SetId sets the Id field's value.
+func (s *TaskSet) SetId(v string) *TaskSet {
+ s.Id = &v
+ return s
+}
+
+// SetLaunchType sets the LaunchType field's value.
+func (s *TaskSet) SetLaunchType(v string) *TaskSet {
+ s.LaunchType = &v
+ return s
+}
+
+// SetLoadBalancers sets the LoadBalancers field's value.
+func (s *TaskSet) SetLoadBalancers(v []*LoadBalancer) *TaskSet {
+ s.LoadBalancers = v
+ return s
+}
+
+// SetNetworkConfiguration sets the NetworkConfiguration field's value.
+func (s *TaskSet) SetNetworkConfiguration(v *NetworkConfiguration) *TaskSet {
+ s.NetworkConfiguration = v
+ return s
+}
+
+// SetPendingCount sets the PendingCount field's value.
+func (s *TaskSet) SetPendingCount(v int64) *TaskSet {
+ s.PendingCount = &v
+ return s
+}
+
+// SetPlatformVersion sets the PlatformVersion field's value.
+func (s *TaskSet) SetPlatformVersion(v string) *TaskSet {
+ s.PlatformVersion = &v
+ return s
+}
+
+// SetRunningCount sets the RunningCount field's value.
+func (s *TaskSet) SetRunningCount(v int64) *TaskSet {
+ s.RunningCount = &v
+ return s
+}
+
+// SetScale sets the Scale field's value.
+func (s *TaskSet) SetScale(v *Scale) *TaskSet {
+ s.Scale = v
+ return s
+}
+
+// SetServiceArn sets the ServiceArn field's value.
+func (s *TaskSet) SetServiceArn(v string) *TaskSet {
+ s.ServiceArn = &v
+ return s
+}
+
+// SetServiceRegistries sets the ServiceRegistries field's value.
+func (s *TaskSet) SetServiceRegistries(v []*ServiceRegistry) *TaskSet {
+ s.ServiceRegistries = v
+ return s
+}
+
+// SetStabilityStatus sets the StabilityStatus field's value.
+func (s *TaskSet) SetStabilityStatus(v string) *TaskSet {
+ s.StabilityStatus = &v
+ return s
+}
+
+// SetStabilityStatusAt sets the StabilityStatusAt field's value.
+func (s *TaskSet) SetStabilityStatusAt(v time.Time) *TaskSet {
+ s.StabilityStatusAt = &v
+ return s
+}
+
+// SetStartedBy sets the StartedBy field's value.
+func (s *TaskSet) SetStartedBy(v string) *TaskSet {
+ s.StartedBy = &v
+ return s
+}
+
+// SetStatus sets the Status field's value.
+func (s *TaskSet) SetStatus(v string) *TaskSet {
+ s.Status = &v
+ return s
+}
+
+// SetTaskDefinition sets the TaskDefinition field's value.
+func (s *TaskSet) SetTaskDefinition(v string) *TaskSet {
+ s.TaskDefinition = &v
+ return s
+}
+
+// SetTaskSetArn sets the TaskSetArn field's value.
+func (s *TaskSet) SetTaskSetArn(v string) *TaskSet {
+ s.TaskSetArn = &v
+ return s
+}
+
+// SetUpdatedAt sets the UpdatedAt field's value.
+func (s *TaskSet) SetUpdatedAt(v time.Time) *TaskSet {
+ s.UpdatedAt = &v
+ return s
+}
+
// The container path, mount options, and size of the tmpfs mount.
type Tmpfs struct {
_ struct{} `type:"structure"`
- // The absolute file path where the tmpfs volume will be mounted.
+ // The absolute file path where the tmpfs volume is to be mounted.
//
// ContainerPath is a required field
ContainerPath *string `locationName:"containerPath" type:"string" required:"true"`
@@ -10331,6 +14966,7 @@ type Tmpfs struct {
// "nomand" | "atime" | "noatime" | "diratime" | "nodiratime" | "bind" | "rbind"
// | "unbindable" | "runbindable" | "private" | "rprivate" | "shared" | "rshared"
// | "slave" | "rslave" | "relatime" | "norelatime" | "strictatime" | "nostrictatime"
+ // | "mode" | "uid" | "gid" | "nr_inodes" | "nr_blocks" | "mpol"
MountOptions []*string `locationName:"mountOptions" type:"list"`
// The size (in MiB) of the tmpfs volume.
@@ -10450,6 +15086,74 @@ func (s *Ulimit) SetSoftLimit(v int64) *Ulimit {
return s
}
+type UntagResourceInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the resource from which to delete tags.
+ // Currently, the supported resources are Amazon ECS tasks, services, task definitions,
+ // clusters, and container instances.
+ //
+ // ResourceArn is a required field
+ ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"`
+
+ // The keys of the tags to be removed.
+ //
+ // TagKeys is a required field
+ TagKeys []*string `locationName:"tagKeys" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s UntagResourceInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UntagResourceInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UntagResourceInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"}
+ if s.ResourceArn == nil {
+ invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
+ }
+ if s.TagKeys == nil {
+ invalidParams.Add(request.NewErrParamRequired("TagKeys"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetResourceArn sets the ResourceArn field's value.
+func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput {
+ s.ResourceArn = &v
+ return s
+}
+
+// SetTagKeys sets the TagKeys field's value.
+func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput {
+ s.TagKeys = v
+ return s
+}
+
+type UntagResourceOutput struct {
+ _ struct{} `type:"structure"`
+}
+
+// String returns the string representation
+func (s UntagResourceOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UntagResourceOutput) GoString() string {
+ return s.String()
+}
+
type UpdateContainerAgentInput struct {
_ struct{} `type:"structure"`
@@ -10537,6 +15241,11 @@ type UpdateContainerInstancesStateInput struct {
ContainerInstances []*string `locationName:"containerInstances" type:"list" required:"true"`
// The container instance state with which to update the container instance.
+ // The only valid values for this action are ACTIVE and DRAINING. A container
+ // instance can only be updated to DRAINING status once it has reached an ACTIVE
+ // state. If a container instance is in REGISTERING, DEREGISTERING, or REGISTRATION_FAILED
+ // state you can describe the container instance but will be unable to update
+ // the container instance state.
//
// Status is a required field
Status *string `locationName:"status" type:"string" required:"true" enum:"ContainerInstanceStatus"`
@@ -10646,16 +15355,16 @@ type UpdateServiceInput struct {
// has first started. This is only valid if your service is configured to use
// a load balancer. If your service's tasks take a while to start and respond
// to Elastic Load Balancing health checks, you can specify a health check grace
- // period of up to 1,800 seconds during which the ECS service scheduler ignores
- // the Elastic Load Balancing health check status. This grace period can prevent
- // the ECS service scheduler from marking tasks as unhealthy and stopping them
- // before they have time to come up.
+ // period of up to 1,800 seconds. During that time, the ECS service scheduler
+ // ignores the Elastic Load Balancing health check status. This grace period
+ // can prevent the ECS service scheduler from marking tasks as unhealthy and
+ // stopping them before they have time to come up.
HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"`
// The network configuration for the service. This parameter is required for
// task definitions that use the awsvpc network mode to receive their own elastic
// network interface, and it is not supported for other network modes. For more
- // information, see Task Networking (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
+ // information, see Task Networking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
// in the Amazon Elastic Container Service Developer Guide.
//
// Updating a service to add a subnet to a list of existing subnets does not
@@ -10664,7 +15373,11 @@ type UpdateServiceInput struct {
// network configuration, this does not trigger a new service deployment.
NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"`
- // The platform version you want to update your service to run.
+ // The platform version on which your tasks in the service are running. A platform
+ // version is only specified for tasks using the Fargate launch type. If one
+ // is not specified, the LATEST platform version is used by default. For more
+ // information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
+ // in the Amazon Elastic Container Service Developer Guide.
PlatformVersion *string `locationName:"platformVersion" type:"string"`
// The name of the service to update.
@@ -10785,13 +15498,217 @@ func (s *UpdateServiceOutput) SetService(v *Service) *UpdateServiceOutput {
return s
}
+type UpdateServicePrimaryTaskSetInput struct {
+ _ struct{} `type:"structure"`
+
+ // The short name or full Amazon Resource Name (ARN) of the cluster that hosts
+ // the service that the task set exists in.
+ //
+ // Cluster is a required field
+ Cluster *string `locationName:"cluster" type:"string" required:"true"`
+
+ // The short name or full Amazon Resource Name (ARN) of the task set to set
+ // as the primary task set in the deployment.
+ //
+ // PrimaryTaskSet is a required field
+ PrimaryTaskSet *string `locationName:"primaryTaskSet" type:"string" required:"true"`
+
+ // The short name or full Amazon Resource Name (ARN) of the service that the
+ // task set exists in.
+ //
+ // Service is a required field
+ Service *string `locationName:"service" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s UpdateServicePrimaryTaskSetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateServicePrimaryTaskSetInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UpdateServicePrimaryTaskSetInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UpdateServicePrimaryTaskSetInput"}
+ if s.Cluster == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cluster"))
+ }
+ if s.PrimaryTaskSet == nil {
+ invalidParams.Add(request.NewErrParamRequired("PrimaryTaskSet"))
+ }
+ if s.Service == nil {
+ invalidParams.Add(request.NewErrParamRequired("Service"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *UpdateServicePrimaryTaskSetInput) SetCluster(v string) *UpdateServicePrimaryTaskSetInput {
+ s.Cluster = &v
+ return s
+}
+
+// SetPrimaryTaskSet sets the PrimaryTaskSet field's value.
+func (s *UpdateServicePrimaryTaskSetInput) SetPrimaryTaskSet(v string) *UpdateServicePrimaryTaskSetInput {
+ s.PrimaryTaskSet = &v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *UpdateServicePrimaryTaskSetInput) SetService(v string) *UpdateServicePrimaryTaskSetInput {
+ s.Service = &v
+ return s
+}
+
+type UpdateServicePrimaryTaskSetOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+ // an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+ // desired number of tasks, how many tasks are running, and whether the task
+ // set serves production traffic.
+ TaskSet *TaskSet `locationName:"taskSet" type:"structure"`
+}
+
+// String returns the string representation
+func (s UpdateServicePrimaryTaskSetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateServicePrimaryTaskSetOutput) GoString() string {
+ return s.String()
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *UpdateServicePrimaryTaskSetOutput) SetTaskSet(v *TaskSet) *UpdateServicePrimaryTaskSetOutput {
+ s.TaskSet = v
+ return s
+}
+
+type UpdateTaskSetInput struct {
+ _ struct{} `type:"structure"`
+
+ // The short name or full Amazon Resource Name (ARN) of the cluster that hosts
+ // the service that the task set exists in.
+ //
+ // Cluster is a required field
+ Cluster *string `locationName:"cluster" type:"string" required:"true"`
+
+ // A floating-point percentage of the desired number of tasks to place and keep
+ // running in the task set.
+ //
+ // Scale is a required field
+ Scale *Scale `locationName:"scale" type:"structure" required:"true"`
+
+ // The short name or full Amazon Resource Name (ARN) of the service that the
+ // task set exists in.
+ //
+ // Service is a required field
+ Service *string `locationName:"service" type:"string" required:"true"`
+
+ // The short name or full Amazon Resource Name (ARN) of the task set to update.
+ //
+ // TaskSet is a required field
+ TaskSet *string `locationName:"taskSet" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s UpdateTaskSetInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateTaskSetInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UpdateTaskSetInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UpdateTaskSetInput"}
+ if s.Cluster == nil {
+ invalidParams.Add(request.NewErrParamRequired("Cluster"))
+ }
+ if s.Scale == nil {
+ invalidParams.Add(request.NewErrParamRequired("Scale"))
+ }
+ if s.Service == nil {
+ invalidParams.Add(request.NewErrParamRequired("Service"))
+ }
+ if s.TaskSet == nil {
+ invalidParams.Add(request.NewErrParamRequired("TaskSet"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetCluster sets the Cluster field's value.
+func (s *UpdateTaskSetInput) SetCluster(v string) *UpdateTaskSetInput {
+ s.Cluster = &v
+ return s
+}
+
+// SetScale sets the Scale field's value.
+func (s *UpdateTaskSetInput) SetScale(v *Scale) *UpdateTaskSetInput {
+ s.Scale = v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *UpdateTaskSetInput) SetService(v string) *UpdateTaskSetInput {
+ s.Service = &v
+ return s
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *UpdateTaskSetInput) SetTaskSet(v string) *UpdateTaskSetInput {
+ s.TaskSet = &v
+ return s
+}
+
+type UpdateTaskSetOutput struct {
+ _ struct{} `type:"structure"`
+
+ // Information about a set of Amazon ECS tasks in either an AWS CodeDeploy or
+ // an EXTERNAL deployment. An Amazon ECS task set includes details such as the
+ // desired number of tasks, how many tasks are running, and whether the task
+ // set serves production traffic.
+ TaskSet *TaskSet `locationName:"taskSet" type:"structure"`
+}
+
+// String returns the string representation
+func (s UpdateTaskSetOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateTaskSetOutput) GoString() string {
+ return s.String()
+}
+
+// SetTaskSet sets the TaskSet field's value.
+func (s *UpdateTaskSetOutput) SetTaskSet(v *TaskSet) *UpdateTaskSetOutput {
+ s.TaskSet = v
+ return s
+}
+
// The Docker and Amazon ECS container agent version information about a container
// instance.
type VersionInfo struct {
_ struct{} `type:"structure"`
// The Git commit hash for the Amazon ECS container agent build on the amazon-ecs-agent
- // (https://github.com/aws/amazon-ecs-agent/commits/master) GitHub repository.
+ // (https://github.com/aws/amazon-ecs-agent/commits/master) GitHub repository.
AgentHash *string `locationName:"agentHash" type:"string"`
// The version number of the Amazon ECS container agent.
@@ -10829,15 +15746,26 @@ func (s *VersionInfo) SetDockerVersion(v string) *VersionInfo {
return s
}
-// A data volume used in a task definition.
+// A data volume used in a task definition. For tasks that use a Docker volume,
+// specify a DockerVolumeConfiguration. For tasks that use a bind mount host
+// volume, specify a host and optional sourcePath. For more information, see
+// Using Data Volumes in Tasks (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html).
type Volume struct {
_ struct{} `type:"structure"`
- // The contents of the host parameter determine whether your data volume persists
- // on the host container instance and where it is stored. If the host parameter
- // is empty, then the Docker daemon assigns a host path for your data volume,
- // but the data is not guaranteed to persist after the containers associated
- // with it stop running.
+ // This parameter is specified when you are using Docker volumes. Docker volumes
+ // are only supported when you are using the EC2 launch type. Windows containers
+ // only support the use of the local driver. To use bind mounts, specify a host
+ // instead.
+ DockerVolumeConfiguration *DockerVolumeConfiguration `locationName:"dockerVolumeConfiguration" type:"structure"`
+
+ // This parameter is specified when you are using bind mount host volumes. Bind
+ // mount host volumes are supported when you are using either the EC2 or Fargate
+ // launch types. The contents of the host parameter determine whether your bind
+ // mount host volume persists on the host container instance and where it is
+ // stored. If the host parameter is empty, then the Docker daemon assigns a
+ // host path for your data volume. However, the data is not guaranteed to persist
+ // after the containers associated with it stop running.
//
// Windows containers can mount whole directories on the same drive as $env:ProgramData.
// Windows containers cannot mount directories on a different drive, and mount
@@ -10846,8 +15774,8 @@ type Volume struct {
Host *HostVolumeProperties `locationName:"host" type:"structure"`
// The name of the volume. Up to 255 letters (uppercase and lowercase), numbers,
- // hyphens, and underscores are allowed. This name is referenced in the sourceVolume
- // parameter of container definition mountPoints.
+ // and hyphens are allowed. This name is referenced in the sourceVolume parameter
+ // of container definition mountPoints.
Name *string `locationName:"name" type:"string"`
}
@@ -10861,6 +15789,12 @@ func (s Volume) GoString() string {
return s.String()
}
+// SetDockerVolumeConfiguration sets the DockerVolumeConfiguration field's value.
+func (s *Volume) SetDockerVolumeConfiguration(v *DockerVolumeConfiguration) *Volume {
+ s.DockerVolumeConfiguration = v
+ return s
+}
+
// SetHost sets the Host field's value.
func (s *Volume) SetHost(v *HostVolumeProperties) *Volume {
s.Host = v
@@ -10882,8 +15816,8 @@ type VolumeFrom struct {
// value is false.
ReadOnly *bool `locationName:"readOnly" type:"boolean"`
- // The name of another container within the same task definition to mount volumes
- // from.
+ // The name of another container within the same task definition from which
+ // to mount volumes.
SourceContainer *string `locationName:"sourceContainer" type:"string"`
}
@@ -10940,6 +15874,14 @@ const (
const (
// ClusterFieldStatistics is a ClusterField enum value
ClusterFieldStatistics = "STATISTICS"
+
+ // ClusterFieldTags is a ClusterField enum value
+ ClusterFieldTags = "TAGS"
+)
+
+const (
+ // ClusterSettingNameContainerInsights is a ClusterSettingName enum value
+ ClusterSettingNameContainerInsights = "containerInsights"
)
const (
@@ -10958,12 +15900,51 @@ const (
ConnectivityDisconnected = "DISCONNECTED"
)
+const (
+ // ContainerConditionStart is a ContainerCondition enum value
+ ContainerConditionStart = "START"
+
+ // ContainerConditionComplete is a ContainerCondition enum value
+ ContainerConditionComplete = "COMPLETE"
+
+ // ContainerConditionSuccess is a ContainerCondition enum value
+ ContainerConditionSuccess = "SUCCESS"
+
+ // ContainerConditionHealthy is a ContainerCondition enum value
+ ContainerConditionHealthy = "HEALTHY"
+)
+
+const (
+ // ContainerInstanceFieldTags is a ContainerInstanceField enum value
+ ContainerInstanceFieldTags = "TAGS"
+)
+
const (
// ContainerInstanceStatusActive is a ContainerInstanceStatus enum value
ContainerInstanceStatusActive = "ACTIVE"
// ContainerInstanceStatusDraining is a ContainerInstanceStatus enum value
ContainerInstanceStatusDraining = "DRAINING"
+
+ // ContainerInstanceStatusRegistering is a ContainerInstanceStatus enum value
+ ContainerInstanceStatusRegistering = "REGISTERING"
+
+ // ContainerInstanceStatusDeregistering is a ContainerInstanceStatus enum value
+ ContainerInstanceStatusDeregistering = "DEREGISTERING"
+
+ // ContainerInstanceStatusRegistrationFailed is a ContainerInstanceStatus enum value
+ ContainerInstanceStatusRegistrationFailed = "REGISTRATION_FAILED"
+)
+
+const (
+ // DeploymentControllerTypeEcs is a DeploymentControllerType enum value
+ DeploymentControllerTypeEcs = "ECS"
+
+ // DeploymentControllerTypeCodeDeploy is a DeploymentControllerType enum value
+ DeploymentControllerTypeCodeDeploy = "CODE_DEPLOY"
+
+ // DeploymentControllerTypeExternal is a DeploymentControllerType enum value
+ DeploymentControllerTypeExternal = "EXTERNAL"
)
const (
@@ -10999,6 +15980,17 @@ const (
HealthStatusUnknown = "UNKNOWN"
)
+const (
+ // IpcModeHost is a IpcMode enum value
+ IpcModeHost = "host"
+
+ // IpcModeTask is a IpcMode enum value
+ IpcModeTask = "task"
+
+ // IpcModeNone is a IpcMode enum value
+ IpcModeNone = "none"
+)
+
const (
// LaunchTypeEc2 is a LaunchType enum value
LaunchTypeEc2 = "EC2"
@@ -11044,6 +16036,14 @@ const (
NetworkModeNone = "none"
)
+const (
+ // PidModeHost is a PidMode enum value
+ PidModeHost = "host"
+
+ // PidModeTask is a PidMode enum value
+ PidModeTask = "task"
+)
+
const (
// PlacementConstraintTypeDistinctInstance is a PlacementConstraintType enum value
PlacementConstraintTypeDistinctInstance = "distinctInstance"
@@ -11063,6 +16063,72 @@ const (
PlacementStrategyTypeBinpack = "binpack"
)
+const (
+ // PlatformDeviceTypeGpu is a PlatformDeviceType enum value
+ PlatformDeviceTypeGpu = "GPU"
+)
+
+const (
+ // PropagateTagsTaskDefinition is a PropagateTags enum value
+ PropagateTagsTaskDefinition = "TASK_DEFINITION"
+
+ // PropagateTagsService is a PropagateTags enum value
+ PropagateTagsService = "SERVICE"
+)
+
+const (
+ // ProxyConfigurationTypeAppmesh is a ProxyConfigurationType enum value
+ ProxyConfigurationTypeAppmesh = "APPMESH"
+)
+
+const (
+ // ResourceTypeGpu is a ResourceType enum value
+ ResourceTypeGpu = "GPU"
+)
+
+const (
+ // ScaleUnitPercent is a ScaleUnit enum value
+ ScaleUnitPercent = "PERCENT"
+)
+
+const (
+ // SchedulingStrategyReplica is a SchedulingStrategy enum value
+ SchedulingStrategyReplica = "REPLICA"
+
+ // SchedulingStrategyDaemon is a SchedulingStrategy enum value
+ SchedulingStrategyDaemon = "DAEMON"
+)
+
+const (
+ // ScopeTask is a Scope enum value
+ ScopeTask = "task"
+
+ // ScopeShared is a Scope enum value
+ ScopeShared = "shared"
+)
+
+const (
+ // ServiceFieldTags is a ServiceField enum value
+ ServiceFieldTags = "TAGS"
+)
+
+const (
+ // SettingNameServiceLongArnFormat is a SettingName enum value
+ SettingNameServiceLongArnFormat = "serviceLongArnFormat"
+
+ // SettingNameTaskLongArnFormat is a SettingName enum value
+ SettingNameTaskLongArnFormat = "taskLongArnFormat"
+
+ // SettingNameContainerInstanceLongArnFormat is a SettingName enum value
+ SettingNameContainerInstanceLongArnFormat = "containerInstanceLongArnFormat"
+
+ // SettingNameAwsvpcTrunking is a SettingName enum value
+ SettingNameAwsvpcTrunking = "awsvpcTrunking"
+
+ // SettingNameContainerInsights is a SettingName enum value
+ SettingNameContainerInsights = "containerInsights"
+)
+
const (
// SortOrderAsc is a SortOrder enum value
SortOrderAsc = "ASC"
@@ -11071,6 +16137,14 @@ const (
SortOrderDesc = "DESC"
)
+const (
+ // StabilityStatusSteadyState is a StabilityStatus enum value
+ StabilityStatusSteadyState = "STEADY_STATE"
+
+ // StabilityStatusStabilizing is a StabilityStatus enum value
+ StabilityStatusStabilizing = "STABILIZING"
+)
+
const (
// TargetTypeContainerInstance is a TargetType enum value
TargetTypeContainerInstance = "container-instance"
@@ -11087,6 +16161,11 @@ const (
TaskDefinitionFamilyStatusAll = "ALL"
)
+const (
+ // TaskDefinitionFieldTags is a TaskDefinitionField enum value
+ TaskDefinitionFieldTags = "TAGS"
+)
+
const (
// TaskDefinitionPlacementConstraintTypeMemberOf is a TaskDefinitionPlacementConstraintType enum value
TaskDefinitionPlacementConstraintTypeMemberOf = "memberOf"
@@ -11100,6 +16179,22 @@ const (
TaskDefinitionStatusInactive = "INACTIVE"
)
+const (
+ // TaskFieldTags is a TaskField enum value
+ TaskFieldTags = "TAGS"
+)
+
+const (
+ // TaskStopCodeTaskFailedToStart is a TaskStopCode enum value
+ TaskStopCodeTaskFailedToStart = "TaskFailedToStart"
+
+ // TaskStopCodeEssentialContainerExited is a TaskStopCode enum value
+ TaskStopCodeEssentialContainerExited = "EssentialContainerExited"
+
+ // TaskStopCodeUserInitiated is a TaskStopCode enum value
+ TaskStopCodeUserInitiated = "UserInitiated"
+)
+
const (
// TransportProtocolTcp is a TransportProtocol enum value
TransportProtocolTcp = "tcp"
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go
index 1d59f5b64..558214212 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/doc.go
@@ -10,7 +10,7 @@
// tasks using the Fargate launch type. For more control, you can host your
// tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) instances
// that you manage by using the EC2 launch type. For more information about
-// launch types, see Amazon ECS Launch Types (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html).
+// launch types, see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html).
//
// Amazon ECS lets you launch and stop container-based applications with simple
// API calls, allows you to get the state of your cluster from a centralized
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go
index 619efc778..c350d185b 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go
@@ -21,8 +21,8 @@ const (
// ErrCodeBlockedException for service response error code
// "BlockedException".
//
- // Your AWS account has been blocked. Contact AWS Support (http://aws.amazon.com/contact-us/)
- // for more information.
+ // Your AWS account has been blocked. For more information, contact AWS Support
+ // (http://aws.amazon.com/contact-us/).
ErrCodeBlockedException = "BlockedException"
// ErrCodeClientException for service response error code
@@ -36,17 +36,17 @@ const (
// ErrCodeClusterContainsContainerInstancesException for service response error code
// "ClusterContainsContainerInstancesException".
//
- // You cannot delete a cluster that has registered container instances. You
- // must first deregister the container instances before you can delete the cluster.
- // For more information, see DeregisterContainerInstance.
+ // You cannot delete a cluster that has registered container instances. First,
+ // deregister the container instances before you can delete the cluster. For
+ // more information, see DeregisterContainerInstance.
ErrCodeClusterContainsContainerInstancesException = "ClusterContainsContainerInstancesException"
// ErrCodeClusterContainsServicesException for service response error code
// "ClusterContainsServicesException".
//
- // You cannot delete a cluster that contains services. You must first update
- // the service to reduce its desired task count to 0 and then delete the service.
- // For more information, see UpdateService and DeleteService.
+ // You cannot delete a cluster that contains services. First, update the service
+ // to reduce its desired task count to 0 and then delete the service. For more
+ // information, see UpdateService and DeleteService.
ErrCodeClusterContainsServicesException = "ClusterContainsServicesException"
// ErrCodeClusterContainsTasksException for service response error code
@@ -59,7 +59,7 @@ const (
// "ClusterNotFoundException".
//
// The specified cluster could not be found. You can view your available clusters
- // with ListClusters. Amazon ECS clusters are region-specific.
+ // with ListClusters. Amazon ECS clusters are Region-specific.
ErrCodeClusterNotFoundException = "ClusterNotFoundException"
// ErrCodeInvalidParameterException for service response error code
@@ -89,7 +89,7 @@ const (
// ErrCodePlatformTaskDefinitionIncompatibilityException for service response error code
// "PlatformTaskDefinitionIncompatibilityException".
//
- // The specified platform version does not satisfy the task definition’s required
+ // The specified platform version does not satisfy the task definition's required
// capabilities.
ErrCodePlatformTaskDefinitionIncompatibilityException = "PlatformTaskDefinitionIncompatibilityException"
@@ -99,6 +99,12 @@ const (
// The specified platform version does not exist.
ErrCodePlatformUnknownException = "PlatformUnknownException"
+ // ErrCodeResourceNotFoundException for service response error code
+ // "ResourceNotFoundException".
+ //
+ // The specified resource could not be found.
+ ErrCodeResourceNotFoundException = "ResourceNotFoundException"
+
// ErrCodeServerException for service response error code
// "ServerException".
//
@@ -116,7 +122,7 @@ const (
// "ServiceNotFoundException".
//
// The specified service could not be found. You can view your available services
- // with ListServices. Amazon ECS services are cluster-specific and region-specific.
+ // with ListServices. Amazon ECS services are cluster-specific and Region-specific.
ErrCodeServiceNotFoundException = "ServiceNotFoundException"
// ErrCodeTargetNotFoundException for service response error code
@@ -124,13 +130,21 @@ const (
//
// The specified target could not be found. You can view your available container
// instances with ListContainerInstances. Amazon ECS container instances are
- // cluster-specific and region-specific.
+ // cluster-specific and Region-specific.
ErrCodeTargetNotFoundException = "TargetNotFoundException"
+ // ErrCodeTaskSetNotFoundException for service response error code
+ // "TaskSetNotFoundException".
+ //
+ // The specified task set could not be found. You can view your available container
+ // instances with DescribeTaskSets. Task sets are specific to each cluster,
+ // service and Region.
+ ErrCodeTaskSetNotFoundException = "TaskSetNotFoundException"
+
// ErrCodeUnsupportedFeatureException for service response error code
// "UnsupportedFeatureException".
//
- // The specified task is not supported in this region.
+ // The specified task is not supported in this Region.
ErrCodeUnsupportedFeatureException = "UnsupportedFeatureException"
// ErrCodeUpdateInProgressException for service response error code
diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go
index 6082b9282..c268614ec 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "ecs" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "ecs" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "ECS" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the ECS client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go
index 0feedda0a..5d7c5a33f 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go
@@ -3,6 +3,7 @@
package lightsail
import (
+ "fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
@@ -15,7 +16,7 @@ const opAllocateStaticIp = "AllocateStaticIp"
// AllocateStaticIpRequest generates a "aws/request.Request" representing the
// client's request for the AllocateStaticIp operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -119,7 +120,7 @@ const opAttachDisk = "AttachDisk"
// AttachDiskRequest generates a "aws/request.Request" representing the
// client's request for the AttachDisk operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -161,6 +162,10 @@ func (c *Lightsail) AttachDiskRequest(input *AttachDiskInput) (req *request.Requ
// Attaches a block storage disk to a running or stopped Lightsail instance
// and exposes it to the instance with the specified disk name.
//
+// The attach disk operation supports tag-based access control via resource
+// tags applied to the resource identified by diskName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -224,7 +229,7 @@ const opAttachInstancesToLoadBalancer = "AttachInstancesToLoadBalancer"
// AttachInstancesToLoadBalancerRequest generates a "aws/request.Request" representing the
// client's request for the AttachInstancesToLoadBalancer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -268,6 +273,10 @@ func (c *Lightsail) AttachInstancesToLoadBalancerRequest(input *AttachInstancesT
// After some time, the instances are attached to the load balancer and the
// health check status is available.
//
+// The attach instances to load balancer operation supports tag-based access
+// control via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -331,7 +340,7 @@ const opAttachLoadBalancerTlsCertificate = "AttachLoadBalancerTlsCertificate"
// AttachLoadBalancerTlsCertificateRequest generates a "aws/request.Request" representing the
// client's request for the AttachLoadBalancerTlsCertificate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -379,6 +388,10 @@ func (c *Lightsail) AttachLoadBalancerTlsCertificateRequest(input *AttachLoadBal
// certificate, and it will replace the existing one and become the attached
// certificate.
//
+// The attach load balancer tls certificate operation supports tag-based access
+// control via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -442,7 +455,7 @@ const opAttachStaticIp = "AttachStaticIp"
// AttachStaticIpRequest generates a "aws/request.Request" representing the
// client's request for the AttachStaticIp operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -546,7 +559,7 @@ const opCloseInstancePublicPorts = "CloseInstancePublicPorts"
// CloseInstancePublicPortsRequest generates a "aws/request.Request" representing the
// client's request for the CloseInstancePublicPorts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -587,6 +600,10 @@ func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPo
//
// Closes the public ports on a specific Amazon Lightsail instance.
//
+// The close instance public ports operation supports tag-based access control
+// via resource tags applied to the resource identified by instanceName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -645,12 +662,229 @@ func (c *Lightsail) CloseInstancePublicPortsWithContext(ctx aws.Context, input *
return out, req.Send()
}
+const opCopySnapshot = "CopySnapshot"
+
+// CopySnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the CopySnapshot 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 CopySnapshot for more information on using the CopySnapshot
+// 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 CopySnapshotRequest method.
+// req, resp := client.CopySnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CopySnapshot
+func (c *Lightsail) CopySnapshotRequest(input *CopySnapshotInput) (req *request.Request, output *CopySnapshotOutput) {
+ op := &request.Operation{
+ Name: opCopySnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CopySnapshotInput{}
+ }
+
+ output = &CopySnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CopySnapshot API operation for Amazon Lightsail.
+//
+// Copies an instance or disk snapshot from one AWS Region to another in Amazon
+// Lightsail.
+//
+// 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 Lightsail's
+// API operation CopySnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CopySnapshot
+func (c *Lightsail) CopySnapshot(input *CopySnapshotInput) (*CopySnapshotOutput, error) {
+ req, out := c.CopySnapshotRequest(input)
+ return out, req.Send()
+}
+
+// CopySnapshotWithContext is the same as CopySnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CopySnapshot 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 *Lightsail) CopySnapshotWithContext(ctx aws.Context, input *CopySnapshotInput, opts ...request.Option) (*CopySnapshotOutput, error) {
+ req, out := c.CopySnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateCloudFormationStack = "CreateCloudFormationStack"
+
+// CreateCloudFormationStackRequest generates a "aws/request.Request" representing the
+// client's request for the CreateCloudFormationStack 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 CreateCloudFormationStack for more information on using the CreateCloudFormationStack
+// 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 CreateCloudFormationStackRequest method.
+// req, resp := client.CreateCloudFormationStackRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateCloudFormationStack
+func (c *Lightsail) CreateCloudFormationStackRequest(input *CreateCloudFormationStackInput) (req *request.Request, output *CreateCloudFormationStackOutput) {
+ op := &request.Operation{
+ Name: opCreateCloudFormationStack,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateCloudFormationStackInput{}
+ }
+
+ output = &CreateCloudFormationStackOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateCloudFormationStack API operation for Amazon Lightsail.
+//
+// Creates an AWS CloudFormation stack, which creates a new Amazon EC2 instance
+// from an exported Amazon Lightsail snapshot. This operation results in a CloudFormation
+// stack record that can be used to track the AWS CloudFormation stack created.
+// Use the get cloud formation stack records operation to get a list of the
+// CloudFormation stacks created.
+//
+// Wait until after your new Amazon EC2 instance is created before running the
+// create cloud formation stack operation again with the same export snapshot
+// record.
+//
+// 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 Lightsail's
+// API operation CreateCloudFormationStack for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateCloudFormationStack
+func (c *Lightsail) CreateCloudFormationStack(input *CreateCloudFormationStackInput) (*CreateCloudFormationStackOutput, error) {
+ req, out := c.CreateCloudFormationStackRequest(input)
+ return out, req.Send()
+}
+
+// CreateCloudFormationStackWithContext is the same as CreateCloudFormationStack with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateCloudFormationStack 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 *Lightsail) CreateCloudFormationStackWithContext(ctx aws.Context, input *CreateCloudFormationStackInput, opts ...request.Option) (*CreateCloudFormationStackOutput, error) {
+ req, out := c.CreateCloudFormationStackRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opCreateDisk = "CreateDisk"
// CreateDiskRequest generates a "aws/request.Request" representing the
// client's request for the CreateDisk operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -694,6 +928,9 @@ func (c *Lightsail) CreateDiskRequest(input *CreateDiskInput) (req *request.Requ
// the regional endpoint that you send the HTTP request to. For more information,
// see Regions and Availability Zones in Lightsail (https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail).
//
+// The create disk operation supports tag-based access control via request tags.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -757,7 +994,7 @@ const opCreateDiskFromSnapshot = "CreateDiskFromSnapshot"
// CreateDiskFromSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CreateDiskFromSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -801,6 +1038,10 @@ func (c *Lightsail) CreateDiskFromSnapshotRequest(input *CreateDiskFromSnapshotI
// disk is created in the regional endpoint that you send the HTTP request to.
// For more information, see Regions and Availability Zones in Lightsail (https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail).
//
+// The create disk from snapshot operation supports tag-based access control
+// via request tags and resource tags applied to the resource identified by
+// diskSnapshotName. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -864,7 +1105,7 @@ const opCreateDiskSnapshot = "CreateDiskSnapshot"
// CreateDiskSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CreateDiskSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -918,6 +1159,19 @@ func (c *Lightsail) CreateDiskSnapshotRequest(input *CreateDiskSnapshotInput) (r
// snapshot. You may remount and use your disk while the snapshot status is
// pending.
//
+// You can also use this operation to create a snapshot of an instance's system
+// volume. You might want to do this, for example, to recover data from the
+// system volume of a botched instance or to create a backup of the system volume
+// like you would for a block storage disk. To create a snapshot of a system
+// volume, just define the instance name parameter when issuing the snapshot
+// command, and a snapshot of the defined instance's system volume will be created.
+// After the snapshot is available, you can create a block storage disk from
+// the snapshot and attach it to a running instance to access the data on the
+// disk.
+//
+// The create disk snapshot operation supports tag-based access control via
+// request tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -981,7 +1235,7 @@ const opCreateDomain = "CreateDomain"
// CreateDomainRequest generates a "aws/request.Request" representing the
// client's request for the CreateDomain operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1022,6 +1276,9 @@ func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) (req *request.
//
// Creates a domain resource for the specified domain (e.g., example.com).
//
+// The create domain operation supports tag-based access control via request
+// tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1085,7 +1342,7 @@ const opCreateDomainEntry = "CreateDomainEntry"
// CreateDomainEntryRequest generates a "aws/request.Request" representing the
// client's request for the CreateDomainEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1124,8 +1381,13 @@ func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) (req
// CreateDomainEntry API operation for Amazon Lightsail.
//
-// Creates one of the following entry records associated with the domain: A
-// record, CNAME record, TXT record, or MX record.
+// Creates one of the following entry records associated with the domain: Address
+// (A), canonical name (CNAME), mail exchanger (MX), name server (NS), start
+// of authority (SOA), service locator (SRV), or text (TXT).
+//
+// The create domain entry operation supports tag-based access control via resource
+// tags applied to the resource identified by domainName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
//
// 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
@@ -1190,7 +1452,7 @@ const opCreateInstanceSnapshot = "CreateInstanceSnapshot"
// CreateInstanceSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CreateInstanceSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1232,6 +1494,9 @@ func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotI
// Creates a snapshot of a specific virtual private server, or instance. You
// can use a snapshot to create a new instance that is based on that snapshot.
//
+// The create instance snapshot operation supports tag-based access control
+// via request tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1295,7 +1560,7 @@ const opCreateInstances = "CreateInstances"
// CreateInstancesRequest generates a "aws/request.Request" representing the
// client's request for the CreateInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1335,6 +1600,14 @@ func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) (req *re
// CreateInstances API operation for Amazon Lightsail.
//
// Creates one or more Amazon Lightsail virtual private servers, or instances.
+// Create instances using active blueprints. Inactive blueprints are listed
+// to support customers with existing instances but are not necessarily available
+// for launch of new instances. Blueprints are marked inactive when they become
+// outdated due to operating system updates or new application releases. Use
+// the get blueprints operation to return a list of available blueprints.
+//
+// The create instances operation supports tag-based access control via request
+// tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
//
// 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
@@ -1399,7 +1672,7 @@ const opCreateInstancesFromSnapshot = "CreateInstancesFromSnapshot"
// CreateInstancesFromSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the CreateInstancesFromSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1441,6 +1714,10 @@ func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFro
// Uses a specific snapshot as a blueprint for creating one or more new instances
// that are based on that identical configuration.
//
+// The create instances from snapshot operation supports tag-based access control
+// via request tags and resource tags applied to the resource identified by
+// instanceSnapshotName. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1504,7 +1781,7 @@ const opCreateKeyPair = "CreateKeyPair"
// CreateKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the CreateKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1543,7 +1820,10 @@ func (c *Lightsail) CreateKeyPairRequest(input *CreateKeyPairInput) (req *reques
// CreateKeyPair API operation for Amazon Lightsail.
//
-// Creates sn SSH key pair.
+// Creates an SSH key pair.
+//
+// The create key pair operation supports tag-based access control via request
+// tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
//
// 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
@@ -1608,7 +1888,7 @@ const opCreateLoadBalancer = "CreateLoadBalancer"
// CreateLoadBalancerRequest generates a "aws/request.Request" representing the
// client's request for the CreateLoadBalancer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1656,6 +1936,9 @@ func (c *Lightsail) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (r
// To change additional load balancer settings, use the UpdateLoadBalancerAttribute
// operation.
//
+// The create load balancer operation supports tag-based access control via
+// request tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1719,7 +2002,7 @@ const opCreateLoadBalancerTlsCertificate = "CreateLoadBalancerTlsCertificate"
// CreateLoadBalancerTlsCertificateRequest generates a "aws/request.Request" representing the
// client's request for the CreateLoadBalancerTlsCertificate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1762,6 +2045,10 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateRequest(input *CreateLoadBal
//
// TLS is just an updated, more secure version of Secure Socket Layer (SSL).
//
+// The create load balancer tls certificate operation supports tag-based access
+// control via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1820,12 +2107,342 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateWithContext(ctx aws.Context,
return out, req.Send()
}
+const opCreateRelationalDatabase = "CreateRelationalDatabase"
+
+// CreateRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the CreateRelationalDatabase 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 CreateRelationalDatabase for more information on using the CreateRelationalDatabase
+// 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 CreateRelationalDatabaseRequest method.
+// req, resp := client.CreateRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase
+func (c *Lightsail) CreateRelationalDatabaseRequest(input *CreateRelationalDatabaseInput) (req *request.Request, output *CreateRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opCreateRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateRelationalDatabaseInput{}
+ }
+
+ output = &CreateRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateRelationalDatabase API operation for Amazon Lightsail.
+//
+// Creates a new database in Amazon Lightsail.
+//
+// The create relational database operation supports tag-based access control
+// via request tags. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation CreateRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase
+func (c *Lightsail) CreateRelationalDatabase(input *CreateRelationalDatabaseInput) (*CreateRelationalDatabaseOutput, error) {
+ req, out := c.CreateRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// CreateRelationalDatabaseWithContext is the same as CreateRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateRelationalDatabase 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 *Lightsail) CreateRelationalDatabaseWithContext(ctx aws.Context, input *CreateRelationalDatabaseInput, opts ...request.Option) (*CreateRelationalDatabaseOutput, error) {
+ req, out := c.CreateRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateRelationalDatabaseFromSnapshot = "CreateRelationalDatabaseFromSnapshot"
+
+// CreateRelationalDatabaseFromSnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the CreateRelationalDatabaseFromSnapshot 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 CreateRelationalDatabaseFromSnapshot for more information on using the CreateRelationalDatabaseFromSnapshot
+// 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 CreateRelationalDatabaseFromSnapshotRequest method.
+// req, resp := client.CreateRelationalDatabaseFromSnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot
+func (c *Lightsail) CreateRelationalDatabaseFromSnapshotRequest(input *CreateRelationalDatabaseFromSnapshotInput) (req *request.Request, output *CreateRelationalDatabaseFromSnapshotOutput) {
+ op := &request.Operation{
+ Name: opCreateRelationalDatabaseFromSnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateRelationalDatabaseFromSnapshotInput{}
+ }
+
+ output = &CreateRelationalDatabaseFromSnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateRelationalDatabaseFromSnapshot API operation for Amazon Lightsail.
+//
+// Creates a new database from an existing database snapshot in Amazon Lightsail.
+//
+// You can create a new database from a snapshot in if something goes wrong
+// with your original database, or to change it to a different plan, such as
+// a high availability or standard plan.
+//
+// The create relational database from snapshot operation supports tag-based
+// access control via request tags and resource tags applied to the resource
+// identified by relationalDatabaseSnapshotName. For more information, see the
+// Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation CreateRelationalDatabaseFromSnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot
+func (c *Lightsail) CreateRelationalDatabaseFromSnapshot(input *CreateRelationalDatabaseFromSnapshotInput) (*CreateRelationalDatabaseFromSnapshotOutput, error) {
+ req, out := c.CreateRelationalDatabaseFromSnapshotRequest(input)
+ return out, req.Send()
+}
+
+// CreateRelationalDatabaseFromSnapshotWithContext is the same as CreateRelationalDatabaseFromSnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateRelationalDatabaseFromSnapshot 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 *Lightsail) CreateRelationalDatabaseFromSnapshotWithContext(ctx aws.Context, input *CreateRelationalDatabaseFromSnapshotInput, opts ...request.Option) (*CreateRelationalDatabaseFromSnapshotOutput, error) {
+ req, out := c.CreateRelationalDatabaseFromSnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opCreateRelationalDatabaseSnapshot = "CreateRelationalDatabaseSnapshot"
+
+// CreateRelationalDatabaseSnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the CreateRelationalDatabaseSnapshot 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 CreateRelationalDatabaseSnapshot for more information on using the CreateRelationalDatabaseSnapshot
+// 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 CreateRelationalDatabaseSnapshotRequest method.
+// req, resp := client.CreateRelationalDatabaseSnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot
+func (c *Lightsail) CreateRelationalDatabaseSnapshotRequest(input *CreateRelationalDatabaseSnapshotInput) (req *request.Request, output *CreateRelationalDatabaseSnapshotOutput) {
+ op := &request.Operation{
+ Name: opCreateRelationalDatabaseSnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &CreateRelationalDatabaseSnapshotInput{}
+ }
+
+ output = &CreateRelationalDatabaseSnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// CreateRelationalDatabaseSnapshot API operation for Amazon Lightsail.
+//
+// Creates a snapshot of your database in Amazon Lightsail. You can use snapshots
+// for backups, to make copies of a database, and to save data before deleting
+// a database.
+//
+// The create relational database snapshot operation supports tag-based access
+// control via request tags. For more information, see the Lightsail Dev Guide
+// (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation CreateRelationalDatabaseSnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot
+func (c *Lightsail) CreateRelationalDatabaseSnapshot(input *CreateRelationalDatabaseSnapshotInput) (*CreateRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.CreateRelationalDatabaseSnapshotRequest(input)
+ return out, req.Send()
+}
+
+// CreateRelationalDatabaseSnapshotWithContext is the same as CreateRelationalDatabaseSnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See CreateRelationalDatabaseSnapshot 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 *Lightsail) CreateRelationalDatabaseSnapshotWithContext(ctx aws.Context, input *CreateRelationalDatabaseSnapshotInput, opts ...request.Option) (*CreateRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.CreateRelationalDatabaseSnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteDisk = "DeleteDisk"
// DeleteDiskRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDisk operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1869,6 +2486,10 @@ func (c *Lightsail) DeleteDiskRequest(input *DeleteDiskInput) (req *request.Requ
//
// The disk may remain in the deleting state for several minutes.
//
+// The delete disk operation supports tag-based access control via resource
+// tags applied to the resource identified by diskName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -1932,7 +2553,7 @@ const opDeleteDiskSnapshot = "DeleteDiskSnapshot"
// DeleteDiskSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDiskSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1980,6 +2601,10 @@ func (c *Lightsail) DeleteDiskSnapshotRequest(input *DeleteDiskSnapshotInput) (r
// snapshots have been deleted, all active snapshots will have access to all
// the information needed to restore the disk.
//
+// The delete disk snapshot operation supports tag-based access control via
+// resource tags applied to the resource identified by diskSnapshotName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2043,7 +2668,7 @@ const opDeleteDomain = "DeleteDomain"
// DeleteDomainRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDomain operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2084,6 +2709,10 @@ func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) (req *request.
//
// Deletes the specified domain recordset and all of its domain records.
//
+// The delete domain operation supports tag-based access control via resource
+// tags applied to the resource identified by domainName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2147,7 +2776,7 @@ const opDeleteDomainEntry = "DeleteDomainEntry"
// DeleteDomainEntryRequest generates a "aws/request.Request" representing the
// client's request for the DeleteDomainEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2188,6 +2817,10 @@ func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) (req
//
// Deletes a specific domain entry.
//
+// The delete domain entry operation supports tag-based access control via resource
+// tags applied to the resource identified by domainName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2251,7 +2884,7 @@ const opDeleteInstance = "DeleteInstance"
// DeleteInstanceRequest generates a "aws/request.Request" representing the
// client's request for the DeleteInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2292,6 +2925,10 @@ func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) (req *requ
//
// Deletes a specific Amazon Lightsail virtual private server, or instance.
//
+// The delete instance operation supports tag-based access control via resource
+// tags applied to the resource identified by instanceName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2355,7 +2992,7 @@ const opDeleteInstanceSnapshot = "DeleteInstanceSnapshot"
// DeleteInstanceSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the DeleteInstanceSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2396,6 +3033,10 @@ func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotI
//
// Deletes a specific snapshot of a virtual private server (or instance).
//
+// The delete instance snapshot operation supports tag-based access control
+// via resource tags applied to the resource identified by instanceSnapshotName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2459,7 +3100,7 @@ const opDeleteKeyPair = "DeleteKeyPair"
// DeleteKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the DeleteKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2500,6 +3141,10 @@ func (c *Lightsail) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *reques
//
// Deletes a specific SSH key pair.
//
+// The delete key pair operation supports tag-based access control via resource
+// tags applied to the resource identified by keyPairName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2558,12 +3203,124 @@ func (c *Lightsail) DeleteKeyPairWithContext(ctx aws.Context, input *DeleteKeyPa
return out, req.Send()
}
+const opDeleteKnownHostKeys = "DeleteKnownHostKeys"
+
+// DeleteKnownHostKeysRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteKnownHostKeys 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 DeleteKnownHostKeys for more information on using the DeleteKnownHostKeys
+// 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 DeleteKnownHostKeysRequest method.
+// req, resp := client.DeleteKnownHostKeysRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKnownHostKeys
+func (c *Lightsail) DeleteKnownHostKeysRequest(input *DeleteKnownHostKeysInput) (req *request.Request, output *DeleteKnownHostKeysOutput) {
+ op := &request.Operation{
+ Name: opDeleteKnownHostKeys,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteKnownHostKeysInput{}
+ }
+
+ output = &DeleteKnownHostKeysOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteKnownHostKeys API operation for Amazon Lightsail.
+//
+// Deletes the known host key or certificate used by the Amazon Lightsail browser-based
+// SSH or RDP clients to authenticate an instance. This operation enables the
+// Lightsail browser-based SSH or RDP clients to connect to the instance after
+// a host key mismatch.
+//
+// Perform this operation only if you were expecting the host key or certificate
+// mismatch or if you are familiar with the new host key or certificate on the
+// instance. For more information, see Troubleshooting connection issues when
+// using the Amazon Lightsail browser-based SSH or RDP client (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-troubleshooting-browser-based-ssh-rdp-client-connection).
+//
+// 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 Lightsail's
+// API operation DeleteKnownHostKeys for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKnownHostKeys
+func (c *Lightsail) DeleteKnownHostKeys(input *DeleteKnownHostKeysInput) (*DeleteKnownHostKeysOutput, error) {
+ req, out := c.DeleteKnownHostKeysRequest(input)
+ return out, req.Send()
+}
+
+// DeleteKnownHostKeysWithContext is the same as DeleteKnownHostKeys with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteKnownHostKeys 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 *Lightsail) DeleteKnownHostKeysWithContext(ctx aws.Context, input *DeleteKnownHostKeysInput, opts ...request.Option) (*DeleteKnownHostKeysOutput, error) {
+ req, out := c.DeleteKnownHostKeysRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDeleteLoadBalancer = "DeleteLoadBalancer"
// DeleteLoadBalancerRequest generates a "aws/request.Request" representing the
// client's request for the DeleteLoadBalancer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2606,6 +3363,10 @@ func (c *Lightsail) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (r
// Once the load balancer is deleted, you will need to create a new load balancer,
// create a new certificate, and verify domain ownership again.
//
+// The delete load balancer operation supports tag-based access control via
+// resource tags applied to the resource identified by loadBalancerName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2669,7 +3430,7 @@ const opDeleteLoadBalancerTlsCertificate = "DeleteLoadBalancerTlsCertificate"
// DeleteLoadBalancerTlsCertificateRequest generates a "aws/request.Request" representing the
// client's request for the DeleteLoadBalancerTlsCertificate operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2710,6 +3471,10 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateRequest(input *DeleteLoadBal
//
// Deletes an SSL/TLS certificate associated with a Lightsail load balancer.
//
+// The delete load balancer tls certificate operation supports tag-based access
+// control via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2768,12 +3533,228 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateWithContext(ctx aws.Context,
return out, req.Send()
}
+const opDeleteRelationalDatabase = "DeleteRelationalDatabase"
+
+// DeleteRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteRelationalDatabase 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 DeleteRelationalDatabase for more information on using the DeleteRelationalDatabase
+// 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 DeleteRelationalDatabaseRequest method.
+// req, resp := client.DeleteRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase
+func (c *Lightsail) DeleteRelationalDatabaseRequest(input *DeleteRelationalDatabaseInput) (req *request.Request, output *DeleteRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opDeleteRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteRelationalDatabaseInput{}
+ }
+
+ output = &DeleteRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteRelationalDatabase API operation for Amazon Lightsail.
+//
+// Deletes a database in Amazon Lightsail.
+//
+// The delete relational database operation supports tag-based access control
+// via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation DeleteRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase
+func (c *Lightsail) DeleteRelationalDatabase(input *DeleteRelationalDatabaseInput) (*DeleteRelationalDatabaseOutput, error) {
+ req, out := c.DeleteRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// DeleteRelationalDatabaseWithContext is the same as DeleteRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteRelationalDatabase 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 *Lightsail) DeleteRelationalDatabaseWithContext(ctx aws.Context, input *DeleteRelationalDatabaseInput, opts ...request.Option) (*DeleteRelationalDatabaseOutput, error) {
+ req, out := c.DeleteRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opDeleteRelationalDatabaseSnapshot = "DeleteRelationalDatabaseSnapshot"
+
+// DeleteRelationalDatabaseSnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the DeleteRelationalDatabaseSnapshot 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 DeleteRelationalDatabaseSnapshot for more information on using the DeleteRelationalDatabaseSnapshot
+// 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 DeleteRelationalDatabaseSnapshotRequest method.
+// req, resp := client.DeleteRelationalDatabaseSnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot
+func (c *Lightsail) DeleteRelationalDatabaseSnapshotRequest(input *DeleteRelationalDatabaseSnapshotInput) (req *request.Request, output *DeleteRelationalDatabaseSnapshotOutput) {
+ op := &request.Operation{
+ Name: opDeleteRelationalDatabaseSnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &DeleteRelationalDatabaseSnapshotInput{}
+ }
+
+ output = &DeleteRelationalDatabaseSnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// DeleteRelationalDatabaseSnapshot API operation for Amazon Lightsail.
+//
+// Deletes a database snapshot in Amazon Lightsail.
+//
+// The delete relational database snapshot operation supports tag-based access
+// control via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation DeleteRelationalDatabaseSnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot
+func (c *Lightsail) DeleteRelationalDatabaseSnapshot(input *DeleteRelationalDatabaseSnapshotInput) (*DeleteRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.DeleteRelationalDatabaseSnapshotRequest(input)
+ return out, req.Send()
+}
+
+// DeleteRelationalDatabaseSnapshotWithContext is the same as DeleteRelationalDatabaseSnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See DeleteRelationalDatabaseSnapshot 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 *Lightsail) DeleteRelationalDatabaseSnapshotWithContext(ctx aws.Context, input *DeleteRelationalDatabaseSnapshotInput, opts ...request.Option) (*DeleteRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.DeleteRelationalDatabaseSnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opDetachDisk = "DetachDisk"
// DetachDiskRequest generates a "aws/request.Request" representing the
// client's request for the DetachDisk operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2816,6 +3797,10 @@ func (c *Lightsail) DetachDiskRequest(input *DetachDiskInput) (req *request.Requ
// to unmount any file systems on the device within your operating system before
// stopping the instance and detaching the disk.
//
+// The detach disk operation supports tag-based access control via resource
+// tags applied to the resource identified by diskName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2879,7 +3864,7 @@ const opDetachInstancesFromLoadBalancer = "DetachInstancesFromLoadBalancer"
// DetachInstancesFromLoadBalancerRequest generates a "aws/request.Request" representing the
// client's request for the DetachInstancesFromLoadBalancer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2923,6 +3908,10 @@ func (c *Lightsail) DetachInstancesFromLoadBalancerRequest(input *DetachInstance
// This operation waits until the instances are no longer needed before they
// are detached from the load balancer.
//
+// The detach instances from load balancer operation supports tag-based access
+// control via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -2986,7 +3975,7 @@ const opDetachStaticIp = "DetachStaticIp"
// DetachStaticIpRequest generates a "aws/request.Request" representing the
// client's request for the DetachStaticIp operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3090,7 +4079,7 @@ const opDownloadDefaultKeyPair = "DownloadDefaultKeyPair"
// DownloadDefaultKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the DownloadDefaultKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3189,12 +4178,132 @@ func (c *Lightsail) DownloadDefaultKeyPairWithContext(ctx aws.Context, input *Do
return out, req.Send()
}
+const opExportSnapshot = "ExportSnapshot"
+
+// ExportSnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the ExportSnapshot 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 ExportSnapshot for more information on using the ExportSnapshot
+// 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 ExportSnapshotRequest method.
+// req, resp := client.ExportSnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ExportSnapshot
+func (c *Lightsail) ExportSnapshotRequest(input *ExportSnapshotInput) (req *request.Request, output *ExportSnapshotOutput) {
+ op := &request.Operation{
+ Name: opExportSnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &ExportSnapshotInput{}
+ }
+
+ output = &ExportSnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// ExportSnapshot API operation for Amazon Lightsail.
+//
+// Exports an Amazon Lightsail instance or block storage disk snapshot to Amazon
+// Elastic Compute Cloud (Amazon EC2). This operation results in an export snapshot
+// record that can be used with the create cloud formation stack operation to
+// create new Amazon EC2 instances.
+//
+// Exported instance snapshots appear in Amazon EC2 as Amazon Machine Images
+// (AMIs), and the instance system disk appears as an Amazon Elastic Block Store
+// (Amazon EBS) volume. Exported disk snapshots appear in Amazon EC2 as Amazon
+// EBS volumes. Snapshots are exported to the same Amazon Web Services Region
+// in Amazon EC2 as the source Lightsail snapshot.
+//
+// The export snapshot operation supports tag-based access control via resource
+// tags applied to the resource identified by sourceSnapshotName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// Use the get instance snapshots or get disk snapshots operations to get a
+// list of snapshots that you can export to Amazon EC2.
+//
+// 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 Lightsail's
+// API operation ExportSnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ExportSnapshot
+func (c *Lightsail) ExportSnapshot(input *ExportSnapshotInput) (*ExportSnapshotOutput, error) {
+ req, out := c.ExportSnapshotRequest(input)
+ return out, req.Send()
+}
+
+// ExportSnapshotWithContext is the same as ExportSnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See ExportSnapshot 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 *Lightsail) ExportSnapshotWithContext(ctx aws.Context, input *ExportSnapshotInput, opts ...request.Option) (*ExportSnapshotOutput, error) {
+ req, out := c.ExportSnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetActiveNames = "GetActiveNames"
// GetActiveNamesRequest generates a "aws/request.Request" representing the
// client's request for the GetActiveNames operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3298,7 +4407,7 @@ const opGetBlueprints = "GetBlueprints"
// GetBlueprintsRequest generates a "aws/request.Request" representing the
// client's request for the GetBlueprints operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3405,7 +4514,7 @@ const opGetBundles = "GetBundles"
// GetBundlesRequest generates a "aws/request.Request" representing the
// client's request for the GetBundles operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3505,12 +4614,120 @@ func (c *Lightsail) GetBundlesWithContext(ctx aws.Context, input *GetBundlesInpu
return out, req.Send()
}
+const opGetCloudFormationStackRecords = "GetCloudFormationStackRecords"
+
+// GetCloudFormationStackRecordsRequest generates a "aws/request.Request" representing the
+// client's request for the GetCloudFormationStackRecords 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 GetCloudFormationStackRecords for more information on using the GetCloudFormationStackRecords
+// 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 GetCloudFormationStackRecordsRequest method.
+// req, resp := client.GetCloudFormationStackRecordsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetCloudFormationStackRecords
+func (c *Lightsail) GetCloudFormationStackRecordsRequest(input *GetCloudFormationStackRecordsInput) (req *request.Request, output *GetCloudFormationStackRecordsOutput) {
+ op := &request.Operation{
+ Name: opGetCloudFormationStackRecords,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetCloudFormationStackRecordsInput{}
+ }
+
+ output = &GetCloudFormationStackRecordsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetCloudFormationStackRecords API operation for Amazon Lightsail.
+//
+// Returns the CloudFormation stack record created as a result of the create
+// cloud formation stack operation.
+//
+// An AWS CloudFormation stack is used to create a new Amazon EC2 instance from
+// an exported Lightsail snapshot.
+//
+// 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 Lightsail's
+// API operation GetCloudFormationStackRecords for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetCloudFormationStackRecords
+func (c *Lightsail) GetCloudFormationStackRecords(input *GetCloudFormationStackRecordsInput) (*GetCloudFormationStackRecordsOutput, error) {
+ req, out := c.GetCloudFormationStackRecordsRequest(input)
+ return out, req.Send()
+}
+
+// GetCloudFormationStackRecordsWithContext is the same as GetCloudFormationStackRecords with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetCloudFormationStackRecords 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 *Lightsail) GetCloudFormationStackRecordsWithContext(ctx aws.Context, input *GetCloudFormationStackRecordsInput, opts ...request.Option) (*GetCloudFormationStackRecordsOutput, error) {
+ req, out := c.GetCloudFormationStackRecordsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetDisk = "GetDisk"
// GetDiskRequest generates a "aws/request.Request" representing the
// client's request for the GetDisk operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3614,7 +4831,7 @@ const opGetDiskSnapshot = "GetDiskSnapshot"
// GetDiskSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the GetDiskSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3718,7 +4935,7 @@ const opGetDiskSnapshots = "GetDiskSnapshots"
// GetDiskSnapshotsRequest generates a "aws/request.Request" representing the
// client's request for the GetDiskSnapshots operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3827,7 +5044,7 @@ const opGetDisks = "GetDisks"
// GetDisksRequest generates a "aws/request.Request" representing the
// client's request for the GetDisks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3936,7 +5153,7 @@ const opGetDomain = "GetDomain"
// GetDomainRequest generates a "aws/request.Request" representing the
// client's request for the GetDomain operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4040,7 +5257,7 @@ const opGetDomains = "GetDomains"
// GetDomainsRequest generates a "aws/request.Request" representing the
// client's request for the GetDomains operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4139,12 +5356,120 @@ func (c *Lightsail) GetDomainsWithContext(ctx aws.Context, input *GetDomainsInpu
return out, req.Send()
}
+const opGetExportSnapshotRecords = "GetExportSnapshotRecords"
+
+// GetExportSnapshotRecordsRequest generates a "aws/request.Request" representing the
+// client's request for the GetExportSnapshotRecords 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 GetExportSnapshotRecords for more information on using the GetExportSnapshotRecords
+// 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 GetExportSnapshotRecordsRequest method.
+// req, resp := client.GetExportSnapshotRecordsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetExportSnapshotRecords
+func (c *Lightsail) GetExportSnapshotRecordsRequest(input *GetExportSnapshotRecordsInput) (req *request.Request, output *GetExportSnapshotRecordsOutput) {
+ op := &request.Operation{
+ Name: opGetExportSnapshotRecords,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetExportSnapshotRecordsInput{}
+ }
+
+ output = &GetExportSnapshotRecordsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetExportSnapshotRecords API operation for Amazon Lightsail.
+//
+// Returns the export snapshot record created as a result of the export snapshot
+// operation.
+//
+// An export snapshot record can be used to create a new Amazon EC2 instance
+// and its related resources with the create cloud formation stack operation.
+//
+// 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 Lightsail's
+// API operation GetExportSnapshotRecords for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetExportSnapshotRecords
+func (c *Lightsail) GetExportSnapshotRecords(input *GetExportSnapshotRecordsInput) (*GetExportSnapshotRecordsOutput, error) {
+ req, out := c.GetExportSnapshotRecordsRequest(input)
+ return out, req.Send()
+}
+
+// GetExportSnapshotRecordsWithContext is the same as GetExportSnapshotRecords with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetExportSnapshotRecords 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 *Lightsail) GetExportSnapshotRecordsWithContext(ctx aws.Context, input *GetExportSnapshotRecordsInput, opts ...request.Option) (*GetExportSnapshotRecordsOutput, error) {
+ req, out := c.GetExportSnapshotRecordsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetInstance = "GetInstance"
// GetInstanceRequest generates a "aws/request.Request" representing the
// client's request for the GetInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4249,7 +5574,7 @@ const opGetInstanceAccessDetails = "GetInstanceAccessDetails"
// GetInstanceAccessDetailsRequest generates a "aws/request.Request" representing the
// client's request for the GetInstanceAccessDetails operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4291,6 +5616,10 @@ func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDeta
// Returns temporary SSH keys you can use to connect to a specific virtual private
// server, or instance.
//
+// The get instance access details operation supports tag-based access control
+// via resource tags applied to the resource identified by instanceName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -4354,7 +5683,7 @@ const opGetInstanceMetricData = "GetInstanceMetricData"
// GetInstanceMetricDataRequest generates a "aws/request.Request" representing the
// client's request for the GetInstanceMetricData operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4459,7 +5788,7 @@ const opGetInstancePortStates = "GetInstancePortStates"
// GetInstancePortStatesRequest generates a "aws/request.Request" representing the
// client's request for the GetInstancePortStates operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4563,7 +5892,7 @@ const opGetInstanceSnapshot = "GetInstanceSnapshot"
// GetInstanceSnapshotRequest generates a "aws/request.Request" representing the
// client's request for the GetInstanceSnapshot operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4667,7 +5996,7 @@ const opGetInstanceSnapshots = "GetInstanceSnapshots"
// GetInstanceSnapshotsRequest generates a "aws/request.Request" representing the
// client's request for the GetInstanceSnapshots operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4771,7 +6100,7 @@ const opGetInstanceState = "GetInstanceState"
// GetInstanceStateRequest generates a "aws/request.Request" representing the
// client's request for the GetInstanceState operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4875,7 +6204,7 @@ const opGetInstances = "GetInstances"
// GetInstancesRequest generates a "aws/request.Request" representing the
// client's request for the GetInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4980,7 +6309,7 @@ const opGetKeyPair = "GetKeyPair"
// GetKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the GetKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5084,7 +6413,7 @@ const opGetKeyPairs = "GetKeyPairs"
// GetKeyPairsRequest generates a "aws/request.Request" representing the
// client's request for the GetKeyPairs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5188,7 +6517,7 @@ const opGetLoadBalancer = "GetLoadBalancer"
// GetLoadBalancerRequest generates a "aws/request.Request" representing the
// client's request for the GetLoadBalancer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5292,7 +6621,7 @@ const opGetLoadBalancerMetricData = "GetLoadBalancerMetricData"
// GetLoadBalancerMetricDataRequest generates a "aws/request.Request" representing the
// client's request for the GetLoadBalancerMetricData operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5396,7 +6725,7 @@ const opGetLoadBalancerTlsCertificates = "GetLoadBalancerTlsCertificates"
// GetLoadBalancerTlsCertificatesRequest generates a "aws/request.Request" representing the
// client's request for the GetLoadBalancerTlsCertificates operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5506,7 +6835,7 @@ const opGetLoadBalancers = "GetLoadBalancers"
// GetLoadBalancersRequest generates a "aws/request.Request" representing the
// client's request for the GetLoadBalancers operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5614,7 +6943,7 @@ const opGetOperation = "GetOperation"
// GetOperationRequest generates a "aws/request.Request" representing the
// client's request for the GetOperation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5720,7 +7049,7 @@ const opGetOperations = "GetOperations"
// GetOperationsRequest generates a "aws/request.Request" representing the
// client's request for the GetOperations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5828,7 +7157,7 @@ const opGetOperationsForResource = "GetOperationsForResource"
// GetOperationsForResourceRequest generates a "aws/request.Request" representing the
// client's request for the GetOperationsForResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5932,7 +7261,7 @@ const opGetRegions = "GetRegions"
// GetRegionsRequest generates a "aws/request.Request" representing the
// client's request for the GetRegions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5972,7 +7301,7 @@ func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) (req *request.Requ
// GetRegions API operation for Amazon Lightsail.
//
// Returns a list of all valid regions for Amazon Lightsail. Use the include
-// availability zones parameter to also return the availability zones in a region.
+// availability zones parameter to also return the Availability Zones in a 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
@@ -6032,12 +7361,1280 @@ func (c *Lightsail) GetRegionsWithContext(ctx aws.Context, input *GetRegionsInpu
return out, req.Send()
}
+const opGetRelationalDatabase = "GetRelationalDatabase"
+
+// GetRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabase 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 GetRelationalDatabase for more information on using the GetRelationalDatabase
+// 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 GetRelationalDatabaseRequest method.
+// req, resp := client.GetRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase
+func (c *Lightsail) GetRelationalDatabaseRequest(input *GetRelationalDatabaseInput) (req *request.Request, output *GetRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseInput{}
+ }
+
+ output = &GetRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabase API operation for Amazon Lightsail.
+//
+// Returns information about a specific database in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase
+func (c *Lightsail) GetRelationalDatabase(input *GetRelationalDatabaseInput) (*GetRelationalDatabaseOutput, error) {
+ req, out := c.GetRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseWithContext is the same as GetRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabase 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 *Lightsail) GetRelationalDatabaseWithContext(ctx aws.Context, input *GetRelationalDatabaseInput, opts ...request.Option) (*GetRelationalDatabaseOutput, error) {
+ req, out := c.GetRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseBlueprints = "GetRelationalDatabaseBlueprints"
+
+// GetRelationalDatabaseBlueprintsRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseBlueprints 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 GetRelationalDatabaseBlueprints for more information on using the GetRelationalDatabaseBlueprints
+// 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 GetRelationalDatabaseBlueprintsRequest method.
+// req, resp := client.GetRelationalDatabaseBlueprintsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints
+func (c *Lightsail) GetRelationalDatabaseBlueprintsRequest(input *GetRelationalDatabaseBlueprintsInput) (req *request.Request, output *GetRelationalDatabaseBlueprintsOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseBlueprints,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseBlueprintsInput{}
+ }
+
+ output = &GetRelationalDatabaseBlueprintsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseBlueprints API operation for Amazon Lightsail.
+//
+// Returns a list of available database blueprints in Amazon Lightsail. A blueprint
+// describes the major engine version of a database.
+//
+// You can use a blueprint ID to create a new database that runs a specific
+// database engine.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseBlueprints for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints
+func (c *Lightsail) GetRelationalDatabaseBlueprints(input *GetRelationalDatabaseBlueprintsInput) (*GetRelationalDatabaseBlueprintsOutput, error) {
+ req, out := c.GetRelationalDatabaseBlueprintsRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseBlueprintsWithContext is the same as GetRelationalDatabaseBlueprints with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseBlueprints 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 *Lightsail) GetRelationalDatabaseBlueprintsWithContext(ctx aws.Context, input *GetRelationalDatabaseBlueprintsInput, opts ...request.Option) (*GetRelationalDatabaseBlueprintsOutput, error) {
+ req, out := c.GetRelationalDatabaseBlueprintsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseBundles = "GetRelationalDatabaseBundles"
+
+// GetRelationalDatabaseBundlesRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseBundles 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 GetRelationalDatabaseBundles for more information on using the GetRelationalDatabaseBundles
+// 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 GetRelationalDatabaseBundlesRequest method.
+// req, resp := client.GetRelationalDatabaseBundlesRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles
+func (c *Lightsail) GetRelationalDatabaseBundlesRequest(input *GetRelationalDatabaseBundlesInput) (req *request.Request, output *GetRelationalDatabaseBundlesOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseBundles,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseBundlesInput{}
+ }
+
+ output = &GetRelationalDatabaseBundlesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseBundles API operation for Amazon Lightsail.
+//
+// Returns the list of bundles that are available in Amazon Lightsail. A bundle
+// describes the performance specifications for a database.
+//
+// You can use a bundle ID to create a new database with explicit performance
+// specifications.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseBundles for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles
+func (c *Lightsail) GetRelationalDatabaseBundles(input *GetRelationalDatabaseBundlesInput) (*GetRelationalDatabaseBundlesOutput, error) {
+ req, out := c.GetRelationalDatabaseBundlesRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseBundlesWithContext is the same as GetRelationalDatabaseBundles with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseBundles 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 *Lightsail) GetRelationalDatabaseBundlesWithContext(ctx aws.Context, input *GetRelationalDatabaseBundlesInput, opts ...request.Option) (*GetRelationalDatabaseBundlesOutput, error) {
+ req, out := c.GetRelationalDatabaseBundlesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseEvents = "GetRelationalDatabaseEvents"
+
+// GetRelationalDatabaseEventsRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseEvents 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 GetRelationalDatabaseEvents for more information on using the GetRelationalDatabaseEvents
+// 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 GetRelationalDatabaseEventsRequest method.
+// req, resp := client.GetRelationalDatabaseEventsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents
+func (c *Lightsail) GetRelationalDatabaseEventsRequest(input *GetRelationalDatabaseEventsInput) (req *request.Request, output *GetRelationalDatabaseEventsOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseEvents,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseEventsInput{}
+ }
+
+ output = &GetRelationalDatabaseEventsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseEvents API operation for Amazon Lightsail.
+//
+// Returns a list of events for a specific database in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseEvents for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents
+func (c *Lightsail) GetRelationalDatabaseEvents(input *GetRelationalDatabaseEventsInput) (*GetRelationalDatabaseEventsOutput, error) {
+ req, out := c.GetRelationalDatabaseEventsRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseEventsWithContext is the same as GetRelationalDatabaseEvents with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseEvents 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 *Lightsail) GetRelationalDatabaseEventsWithContext(ctx aws.Context, input *GetRelationalDatabaseEventsInput, opts ...request.Option) (*GetRelationalDatabaseEventsOutput, error) {
+ req, out := c.GetRelationalDatabaseEventsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseLogEvents = "GetRelationalDatabaseLogEvents"
+
+// GetRelationalDatabaseLogEventsRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseLogEvents 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 GetRelationalDatabaseLogEvents for more information on using the GetRelationalDatabaseLogEvents
+// 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 GetRelationalDatabaseLogEventsRequest method.
+// req, resp := client.GetRelationalDatabaseLogEventsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents
+func (c *Lightsail) GetRelationalDatabaseLogEventsRequest(input *GetRelationalDatabaseLogEventsInput) (req *request.Request, output *GetRelationalDatabaseLogEventsOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseLogEvents,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseLogEventsInput{}
+ }
+
+ output = &GetRelationalDatabaseLogEventsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseLogEvents API operation for Amazon Lightsail.
+//
+// Returns a list of log events for a database in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseLogEvents for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents
+func (c *Lightsail) GetRelationalDatabaseLogEvents(input *GetRelationalDatabaseLogEventsInput) (*GetRelationalDatabaseLogEventsOutput, error) {
+ req, out := c.GetRelationalDatabaseLogEventsRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseLogEventsWithContext is the same as GetRelationalDatabaseLogEvents with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseLogEvents 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 *Lightsail) GetRelationalDatabaseLogEventsWithContext(ctx aws.Context, input *GetRelationalDatabaseLogEventsInput, opts ...request.Option) (*GetRelationalDatabaseLogEventsOutput, error) {
+ req, out := c.GetRelationalDatabaseLogEventsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseLogStreams = "GetRelationalDatabaseLogStreams"
+
+// GetRelationalDatabaseLogStreamsRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseLogStreams 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 GetRelationalDatabaseLogStreams for more information on using the GetRelationalDatabaseLogStreams
+// 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 GetRelationalDatabaseLogStreamsRequest method.
+// req, resp := client.GetRelationalDatabaseLogStreamsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams
+func (c *Lightsail) GetRelationalDatabaseLogStreamsRequest(input *GetRelationalDatabaseLogStreamsInput) (req *request.Request, output *GetRelationalDatabaseLogStreamsOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseLogStreams,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseLogStreamsInput{}
+ }
+
+ output = &GetRelationalDatabaseLogStreamsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseLogStreams API operation for Amazon Lightsail.
+//
+// Returns a list of available log streams for a specific database in Amazon
+// Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseLogStreams for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams
+func (c *Lightsail) GetRelationalDatabaseLogStreams(input *GetRelationalDatabaseLogStreamsInput) (*GetRelationalDatabaseLogStreamsOutput, error) {
+ req, out := c.GetRelationalDatabaseLogStreamsRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseLogStreamsWithContext is the same as GetRelationalDatabaseLogStreams with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseLogStreams 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 *Lightsail) GetRelationalDatabaseLogStreamsWithContext(ctx aws.Context, input *GetRelationalDatabaseLogStreamsInput, opts ...request.Option) (*GetRelationalDatabaseLogStreamsOutput, error) {
+ req, out := c.GetRelationalDatabaseLogStreamsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseMasterUserPassword = "GetRelationalDatabaseMasterUserPassword"
+
+// GetRelationalDatabaseMasterUserPasswordRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseMasterUserPassword 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 GetRelationalDatabaseMasterUserPassword for more information on using the GetRelationalDatabaseMasterUserPassword
+// 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 GetRelationalDatabaseMasterUserPasswordRequest method.
+// req, resp := client.GetRelationalDatabaseMasterUserPasswordRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword
+func (c *Lightsail) GetRelationalDatabaseMasterUserPasswordRequest(input *GetRelationalDatabaseMasterUserPasswordInput) (req *request.Request, output *GetRelationalDatabaseMasterUserPasswordOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseMasterUserPassword,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseMasterUserPasswordInput{}
+ }
+
+ output = &GetRelationalDatabaseMasterUserPasswordOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseMasterUserPassword API operation for Amazon Lightsail.
+//
+// Returns the current, previous, or pending versions of the master user password
+// for a Lightsail database.
+//
+// The asdf operation GetRelationalDatabaseMasterUserPassword supports tag-based
+// access control via resource tags applied to the resource identified by relationalDatabaseName.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseMasterUserPassword for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword
+func (c *Lightsail) GetRelationalDatabaseMasterUserPassword(input *GetRelationalDatabaseMasterUserPasswordInput) (*GetRelationalDatabaseMasterUserPasswordOutput, error) {
+ req, out := c.GetRelationalDatabaseMasterUserPasswordRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseMasterUserPasswordWithContext is the same as GetRelationalDatabaseMasterUserPassword with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseMasterUserPassword 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 *Lightsail) GetRelationalDatabaseMasterUserPasswordWithContext(ctx aws.Context, input *GetRelationalDatabaseMasterUserPasswordInput, opts ...request.Option) (*GetRelationalDatabaseMasterUserPasswordOutput, error) {
+ req, out := c.GetRelationalDatabaseMasterUserPasswordRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseMetricData = "GetRelationalDatabaseMetricData"
+
+// GetRelationalDatabaseMetricDataRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseMetricData 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 GetRelationalDatabaseMetricData for more information on using the GetRelationalDatabaseMetricData
+// 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 GetRelationalDatabaseMetricDataRequest method.
+// req, resp := client.GetRelationalDatabaseMetricDataRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData
+func (c *Lightsail) GetRelationalDatabaseMetricDataRequest(input *GetRelationalDatabaseMetricDataInput) (req *request.Request, output *GetRelationalDatabaseMetricDataOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseMetricData,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseMetricDataInput{}
+ }
+
+ output = &GetRelationalDatabaseMetricDataOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseMetricData API operation for Amazon Lightsail.
+//
+// Returns the data points of the specified metric for a database in Amazon
+// Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseMetricData for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData
+func (c *Lightsail) GetRelationalDatabaseMetricData(input *GetRelationalDatabaseMetricDataInput) (*GetRelationalDatabaseMetricDataOutput, error) {
+ req, out := c.GetRelationalDatabaseMetricDataRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseMetricDataWithContext is the same as GetRelationalDatabaseMetricData with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseMetricData 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 *Lightsail) GetRelationalDatabaseMetricDataWithContext(ctx aws.Context, input *GetRelationalDatabaseMetricDataInput, opts ...request.Option) (*GetRelationalDatabaseMetricDataOutput, error) {
+ req, out := c.GetRelationalDatabaseMetricDataRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseParameters = "GetRelationalDatabaseParameters"
+
+// GetRelationalDatabaseParametersRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseParameters 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 GetRelationalDatabaseParameters for more information on using the GetRelationalDatabaseParameters
+// 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 GetRelationalDatabaseParametersRequest method.
+// req, resp := client.GetRelationalDatabaseParametersRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters
+func (c *Lightsail) GetRelationalDatabaseParametersRequest(input *GetRelationalDatabaseParametersInput) (req *request.Request, output *GetRelationalDatabaseParametersOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseParameters,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseParametersInput{}
+ }
+
+ output = &GetRelationalDatabaseParametersOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseParameters API operation for Amazon Lightsail.
+//
+// Returns all of the runtime parameters offered by the underlying database
+// software, or engine, for a specific database in Amazon Lightsail.
+//
+// In addition to the parameter names and values, this operation returns other
+// information about each parameter. This information includes whether changes
+// require a reboot, whether the parameter is modifiable, the allowed values,
+// and the data types.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseParameters for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters
+func (c *Lightsail) GetRelationalDatabaseParameters(input *GetRelationalDatabaseParametersInput) (*GetRelationalDatabaseParametersOutput, error) {
+ req, out := c.GetRelationalDatabaseParametersRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseParametersWithContext is the same as GetRelationalDatabaseParameters with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseParameters 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 *Lightsail) GetRelationalDatabaseParametersWithContext(ctx aws.Context, input *GetRelationalDatabaseParametersInput, opts ...request.Option) (*GetRelationalDatabaseParametersOutput, error) {
+ req, out := c.GetRelationalDatabaseParametersRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseSnapshot = "GetRelationalDatabaseSnapshot"
+
+// GetRelationalDatabaseSnapshotRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseSnapshot 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 GetRelationalDatabaseSnapshot for more information on using the GetRelationalDatabaseSnapshot
+// 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 GetRelationalDatabaseSnapshotRequest method.
+// req, resp := client.GetRelationalDatabaseSnapshotRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot
+func (c *Lightsail) GetRelationalDatabaseSnapshotRequest(input *GetRelationalDatabaseSnapshotInput) (req *request.Request, output *GetRelationalDatabaseSnapshotOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseSnapshot,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseSnapshotInput{}
+ }
+
+ output = &GetRelationalDatabaseSnapshotOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseSnapshot API operation for Amazon Lightsail.
+//
+// Returns information about a specific database snapshot in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseSnapshot for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot
+func (c *Lightsail) GetRelationalDatabaseSnapshot(input *GetRelationalDatabaseSnapshotInput) (*GetRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.GetRelationalDatabaseSnapshotRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseSnapshotWithContext is the same as GetRelationalDatabaseSnapshot with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseSnapshot 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 *Lightsail) GetRelationalDatabaseSnapshotWithContext(ctx aws.Context, input *GetRelationalDatabaseSnapshotInput, opts ...request.Option) (*GetRelationalDatabaseSnapshotOutput, error) {
+ req, out := c.GetRelationalDatabaseSnapshotRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabaseSnapshots = "GetRelationalDatabaseSnapshots"
+
+// GetRelationalDatabaseSnapshotsRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabaseSnapshots 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 GetRelationalDatabaseSnapshots for more information on using the GetRelationalDatabaseSnapshots
+// 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 GetRelationalDatabaseSnapshotsRequest method.
+// req, resp := client.GetRelationalDatabaseSnapshotsRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots
+func (c *Lightsail) GetRelationalDatabaseSnapshotsRequest(input *GetRelationalDatabaseSnapshotsInput) (req *request.Request, output *GetRelationalDatabaseSnapshotsOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabaseSnapshots,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabaseSnapshotsInput{}
+ }
+
+ output = &GetRelationalDatabaseSnapshotsOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabaseSnapshots API operation for Amazon Lightsail.
+//
+// Returns information about all of your database snapshots in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabaseSnapshots for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots
+func (c *Lightsail) GetRelationalDatabaseSnapshots(input *GetRelationalDatabaseSnapshotsInput) (*GetRelationalDatabaseSnapshotsOutput, error) {
+ req, out := c.GetRelationalDatabaseSnapshotsRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabaseSnapshotsWithContext is the same as GetRelationalDatabaseSnapshots with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabaseSnapshots 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 *Lightsail) GetRelationalDatabaseSnapshotsWithContext(ctx aws.Context, input *GetRelationalDatabaseSnapshotsInput, opts ...request.Option) (*GetRelationalDatabaseSnapshotsOutput, error) {
+ req, out := c.GetRelationalDatabaseSnapshotsRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opGetRelationalDatabases = "GetRelationalDatabases"
+
+// GetRelationalDatabasesRequest generates a "aws/request.Request" representing the
+// client's request for the GetRelationalDatabases 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 GetRelationalDatabases for more information on using the GetRelationalDatabases
+// 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 GetRelationalDatabasesRequest method.
+// req, resp := client.GetRelationalDatabasesRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases
+func (c *Lightsail) GetRelationalDatabasesRequest(input *GetRelationalDatabasesInput) (req *request.Request, output *GetRelationalDatabasesOutput) {
+ op := &request.Operation{
+ Name: opGetRelationalDatabases,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetRelationalDatabasesInput{}
+ }
+
+ output = &GetRelationalDatabasesOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetRelationalDatabases API operation for Amazon Lightsail.
+//
+// Returns information about all of your databases in Amazon Lightsail.
+//
+// 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 Lightsail's
+// API operation GetRelationalDatabases for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases
+func (c *Lightsail) GetRelationalDatabases(input *GetRelationalDatabasesInput) (*GetRelationalDatabasesOutput, error) {
+ req, out := c.GetRelationalDatabasesRequest(input)
+ return out, req.Send()
+}
+
+// GetRelationalDatabasesWithContext is the same as GetRelationalDatabases with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetRelationalDatabases 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 *Lightsail) GetRelationalDatabasesWithContext(ctx aws.Context, input *GetRelationalDatabasesInput, opts ...request.Option) (*GetRelationalDatabasesOutput, error) {
+ req, out := c.GetRelationalDatabasesRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetStaticIp = "GetStaticIp"
// GetStaticIpRequest generates a "aws/request.Request" representing the
// client's request for the GetStaticIp operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6141,7 +8738,7 @@ const opGetStaticIps = "GetStaticIps"
// GetStaticIpsRequest generates a "aws/request.Request" representing the
// client's request for the GetStaticIps operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6245,7 +8842,7 @@ const opImportKeyPair = "ImportKeyPair"
// ImportKeyPairRequest generates a "aws/request.Request" representing the
// client's request for the ImportKeyPair operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6349,7 +8946,7 @@ const opIsVpcPeered = "IsVpcPeered"
// IsVpcPeeredRequest generates a "aws/request.Request" representing the
// client's request for the IsVpcPeered operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6453,7 +9050,7 @@ const opOpenInstancePublicPorts = "OpenInstancePublicPorts"
// OpenInstancePublicPortsRequest generates a "aws/request.Request" representing the
// client's request for the OpenInstancePublicPorts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6494,6 +9091,10 @@ func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPort
//
// Adds public ports to an Amazon Lightsail instance.
//
+// The open instance public ports operation supports tag-based access control
+// via resource tags applied to the resource identified by instanceName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -6557,7 +9158,7 @@ const opPeerVpc = "PeerVpc"
// PeerVpcRequest generates a "aws/request.Request" representing the
// client's request for the PeerVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6661,7 +9262,7 @@ const opPutInstancePublicPorts = "PutInstancePublicPorts"
// PutInstancePublicPortsRequest generates a "aws/request.Request" representing the
// client's request for the PutInstancePublicPorts operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6703,6 +9304,10 @@ func (c *Lightsail) PutInstancePublicPortsRequest(input *PutInstancePublicPortsI
// Sets the specified open ports for an Amazon Lightsail instance, and closes
// all ports for every protocol not included in the current request.
//
+// The put instance public ports operation supports tag-based access control
+// via resource tags applied to the resource identified by instanceName. For
+// more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -6766,7 +9371,7 @@ const opRebootInstance = "RebootInstance"
// RebootInstanceRequest generates a "aws/request.Request" representing the
// client's request for the RebootInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6805,10 +9410,11 @@ func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) (req *requ
// RebootInstance API operation for Amazon Lightsail.
//
-// Restarts a specific instance. When your Amazon Lightsail instance is finished
-// rebooting, Lightsail assigns a new public IP address. To use the same IP
-// address after restarting, create a static IP address and attach it to the
-// instance.
+// Restarts a specific instance.
+//
+// The reboot instance operation supports tag-based access control via resource
+// tags applied to the resource identified by instanceName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
//
// 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
@@ -6868,12 +9474,120 @@ func (c *Lightsail) RebootInstanceWithContext(ctx aws.Context, input *RebootInst
return out, req.Send()
}
+const opRebootRelationalDatabase = "RebootRelationalDatabase"
+
+// RebootRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the RebootRelationalDatabase 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 RebootRelationalDatabase for more information on using the RebootRelationalDatabase
+// 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 RebootRelationalDatabaseRequest method.
+// req, resp := client.RebootRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase
+func (c *Lightsail) RebootRelationalDatabaseRequest(input *RebootRelationalDatabaseInput) (req *request.Request, output *RebootRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opRebootRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &RebootRelationalDatabaseInput{}
+ }
+
+ output = &RebootRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// RebootRelationalDatabase API operation for Amazon Lightsail.
+//
+// Restarts a specific database in Amazon Lightsail.
+//
+// The reboot relational database operation supports tag-based access control
+// via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation RebootRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase
+func (c *Lightsail) RebootRelationalDatabase(input *RebootRelationalDatabaseInput) (*RebootRelationalDatabaseOutput, error) {
+ req, out := c.RebootRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// RebootRelationalDatabaseWithContext is the same as RebootRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See RebootRelationalDatabase 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 *Lightsail) RebootRelationalDatabaseWithContext(ctx aws.Context, input *RebootRelationalDatabaseInput, opts ...request.Option) (*RebootRelationalDatabaseOutput, error) {
+ req, out := c.RebootRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opReleaseStaticIp = "ReleaseStaticIp"
// ReleaseStaticIpRequest generates a "aws/request.Request" representing the
// client's request for the ReleaseStaticIp operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -6977,7 +9691,7 @@ const opStartInstance = "StartInstance"
// StartInstanceRequest generates a "aws/request.Request" representing the
// client's request for the StartInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7019,6 +9733,15 @@ func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *reques
// Starts a specific Amazon Lightsail instance from a stopped state. To restart
// an instance, use the reboot instance operation.
//
+// When you start a stopped instance, Lightsail assigns a new public IP address
+// to the instance. To use the same IP address after stopping and starting an
+// instance, create a static IP address and attach it to the instance. For more
+// information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/lightsail-create-static-ip).
+//
+// The start instance operation supports tag-based access control via resource
+// tags applied to the resource identified by instanceName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -7077,12 +9800,121 @@ func (c *Lightsail) StartInstanceWithContext(ctx aws.Context, input *StartInstan
return out, req.Send()
}
+const opStartRelationalDatabase = "StartRelationalDatabase"
+
+// StartRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the StartRelationalDatabase 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 StartRelationalDatabase for more information on using the StartRelationalDatabase
+// 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 StartRelationalDatabaseRequest method.
+// req, resp := client.StartRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase
+func (c *Lightsail) StartRelationalDatabaseRequest(input *StartRelationalDatabaseInput) (req *request.Request, output *StartRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opStartRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &StartRelationalDatabaseInput{}
+ }
+
+ output = &StartRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// StartRelationalDatabase API operation for Amazon Lightsail.
+//
+// Starts a specific database from a stopped state in Amazon Lightsail. To restart
+// a database, use the reboot relational database operation.
+//
+// The start relational database operation supports tag-based access control
+// via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation StartRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase
+func (c *Lightsail) StartRelationalDatabase(input *StartRelationalDatabaseInput) (*StartRelationalDatabaseOutput, error) {
+ req, out := c.StartRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// StartRelationalDatabaseWithContext is the same as StartRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See StartRelationalDatabase 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 *Lightsail) StartRelationalDatabaseWithContext(ctx aws.Context, input *StartRelationalDatabaseInput, opts ...request.Option) (*StartRelationalDatabaseOutput, error) {
+ req, out := c.StartRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opStopInstance = "StopInstance"
// StopInstanceRequest generates a "aws/request.Request" representing the
// client's request for the StopInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7123,6 +9955,15 @@ func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) (req *request.
//
// Stops a specific Amazon Lightsail instance that is currently running.
//
+// When you start a stopped instance, Lightsail assigns a new public IP address
+// to the instance. To use the same IP address after stopping and starting an
+// instance, create a static IP address and attach it to the instance. For more
+// information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/lightsail-create-static-ip).
+//
+// The stop instance operation supports tag-based access control via resource
+// tags applied to the resource identified by instanceName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -7181,12 +10022,231 @@ func (c *Lightsail) StopInstanceWithContext(ctx aws.Context, input *StopInstance
return out, req.Send()
}
+const opStopRelationalDatabase = "StopRelationalDatabase"
+
+// StopRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the StopRelationalDatabase 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 StopRelationalDatabase for more information on using the StopRelationalDatabase
+// 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 StopRelationalDatabaseRequest method.
+// req, resp := client.StopRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase
+func (c *Lightsail) StopRelationalDatabaseRequest(input *StopRelationalDatabaseInput) (req *request.Request, output *StopRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opStopRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &StopRelationalDatabaseInput{}
+ }
+
+ output = &StopRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// StopRelationalDatabase API operation for Amazon Lightsail.
+//
+// Stops a specific database that is currently running in Amazon Lightsail.
+//
+// The stop relational database operation supports tag-based access control
+// via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation StopRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase
+func (c *Lightsail) StopRelationalDatabase(input *StopRelationalDatabaseInput) (*StopRelationalDatabaseOutput, error) {
+ req, out := c.StopRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// StopRelationalDatabaseWithContext is the same as StopRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See StopRelationalDatabase 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 *Lightsail) StopRelationalDatabaseWithContext(ctx aws.Context, input *StopRelationalDatabaseInput, opts ...request.Option) (*StopRelationalDatabaseOutput, error) {
+ req, out := c.StopRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opTagResource = "TagResource"
+
+// TagResourceRequest generates a "aws/request.Request" representing the
+// client's request for the TagResource 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 TagResource for more information on using the TagResource
+// 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 TagResourceRequest method.
+// req, resp := client.TagResourceRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/TagResource
+func (c *Lightsail) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) {
+ op := &request.Operation{
+ Name: opTagResource,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &TagResourceInput{}
+ }
+
+ output = &TagResourceOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// TagResource API operation for Amazon Lightsail.
+//
+// Adds one or more tags to the specified Amazon Lightsail resource. Each resource
+// can have a maximum of 50 tags. Each tag consists of a key and an optional
+// value. Tag keys must be unique per resource. For more information about tags,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+//
+// The tag resource operation supports tag-based access control via request
+// tags and resource tags applied to the resource identified by resourceName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation TagResource for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/TagResource
+func (c *Lightsail) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
+ req, out := c.TagResourceRequest(input)
+ return out, req.Send()
+}
+
+// TagResourceWithContext is the same as TagResource with the addition of
+// the ability to pass a context and additional request options.
+//
+// See TagResource 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 *Lightsail) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {
+ req, out := c.TagResourceRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opUnpeerVpc = "UnpeerVpc"
// UnpeerVpcRequest generates a "aws/request.Request" representing the
// client's request for the UnpeerVpc operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7285,12 +10345,121 @@ func (c *Lightsail) UnpeerVpcWithContext(ctx aws.Context, input *UnpeerVpcInput,
return out, req.Send()
}
+const opUntagResource = "UntagResource"
+
+// UntagResourceRequest generates a "aws/request.Request" representing the
+// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource
+// 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 UntagResourceRequest method.
+// req, resp := client.UntagResourceRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UntagResource
+func (c *Lightsail) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) {
+ op := &request.Operation{
+ Name: opUntagResource,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UntagResourceInput{}
+ }
+
+ output = &UntagResourceOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// UntagResource API operation for Amazon Lightsail.
+//
+// Deletes the specified set of tag keys and their values from the specified
+// Amazon Lightsail resource.
+//
+// The untag resource operation supports tag-based access control via request
+// tags and resource tags applied to the resource identified by resourceName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation UntagResource for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UntagResource
+func (c *Lightsail) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) {
+ req, out := c.UntagResourceRequest(input)
+ return out, req.Send()
+}
+
+// UntagResourceWithContext is the same as UntagResource with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UntagResource 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 *Lightsail) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {
+ req, out := c.UntagResourceRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opUpdateDomainEntry = "UpdateDomainEntry"
// UpdateDomainEntryRequest generates a "aws/request.Request" representing the
// client's request for the UpdateDomainEntry operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7331,6 +10500,10 @@ func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) (req
//
// Updates a domain recordset after it is created.
//
+// The update domain entry operation supports tag-based access control via resource
+// tags applied to the resource identified by domainName. For more information,
+// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -7394,7 +10567,7 @@ const opUpdateLoadBalancerAttribute = "UpdateLoadBalancerAttribute"
// UpdateLoadBalancerAttributeRequest generates a "aws/request.Request" representing the
// client's request for the UpdateLoadBalancerAttribute operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -7436,6 +10609,10 @@ func (c *Lightsail) UpdateLoadBalancerAttributeRequest(input *UpdateLoadBalancer
// Updates the specified attribute for a load balancer. You can only update
// one attribute at a time.
//
+// The update load balancer attribute operation supports tag-based access control
+// via resource tags applied to the resource identified by loadBalancerName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
// 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.
@@ -7494,6 +10671,232 @@ func (c *Lightsail) UpdateLoadBalancerAttributeWithContext(ctx aws.Context, inpu
return out, req.Send()
}
+const opUpdateRelationalDatabase = "UpdateRelationalDatabase"
+
+// UpdateRelationalDatabaseRequest generates a "aws/request.Request" representing the
+// client's request for the UpdateRelationalDatabase 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 UpdateRelationalDatabase for more information on using the UpdateRelationalDatabase
+// 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 UpdateRelationalDatabaseRequest method.
+// req, resp := client.UpdateRelationalDatabaseRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase
+func (c *Lightsail) UpdateRelationalDatabaseRequest(input *UpdateRelationalDatabaseInput) (req *request.Request, output *UpdateRelationalDatabaseOutput) {
+ op := &request.Operation{
+ Name: opUpdateRelationalDatabase,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UpdateRelationalDatabaseInput{}
+ }
+
+ output = &UpdateRelationalDatabaseOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// UpdateRelationalDatabase API operation for Amazon Lightsail.
+//
+// Allows the update of one or more attributes of a database in Amazon Lightsail.
+//
+// Updates are applied immediately, or in cases where the updates could result
+// in an outage, are applied during the database's predefined maintenance window.
+//
+// The update relational database operation supports tag-based access control
+// via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation UpdateRelationalDatabase for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase
+func (c *Lightsail) UpdateRelationalDatabase(input *UpdateRelationalDatabaseInput) (*UpdateRelationalDatabaseOutput, error) {
+ req, out := c.UpdateRelationalDatabaseRequest(input)
+ return out, req.Send()
+}
+
+// UpdateRelationalDatabaseWithContext is the same as UpdateRelationalDatabase with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UpdateRelationalDatabase 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 *Lightsail) UpdateRelationalDatabaseWithContext(ctx aws.Context, input *UpdateRelationalDatabaseInput, opts ...request.Option) (*UpdateRelationalDatabaseOutput, error) {
+ req, out := c.UpdateRelationalDatabaseRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
+const opUpdateRelationalDatabaseParameters = "UpdateRelationalDatabaseParameters"
+
+// UpdateRelationalDatabaseParametersRequest generates a "aws/request.Request" representing the
+// client's request for the UpdateRelationalDatabaseParameters 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 UpdateRelationalDatabaseParameters for more information on using the UpdateRelationalDatabaseParameters
+// 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 UpdateRelationalDatabaseParametersRequest method.
+// req, resp := client.UpdateRelationalDatabaseParametersRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters
+func (c *Lightsail) UpdateRelationalDatabaseParametersRequest(input *UpdateRelationalDatabaseParametersInput) (req *request.Request, output *UpdateRelationalDatabaseParametersOutput) {
+ op := &request.Operation{
+ Name: opUpdateRelationalDatabaseParameters,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &UpdateRelationalDatabaseParametersInput{}
+ }
+
+ output = &UpdateRelationalDatabaseParametersOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// UpdateRelationalDatabaseParameters API operation for Amazon Lightsail.
+//
+// Allows the update of one or more parameters of a database in Amazon Lightsail.
+//
+// Parameter updates don't cause outages; therefore, their application is not
+// subject to the preferred maintenance window. However, there are two ways
+// in which paramater updates are applied: dynamic or pending-reboot. Parameters
+// marked with a dynamic apply type are applied immediately. Parameters marked
+// with a pending-reboot apply type are applied only after the database is rebooted
+// using the reboot relational database operation.
+//
+// The update relational database parameters operation supports tag-based access
+// control via resource tags applied to the resource identified by relationalDatabaseName.
+// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags).
+//
+// 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 Lightsail's
+// API operation UpdateRelationalDatabaseParameters for usage and error information.
+//
+// Returned Error Codes:
+// * ErrCodeServiceException "ServiceException"
+// A general service exception.
+//
+// * ErrCodeInvalidInputException "InvalidInputException"
+// Lightsail throws this exception when user input does not conform to the validation
+// rules of an input field.
+//
+// Domain-related APIs are only available in the N. Virginia (us-east-1) Region.
+// Please set your AWS Region configuration to us-east-1 to create, view, or
+// edit these resources.
+//
+// * ErrCodeNotFoundException "NotFoundException"
+// Lightsail throws this exception when it cannot find a resource.
+//
+// * ErrCodeOperationFailureException "OperationFailureException"
+// Lightsail throws this exception when an operation fails to execute.
+//
+// * ErrCodeAccessDeniedException "AccessDeniedException"
+// Lightsail throws this exception when the user cannot be authenticated or
+// uses invalid credentials to access a resource.
+//
+// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException"
+// Lightsail throws this exception when an account is still in the setup in
+// progress state.
+//
+// * ErrCodeUnauthenticatedException "UnauthenticatedException"
+// Lightsail throws this exception when the user has not been authenticated.
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters
+func (c *Lightsail) UpdateRelationalDatabaseParameters(input *UpdateRelationalDatabaseParametersInput) (*UpdateRelationalDatabaseParametersOutput, error) {
+ req, out := c.UpdateRelationalDatabaseParametersRequest(input)
+ return out, req.Send()
+}
+
+// UpdateRelationalDatabaseParametersWithContext is the same as UpdateRelationalDatabaseParameters with the addition of
+// the ability to pass a context and additional request options.
+//
+// See UpdateRelationalDatabaseParameters 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 *Lightsail) UpdateRelationalDatabaseParametersWithContext(ctx aws.Context, input *UpdateRelationalDatabaseParametersInput, opts ...request.Option) (*UpdateRelationalDatabaseParametersOutput, error) {
+ req, out := c.UpdateRelationalDatabaseParametersRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
type AllocateStaticIpInput struct {
_ struct{} `type:"structure"`
@@ -7928,9 +11331,10 @@ type Blueprint struct {
// The group name of the blueprint (e.g., amazon-linux).
Group *string `locationName:"group" type:"string"`
- // A Boolean value indicating whether the blueprint is active. When you update
- // your blueprints, you will inactivate old blueprints and keep the most recent
- // versions active.
+ // A Boolean value indicating whether the blueprint is active. Inactive blueprints
+ // are listed to support customers with existing instances but are not necessarily
+ // available for launch of new instances. Blueprints are marked inactive when
+ // they become outdated due to operating system updates or new application releases.
IsActive *bool `locationName:"isActive" type:"boolean"`
// The end-user license agreement URL for the image or blueprint.
@@ -8242,6 +11646,307 @@ func (s *CloseInstancePublicPortsOutput) SetOperation(v *Operation) *CloseInstan
return s
}
+// Describes a CloudFormation stack record created as a result of the create
+// cloud formation stack operation.
+//
+// A CloudFormation stack record provides information about the AWS CloudFormation
+// stack used to create a new Amazon Elastic Compute Cloud instance from an
+// exported Lightsail instance snapshot.
+type CloudFormationStackRecord struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the CloudFormation stack record.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // The date when the CloudFormation stack record was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // A list of objects describing the destination service, which is AWS CloudFormation,
+ // and the Amazon Resource Name (ARN) of the AWS CloudFormation stack.
+ DestinationInfo *DestinationInfo `locationName:"destinationInfo" type:"structure"`
+
+ // A list of objects describing the Availability Zone and AWS Region of the
+ // CloudFormation stack record.
+ Location *ResourceLocation `locationName:"location" type:"structure"`
+
+ // The name of the CloudFormation stack record. It starts with CloudFormationStackRecord
+ // followed by a GUID.
+ Name *string `locationName:"name" type:"string"`
+
+ // The Lightsail resource type (e.g., CloudFormationStackRecord).
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"`
+
+ // A list of objects describing the source of the CloudFormation stack record.
+ SourceInfo []*CloudFormationStackRecordSourceInfo `locationName:"sourceInfo" type:"list"`
+
+ // The current state of the CloudFormation stack record.
+ State *string `locationName:"state" type:"string" enum:"RecordState"`
+}
+
+// String returns the string representation
+func (s CloudFormationStackRecord) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CloudFormationStackRecord) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *CloudFormationStackRecord) SetArn(v string) *CloudFormationStackRecord {
+ s.Arn = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *CloudFormationStackRecord) SetCreatedAt(v time.Time) *CloudFormationStackRecord {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetDestinationInfo sets the DestinationInfo field's value.
+func (s *CloudFormationStackRecord) SetDestinationInfo(v *DestinationInfo) *CloudFormationStackRecord {
+ s.DestinationInfo = v
+ return s
+}
+
+// SetLocation sets the Location field's value.
+func (s *CloudFormationStackRecord) SetLocation(v *ResourceLocation) *CloudFormationStackRecord {
+ s.Location = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *CloudFormationStackRecord) SetName(v string) *CloudFormationStackRecord {
+ s.Name = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *CloudFormationStackRecord) SetResourceType(v string) *CloudFormationStackRecord {
+ s.ResourceType = &v
+ return s
+}
+
+// SetSourceInfo sets the SourceInfo field's value.
+func (s *CloudFormationStackRecord) SetSourceInfo(v []*CloudFormationStackRecordSourceInfo) *CloudFormationStackRecord {
+ s.SourceInfo = v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *CloudFormationStackRecord) SetState(v string) *CloudFormationStackRecord {
+ s.State = &v
+ return s
+}
+
+// Describes the source of a CloudFormation stack record (i.e., the export snapshot
+// record).
+type CloudFormationStackRecordSourceInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the export snapshot record.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // The name of the record.
+ Name *string `locationName:"name" type:"string"`
+
+ // The Lightsail resource type (e.g., ExportSnapshotRecord).
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"CloudFormationStackRecordSourceType"`
+}
+
+// String returns the string representation
+func (s CloudFormationStackRecordSourceInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CloudFormationStackRecordSourceInfo) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *CloudFormationStackRecordSourceInfo) SetArn(v string) *CloudFormationStackRecordSourceInfo {
+ s.Arn = &v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *CloudFormationStackRecordSourceInfo) SetName(v string) *CloudFormationStackRecordSourceInfo {
+ s.Name = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *CloudFormationStackRecordSourceInfo) SetResourceType(v string) *CloudFormationStackRecordSourceInfo {
+ s.ResourceType = &v
+ return s
+}
+
+type CopySnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The AWS Region where the source snapshot is located.
+ //
+ // SourceRegion is a required field
+ SourceRegion *string `locationName:"sourceRegion" type:"string" required:"true" enum:"RegionName"`
+
+ // The name of the source instance or disk snapshot to be copied.
+ //
+ // SourceSnapshotName is a required field
+ SourceSnapshotName *string `locationName:"sourceSnapshotName" type:"string" required:"true"`
+
+ // The name of the new instance or disk snapshot to be created as a copy.
+ //
+ // TargetSnapshotName is a required field
+ TargetSnapshotName *string `locationName:"targetSnapshotName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s CopySnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CopySnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CopySnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CopySnapshotInput"}
+ if s.SourceRegion == nil {
+ invalidParams.Add(request.NewErrParamRequired("SourceRegion"))
+ }
+ if s.SourceSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("SourceSnapshotName"))
+ }
+ if s.TargetSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("TargetSnapshotName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetSourceRegion sets the SourceRegion field's value.
+func (s *CopySnapshotInput) SetSourceRegion(v string) *CopySnapshotInput {
+ s.SourceRegion = &v
+ return s
+}
+
+// SetSourceSnapshotName sets the SourceSnapshotName field's value.
+func (s *CopySnapshotInput) SetSourceSnapshotName(v string) *CopySnapshotInput {
+ s.SourceSnapshotName = &v
+ return s
+}
+
+// SetTargetSnapshotName sets the TargetSnapshotName field's value.
+func (s *CopySnapshotInput) SetTargetSnapshotName(v string) *CopySnapshotInput {
+ s.TargetSnapshotName = &v
+ return s
+}
+
+type CopySnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s CopySnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CopySnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *CopySnapshotOutput) SetOperations(v []*Operation) *CopySnapshotOutput {
+ s.Operations = v
+ return s
+}
+
+type CreateCloudFormationStackInput struct {
+ _ struct{} `type:"structure"`
+
+ // An array of parameters that will be used to create the new Amazon EC2 instance.
+ // You can only pass one instance entry at a time in this array. You will get
+ // an invalid parameter error if you pass more than one instance entry in this
+ // array.
+ //
+ // Instances is a required field
+ Instances []*InstanceEntry `locationName:"instances" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s CreateCloudFormationStackInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateCloudFormationStackInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateCloudFormationStackInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateCloudFormationStackInput"}
+ if s.Instances == nil {
+ invalidParams.Add(request.NewErrParamRequired("Instances"))
+ }
+ if s.Instances != nil {
+ for i, v := range s.Instances {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Instances", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetInstances sets the Instances field's value.
+func (s *CreateCloudFormationStackInput) SetInstances(v []*InstanceEntry) *CreateCloudFormationStackInput {
+ s.Instances = v
+ return s
+}
+
+type CreateCloudFormationStackOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateCloudFormationStackOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateCloudFormationStackOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *CreateCloudFormationStackOutput) SetOperations(v []*Operation) *CreateCloudFormationStackOutput {
+ s.Operations = v
+ return s
+}
+
type CreateDiskFromSnapshotInput struct {
_ struct{} `type:"structure"`
@@ -8270,6 +11975,11 @@ type CreateDiskFromSnapshotInput struct {
//
// SizeInGb is a required field
SizeInGb *int64 `locationName:"sizeInGb" type:"integer" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -8328,6 +12038,12 @@ func (s *CreateDiskFromSnapshotInput) SetSizeInGb(v int64) *CreateDiskFromSnapsh
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateDiskFromSnapshotInput) SetTags(v []*Tag) *CreateDiskFromSnapshotInput {
+ s.Tags = v
+ return s
+}
+
type CreateDiskFromSnapshotOutput struct {
_ struct{} `type:"structure"`
@@ -8373,6 +12089,11 @@ type CreateDiskInput struct {
//
// SizeInGb is a required field
SizeInGb *int64 `locationName:"sizeInGb" type:"integer" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -8422,6 +12143,12 @@ func (s *CreateDiskInput) SetSizeInGb(v int64) *CreateDiskInput {
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateDiskInput) SetTags(v []*Tag) *CreateDiskInput {
+ s.Tags = v
+ return s
+}
+
type CreateDiskOutput struct {
_ struct{} `type:"structure"`
@@ -8448,16 +12175,29 @@ func (s *CreateDiskOutput) SetOperations(v []*Operation) *CreateDiskOutput {
type CreateDiskSnapshotInput struct {
_ struct{} `type:"structure"`
- // The unique name of the source disk (e.g., my-source-disk).
+ // The unique name of the source disk (e.g., Disk-Virginia-1).
//
- // DiskName is a required field
- DiskName *string `locationName:"diskName" type:"string" required:"true"`
+ // This parameter cannot be defined together with the instance name parameter.
+ // The disk name and instance name parameters are mutually exclusive.
+ DiskName *string `locationName:"diskName" type:"string"`
// The name of the destination disk snapshot (e.g., my-disk-snapshot) based
// on the source disk.
//
// DiskSnapshotName is a required field
DiskSnapshotName *string `locationName:"diskSnapshotName" type:"string" required:"true"`
+
+ // The unique name of the source instance (e.g., Amazon_Linux-512MB-Virginia-1).
+ // When this is defined, a snapshot of the instance's system volume is created.
+ //
+ // This parameter cannot be defined together with the disk name parameter. The
+ // instance name and disk name parameters are mutually exclusive.
+ InstanceName *string `locationName:"instanceName" type:"string"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -8473,9 +12213,6 @@ func (s CreateDiskSnapshotInput) GoString() string {
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateDiskSnapshotInput) Validate() error {
invalidParams := request.ErrInvalidParams{Context: "CreateDiskSnapshotInput"}
- if s.DiskName == nil {
- invalidParams.Add(request.NewErrParamRequired("DiskName"))
- }
if s.DiskSnapshotName == nil {
invalidParams.Add(request.NewErrParamRequired("DiskSnapshotName"))
}
@@ -8498,6 +12235,18 @@ func (s *CreateDiskSnapshotInput) SetDiskSnapshotName(v string) *CreateDiskSnaps
return s
}
+// SetInstanceName sets the InstanceName field's value.
+func (s *CreateDiskSnapshotInput) SetInstanceName(v string) *CreateDiskSnapshotInput {
+ s.InstanceName = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CreateDiskSnapshotInput) SetTags(v []*Tag) *CreateDiskSnapshotInput {
+ s.Tags = v
+ return s
+}
+
type CreateDiskSnapshotOutput struct {
_ struct{} `type:"structure"`
@@ -8610,6 +12359,11 @@ type CreateDomainInput struct {
//
// DomainName is a required field
DomainName *string `locationName:"domainName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -8641,6 +12395,12 @@ func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput {
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateDomainInput) SetTags(v []*Tag) *CreateDomainInput {
+ s.Tags = v
+ return s
+}
+
type CreateDomainOutput struct {
_ struct{} `type:"structure"`
@@ -8677,6 +12437,11 @@ type CreateInstanceSnapshotInput struct {
//
// InstanceSnapshotName is a required field
InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -8717,6 +12482,12 @@ func (s *CreateInstanceSnapshotInput) SetInstanceSnapshotName(v string) *CreateI
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateInstanceSnapshotInput) SetTags(v []*Tag) *CreateInstanceSnapshotInput {
+ s.Tags = v
+ return s
+}
+
type CreateInstanceSnapshotOutput struct {
_ struct{} `type:"structure"`
@@ -8748,9 +12519,9 @@ type CreateInstancesFromSnapshotInput struct {
AttachedDiskMapping map[string][]*DiskMap `locationName:"attachedDiskMapping" type:"map"`
// The Availability Zone where you want to create your instances. Use the following
- // formatting: us-east-2a (case sensitive). You can get a list of availability
- // zones by using the get regions (http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html)
- // operation. Be sure to add the include availability zones parameter to your
+ // formatting: us-east-2a (case sensitive). You can get a list of Availability
+ // Zones by using the get regions (http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html)
+ // operation. Be sure to add the include Availability Zones parameter to your
// request.
//
// AvailabilityZone is a required field
@@ -8777,13 +12548,18 @@ type CreateInstancesFromSnapshotInput struct {
// The name for your key pair.
KeyPairName *string `locationName:"keyPairName" type:"string"`
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// You can create a launch script that configures a server with additional user
// data. For example, apt-get -y update.
//
// Depending on the machine image you choose, the command to get software on
// your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu
// use apt-get, and FreeBSD uses pkg. For a complete list, see the Dev Guide
- // (http://lightsail.aws.amazon.com/ls/docs/getting-started/articles/pre-installed-apps).
+ // (https://lightsail.aws.amazon.com/ls/docs/getting-started/article/compare-options-choose-lightsail-instance-image).
UserData *string `locationName:"userData" type:"string"`
}
@@ -8855,6 +12631,12 @@ func (s *CreateInstancesFromSnapshotInput) SetKeyPairName(v string) *CreateInsta
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateInstancesFromSnapshotInput) SetTags(v []*Tag) *CreateInstancesFromSnapshotInput {
+ s.Tags = v
+ return s
+}
+
// SetUserData sets the UserData field's value.
func (s *CreateInstancesFromSnapshotInput) SetUserData(v string) *CreateInstancesFromSnapshotInput {
s.UserData = &v
@@ -8889,9 +12671,9 @@ type CreateInstancesInput struct {
_ struct{} `type:"structure"`
// The Availability Zone in which to create your instance. Use the following
- // format: us-east-2a (case sensitive). You can get a list of availability zones
+ // format: us-east-2a (case sensitive). You can get a list of Availability Zones
// by using the get regions (http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html)
- // operation. Be sure to add the include availability zones parameter to your
+ // operation. Be sure to add the include Availability Zones parameter to your
// request.
//
// AvailabilityZone is a required field
@@ -8914,6 +12696,8 @@ type CreateInstancesInput struct {
//
// In releases prior to June 12, 2017, this parameter was ignored by the API.
// It is now deprecated.
+ //
+ // Deprecated: CustomImageName has been deprecated
CustomImageName *string `locationName:"customImageName" deprecated:"true" type:"string"`
// The names to use for your new Lightsail instances. Separate multiple values
@@ -8925,6 +12709,11 @@ type CreateInstancesInput struct {
// The name of your key pair.
KeyPairName *string `locationName:"keyPairName" type:"string"`
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// A launch script you can create that configures a server with additional user
// data. For example, you might want to run apt-get -y update.
//
@@ -9003,6 +12792,12 @@ func (s *CreateInstancesInput) SetKeyPairName(v string) *CreateInstancesInput {
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateInstancesInput) SetTags(v []*Tag) *CreateInstancesInput {
+ s.Tags = v
+ return s
+}
+
// SetUserData sets the UserData field's value.
func (s *CreateInstancesInput) SetUserData(v string) *CreateInstancesInput {
s.UserData = &v
@@ -9040,6 +12835,11 @@ type CreateKeyPairInput struct {
//
// KeyPairName is a required field
KeyPairName *string `locationName:"keyPairName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -9071,6 +12871,12 @@ func (s *CreateKeyPairInput) SetKeyPairName(v string) *CreateKeyPairInput {
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateKeyPairInput) SetTags(v []*Tag) *CreateKeyPairInput {
+ s.Tags = v
+ return s
+}
+
type CreateKeyPairOutput struct {
_ struct{} `type:"structure"`
@@ -9160,6 +12966,11 @@ type CreateLoadBalancerInput struct {
//
// LoadBalancerName is a required field
LoadBalancerName *string `locationName:"loadBalancerName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -9224,6 +13035,12 @@ func (s *CreateLoadBalancerInput) SetLoadBalancerName(v string) *CreateLoadBalan
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateLoadBalancerInput) SetTags(v []*Tag) *CreateLoadBalancerInput {
+ s.Tags = v
+ return s
+}
+
type CreateLoadBalancerOutput struct {
_ struct{} `type:"structure"`
@@ -9275,6 +13092,11 @@ type CreateLoadBalancerTlsCertificateInput struct {
//
// LoadBalancerName is a required field
LoadBalancerName *string `locationName:"loadBalancerName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -9330,6 +13152,12 @@ func (s *CreateLoadBalancerTlsCertificateInput) SetLoadBalancerName(v string) *C
return s
}
+// SetTags sets the Tags field's value.
+func (s *CreateLoadBalancerTlsCertificateInput) SetTags(v []*Tag) *CreateLoadBalancerTlsCertificateInput {
+ s.Tags = v
+ return s
+}
+
type CreateLoadBalancerTlsCertificateOutput struct {
_ struct{} `type:"structure"`
@@ -9353,6 +13181,523 @@ func (s *CreateLoadBalancerTlsCertificateOutput) SetOperations(v []*Operation) *
return s
}
+type CreateRelationalDatabaseFromSnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Availability Zone in which to create your new database. Use the us-east-2a
+ // case-sensitive format.
+ //
+ // You can get a list of Availability Zones by using the get regions operation.
+ // Be sure to add the include relational database Availability Zones parameter
+ // to your request.
+ AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
+
+ // Specifies the accessibility options for your new database. A value of true
+ // specifies a database that is available to resources outside of your Lightsail
+ // account. A value of false specifies a database that is available only to
+ // your Lightsail resources in the same region as your database.
+ PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"`
+
+ // The bundle ID for your new database. A bundle describes the performance specifications
+ // for your database.
+ //
+ // You can get a list of database bundle IDs by using the get relational database
+ // bundles operation.
+ //
+ // When creating a new database from a snapshot, you cannot choose a bundle
+ // that is smaller than the bundle of the source database.
+ RelationalDatabaseBundleId *string `locationName:"relationalDatabaseBundleId" type:"string"`
+
+ // The name to use for your new database.
+ //
+ // Constraints:
+ //
+ // * Must contain from 2 to 255 alphanumeric characters, or hyphens.
+ //
+ // * The first and last character must be a letter or number.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // The name of the database snapshot from which to create your new database.
+ RelationalDatabaseSnapshotName *string `locationName:"relationalDatabaseSnapshotName" type:"string"`
+
+ // The date and time to restore your database from.
+ //
+ // Constraints:
+ //
+ // * Must be before the latest restorable time for the database.
+ //
+ // * Cannot be specified if the use latest restorable time parameter is true.
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Specified in the Unix time format. For example, if you wish to use a
+ // restore time of October 1, 2018, at 8 PM UTC, then you input 1538424000
+ // as the restore time.
+ RestoreTime *time.Time `locationName:"restoreTime" type:"timestamp"`
+
+ // The name of the source database.
+ SourceRelationalDatabaseName *string `locationName:"sourceRelationalDatabaseName" type:"string"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
+
+ // Specifies whether your database is restored from the latest backup time.
+ // A value of true restores from the latest backup time.
+ //
+ // Default: false
+ //
+ // Constraints: Cannot be specified if the restore time parameter is provided.
+ UseLatestRestorableTime *bool `locationName:"useLatestRestorableTime" type:"boolean"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseFromSnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseFromSnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateRelationalDatabaseFromSnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateRelationalDatabaseFromSnapshotInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAvailabilityZone sets the AvailabilityZone field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetAvailabilityZone(v string) *CreateRelationalDatabaseFromSnapshotInput {
+ s.AvailabilityZone = &v
+ return s
+}
+
+// SetPubliclyAccessible sets the PubliclyAccessible field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetPubliclyAccessible(v bool) *CreateRelationalDatabaseFromSnapshotInput {
+ s.PubliclyAccessible = &v
+ return s
+}
+
+// SetRelationalDatabaseBundleId sets the RelationalDatabaseBundleId field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetRelationalDatabaseBundleId(v string) *CreateRelationalDatabaseFromSnapshotInput {
+ s.RelationalDatabaseBundleId = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetRelationalDatabaseName(v string) *CreateRelationalDatabaseFromSnapshotInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetRelationalDatabaseSnapshotName sets the RelationalDatabaseSnapshotName field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetRelationalDatabaseSnapshotName(v string) *CreateRelationalDatabaseFromSnapshotInput {
+ s.RelationalDatabaseSnapshotName = &v
+ return s
+}
+
+// SetRestoreTime sets the RestoreTime field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetRestoreTime(v time.Time) *CreateRelationalDatabaseFromSnapshotInput {
+ s.RestoreTime = &v
+ return s
+}
+
+// SetSourceRelationalDatabaseName sets the SourceRelationalDatabaseName field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetSourceRelationalDatabaseName(v string) *CreateRelationalDatabaseFromSnapshotInput {
+ s.SourceRelationalDatabaseName = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetTags(v []*Tag) *CreateRelationalDatabaseFromSnapshotInput {
+ s.Tags = v
+ return s
+}
+
+// SetUseLatestRestorableTime sets the UseLatestRestorableTime field's value.
+func (s *CreateRelationalDatabaseFromSnapshotInput) SetUseLatestRestorableTime(v bool) *CreateRelationalDatabaseFromSnapshotInput {
+ s.UseLatestRestorableTime = &v
+ return s
+}
+
+type CreateRelationalDatabaseFromSnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your create relational database from snapshot
+ // request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseFromSnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseFromSnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *CreateRelationalDatabaseFromSnapshotOutput) SetOperations(v []*Operation) *CreateRelationalDatabaseFromSnapshotOutput {
+ s.Operations = v
+ return s
+}
+
+type CreateRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The Availability Zone in which to create your new database. Use the us-east-2a
+ // case-sensitive format.
+ //
+ // You can get a list of Availability Zones by using the get regions operation.
+ // Be sure to add the include relational database Availability Zones parameter
+ // to your request.
+ AvailabilityZone *string `locationName:"availabilityZone" type:"string"`
+
+ // The name of the master database created when the Lightsail database resource
+ // is created.
+ //
+ // Constraints:
+ //
+ // * Must contain from 1 to 64 alphanumeric characters.
+ //
+ // * Cannot be a word reserved by the specified database engine
+ //
+ // MasterDatabaseName is a required field
+ MasterDatabaseName *string `locationName:"masterDatabaseName" type:"string" required:"true"`
+
+ // The password for the master user of your new database. The password can include
+ // any printable ASCII character except "/", """, or "@".
+ //
+ // Constraints: Must contain 8 to 41 characters.
+ MasterUserPassword *string `locationName:"masterUserPassword" type:"string" sensitive:"true"`
+
+ // The master user name for your new database.
+ //
+ // Constraints:
+ //
+ // * Master user name is required.
+ //
+ // * Must contain from 1 to 16 alphanumeric characters.
+ //
+ // * The first character must be a letter.
+ //
+ // * Cannot be a reserved word for the database engine you choose. For more
+ // information about reserved words in MySQL 5.6 or 5.7, see the Keywords
+ // and Reserved Words articles for MySQL 5.6 (https://dev.mysql.com/doc/refman/5.6/en/keywords.html)
+ // or MySQL 5.7 (https://dev.mysql.com/doc/refman/5.7/en/keywords.html) respectively.
+ //
+ // MasterUsername is a required field
+ MasterUsername *string `locationName:"masterUsername" type:"string" required:"true"`
+
+ // The daily time range during which automated backups are created for your
+ // new database if automated backups are enabled.
+ //
+ // The default is a 30-minute window selected at random from an 8-hour block
+ // of time for each AWS Region. For more information about the preferred backup
+ // window time blocks for each region, see the Working With Backups (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow)
+ // guide in the Amazon Relational Database Service (Amazon RDS) documentation.
+ //
+ // Constraints:
+ //
+ // * Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Must not conflict with the preferred maintenance window.
+ //
+ // * Must be at least 30 minutes.
+ PreferredBackupWindow *string `locationName:"preferredBackupWindow" type:"string"`
+
+ // The weekly time range during which system maintenance can occur on your new
+ // database.
+ //
+ // The default is a 30-minute window selected at random from an 8-hour block
+ // of time for each AWS Region, occurring on a random day of the week.
+ //
+ // Constraints:
+ //
+ // * Must be in the ddd:hh24:mi-ddd:hh24:mi format.
+ //
+ // * Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
+ //
+ // * Must be at least 30 minutes.
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Example: Tue:17:00-Tue:17:30
+ PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"`
+
+ // Specifies the accessibility options for your new database. A value of true
+ // specifies a database that is available to resources outside of your Lightsail
+ // account. A value of false specifies a database that is available only to
+ // your Lightsail resources in the same region as your database.
+ PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"`
+
+ // The blueprint ID for your new database. A blueprint describes the major engine
+ // version of a database.
+ //
+ // You can get a list of database blueprints IDs by using the get relational
+ // database blueprints operation.
+ //
+ // RelationalDatabaseBlueprintId is a required field
+ RelationalDatabaseBlueprintId *string `locationName:"relationalDatabaseBlueprintId" type:"string" required:"true"`
+
+ // The bundle ID for your new database. A bundle describes the performance specifications
+ // for your database.
+ //
+ // You can get a list of database bundle IDs by using the get relational database
+ // bundles operation.
+ //
+ // RelationalDatabaseBundleId is a required field
+ RelationalDatabaseBundleId *string `locationName:"relationalDatabaseBundleId" type:"string" required:"true"`
+
+ // The name to use for your new database.
+ //
+ // Constraints:
+ //
+ // * Must contain from 2 to 255 alphanumeric characters, or hyphens.
+ //
+ // * The first and last character must be a letter or number.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateRelationalDatabaseInput"}
+ if s.MasterDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("MasterDatabaseName"))
+ }
+ if s.MasterUsername == nil {
+ invalidParams.Add(request.NewErrParamRequired("MasterUsername"))
+ }
+ if s.RelationalDatabaseBlueprintId == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseBlueprintId"))
+ }
+ if s.RelationalDatabaseBundleId == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseBundleId"))
+ }
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAvailabilityZone sets the AvailabilityZone field's value.
+func (s *CreateRelationalDatabaseInput) SetAvailabilityZone(v string) *CreateRelationalDatabaseInput {
+ s.AvailabilityZone = &v
+ return s
+}
+
+// SetMasterDatabaseName sets the MasterDatabaseName field's value.
+func (s *CreateRelationalDatabaseInput) SetMasterDatabaseName(v string) *CreateRelationalDatabaseInput {
+ s.MasterDatabaseName = &v
+ return s
+}
+
+// SetMasterUserPassword sets the MasterUserPassword field's value.
+func (s *CreateRelationalDatabaseInput) SetMasterUserPassword(v string) *CreateRelationalDatabaseInput {
+ s.MasterUserPassword = &v
+ return s
+}
+
+// SetMasterUsername sets the MasterUsername field's value.
+func (s *CreateRelationalDatabaseInput) SetMasterUsername(v string) *CreateRelationalDatabaseInput {
+ s.MasterUsername = &v
+ return s
+}
+
+// SetPreferredBackupWindow sets the PreferredBackupWindow field's value.
+func (s *CreateRelationalDatabaseInput) SetPreferredBackupWindow(v string) *CreateRelationalDatabaseInput {
+ s.PreferredBackupWindow = &v
+ return s
+}
+
+// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value.
+func (s *CreateRelationalDatabaseInput) SetPreferredMaintenanceWindow(v string) *CreateRelationalDatabaseInput {
+ s.PreferredMaintenanceWindow = &v
+ return s
+}
+
+// SetPubliclyAccessible sets the PubliclyAccessible field's value.
+func (s *CreateRelationalDatabaseInput) SetPubliclyAccessible(v bool) *CreateRelationalDatabaseInput {
+ s.PubliclyAccessible = &v
+ return s
+}
+
+// SetRelationalDatabaseBlueprintId sets the RelationalDatabaseBlueprintId field's value.
+func (s *CreateRelationalDatabaseInput) SetRelationalDatabaseBlueprintId(v string) *CreateRelationalDatabaseInput {
+ s.RelationalDatabaseBlueprintId = &v
+ return s
+}
+
+// SetRelationalDatabaseBundleId sets the RelationalDatabaseBundleId field's value.
+func (s *CreateRelationalDatabaseInput) SetRelationalDatabaseBundleId(v string) *CreateRelationalDatabaseInput {
+ s.RelationalDatabaseBundleId = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *CreateRelationalDatabaseInput) SetRelationalDatabaseName(v string) *CreateRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CreateRelationalDatabaseInput) SetTags(v []*Tag) *CreateRelationalDatabaseInput {
+ s.Tags = v
+ return s
+}
+
+type CreateRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your create relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *CreateRelationalDatabaseOutput) SetOperations(v []*Operation) *CreateRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
+type CreateRelationalDatabaseSnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the database on which to base your new snapshot.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // The name for your new database snapshot.
+ //
+ // Constraints:
+ //
+ // * Must contain from 2 to 255 alphanumeric characters, or hyphens.
+ //
+ // * The first and last character must be a letter or number.
+ //
+ // RelationalDatabaseSnapshotName is a required field
+ RelationalDatabaseSnapshotName *string `locationName:"relationalDatabaseSnapshotName" type:"string" required:"true"`
+
+ // The tag keys and optional values to add to the resource during create.
+ //
+ // To tag a resource after it has been created, see the tag resource operation.
+ Tags []*Tag `locationName:"tags" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseSnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseSnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *CreateRelationalDatabaseSnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "CreateRelationalDatabaseSnapshotInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+ if s.RelationalDatabaseSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseSnapshotName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *CreateRelationalDatabaseSnapshotInput) SetRelationalDatabaseName(v string) *CreateRelationalDatabaseSnapshotInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetRelationalDatabaseSnapshotName sets the RelationalDatabaseSnapshotName field's value.
+func (s *CreateRelationalDatabaseSnapshotInput) SetRelationalDatabaseSnapshotName(v string) *CreateRelationalDatabaseSnapshotInput {
+ s.RelationalDatabaseSnapshotName = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *CreateRelationalDatabaseSnapshotInput) SetTags(v []*Tag) *CreateRelationalDatabaseSnapshotInput {
+ s.Tags = v
+ return s
+}
+
+type CreateRelationalDatabaseSnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your create relational database snapshot
+ // request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s CreateRelationalDatabaseSnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s CreateRelationalDatabaseSnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *CreateRelationalDatabaseSnapshotOutput) SetOperations(v []*Operation) *CreateRelationalDatabaseSnapshotOutput {
+ s.Operations = v
+ return s
+}
+
type DeleteDiskInput struct {
_ struct{} `type:"structure"`
@@ -9799,6 +14144,67 @@ func (s *DeleteKeyPairOutput) SetOperation(v *Operation) *DeleteKeyPairOutput {
return s
}
+type DeleteKnownHostKeysInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the instance for which you want to reset the host key or certificate.
+ //
+ // InstanceName is a required field
+ InstanceName *string `locationName:"instanceName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteKnownHostKeysInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteKnownHostKeysInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteKnownHostKeysInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteKnownHostKeysInput"}
+ if s.InstanceName == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetInstanceName sets the InstanceName field's value.
+func (s *DeleteKnownHostKeysInput) SetInstanceName(v string) *DeleteKnownHostKeysInput {
+ s.InstanceName = &v
+ return s
+}
+
+type DeleteKnownHostKeysOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s DeleteKnownHostKeysOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteKnownHostKeysOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *DeleteKnownHostKeysOutput) SetOperations(v []*Operation) *DeleteKnownHostKeysOutput {
+ s.Operations = v
+ return s
+}
+
type DeleteLoadBalancerInput struct {
_ struct{} `type:"structure"`
@@ -9948,6 +14354,197 @@ func (s *DeleteLoadBalancerTlsCertificateOutput) SetOperations(v []*Operation) *
return s
}
+type DeleteRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the database snapshot created if skip final snapshot is false,
+ // which is the default value for that parameter.
+ //
+ // Specifying this parameter and also specifying the skip final snapshot parameter
+ // to true results in an error.
+ //
+ // Constraints:
+ //
+ // * Must contain from 2 to 255 alphanumeric characters, or hyphens.
+ //
+ // * The first and last character must be a letter or number.
+ FinalRelationalDatabaseSnapshotName *string `locationName:"finalRelationalDatabaseSnapshotName" type:"string"`
+
+ // The name of the database that you are deleting.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // Determines whether a final database snapshot is created before your database
+ // is deleted. If true is specified, no database snapshot is created. If false
+ // is specified, a database snapshot is created before your database is deleted.
+ //
+ // You must specify the final relational database snapshot name parameter if
+ // the skip final snapshot parameter is false.
+ //
+ // Default: false
+ SkipFinalSnapshot *bool `locationName:"skipFinalSnapshot" type:"boolean"`
+}
+
+// String returns the string representation
+func (s DeleteRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetFinalRelationalDatabaseSnapshotName sets the FinalRelationalDatabaseSnapshotName field's value.
+func (s *DeleteRelationalDatabaseInput) SetFinalRelationalDatabaseSnapshotName(v string) *DeleteRelationalDatabaseInput {
+ s.FinalRelationalDatabaseSnapshotName = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *DeleteRelationalDatabaseInput) SetRelationalDatabaseName(v string) *DeleteRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetSkipFinalSnapshot sets the SkipFinalSnapshot field's value.
+func (s *DeleteRelationalDatabaseInput) SetSkipFinalSnapshot(v bool) *DeleteRelationalDatabaseInput {
+ s.SkipFinalSnapshot = &v
+ return s
+}
+
+type DeleteRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your delete relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s DeleteRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *DeleteRelationalDatabaseOutput) SetOperations(v []*Operation) *DeleteRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
+type DeleteRelationalDatabaseSnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the database snapshot that you are deleting.
+ //
+ // RelationalDatabaseSnapshotName is a required field
+ RelationalDatabaseSnapshotName *string `locationName:"relationalDatabaseSnapshotName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s DeleteRelationalDatabaseSnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteRelationalDatabaseSnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *DeleteRelationalDatabaseSnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "DeleteRelationalDatabaseSnapshotInput"}
+ if s.RelationalDatabaseSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseSnapshotName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseSnapshotName sets the RelationalDatabaseSnapshotName field's value.
+func (s *DeleteRelationalDatabaseSnapshotInput) SetRelationalDatabaseSnapshotName(v string) *DeleteRelationalDatabaseSnapshotInput {
+ s.RelationalDatabaseSnapshotName = &v
+ return s
+}
+
+type DeleteRelationalDatabaseSnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your delete relational database snapshot
+ // request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s DeleteRelationalDatabaseSnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DeleteRelationalDatabaseSnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *DeleteRelationalDatabaseSnapshotOutput) SetOperations(v []*Operation) *DeleteRelationalDatabaseSnapshotOutput {
+ s.Operations = v
+ return s
+}
+
+// Describes the destination of a record.
+type DestinationInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The ID of the resource created at the destination.
+ Id *string `locationName:"id" type:"string"`
+
+ // The destination service of the record.
+ Service *string `locationName:"service" type:"string"`
+}
+
+// String returns the string representation
+func (s DestinationInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DestinationInfo) GoString() string {
+ return s.String()
+}
+
+// SetId sets the Id field's value.
+func (s *DestinationInfo) SetId(v string) *DestinationInfo {
+ s.Id = &v
+ return s
+}
+
+// SetService sets the Service field's value.
+func (s *DestinationInfo) SetService(v string) *DestinationInfo {
+ s.Service = &v
+ return s
+}
+
type DetachDiskInput struct {
_ struct{} `type:"structure"`
@@ -10163,15 +14760,19 @@ type Disk struct {
// In releases prior to November 14, 2017, this parameter returned attached
// for system disks in the API response. It is now deprecated, but still included
// in the response. Use isAttached instead.
+ //
+ // Deprecated: AttachmentState has been deprecated
AttachmentState *string `locationName:"attachmentState" deprecated:"true" type:"string"`
// The date when the disk was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// (Deprecated) The number of GB in use by the disk.
//
// In releases prior to November 14, 2017, this parameter was not included in
// the API response. It is now deprecated.
+ //
+ // Deprecated: GbInUse has been deprecated
GbInUse *int64 `locationName:"gbInUse" deprecated:"true" type:"integer"`
// The input/output operations per second (IOPS) of the disk.
@@ -10206,6 +14807,10 @@ type Disk struct {
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -10308,6 +14913,64 @@ func (s *Disk) SetSupportCode(v string) *Disk {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Disk) SetTags(v []*Tag) *Disk {
+ s.Tags = v
+ return s
+}
+
+// Describes a disk.
+type DiskInfo struct {
+ _ struct{} `type:"structure"`
+
+ // A Boolean value indicating whether this disk is a system disk (has an operating
+ // system loaded on it).
+ IsSystemDisk *bool `locationName:"isSystemDisk" type:"boolean"`
+
+ // The disk name.
+ Name *string `locationName:"name" type:"string"`
+
+ // The disk path.
+ Path *string `locationName:"path" type:"string"`
+
+ // The size of the disk in GB (e.g., 32).
+ SizeInGb *int64 `locationName:"sizeInGb" type:"integer"`
+}
+
+// String returns the string representation
+func (s DiskInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DiskInfo) GoString() string {
+ return s.String()
+}
+
+// SetIsSystemDisk sets the IsSystemDisk field's value.
+func (s *DiskInfo) SetIsSystemDisk(v bool) *DiskInfo {
+ s.IsSystemDisk = &v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *DiskInfo) SetName(v string) *DiskInfo {
+ s.Name = &v
+ return s
+}
+
+// SetPath sets the Path field's value.
+func (s *DiskInfo) SetPath(v string) *DiskInfo {
+ s.Path = &v
+ return s
+}
+
+// SetSizeInGb sets the SizeInGb field's value.
+func (s *DiskInfo) SetSizeInGb(v int64) *DiskInfo {
+ s.SizeInGb = &v
+ return s
+}
+
// Describes a block storage disk mapping.
type DiskMap struct {
_ struct{} `type:"structure"`
@@ -10349,15 +15012,23 @@ type DiskSnapshot struct {
Arn *string `locationName:"arn" type:"string"`
// The date when the disk snapshot was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
- // The Amazon Resource Name (ARN) of the source disk from which you are creating
- // the disk snapshot.
+ // The Amazon Resource Name (ARN) of the source disk from which the disk snapshot
+ // was created.
FromDiskArn *string `locationName:"fromDiskArn" type:"string"`
- // The unique name of the source disk from which you are creating the disk snapshot.
+ // The unique name of the source disk from which the disk snapshot was created.
FromDiskName *string `locationName:"fromDiskName" type:"string"`
+ // The Amazon Resource Name (ARN) of the source instance from which the disk
+ // (system volume) snapshot was created.
+ FromInstanceArn *string `locationName:"fromInstanceArn" type:"string"`
+
+ // The unique name of the source instance from which the disk (system volume)
+ // snapshot was created.
+ FromInstanceName *string `locationName:"fromInstanceName" type:"string"`
+
// The AWS Region and Availability Zone where the disk snapshot was created.
Location *ResourceLocation `locationName:"location" type:"structure"`
@@ -10380,6 +15051,10 @@ type DiskSnapshot struct {
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -10416,6 +15091,18 @@ func (s *DiskSnapshot) SetFromDiskName(v string) *DiskSnapshot {
return s
}
+// SetFromInstanceArn sets the FromInstanceArn field's value.
+func (s *DiskSnapshot) SetFromInstanceArn(v string) *DiskSnapshot {
+ s.FromInstanceArn = &v
+ return s
+}
+
+// SetFromInstanceName sets the FromInstanceName field's value.
+func (s *DiskSnapshot) SetFromInstanceName(v string) *DiskSnapshot {
+ s.FromInstanceName = &v
+ return s
+}
+
// SetLocation sets the Location field's value.
func (s *DiskSnapshot) SetLocation(v *ResourceLocation) *DiskSnapshot {
s.Location = v
@@ -10458,6 +15145,36 @@ func (s *DiskSnapshot) SetSupportCode(v string) *DiskSnapshot {
return s
}
+// SetTags sets the Tags field's value.
+func (s *DiskSnapshot) SetTags(v []*Tag) *DiskSnapshot {
+ s.Tags = v
+ return s
+}
+
+// Describes a disk snapshot.
+type DiskSnapshotInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The size of the disk in GB (e.g., 32).
+ SizeInGb *int64 `locationName:"sizeInGb" type:"integer"`
+}
+
+// String returns the string representation
+func (s DiskSnapshotInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s DiskSnapshotInfo) GoString() string {
+ return s.String()
+}
+
+// SetSizeInGb sets the SizeInGb field's value.
+func (s *DiskSnapshotInfo) SetSizeInGb(v int64) *DiskSnapshotInfo {
+ s.SizeInGb = &v
+ return s
+}
+
// Describes a domain where you are storing recordsets in Lightsail.
type Domain struct {
_ struct{} `type:"structure"`
@@ -10466,7 +15183,7 @@ type Domain struct {
Arn *string `locationName:"arn" type:"string"`
// The date when the domain recordset was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// An array of key-value pairs containing information about the domain entries.
DomainEntries []*DomainEntry `locationName:"domainEntries" type:"list"`
@@ -10484,6 +15201,10 @@ type Domain struct {
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -10538,6 +15259,12 @@ func (s *Domain) SetSupportCode(v string) *Domain {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Domain) SetTags(v []*Tag) *Domain {
+ s.Tags = v
+ return s
+}
+
// Describes a domain recordset entry.
type DomainEntry struct {
_ struct{} `type:"structure"`
@@ -10558,6 +15285,8 @@ type DomainEntry struct {
//
// In releases prior to November 29, 2017, this parameter was not included in
// the API response. It is now deprecated.
+ //
+ // Deprecated: Options has been deprecated
Options map[string]*string `locationName:"options" deprecated:"true" type:"map"`
// The target AWS name server (e.g., ns-111.awsdns-22.com.).
@@ -10567,7 +15296,25 @@ type DomainEntry struct {
// balancer.
Target *string `locationName:"target" type:"string"`
- // The type of domain entry (e.g., SOA or NS).
+ // The type of domain entry, such as address (A), canonical name (CNAME), mail
+ // exchanger (MX), name server (NS), start of authority (SOA), service locator
+ // (SRV), or text (TXT).
+ //
+ // The following domain entry types can be used:
+ //
+ // * A
+ //
+ // * CNAME
+ //
+ // * MX
+ //
+ // * NS
+ //
+ // * SOA
+ //
+ // * SRV
+ //
+ // * TXT
Type *string `locationName:"type" type:"string"`
}
@@ -10663,6 +15410,242 @@ func (s *DownloadDefaultKeyPairOutput) SetPublicKeyBase64(v string) *DownloadDef
return s
}
+type ExportSnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the instance or disk snapshot to be exported to Amazon EC2.
+ //
+ // SourceSnapshotName is a required field
+ SourceSnapshotName *string `locationName:"sourceSnapshotName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s ExportSnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportSnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *ExportSnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "ExportSnapshotInput"}
+ if s.SourceSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("SourceSnapshotName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetSourceSnapshotName sets the SourceSnapshotName field's value.
+func (s *ExportSnapshotInput) SetSourceSnapshotName(v string) *ExportSnapshotInput {
+ s.SourceSnapshotName = &v
+ return s
+}
+
+type ExportSnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s ExportSnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportSnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *ExportSnapshotOutput) SetOperations(v []*Operation) *ExportSnapshotOutput {
+ s.Operations = v
+ return s
+}
+
+// Describes an export snapshot record.
+type ExportSnapshotRecord struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the export snapshot record.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // The date when the export snapshot record was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // A list of objects describing the destination of the export snapshot record.
+ DestinationInfo *DestinationInfo `locationName:"destinationInfo" type:"structure"`
+
+ // The AWS Region and Availability Zone where the export snapshot record is
+ // located.
+ Location *ResourceLocation `locationName:"location" type:"structure"`
+
+ // The export snapshot record name.
+ Name *string `locationName:"name" type:"string"`
+
+ // The Lightsail resource type (e.g., ExportSnapshotRecord).
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"`
+
+ // A list of objects describing the source of the export snapshot record.
+ SourceInfo *ExportSnapshotRecordSourceInfo `locationName:"sourceInfo" type:"structure"`
+
+ // The state of the export snapshot record.
+ State *string `locationName:"state" type:"string" enum:"RecordState"`
+}
+
+// String returns the string representation
+func (s ExportSnapshotRecord) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportSnapshotRecord) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *ExportSnapshotRecord) SetArn(v string) *ExportSnapshotRecord {
+ s.Arn = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *ExportSnapshotRecord) SetCreatedAt(v time.Time) *ExportSnapshotRecord {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetDestinationInfo sets the DestinationInfo field's value.
+func (s *ExportSnapshotRecord) SetDestinationInfo(v *DestinationInfo) *ExportSnapshotRecord {
+ s.DestinationInfo = v
+ return s
+}
+
+// SetLocation sets the Location field's value.
+func (s *ExportSnapshotRecord) SetLocation(v *ResourceLocation) *ExportSnapshotRecord {
+ s.Location = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *ExportSnapshotRecord) SetName(v string) *ExportSnapshotRecord {
+ s.Name = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *ExportSnapshotRecord) SetResourceType(v string) *ExportSnapshotRecord {
+ s.ResourceType = &v
+ return s
+}
+
+// SetSourceInfo sets the SourceInfo field's value.
+func (s *ExportSnapshotRecord) SetSourceInfo(v *ExportSnapshotRecordSourceInfo) *ExportSnapshotRecord {
+ s.SourceInfo = v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *ExportSnapshotRecord) SetState(v string) *ExportSnapshotRecord {
+ s.State = &v
+ return s
+}
+
+// Describes the source of an export snapshot record.
+type ExportSnapshotRecordSourceInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the source instance or disk snapshot.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // The date when the source instance or disk snapshot was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // A list of objects describing a disk snapshot.
+ DiskSnapshotInfo *DiskSnapshotInfo `locationName:"diskSnapshotInfo" type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the snapshot's source instance or disk.
+ FromResourceArn *string `locationName:"fromResourceArn" type:"string"`
+
+ // The name of the snapshot's source instance or disk.
+ FromResourceName *string `locationName:"fromResourceName" type:"string"`
+
+ // A list of objects describing an instance snapshot.
+ InstanceSnapshotInfo *InstanceSnapshotInfo `locationName:"instanceSnapshotInfo" type:"structure"`
+
+ // The name of the source instance or disk snapshot.
+ Name *string `locationName:"name" type:"string"`
+
+ // The Lightsail resource type (e.g., InstanceSnapshot or DiskSnapshot).
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"ExportSnapshotRecordSourceType"`
+}
+
+// String returns the string representation
+func (s ExportSnapshotRecordSourceInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s ExportSnapshotRecordSourceInfo) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetArn(v string) *ExportSnapshotRecordSourceInfo {
+ s.Arn = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetCreatedAt(v time.Time) *ExportSnapshotRecordSourceInfo {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetDiskSnapshotInfo sets the DiskSnapshotInfo field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetDiskSnapshotInfo(v *DiskSnapshotInfo) *ExportSnapshotRecordSourceInfo {
+ s.DiskSnapshotInfo = v
+ return s
+}
+
+// SetFromResourceArn sets the FromResourceArn field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetFromResourceArn(v string) *ExportSnapshotRecordSourceInfo {
+ s.FromResourceArn = &v
+ return s
+}
+
+// SetFromResourceName sets the FromResourceName field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetFromResourceName(v string) *ExportSnapshotRecordSourceInfo {
+ s.FromResourceName = &v
+ return s
+}
+
+// SetInstanceSnapshotInfo sets the InstanceSnapshotInfo field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetInstanceSnapshotInfo(v *InstanceSnapshotInfo) *ExportSnapshotRecordSourceInfo {
+ s.InstanceSnapshotInfo = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetName(v string) *ExportSnapshotRecordSourceInfo {
+ s.Name = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *ExportSnapshotRecordSourceInfo) SetResourceType(v string) *ExportSnapshotRecordSourceInfo {
+ s.ResourceType = &v
+ return s
+}
+
type GetActiveNamesInput struct {
_ struct{} `type:"structure"`
@@ -10854,6 +15837,63 @@ func (s *GetBundlesOutput) SetNextPageToken(v string) *GetBundlesOutput {
return s
}
+type GetCloudFormationStackRecordsInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get cloud
+ // formation stack records request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetCloudFormationStackRecordsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetCloudFormationStackRecordsInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetCloudFormationStackRecordsInput) SetPageToken(v string) *GetCloudFormationStackRecordsInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetCloudFormationStackRecordsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the CloudFormation stack records.
+ CloudFormationStackRecords []*CloudFormationStackRecord `locationName:"cloudFormationStackRecords" type:"list"`
+
+ // A token used for advancing to the next page of results of your get relational
+ // database bundles request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetCloudFormationStackRecordsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetCloudFormationStackRecordsOutput) GoString() string {
+ return s.String()
+}
+
+// SetCloudFormationStackRecords sets the CloudFormationStackRecords field's value.
+func (s *GetCloudFormationStackRecordsOutput) SetCloudFormationStackRecords(v []*CloudFormationStackRecord) *GetCloudFormationStackRecordsOutput {
+ s.CloudFormationStackRecords = v
+ return s
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetCloudFormationStackRecordsOutput) SetNextPageToken(v string) *GetCloudFormationStackRecordsOutput {
+ s.NextPageToken = &v
+ return s
+}
+
type GetDiskInput struct {
_ struct{} `type:"structure"`
@@ -11210,6 +16250,63 @@ func (s *GetDomainsOutput) SetNextPageToken(v string) *GetDomainsOutput {
return s
}
+type GetExportSnapshotRecordsInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get export
+ // snapshot records request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetExportSnapshotRecordsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetExportSnapshotRecordsInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetExportSnapshotRecordsInput) SetPageToken(v string) *GetExportSnapshotRecordsInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetExportSnapshotRecordsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the export snapshot records.
+ ExportSnapshotRecords []*ExportSnapshotRecord `locationName:"exportSnapshotRecords" type:"list"`
+
+ // A token used for advancing to the next page of results of your get relational
+ // database bundles request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetExportSnapshotRecordsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetExportSnapshotRecordsOutput) GoString() string {
+ return s.String()
+}
+
+// SetExportSnapshotRecords sets the ExportSnapshotRecords field's value.
+func (s *GetExportSnapshotRecordsOutput) SetExportSnapshotRecords(v []*ExportSnapshotRecord) *GetExportSnapshotRecordsOutput {
+ s.ExportSnapshotRecords = v
+ return s
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetExportSnapshotRecordsOutput) SetNextPageToken(v string) *GetExportSnapshotRecordsOutput {
+ s.NextPageToken = &v
+ return s
+}
+
type GetInstanceAccessDetailsInput struct {
_ struct{} `type:"structure"`
@@ -11325,7 +16422,7 @@ type GetInstanceMetricDataInput struct {
// The end time of the time period.
//
// EndTime is a required field
- EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix" required:"true"`
+ EndTime *time.Time `locationName:"endTime" type:"timestamp" required:"true"`
// The name of the instance for which you want to get metrics data.
//
@@ -11337,7 +16434,7 @@ type GetInstanceMetricDataInput struct {
// MetricName is a required field
MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"InstanceMetricName"`
- // The time period for which you are requesting data.
+ // The granularity, in seconds, of the returned data points.
//
// Period is a required field
Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"`
@@ -11345,7 +16442,7 @@ type GetInstanceMetricDataInput struct {
// The start time of the time period.
//
// StartTime is a required field
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix" required:"true"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"`
// The instance statistics.
//
@@ -11961,7 +17058,7 @@ type GetLoadBalancerMetricDataInput struct {
// The end time of the period.
//
// EndTime is a required field
- EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"unix" required:"true"`
+ EndTime *time.Time `locationName:"endTime" type:"timestamp" required:"true"`
// The name of the load balancer.
//
@@ -11973,87 +17070,67 @@ type GetLoadBalancerMetricDataInput struct {
//
// * ClientTLSNegotiationErrorCount - The number of TLS connections initiated
// by the client that did not establish a session with the load balancer.
- // Possible causes include a mismatch of ciphers or protocols.
- //
- // Statistics: The most useful statistic is Sum.
+ // Possible causes include a mismatch of ciphers or protocols. Statistics:
+ // The most useful statistic is Sum.
//
// * HealthyHostCount - The number of target instances that are considered
- // healthy.
- //
- // Statistics: The most useful statistic are Average, Minimum, and Maximum.
+ // healthy. Statistics: The most useful statistic are Average, Minimum, and
+ // Maximum.
//
// * UnhealthyHostCount - The number of target instances that are considered
- // unhealthy.
- //
- // Statistics: The most useful statistic are Average, Minimum, and Maximum.
+ // unhealthy. Statistics: The most useful statistic are Average, Minimum,
+ // and Maximum.
//
// * HTTPCode_LB_4XX_Count - The number of HTTP 4XX client error codes that
// originate from the load balancer. Client errors are generated when requests
// are malformed or incomplete. These requests have not been received by
// the target instance. This count does not include any response codes generated
- // by the target instances.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the target instances. Statistics: The most useful statistic is Sum.
+ // Note that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_LB_5XX_Count - The number of HTTP 5XX server error codes that
// originate from the load balancer. This count does not include any response
- // codes generated by the target instances.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1. Note that Minimum, Maximum, and Average all
- // return 1.
+ // codes generated by the target instances. Statistics: The most useful statistic
+ // is Sum. Note that Minimum, Maximum, and Average all return 1. Note that
+ // Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_2XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_3XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_4XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_5XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * InstanceResponseTime - The time elapsed, in seconds, after the request
// leaves the load balancer until a response from the target instance is
- // received.
- //
- // Statistics: The most useful statistic is Average.
+ // received. Statistics: The most useful statistic is Average.
//
// * RejectedConnectionCount - The number of connections that were rejected
// because the load balancer had reached its maximum number of connections.
- //
- // Statistics: The most useful statistic is Sum.
+ // Statistics: The most useful statistic is Sum.
//
// * RequestCount - The number of requests processed over IPv4. This count
// includes only the requests with a response generated by a target instance
- // of the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // of the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// MetricName is a required field
MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"LoadBalancerMetricName"`
- // The time period duration for your health data request.
+ // The granularity, in seconds, of the returned data points.
//
// Period is a required field
Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"`
@@ -12061,7 +17138,7 @@ type GetLoadBalancerMetricDataInput struct {
// The start time of the period.
//
// StartTime is a required field
- StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"unix" required:"true"`
+ StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"`
// An array of statistics that you want to request metrics for. Valid values
// are listed below.
@@ -12190,82 +17267,62 @@ type GetLoadBalancerMetricDataOutput struct {
//
// * ClientTLSNegotiationErrorCount - The number of TLS connections initiated
// by the client that did not establish a session with the load balancer.
- // Possible causes include a mismatch of ciphers or protocols.
- //
- // Statistics: The most useful statistic is Sum.
+ // Possible causes include a mismatch of ciphers or protocols. Statistics:
+ // The most useful statistic is Sum.
//
// * HealthyHostCount - The number of target instances that are considered
- // healthy.
- //
- // Statistics: The most useful statistic are Average, Minimum, and Maximum.
+ // healthy. Statistics: The most useful statistic are Average, Minimum, and
+ // Maximum.
//
// * UnhealthyHostCount - The number of target instances that are considered
- // unhealthy.
- //
- // Statistics: The most useful statistic are Average, Minimum, and Maximum.
+ // unhealthy. Statistics: The most useful statistic are Average, Minimum,
+ // and Maximum.
//
// * HTTPCode_LB_4XX_Count - The number of HTTP 4XX client error codes that
// originate from the load balancer. Client errors are generated when requests
// are malformed or incomplete. These requests have not been received by
// the target instance. This count does not include any response codes generated
- // by the target instances.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the target instances. Statistics: The most useful statistic is Sum.
+ // Note that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_LB_5XX_Count - The number of HTTP 5XX server error codes that
// originate from the load balancer. This count does not include any response
- // codes generated by the target instances.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1. Note that Minimum, Maximum, and Average all
- // return 1.
+ // codes generated by the target instances. Statistics: The most useful statistic
+ // is Sum. Note that Minimum, Maximum, and Average all return 1. Note that
+ // Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_2XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_3XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_4XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * HTTPCode_Instance_5XX_Count - The number of HTTP response codes generated
// by the target instances. This does not include any response codes generated
- // by the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // by the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
//
// * InstanceResponseTime - The time elapsed, in seconds, after the request
// leaves the load balancer until a response from the target instance is
- // received.
- //
- // Statistics: The most useful statistic is Average.
+ // received. Statistics: The most useful statistic is Average.
//
// * RejectedConnectionCount - The number of connections that were rejected
// because the load balancer had reached its maximum number of connections.
- //
- // Statistics: The most useful statistic is Sum.
+ // Statistics: The most useful statistic is Sum.
//
// * RequestCount - The number of requests processed over IPv4. This count
// includes only the requests with a response generated by a target instance
- // of the load balancer.
- //
- // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum,
- // and Average all return 1.
+ // of the load balancer. Statistics: The most useful statistic is Sum. Note
+ // that Minimum, Maximum, and Average all return 1.
MetricName *string `locationName:"metricName" type:"string" enum:"LoadBalancerMetricName"`
}
@@ -12547,7 +17604,9 @@ type GetOperationsForResourceOutput struct {
// (Deprecated) Returns the number of pages of results that remain.
//
// In releases prior to June 12, 2017, this parameter returned null by the API.
- // It is now deprecated, and the API returns the nextPageToken parameter instead.
+ // It is now deprecated, and the API returns the next page token parameter instead.
+ //
+ // Deprecated: NextPageCount has been deprecated
NextPageCount *string `locationName:"nextPageCount" deprecated:"true" type:"string"`
// An identifier that was returned from the previous call to this operation,
@@ -12652,6 +17711,11 @@ type GetRegionsInput struct {
// your get regions request. Availability Zones are indicated with a letter:
// e.g., us-east-2a.
IncludeAvailabilityZones *bool `locationName:"includeAvailabilityZones" type:"boolean"`
+
+ // >A Boolean value indicating whether to also include Availability Zones for
+ // databases in your get regions request. Availability Zones are indicated with
+ // a letter (e.g., us-east-2a).
+ IncludeRelationalDatabaseAvailabilityZones *bool `locationName:"includeRelationalDatabaseAvailabilityZones" type:"boolean"`
}
// String returns the string representation
@@ -12670,6 +17734,12 @@ func (s *GetRegionsInput) SetIncludeAvailabilityZones(v bool) *GetRegionsInput {
return s
}
+// SetIncludeRelationalDatabaseAvailabilityZones sets the IncludeRelationalDatabaseAvailabilityZones field's value.
+func (s *GetRegionsInput) SetIncludeRelationalDatabaseAvailabilityZones(v bool) *GetRegionsInput {
+ s.IncludeRelationalDatabaseAvailabilityZones = &v
+ return s
+}
+
type GetRegionsOutput struct {
_ struct{} `type:"structure"`
@@ -12694,6 +17764,1014 @@ func (s *GetRegionsOutput) SetRegions(v []*Region) *GetRegionsOutput {
return s
}
+type GetRelationalDatabaseBlueprintsInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database blueprints request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseBlueprintsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseBlueprintsInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseBlueprintsInput) SetPageToken(v string) *GetRelationalDatabaseBlueprintsInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetRelationalDatabaseBlueprintsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your get relational database blueprints
+ // request.
+ Blueprints []*RelationalDatabaseBlueprint `locationName:"blueprints" type:"list"`
+
+ // A token used for advancing to the next page of results of your get relational
+ // database blueprints request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseBlueprintsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseBlueprintsOutput) GoString() string {
+ return s.String()
+}
+
+// SetBlueprints sets the Blueprints field's value.
+func (s *GetRelationalDatabaseBlueprintsOutput) SetBlueprints(v []*RelationalDatabaseBlueprint) *GetRelationalDatabaseBlueprintsOutput {
+ s.Blueprints = v
+ return s
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabaseBlueprintsOutput) SetNextPageToken(v string) *GetRelationalDatabaseBlueprintsOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+type GetRelationalDatabaseBundlesInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database bundles request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseBundlesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseBundlesInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseBundlesInput) SetPageToken(v string) *GetRelationalDatabaseBundlesInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetRelationalDatabaseBundlesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your get relational database bundles request.
+ Bundles []*RelationalDatabaseBundle `locationName:"bundles" type:"list"`
+
+ // A token used for advancing to the next page of results of your get relational
+ // database bundles request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseBundlesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseBundlesOutput) GoString() string {
+ return s.String()
+}
+
+// SetBundles sets the Bundles field's value.
+func (s *GetRelationalDatabaseBundlesOutput) SetBundles(v []*RelationalDatabaseBundle) *GetRelationalDatabaseBundlesOutput {
+ s.Bundles = v
+ return s
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabaseBundlesOutput) SetNextPageToken(v string) *GetRelationalDatabaseBundlesOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+type GetRelationalDatabaseEventsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The number of minutes in the past from which to retrieve events. For example,
+ // to get all events from the past 2 hours, enter 120.
+ //
+ // Default: 60
+ //
+ // The minimum is 1 and the maximum is 14 days (20160 minutes).
+ DurationInMinutes *int64 `locationName:"durationInMinutes" type:"integer"`
+
+ // A token used for advancing to a specific page of results from for get relational
+ // database events request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+
+ // The name of the database from which to get events.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseEventsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseEventsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseEventsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseEventsInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetDurationInMinutes sets the DurationInMinutes field's value.
+func (s *GetRelationalDatabaseEventsInput) SetDurationInMinutes(v int64) *GetRelationalDatabaseEventsInput {
+ s.DurationInMinutes = &v
+ return s
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseEventsInput) SetPageToken(v string) *GetRelationalDatabaseEventsInput {
+ s.PageToken = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseEventsInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseEventsInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type GetRelationalDatabaseEventsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to the next page of results from your get relational
+ // database events request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+
+ // An object describing the result of your get relational database events request.
+ RelationalDatabaseEvents []*RelationalDatabaseEvent `locationName:"relationalDatabaseEvents" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseEventsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseEventsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabaseEventsOutput) SetNextPageToken(v string) *GetRelationalDatabaseEventsOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+// SetRelationalDatabaseEvents sets the RelationalDatabaseEvents field's value.
+func (s *GetRelationalDatabaseEventsOutput) SetRelationalDatabaseEvents(v []*RelationalDatabaseEvent) *GetRelationalDatabaseEventsOutput {
+ s.RelationalDatabaseEvents = v
+ return s
+}
+
+type GetRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the database that you are looking up.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type GetRelationalDatabaseLogEventsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The end of the time interval from which to get log events.
+ //
+ // Constraints:
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Specified in the Unix time format. For example, if you wish to use an
+ // end time of October 1, 2018, at 8 PM UTC, then you input 1538424000 as
+ // the end time.
+ EndTime *time.Time `locationName:"endTime" type:"timestamp"`
+
+ // The name of the log stream.
+ //
+ // Use the get relational database log streams operation to get a list of available
+ // log streams.
+ //
+ // LogStreamName is a required field
+ LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database log events request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+
+ // The name of your database for which to get log events.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // Parameter to specify if the log should start from head or tail. If true is
+ // specified, the log event starts from the head of the log. If false is specified,
+ // the log event starts from the tail of the log.
+ //
+ // Default: false
+ StartFromHead *bool `locationName:"startFromHead" type:"boolean"`
+
+ // The start of the time interval from which to get log events.
+ //
+ // Constraints:
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Specified in the Unix time format. For example, if you wish to use a
+ // start time of October 1, 2018, at 8 PM UTC, then you input 1538424000
+ // as the start time.
+ StartTime *time.Time `locationName:"startTime" type:"timestamp"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseLogEventsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseLogEventsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseLogEventsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseLogEventsInput"}
+ if s.LogStreamName == nil {
+ invalidParams.Add(request.NewErrParamRequired("LogStreamName"))
+ }
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetEndTime sets the EndTime field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetEndTime(v time.Time) *GetRelationalDatabaseLogEventsInput {
+ s.EndTime = &v
+ return s
+}
+
+// SetLogStreamName sets the LogStreamName field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetLogStreamName(v string) *GetRelationalDatabaseLogEventsInput {
+ s.LogStreamName = &v
+ return s
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetPageToken(v string) *GetRelationalDatabaseLogEventsInput {
+ s.PageToken = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseLogEventsInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetStartFromHead sets the StartFromHead field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetStartFromHead(v bool) *GetRelationalDatabaseLogEventsInput {
+ s.StartFromHead = &v
+ return s
+}
+
+// SetStartTime sets the StartTime field's value.
+func (s *GetRelationalDatabaseLogEventsInput) SetStartTime(v time.Time) *GetRelationalDatabaseLogEventsInput {
+ s.StartTime = &v
+ return s
+}
+
+type GetRelationalDatabaseLogEventsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to the previous page of results from your get
+ // relational database log events request.
+ NextBackwardToken *string `locationName:"nextBackwardToken" type:"string"`
+
+ // A token used for advancing to the next page of results from your get relational
+ // database log events request.
+ NextForwardToken *string `locationName:"nextForwardToken" type:"string"`
+
+ // An object describing the result of your get relational database log events
+ // request.
+ ResourceLogEvents []*LogEvent `locationName:"resourceLogEvents" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseLogEventsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseLogEventsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextBackwardToken sets the NextBackwardToken field's value.
+func (s *GetRelationalDatabaseLogEventsOutput) SetNextBackwardToken(v string) *GetRelationalDatabaseLogEventsOutput {
+ s.NextBackwardToken = &v
+ return s
+}
+
+// SetNextForwardToken sets the NextForwardToken field's value.
+func (s *GetRelationalDatabaseLogEventsOutput) SetNextForwardToken(v string) *GetRelationalDatabaseLogEventsOutput {
+ s.NextForwardToken = &v
+ return s
+}
+
+// SetResourceLogEvents sets the ResourceLogEvents field's value.
+func (s *GetRelationalDatabaseLogEventsOutput) SetResourceLogEvents(v []*LogEvent) *GetRelationalDatabaseLogEventsOutput {
+ s.ResourceLogEvents = v
+ return s
+}
+
+type GetRelationalDatabaseLogStreamsInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of your database for which to get log streams.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseLogStreamsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseLogStreamsInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseLogStreamsInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseLogStreamsInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseLogStreamsInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseLogStreamsInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type GetRelationalDatabaseLogStreamsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your get relational database log streams
+ // request.
+ LogStreams []*string `locationName:"logStreams" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseLogStreamsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseLogStreamsOutput) GoString() string {
+ return s.String()
+}
+
+// SetLogStreams sets the LogStreams field's value.
+func (s *GetRelationalDatabaseLogStreamsOutput) SetLogStreams(v []*string) *GetRelationalDatabaseLogStreamsOutput {
+ s.LogStreams = v
+ return s
+}
+
+type GetRelationalDatabaseMasterUserPasswordInput struct {
+ _ struct{} `type:"structure"`
+
+ // The password version to return.
+ //
+ // Specifying CURRENT or PREVIOUS returns the current or previous passwords
+ // respectively. Specifying PENDING returns the newest version of the password
+ // that will rotate to CURRENT. After the PENDING password rotates to CURRENT,
+ // the PENDING password is no longer available.
+ //
+ // Default: CURRENT
+ PasswordVersion *string `locationName:"passwordVersion" type:"string" enum:"RelationalDatabasePasswordVersion"`
+
+ // The name of your database for which to get the master user password.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseMasterUserPasswordInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseMasterUserPasswordInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseMasterUserPasswordInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseMasterUserPasswordInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetPasswordVersion sets the PasswordVersion field's value.
+func (s *GetRelationalDatabaseMasterUserPasswordInput) SetPasswordVersion(v string) *GetRelationalDatabaseMasterUserPasswordInput {
+ s.PasswordVersion = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseMasterUserPasswordInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseMasterUserPasswordInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type GetRelationalDatabaseMasterUserPasswordOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The timestamp when the specified version of the master user password was
+ // created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The master user password for the password version specified.
+ MasterUserPassword *string `locationName:"masterUserPassword" type:"string" sensitive:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseMasterUserPasswordOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseMasterUserPasswordOutput) GoString() string {
+ return s.String()
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *GetRelationalDatabaseMasterUserPasswordOutput) SetCreatedAt(v time.Time) *GetRelationalDatabaseMasterUserPasswordOutput {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetMasterUserPassword sets the MasterUserPassword field's value.
+func (s *GetRelationalDatabaseMasterUserPasswordOutput) SetMasterUserPassword(v string) *GetRelationalDatabaseMasterUserPasswordOutput {
+ s.MasterUserPassword = &v
+ return s
+}
+
+type GetRelationalDatabaseMetricDataInput struct {
+ _ struct{} `type:"structure"`
+
+ // The end of the time interval from which to get metric data.
+ //
+ // Constraints:
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Specified in the Unix time format. For example, if you wish to use an
+ // end time of October 1, 2018, at 8 PM UTC, then you input 1538424000 as
+ // the end time.
+ //
+ // EndTime is a required field
+ EndTime *time.Time `locationName:"endTime" type:"timestamp" required:"true"`
+
+ // The name of the metric data to return.
+ //
+ // MetricName is a required field
+ MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"RelationalDatabaseMetricName"`
+
+ // The granularity, in seconds, of the returned data points.
+ //
+ // Period is a required field
+ Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"`
+
+ // The name of your database from which to get metric data.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // The start of the time interval from which to get metric data.
+ //
+ // Constraints:
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Specified in the Unix time format. For example, if you wish to use a
+ // start time of October 1, 2018, at 8 PM UTC, then you input 1538424000
+ // as the start time.
+ //
+ // StartTime is a required field
+ StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"`
+
+ // The array of statistics for your metric data request.
+ //
+ // Statistics is a required field
+ Statistics []*string `locationName:"statistics" type:"list" required:"true"`
+
+ // The unit for the metric data request.
+ //
+ // Unit is a required field
+ Unit *string `locationName:"unit" type:"string" required:"true" enum:"MetricUnit"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseMetricDataInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseMetricDataInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseMetricDataInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseMetricDataInput"}
+ if s.EndTime == nil {
+ invalidParams.Add(request.NewErrParamRequired("EndTime"))
+ }
+ if s.MetricName == nil {
+ invalidParams.Add(request.NewErrParamRequired("MetricName"))
+ }
+ if s.Period == nil {
+ invalidParams.Add(request.NewErrParamRequired("Period"))
+ }
+ if s.Period != nil && *s.Period < 60 {
+ invalidParams.Add(request.NewErrParamMinValue("Period", 60))
+ }
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+ if s.StartTime == nil {
+ invalidParams.Add(request.NewErrParamRequired("StartTime"))
+ }
+ if s.Statistics == nil {
+ invalidParams.Add(request.NewErrParamRequired("Statistics"))
+ }
+ if s.Unit == nil {
+ invalidParams.Add(request.NewErrParamRequired("Unit"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetEndTime sets the EndTime field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetEndTime(v time.Time) *GetRelationalDatabaseMetricDataInput {
+ s.EndTime = &v
+ return s
+}
+
+// SetMetricName sets the MetricName field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetMetricName(v string) *GetRelationalDatabaseMetricDataInput {
+ s.MetricName = &v
+ return s
+}
+
+// SetPeriod sets the Period field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetPeriod(v int64) *GetRelationalDatabaseMetricDataInput {
+ s.Period = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseMetricDataInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetStartTime sets the StartTime field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetStartTime(v time.Time) *GetRelationalDatabaseMetricDataInput {
+ s.StartTime = &v
+ return s
+}
+
+// SetStatistics sets the Statistics field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetStatistics(v []*string) *GetRelationalDatabaseMetricDataInput {
+ s.Statistics = v
+ return s
+}
+
+// SetUnit sets the Unit field's value.
+func (s *GetRelationalDatabaseMetricDataInput) SetUnit(v string) *GetRelationalDatabaseMetricDataInput {
+ s.Unit = &v
+ return s
+}
+
+type GetRelationalDatabaseMetricDataOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your get relational database metric data
+ // request.
+ MetricData []*MetricDatapoint `locationName:"metricData" type:"list"`
+
+ // The name of the metric.
+ MetricName *string `locationName:"metricName" type:"string" enum:"RelationalDatabaseMetricName"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseMetricDataOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseMetricDataOutput) GoString() string {
+ return s.String()
+}
+
+// SetMetricData sets the MetricData field's value.
+func (s *GetRelationalDatabaseMetricDataOutput) SetMetricData(v []*MetricDatapoint) *GetRelationalDatabaseMetricDataOutput {
+ s.MetricData = v
+ return s
+}
+
+// SetMetricName sets the MetricName field's value.
+func (s *GetRelationalDatabaseMetricDataOutput) SetMetricName(v string) *GetRelationalDatabaseMetricDataOutput {
+ s.MetricName = &v
+ return s
+}
+
+type GetRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the specified database.
+ RelationalDatabase *RelationalDatabase `locationName:"relationalDatabase" type:"structure"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetRelationalDatabase sets the RelationalDatabase field's value.
+func (s *GetRelationalDatabaseOutput) SetRelationalDatabase(v *RelationalDatabase) *GetRelationalDatabaseOutput {
+ s.RelationalDatabase = v
+ return s
+}
+
+type GetRelationalDatabaseParametersInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database parameters request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+
+ // The name of your database for which to get parameters.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseParametersInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseParametersInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseParametersInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseParametersInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseParametersInput) SetPageToken(v string) *GetRelationalDatabaseParametersInput {
+ s.PageToken = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *GetRelationalDatabaseParametersInput) SetRelationalDatabaseName(v string) *GetRelationalDatabaseParametersInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type GetRelationalDatabaseParametersOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to the next page of results from your get static
+ // IPs request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+
+ // An object describing the result of your get relational database parameters
+ // request.
+ Parameters []*RelationalDatabaseParameter `locationName:"parameters" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseParametersOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseParametersOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabaseParametersOutput) SetNextPageToken(v string) *GetRelationalDatabaseParametersOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+// SetParameters sets the Parameters field's value.
+func (s *GetRelationalDatabaseParametersOutput) SetParameters(v []*RelationalDatabaseParameter) *GetRelationalDatabaseParametersOutput {
+ s.Parameters = v
+ return s
+}
+
+type GetRelationalDatabaseSnapshotInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the database snapshot for which to get information.
+ //
+ // RelationalDatabaseSnapshotName is a required field
+ RelationalDatabaseSnapshotName *string `locationName:"relationalDatabaseSnapshotName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseSnapshotInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseSnapshotInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetRelationalDatabaseSnapshotInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetRelationalDatabaseSnapshotInput"}
+ if s.RelationalDatabaseSnapshotName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseSnapshotName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseSnapshotName sets the RelationalDatabaseSnapshotName field's value.
+func (s *GetRelationalDatabaseSnapshotInput) SetRelationalDatabaseSnapshotName(v string) *GetRelationalDatabaseSnapshotInput {
+ s.RelationalDatabaseSnapshotName = &v
+ return s
+}
+
+type GetRelationalDatabaseSnapshotOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the specified database snapshot.
+ RelationalDatabaseSnapshot *RelationalDatabaseSnapshot `locationName:"relationalDatabaseSnapshot" type:"structure"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseSnapshotOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseSnapshotOutput) GoString() string {
+ return s.String()
+}
+
+// SetRelationalDatabaseSnapshot sets the RelationalDatabaseSnapshot field's value.
+func (s *GetRelationalDatabaseSnapshotOutput) SetRelationalDatabaseSnapshot(v *RelationalDatabaseSnapshot) *GetRelationalDatabaseSnapshotOutput {
+ s.RelationalDatabaseSnapshot = v
+ return s
+}
+
+type GetRelationalDatabaseSnapshotsInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database snapshots request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseSnapshotsInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseSnapshotsInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabaseSnapshotsInput) SetPageToken(v string) *GetRelationalDatabaseSnapshotsInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetRelationalDatabaseSnapshotsOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to the next page of results from your get relational
+ // database snapshots request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+
+ // An object describing the result of your get relational database snapshots
+ // request.
+ RelationalDatabaseSnapshots []*RelationalDatabaseSnapshot `locationName:"relationalDatabaseSnapshots" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabaseSnapshotsOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabaseSnapshotsOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabaseSnapshotsOutput) SetNextPageToken(v string) *GetRelationalDatabaseSnapshotsOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+// SetRelationalDatabaseSnapshots sets the RelationalDatabaseSnapshots field's value.
+func (s *GetRelationalDatabaseSnapshotsOutput) SetRelationalDatabaseSnapshots(v []*RelationalDatabaseSnapshot) *GetRelationalDatabaseSnapshotsOutput {
+ s.RelationalDatabaseSnapshots = v
+ return s
+}
+
+type GetRelationalDatabasesInput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to a specific page of results for your get relational
+ // database request.
+ PageToken *string `locationName:"pageToken" type:"string"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabasesInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabasesInput) GoString() string {
+ return s.String()
+}
+
+// SetPageToken sets the PageToken field's value.
+func (s *GetRelationalDatabasesInput) SetPageToken(v string) *GetRelationalDatabasesInput {
+ s.PageToken = &v
+ return s
+}
+
+type GetRelationalDatabasesOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A token used for advancing to the next page of results from your get relational
+ // databases request.
+ NextPageToken *string `locationName:"nextPageToken" type:"string"`
+
+ // An object describing the result of your get relational databases request.
+ RelationalDatabases []*RelationalDatabase `locationName:"relationalDatabases" type:"list"`
+}
+
+// String returns the string representation
+func (s GetRelationalDatabasesOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetRelationalDatabasesOutput) GoString() string {
+ return s.String()
+}
+
+// SetNextPageToken sets the NextPageToken field's value.
+func (s *GetRelationalDatabasesOutput) SetNextPageToken(v string) *GetRelationalDatabasesOutput {
+ s.NextPageToken = &v
+ return s
+}
+
+// SetRelationalDatabases sets the RelationalDatabases field's value.
+func (s *GetRelationalDatabasesOutput) SetRelationalDatabases(v []*RelationalDatabase) *GetRelationalDatabasesOutput {
+ s.RelationalDatabases = v
+ return s
+}
+
type GetStaticIpInput struct {
_ struct{} `type:"structure"`
@@ -12814,6 +18892,99 @@ func (s *GetStaticIpsOutput) SetStaticIps(v []*StaticIp) *GetStaticIpsOutput {
return s
}
+// Describes the public SSH host keys or the RDP certificate.
+type HostKeyAttributes struct {
+ _ struct{} `type:"structure"`
+
+ // The SSH host key algorithm or the RDP certificate format.
+ //
+ // For SSH host keys, the algorithm may be ssh-rsa, ecdsa-sha2-nistp256, ssh-ed25519,
+ // etc. For RDP certificates, the algorithm is always x509-cert.
+ Algorithm *string `locationName:"algorithm" type:"string"`
+
+ // The SHA-1 fingerprint of the returned SSH host key or RDP certificate.
+ //
+ // * Example of an SHA-1 SSH fingerprint: SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0
+ //
+ // * Example of an SHA-1 RDP fingerprint: af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45
+ FingerprintSHA1 *string `locationName:"fingerprintSHA1" type:"string"`
+
+ // The SHA-256 fingerprint of the returned SSH host key or RDP certificate.
+ //
+ // * Example of an SHA-256 SSH fingerprint: SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o
+ //
+ // * Example of an SHA-256 RDP fingerprint: 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68
+ FingerprintSHA256 *string `locationName:"fingerprintSHA256" type:"string"`
+
+ // The returned RDP certificate is not valid after this point in time.
+ //
+ // This value is listed only for RDP certificates.
+ NotValidAfter *time.Time `locationName:"notValidAfter" type:"timestamp"`
+
+ // The returned RDP certificate is valid after this point in time.
+ //
+ // This value is listed only for RDP certificates.
+ NotValidBefore *time.Time `locationName:"notValidBefore" type:"timestamp"`
+
+ // The public SSH host key or the RDP certificate.
+ PublicKey *string `locationName:"publicKey" type:"string"`
+
+ // The time that the SSH host key or RDP certificate was recorded by Lightsail.
+ WitnessedAt *time.Time `locationName:"witnessedAt" type:"timestamp"`
+}
+
+// String returns the string representation
+func (s HostKeyAttributes) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s HostKeyAttributes) GoString() string {
+ return s.String()
+}
+
+// SetAlgorithm sets the Algorithm field's value.
+func (s *HostKeyAttributes) SetAlgorithm(v string) *HostKeyAttributes {
+ s.Algorithm = &v
+ return s
+}
+
+// SetFingerprintSHA1 sets the FingerprintSHA1 field's value.
+func (s *HostKeyAttributes) SetFingerprintSHA1(v string) *HostKeyAttributes {
+ s.FingerprintSHA1 = &v
+ return s
+}
+
+// SetFingerprintSHA256 sets the FingerprintSHA256 field's value.
+func (s *HostKeyAttributes) SetFingerprintSHA256(v string) *HostKeyAttributes {
+ s.FingerprintSHA256 = &v
+ return s
+}
+
+// SetNotValidAfter sets the NotValidAfter field's value.
+func (s *HostKeyAttributes) SetNotValidAfter(v time.Time) *HostKeyAttributes {
+ s.NotValidAfter = &v
+ return s
+}
+
+// SetNotValidBefore sets the NotValidBefore field's value.
+func (s *HostKeyAttributes) SetNotValidBefore(v time.Time) *HostKeyAttributes {
+ s.NotValidBefore = &v
+ return s
+}
+
+// SetPublicKey sets the PublicKey field's value.
+func (s *HostKeyAttributes) SetPublicKey(v string) *HostKeyAttributes {
+ s.PublicKey = &v
+ return s
+}
+
+// SetWitnessedAt sets the WitnessedAt field's value.
+func (s *HostKeyAttributes) SetWitnessedAt(v time.Time) *HostKeyAttributes {
+ s.WitnessedAt = &v
+ return s
+}
+
type ImportKeyPairInput struct {
_ struct{} `type:"structure"`
@@ -12906,7 +19077,7 @@ type Instance struct {
BundleId *string `locationName:"bundleId" type:"string"`
// The timestamp when the instance was created (e.g., 1479734909.17).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The size of the vCPU and the amount of RAM for the instance.
Hardware *InstanceHardware `locationName:"hardware" type:"structure"`
@@ -12918,7 +19089,7 @@ type Instance struct {
// to it.
IsStaticIp *bool `locationName:"isStaticIp" type:"boolean"`
- // The region name and availability zone where the instance is located.
+ // The region name and Availability Zone where the instance is located.
Location *ResourceLocation `locationName:"location" type:"structure"`
// The name the user gave the instance (e.g., Amazon_Linux-1GB-Ohio-1).
@@ -12948,6 +19119,10 @@ type Instance struct {
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// The user name for connecting to the instance (e.g., ec2-user).
Username *string `locationName:"username" type:"string"`
}
@@ -13064,6 +19239,12 @@ func (s *Instance) SetSupportCode(v string) *Instance {
return s
}
+// SetTags sets the Tags field's value.
+func (s *Instance) SetTags(v []*Tag) *Instance {
+ s.Tags = v
+ return s
+}
+
// SetUsername sets the Username field's value.
func (s *Instance) SetUsername(v string) *Instance {
s.Username = &v
@@ -13080,7 +19261,10 @@ type InstanceAccessDetails struct {
CertKey *string `locationName:"certKey" type:"string"`
// For SSH access, the date on which the temporary keys expire.
- ExpiresAt *time.Time `locationName:"expiresAt" type:"timestamp" timestampFormat:"unix"`
+ ExpiresAt *time.Time `locationName:"expiresAt" type:"timestamp"`
+
+ // Describes the public SSH host keys or the RDP certificate.
+ HostKeys []*HostKeyAttributes `locationName:"hostKeys" type:"list"`
// The name of this Amazon Lightsail instance.
InstanceName *string `locationName:"instanceName" type:"string"`
@@ -13141,6 +19325,12 @@ func (s *InstanceAccessDetails) SetExpiresAt(v time.Time) *InstanceAccessDetails
return s
}
+// SetHostKeys sets the HostKeys field's value.
+func (s *InstanceAccessDetails) SetHostKeys(v []*HostKeyAttributes) *InstanceAccessDetails {
+ s.HostKeys = v
+ return s
+}
+
// SetInstanceName sets the InstanceName field's value.
func (s *InstanceAccessDetails) SetInstanceName(v string) *InstanceAccessDetails {
s.InstanceName = &v
@@ -13183,6 +19373,116 @@ func (s *InstanceAccessDetails) SetUsername(v string) *InstanceAccessDetails {
return s
}
+// Describes the Amazon Elastic Compute Cloud instance and related resources
+// to be created using the create cloud formation stack operation.
+type InstanceEntry struct {
+ _ struct{} `type:"structure"`
+
+ // The Availability Zone for the new Amazon EC2 instance.
+ //
+ // AvailabilityZone is a required field
+ AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"`
+
+ // The instance type (e.g., t2.micro) to use for the new Amazon EC2 instance.
+ //
+ // InstanceType is a required field
+ InstanceType *string `locationName:"instanceType" type:"string" required:"true"`
+
+ // The port configuration to use for the new Amazon EC2 instance.
+ //
+ // The following configuration options are available:
+ //
+ // * DEFAULT — Use the default firewall settings from the image.
+ //
+ // * INSTANCE — Use the firewall settings from the source Lightsail instance.
+ //
+ // * NONE — Default to Amazon EC2.
+ //
+ // * CLOSED — All ports closed.
+ //
+ // PortInfoSource is a required field
+ PortInfoSource *string `locationName:"portInfoSource" type:"string" required:"true" enum:"PortInfoSourceType"`
+
+ // The name of the export snapshot record, which contains the exported Lightsail
+ // instance snapshot that will be used as the source of the new Amazon EC2 instance.
+ //
+ // Use the get export snapshot records operation to get a list of export snapshot
+ // records that you can use to create a CloudFormation stack.
+ //
+ // SourceName is a required field
+ SourceName *string `locationName:"sourceName" type:"string" required:"true"`
+
+ // A launch script you can create that configures a server with additional user
+ // data. For example, you might want to run apt-get -y update.
+ //
+ // Depending on the machine image you choose, the command to get software on
+ // your instance varies. Amazon Linux and CentOS use yum, Debian and Ubuntu
+ // use apt-get, and FreeBSD uses pkg.
+ UserData *string `locationName:"userData" type:"string"`
+}
+
+// String returns the string representation
+func (s InstanceEntry) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s InstanceEntry) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *InstanceEntry) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "InstanceEntry"}
+ if s.AvailabilityZone == nil {
+ invalidParams.Add(request.NewErrParamRequired("AvailabilityZone"))
+ }
+ if s.InstanceType == nil {
+ invalidParams.Add(request.NewErrParamRequired("InstanceType"))
+ }
+ if s.PortInfoSource == nil {
+ invalidParams.Add(request.NewErrParamRequired("PortInfoSource"))
+ }
+ if s.SourceName == nil {
+ invalidParams.Add(request.NewErrParamRequired("SourceName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAvailabilityZone sets the AvailabilityZone field's value.
+func (s *InstanceEntry) SetAvailabilityZone(v string) *InstanceEntry {
+ s.AvailabilityZone = &v
+ return s
+}
+
+// SetInstanceType sets the InstanceType field's value.
+func (s *InstanceEntry) SetInstanceType(v string) *InstanceEntry {
+ s.InstanceType = &v
+ return s
+}
+
+// SetPortInfoSource sets the PortInfoSource field's value.
+func (s *InstanceEntry) SetPortInfoSource(v string) *InstanceEntry {
+ s.PortInfoSource = &v
+ return s
+}
+
+// SetSourceName sets the SourceName field's value.
+func (s *InstanceEntry) SetSourceName(v string) *InstanceEntry {
+ s.SourceName = &v
+ return s
+}
+
+// SetUserData sets the UserData field's value.
+func (s *InstanceEntry) SetUserData(v string) *InstanceEntry {
+ s.UserData = &v
+ return s
+}
+
// Describes the hardware for the instance.
type InstanceHardware struct {
_ struct{} `type:"structure"`
@@ -13519,7 +19819,7 @@ type InstanceSnapshot struct {
Arn *string `locationName:"arn" type:"string"`
// The timestamp when the snapshot was created (e.g., 1479907467.024).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// An array of disk objects containing information about all block storage disks.
FromAttachedDisks []*Disk `locationName:"fromAttachedDisks" type:"list"`
@@ -13539,7 +19839,7 @@ type InstanceSnapshot struct {
// The instance from which the snapshot was created.
FromInstanceName *string `locationName:"fromInstanceName" type:"string"`
- // The region name and availability zone where you created the snapshot.
+ // The region name and Availability Zone where you created the snapshot.
Location *ResourceLocation `locationName:"location" type:"structure"`
// The name of the snapshot.
@@ -13561,6 +19861,10 @@ type InstanceSnapshot struct {
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -13657,6 +19961,54 @@ func (s *InstanceSnapshot) SetSupportCode(v string) *InstanceSnapshot {
return s
}
+// SetTags sets the Tags field's value.
+func (s *InstanceSnapshot) SetTags(v []*Tag) *InstanceSnapshot {
+ s.Tags = v
+ return s
+}
+
+// Describes an instance snapshot.
+type InstanceSnapshotInfo struct {
+ _ struct{} `type:"structure"`
+
+ // The blueprint ID from which the source instance (e.g., os_debian_8_3).
+ FromBlueprintId *string `locationName:"fromBlueprintId" type:"string"`
+
+ // The bundle ID from which the source instance was created (e.g., micro_1_0).
+ FromBundleId *string `locationName:"fromBundleId" type:"string"`
+
+ // A list of objects describing the disks that were attached to the source instance.
+ FromDiskInfo []*DiskInfo `locationName:"fromDiskInfo" type:"list"`
+}
+
+// String returns the string representation
+func (s InstanceSnapshotInfo) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s InstanceSnapshotInfo) GoString() string {
+ return s.String()
+}
+
+// SetFromBlueprintId sets the FromBlueprintId field's value.
+func (s *InstanceSnapshotInfo) SetFromBlueprintId(v string) *InstanceSnapshotInfo {
+ s.FromBlueprintId = &v
+ return s
+}
+
+// SetFromBundleId sets the FromBundleId field's value.
+func (s *InstanceSnapshotInfo) SetFromBundleId(v string) *InstanceSnapshotInfo {
+ s.FromBundleId = &v
+ return s
+}
+
+// SetFromDiskInfo sets the FromDiskInfo field's value.
+func (s *InstanceSnapshotInfo) SetFromDiskInfo(v []*DiskInfo) *InstanceSnapshotInfo {
+ s.FromDiskInfo = v
+ return s
+}
+
// Describes the virtual private server (or instance) status.
type InstanceState struct {
_ struct{} `type:"structure"`
@@ -13735,7 +20087,7 @@ type KeyPair struct {
Arn *string `locationName:"arn" type:"string"`
// The timestamp when the key pair was created (e.g., 1479816991.349).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The RSA fingerprint of the key pair.
Fingerprint *string `locationName:"fingerprint" type:"string"`
@@ -13753,6 +20105,10 @@ type KeyPair struct {
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -13807,6 +20163,12 @@ func (s *KeyPair) SetSupportCode(v string) *KeyPair {
return s
}
+// SetTags sets the Tags field's value.
+func (s *KeyPair) SetTags(v []*Tag) *KeyPair {
+ s.Tags = v
+ return s
+}
+
// Describes the Lightsail load balancer.
type LoadBalancer struct {
_ struct{} `type:"structure"`
@@ -13819,7 +20181,7 @@ type LoadBalancer struct {
ConfigurationOptions map[string]*string `locationName:"configurationOptions" type:"map"`
// The date when your load balancer was created.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The DNS name of your Lightsail load balancer.
DnsName *string `locationName:"dnsName" type:"string"`
@@ -13863,6 +20225,10 @@ type LoadBalancer struct {
// team to look up your Lightsail information more easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
+
// An array of LoadBalancerTlsCertificateSummary objects that provide additional
// information about the SSL/TLS certificates. For example, if true, the certificate
// is attached to the load balancer.
@@ -13963,6 +20329,12 @@ func (s *LoadBalancer) SetSupportCode(v string) *LoadBalancer {
return s
}
+// SetTags sets the Tags field's value.
+func (s *LoadBalancer) SetTags(v []*Tag) *LoadBalancer {
+ s.Tags = v
+ return s
+}
+
// SetTlsCertificateSummaries sets the TlsCertificateSummaries field's value.
func (s *LoadBalancer) SetTlsCertificateSummaries(v []*LoadBalancerTlsCertificateSummary) *LoadBalancer {
s.TlsCertificateSummaries = v
@@ -13979,7 +20351,7 @@ type LoadBalancerTlsCertificate struct {
Arn *string `locationName:"arn" type:"string"`
// The time when you created your SSL/TLS certificate.
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The domain name for your SSL/TLS certificate.
DomainName *string `locationName:"domainName" type:"string"`
@@ -13995,7 +20367,7 @@ type LoadBalancerTlsCertificate struct {
IsAttached *bool `locationName:"isAttached" type:"boolean"`
// The time when the SSL/TLS certificate was issued.
- IssuedAt *time.Time `locationName:"issuedAt" type:"timestamp" timestampFormat:"unix"`
+ IssuedAt *time.Time `locationName:"issuedAt" type:"timestamp"`
// The issuer of the certificate.
Issuer *string `locationName:"issuer" type:"string"`
@@ -14014,10 +20386,10 @@ type LoadBalancerTlsCertificate struct {
Name *string `locationName:"name" type:"string"`
// The timestamp when the SSL/TLS certificate expires.
- NotAfter *time.Time `locationName:"notAfter" type:"timestamp" timestampFormat:"unix"`
+ NotAfter *time.Time `locationName:"notAfter" type:"timestamp"`
// The timestamp when the SSL/TLS certificate is first valid.
- NotBefore *time.Time `locationName:"notBefore" type:"timestamp" timestampFormat:"unix"`
+ NotBefore *time.Time `locationName:"notBefore" type:"timestamp"`
// An object containing information about the status of Lightsail's managed
// renewal for the certificate.
@@ -14051,7 +20423,7 @@ type LoadBalancerTlsCertificate struct {
RevocationReason *string `locationName:"revocationReason" type:"string" enum:"LoadBalancerTlsCertificateRevocationReason"`
// The timestamp when the SSL/TLS certificate was revoked.
- RevokedAt *time.Time `locationName:"revokedAt" type:"timestamp" timestampFormat:"unix"`
+ RevokedAt *time.Time `locationName:"revokedAt" type:"timestamp"`
// The serial number of the certificate.
Serial *string `locationName:"serial" type:"string"`
@@ -14078,6 +20450,10 @@ type LoadBalancerTlsCertificate struct {
// code enables our support team to look up your Lightsail information more
// easily.
SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
}
// String returns the string representation
@@ -14234,6 +20610,12 @@ func (s *LoadBalancerTlsCertificate) SetSupportCode(v string) *LoadBalancerTlsCe
return s
}
+// SetTags sets the Tags field's value.
+func (s *LoadBalancerTlsCertificate) SetTags(v []*Tag) *LoadBalancerTlsCertificate {
+ s.Tags = v
+ return s
+}
+
// Contains information about the domain names on an SSL/TLS certificate that
// you will use to validate domain ownership.
type LoadBalancerTlsCertificateDomainValidationOption struct {
@@ -14398,6 +20780,39 @@ func (s *LoadBalancerTlsCertificateSummary) SetName(v string) *LoadBalancerTlsCe
return s
}
+// Describes a database log event.
+type LogEvent struct {
+ _ struct{} `type:"structure"`
+
+ // The timestamp when the database log event was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The message of the database log event.
+ Message *string `locationName:"message" type:"string"`
+}
+
+// String returns the string representation
+func (s LogEvent) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s LogEvent) GoString() string {
+ return s.String()
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *LogEvent) SetCreatedAt(v time.Time) *LogEvent {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *LogEvent) SetMessage(v string) *LogEvent {
+ s.Message = &v
+ return s
+}
+
// Describes the metric data point.
type MetricDatapoint struct {
_ struct{} `type:"structure"`
@@ -14418,7 +20833,7 @@ type MetricDatapoint struct {
Sum *float64 `locationName:"sum" type:"double"`
// The timestamp (e.g., 1479816991.349).
- Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"unix"`
+ Timestamp *time.Time `locationName:"timestamp" type:"timestamp"`
// The unit.
Unit *string `locationName:"unit" type:"string" enum:"MetricUnit"`
@@ -14581,7 +20996,7 @@ type Operation struct {
_ struct{} `type:"structure"`
// The timestamp when the operation was initialized (e.g., 1479816991.349).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The error code.
ErrorCode *string `locationName:"errorCode" type:"string"`
@@ -14614,7 +21029,7 @@ type Operation struct {
Status *string `locationName:"status" type:"string" enum:"OperationStatus"`
// The timestamp when the status was changed (e.g., 1479816991.349).
- StatusChangedAt *time.Time `locationName:"statusChangedAt" type:"timestamp" timestampFormat:"unix"`
+ StatusChangedAt *time.Time `locationName:"statusChangedAt" type:"timestamp"`
}
// String returns the string representation
@@ -14788,6 +21203,90 @@ func (s *PeerVpcOutput) SetOperation(v *Operation) *PeerVpcOutput {
return s
}
+// Describes a pending database maintenance action.
+type PendingMaintenanceAction struct {
+ _ struct{} `type:"structure"`
+
+ // The type of pending database maintenance action.
+ Action *string `locationName:"action" type:"string"`
+
+ // The effective date of the pending database maintenance action.
+ CurrentApplyDate *time.Time `locationName:"currentApplyDate" type:"timestamp"`
+
+ // Additional detail about the pending database maintenance action.
+ Description *string `locationName:"description" type:"string"`
+}
+
+// String returns the string representation
+func (s PendingMaintenanceAction) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PendingMaintenanceAction) GoString() string {
+ return s.String()
+}
+
+// SetAction sets the Action field's value.
+func (s *PendingMaintenanceAction) SetAction(v string) *PendingMaintenanceAction {
+ s.Action = &v
+ return s
+}
+
+// SetCurrentApplyDate sets the CurrentApplyDate field's value.
+func (s *PendingMaintenanceAction) SetCurrentApplyDate(v time.Time) *PendingMaintenanceAction {
+ s.CurrentApplyDate = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *PendingMaintenanceAction) SetDescription(v string) *PendingMaintenanceAction {
+ s.Description = &v
+ return s
+}
+
+// Describes a pending database value modification.
+type PendingModifiedRelationalDatabaseValues struct {
+ _ struct{} `type:"structure"`
+
+ // A Boolean value indicating whether automated backup retention is enabled.
+ BackupRetentionEnabled *bool `locationName:"backupRetentionEnabled" type:"boolean"`
+
+ // The database engine version.
+ EngineVersion *string `locationName:"engineVersion" type:"string"`
+
+ // The password for the master user of the database.
+ MasterUserPassword *string `locationName:"masterUserPassword" type:"string"`
+}
+
+// String returns the string representation
+func (s PendingModifiedRelationalDatabaseValues) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PendingModifiedRelationalDatabaseValues) GoString() string {
+ return s.String()
+}
+
+// SetBackupRetentionEnabled sets the BackupRetentionEnabled field's value.
+func (s *PendingModifiedRelationalDatabaseValues) SetBackupRetentionEnabled(v bool) *PendingModifiedRelationalDatabaseValues {
+ s.BackupRetentionEnabled = &v
+ return s
+}
+
+// SetEngineVersion sets the EngineVersion field's value.
+func (s *PendingModifiedRelationalDatabaseValues) SetEngineVersion(v string) *PendingModifiedRelationalDatabaseValues {
+ s.EngineVersion = &v
+ return s
+}
+
+// SetMasterUserPassword sets the MasterUserPassword field's value.
+func (s *PendingModifiedRelationalDatabaseValues) SetMasterUserPassword(v string) *PendingModifiedRelationalDatabaseValues {
+ s.MasterUserPassword = &v
+ return s
+}
+
// Describes information about the ports on your virtual private server (or
// instance).
type PortInfo struct {
@@ -14967,6 +21466,67 @@ func (s *RebootInstanceOutput) SetOperations(v []*Operation) *RebootInstanceOutp
return s
}
+type RebootRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of your database to reboot.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s RebootRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RebootRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *RebootRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "RebootRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *RebootRelationalDatabaseInput) SetRelationalDatabaseName(v string) *RebootRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type RebootRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your reboot relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s RebootRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RebootRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *RebootRelationalDatabaseOutput) SetOperations(v []*Operation) *RebootRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
// Describes the AWS Region.
type Region struct {
_ struct{} `type:"structure"`
@@ -14986,6 +21546,9 @@ type Region struct {
// The region name (e.g., us-east-2).
Name *string `locationName:"name" type:"string" enum:"RegionName"`
+
+ // The Availability Zones for databases. Follows the format us-east-2a (case-sensitive).
+ RelationalDatabaseAvailabilityZones []*AvailabilityZone `locationName:"relationalDatabaseAvailabilityZones" type:"list"`
}
// String returns the string representation
@@ -15028,6 +21591,805 @@ func (s *Region) SetName(v string) *Region {
return s
}
+// SetRelationalDatabaseAvailabilityZones sets the RelationalDatabaseAvailabilityZones field's value.
+func (s *Region) SetRelationalDatabaseAvailabilityZones(v []*AvailabilityZone) *Region {
+ s.RelationalDatabaseAvailabilityZones = v
+ return s
+}
+
+// Describes a database.
+type RelationalDatabase struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the database.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // A Boolean value indicating whether automated backup retention is enabled
+ // for the database.
+ BackupRetentionEnabled *bool `locationName:"backupRetentionEnabled" type:"boolean"`
+
+ // The timestamp when the database was created. Formatted in Unix time.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The database software (for example, MySQL).
+ Engine *string `locationName:"engine" type:"string"`
+
+ // The database engine version (for example, 5.7.23).
+ EngineVersion *string `locationName:"engineVersion" type:"string"`
+
+ // Describes the hardware of the database.
+ Hardware *RelationalDatabaseHardware `locationName:"hardware" type:"structure"`
+
+ // The latest point in time to which the database can be restored. Formatted
+ // in Unix time.
+ LatestRestorableTime *time.Time `locationName:"latestRestorableTime" type:"timestamp"`
+
+ // The Region name and Availability Zone where the database is located.
+ Location *ResourceLocation `locationName:"location" type:"structure"`
+
+ // The name of the master database created when the Lightsail database resource
+ // is created.
+ MasterDatabaseName *string `locationName:"masterDatabaseName" type:"string"`
+
+ // The master endpoint for the database.
+ MasterEndpoint *RelationalDatabaseEndpoint `locationName:"masterEndpoint" type:"structure"`
+
+ // The master user name of the database.
+ MasterUsername *string `locationName:"masterUsername" type:"string"`
+
+ // The unique name of the database resource in Lightsail.
+ Name *string `locationName:"name" type:"string"`
+
+ // The status of parameter updates for the database.
+ ParameterApplyStatus *string `locationName:"parameterApplyStatus" type:"string"`
+
+ // Describes the pending maintenance actions for the database.
+ PendingMaintenanceActions []*PendingMaintenanceAction `locationName:"pendingMaintenanceActions" type:"list"`
+
+ // Describes pending database value modifications.
+ PendingModifiedValues *PendingModifiedRelationalDatabaseValues `locationName:"pendingModifiedValues" type:"structure"`
+
+ // The daily time range during which automated backups are created for the database
+ // (for example, 16:00-16:30).
+ PreferredBackupWindow *string `locationName:"preferredBackupWindow" type:"string"`
+
+ // The weekly time range during which system maintenance can occur on the database.
+ //
+ // In the format ddd:hh24:mi-ddd:hh24:mi. For example, Tue:17:00-Tue:17:30.
+ PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"`
+
+ // A Boolean value indicating whether the database is publicly accessible.
+ PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"`
+
+ // The blueprint ID for the database. A blueprint describes the major engine
+ // version of a database.
+ RelationalDatabaseBlueprintId *string `locationName:"relationalDatabaseBlueprintId" type:"string"`
+
+ // The bundle ID for the database. A bundle describes the performance specifications
+ // for your database.
+ RelationalDatabaseBundleId *string `locationName:"relationalDatabaseBundleId" type:"string"`
+
+ // The Lightsail resource type for the database (for example, RelationalDatabase).
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"`
+
+ // Describes the secondary Availability Zone of a high availability database.
+ //
+ // The secondary database is used for failover support of a high availability
+ // database.
+ SecondaryAvailabilityZone *string `locationName:"secondaryAvailabilityZone" type:"string"`
+
+ // Describes the current state of the database.
+ State *string `locationName:"state" type:"string"`
+
+ // The support code for the database. Include this code in your email to support
+ // when you have questions about a database in Lightsail. This code enables
+ // our support team to look up your Lightsail information more easily.
+ SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
+}
+
+// String returns the string representation
+func (s RelationalDatabase) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabase) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *RelationalDatabase) SetArn(v string) *RelationalDatabase {
+ s.Arn = &v
+ return s
+}
+
+// SetBackupRetentionEnabled sets the BackupRetentionEnabled field's value.
+func (s *RelationalDatabase) SetBackupRetentionEnabled(v bool) *RelationalDatabase {
+ s.BackupRetentionEnabled = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *RelationalDatabase) SetCreatedAt(v time.Time) *RelationalDatabase {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetEngine sets the Engine field's value.
+func (s *RelationalDatabase) SetEngine(v string) *RelationalDatabase {
+ s.Engine = &v
+ return s
+}
+
+// SetEngineVersion sets the EngineVersion field's value.
+func (s *RelationalDatabase) SetEngineVersion(v string) *RelationalDatabase {
+ s.EngineVersion = &v
+ return s
+}
+
+// SetHardware sets the Hardware field's value.
+func (s *RelationalDatabase) SetHardware(v *RelationalDatabaseHardware) *RelationalDatabase {
+ s.Hardware = v
+ return s
+}
+
+// SetLatestRestorableTime sets the LatestRestorableTime field's value.
+func (s *RelationalDatabase) SetLatestRestorableTime(v time.Time) *RelationalDatabase {
+ s.LatestRestorableTime = &v
+ return s
+}
+
+// SetLocation sets the Location field's value.
+func (s *RelationalDatabase) SetLocation(v *ResourceLocation) *RelationalDatabase {
+ s.Location = v
+ return s
+}
+
+// SetMasterDatabaseName sets the MasterDatabaseName field's value.
+func (s *RelationalDatabase) SetMasterDatabaseName(v string) *RelationalDatabase {
+ s.MasterDatabaseName = &v
+ return s
+}
+
+// SetMasterEndpoint sets the MasterEndpoint field's value.
+func (s *RelationalDatabase) SetMasterEndpoint(v *RelationalDatabaseEndpoint) *RelationalDatabase {
+ s.MasterEndpoint = v
+ return s
+}
+
+// SetMasterUsername sets the MasterUsername field's value.
+func (s *RelationalDatabase) SetMasterUsername(v string) *RelationalDatabase {
+ s.MasterUsername = &v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *RelationalDatabase) SetName(v string) *RelationalDatabase {
+ s.Name = &v
+ return s
+}
+
+// SetParameterApplyStatus sets the ParameterApplyStatus field's value.
+func (s *RelationalDatabase) SetParameterApplyStatus(v string) *RelationalDatabase {
+ s.ParameterApplyStatus = &v
+ return s
+}
+
+// SetPendingMaintenanceActions sets the PendingMaintenanceActions field's value.
+func (s *RelationalDatabase) SetPendingMaintenanceActions(v []*PendingMaintenanceAction) *RelationalDatabase {
+ s.PendingMaintenanceActions = v
+ return s
+}
+
+// SetPendingModifiedValues sets the PendingModifiedValues field's value.
+func (s *RelationalDatabase) SetPendingModifiedValues(v *PendingModifiedRelationalDatabaseValues) *RelationalDatabase {
+ s.PendingModifiedValues = v
+ return s
+}
+
+// SetPreferredBackupWindow sets the PreferredBackupWindow field's value.
+func (s *RelationalDatabase) SetPreferredBackupWindow(v string) *RelationalDatabase {
+ s.PreferredBackupWindow = &v
+ return s
+}
+
+// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value.
+func (s *RelationalDatabase) SetPreferredMaintenanceWindow(v string) *RelationalDatabase {
+ s.PreferredMaintenanceWindow = &v
+ return s
+}
+
+// SetPubliclyAccessible sets the PubliclyAccessible field's value.
+func (s *RelationalDatabase) SetPubliclyAccessible(v bool) *RelationalDatabase {
+ s.PubliclyAccessible = &v
+ return s
+}
+
+// SetRelationalDatabaseBlueprintId sets the RelationalDatabaseBlueprintId field's value.
+func (s *RelationalDatabase) SetRelationalDatabaseBlueprintId(v string) *RelationalDatabase {
+ s.RelationalDatabaseBlueprintId = &v
+ return s
+}
+
+// SetRelationalDatabaseBundleId sets the RelationalDatabaseBundleId field's value.
+func (s *RelationalDatabase) SetRelationalDatabaseBundleId(v string) *RelationalDatabase {
+ s.RelationalDatabaseBundleId = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *RelationalDatabase) SetResourceType(v string) *RelationalDatabase {
+ s.ResourceType = &v
+ return s
+}
+
+// SetSecondaryAvailabilityZone sets the SecondaryAvailabilityZone field's value.
+func (s *RelationalDatabase) SetSecondaryAvailabilityZone(v string) *RelationalDatabase {
+ s.SecondaryAvailabilityZone = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *RelationalDatabase) SetState(v string) *RelationalDatabase {
+ s.State = &v
+ return s
+}
+
+// SetSupportCode sets the SupportCode field's value.
+func (s *RelationalDatabase) SetSupportCode(v string) *RelationalDatabase {
+ s.SupportCode = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *RelationalDatabase) SetTags(v []*Tag) *RelationalDatabase {
+ s.Tags = v
+ return s
+}
+
+// Describes a database image, or blueprint. A blueprint describes the major
+// engine version of a database.
+type RelationalDatabaseBlueprint struct {
+ _ struct{} `type:"structure"`
+
+ // The ID for the database blueprint.
+ BlueprintId *string `locationName:"blueprintId" type:"string"`
+
+ // The database software of the database blueprint (for example, MySQL).
+ Engine *string `locationName:"engine" type:"string" enum:"RelationalDatabaseEngine"`
+
+ // The description of the database engine for the database blueprint.
+ EngineDescription *string `locationName:"engineDescription" type:"string"`
+
+ // The database engine version for the database blueprint (for example, 5.7.23).
+ EngineVersion *string `locationName:"engineVersion" type:"string"`
+
+ // The description of the database engine version for the database blueprint.
+ EngineVersionDescription *string `locationName:"engineVersionDescription" type:"string"`
+
+ // A Boolean value indicating whether the engine version is the default for
+ // the database blueprint.
+ IsEngineDefault *bool `locationName:"isEngineDefault" type:"boolean"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseBlueprint) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseBlueprint) GoString() string {
+ return s.String()
+}
+
+// SetBlueprintId sets the BlueprintId field's value.
+func (s *RelationalDatabaseBlueprint) SetBlueprintId(v string) *RelationalDatabaseBlueprint {
+ s.BlueprintId = &v
+ return s
+}
+
+// SetEngine sets the Engine field's value.
+func (s *RelationalDatabaseBlueprint) SetEngine(v string) *RelationalDatabaseBlueprint {
+ s.Engine = &v
+ return s
+}
+
+// SetEngineDescription sets the EngineDescription field's value.
+func (s *RelationalDatabaseBlueprint) SetEngineDescription(v string) *RelationalDatabaseBlueprint {
+ s.EngineDescription = &v
+ return s
+}
+
+// SetEngineVersion sets the EngineVersion field's value.
+func (s *RelationalDatabaseBlueprint) SetEngineVersion(v string) *RelationalDatabaseBlueprint {
+ s.EngineVersion = &v
+ return s
+}
+
+// SetEngineVersionDescription sets the EngineVersionDescription field's value.
+func (s *RelationalDatabaseBlueprint) SetEngineVersionDescription(v string) *RelationalDatabaseBlueprint {
+ s.EngineVersionDescription = &v
+ return s
+}
+
+// SetIsEngineDefault sets the IsEngineDefault field's value.
+func (s *RelationalDatabaseBlueprint) SetIsEngineDefault(v bool) *RelationalDatabaseBlueprint {
+ s.IsEngineDefault = &v
+ return s
+}
+
+// Describes a database bundle. A bundle describes the performance specifications
+// of the database.
+type RelationalDatabaseBundle struct {
+ _ struct{} `type:"structure"`
+
+ // The ID for the database bundle.
+ BundleId *string `locationName:"bundleId" type:"string"`
+
+ // The number of virtual CPUs (vCPUs) for the database bundle.
+ CpuCount *int64 `locationName:"cpuCount" type:"integer"`
+
+ // The size of the disk for the database bundle.
+ DiskSizeInGb *int64 `locationName:"diskSizeInGb" type:"integer"`
+
+ // A Boolean value indicating whether the database bundle is active.
+ IsActive *bool `locationName:"isActive" type:"boolean"`
+
+ // A Boolean value indicating whether the database bundle is encrypted.
+ IsEncrypted *bool `locationName:"isEncrypted" type:"boolean"`
+
+ // The name for the database bundle.
+ Name *string `locationName:"name" type:"string"`
+
+ // The cost of the database bundle in US currency.
+ Price *float64 `locationName:"price" type:"float"`
+
+ // The amount of RAM in GB (for example, 2.0) for the database bundle.
+ RamSizeInGb *float64 `locationName:"ramSizeInGb" type:"float"`
+
+ // The data transfer rate per month in GB for the database bundle.
+ TransferPerMonthInGb *int64 `locationName:"transferPerMonthInGb" type:"integer"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseBundle) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseBundle) GoString() string {
+ return s.String()
+}
+
+// SetBundleId sets the BundleId field's value.
+func (s *RelationalDatabaseBundle) SetBundleId(v string) *RelationalDatabaseBundle {
+ s.BundleId = &v
+ return s
+}
+
+// SetCpuCount sets the CpuCount field's value.
+func (s *RelationalDatabaseBundle) SetCpuCount(v int64) *RelationalDatabaseBundle {
+ s.CpuCount = &v
+ return s
+}
+
+// SetDiskSizeInGb sets the DiskSizeInGb field's value.
+func (s *RelationalDatabaseBundle) SetDiskSizeInGb(v int64) *RelationalDatabaseBundle {
+ s.DiskSizeInGb = &v
+ return s
+}
+
+// SetIsActive sets the IsActive field's value.
+func (s *RelationalDatabaseBundle) SetIsActive(v bool) *RelationalDatabaseBundle {
+ s.IsActive = &v
+ return s
+}
+
+// SetIsEncrypted sets the IsEncrypted field's value.
+func (s *RelationalDatabaseBundle) SetIsEncrypted(v bool) *RelationalDatabaseBundle {
+ s.IsEncrypted = &v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *RelationalDatabaseBundle) SetName(v string) *RelationalDatabaseBundle {
+ s.Name = &v
+ return s
+}
+
+// SetPrice sets the Price field's value.
+func (s *RelationalDatabaseBundle) SetPrice(v float64) *RelationalDatabaseBundle {
+ s.Price = &v
+ return s
+}
+
+// SetRamSizeInGb sets the RamSizeInGb field's value.
+func (s *RelationalDatabaseBundle) SetRamSizeInGb(v float64) *RelationalDatabaseBundle {
+ s.RamSizeInGb = &v
+ return s
+}
+
+// SetTransferPerMonthInGb sets the TransferPerMonthInGb field's value.
+func (s *RelationalDatabaseBundle) SetTransferPerMonthInGb(v int64) *RelationalDatabaseBundle {
+ s.TransferPerMonthInGb = &v
+ return s
+}
+
+// Describes an endpoint for a database.
+type RelationalDatabaseEndpoint struct {
+ _ struct{} `type:"structure"`
+
+ // Specifies the DNS address of the database.
+ Address *string `locationName:"address" type:"string"`
+
+ // Specifies the port that the database is listening on.
+ Port *int64 `locationName:"port" type:"integer"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseEndpoint) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseEndpoint) GoString() string {
+ return s.String()
+}
+
+// SetAddress sets the Address field's value.
+func (s *RelationalDatabaseEndpoint) SetAddress(v string) *RelationalDatabaseEndpoint {
+ s.Address = &v
+ return s
+}
+
+// SetPort sets the Port field's value.
+func (s *RelationalDatabaseEndpoint) SetPort(v int64) *RelationalDatabaseEndpoint {
+ s.Port = &v
+ return s
+}
+
+// Describes an event for a database.
+type RelationalDatabaseEvent struct {
+ _ struct{} `type:"structure"`
+
+ // The timestamp when the database event was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The category that the database event belongs to.
+ EventCategories []*string `locationName:"eventCategories" type:"list"`
+
+ // The message of the database event.
+ Message *string `locationName:"message" type:"string"`
+
+ // The database that the database event relates to.
+ Resource *string `locationName:"resource" type:"string"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseEvent) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseEvent) GoString() string {
+ return s.String()
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *RelationalDatabaseEvent) SetCreatedAt(v time.Time) *RelationalDatabaseEvent {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetEventCategories sets the EventCategories field's value.
+func (s *RelationalDatabaseEvent) SetEventCategories(v []*string) *RelationalDatabaseEvent {
+ s.EventCategories = v
+ return s
+}
+
+// SetMessage sets the Message field's value.
+func (s *RelationalDatabaseEvent) SetMessage(v string) *RelationalDatabaseEvent {
+ s.Message = &v
+ return s
+}
+
+// SetResource sets the Resource field's value.
+func (s *RelationalDatabaseEvent) SetResource(v string) *RelationalDatabaseEvent {
+ s.Resource = &v
+ return s
+}
+
+// Describes the hardware of a database.
+type RelationalDatabaseHardware struct {
+ _ struct{} `type:"structure"`
+
+ // The number of vCPUs for the database.
+ CpuCount *int64 `locationName:"cpuCount" type:"integer"`
+
+ // The size of the disk for the database.
+ DiskSizeInGb *int64 `locationName:"diskSizeInGb" type:"integer"`
+
+ // The amount of RAM in GB for the database.
+ RamSizeInGb *float64 `locationName:"ramSizeInGb" type:"float"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseHardware) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseHardware) GoString() string {
+ return s.String()
+}
+
+// SetCpuCount sets the CpuCount field's value.
+func (s *RelationalDatabaseHardware) SetCpuCount(v int64) *RelationalDatabaseHardware {
+ s.CpuCount = &v
+ return s
+}
+
+// SetDiskSizeInGb sets the DiskSizeInGb field's value.
+func (s *RelationalDatabaseHardware) SetDiskSizeInGb(v int64) *RelationalDatabaseHardware {
+ s.DiskSizeInGb = &v
+ return s
+}
+
+// SetRamSizeInGb sets the RamSizeInGb field's value.
+func (s *RelationalDatabaseHardware) SetRamSizeInGb(v float64) *RelationalDatabaseHardware {
+ s.RamSizeInGb = &v
+ return s
+}
+
+// Describes the parameters of a database.
+type RelationalDatabaseParameter struct {
+ _ struct{} `type:"structure"`
+
+ // Specifies the valid range of values for the parameter.
+ AllowedValues *string `locationName:"allowedValues" type:"string"`
+
+ // Indicates when parameter updates are applied.
+ //
+ // Can be immediate or pending-reboot.
+ ApplyMethod *string `locationName:"applyMethod" type:"string"`
+
+ // Specifies the engine-specific parameter type.
+ ApplyType *string `locationName:"applyType" type:"string"`
+
+ // Specifies the valid data type for the parameter.
+ DataType *string `locationName:"dataType" type:"string"`
+
+ // Provides a description of the parameter.
+ Description *string `locationName:"description" type:"string"`
+
+ // A Boolean value indicating whether the parameter can be modified.
+ IsModifiable *bool `locationName:"isModifiable" type:"boolean"`
+
+ // Specifies the name of the parameter.
+ ParameterName *string `locationName:"parameterName" type:"string"`
+
+ // Specifies the value of the parameter.
+ ParameterValue *string `locationName:"parameterValue" type:"string"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseParameter) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseParameter) GoString() string {
+ return s.String()
+}
+
+// SetAllowedValues sets the AllowedValues field's value.
+func (s *RelationalDatabaseParameter) SetAllowedValues(v string) *RelationalDatabaseParameter {
+ s.AllowedValues = &v
+ return s
+}
+
+// SetApplyMethod sets the ApplyMethod field's value.
+func (s *RelationalDatabaseParameter) SetApplyMethod(v string) *RelationalDatabaseParameter {
+ s.ApplyMethod = &v
+ return s
+}
+
+// SetApplyType sets the ApplyType field's value.
+func (s *RelationalDatabaseParameter) SetApplyType(v string) *RelationalDatabaseParameter {
+ s.ApplyType = &v
+ return s
+}
+
+// SetDataType sets the DataType field's value.
+func (s *RelationalDatabaseParameter) SetDataType(v string) *RelationalDatabaseParameter {
+ s.DataType = &v
+ return s
+}
+
+// SetDescription sets the Description field's value.
+func (s *RelationalDatabaseParameter) SetDescription(v string) *RelationalDatabaseParameter {
+ s.Description = &v
+ return s
+}
+
+// SetIsModifiable sets the IsModifiable field's value.
+func (s *RelationalDatabaseParameter) SetIsModifiable(v bool) *RelationalDatabaseParameter {
+ s.IsModifiable = &v
+ return s
+}
+
+// SetParameterName sets the ParameterName field's value.
+func (s *RelationalDatabaseParameter) SetParameterName(v string) *RelationalDatabaseParameter {
+ s.ParameterName = &v
+ return s
+}
+
+// SetParameterValue sets the ParameterValue field's value.
+func (s *RelationalDatabaseParameter) SetParameterValue(v string) *RelationalDatabaseParameter {
+ s.ParameterValue = &v
+ return s
+}
+
+// Describes a database snapshot.
+type RelationalDatabaseSnapshot struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the database snapshot.
+ Arn *string `locationName:"arn" type:"string"`
+
+ // The timestamp when the database snapshot was created.
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
+
+ // The software of the database snapshot (for example, MySQL)
+ Engine *string `locationName:"engine" type:"string"`
+
+ // The database engine version for the database snapshot (for example, 5.7.23).
+ EngineVersion *string `locationName:"engineVersion" type:"string"`
+
+ // The Amazon Resource Name (ARN) of the database from which the database snapshot
+ // was created.
+ FromRelationalDatabaseArn *string `locationName:"fromRelationalDatabaseArn" type:"string"`
+
+ // The blueprint ID of the database from which the database snapshot was created.
+ // A blueprint describes the major engine version of a database.
+ FromRelationalDatabaseBlueprintId *string `locationName:"fromRelationalDatabaseBlueprintId" type:"string"`
+
+ // The bundle ID of the database from which the database snapshot was created.
+ FromRelationalDatabaseBundleId *string `locationName:"fromRelationalDatabaseBundleId" type:"string"`
+
+ // The name of the source database from which the database snapshot was created.
+ FromRelationalDatabaseName *string `locationName:"fromRelationalDatabaseName" type:"string"`
+
+ // The Region name and Availability Zone where the database snapshot is located.
+ Location *ResourceLocation `locationName:"location" type:"structure"`
+
+ // The name of the database snapshot.
+ Name *string `locationName:"name" type:"string"`
+
+ // The Lightsail resource type.
+ ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"`
+
+ // The size of the disk in GB (for example, 32) for the database snapshot.
+ SizeInGb *int64 `locationName:"sizeInGb" type:"integer"`
+
+ // The state of the database snapshot.
+ State *string `locationName:"state" type:"string"`
+
+ // The support code for the database snapshot. Include this code in your email
+ // to support when you have questions about a database snapshot in Lightsail.
+ // This code enables our support team to look up your Lightsail information
+ // more easily.
+ SupportCode *string `locationName:"supportCode" type:"string"`
+
+ // The tag keys and optional values for the resource. For more information about
+ // tags in Lightsail, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+ Tags []*Tag `locationName:"tags" type:"list"`
+}
+
+// String returns the string representation
+func (s RelationalDatabaseSnapshot) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s RelationalDatabaseSnapshot) GoString() string {
+ return s.String()
+}
+
+// SetArn sets the Arn field's value.
+func (s *RelationalDatabaseSnapshot) SetArn(v string) *RelationalDatabaseSnapshot {
+ s.Arn = &v
+ return s
+}
+
+// SetCreatedAt sets the CreatedAt field's value.
+func (s *RelationalDatabaseSnapshot) SetCreatedAt(v time.Time) *RelationalDatabaseSnapshot {
+ s.CreatedAt = &v
+ return s
+}
+
+// SetEngine sets the Engine field's value.
+func (s *RelationalDatabaseSnapshot) SetEngine(v string) *RelationalDatabaseSnapshot {
+ s.Engine = &v
+ return s
+}
+
+// SetEngineVersion sets the EngineVersion field's value.
+func (s *RelationalDatabaseSnapshot) SetEngineVersion(v string) *RelationalDatabaseSnapshot {
+ s.EngineVersion = &v
+ return s
+}
+
+// SetFromRelationalDatabaseArn sets the FromRelationalDatabaseArn field's value.
+func (s *RelationalDatabaseSnapshot) SetFromRelationalDatabaseArn(v string) *RelationalDatabaseSnapshot {
+ s.FromRelationalDatabaseArn = &v
+ return s
+}
+
+// SetFromRelationalDatabaseBlueprintId sets the FromRelationalDatabaseBlueprintId field's value.
+func (s *RelationalDatabaseSnapshot) SetFromRelationalDatabaseBlueprintId(v string) *RelationalDatabaseSnapshot {
+ s.FromRelationalDatabaseBlueprintId = &v
+ return s
+}
+
+// SetFromRelationalDatabaseBundleId sets the FromRelationalDatabaseBundleId field's value.
+func (s *RelationalDatabaseSnapshot) SetFromRelationalDatabaseBundleId(v string) *RelationalDatabaseSnapshot {
+ s.FromRelationalDatabaseBundleId = &v
+ return s
+}
+
+// SetFromRelationalDatabaseName sets the FromRelationalDatabaseName field's value.
+func (s *RelationalDatabaseSnapshot) SetFromRelationalDatabaseName(v string) *RelationalDatabaseSnapshot {
+ s.FromRelationalDatabaseName = &v
+ return s
+}
+
+// SetLocation sets the Location field's value.
+func (s *RelationalDatabaseSnapshot) SetLocation(v *ResourceLocation) *RelationalDatabaseSnapshot {
+ s.Location = v
+ return s
+}
+
+// SetName sets the Name field's value.
+func (s *RelationalDatabaseSnapshot) SetName(v string) *RelationalDatabaseSnapshot {
+ s.Name = &v
+ return s
+}
+
+// SetResourceType sets the ResourceType field's value.
+func (s *RelationalDatabaseSnapshot) SetResourceType(v string) *RelationalDatabaseSnapshot {
+ s.ResourceType = &v
+ return s
+}
+
+// SetSizeInGb sets the SizeInGb field's value.
+func (s *RelationalDatabaseSnapshot) SetSizeInGb(v int64) *RelationalDatabaseSnapshot {
+ s.SizeInGb = &v
+ return s
+}
+
+// SetState sets the State field's value.
+func (s *RelationalDatabaseSnapshot) SetState(v string) *RelationalDatabaseSnapshot {
+ s.State = &v
+ return s
+}
+
+// SetSupportCode sets the SupportCode field's value.
+func (s *RelationalDatabaseSnapshot) SetSupportCode(v string) *RelationalDatabaseSnapshot {
+ s.SupportCode = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *RelationalDatabaseSnapshot) SetTags(v []*Tag) *RelationalDatabaseSnapshot {
+ s.Tags = v
+ return s
+}
+
type ReleaseStaticIpInput struct {
_ struct{} `type:"structure"`
@@ -15183,6 +22545,67 @@ func (s *StartInstanceOutput) SetOperations(v []*Operation) *StartInstanceOutput
return s
}
+type StartRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of your database to start.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s StartRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s StartRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *StartRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "StartRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *StartRelationalDatabaseInput) SetRelationalDatabaseName(v string) *StartRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type StartRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your start relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s StartRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s StartRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *StartRelationalDatabaseOutput) SetOperations(v []*Operation) *StartRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
// Describes the static IP.
type StaticIp struct {
_ struct{} `type:"structure"`
@@ -15194,7 +22617,7 @@ type StaticIp struct {
AttachedTo *string `locationName:"attachedTo" type:"string"`
// The timestamp when the static IP was created (e.g., 1479735304.222).
- CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"unix"`
+ CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"`
// The static IP address.
IpAddress *string `locationName:"ipAddress" type:"string"`
@@ -15356,6 +22779,194 @@ func (s *StopInstanceOutput) SetOperations(v []*Operation) *StopInstanceOutput {
return s
}
+type StopRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of your database to stop.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // The name of your new database snapshot to be created before stopping your
+ // database.
+ RelationalDatabaseSnapshotName *string `locationName:"relationalDatabaseSnapshotName" type:"string"`
+}
+
+// String returns the string representation
+func (s StopRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s StopRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *StopRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "StopRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *StopRelationalDatabaseInput) SetRelationalDatabaseName(v string) *StopRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetRelationalDatabaseSnapshotName sets the RelationalDatabaseSnapshotName field's value.
+func (s *StopRelationalDatabaseInput) SetRelationalDatabaseSnapshotName(v string) *StopRelationalDatabaseInput {
+ s.RelationalDatabaseSnapshotName = &v
+ return s
+}
+
+type StopRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your stop relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s StopRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s StopRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *StopRelationalDatabaseOutput) SetOperations(v []*Operation) *StopRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
+// Describes a tag key and optional value assigned to an Amazon Lightsail resource.
+//
+// For more information about tags in Lightsail, see the Lightsail Dev Guide
+// (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags).
+type Tag struct {
+ _ struct{} `type:"structure"`
+
+ // The key of the tag.
+ //
+ // Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in
+ // UTF-8, or the following characters: + - = . _ : / @
+ Key *string `locationName:"key" type:"string"`
+
+ // The value of the tag.
+ //
+ // Constraints: Tag values accept a maximum of 256 letters, numbers, spaces
+ // in UTF-8, or the following characters: + - = . _ : / @
+ Value *string `locationName:"value" type:"string"`
+}
+
+// String returns the string representation
+func (s Tag) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s Tag) GoString() string {
+ return s.String()
+}
+
+// SetKey sets the Key field's value.
+func (s *Tag) SetKey(v string) *Tag {
+ s.Key = &v
+ return s
+}
+
+// SetValue sets the Value field's value.
+func (s *Tag) SetValue(v string) *Tag {
+ s.Value = &v
+ return s
+}
+
+type TagResourceInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the resource to which you are adding tags.
+ //
+ // ResourceName is a required field
+ ResourceName *string `locationName:"resourceName" type:"string" required:"true"`
+
+ // The tag key and optional value.
+ //
+ // Tags is a required field
+ Tags []*Tag `locationName:"tags" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s TagResourceInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TagResourceInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *TagResourceInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"}
+ if s.ResourceName == nil {
+ invalidParams.Add(request.NewErrParamRequired("ResourceName"))
+ }
+ if s.Tags == nil {
+ invalidParams.Add(request.NewErrParamRequired("Tags"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetResourceName sets the ResourceName field's value.
+func (s *TagResourceInput) SetResourceName(v string) *TagResourceInput {
+ s.ResourceName = &v
+ return s
+}
+
+// SetTags sets the Tags field's value.
+func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput {
+ s.Tags = v
+ return s
+}
+
+type TagResourceOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s TagResourceOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s TagResourceOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *TagResourceOutput) SetOperations(v []*Operation) *TagResourceOutput {
+ s.Operations = v
+ return s
+}
+
type UnpeerVpcInput struct {
_ struct{} `type:"structure"`
}
@@ -15393,6 +23004,81 @@ func (s *UnpeerVpcOutput) SetOperation(v *Operation) *UnpeerVpcOutput {
return s
}
+type UntagResourceInput struct {
+ _ struct{} `type:"structure"`
+
+ // The name of the resource from which you are removing a tag.
+ //
+ // ResourceName is a required field
+ ResourceName *string `locationName:"resourceName" type:"string" required:"true"`
+
+ // The tag keys to delete from the specified resource.
+ //
+ // TagKeys is a required field
+ TagKeys []*string `locationName:"tagKeys" type:"list" required:"true"`
+}
+
+// String returns the string representation
+func (s UntagResourceInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UntagResourceInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UntagResourceInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"}
+ if s.ResourceName == nil {
+ invalidParams.Add(request.NewErrParamRequired("ResourceName"))
+ }
+ if s.TagKeys == nil {
+ invalidParams.Add(request.NewErrParamRequired("TagKeys"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetResourceName sets the ResourceName field's value.
+func (s *UntagResourceInput) SetResourceName(v string) *UntagResourceInput {
+ s.ResourceName = &v
+ return s
+}
+
+// SetTagKeys sets the TagKeys field's value.
+func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput {
+ s.TagKeys = v
+ return s
+}
+
+type UntagResourceOutput struct {
+ _ struct{} `type:"structure"`
+
+ // A list of objects describing the API operation.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s UntagResourceOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UntagResourceOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *UntagResourceOutput) SetOperations(v []*Operation) *UntagResourceOutput {
+ s.Operations = v
+ return s
+}
+
type UpdateDomainEntryInput struct {
_ struct{} `type:"structure"`
@@ -15560,6 +23246,264 @@ func (s *UpdateLoadBalancerAttributeOutput) SetOperations(v []*Operation) *Updat
return s
}
+type UpdateRelationalDatabaseInput struct {
+ _ struct{} `type:"structure"`
+
+ // When true, applies changes immediately. When false, applies changes during
+ // the preferred maintenance window. Some changes may cause an outage.
+ //
+ // Default: false
+ ApplyImmediately *bool `locationName:"applyImmediately" type:"boolean"`
+
+ // When true, disables automated backup retention for your database.
+ //
+ // Disabling backup retention deletes all automated database backups. Before
+ // disabling this, you may want to create a snapshot of your database using
+ // the create relational database snapshot operation.
+ //
+ // Updates are applied during the next maintenance window because this can result
+ // in an outage.
+ DisableBackupRetention *bool `locationName:"disableBackupRetention" type:"boolean"`
+
+ // When true, enables automated backup retention for your database.
+ //
+ // Updates are applied during the next maintenance window because this can result
+ // in an outage.
+ EnableBackupRetention *bool `locationName:"enableBackupRetention" type:"boolean"`
+
+ // The password for the master user of your database. The password can include
+ // any printable ASCII character except "/", """, or "@".
+ //
+ // Constraints: Must contain 8 to 41 characters.
+ MasterUserPassword *string `locationName:"masterUserPassword" type:"string" sensitive:"true"`
+
+ // The daily time range during which automated backups are created for your
+ // database if automated backups are enabled.
+ //
+ // Constraints:
+ //
+ // * Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Must not conflict with the preferred maintenance window.
+ //
+ // * Must be at least 30 minutes.
+ PreferredBackupWindow *string `locationName:"preferredBackupWindow" type:"string"`
+
+ // The weekly time range during which system maintenance can occur on your database.
+ //
+ // The default is a 30-minute window selected at random from an 8-hour block
+ // of time for each AWS Region, occurring on a random day of the week.
+ //
+ // Constraints:
+ //
+ // * Must be in the ddd:hh24:mi-ddd:hh24:mi format.
+ //
+ // * Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
+ //
+ // * Must be at least 30 minutes.
+ //
+ // * Specified in Universal Coordinated Time (UTC).
+ //
+ // * Example: Tue:17:00-Tue:17:30
+ PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"`
+
+ // Specifies the accessibility options for your database. A value of true specifies
+ // a database that is available to resources outside of your Lightsail account.
+ // A value of false specifies a database that is available only to your Lightsail
+ // resources in the same region as your database.
+ PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"`
+
+ // The name of your database to update.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+
+ // When true, the master user password is changed to a new strong password generated
+ // by Lightsail.
+ //
+ // Use the get relational database master user password operation to get the
+ // new password.
+ RotateMasterUserPassword *bool `locationName:"rotateMasterUserPassword" type:"boolean"`
+}
+
+// String returns the string representation
+func (s UpdateRelationalDatabaseInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateRelationalDatabaseInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UpdateRelationalDatabaseInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UpdateRelationalDatabaseInput"}
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetApplyImmediately sets the ApplyImmediately field's value.
+func (s *UpdateRelationalDatabaseInput) SetApplyImmediately(v bool) *UpdateRelationalDatabaseInput {
+ s.ApplyImmediately = &v
+ return s
+}
+
+// SetDisableBackupRetention sets the DisableBackupRetention field's value.
+func (s *UpdateRelationalDatabaseInput) SetDisableBackupRetention(v bool) *UpdateRelationalDatabaseInput {
+ s.DisableBackupRetention = &v
+ return s
+}
+
+// SetEnableBackupRetention sets the EnableBackupRetention field's value.
+func (s *UpdateRelationalDatabaseInput) SetEnableBackupRetention(v bool) *UpdateRelationalDatabaseInput {
+ s.EnableBackupRetention = &v
+ return s
+}
+
+// SetMasterUserPassword sets the MasterUserPassword field's value.
+func (s *UpdateRelationalDatabaseInput) SetMasterUserPassword(v string) *UpdateRelationalDatabaseInput {
+ s.MasterUserPassword = &v
+ return s
+}
+
+// SetPreferredBackupWindow sets the PreferredBackupWindow field's value.
+func (s *UpdateRelationalDatabaseInput) SetPreferredBackupWindow(v string) *UpdateRelationalDatabaseInput {
+ s.PreferredBackupWindow = &v
+ return s
+}
+
+// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value.
+func (s *UpdateRelationalDatabaseInput) SetPreferredMaintenanceWindow(v string) *UpdateRelationalDatabaseInput {
+ s.PreferredMaintenanceWindow = &v
+ return s
+}
+
+// SetPubliclyAccessible sets the PubliclyAccessible field's value.
+func (s *UpdateRelationalDatabaseInput) SetPubliclyAccessible(v bool) *UpdateRelationalDatabaseInput {
+ s.PubliclyAccessible = &v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *UpdateRelationalDatabaseInput) SetRelationalDatabaseName(v string) *UpdateRelationalDatabaseInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+// SetRotateMasterUserPassword sets the RotateMasterUserPassword field's value.
+func (s *UpdateRelationalDatabaseInput) SetRotateMasterUserPassword(v bool) *UpdateRelationalDatabaseInput {
+ s.RotateMasterUserPassword = &v
+ return s
+}
+
+type UpdateRelationalDatabaseOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your update relational database request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s UpdateRelationalDatabaseOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateRelationalDatabaseOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *UpdateRelationalDatabaseOutput) SetOperations(v []*Operation) *UpdateRelationalDatabaseOutput {
+ s.Operations = v
+ return s
+}
+
+type UpdateRelationalDatabaseParametersInput struct {
+ _ struct{} `type:"structure"`
+
+ // The database parameters to update.
+ //
+ // Parameters is a required field
+ Parameters []*RelationalDatabaseParameter `locationName:"parameters" type:"list" required:"true"`
+
+ // The name of your database for which to update parameters.
+ //
+ // RelationalDatabaseName is a required field
+ RelationalDatabaseName *string `locationName:"relationalDatabaseName" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s UpdateRelationalDatabaseParametersInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateRelationalDatabaseParametersInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *UpdateRelationalDatabaseParametersInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "UpdateRelationalDatabaseParametersInput"}
+ if s.Parameters == nil {
+ invalidParams.Add(request.NewErrParamRequired("Parameters"))
+ }
+ if s.RelationalDatabaseName == nil {
+ invalidParams.Add(request.NewErrParamRequired("RelationalDatabaseName"))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetParameters sets the Parameters field's value.
+func (s *UpdateRelationalDatabaseParametersInput) SetParameters(v []*RelationalDatabaseParameter) *UpdateRelationalDatabaseParametersInput {
+ s.Parameters = v
+ return s
+}
+
+// SetRelationalDatabaseName sets the RelationalDatabaseName field's value.
+func (s *UpdateRelationalDatabaseParametersInput) SetRelationalDatabaseName(v string) *UpdateRelationalDatabaseParametersInput {
+ s.RelationalDatabaseName = &v
+ return s
+}
+
+type UpdateRelationalDatabaseParametersOutput struct {
+ _ struct{} `type:"structure"`
+
+ // An object describing the result of your update relational database parameters
+ // request.
+ Operations []*Operation `locationName:"operations" type:"list"`
+}
+
+// String returns the string representation
+func (s UpdateRelationalDatabaseParametersOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s UpdateRelationalDatabaseParametersOutput) GoString() string {
+ return s.String()
+}
+
+// SetOperations sets the Operations field's value.
+func (s *UpdateRelationalDatabaseParametersOutput) SetOperations(v []*Operation) *UpdateRelationalDatabaseParametersOutput {
+ s.Operations = v
+ return s
+}
+
const (
// AccessDirectionInbound is a AccessDirection enum value
AccessDirectionInbound = "inbound"
@@ -15576,6 +23520,11 @@ const (
BlueprintTypeApp = "app"
)
+const (
+ // CloudFormationStackRecordSourceTypeExportSnapshotRecord is a CloudFormationStackRecordSourceType enum value
+ CloudFormationStackRecordSourceTypeExportSnapshotRecord = "ExportSnapshotRecord"
+)
+
const (
// DiskSnapshotStatePending is a DiskSnapshotState enum value
DiskSnapshotStatePending = "pending"
@@ -15607,6 +23556,14 @@ const (
DiskStateUnknown = "unknown"
)
+const (
+ // ExportSnapshotRecordSourceTypeInstanceSnapshot is a ExportSnapshotRecordSourceType enum value
+ ExportSnapshotRecordSourceTypeInstanceSnapshot = "InstanceSnapshot"
+
+ // ExportSnapshotRecordSourceTypeDiskSnapshot is a ExportSnapshotRecordSourceType enum value
+ ExportSnapshotRecordSourceTypeDiskSnapshot = "DiskSnapshot"
+)
+
const (
// InstanceAccessProtocolSsh is a InstanceAccessProtocol enum value
InstanceAccessProtocolSsh = "ssh"
@@ -16012,6 +23969,9 @@ const (
)
const (
+ // OperationTypeDeleteKnownHostKeys is a OperationType enum value
+ OperationTypeDeleteKnownHostKeys = "DeleteKnownHostKeys"
+
// OperationTypeDeleteInstance is a OperationType enum value
OperationTypeDeleteInstance = "DeleteInstance"
@@ -16113,6 +24073,36 @@ const (
// OperationTypeCreateDiskFromSnapshot is a OperationType enum value
OperationTypeCreateDiskFromSnapshot = "CreateDiskFromSnapshot"
+
+ // OperationTypeCreateRelationalDatabase is a OperationType enum value
+ OperationTypeCreateRelationalDatabase = "CreateRelationalDatabase"
+
+ // OperationTypeUpdateRelationalDatabase is a OperationType enum value
+ OperationTypeUpdateRelationalDatabase = "UpdateRelationalDatabase"
+
+ // OperationTypeDeleteRelationalDatabase is a OperationType enum value
+ OperationTypeDeleteRelationalDatabase = "DeleteRelationalDatabase"
+
+ // OperationTypeCreateRelationalDatabaseFromSnapshot is a OperationType enum value
+ OperationTypeCreateRelationalDatabaseFromSnapshot = "CreateRelationalDatabaseFromSnapshot"
+
+ // OperationTypeCreateRelationalDatabaseSnapshot is a OperationType enum value
+ OperationTypeCreateRelationalDatabaseSnapshot = "CreateRelationalDatabaseSnapshot"
+
+ // OperationTypeDeleteRelationalDatabaseSnapshot is a OperationType enum value
+ OperationTypeDeleteRelationalDatabaseSnapshot = "DeleteRelationalDatabaseSnapshot"
+
+ // OperationTypeUpdateRelationalDatabaseParameters is a OperationType enum value
+ OperationTypeUpdateRelationalDatabaseParameters = "UpdateRelationalDatabaseParameters"
+
+ // OperationTypeStartRelationalDatabase is a OperationType enum value
+ OperationTypeStartRelationalDatabase = "StartRelationalDatabase"
+
+ // OperationTypeRebootRelationalDatabase is a OperationType enum value
+ OperationTypeRebootRelationalDatabase = "RebootRelationalDatabase"
+
+ // OperationTypeStopRelationalDatabase is a OperationType enum value
+ OperationTypeStopRelationalDatabase = "StopRelationalDatabase"
)
const (
@@ -16123,6 +24113,20 @@ const (
PortAccessTypePrivate = "Private"
)
+const (
+ // PortInfoSourceTypeDefault is a PortInfoSourceType enum value
+ PortInfoSourceTypeDefault = "DEFAULT"
+
+ // PortInfoSourceTypeInstance is a PortInfoSourceType enum value
+ PortInfoSourceTypeInstance = "INSTANCE"
+
+ // PortInfoSourceTypeNone is a PortInfoSourceType enum value
+ PortInfoSourceTypeNone = "NONE"
+
+ // PortInfoSourceTypeClosed is a PortInfoSourceType enum value
+ PortInfoSourceTypeClosed = "CLOSED"
+)
+
const (
// PortStateOpen is a PortState enum value
PortStateOpen = "open"
@@ -16131,6 +24135,17 @@ const (
PortStateClosed = "closed"
)
+const (
+ // RecordStateStarted is a RecordState enum value
+ RecordStateStarted = "Started"
+
+ // RecordStateSucceeded is a RecordState enum value
+ RecordStateSucceeded = "Succeeded"
+
+ // RecordStateFailed is a RecordState enum value
+ RecordStateFailed = "Failed"
+)
+
const (
// RegionNameUsEast1 is a RegionName enum value
RegionNameUsEast1 = "us-east-1"
@@ -16144,15 +24159,21 @@ const (
// RegionNameUsWest2 is a RegionName enum value
RegionNameUsWest2 = "us-west-2"
- // RegionNameEuCentral1 is a RegionName enum value
- RegionNameEuCentral1 = "eu-central-1"
-
// RegionNameEuWest1 is a RegionName enum value
RegionNameEuWest1 = "eu-west-1"
// RegionNameEuWest2 is a RegionName enum value
RegionNameEuWest2 = "eu-west-2"
+ // RegionNameEuWest3 is a RegionName enum value
+ RegionNameEuWest3 = "eu-west-3"
+
+ // RegionNameEuCentral1 is a RegionName enum value
+ RegionNameEuCentral1 = "eu-central-1"
+
+ // RegionNameCaCentral1 is a RegionName enum value
+ RegionNameCaCentral1 = "ca-central-1"
+
// RegionNameApSouth1 is a RegionName enum value
RegionNameApSouth1 = "ap-south-1"
@@ -16169,6 +24190,42 @@ const (
RegionNameApNortheast2 = "ap-northeast-2"
)
+const (
+ // RelationalDatabaseEngineMysql is a RelationalDatabaseEngine enum value
+ RelationalDatabaseEngineMysql = "mysql"
+)
+
+const (
+ // RelationalDatabaseMetricNameCpuutilization is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameCpuutilization = "CPUUtilization"
+
+ // RelationalDatabaseMetricNameDatabaseConnections is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameDatabaseConnections = "DatabaseConnections"
+
+ // RelationalDatabaseMetricNameDiskQueueDepth is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameDiskQueueDepth = "DiskQueueDepth"
+
+ // RelationalDatabaseMetricNameFreeStorageSpace is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameFreeStorageSpace = "FreeStorageSpace"
+
+ // RelationalDatabaseMetricNameNetworkReceiveThroughput is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameNetworkReceiveThroughput = "NetworkReceiveThroughput"
+
+ // RelationalDatabaseMetricNameNetworkTransmitThroughput is a RelationalDatabaseMetricName enum value
+ RelationalDatabaseMetricNameNetworkTransmitThroughput = "NetworkTransmitThroughput"
+)
+
+const (
+ // RelationalDatabasePasswordVersionCurrent is a RelationalDatabasePasswordVersion enum value
+ RelationalDatabasePasswordVersionCurrent = "CURRENT"
+
+ // RelationalDatabasePasswordVersionPrevious is a RelationalDatabasePasswordVersion enum value
+ RelationalDatabasePasswordVersionPrevious = "PREVIOUS"
+
+ // RelationalDatabasePasswordVersionPending is a RelationalDatabasePasswordVersion enum value
+ RelationalDatabasePasswordVersionPending = "PENDING"
+)
+
const (
// ResourceTypeInstance is a ResourceType enum value
ResourceTypeInstance = "Instance"
@@ -16199,4 +24256,16 @@ const (
// ResourceTypeDiskSnapshot is a ResourceType enum value
ResourceTypeDiskSnapshot = "DiskSnapshot"
+
+ // ResourceTypeRelationalDatabase is a ResourceType enum value
+ ResourceTypeRelationalDatabase = "RelationalDatabase"
+
+ // ResourceTypeRelationalDatabaseSnapshot is a ResourceType enum value
+ ResourceTypeRelationalDatabaseSnapshot = "RelationalDatabaseSnapshot"
+
+ // ResourceTypeExportSnapshotRecord is a ResourceType enum value
+ ResourceTypeExportSnapshotRecord = "ExportSnapshotRecord"
+
+ // ResourceTypeCloudFormationStackRecord is a ResourceType enum value
+ ResourceTypeCloudFormationStackRecord = "CloudFormationStackRecord"
)
diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/doc.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/doc.go
index 9c52815bb..f806bbf09 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/doc.go
@@ -5,10 +5,10 @@
//
// Amazon Lightsail is the easiest way to get started with AWS for developers
// who just need virtual private servers. Lightsail includes everything you
-// need to launch your project quickly - a virtual machine, SSD-based storage,
-// data transfer, DNS management, and a static IP - for a low, predictable price.
-// You manage those Lightsail servers through the Lightsail console or by using
-// the API or command-line interface (CLI).
+// need to launch your project quickly - a virtual machine, a managed database,
+// SSD-based storage, data transfer, DNS management, and a static IP - for a
+// low, predictable price. You manage those Lightsail servers through the Lightsail
+// console or by using the API or command-line interface (CLI).
//
// For more information about Lightsail concepts and tasks, see the Lightsail
// Dev Guide (https://lightsail.aws.amazon.com/ls/docs/all).
diff --git a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go
index a76cf79e0..b9f97faa8 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "lightsail" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "lightsail" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "Lightsail" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Lightsail client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go
index 5357821e8..82e8d54b0 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go
@@ -9,6 +9,8 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/protocol"
+ "github.com/aws/aws-sdk-go/private/protocol/restxml"
)
const opAssociateVPCWithHostedZone = "AssociateVPCWithHostedZone"
@@ -16,7 +18,7 @@ const opAssociateVPCWithHostedZone = "AssociateVPCWithHostedZone"
// AssociateVPCWithHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the AssociateVPCWithHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -102,7 +104,7 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone. For more information,
-// see CreateReusableDelegationSet.
+// see CreateReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html).
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
@@ -115,8 +117,9 @@ func (c *Route53) AssociateVPCWithHostedZoneRequest(input *AssociateVPCWithHoste
// reached the limit on reusable delegation sets that it can create or because
// you've reached the limit on the number of Amazon VPCs that you can associate
// with a private hosted zone. To get the current limit on the number of reusable
-// delegation sets, see GetAccountLimit. To get the current limit on the number
-// of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit.
+// delegation sets, see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
+// To get the current limit on the number of Amazon VPCs that you can associate
+// with a private hosted zone, see GetHostedZoneLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetHostedZoneLimit.html).
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
//
@@ -147,7 +150,7 @@ const opChangeResourceRecordSets = "ChangeResourceRecordSets"
// ChangeResourceRecordSetsRequest generates a "aws/request.Request" representing the
// client's request for the ChangeResourceRecordSets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -197,28 +200,28 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// The request body must include a document with a ChangeResourceRecordSetsRequest
// element. The request body contains a list of change items, known as a change
// batch. Change batches are considered transactional changes. When using the
-// Amazon Route 53 API to change resource record sets, Amazon Route 53 either
-// makes all or none of the changes in a change batch request. This ensures
-// that Amazon Route 53 never partially implements the intended changes to the
-// resource record sets in a hosted zone.
+// Amazon Route 53 API to change resource record sets, Route 53 either makes
+// all or none of the changes in a change batch request. This ensures that Route
+// 53 never partially implements the intended changes to the resource record
+// sets in a hosted zone.
//
// For example, a change batch request that deletes the CNAME record for www.example.com
-// and creates an alias resource record set for www.example.com. Amazon Route
-// 53 deletes the first resource record set and creates the second resource
-// record set in a single operation. If either the DELETE or the CREATE action
-// fails, then both changes (plus any other changes in the batch) fail, and
-// the original CNAME record continues to exist.
+// and creates an alias resource record set for www.example.com. Route 53 deletes
+// the first resource record set and creates the second resource record set
+// in a single operation. If either the DELETE or the CREATE action fails, then
+// both changes (plus any other changes in the batch) fail, and the original
+// CNAME record continues to exist.
//
// Due to the nature of transactional changes, you can't delete the same resource
// record set more than once in a single change batch. If you attempt to delete
-// the same change batch more than once, Amazon Route 53 returns an InvalidChangeBatch
+// the same change batch more than once, Route 53 returns an InvalidChangeBatch
// error.
//
// Traffic Flow
//
// To create resource record sets for complex routing configurations, use either
-// the traffic flow visual editor in the Amazon Route 53 console or the API
-// actions for traffic policies and traffic policy instances. Save the configuration
+// the traffic flow visual editor in the Route 53 console or the API actions
+// for traffic policies and traffic policy instances. Save the configuration
// as a traffic policy, then associate the traffic policy with one or more domain
// names (such as example.com) or subdomain names (such as www.example.com),
// in the same hosted zone or in multiple hosted zones. You can roll back the
@@ -236,8 +239,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// values.
//
// * UPSERT: If a resource record set does not already exist, AWS creates
-// it. If a resource set does exist, Amazon Route 53 updates it with the
-// values in the request.
+// it. If a resource set does exist, Route 53 updates it with the values
+// in the request.
//
// Syntaxes for Creating, Updating, and Deleting Resource Record Sets
//
@@ -251,19 +254,19 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// all of the elements for every kind of resource record set that you can create,
// delete, or update by using ChangeResourceRecordSets.
//
-// Change Propagation to Amazon Route 53 DNS Servers
+// Change Propagation to Route 53 DNS Servers
//
-// When you submit a ChangeResourceRecordSets request, Amazon Route 53 propagates
-// your changes to all of the Amazon Route 53 authoritative DNS servers. While
-// your changes are propagating, GetChange returns a status of PENDING. When
-// propagation is complete, GetChange returns a status of INSYNC. Changes generally
-// propagate to all Amazon Route 53 name servers within 60 seconds. For more
-// information, see GetChange.
+// When you submit a ChangeResourceRecordSets request, Route 53 propagates your
+// changes to all of the Route 53 authoritative DNS servers. While your changes
+// are propagating, GetChange returns a status of PENDING. When propagation
+// is complete, GetChange returns a status of INSYNC. Changes generally propagate
+// to all Route 53 name servers within 60 seconds. For more information, see
+// GetChange (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html).
//
// Limits on ChangeResourceRecordSets Requests
//
// For information about the limits on a ChangeResourceRecordSets request, see
-// Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -278,8 +281,7 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// No hosted zone exists with the ID that you specified.
//
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeInvalidChangeBatch "InvalidChangeBatch"
// This exception contains a list of messages that might contain one or more
@@ -291,8 +293,8 @@ func (c *Route53) ChangeResourceRecordSetsRequest(input *ChangeResourceRecordSet
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/ChangeResourceRecordSets
@@ -322,7 +324,7 @@ const opChangeTagsForResource = "ChangeTagsForResource"
// ChangeTagsForResourceRequest generates a "aws/request.Request" representing the
// client's request for the ChangeTagsForResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -356,6 +358,7 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput
output = &ChangeTagsForResourceOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -364,7 +367,7 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput
// Adds, edits, or deletes tags for a health check or a hosted zone.
//
// For information about using tags for cost allocation, see Using Cost Allocation
-// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
+// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the AWS Billing and Cost Management User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -379,8 +382,7 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput
// The input is not valid.
//
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeNoSuchHostedZone "NoSuchHostedZone"
// No hosted zone exists with the ID that you specified.
@@ -388,8 +390,8 @@ func (c *Route53) ChangeTagsForResourceRequest(input *ChangeTagsForResourceInput
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// * ErrCodeThrottlingException "ThrottlingException"
@@ -422,7 +424,7 @@ const opCreateHealthCheck = "CreateHealthCheck"
// CreateHealthCheckRequest generates a "aws/request.Request" representing the
// client's request for the CreateHealthCheck operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -463,25 +465,26 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *
//
// Creates a new health check.
//
-// For information about adding health checks to resource record sets, see ResourceRecordSet$HealthCheckId
-// in ChangeResourceRecordSets.
+// For information about adding health checks to resource record sets, see HealthCheckId
+// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html#Route53-Type-ResourceRecordSet-HealthCheckId)
+// in ChangeResourceRecordSets (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html).
//
// ELB Load Balancers
//
// If you're registering EC2 instances with an Elastic Load Balancing (ELB)
// load balancer, do not create Amazon Route 53 health checks for the EC2 instances.
// When you register an EC2 instance with a load balancer, you configure settings
-// for an ELB health check, which performs a similar function to an Amazon Route
-// 53 health check.
+// for an ELB health check, which performs a similar function to a Route 53
+// health check.
//
// Private Hosted Zones
//
// You can associate health checks with failover resource record sets in a private
// hosted zone. Note the following:
//
-// * Amazon Route 53 health checkers are outside the VPC. To check the health
-// of an endpoint within a VPC by IP address, you must assign a public IP
-// address to the instance in the VPC.
+// * Route 53 health checkers are outside the VPC. To check the health of
+// an endpoint within a VPC by IP address, you must assign a public IP address
+// to the instance in the VPC.
//
// * You can configure a health checker to check the health of an external
// resource that the instance relies on, such as a database server.
@@ -506,10 +509,11 @@ func (c *Route53) CreateHealthCheckRequest(input *CreateHealthCheckInput) (req *
// This health check can't be created because the current account has reached
// the limit on the number of active health checks.
//
-// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
-// For information about how to get the current limit for an account, see GetAccountLimit.
+// For information about how to get the current limit for an account, see GetAccountLimit
+// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
//
@@ -558,7 +562,7 @@ const opCreateHostedZone = "CreateHostedZone"
// CreateHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the CreateHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -597,41 +601,44 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
// CreateHostedZone API operation for Amazon Route 53.
//
-// Creates a new public hosted zone, which you use to specify how the Domain
-// Name System (DNS) routes traffic on the Internet for a domain, such as example.com,
-// and its subdomains.
+// Creates a new public or private hosted zone. You create records in a public
+// hosted zone to define how you want to route traffic on the internet for a
+// domain, such as example.com, and its subdomains (apex.example.com, acme.example.com).
+// You create records in a private hosted zone to define how you want to route
+// traffic for a domain and its subdomains within one or more Amazon Virtual
+// Private Clouds (Amazon VPCs).
//
-// You can't convert a public hosted zones to a private hosted zone or vice
-// versa. Instead, you must create a new hosted zone with the same name and
-// create new resource record sets.
+// You can't convert a public hosted zone to a private hosted zone or vice versa.
+// Instead, you must create a new hosted zone with the same name and create
+// new resource record sets.
//
// For more information about charges for hosted zones, see Amazon Route 53
// Pricing (http://aws.amazon.com/route53/pricing/).
//
// Note the following:
//
-// * You can't create a hosted zone for a top-level domain (TLD).
+// * You can't create a hosted zone for a top-level domain (TLD) such as
+// .com.
//
-// * Amazon Route 53 automatically creates a default SOA record and four
-// NS records for the zone. For more information about SOA and NS records,
-// see NS and SOA Records that Amazon Route 53 Creates for a Hosted Zone
-// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html)
-// in the Amazon Route 53 Developer Guide.
+// * For public hosted zones, Amazon Route 53 automatically creates a default
+// SOA record and four NS records for the zone. For more information about
+// SOA and NS records, see NS and SOA Records that Route 53 Creates for a
+// Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/SOA-NSrecords.html)
+// in the Amazon Route 53 Developer Guide. If you want to use the same name
+// servers for multiple public hosted zones, you can optionally associate
+// a reusable delegation set with the hosted zone. See the DelegationSetId
+// element.
//
-// If you want to use the same name servers for multiple hosted zones, you can
-// optionally associate a reusable delegation set with the hosted zone. See
-// the DelegationSetId element.
-//
-// * If your domain is registered with a registrar other than Amazon Route
-// 53, you must update the name servers with your registrar to make Amazon
-// Route 53 your DNS service. For more information, see Configuring Amazon
-// Route 53 as your DNS Service (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/creating-migrating.html)
+// * If your domain is registered with a registrar other than Route 53, you
+// must update the name servers with your registrar to make Route 53 the
+// DNS service for the domain. For more information, see Migrating DNS Service
+// for an Existing Domain to Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html)
// in the Amazon Route 53 Developer Guide.
//
// When you submit a CreateHostedZone request, the initial status of the hosted
-// zone is PENDING. This means that the NS and SOA records are not yet available
-// on all Amazon Route 53 DNS servers. When the NS and SOA records are available,
-// the status of the zone changes to INSYNC.
+// zone is PENDING. For public hosted zones, this means that the NS and SOA
+// records are not yet available on all Route 53 DNS servers. When the NS and
+// SOA records are available, the status of the zone changes to INSYNC.
//
// 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
@@ -655,14 +662,14 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
// the limit on the number of hosted zones that can be associated with a reusable
// delegation set.
//
-// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
// To get the current limit on hosted zones that can be created by an account,
-// see GetAccountLimit.
+// see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To get the current limit on hosted zones that can be associated with a reusable
-// delegation set, see GetReusableDelegationSetLimit.
+// delegation set, see GetReusableDelegationSetLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetReusableDelegationSetLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -678,8 +685,8 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
// You can create a hosted zone that has the same name as an existing hosted
// zone (example.com is common), but there is a limit to the number of hosted
// zones that have the same name. If you get this error, Amazon Route 53 has
-// reached that limit. If you own the domain name and Amazon Route 53 generates
-// this error, contact Customer Support.
+// reached that limit. If you own the domain name and Route 53 generates this
+// error, contact Customer Support.
//
// * ErrCodeConflictingDomainExists "ConflictingDomainExists"
// The cause of this error depends on whether you're trying to create a public
@@ -691,7 +698,7 @@ func (c *Route53) CreateHostedZoneRequest(input *CreateHostedZoneInput) (req *re
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone. For more information,
-// see CreateReusableDelegationSet.
+// see CreateReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html).
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
@@ -732,7 +739,7 @@ const opCreateQueryLoggingConfig = "CreateQueryLoggingConfig"
// CreateQueryLoggingConfigRequest generates a "aws/request.Request" representing the
// client's request for the CreateQueryLoggingConfig operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -775,10 +782,10 @@ func (c *Route53) CreateQueryLoggingConfigRequest(input *CreateQueryLoggingConfi
// configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch
// Logs log group.
//
-// DNS query logs contain information about the queries that Amazon Route 53
-// receives for a specified public hosted zone, such as the following:
+// DNS query logs contain information about the queries that Route 53 receives
+// for a specified public hosted zone, such as the following:
//
-// * Amazon Route 53 edge location that responded to the DNS query
+// * Route 53 edge location that responded to the DNS query
//
// * Domain or subdomain that was requested
//
@@ -786,52 +793,53 @@ func (c *Route53) CreateQueryLoggingConfigRequest(input *CreateQueryLoggingConfi
//
// * DNS response code, such as NoError or ServFail
//
-// Log Group and Resource PolicyBefore you create a query logging configuration,
-// perform the following operations.
+// Log Group and Resource Policy
//
-// If you create a query logging configuration using the Amazon Route 53 console,
-// Amazon Route 53 performs these operations automatically.
+// Before you create a query logging configuration, perform the following operations.
+//
+// If you create a query logging configuration using the Route 53 console, Route
+// 53 performs these operations automatically.
//
// Create a CloudWatch Logs log group, and make note of the ARN, which you specify
// when you create a query logging configuration. Note the following:
//
-// You must create the log group in the us-east-1 region.
+// * You must create the log group in the us-east-1 region.
//
-// You must use the same AWS account to create the log group and the hosted
-// zone that you want to configure query logging for.
+// * You must use the same AWS account to create the log group and the hosted
+// zone that you want to configure query logging for.
//
-// When you create log groups for query logging, we recommend that you use a
-// consistent prefix, for example:
-//
-// /aws/route53/hosted zone name
-//
-// In the next step, you'll create a resource policy, which controls access
-// to one or more log groups and the associated AWS resources, such as Amazon
-// Route 53 hosted zones. There's a limit on the number of resource policies
-// that you can create, so we recommend that you use a consistent prefix so
-// you can use the same resource policy for all the log groups that you create
-// for query logging.
+// * When you create log groups for query logging, we recommend that you
+// use a consistent prefix, for example: /aws/route53/hosted zone name In
+// the next step, you'll create a resource policy, which controls access
+// to one or more log groups and the associated AWS resources, such as Route
+// 53 hosted zones. There's a limit on the number of resource policies that
+// you can create, so we recommend that you use a consistent prefix so you
+// can use the same resource policy for all the log groups that you create
+// for query logging.
//
// Create a CloudWatch Logs resource policy, and give it the permissions that
-// Amazon Route 53 needs to create log streams and to send query logs to log
-// streams. For the value of Resource, specify the ARN for the log group that
-// you created in the previous step. To use the same resource policy for all
-// the CloudWatch Logs log groups that you created for query logging configurations,
-// replace the hosted zone name with *, for example:
+// Route 53 needs to create log streams and to send query logs to log streams.
+// For the value of Resource, specify the ARN for the log group that you created
+// in the previous step. To use the same resource policy for all the CloudWatch
+// Logs log groups that you created for query logging configurations, replace
+// the hosted zone name with *, for example:
//
// arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*
//
// You can't use the CloudWatch console to create or edit a resource policy.
// You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI.
//
-// Log Streams and Edge LocationsWhen Amazon Route 53 finishes creating the
-// configuration for DNS query logging, it does the following:
+// Log Streams and Edge Locations
//
-// Creates a log stream for an edge location the first time that the edge location
-// responds to DNS queries for the specified hosted zone. That log stream is
-// used to log all queries that Amazon Route 53 responds to for that edge location.
+// When Route 53 finishes creating the configuration for DNS query logging,
+// it does the following:
//
-// Begins to send query logs to the applicable log stream.
+// * Creates a log stream for an edge location the first time that the edge
+// location responds to DNS queries for the specified hosted zone. That log
+// stream is used to log all queries that Route 53 responds to for that edge
+// location.
+//
+// * Begins to send query logs to the applicable log stream.
//
// The name of each log stream is in the following format:
//
@@ -841,33 +849,39 @@ func (c *Route53) CreateQueryLoggingConfigRequest(input *CreateQueryLoggingConfi
// number, for example, DFW3. The three-letter code typically corresponds with
// the International Air Transport Association airport code for an airport near
// the edge location. (These abbreviations might change in the future.) For
-// a list of edge locations, see "The Amazon Route 53 Global Network" on the
-// Amazon Route 53 Product Details (http://aws.amazon.com/route53/details/)
-// page.
+// a list of edge locations, see "The Route 53 Global Network" on the Route
+// 53 Product Details (http://aws.amazon.com/route53/details/) page.
//
-// Queries That Are LoggedQuery logs contain only the queries that DNS resolvers
-// forward to Amazon Route 53. If a DNS resolver has already cached the response
-// to a query (such as the IP address for a load balancer for example.com),
-// the resolver will continue to return the cached response. It doesn't forward
-// another query to Amazon Route 53 until the TTL for the corresponding resource
-// record set expires. Depending on how many DNS queries are submitted for a
-// resource record set, and depending on the TTL for that resource record set,
-// query logs might contain information about only one query out of every several
-// thousand queries that are submitted to DNS. For more information about how
-// DNS works, see Routing Internet Traffic to Your Website or Web Application
-// (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html)
+// Queries That Are Logged
+//
+// Query logs contain only the queries that DNS resolvers forward to Route 53.
+// If a DNS resolver has already cached the response to a query (such as the
+// IP address for a load balancer for example.com), the resolver will continue
+// to return the cached response. It doesn't forward another query to Route
+// 53 until the TTL for the corresponding resource record set expires. Depending
+// on how many DNS queries are submitted for a resource record set, and depending
+// on the TTL for that resource record set, query logs might contain information
+// about only one query out of every several thousand queries that are submitted
+// to DNS. For more information about how DNS works, see Routing Internet Traffic
+// to Your Website or Web Application (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html)
// in the Amazon Route 53 Developer Guide.
//
-// Log File FormatFor a list of the values in each query log and the format
-// of each value, see Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html)
+// Log File Format
+//
+// For a list of the values in each query log and the format of each value,
+// see Logging DNS Queries (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html)
// in the Amazon Route 53 Developer Guide.
//
-// PricingFor information about charges for query logs, see Amazon CloudWatch
-// Pricing (http://aws.amazon.com/cloudwatch/pricing/).
+// Pricing
//
-// How to Stop LoggingIf you want Amazon Route 53 to stop sending query logs
-// to CloudWatch Logs, delete the query logging configuration. For more information,
-// see DeleteQueryLoggingConfig.
+// For information about charges for query logs, see Amazon CloudWatch Pricing
+// (http://aws.amazon.com/cloudwatch/pricing/).
+//
+// How to Stop Logging
+//
+// If you want Route 53 to stop sending query logs to CloudWatch Logs, delete
+// the query logging configuration. For more information, see DeleteQueryLoggingConfig
+// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteQueryLoggingConfig.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
@@ -933,7 +947,7 @@ const opCreateReusableDelegationSet = "CreateReusableDelegationSet"
// CreateReusableDelegationSetRequest generates a "aws/request.Request" representing the
// client's request for the CreateReusableDelegationSet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1034,8 +1048,9 @@ func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelega
// reached the limit on reusable delegation sets that it can create or because
// you've reached the limit on the number of Amazon VPCs that you can associate
// with a private hosted zone. To get the current limit on the number of reusable
-// delegation sets, see GetAccountLimit. To get the current limit on the number
-// of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit.
+// delegation sets, see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
+// To get the current limit on the number of Amazon VPCs that you can associate
+// with a private hosted zone, see GetHostedZoneLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetHostedZoneLimit.html).
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
//
@@ -1052,8 +1067,8 @@ func (c *Route53) CreateReusableDelegationSetRequest(input *CreateReusableDelega
// You can create a hosted zone that has the same name as an existing hosted
// zone (example.com is common), but there is a limit to the number of hosted
// zones that have the same name. If you get this error, Amazon Route 53 has
-// reached that limit. If you own the domain name and Amazon Route 53 generates
-// this error, contact Customer Support.
+// reached that limit. If you own the domain name and Route 53 generates this
+// error, contact Customer Support.
//
// * ErrCodeDelegationSetAlreadyReusable "DelegationSetAlreadyReusable"
// The specified delegation set has already been marked as reusable.
@@ -1085,7 +1100,7 @@ const opCreateTrafficPolicy = "CreateTrafficPolicy"
// CreateTrafficPolicyRequest generates a "aws/request.Request" representing the
// client's request for the CreateTrafficPolicy operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1143,10 +1158,10 @@ func (c *Route53) CreateTrafficPolicyRequest(input *CreateTrafficPolicyInput) (r
// This traffic policy can't be created because the current account has reached
// the limit on the number of traffic policies.
//
-// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
-// To get the current limit for an account, see GetAccountLimit.
+// To get the current limit for an account, see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -1185,7 +1200,7 @@ const opCreateTrafficPolicyInstance = "CreateTrafficPolicyInstance"
// CreateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the
// client's request for the CreateTrafficPolicyInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1249,10 +1264,11 @@ func (c *Route53) CreateTrafficPolicyInstanceRequest(input *CreateTrafficPolicyI
// This traffic policy instance can't be created because the current account
// has reached the limit on the number of traffic policy instances.
//
-// For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
-// For information about how to get the current limit for an account, see GetAccountLimit.
+// For information about how to get the current limit for an account, see GetAccountLimit
+// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -1290,7 +1306,7 @@ const opCreateTrafficPolicyVersion = "CreateTrafficPolicyVersion"
// CreateTrafficPolicyVersionRequest generates a "aws/request.Request" representing the
// client's request for the CreateTrafficPolicyVersion operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1357,10 +1373,10 @@ func (c *Route53) CreateTrafficPolicyVersionRequest(input *CreateTrafficPolicyVe
// of 1000 on the number of versions that you can create for the current traffic
// policy.
//
-// To create more traffic policy versions, you can use GetTrafficPolicy to get
-// the traffic policy document for a specified traffic policy version, and then
-// use CreateTrafficPolicy to create a new traffic policy using the traffic
-// policy document.
+// To create more traffic policy versions, you can use GetTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetTrafficPolicy.html)
+// to get the traffic policy document for a specified traffic policy version,
+// and then use CreateTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html)
+// to create a new traffic policy using the traffic policy document.
//
// * ErrCodeConcurrentModification "ConcurrentModification"
// Another user submitted a request to create, update, or delete the object
@@ -1397,7 +1413,7 @@ const opCreateVPCAssociationAuthorization = "CreateVPCAssociationAuthorization"
// CreateVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the
// client's request for the CreateVPCAssociationAuthorization operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1503,7 +1519,7 @@ const opDeleteHealthCheck = "DeleteHealthCheck"
// DeleteHealthCheckRequest generates a "aws/request.Request" representing the
// client's request for the DeleteHealthCheck operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1537,6 +1553,7 @@ func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req *
output = &DeleteHealthCheckOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -1561,8 +1578,7 @@ func (c *Route53) DeleteHealthCheckRequest(input *DeleteHealthCheckInput) (req *
//
// Returned Error Codes:
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeHealthCheckInUse "HealthCheckInUse"
// This error code is not in use.
@@ -1597,7 +1613,7 @@ const opDeleteHostedZone = "DeleteHostedZone"
// DeleteHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the DeleteHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1638,26 +1654,42 @@ func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) (req *re
//
// Deletes a hosted zone.
//
-// If the name servers for the hosted zone are associated with a domain and
-// if you want to make the domain unavailable on the Internet, we recommend
-// that you delete the name servers from the domain to prevent future DNS queries
-// from possibly being misrouted. If the domain is registered with Amazon Route
-// 53, see UpdateDomainNameservers. If the domain is registered with another
-// registrar, use the method provided by the registrar to delete name servers
-// for the domain.
+// If the hosted zone was created by another service, such as AWS Cloud Map,
+// see Deleting Public Hosted Zones That Were Created by Another Service (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DeleteHostedZone.html#delete-public-hosted-zone-created-by-another-service)
+// in the Amazon Route 53 Developer Guide for information about how to delete
+// it. (The process is the same for public and private hosted zones that were
+// created by another service.)
//
-// Some domain registries don't allow you to remove all of the name servers
-// for a domain. If the registry for your domain requires one or more name servers,
-// we recommend that you delete the hosted zone only if you transfer DNS service
-// to another service provider, and you replace the name servers for the domain
-// with name servers from the new provider.
+// If you want to keep your domain registration but you want to stop routing
+// internet traffic to your website or web application, we recommend that you
+// delete resource record sets in the hosted zone instead of deleting the hosted
+// zone.
+//
+// If you delete a hosted zone, you can't undelete it. You must create a new
+// hosted zone and update the name servers for your domain registration, which
+// can require up to 48 hours to take effect. (If you delegated responsibility
+// for a subdomain to a hosted zone and you delete the child hosted zone, you
+// must update the name servers in the parent hosted zone.) In addition, if
+// you delete a hosted zone, someone could hijack the domain and route traffic
+// to their own resources using your domain name.
+//
+// If you want to avoid the monthly charge for the hosted zone, you can transfer
+// DNS service for the domain to a free DNS service. When you transfer DNS service,
+// you have to update the name servers for the domain registration. If the domain
+// is registered with Route 53, see UpdateDomainNameservers (https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_UpdateDomainNameservers.html)
+// for information about how to replace Route 53 name servers with name servers
+// for the new DNS service. If the domain is registered with another registrar,
+// use the method provided by the registrar to update name servers for the domain
+// registration. For more information, perform an internet search on "free DNS
+// service."
//
// You can delete a hosted zone only if it contains only the default SOA record
// and NS resource record sets. If the hosted zone contains other resource record
// sets, you must delete them before you can delete the hosted zone. If you
// try to delete a hosted zone that contains other resource record sets, the
-// request fails, and Amazon Route 53 returns a HostedZoneNotEmpty error. For
-// information about deleting records from your hosted zone, see ChangeResourceRecordSets.
+// request fails, and Route 53 returns a HostedZoneNotEmpty error. For information
+// about deleting records from your hosted zone, see ChangeResourceRecordSets
+// (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html).
//
// To verify that the hosted zone has been deleted, do one of the following:
//
@@ -1684,8 +1716,8 @@ func (c *Route53) DeleteHostedZoneRequest(input *DeleteHostedZoneInput) (req *re
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// * ErrCodeInvalidInput "InvalidInput"
@@ -1721,7 +1753,7 @@ const opDeleteQueryLoggingConfig = "DeleteQueryLoggingConfig"
// DeleteQueryLoggingConfigRequest generates a "aws/request.Request" representing the
// client's request for the DeleteQueryLoggingConfig operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1755,16 +1787,17 @@ func (c *Route53) DeleteQueryLoggingConfigRequest(input *DeleteQueryLoggingConfi
output = &DeleteQueryLoggingConfigOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
// DeleteQueryLoggingConfig API operation for Amazon Route 53.
//
// Deletes a configuration for DNS query logging. If you delete a configuration,
-// Amazon Route 53 stops sending query logs to CloudWatch Logs. Amazon Route
-// 53 doesn't delete any logs that are already in CloudWatch Logs.
+// Amazon Route 53 stops sending query logs to CloudWatch Logs. Route 53 doesn't
+// delete any logs that are already in CloudWatch Logs.
//
-// For more information about DNS query logs, see CreateQueryLoggingConfig.
+// For more information about DNS query logs, see CreateQueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateQueryLoggingConfig.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
@@ -1811,7 +1844,7 @@ const opDeleteReusableDelegationSet = "DeleteReusableDelegationSet"
// DeleteReusableDelegationSetRequest generates a "aws/request.Request" representing the
// client's request for the DeleteReusableDelegationSet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1845,6 +1878,7 @@ func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelega
output = &DeleteReusableDelegationSetOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -1856,8 +1890,9 @@ func (c *Route53) DeleteReusableDelegationSetRequest(input *DeleteReusableDelega
// any hosted zones.
//
// To verify that the reusable delegation set is not associated with any hosted
-// zones, submit a GetReusableDelegationSet request and specify the ID of the
-// reusable delegation set that you want to delete.
+// zones, submit a GetReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetReusableDelegationSet.html)
+// request and specify the ID of the reusable delegation set that you want to
+// delete.
//
// 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
@@ -1907,7 +1942,7 @@ const opDeleteTrafficPolicy = "DeleteTrafficPolicy"
// DeleteTrafficPolicyRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTrafficPolicy operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1941,6 +1976,7 @@ func (c *Route53) DeleteTrafficPolicyRequest(input *DeleteTrafficPolicyInput) (r
output = &DeleteTrafficPolicyOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -1997,7 +2033,7 @@ const opDeleteTrafficPolicyInstance = "DeleteTrafficPolicyInstance"
// DeleteTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the
// client's request for the DeleteTrafficPolicyInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2031,6 +2067,7 @@ func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyI
output = &DeleteTrafficPolicyInstanceOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -2039,8 +2076,7 @@ func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyI
// Deletes a traffic policy instance and all of the resource record sets that
// Amazon Route 53 created when you created the instance.
//
-// In the Amazon Route 53 console, traffic policy instances are known as policy
-// records.
+// In the Route 53 console, traffic policy instances are known as policy records.
//
// 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
@@ -2059,8 +2095,8 @@ func (c *Route53) DeleteTrafficPolicyInstanceRequest(input *DeleteTrafficPolicyI
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/DeleteTrafficPolicyInstance
@@ -2090,7 +2126,7 @@ const opDeleteVPCAssociationAuthorization = "DeleteVPCAssociationAuthorization"
// DeleteVPCAssociationAuthorizationRequest generates a "aws/request.Request" representing the
// client's request for the DeleteVPCAssociationAuthorization operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2124,6 +2160,7 @@ func (c *Route53) DeleteVPCAssociationAuthorizationRequest(input *DeleteVPCAssoc
output = &DeleteVPCAssociationAuthorizationOutput{}
req = c.newRequest(op, input, output)
+ req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
}
@@ -2193,7 +2230,7 @@ const opDisassociateVPCFromHostedZone = "DisassociateVPCFromHostedZone"
// DisassociateVPCFromHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the DisassociateVPCFromHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2232,13 +2269,16 @@ func (c *Route53) DisassociateVPCFromHostedZoneRequest(input *DisassociateVPCFro
// DisassociateVPCFromHostedZone API operation for Amazon Route 53.
//
-// Disassociates a VPC from a Amazon Route 53 private hosted zone.
+// Disassociates a VPC from a Amazon Route 53 private hosted zone. Note the
+// following:
//
-// You can't disassociate the last VPC from a private hosted zone.
+// * You can't disassociate the last VPC from a private hosted zone.
//
-// You can't disassociate a VPC from a private hosted zone when only one VPC
-// is associated with the hosted zone. You also can't convert a private hosted
-// zone into a public hosted zone.
+// * You can't convert a private hosted zone into a public hosted zone.
+//
+// * You can submit a DisassociateVPCFromHostedZone request using either
+// the account that created the hosted zone or the account that created the
+// VPC.
//
// 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
@@ -2293,7 +2333,7 @@ const opGetAccountLimit = "GetAccountLimit"
// GetAccountLimitRequest generates a "aws/request.Request" representing the
// client's request for the GetAccountLimit operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2335,10 +2375,15 @@ func (c *Route53) GetAccountLimitRequest(input *GetAccountLimitInput) (req *requ
// Gets the specified limit for the current account, for example, the maximum
// number of health checks that you can create using the account.
//
-// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For the default limit, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide. To request a higher limit, open a
// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53).
//
+// You can also view account limits in AWS Trusted Advisor. Sign in to the AWS
+// Management Console and open the Trusted Advisor console at https://console.aws.amazon.com/trustedadvisor/
+// (https://console.aws.amazon.com/trustedadvisor). Then choose Service limits
+// in the navigation pane.
+//
// 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.
@@ -2377,7 +2422,7 @@ const opGetChange = "GetChange"
// GetChangeRequest generates a "aws/request.Request" representing the
// client's request for the GetChange operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2423,8 +2468,8 @@ func (c *Route53) GetChangeRequest(input *GetChangeInput) (req *request.Request,
// to all Amazon Route 53 DNS servers. This is the initial status of all
// change batch requests.
//
-// * INSYNC indicates that the changes have propagated to all Amazon Route
-// 53 DNS servers.
+// * INSYNC indicates that the changes have propagated to all Route 53 DNS
+// servers.
//
// 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
@@ -2467,7 +2512,7 @@ const opGetCheckerIpRanges = "GetCheckerIpRanges"
// GetCheckerIpRangesRequest generates a "aws/request.Request" representing the
// client's request for the GetCheckerIpRanges operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2506,6 +2551,7 @@ func (c *Route53) GetCheckerIpRangesRequest(input *GetCheckerIpRangesInput) (req
// GetCheckerIpRanges API operation for Amazon Route 53.
//
+//
// GetCheckerIpRanges still works, but we recommend that you download ip-ranges.json,
// which includes IP address ranges for all AWS services. For more information,
// see IP Address Ranges of Amazon Route 53 Servers (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/route-53-ip-addresses.html)
@@ -2544,7 +2590,7 @@ const opGetGeoLocation = "GetGeoLocation"
// GetGeoLocationRequest generates a "aws/request.Request" representing the
// client's request for the GetGeoLocation operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2589,17 +2635,17 @@ func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) (req *reques
// Use the following syntax to determine whether a continent is supported for
// geolocation:
//
-// GET /2013-04-01/geolocation?ContinentCode=two-letter abbreviation for a continent
+// GET /2013-04-01/geolocation?continentcode=two-letter abbreviation for a continent
//
// Use the following syntax to determine whether a country is supported for
// geolocation:
//
-// GET /2013-04-01/geolocation?CountryCode=two-character country code
+// GET /2013-04-01/geolocation?countrycode=two-character country code
//
// Use the following syntax to determine whether a subdivision of a country
// is supported for geolocation:
//
-// GET /2013-04-01/geolocation?CountryCode=two-character country code&SubdivisionCode=subdivision
+// GET /2013-04-01/geolocation?countrycode=two-character country code&subdivisioncode=subdivision
// code
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -2611,7 +2657,7 @@ func (c *Route53) GetGeoLocationRequest(input *GetGeoLocationInput) (req *reques
//
// Returned Error Codes:
// * ErrCodeNoSuchGeoLocation "NoSuchGeoLocation"
-// Amazon Route 53 doesn't support the specified geolocation.
+// Amazon Route 53 doesn't support the specified geographic location.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@@ -2643,7 +2689,7 @@ const opGetHealthCheck = "GetHealthCheck"
// GetHealthCheckRequest generates a "aws/request.Request" representing the
// client's request for the GetHealthCheck operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2693,8 +2739,7 @@ func (c *Route53) GetHealthCheckRequest(input *GetHealthCheckInput) (req *reques
//
// Returned Error Codes:
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@@ -2730,7 +2775,7 @@ const opGetHealthCheckCount = "GetHealthCheckCount"
// GetHealthCheckCountRequest generates a "aws/request.Request" representing the
// client's request for the GetHealthCheckCount operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2805,7 +2850,7 @@ const opGetHealthCheckLastFailureReason = "GetHealthCheckLastFailureReason"
// GetHealthCheckLastFailureReasonRequest generates a "aws/request.Request" representing the
// client's request for the GetHealthCheckLastFailureReason operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2855,8 +2900,7 @@ func (c *Route53) GetHealthCheckLastFailureReasonRequest(input *GetHealthCheckLa
//
// Returned Error Codes:
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@@ -2888,7 +2932,7 @@ const opGetHealthCheckStatus = "GetHealthCheckStatus"
// GetHealthCheckStatusRequest generates a "aws/request.Request" representing the
// client's request for the GetHealthCheckStatus operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -2938,8 +2982,7 @@ func (c *Route53) GetHealthCheckStatusRequest(input *GetHealthCheckStatusInput)
//
// Returned Error Codes:
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@@ -2971,7 +3014,7 @@ const opGetHostedZone = "GetHostedZone"
// GetHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the GetHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3054,7 +3097,7 @@ const opGetHostedZoneCount = "GetHostedZoneCount"
// GetHostedZoneCountRequest generates a "aws/request.Request" representing the
// client's request for the GetHostedZoneCount operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3134,7 +3177,7 @@ const opGetHostedZoneLimit = "GetHostedZoneLimit"
// GetHostedZoneLimitRequest generates a "aws/request.Request" representing the
// client's request for the GetHostedZoneLimit operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3176,7 +3219,7 @@ func (c *Route53) GetHostedZoneLimitRequest(input *GetHostedZoneLimitInput) (req
// Gets the specified limit for a specified hosted zone, for example, the maximum
// number of records that you can create in the hosted zone.
//
-// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For the default limit, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide. To request a higher limit, open a
// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53).
//
@@ -3224,7 +3267,7 @@ const opGetQueryLoggingConfig = "GetQueryLoggingConfig"
// GetQueryLoggingConfigRequest generates a "aws/request.Request" representing the
// client's request for the GetQueryLoggingConfig operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3265,8 +3308,8 @@ func (c *Route53) GetQueryLoggingConfigRequest(input *GetQueryLoggingConfigInput
//
// Gets information about a specified configuration for DNS query logging.
//
-// For more information about DNS query logs, see CreateQueryLoggingConfig and
-// Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html).
+// For more information about DNS query logs, see CreateQueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateQueryLoggingConfig.html)
+// and Logging DNS Queries (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.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
@@ -3309,7 +3352,7 @@ const opGetReusableDelegationSet = "GetReusableDelegationSet"
// GetReusableDelegationSetRequest generates a "aws/request.Request" representing the
// client's request for the GetReusableDelegationSet operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3395,7 +3438,7 @@ const opGetReusableDelegationSetLimit = "GetReusableDelegationSetLimit"
// GetReusableDelegationSetLimitRequest generates a "aws/request.Request" representing the
// client's request for the GetReusableDelegationSetLimit operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3437,7 +3480,7 @@ func (c *Route53) GetReusableDelegationSetLimitRequest(input *GetReusableDelegat
// Gets the maximum number of hosted zones that you can associate with the specified
// reusable delegation set.
//
-// For the default limit, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+// For the default limit, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide. To request a higher limit, open a
// case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53).
//
@@ -3482,7 +3525,7 @@ const opGetTrafficPolicy = "GetTrafficPolicy"
// GetTrafficPolicyRequest generates a "aws/request.Request" representing the
// client's request for the GetTrafficPolicy operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3564,7 +3607,7 @@ const opGetTrafficPolicyInstance = "GetTrafficPolicyInstance"
// GetTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the
// client's request for the GetTrafficPolicyInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3610,8 +3653,7 @@ func (c *Route53) GetTrafficPolicyInstanceRequest(input *GetTrafficPolicyInstanc
// record sets that are specified in the traffic policy definition. For more
// information, see the State response element.
//
-// In the Amazon Route 53 console, traffic policy instances are known as policy
-// records.
+// In the Route 53 console, traffic policy instances are known as policy records.
//
// 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
@@ -3654,7 +3696,7 @@ const opGetTrafficPolicyInstanceCount = "GetTrafficPolicyInstanceCount"
// GetTrafficPolicyInstanceCountRequest generates a "aws/request.Request" representing the
// client's request for the GetTrafficPolicyInstanceCount operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3729,7 +3771,7 @@ const opListGeoLocations = "ListGeoLocations"
// ListGeoLocationsRequest generates a "aws/request.Request" representing the
// client's request for the ListGeoLocations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3768,7 +3810,7 @@ func (c *Route53) ListGeoLocationsRequest(input *ListGeoLocationsInput) (req *re
// ListGeoLocations API operation for Amazon Route 53.
//
-// Retrieves a list of supported geo locations.
+// Retrieves a list of supported geographic locations.
//
// Countries are listed first, and continents are listed last. If Amazon Route
// 53 supports subdivisions for a country (for example, states or provinces),
@@ -3813,7 +3855,7 @@ const opListHealthChecks = "ListHealthChecks"
// ListHealthChecksRequest generates a "aws/request.Request" representing the
// client's request for the ListHealthChecks operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -3909,7 +3951,7 @@ func (c *Route53) ListHealthChecksWithContext(ctx aws.Context, input *ListHealth
// // Example iterating over at most 3 pages of a ListHealthChecks operation.
// pageNum := 0
// err := client.ListHealthChecksPages(params,
-// func(page *ListHealthChecksOutput, lastPage bool) bool {
+// func(page *route53.ListHealthChecksOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -3953,7 +3995,7 @@ const opListHostedZones = "ListHostedZones"
// ListHostedZonesRequest generates a "aws/request.Request" representing the
// client's request for the ListHostedZones operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4056,7 +4098,7 @@ func (c *Route53) ListHostedZonesWithContext(ctx aws.Context, input *ListHostedZ
// // Example iterating over at most 3 pages of a ListHostedZones operation.
// pageNum := 0
// err := client.ListHostedZonesPages(params,
-// func(page *ListHostedZonesOutput, lastPage bool) bool {
+// func(page *route53.ListHostedZonesOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -4100,7 +4142,7 @@ const opListHostedZonesByName = "ListHostedZonesByName"
// ListHostedZonesByNameRequest generates a "aws/request.Request" representing the
// client's request for the ListHostedZonesByName operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4163,10 +4205,10 @@ func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput
// domain names, see DNS Domain Name Format (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html)
// in the Amazon Route 53 Developer Guide.
//
-// Amazon Route 53 returns up to 100 items in each response. If you have a lot
-// of hosted zones, use the MaxItems parameter to list them in groups of up
-// to 100. The response includes values that help navigate from one group of
-// MaxItems hosted zones to the next:
+// Route 53 returns up to 100 items in each response. If you have a lot of hosted
+// zones, use the MaxItems parameter to list them in groups of up to 100. The
+// response includes values that help navigate from one group of MaxItems hosted
+// zones to the next:
//
// * The DNSName and HostedZoneId elements in the response contain the values,
// if any, specified for the dnsname and hostedzoneid parameters in the request
@@ -4177,10 +4219,9 @@ func (c *Route53) ListHostedZonesByNameRequest(input *ListHostedZonesByNameInput
// the current response.
//
// * If the value of IsTruncated in the response is true, there are more
-// hosted zones associated with the current AWS account.
-//
-// If IsTruncated is false, this response includes the last hosted zone that
-// is associated with the current account. The NextDNSName element and NextHostedZoneId
+// hosted zones associated with the current AWS account. If IsTruncated is
+// false, this response includes the last hosted zone that is associated
+// with the current account. The NextDNSName element and NextHostedZoneId
// elements are omitted from the response.
//
// * The NextDNSName and NextHostedZoneId elements in the response contain
@@ -4231,7 +4272,7 @@ const opListQueryLoggingConfigs = "ListQueryLoggingConfigs"
// ListQueryLoggingConfigsRequest generates a "aws/request.Request" representing the
// client's request for the ListQueryLoggingConfigs operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4274,9 +4315,9 @@ func (c *Route53) ListQueryLoggingConfigsRequest(input *ListQueryLoggingConfigsI
// current AWS account or the configuration that is associated with a specified
// hosted zone.
//
-// For more information about DNS query logs, see CreateQueryLoggingConfig.
+// For more information about DNS query logs, see CreateQueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateQueryLoggingConfig.html).
// Additional information, including the format of DNS query logs, appears in
-// Logging DNS Queries (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html)
+// Logging DNS Queries (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html)
// in the Amazon Route 53 Developer Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4324,7 +4365,7 @@ const opListResourceRecordSets = "ListResourceRecordSets"
// ListResourceRecordSetsRequest generates a "aws/request.Request" representing the
// client's request for the ListResourceRecordSets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4373,35 +4414,53 @@ func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInp
//
// ListResourceRecordSets returns up to 100 resource record sets at a time in
// ASCII order, beginning at a position specified by the name and type elements.
-// The action sorts results first by DNS name with the labels reversed, for
-// example:
+//
+// Sort order
+//
+// ListResourceRecordSets sorts results first by DNS name with the labels reversed,
+// for example:
//
// com.example.www.
//
-// Note the trailing dot, which can change the sort order in some circumstances.
+// Note the trailing dot, which can change the sort order when the record name
+// contains characters that appear before . (decimal 46) in the ASCII table.
+// These characters include the following: ! " # $ % & ' ( ) * + , -
//
-// When multiple records have the same DNS name, the action sorts results by
-// the record type.
+// When multiple records have the same DNS name, ListResourceRecordSets sorts
+// results by the record type.
//
-// You can use the name and type elements to adjust the beginning position of
-// the list of resource record sets returned:
+// Specifying where to start listing records
//
-// If you do not specify Name or TypeThe results begin with the first resource
-// record set that the hosted zone contains.
+// You can use the name and type elements to specify the resource record set
+// that the list begins with:
//
-// If you specify Name but not TypeThe results begin with the first resource
-// record set in the list whose name is greater than or equal to Name.
+// If you do not specify Name or Type
//
-// If you specify Type but not NameAmazon Route 53 returns the InvalidInput
-// error.
+// The results begin with the first resource record set that the hosted zone
+// contains.
//
-// If you specify both Name and TypeThe results begin with the first resource
-// record set in the list whose name is greater than or equal to Name, and whose
-// type is greater than or equal to Type.
+// If you specify Name but not Type
+//
+// The results begin with the first resource record set in the list whose name
+// is greater than or equal to Name.
+//
+// If you specify Type but not Name
+//
+// Amazon Route 53 returns the InvalidInput error.
+//
+// If you specify both Name and Type
+//
+// The results begin with the first resource record set in the list whose name
+// is greater than or equal to Name, and whose type is greater than or equal
+// to Type.
+//
+// Resource record sets that are PENDING
//
// This action returns the most current version of the records. This includes
-// records that are PENDING, and that are not yet available on all Amazon Route
-// 53 DNS servers.
+// records that are PENDING, and that are not yet available on all Route 53
+// DNS servers.
+//
+// Changing resource record sets
//
// To ensure that you get an accurate listing of the resource record sets for
// a hosted zone at a point in time, do not submit a ChangeResourceRecordSets
@@ -4409,6 +4468,14 @@ func (c *Route53) ListResourceRecordSetsRequest(input *ListResourceRecordSetsInp
// request. If you do, some pages may display results without the latest changes
// while other pages display results with the latest changes.
//
+// Displaying the next page of results
+//
+// If a ListResourceRecordSets command returns more than one page of results,
+// the value of IsTruncated is true. To display the next page of results, get
+// the values of NextRecordName, NextRecordType, and NextRecordIdentifier (if
+// any) from the response. Then submit another ListResourceRecordSets request,
+// and specify those values for StartRecordName, StartRecordType, and StartRecordIdentifier.
+//
// 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.
@@ -4456,7 +4523,7 @@ func (c *Route53) ListResourceRecordSetsWithContext(ctx aws.Context, input *List
// // Example iterating over at most 3 pages of a ListResourceRecordSets operation.
// pageNum := 0
// err := client.ListResourceRecordSetsPages(params,
-// func(page *ListResourceRecordSetsOutput, lastPage bool) bool {
+// func(page *route53.ListResourceRecordSetsOutput, lastPage bool) bool {
// pageNum++
// fmt.Println(page)
// return pageNum <= 3
@@ -4500,7 +4567,7 @@ const opListReusableDelegationSets = "ListReusableDelegationSets"
// ListReusableDelegationSetsRequest generates a "aws/request.Request" representing the
// client's request for the ListReusableDelegationSets operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4580,7 +4647,7 @@ const opListTagsForResource = "ListTagsForResource"
// ListTagsForResourceRequest generates a "aws/request.Request" representing the
// client's request for the ListTagsForResource operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4622,7 +4689,7 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r
// Lists tags for one health check or hosted zone.
//
// For information about using tags for cost allocation, see Using Cost Allocation
-// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
+// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the AWS Billing and Cost Management User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4637,8 +4704,7 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r
// The input is not valid.
//
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeNoSuchHostedZone "NoSuchHostedZone"
// No hosted zone exists with the ID that you specified.
@@ -4646,8 +4712,8 @@ func (c *Route53) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// * ErrCodeThrottlingException "ThrottlingException"
@@ -4680,7 +4746,7 @@ const opListTagsForResources = "ListTagsForResources"
// ListTagsForResourcesRequest generates a "aws/request.Request" representing the
// client's request for the ListTagsForResources operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4722,7 +4788,7 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput)
// Lists tags for up to 10 health checks or hosted zones.
//
// For information about using tags for cost allocation, see Using Cost Allocation
-// Tags (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
+// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the AWS Billing and Cost Management User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -4737,8 +4803,7 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput)
// The input is not valid.
//
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeNoSuchHostedZone "NoSuchHostedZone"
// No hosted zone exists with the ID that you specified.
@@ -4746,8 +4811,8 @@ func (c *Route53) ListTagsForResourcesRequest(input *ListTagsForResourcesInput)
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// * ErrCodeThrottlingException "ThrottlingException"
@@ -4780,7 +4845,7 @@ const opListTrafficPolicies = "ListTrafficPolicies"
// ListTrafficPoliciesRequest generates a "aws/request.Request" representing the
// client's request for the ListTrafficPolicies operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4821,7 +4886,7 @@ func (c *Route53) ListTrafficPoliciesRequest(input *ListTrafficPoliciesInput) (r
//
// Gets information about the latest version for every traffic policy that is
// associated with the current AWS account. Policies are listed in the order
-// in which they were created.
+// that they were created in.
//
// 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
@@ -4861,7 +4926,7 @@ const opListTrafficPolicyInstances = "ListTrafficPolicyInstances"
// ListTrafficPolicyInstancesRequest generates a "aws/request.Request" representing the
// client's request for the ListTrafficPolicyInstances operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -4908,9 +4973,9 @@ func (c *Route53) ListTrafficPolicyInstancesRequest(input *ListTrafficPolicyInst
// in the traffic policy definition. For more information, see the State response
// element.
//
-// Amazon Route 53 returns a maximum of 100 items in each response. If you have
-// a lot of traffic policy instances, you can use the MaxItems parameter to
-// list them in groups of up to 100.
+// Route 53 returns a maximum of 100 items in each response. If you have a lot
+// of traffic policy instances, you can use the MaxItems parameter to list them
+// in groups of up to 100.
//
// 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
@@ -4953,7 +5018,7 @@ const opListTrafficPolicyInstancesByHostedZone = "ListTrafficPolicyInstancesByHo
// ListTrafficPolicyInstancesByHostedZoneRequest generates a "aws/request.Request" representing the
// client's request for the ListTrafficPolicyInstancesByHostedZone operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5000,9 +5065,9 @@ func (c *Route53) ListTrafficPolicyInstancesByHostedZoneRequest(input *ListTraff
// record sets that are specified in the traffic policy definition. For more
// information, see the State response element.
//
-// Amazon Route 53 returns a maximum of 100 items in each response. If you have
-// a lot of traffic policy instances, you can use the MaxItems parameter to
-// list them in groups of up to 100.
+// Route 53 returns a maximum of 100 items in each response. If you have a lot
+// of traffic policy instances, you can use the MaxItems parameter to list them
+// in groups of up to 100.
//
// 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
@@ -5048,7 +5113,7 @@ const opListTrafficPolicyInstancesByPolicy = "ListTrafficPolicyInstancesByPolicy
// ListTrafficPolicyInstancesByPolicyRequest generates a "aws/request.Request" representing the
// client's request for the ListTrafficPolicyInstancesByPolicy operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5095,9 +5160,9 @@ func (c *Route53) ListTrafficPolicyInstancesByPolicyRequest(input *ListTrafficPo
// record sets that are specified in the traffic policy definition. For more
// information, see the State response element.
//
-// Amazon Route 53 returns a maximum of 100 items in each response. If you have
-// a lot of traffic policy instances, you can use the MaxItems parameter to
-// list them in groups of up to 100.
+// Route 53 returns a maximum of 100 items in each response. If you have a lot
+// of traffic policy instances, you can use the MaxItems parameter to list them
+// in groups of up to 100.
//
// 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
@@ -5143,7 +5208,7 @@ const opListTrafficPolicyVersions = "ListTrafficPolicyVersions"
// ListTrafficPolicyVersionsRequest generates a "aws/request.Request" representing the
// client's request for the ListTrafficPolicyVersions operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5227,7 +5292,7 @@ const opListVPCAssociationAuthorizations = "ListVPCAssociationAuthorizations"
// ListVPCAssociationAuthorizationsRequest generates a "aws/request.Request" representing the
// client's request for the ListVPCAssociationAuthorizations operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5318,7 +5383,7 @@ const opTestDNSAnswer = "TestDNSAnswer"
// TestDNSAnswerRequest generates a "aws/request.Request" representing the
// client's request for the TestDNSAnswer operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5402,7 +5467,7 @@ const opUpdateHealthCheck = "UpdateHealthCheck"
// UpdateHealthCheckRequest generates a "aws/request.Request" representing the
// client's request for the UpdateHealthCheck operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5456,8 +5521,7 @@ func (c *Route53) UpdateHealthCheckRequest(input *UpdateHealthCheckInput) (req *
//
// Returned Error Codes:
// * ErrCodeNoSuchHealthCheck "NoSuchHealthCheck"
-// No health check exists with the ID that you specified in the DeleteHealthCheck
-// request.
+// No health check exists with the specified ID.
//
// * ErrCodeInvalidInput "InvalidInput"
// The input is not valid.
@@ -5493,7 +5557,7 @@ const opUpdateHostedZoneComment = "UpdateHostedZoneComment"
// UpdateHostedZoneCommentRequest generates a "aws/request.Request" representing the
// client's request for the UpdateHostedZoneComment operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5575,7 +5639,7 @@ const opUpdateTrafficPolicyComment = "UpdateTrafficPolicyComment"
// UpdateTrafficPolicyCommentRequest generates a "aws/request.Request" representing the
// client's request for the UpdateTrafficPolicyComment operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5661,7 +5725,7 @@ const opUpdateTrafficPolicyInstance = "UpdateTrafficPolicyInstance"
// UpdateTrafficPolicyInstanceRequest generates a "aws/request.Request" representing the
// client's request for the UpdateTrafficPolicyInstance operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -5705,19 +5769,19 @@ func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyI
//
// When you update a traffic policy instance, Amazon Route 53 continues to respond
// to DNS queries for the root resource record set name (such as example.com)
-// while it replaces one group of resource record sets with another. Amazon
-// Route 53 performs the following operations:
+// while it replaces one group of resource record sets with another. Route 53
+// performs the following operations:
//
-// Amazon Route 53 creates a new group of resource record sets based on the
-// specified traffic policy. This is true regardless of how significant the
-// differences are between the existing resource record sets and the new resource
-// record sets.
+// Route 53 creates a new group of resource record sets based on the specified
+// traffic policy. This is true regardless of how significant the differences
+// are between the existing resource record sets and the new resource record
+// sets.
//
-// When all of the new resource record sets have been created, Amazon Route
-// 53 starts to respond to DNS queries for the root resource record set name
-// (such as example.com) by using the new resource record sets.
+// When all of the new resource record sets have been created, Route 53 starts
+// to respond to DNS queries for the root resource record set name (such as
+// example.com) by using the new resource record sets.
//
-// Amazon Route 53 deletes the old group of resource record sets that are associated
+// Route 53 deletes the old group of resource record sets that are associated
// with the root resource record set name.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -5740,8 +5804,8 @@ func (c *Route53) UpdateTrafficPolicyInstanceRequest(input *UpdateTrafficPolicyI
// * ErrCodePriorRequestNotComplete "PriorRequestNotComplete"
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
-// HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
-// for the same request, we recommend that you wait, in intervals of increasing
+// HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+// the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
//
// * ErrCodeConflictingTypes "ConflictingTypes"
@@ -5798,7 +5862,7 @@ type AccountLimit struct {
// Type is a required field
Type *string `type:"string" required:"true" enum:"AccountLimitType"`
- // The current value for the limit that is specified by AccountLimit$Type.
+ // The current value for the limit that is specified by Type (https://docs.aws.amazon.com/Route53/latest/APIReference/API_AccountLimit.html#Route53-Type-AccountLimit-Type).
//
// Value is a required field
Value *int64 `min:"1" type:"long" required:"true"`
@@ -5827,20 +5891,29 @@ func (s *AccountLimit) SetValue(v int64) *AccountLimit {
}
// A complex type that identifies the CloudWatch alarm that you want Amazon
-// Route 53 health checkers to use to determine whether this health check is
-// healthy.
+// Route 53 health checkers to use to determine whether the specified health
+// check is healthy.
type AlarmIdentifier struct {
_ struct{} `type:"structure"`
// The name of the CloudWatch alarm that you want Amazon Route 53 health checkers
// to use to determine whether this health check is healthy.
//
+ // Route 53 supports CloudWatch alarms with the following features:
+ //
+ // * Standard-resolution metrics. High-resolution metrics aren't supported.
+ // For more information, see High-Resolution Metrics (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/publishingMetrics.html#high-resolution-metrics)
+ // in the Amazon CloudWatch User Guide.
+ //
+ // * Statistics: Average, Minimum, Maximum, Sum, and SampleCount. Extended
+ // statistics aren't supported.
+ //
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
- // A complex type that identifies the CloudWatch alarm that you want Amazon
- // Route 53 health checkers to use to determine whether this health check is
- // healthy.
+ // For the CloudWatch alarm that you want Route 53 health checkers to use to
+ // determine whether this health check is healthy, the region that the alarm
+ // was created in.
//
// For the current list of CloudWatch regions, see Amazon CloudWatch (http://docs.aws.amazon.com/general/latest/gr/rande.html#cw_region)
// in the AWS Regions and Endpoints chapter of the Amazon Web Services General
@@ -5894,16 +5967,12 @@ func (s *AlarmIdentifier) SetRegion(v string) *AlarmIdentifier {
return s
}
-// Alias resource record sets only: Information about the CloudFront distribution,
-// Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or Amazon
-// Route 53 resource record set that you're redirecting queries to. An Elastic
-// Beanstalk environment must have a regionalized subdomain.
+// Alias resource record sets only: Information about the AWS resource, such
+// as a CloudFront distribution or an Amazon S3 bucket, that you want to route
+// traffic to.
//
// When creating resource record sets for a private hosted zone, note the following:
//
-// * Resource record sets can't be created for CloudFront distributions in
-// a private hosted zone.
-//
// * Creating geolocation alias resource record sets or latency alias resource
// record sets in a private hosted zone is unsupported.
//
@@ -5915,8 +5984,29 @@ type AliasTarget struct {
// Alias resource record sets only: The value that you specify depends on where
// you want to route queries:
//
- // CloudFront distributionSpecify the domain name that CloudFront assigned when
- // you created your distribution.
+ // Amazon API Gateway custom regional APIs and edge-optimized APIs
+ //
+ // Specify the applicable domain name for your API. You can get the applicable
+ // value using the AWS CLI command get-domain-names (https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html):
+ //
+ // * For regional APIs, specify the value of regionalDomainName.
+ //
+ // * For edge-optimized APIs, specify the value of distributionDomainName.
+ // This is the name of the associated CloudFront distribution, such as da1b2c3d4e5.cloudfront.net.
+ //
+ // The name of the record that you're creating must match a custom domain name
+ // for your API, such as api.example.com.
+ //
+ // Amazon Virtual Private Cloud interface VPC endpoint
+ //
+ // Enter the API endpoint for the interface endpoint, such as vpce-123456789abcdef01-example-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com.
+ // For edge-optimized APIs, this is the domain name for the corresponding CloudFront
+ // distribution. You can get the value of DnsName using the AWS CLI command
+ // describe-vpc-endpoints (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html).
+ //
+ // CloudFront distribution
+ //
+ // Specify the domain name that CloudFront assigned when you created your distribution.
//
// Your CloudFront distribution must include an alternate domain name that matches
// the name of the resource record set. For example, if the name of the resource
@@ -5925,56 +6015,90 @@ type AliasTarget struct {
// see Using Alternate Domain Names (CNAMEs) (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)
// in the Amazon CloudFront Developer Guide.
//
- // Elastic Beanstalk environmentSpecify the CNAME attribute for the environment.
- // (The environment must have a regionalized domain name.) You can use the following
- // methods to get the value of the CNAME attribute:
+ // You can't create a resource record set in a private hosted zone to route
+ // traffic to a CloudFront distribution.
//
- // AWS Management Console: For information about how to get the value by using
- // the console, see Using Custom Domains with AWS Elastic Beanstalk (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html)
- // in the AWS Elastic Beanstalk Developer Guide.
+ // For failover alias records, you can't specify a CloudFront distribution for
+ // both the primary and secondary records. A distribution must include an alternate
+ // domain name that matches the name of the record. However, the primary and
+ // secondary records have the same name, and you can't include the same alternate
+ // domain name in more than one distribution.
//
- // Elastic Beanstalk API: Use the DescribeEnvironments action to get the value
- // of the CNAME attribute. For more information, see DescribeEnvironments (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html)
- // in the AWS Elastic Beanstalk API Reference.
+ // Elastic Beanstalk environment
//
- // AWS CLI: Use the describe-environments command to get the value of the CNAME
- // attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html)
- // in the AWS Command Line Interface Reference.
+ // If the domain name for your Elastic Beanstalk environment includes the region
+ // that you deployed the environment in, you can create an alias record that
+ // routes traffic to the environment. For example, the domain name my-environment.us-west-2.elasticbeanstalk.com
+ // is a regionalized domain name.
//
- // ELB load balancerSpecify the DNS name that is associated with the load balancer.
- // Get the DNS name by using the AWS Management Console, the ELB API, or the
- // AWS CLI.
+ // For environments that were created before early 2016, the domain name doesn't
+ // include the region. To route traffic to these environments, you must create
+ // a CNAME record instead of an alias record. Note that you can't create a CNAME
+ // record for the root domain name. For example, if your domain name is example.com,
+ // you can create a record that routes traffic for acme.example.com to your
+ // Elastic Beanstalk environment, but you can't create a record that routes
+ // traffic for example.com to your Elastic Beanstalk environment.
//
- // AWS Management Console: Go to the EC2 page, choose Load Balancers in the
- // navigation pane, choose the load balancer, choose the Description tab, and
- // get the value of the DNS name field. (If you're routing traffic to a Classic
- // Load Balancer, get the value that begins with dualstack.)
+ // For Elastic Beanstalk environments that have regionalized subdomains, specify
+ // the CNAME attribute for the environment. You can use the following methods
+ // to get the value of the CNAME attribute:
//
- // Elastic Load Balancing API: Use DescribeLoadBalancers to get the value of
- // DNSName. For more information, see the applicable guide:
+ // * AWS Management Console: For information about how to get the value by
+ // using the console, see Using Custom Domains with AWS Elastic Beanstalk
+ // (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customdomains.html)
+ // in the AWS Elastic Beanstalk Developer Guide.
//
- // Classic Load Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
+ // * Elastic Beanstalk API: Use the DescribeEnvironments action to get the
+ // value of the CNAME attribute. For more information, see DescribeEnvironments
+ // (http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html)
+ // in the AWS Elastic Beanstalk API Reference.
//
- // Application and Network Load Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
+ // * AWS CLI: Use the describe-environments command to get the value of the
+ // CNAME attribute. For more information, see describe-environments (http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/describe-environments.html)
+ // in the AWS Command Line Interface Reference.
//
- // AWS CLI: Use describe-load-balancers to get the value of DNSName. For more
- // information, see the applicable guide:
+ // ELB load balancer
//
- // Classic Load Balancers: describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
+ // Specify the DNS name that is associated with the load balancer. Get the DNS
+ // name by using the AWS Management Console, the ELB API, or the AWS CLI.
//
- // Application and Network Load Balancers: describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html)
+ // * AWS Management Console: Go to the EC2 page, choose Load Balancers in
+ // the navigation pane, choose the load balancer, choose the Description
+ // tab, and get the value of the DNS name field. If you're routing traffic
+ // to a Classic Load Balancer, get the value that begins with dualstack.
+ // If you're routing traffic to another type of load balancer, get the value
+ // that applies to the record type, A or AAAA.
//
- // Amazon S3 bucket that is configured as a static websiteSpecify the domain
- // name of the Amazon S3 website endpoint in which you created the bucket, for
- // example, s3-website-us-east-2.amazonaws.com. For more information about valid
- // values, see the table Amazon Simple Storage Service (S3) Website Endpoints
- // (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
- // Amazon Web Services General Reference. For more information about using S3
- // buckets for websites, see Getting Started with Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html)
+ // * Elastic Load Balancing API: Use DescribeLoadBalancers to get the value
+ // of DNSName. For more information, see the applicable guide: Classic Load
+ // Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
+ // Application and Network Load Balancers: DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
+ //
+ // * AWS CLI: Use describe-load-balancers to get the value of DNSName. For
+ // more information, see the applicable guide: Classic Load Balancers: describe-load-balancers
+ // (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
+ // Application and Network Load Balancers: describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html)
+ //
+ // Amazon S3 bucket that is configured as a static website
+ //
+ // Specify the domain name of the Amazon S3 website endpoint that you created
+ // the bucket in, for example, s3-website.us-east-2.amazonaws.com. For more
+ // information about valid values, see the table Amazon Simple Storage Service
+ // (S3) Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
+ // in the Amazon Web Services General Reference. For more information about
+ // using S3 buckets for websites, see Getting Started with Amazon Route 53 (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started.html)
// in the Amazon Route 53 Developer Guide.
//
- // Another Amazon Route 53 resource record setSpecify the value of the Name
- // element for a resource record set in the current hosted zone.
+ // Another Route 53 resource record set
+ //
+ // Specify the value of the Name element for a resource record set in the current
+ // hosted zone.
+ //
+ // If you're creating an alias record that has the same name as the hosted zone
+ // (known as the zone apex), you can't specify the domain name for a record
+ // for which the value of Type is CNAME. This is because the alias record must
+ // have the same type as the record that you're routing traffic to, and creating
+ // a CNAME record for the zone apex isn't supported even for an alias record.
//
// DNSName is a required field
DNSName *string `type:"string" required:"true"`
@@ -5982,48 +6106,69 @@ type AliasTarget struct {
// Applies only to alias, failover alias, geolocation alias, latency alias,
// and weighted alias resource record sets: When EvaluateTargetHealth is true,
// an alias resource record set inherits the health of the referenced AWS resource,
- // such as an ELB load balancer, or the referenced resource record set.
+ // such as an ELB load balancer or another resource record set in the hosted
+ // zone.
//
// Note the following:
//
- // * You can't set EvaluateTargetHealth to true when the alias target is
- // a CloudFront distribution.
+ // CloudFront distributions
//
- // * If the AWS resource that you specify in AliasTarget is a resource record
- // set or a group of resource record sets (for example, a group of weighted
- // resource record sets), but it is not another alias resource record set,
- // we recommend that you associate a health check with all of the resource
- // record sets in the alias target. For more information, see What Happens
- // When You Omit Health Checks? (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting)
- // in the Amazon Route 53 Developer Guide.
+ // You can't set EvaluateTargetHealth to true when the alias target is a CloudFront
+ // distribution.
//
- // * If you specify an Elastic Beanstalk environment in HostedZoneId and
- // DNSName, and if the environment contains an ELB load balancer, Elastic
- // Load Balancing routes queries only to the healthy Amazon EC2 instances
- // that are registered with the load balancer. (An environment automatically
- // contains an ELB load balancer if it includes more than one EC2 instance.)
- // If you set EvaluateTargetHealth to true and either no EC2 instances are
- // healthy or the load balancer itself is unhealthy, Amazon Route 53 routes
- // queries to other available resources that are healthy, if any.
+ // Elastic Beanstalk environments that have regionalized subdomains
//
- // If the environment contains a single EC2 instance, there are no special requirements.
+ // If you specify an Elastic Beanstalk environment in DNSName and the environment
+ // contains an ELB load balancer, Elastic Load Balancing routes queries only
+ // to the healthy Amazon EC2 instances that are registered with the load balancer.
+ // (An environment automatically contains an ELB load balancer if it includes
+ // more than one Amazon EC2 instance.) If you set EvaluateTargetHealth to true
+ // and either no Amazon EC2 instances are healthy or the load balancer itself
+ // is unhealthy, Route 53 routes queries to other available resources that are
+ // healthy, if any.
//
- // * If you specify an ELB load balancer in AliasTarget, ELB routes queries
- // only to the healthy EC2 instances that are registered with the load balancer.
- // If no EC2 instances are healthy or if the load balancer itself is unhealthy,
- // and if EvaluateTargetHealth is true for the corresponding alias resource
- // record set, Amazon Route 53 routes queries to other resources. When you
- // create a load balancer, you configure settings for ELB health checks;
- // they're not Amazon Route 53 health checks, but they perform a similar
- // function. Do not create Amazon Route 53 health checks for the EC2 instances
- // that you register with an ELB load balancer.
+ // If the environment contains a single Amazon EC2 instance, there are no special
+ // requirements.
//
- // For more information, see How Health Checks Work in More Complex Amazon Route
- // 53 Configurations (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html)
- // in the Amazon Route 53 Developer Guide.
+ // ELB load balancers
//
- // * We recommend that you set EvaluateTargetHealth to true only when you
- // have enough idle capacity to handle the failure of one or more endpoints.
+ // Health checking behavior depends on the type of load balancer:
+ //
+ // * Classic Load Balancers: If you specify an ELB Classic Load Balancer
+ // in DNSName, Elastic Load Balancing routes queries only to the healthy
+ // Amazon EC2 instances that are registered with the load balancer. If you
+ // set EvaluateTargetHealth to true and either no EC2 instances are healthy
+ // or the load balancer itself is unhealthy, Route 53 routes queries to other
+ // resources.
+ //
+ // * Application and Network Load Balancers: If you specify an ELB Application
+ // or Network Load Balancer and you set EvaluateTargetHealth to true, Route
+ // 53 routes queries to the load balancer based on the health of the target
+ // groups that are associated with the load balancer: For an Application
+ // or Network Load Balancer to be considered healthy, every target group
+ // that contains targets must contain at least one healthy target. If any
+ // target group contains only unhealthy targets, the load balancer is considered
+ // unhealthy, and Route 53 routes queries to other resources. A target group
+ // that has no registered targets is considered unhealthy.
+ //
+ // When you create a load balancer, you configure settings for Elastic Load
+ // Balancing health checks; they're not Route 53 health checks, but they perform
+ // a similar function. Do not create Route 53 health checks for the EC2 instances
+ // that you register with an ELB load balancer.
+ //
+ // S3 buckets
+ //
+ // There are no special requirements for setting EvaluateTargetHealth to true
+ // when the alias target is an S3 bucket.
+ //
+ // Other records in the same hosted zone
+ //
+ // If the AWS resource that you specify in DNSName is a record or a group of
+ // records (for example, a group of weighted records) but is not another alias
+ // record, we recommend that you associate a health check with all of the records
+ // in the alias target. For more information, see What Happens When You Omit
+ // Health Checks? (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-complex-configs.html#dns-failover-complex-configs-hc-omitting)
+ // in the Amazon Route 53 Developer Guide.
//
// For more information and examples, see Amazon Route 53 Health Checks and
// DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html)
@@ -6035,57 +6180,75 @@ type AliasTarget struct {
// Alias resource records sets only: The value used depends on where you want
// to route traffic:
//
- // CloudFront distributionSpecify Z2FDTNDATAQYW2.
+ // Amazon API Gateway custom regional APIs and edge-optimized APIs
+ //
+ // Specify the hosted zone ID for your API. You can get the applicable value
+ // using the AWS CLI command get-domain-names (https://docs.aws.amazon.com/cli/latest/reference/apigateway/get-domain-names.html):
+ //
+ // * For regional APIs, specify the value of regionalHostedZoneId.
+ //
+ // * For edge-optimized APIs, specify the value of distributionHostedZoneId.
+ //
+ // Amazon Virtual Private Cloud interface VPC endpoint
+ //
+ // Specify the hosted zone ID for your interface endpoint. You can get the value
+ // of HostedZoneId using the AWS CLI command describe-vpc-endpoints (https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-vpc-endpoints.html).
+ //
+ // CloudFront distribution
+ //
+ // Specify Z2FDTNDATAQYW2.
//
// Alias resource record sets for CloudFront can't be created in a private zone.
//
- // Elastic Beanstalk environmentSpecify the hosted zone ID for the region in
- // which you created the environment. The environment must have a regionalized
- // subdomain. For a list of regions and the corresponding hosted zone IDs, see
- // AWS Elastic Beanstalk (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region)
+ // Elastic Beanstalk environment
+ //
+ // Specify the hosted zone ID for the region that you created the environment
+ // in. The environment must have a regionalized subdomain. For a list of regions
+ // and the corresponding hosted zone IDs, see AWS Elastic Beanstalk (http://docs.aws.amazon.com/general/latest/gr/rande.html#elasticbeanstalk_region)
// in the "AWS Regions and Endpoints" chapter of the Amazon Web Services General
// Reference.
//
- // ELB load balancerSpecify the value of the hosted zone ID for the load balancer.
- // Use the following methods to get the hosted zone ID:
+ // ELB load balancer
//
- // Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region)
- // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services
- // General Reference: Use the value that corresponds with the region that you
- // created your load balancer in. Note that there are separate columns for Application
- // and Classic Load Balancers and for Network Load Balancers.
+ // Specify the value of the hosted zone ID for the load balancer. Use the following
+ // methods to get the hosted zone ID:
//
- // AWS Management Console: Go to the Amazon EC2 page, choose Load Balancers
- // in the navigation pane, select the load balancer, and get the value of the
- // Hosted zone field on the Description tab.
+ // * Elastic Load Balancing (https://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region)
+ // table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services
+ // General Reference: Use the value that corresponds with the region that
+ // you created your load balancer in. Note that there are separate columns
+ // for Application and Classic Load Balancers and for Network Load Balancers.
//
- // Elastic Load Balancing API: Use DescribeLoadBalancers to get the applicable
- // value. For more information, see the applicable guide:
+ // * AWS Management Console: Go to the Amazon EC2 page, choose Load Balancers
+ // in the navigation pane, select the load balancer, and get the value of
+ // the Hosted zone field on the Description tab.
//
- // Classic Load Balancers: Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
- // to get the value of CanonicalHostedZoneNameId.
+ // * Elastic Load Balancing API: Use DescribeLoadBalancers to get the applicable
+ // value. For more information, see the applicable guide: Classic Load Balancers:
+ // Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/2012-06-01/APIReference/API_DescribeLoadBalancers.html)
+ // to get the value of CanonicalHostedZoneNameId. Application and Network
+ // Load Balancers: Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
+ // to get the value of CanonicalHostedZoneId.
//
- // Application and Network Load Balancers: Use DescribeLoadBalancers (http://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html)
- // to get the value of CanonicalHostedZoneId.
+ // * AWS CLI: Use describe-load-balancers to get the applicable value. For
+ // more information, see the applicable guide: Classic Load Balancers: Use
+ // describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
+ // to get the value of CanonicalHostedZoneNameId. Application and Network
+ // Load Balancers: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html)
+ // to get the value of CanonicalHostedZoneId.
//
- // AWS CLI: Use describe-load-balancers to get the applicable value. For more
- // information, see the applicable guide:
+ // An Amazon S3 bucket configured as a static website
//
- // Classic Load Balancers: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elb/describe-load-balancers.html)
- // to get the value of CanonicalHostedZoneNameId.
- //
- // Application and Network Load Balancers: Use describe-load-balancers (http://docs.aws.amazon.com/cli/latest/reference/elbv2/describe-load-balancers.html)
- // to get the value of CanonicalHostedZoneId.
- //
- // An Amazon S3 bucket configured as a static websiteSpecify the hosted zone
- // ID for the region that you created the bucket in. For more information about
- // valid values, see the Amazon Simple Storage Service Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
+ // Specify the hosted zone ID for the region that you created the bucket in.
+ // For more information about valid values, see the Amazon Simple Storage Service
+ // Website Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region)
// table in the "AWS Regions and Endpoints" chapter of the Amazon Web Services
// General Reference.
//
- // Another Amazon Route 53 resource record set in your hosted zoneSpecify the
- // hosted zone ID of your hosted zone. (An alias resource record set can't reference
- // a resource record set in a different hosted zone.)
+ // Another Route 53 resource record set in your hosted zone
+ //
+ // Specify the hosted zone ID of your hosted zone. (An alias resource record
+ // set can't reference a resource record set in a different hosted zone.)
//
// HostedZoneId is a required field
HostedZoneId *string `type:"string" required:"true"`
@@ -6178,6 +6341,9 @@ func (s *AssociateVPCWithHostedZoneInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.VPC == nil {
invalidParams.Add(request.NewErrParamRequired("VPC"))
}
@@ -6246,18 +6412,17 @@ type Change struct {
//
// * CREATE: Creates a resource record set that has the specified values.
//
- // * DELETE: Deletes a existing resource record set.
+ // * DELETE: Deletes a existing resource record set. To delete the resource
+ // record set that is associated with a traffic policy instance, use DeleteTrafficPolicyInstance
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html).
+ // Amazon Route 53 will delete the resource record set automatically. If
+ // you delete the resource record set by using ChangeResourceRecordSets,
+ // Route 53 doesn't automatically delete the traffic policy instance, and
+ // you'll continue to be charged for it even though it's no longer in use.
//
- // To delete the resource record set that is associated with a traffic policy
- // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete
- // the resource record set automatically. If you delete the resource record
- // set by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically
- // delete the traffic policy instance, and you'll continue to be charged
- // for it even though it's no longer in use.
- //
- // * UPSERT: If a resource record set doesn't already exist, Amazon Route
- // 53 creates it. If a resource record set does exist, Amazon Route 53 updates
- // it with the values in the request.
+ // * UPSERT: If a resource record set doesn't already exist, Route 53 creates
+ // it. If a resource record set does exist, Route 53 updates it with the
+ // values in the request.
//
// Action is a required field
Action *string `type:"string" required:"true" enum:"ChangeAction"`
@@ -6380,8 +6545,8 @@ type ChangeInfo struct {
// A complex type that describes change information about changes made to your
// hosted zone.
//
- // This element contains an ID that you use when performing a GetChange action
- // to get detailed information about the change.
+ // This element contains an ID that you use when performing a GetChange (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html)
+ // action to get detailed information about the change.
Comment *string `type:"string"`
// The ID of the request.
@@ -6401,7 +6566,7 @@ type ChangeInfo struct {
// at 17:48:16.751 UTC.
//
// SubmittedAt is a required field
- SubmittedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ SubmittedAt *time.Time `type:"timestamp" required:"true"`
}
// String returns the string representation
@@ -6473,6 +6638,9 @@ func (s *ChangeResourceRecordSetsInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.ChangeBatch != nil {
if err := s.ChangeBatch.Validate(); err != nil {
invalidParams.AddNested("ChangeBatch", err.(request.ErrInvalidParams))
@@ -6504,8 +6672,8 @@ type ChangeResourceRecordSetsOutput struct {
// A complex type that contains information about changes made to your hosted
// zone.
//
- // This element contains an ID that you use when performing a GetChange action
- // to get detailed information about the change.
+ // This element contains an ID that you use when performing a GetChange (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetChange.html)
+ // action to get detailed information about the change.
//
// ChangeInfo is a required field
ChangeInfo *ChangeInfo `type:"structure" required:"true"`
@@ -6580,9 +6748,15 @@ func (s *ChangeTagsForResourceInput) Validate() error {
if s.ResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceId"))
}
+ if s.ResourceId != nil && len(*s.ResourceId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
+ }
if s.ResourceType == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceType"))
}
+ if s.ResourceType != nil && len(*s.ResourceType) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -6752,24 +6926,24 @@ type CreateHealthCheckInput struct {
// * If you send a CreateHealthCheck request with the same CallerReference
// and settings as a previous request, and if the health check doesn't exist,
// Amazon Route 53 creates the health check. If the health check does exist,
- // Amazon Route 53 returns the settings for the existing health check.
+ // Route 53 returns the settings for the existing health check.
//
// * If you send a CreateHealthCheck request with the same CallerReference
- // as a deleted health check, regardless of the settings, Amazon Route 53
- // returns a HealthCheckAlreadyExists error.
+ // as a deleted health check, regardless of the settings, Route 53 returns
+ // a HealthCheckAlreadyExists error.
//
// * If you send a CreateHealthCheck request with the same CallerReference
- // as an existing health check but with different settings, Amazon Route
- // 53 returns a HealthCheckAlreadyExists error.
+ // as an existing health check but with different settings, Route 53 returns
+ // a HealthCheckAlreadyExists error.
//
// * If you send a CreateHealthCheck request with a unique CallerReference
- // but settings identical to an existing health check, Amazon Route 53 creates
- // the health check.
+ // but settings identical to an existing health check, Route 53 creates the
+ // health check.
//
// CallerReference is a required field
CallerReference *string `min:"1" type:"string" required:"true"`
- // A complex type that contains the response to a CreateHealthCheck request.
+ // A complex type that contains settings for a new health check.
//
// HealthCheckConfig is a required field
HealthCheckConfig *HealthCheckConfig `type:"structure" required:"true"`
@@ -6858,8 +7032,8 @@ func (s *CreateHealthCheckOutput) SetLocation(v string) *CreateHealthCheckOutput
return s
}
-// A complex type that contains information about the request to create a hosted
-// zone.
+// A complex type that contains information about the request to create a public
+// or private hosted zone.
type CreateHostedZoneInput struct {
_ struct{} `locationName:"CreateHostedZoneRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"`
@@ -6875,7 +7049,7 @@ type CreateHostedZoneInput struct {
// If you want to associate a reusable delegation set with this hosted zone,
// the ID that Amazon Route 53 assigned to the reusable delegation set when
// you created it. For more information about reusable delegation sets, see
- // CreateReusableDelegationSet.
+ // CreateReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html).
DelegationSetId *string `type:"string"`
// (Optional) A complex type that contains the following optional values:
@@ -6888,16 +7062,15 @@ type CreateHostedZoneInput struct {
// and the other elements.
HostedZoneConfig *HostedZoneConfig `type:"structure"`
- // The name of the domain. For resource record types that include a domain name,
- // specify a fully qualified domain name, for example, www.example.com. The
- // trailing dot is optional; Amazon Route 53 assumes that the domain name is
- // fully qualified. This means that Amazon Route 53 treats www.example.com (without
- // a trailing dot) and www.example.com. (with a trailing dot) as identical.
+ // The name of the domain. Specify a fully qualified domain name, for example,
+ // www.example.com. The trailing dot is optional; Amazon Route 53 assumes that
+ // the domain name is fully qualified. This means that Route 53 treats www.example.com
+ // (without a trailing dot) and www.example.com. (with a trailing dot) as identical.
//
// If you're creating a public hosted zone, this is the name you have registered
// with your DNS registrar. If your domain name is registered with a registrar
- // other than Amazon Route 53, change the name servers for your domain to the
- // set of NameServers that CreateHostedZone returns in DelegationSet.
+ // other than Route 53, change the name servers for your domain to the set of
+ // NameServers that CreateHostedZone returns in DelegationSet.
//
// Name is a required field
Name *string `type:"string" required:"true"`
@@ -6907,6 +7080,7 @@ type CreateHostedZoneInput struct {
//
// You can specify only one Amazon VPC when you create a private hosted zone.
// To associate additional Amazon VPCs with the hosted zone, use AssociateVPCWithHostedZone
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_AssociateVPCWithHostedZone.html)
// after you create a hosted zone.
VPC *VPC `type:"structure"`
}
@@ -7053,8 +7227,8 @@ type CreateQueryLoggingConfigInput struct {
// arn:aws:logs:region:account-id:log-group:log_group_name
//
// To get the ARN for a log group, you can use the CloudWatch console, the DescribeLogGroups
- // (http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html)
- // API action, the describe-log-groups (http://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html)
+ // (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogGroups.html)
+ // API action, the describe-log-groups (https://docs.aws.amazon.com/cli/latest/reference/logs/describe-log-groups.html)
// command, or the applicable command in one of the AWS SDKs.
//
// CloudWatchLogsLogGroupArn is a required field
@@ -7243,7 +7417,7 @@ type CreateTrafficPolicyInput struct {
Comment *string `type:"string"`
// The definition of this traffic policy in JSON format. For more information,
- // see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
+ // see Traffic Policy Document Format (https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
//
// Document is a required field
Document *string `type:"string" required:"true"`
@@ -7303,15 +7477,15 @@ func (s *CreateTrafficPolicyInput) SetName(v string) *CreateTrafficPolicyInput {
type CreateTrafficPolicyInstanceInput struct {
_ struct{} `locationName:"CreateTrafficPolicyInstanceRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"`
- // The ID of the hosted zone in which you want Amazon Route 53 to create resource
- // record sets by using the configuration in a traffic policy.
+ // The ID of the hosted zone that you want Amazon Route 53 to create resource
+ // record sets in by using the configuration in a traffic policy.
//
// HostedZoneId is a required field
HostedZoneId *string `type:"string" required:"true"`
// The domain name (such as example.com) or subdomain name (such as www.example.com)
// for which Amazon Route 53 responds to DNS queries by using the resource record
- // sets that Amazon Route 53 creates for this traffic policy instance.
+ // sets that Route 53 creates for this traffic policy instance.
//
// Name is a required field
Name *string `type:"string" required:"true"`
@@ -7493,7 +7667,7 @@ type CreateTrafficPolicyVersionInput struct {
// The definition of this version of the traffic policy, in JSON format. You
// specified the JSON in the CreateTrafficPolicyVersion request. For more information
- // about the JSON format, see CreateTrafficPolicy.
+ // about the JSON format, see CreateTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html).
//
// Document is a required field
Document *string `type:"string" required:"true"`
@@ -7625,6 +7799,9 @@ func (s *CreateVPCAssociationAuthorizationInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.VPC == nil {
invalidParams.Add(request.NewErrParamRequired("VPC"))
}
@@ -7763,6 +7940,9 @@ func (s *DeleteHealthCheckInput) Validate() error {
if s.HealthCheckId == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheckId"))
}
+ if s.HealthCheckId != nil && len(*s.HealthCheckId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HealthCheckId", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -7817,6 +7997,9 @@ func (s *DeleteHostedZoneInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -7938,6 +8121,9 @@ func (s *DeleteReusableDelegationSetInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8138,6 +8324,9 @@ func (s *DeleteVPCAssociationAuthorizationInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.VPC == nil {
invalidParams.Add(request.NewErrParamRequired("VPC"))
}
@@ -8256,6 +8445,9 @@ func (s *DisassociateVPCFromHostedZoneInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.VPC == nil {
invalidParams.Add(request.NewErrParamRequired("VPC"))
}
@@ -8317,7 +8509,7 @@ func (s *DisassociateVPCFromHostedZoneOutput) SetChangeInfo(v *ChangeInfo) *Disa
return s
}
-// A complex type that contains information about a geo location.
+// A complex type that contains information about a geographic location.
type GeoLocation struct {
_ struct{} `type:"structure"`
@@ -8332,8 +8524,8 @@ type GeoLocation struct {
// The two-letter code for the country.
CountryCode *string `min:"1" type:"string"`
- // The code for the subdivision, for example, a state in the United States or
- // a province in Canada.
+ // The code for the subdivision. Route 53 currently supports only states in
+ // the United States.
SubdivisionCode *string `min:"1" type:"string"`
}
@@ -8401,12 +8593,12 @@ type GeoLocationDetails struct {
// The name of the country.
CountryName *string `min:"1" type:"string"`
- // The code for the subdivision, for example, a state in the United States or
- // a province in Canada.
+ // The code for the subdivision. Route 53 currently supports only states in
+ // the United States.
SubdivisionCode *string `min:"1" type:"string"`
- // The full name of the subdivision, for example, a state in the United States
- // or a province in Canada.
+ // The full name of the subdivision. Route 53 currently supports only states
+ // in the United States.
SubdivisionName *string `min:"1" type:"string"`
}
@@ -8500,6 +8692,9 @@ func (s *GetAccountLimitInput) Validate() error {
if s.Type == nil {
invalidParams.Add(request.NewErrParamRequired("Type"))
}
+ if s.Type != nil && len(*s.Type) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Type", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8584,6 +8779,9 @@ func (s *GetChangeInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8623,6 +8821,7 @@ func (s *GetChangeOutput) SetChangeInfo(v *ChangeInfo) *GetChangeOutput {
return s
}
+// Empty request.
type GetCheckerIpRangesInput struct {
_ struct{} `type:"structure"`
}
@@ -8637,9 +8836,13 @@ func (s GetCheckerIpRangesInput) GoString() string {
return s.String()
}
+// A complex type that contains the CheckerIpRanges element.
type GetCheckerIpRangesOutput struct {
_ struct{} `type:"structure"`
+ // A complex type that contains sorted list of IP ranges in CIDR format for
+ // Amazon Route 53 health checkers.
+ //
// CheckerIpRanges is a required field
CheckerIpRanges []*string `type:"list" required:"true"`
}
@@ -8688,8 +8891,8 @@ type GetGeoLocationInput struct {
// Amazon Route 53 uses the one- to three-letter subdivision codes that are
// specified in ISO standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
- // Amazon Route 53 doesn't support subdivision codes for all countries. If you
- // specify SubdivisionCode, you must also specify CountryCode.
+ // Route 53 doesn't support subdivision codes for all countries. If you specify
+ // subdivisioncode, you must also specify countrycode.
SubdivisionCode *string `location:"querystring" locationName:"subdivisioncode" min:"1" type:"string"`
}
@@ -8839,6 +9042,9 @@ func (s *GetHealthCheckInput) Validate() error {
if s.HealthCheckId == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheckId"))
}
+ if s.HealthCheckId != nil && len(*s.HealthCheckId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HealthCheckId", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8884,6 +9090,9 @@ func (s *GetHealthCheckLastFailureReasonInput) Validate() error {
if s.HealthCheckId == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheckId"))
}
+ if s.HealthCheckId != nil && len(*s.HealthCheckId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HealthCheckId", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -8984,6 +9193,9 @@ func (s *GetHealthCheckStatusInput) Validate() error {
if s.HealthCheckId == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheckId"))
}
+ if s.HealthCheckId != nil && len(*s.HealthCheckId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HealthCheckId", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9093,6 +9305,9 @@ func (s *GetHostedZoneInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9144,9 +9359,15 @@ func (s *GetHostedZoneLimitInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.Type == nil {
invalidParams.Add(request.NewErrParamRequired("Type"))
}
+ if s.Type != nil && len(*s.Type) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Type", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9302,7 +9523,8 @@ type GetQueryLoggingConfigOutput struct {
_ struct{} `type:"structure"`
// A complex type that contains information about the query logging configuration
- // that you specified in a GetQueryLoggingConfig request.
+ // that you specified in a GetQueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetQueryLoggingConfig.html)
+ // request.
//
// QueryLoggingConfig is a required field
QueryLoggingConfig *QueryLoggingConfig `type:"structure" required:"true"`
@@ -9351,6 +9573,9 @@ func (s *GetReusableDelegationSetInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9398,9 +9623,15 @@ func (s *GetReusableDelegationSetLimitInput) Validate() error {
if s.DelegationSetId == nil {
invalidParams.Add(request.NewErrParamRequired("DelegationSetId"))
}
+ if s.DelegationSetId != nil && len(*s.DelegationSetId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("DelegationSetId", 1))
+ }
if s.Type == nil {
invalidParams.Add(request.NewErrParamRequired("Type"))
}
+ if s.Type != nil && len(*s.Type) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Type", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -9776,8 +10007,8 @@ type HealthCheckConfig struct {
_ struct{} `type:"structure"`
// A complex type that identifies the CloudWatch alarm that you want Amazon
- // Route 53 health checkers to use to determine whether this health check is
- // healthy.
+ // Route 53 health checkers to use to determine whether the specified health
+ // check is healthy.
AlarmIdentifier *AlarmIdentifier `type:"structure"`
// (CALCULATED Health Checks Only) A complex type that contains one ChildHealthCheck
@@ -9785,6 +10016,27 @@ type HealthCheckConfig struct {
// health check.
ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"`
+ // Stops Route 53 from performing health checks. When you disable a health check,
+ // here's what happens:
+ //
+ // * Health checks that check the health of endpoints: Route 53 stops submitting
+ // requests to your application, server, or other resource.
+ //
+ // * Calculated health checks: Route 53 stops aggregating the status of the
+ // referenced health checks.
+ //
+ // * Health checks that monitor CloudWatch alarms: Route 53 stops monitoring
+ // the corresponding CloudWatch metrics.
+ //
+ // After you disable a health check, Route 53 considers the status of the health
+ // check to always be healthy. If you configured DNS failover, Route 53 continues
+ // to route traffic to the corresponding resources. If you want to stop routing
+ // traffic to a resource, change the value of Inverted (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-Inverted).
+ //
+ // Charges for a health check still apply when the health check is disabled.
+ // For more information, see Amazon Route 53 Pricing (http://aws.amazon.com/route53/pricing/).
+ Disabled *bool `type:"boolean"`
+
// Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName
// to the endpoint in the client_hello message during TLS negotiation. This
// allows the endpoint to respond to HTTPS health check requests with the applicable
@@ -9819,43 +10071,42 @@ type HealthCheckConfig struct {
// Amazon Route 53 behavior depends on whether you specify a value for IPAddress.
//
- // If you specify a value forIPAddress:
+ // If you specify a value for IPAddress:
//
// Amazon Route 53 sends health check requests to the specified IPv4 or IPv6
// address and passes the value of FullyQualifiedDomainName in the Host header
// for all health checks except TCP health checks. This is typically the fully
- // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform
+ // qualified DNS name of the endpoint on which you want Route 53 to perform
// health checks.
//
- // When Amazon Route 53 checks the health of an endpoint, here is how it constructs
+ // When Route 53 checks the health of an endpoint, here is how it constructs
// the Host header:
//
// * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for
- // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to
- // the endpoint in the Host header.
+ // Type, Route 53 passes the value of FullyQualifiedDomainName to the endpoint
+ // in the Host header.
//
// * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH
- // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName
- // to the endpoint in the Host header.
+ // for Type, Route 53 passes the value of FullyQualifiedDomainName to the
+ // endpoint in the Host header.
//
// * If you specify another value for Port and any value except TCP for Type,
- // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in
- // the Host header.
+ // Route 53 passes FullyQualifiedDomainName:Port to the endpoint in the Host
+ // header.
//
- // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53
- // substitutes the value of IPAddress in the Host header in each of the preceding
- // cases.
+ // If you don't specify a value for FullyQualifiedDomainName, Route 53 substitutes
+ // the value of IPAddress in the Host header in each of the preceding cases.
//
- // If you don't specify a value for IPAddress:
+ // If you don't specify a value for IPAddress :
//
- // Amazon Route 53 sends a DNS request to the domain that you specify for FullyQualifiedDomainName
+ // Route 53 sends a DNS request to the domain that you specify for FullyQualifiedDomainName
// at the interval that you specify for RequestInterval. Using an IPv4 address
- // that DNS returns, Amazon Route 53 then checks the health of the endpoint.
+ // that DNS returns, Route 53 then checks the health of the endpoint.
//
- // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4
- // to send health checks to the endpoint. If there's no resource record set
- // with a type of A for the name that you specify for FullyQualifiedDomainName,
- // the health check fails with a "DNS resolution failed" error.
+ // If you don't specify a value for IPAddress, Route 53 uses only IPv4 to send
+ // health checks to the endpoint. If there's no resource record set with a type
+ // of A for the name that you specify for FullyQualifiedDomainName, the health
+ // check fails with a "DNS resolution failed" error.
//
// If you want to check the health of weighted, latency, or failover resource
// record sets and you choose to specify the endpoint only by FullyQualifiedDomainName,
@@ -9871,32 +10122,33 @@ type HealthCheckConfig struct {
// check results will be unpredictable.
//
// In addition, if the value that you specify for Type is HTTP, HTTPS, HTTP_STR_MATCH,
- // or HTTPS_STR_MATCH, Amazon Route 53 passes the value of FullyQualifiedDomainName
+ // or HTTPS_STR_MATCH, Route 53 passes the value of FullyQualifiedDomainName
// in the Host header, as it does when you specify a value for IPAddress. If
- // the value of Type is TCP, Amazon Route 53 doesn't pass a Host header.
+ // the value of Type is TCP, Route 53 doesn't pass a Host header.
FullyQualifiedDomainName *string `type:"string"`
// The number of child health checks that are associated with a CALCULATED health
- // that Amazon Route 53 must consider healthy for the CALCULATED health check
- // to be considered healthy. To specify the child health checks that you want
- // to associate with a CALCULATED health check, use the HealthCheckConfig$ChildHealthChecks
- // and HealthCheckConfig$ChildHealthChecks elements.
+ // check that Amazon Route 53 must consider healthy for the CALCULATED health
+ // check to be considered healthy. To specify the child health checks that you
+ // want to associate with a CALCULATED health check, use the ChildHealthChecks
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-ChildHealthChecks)
+ // element.
//
// Note the following:
//
// * If you specify a number greater than the number of child health checks,
- // Amazon Route 53 always considers this health check to be unhealthy.
+ // Route 53 always considers this health check to be unhealthy.
//
- // * If you specify 0, Amazon Route 53 always considers this health check
- // to be healthy.
+ // * If you specify 0, Route 53 always considers this health check to be
+ // healthy.
HealthThreshold *int64 `type:"integer"`
// The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route 53
// to perform health checks on. If you don't specify a value for IPAddress,
- // Amazon Route 53 sends a DNS request to resolve the domain name that you specify
+ // Route 53 sends a DNS request to resolve the domain name that you specify
// in FullyQualifiedDomainName at the interval that you specify in RequestInterval.
- // Using an IP address returned by DNS, Amazon Route 53 then checks the health
- // of the endpoint.
+ // Using an IP address returned by DNS, Route 53 then checks the health of the
+ // endpoint.
//
// Use one of the following formats for the value of IPAddress:
//
@@ -9913,11 +10165,11 @@ type HealthCheckConfig struct {
// IP address for IPAddress. This ensures that the IP address of your instance
// will never change.
//
- // For more information, see HealthCheckConfig$FullyQualifiedDomainName.
+ // For more information, see FullyQualifiedDomainName (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName).
//
- // Constraints: Amazon Route 53 can't check the health of endpoints for which
- // the IP address is in local, private, non-routable, or multicast ranges. For
- // more information about IP addresses for which you can't create health checks,
+ // Constraints: Route 53 can't check the health of endpoints for which the IP
+ // address is in local, private, non-routable, or multicast ranges. For more
+ // information about IP addresses for which you can't create health checks,
// see the following documents:
//
// * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735)
@@ -9932,14 +10184,14 @@ type HealthCheckConfig struct {
// When CloudWatch has insufficient data about the metric to determine the alarm
// state, the status that you want Amazon Route 53 to assign to the health check:
//
- // * Healthy: Amazon Route 53 considers the health check to be healthy.
+ // * Healthy: Route 53 considers the health check to be healthy.
//
- // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy.
+ // * Unhealthy: Route 53 considers the health check to be unhealthy.
//
- // * LastKnownStatus: Amazon Route 53 uses the status of the health check
- // from the last time that CloudWatch had sufficient data to determine the
- // alarm state. For new health checks that have no last known status, the
- // default status for the health check is healthy.
+ // * LastKnownStatus: Route 53 uses the status of the health check from the
+ // last time that CloudWatch had sufficient data to determine the alarm state.
+ // For new health checks that have no last known status, the default status
+ // for the health check is healthy.
InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"`
// Specify whether you want Amazon Route 53 to invert the status of a health
@@ -9949,7 +10201,7 @@ type HealthCheckConfig struct {
// Specify whether you want Amazon Route 53 to measure the latency between health
// checkers in multiple AWS regions and your endpoint, and to display CloudWatch
- // latency graphs on the Health Checks page in the Amazon Route 53 console.
+ // latency graphs on the Health Checks page in the Route 53 console.
//
// You can't change the value of MeasureLatency after you create a health check.
MeasureLatency *bool `type:"boolean"`
@@ -9961,18 +10213,18 @@ type HealthCheckConfig struct {
// A complex type that contains one Region element for each region from which
// you want Amazon Route 53 health checkers to check the specified endpoint.
//
- // If you don't specify any regions, Amazon Route 53 health checkers automatically
+ // If you don't specify any regions, Route 53 health checkers automatically
// performs checks from all of the regions that are listed under Valid Values.
//
// If you update a health check to remove a region that has been performing
- // health checks, Amazon Route 53 will briefly continue to perform checks from
- // that region to ensure that some health checkers are always checking the endpoint
+ // health checks, Route 53 will briefly continue to perform checks from that
+ // region to ensure that some health checkers are always checking the endpoint
// (for example, if you replace three regions with four different regions).
Regions []*string `locationNameList:"Region" min:"3" type:"list"`
// The number of seconds between the time that Amazon Route 53 gets a response
// from your endpoint and the time that it sends the next health check request.
- // Each Amazon Route 53 health checker makes requests at this interval.
+ // Each Route 53 health checker makes requests at this interval.
//
// You can't change the value of RequestInterval after you create a health check.
//
@@ -9983,16 +10235,16 @@ type HealthCheckConfig struct {
// The path, if any, that you want Amazon Route 53 to request when performing
// health checks. The path can be any value for which your endpoint will return
// an HTTP status code of 2xx or 3xx when the endpoint is healthy, for example,
- // the file /docs/route53-health-check.html.
+ // the file /docs/route53-health-check.html. You can also include query string
+ // parameters, for example, /welcome.html?language=jp&login=y.
ResourcePath *string `type:"string"`
// If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that
// you want Amazon Route 53 to search for in the response body from the specified
- // resource. If the string appears in the response body, Amazon Route 53 considers
+ // resource. If the string appears in the response body, Route 53 considers
// the resource healthy.
//
- // Amazon Route 53 considers case when searching for SearchString in the response
- // body.
+ // Route 53 considers case when searching for SearchString in the response body.
SearchString *string `type:"string"`
// The type of health check that you want to create, which indicates how Amazon
@@ -10002,28 +10254,24 @@ type HealthCheckConfig struct {
//
// You can create the following types of health checks:
//
- // * HTTP: Amazon Route 53 tries to establish a TCP connection. If successful,
- // Amazon Route 53 submits an HTTP request and waits for an HTTP status code
- // of 200 or greater and less than 400.
+ // * HTTP: Route 53 tries to establish a TCP connection. If successful, Route
+ // 53 submits an HTTP request and waits for an HTTP status code of 200 or
+ // greater and less than 400.
//
- // * HTTPS: Amazon Route 53 tries to establish a TCP connection. If successful,
- // Amazon Route 53 submits an HTTPS request and waits for an HTTP status
- // code of 200 or greater and less than 400.
+ // * HTTPS: Route 53 tries to establish a TCP connection. If successful,
+ // Route 53 submits an HTTPS request and waits for an HTTP status code of
+ // 200 or greater and less than 400. If you specify HTTPS for the value of
+ // Type, the endpoint must support TLS v1.0 or later.
//
- // If you specify HTTPS for the value of Type, the endpoint must support TLS
- // v1.0 or later.
+ // * HTTP_STR_MATCH: Route 53 tries to establish a TCP connection. If successful,
+ // Route 53 submits an HTTP request and searches the first 5,120 bytes of
+ // the response body for the string that you specify in SearchString.
//
- // * HTTP_STR_MATCH: Amazon Route 53 tries to establish a TCP connection.
- // If successful, Amazon Route 53 submits an HTTP request and searches the
- // first 5,120 bytes of the response body for the string that you specify
- // in SearchString.
+ // * HTTPS_STR_MATCH: Route 53 tries to establish a TCP connection. If successful,
+ // Route 53 submits an HTTPS request and searches the first 5,120 bytes of
+ // the response body for the string that you specify in SearchString.
//
- // * HTTPS_STR_MATCH: Amazon Route 53 tries to establish a TCP connection.
- // If successful, Amazon Route 53 submits an HTTPS request and searches the
- // first 5,120 bytes of the response body for the string that you specify
- // in SearchString.
- //
- // * TCP: Amazon Route 53 tries to establish a TCP connection.
+ // * TCP: Route 53 tries to establish a TCP connection.
//
// * CLOUDWATCH_METRIC: The health check is associated with a CloudWatch
// alarm. If the state of the alarm is OK, the health check is considered
@@ -10033,12 +10281,12 @@ type HealthCheckConfig struct {
// Healthy, Unhealthy, or LastKnownStatus.
//
// * CALCULATED: For health checks that monitor the status of other health
- // checks, Amazon Route 53 adds up the number of health checks that Amazon
- // Route 53 health checkers consider to be healthy and compares that number
- // with the value of HealthThreshold.
+ // checks, Route 53 adds up the number of health checks that Route 53 health
+ // checkers consider to be healthy and compares that number with the value
+ // of HealthThreshold.
//
- // For more information, see How Amazon Route 53 Determines Whether an Endpoint
- // Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html)
+ // For more information, see How Route 53 Determines Whether an Endpoint Is
+ // Healthy (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html)
// in the Amazon Route 53 Developer Guide.
//
// Type is a required field
@@ -10097,6 +10345,12 @@ func (s *HealthCheckConfig) SetChildHealthChecks(v []*string) *HealthCheckConfig
return s
}
+// SetDisabled sets the Disabled field's value.
+func (s *HealthCheckConfig) SetDisabled(v bool) *HealthCheckConfig {
+ s.Disabled = &v
+ return s
+}
+
// SetEnableSNI sets the EnableSNI field's value.
func (s *HealthCheckConfig) SetEnableSNI(v bool) *HealthCheckConfig {
s.EnableSNI = &v
@@ -10250,14 +10504,15 @@ type HostedZone struct {
// If the hosted zone was created by another service, the service that created
// the hosted zone. When a hosted zone is created by another service, you can't
- // edit or delete it using Amazon Route 53.
+ // edit or delete it using Route 53.
LinkedService *LinkedService `type:"structure"`
// The name of the domain. For public hosted zones, this is the name that you
// have registered with your DNS registrar.
//
// For information about how to specify characters other than a-z, 0-9, and
- // - (hyphen) and how to specify internationalized domain names, see CreateHostedZone.
+ // - (hyphen) and how to specify internationalized domain names, see CreateHostedZone
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateHostedZone.html).
//
// Name is a required field
Name *string `type:"string" required:"true"`
@@ -10438,39 +10693,39 @@ type ListGeoLocationsInput struct {
_ struct{} `type:"structure"`
// (Optional) The maximum number of geolocations to be included in the response
- // body for this request. If more than MaxItems geolocations remain to be listed,
+ // body for this request. If more than maxitems geolocations remain to be listed,
// then the value of the IsTruncated element in the response is true.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
// The code for the continent with which you want to start listing locations
- // that Amazon Route 53 supports for geolocation. If Amazon Route 53 has already
- // returned a page or more of results, if IsTruncated is true, and if NextContinentCode
- // from the previous response has a value, enter that value in StartContinentCode
+ // that Amazon Route 53 supports for geolocation. If Route 53 has already returned
+ // a page or more of results, if IsTruncated is true, and if NextContinentCode
+ // from the previous response has a value, enter that value in startcontinentcode
// to return the next page of results.
//
- // Include StartContinentCode only if you want to list continents. Don't include
- // StartContinentCode when you're listing countries or countries with their
+ // Include startcontinentcode only if you want to list continents. Don't include
+ // startcontinentcode when you're listing countries or countries with their
// subdivisions.
StartContinentCode *string `location:"querystring" locationName:"startcontinentcode" min:"2" type:"string"`
// The code for the country with which you want to start listing locations that
- // Amazon Route 53 supports for geolocation. If Amazon Route 53 has already
- // returned a page or more of results, if IsTruncated is true, and if NextCountryCode
- // from the previous response has a value, enter that value in StartCountryCode
+ // Amazon Route 53 supports for geolocation. If Route 53 has already returned
+ // a page or more of results, if IsTruncated is true, and if NextCountryCode
+ // from the previous response has a value, enter that value in startcountrycode
// to return the next page of results.
//
- // Amazon Route 53 uses the two-letter country codes that are specified in ISO
- // standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
+ // Route 53 uses the two-letter country codes that are specified in ISO standard
+ // 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
StartCountryCode *string `location:"querystring" locationName:"startcountrycode" min:"1" type:"string"`
// The code for the subdivision (for example, state or province) with which
// you want to start listing locations that Amazon Route 53 supports for geolocation.
- // If Amazon Route 53 has already returned a page or more of results, if IsTruncated
+ // If Route 53 has already returned a page or more of results, if IsTruncated
// is true, and if NextSubdivisionCode from the previous response has a value,
- // enter that value in StartSubdivisionCode to return the next page of results.
+ // enter that value in startsubdivisioncode to return the next page of results.
//
- // To list subdivisions of a country, you must include both StartCountryCode
- // and StartSubdivisionCode.
+ // To list subdivisions of a country, you must include both startcountrycode
+ // and startsubdivisioncode.
StartSubdivisionCode *string `location:"querystring" locationName:"startsubdivisioncode" min:"1" type:"string"`
}
@@ -10540,8 +10795,8 @@ type ListGeoLocationsOutput struct {
// A value that indicates whether more locations remain to be listed after the
// last location in this response. If so, the value of IsTruncated is true.
// To get more values, submit another request and include the values of NextContinentCode,
- // NextCountryCode, and NextSubdivisionCode in the StartContinentCode, StartCountryCode,
- // and StartSubdivisionCode, as applicable.
+ // NextCountryCode, and NextSubdivisionCode in the startcontinentcode, startcountrycode,
+ // and startsubdivisioncode, as applicable.
//
// IsTruncated is a required field
IsTruncated *bool `type:"boolean" required:"true"`
@@ -10552,17 +10807,17 @@ type ListGeoLocationsOutput struct {
MaxItems *string `type:"string" required:"true"`
// If IsTruncated is true, you can make a follow-up request to display more
- // locations. Enter the value of NextContinentCode in the StartContinentCode
+ // locations. Enter the value of NextContinentCode in the startcontinentcode
// parameter in another ListGeoLocations request.
NextContinentCode *string `min:"2" type:"string"`
// If IsTruncated is true, you can make a follow-up request to display more
- // locations. Enter the value of NextCountryCode in the StartCountryCode parameter
+ // locations. Enter the value of NextCountryCode in the startcountrycode parameter
// in another ListGeoLocations request.
NextCountryCode *string `min:"1" type:"string"`
// If IsTruncated is true, you can make a follow-up request to display more
- // locations. Enter the value of NextSubdivisionCode in the StartSubdivisionCode
+ // locations. Enter the value of NextSubdivisionCode in the startsubdivisioncode
// parameter in another ListGeoLocations request.
NextSubdivisionCode *string `min:"1" type:"string"`
}
@@ -10631,8 +10886,8 @@ type ListHealthChecksInput struct {
// The maximum number of health checks that you want ListHealthChecks to return
// in response to the current request. Amazon Route 53 returns a maximum of
- // 100 items. If you set MaxItems to a value greater than 100, Amazon Route
- // 53 returns only the first 100 health checks.
+ // 100 items. If you set MaxItems to a value greater than 100, Route 53 returns
+ // only the first 100 health checks.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
}
@@ -10920,7 +11175,7 @@ type ListHostedZonesInput struct {
// (Optional) The maximum number of hosted zones that you want Amazon Route
// 53 to return. If you have more than maxitems hosted zones, the value of IsTruncated
// in the response is true, and the value of NextMarker is the hosted zone ID
- // of the first hosted zone that Amazon Route 53 will return if you submit another
+ // of the first hosted zone that Route 53 will return if you submit another
// request.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
}
@@ -11042,11 +11297,11 @@ type ListQueryLoggingConfigsInput struct {
// (Optional) The maximum number of query logging configurations that you want
// Amazon Route 53 to return in response to the current request. If the current
- // AWS account has more than MaxResults configurations, use the value of ListQueryLoggingConfigsResponse$NextToken
+ // AWS account has more than MaxResults configurations, use the value of NextToken
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html#API_ListQueryLoggingConfigs_RequestSyntax)
// in the response to get the next page of results.
//
- // If you don't specify a value for MaxResults, Amazon Route 53 returns up to
- // 100 configurations.
+ // If you don't specify a value for MaxResults, Route 53 returns up to 100 configurations.
MaxResults *string `location:"querystring" locationName:"maxresults" type:"string"`
// (Optional) If the current AWS account has more than MaxResults query logging
@@ -11095,13 +11350,14 @@ type ListQueryLoggingConfigsOutput struct {
// the response.
//
// If a response doesn't include the last of the configurations, you can get
- // more configurations by submitting another ListQueryLoggingConfigs request.
- // Get the value of NextToken that Amazon Route 53 returned in the previous
- // response and include it in NextToken in the next request.
+ // more configurations by submitting another ListQueryLoggingConfigs (https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListQueryLoggingConfigs.html)
+ // request. Get the value of NextToken that Amazon Route 53 returned in the
+ // previous response and include it in NextToken in the next request.
NextToken *string `type:"string"`
- // An array that contains one QueryLoggingConfig element for each configuration
- // for DNS query logging that is associated with the current AWS account.
+ // An array that contains one QueryLoggingConfig (https://docs.aws.amazon.com/Route53/latest/APIReference/API_QueryLoggingConfig.html)
+ // element for each configuration for DNS query logging that is associated with
+ // the current AWS account.
//
// QueryLoggingConfigs is a required field
QueryLoggingConfigs []*QueryLoggingConfig `locationNameList:"QueryLoggingConfig" type:"list" required:"true"`
@@ -11148,10 +11404,10 @@ type ListResourceRecordSetsInput struct {
// of maxitems resource record sets.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
- // Weighted resource record sets only: If results were truncated for a given
- // DNS name and type, specify the value of NextRecordIdentifier from the previous
- // response to get the next resource record set that has the current DNS name
- // and type.
+ // Resource record sets that have a routing policy other than simple: If results
+ // were truncated for a given DNS name and type, specify the value of NextRecordIdentifier
+ // from the previous response to get the next resource record set that has the
+ // current DNS name and type.
StartRecordIdentifier *string `location:"querystring" locationName:"identifier" min:"1" type:"string"`
// The first name in the lexicographic ordering of resource record sets that
@@ -11163,19 +11419,23 @@ type ListResourceRecordSetsInput struct {
// Valid values for basic resource record sets: A | AAAA | CAA | CNAME | MX
// | NAPTR | NS | PTR | SOA | SPF | SRV | TXT
//
- // Values for weighted, latency, geo, and failover resource record sets: A |
- // AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT
+ // Values for weighted, latency, geolocation, and failover resource record sets:
+ // A | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT
//
// Values for alias resource record sets:
//
+ // * API Gateway custom regional API or edge-optimized API: A
+ //
// * CloudFront distribution: A or AAAA
//
// * Elastic Beanstalk environment that has a regionalized subdomain: A
//
- // * ELB load balancer: A | AAAA
+ // * Elastic Load Balancing load balancer: A | AAAA
//
// * Amazon S3 bucket: A
//
+ // * Amazon VPC interface VPC endpoint: A
+ //
// * Another resource record set in this hosted zone: The type of the resource
// record set that the alias references.
//
@@ -11200,6 +11460,9 @@ func (s *ListResourceRecordSetsInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if s.StartRecordIdentifier != nil && len(*s.StartRecordIdentifier) < 1 {
invalidParams.Add(request.NewErrParamMinLen("StartRecordIdentifier", 1))
}
@@ -11256,9 +11519,12 @@ type ListResourceRecordSetsOutput struct {
// MaxItems is a required field
MaxItems *string `type:"string" required:"true"`
- // Weighted, latency, geolocation, and failover resource record sets only: If
- // results were truncated for a given DNS name and type, the value of SetIdentifier
+ // Resource record sets that have a routing policy other than simple: If results
+ // were truncated for a given DNS name and type, the value of SetIdentifier
// for the next resource record set that has the current DNS name and type.
+ //
+ // For information about routing policies, see Choosing a Routing Policy (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html)
+ // in the Amazon Route 53 Developer Guide.
NextRecordIdentifier *string `min:"1" type:"string"`
// If the results were truncated, the name of the next record in the list.
@@ -11342,7 +11608,7 @@ type ListReusableDelegationSetsInput struct {
// The number of reusable delegation sets that you want Amazon Route 53 to return
// in the response to this request. If you specify a value greater than 100,
- // Amazon Route 53 returns only the first 100 reusable delegation sets.
+ // Route 53 returns only the first 100 reusable delegation sets.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
}
@@ -11480,9 +11746,15 @@ func (s *ListTagsForResourceInput) Validate() error {
if s.ResourceId == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceId"))
}
+ if s.ResourceId != nil && len(*s.ResourceId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1))
+ }
if s.ResourceType == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceType"))
}
+ if s.ResourceType != nil && len(*s.ResourceType) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -11572,6 +11844,9 @@ func (s *ListTagsForResourcesInput) Validate() error {
if s.ResourceType == nil {
invalidParams.Add(request.NewErrParamRequired("ResourceType"))
}
+ if s.ResourceType != nil && len(*s.ResourceType) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -11626,7 +11901,7 @@ type ListTrafficPoliciesInput struct {
// 53 to return in response to this request. If you have more than MaxItems
// traffic policies, the value of IsTruncated in the response is true, and the
// value of TrafficPolicyIdMarker is the ID of the first traffic policy that
- // Amazon Route 53 will return if you submit another request.
+ // Route 53 will return if you submit another request.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
// (Conditional) For your first request to ListTrafficPolicies, don't include
@@ -12207,8 +12482,8 @@ type ListTrafficPolicyInstancesOutput struct {
_ struct{} `type:"structure"`
// If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of
- // the first traffic policy instance that Amazon Route 53 will return if you
- // submit another ListTrafficPolicyInstances request.
+ // the first traffic policy instance that Route 53 will return if you submit
+ // another ListTrafficPolicyInstances request.
HostedZoneIdMarker *string `type:"string"`
// A flag that indicates whether there are more traffic policy instances to
@@ -12227,8 +12502,8 @@ type ListTrafficPolicyInstancesOutput struct {
MaxItems *string `type:"string" required:"true"`
// If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the
- // first traffic policy instance that Amazon Route 53 will return if you submit
- // another ListTrafficPolicyInstances request.
+ // first traffic policy instance that Route 53 will return if you submit another
+ // ListTrafficPolicyInstances request.
TrafficPolicyInstanceNameMarker *string `type:"string"`
// If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of
@@ -12305,8 +12580,7 @@ type ListTrafficPolicyVersionsInput struct {
// 53 to include in the response body for this request. If the specified traffic
// policy has more than MaxItems versions, the value of IsTruncated in the response
// is true, and the value of the TrafficPolicyVersionMarker element is the ID
- // of the first version that Amazon Route 53 will return if you submit another
- // request.
+ // of the first version that Route 53 will return if you submit another request.
MaxItems *string `location:"querystring" locationName:"maxitems" type:"string"`
// For your first request to ListTrafficPolicyVersions, don't include the TrafficPolicyVersionMarker
@@ -12445,8 +12719,8 @@ type ListVPCAssociationAuthorizationsInput struct {
HostedZoneId *string `location:"uri" locationName:"Id" type:"string" required:"true"`
// Optional: An integer that specifies the maximum number of VPCs that you want
- // Amazon Route 53 to return. If you don't specify a value for MaxResults, Amazon
- // Route 53 returns up to 50 VPCs per page.
+ // Amazon Route 53 to return. If you don't specify a value for MaxResults, Route
+ // 53 returns up to 50 VPCs per page.
MaxResults *string `location:"querystring" locationName:"maxresults" type:"string"`
// Optional: If a response includes a NextToken element, there are more VPCs
@@ -12473,6 +12747,9 @@ func (s *ListVPCAssociationAuthorizationsInput) Validate() error {
if s.HostedZoneId == nil {
invalidParams.Add(request.NewErrParamRequired("HostedZoneId"))
}
+ if s.HostedZoneId != nil && len(*s.HostedZoneId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HostedZoneId", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -12608,7 +12885,7 @@ type ResourceRecord struct {
// The current or new DNS record value, not to exceed 4,000 characters. In the
// case of a DELETE action, if the current value does not match the actual value,
// an error is returned. For descriptions about how to format Value for different
- // record types, see Supported DNS Resource Record Types (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html)
+ // record types, see Supported DNS Resource Record Types (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html)
// in the Amazon Route 53 Developer Guide.
//
// You can specify more than one value for all record types except CNAME and
@@ -12653,16 +12930,15 @@ func (s *ResourceRecord) SetValue(v string) *ResourceRecord {
type ResourceRecordSet struct {
_ struct{} `type:"structure"`
- // Alias resource record sets only: Information about the CloudFront distribution,
- // AWS Elastic Beanstalk environment, ELB load balancer, Amazon S3 bucket, or
- // Amazon Route 53 resource record set to which you're redirecting queries.
- // The AWS Elastic Beanstalk environment must have a regionalized subdomain.
+ // Alias resource record sets only: Information about the AWS resource, such
+ // as a CloudFront distribution or an Amazon S3 bucket, that you want to route
+ // traffic to.
//
// If you're creating resource records sets for a private hosted zone, note
// the following:
//
- // * You can't create alias resource record sets for CloudFront distributions
- // in a private hosted zone.
+ // * You can't create an alias resource record set in a private hosted zone
+ // to route traffic to a CloudFront distribution.
//
// * Creating geolocation alias resource record sets or latency alias resource
// record sets in a private hosted zone is unsupported.
@@ -12682,23 +12958,22 @@ type ResourceRecordSet struct {
// Except where noted, the following failover behaviors assume that you have
// included the HealthCheckId element in both resource record sets:
//
- // * When the primary resource record set is healthy, Amazon Route 53 responds
- // to DNS queries with the applicable value from the primary resource record
+ // * When the primary resource record set is healthy, Route 53 responds to
+ // DNS queries with the applicable value from the primary resource record
// set regardless of the health of the secondary resource record set.
//
// * When the primary resource record set is unhealthy and the secondary
- // resource record set is healthy, Amazon Route 53 responds to DNS queries
- // with the applicable value from the secondary resource record set.
+ // resource record set is healthy, Route 53 responds to DNS queries with
+ // the applicable value from the secondary resource record set.
//
- // * When the secondary resource record set is unhealthy, Amazon Route 53
- // responds to DNS queries with the applicable value from the primary resource
- // record set regardless of the health of the primary resource record set.
+ // * When the secondary resource record set is unhealthy, Route 53 responds
+ // to DNS queries with the applicable value from the primary resource record
+ // set regardless of the health of the primary resource record set.
//
// * If you omit the HealthCheckId element for the secondary resource record
- // set, and if the primary resource record set is unhealthy, Amazon Route
- // 53 always responds to DNS queries with the applicable value from the secondary
- // resource record set. This is true regardless of the health of the associated
- // endpoint.
+ // set, and if the primary resource record set is unhealthy, Route 53 always
+ // responds to DNS queries with the applicable value from the secondary resource
+ // record set. This is true regardless of the health of the associated endpoint.
//
// You can't create non-failover resource record sets that have the same values
// for the Name and Type elements as failover resource record sets.
@@ -12706,15 +12981,15 @@ type ResourceRecordSet struct {
// For failover alias resource record sets, you must also include the EvaluateTargetHealth
// element and set the value to true.
//
- // For more information about configuring failover for Amazon Route 53, see
- // the following topics in the Amazon Route 53 Developer Guide:
+ // For more information about configuring failover for Route 53, see the following
+ // topics in the Amazon Route 53 Developer Guide:
//
- // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html)
+ // * Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html)
//
// * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html)
Failover *string `type:"string" enum:"ResourceRecordSetFailover"`
- // Geo location resource record sets only: A complex type that lets you control
+ // Geolocation resource record sets only: A complex type that lets you control
// how Amazon Route 53 responds to DNS queries based on the geographic origin
// of the query. For example, if you want all queries from Africa to be routed
// to a web server with an IP address of 192.0.2.111, create a resource record
@@ -12738,24 +13013,24 @@ type ResourceRecordSet struct {
//
// Geolocation works by mapping IP addresses to locations. However, some IP
// addresses aren't mapped to geographic locations, so even if you create geolocation
- // resource record sets that cover all seven continents, Amazon Route 53 will
- // receive some DNS queries from locations that it can't identify. We recommend
- // that you create a resource record set for which the value of CountryCode
- // is *, which handles both queries that come from locations for which you haven't
+ // resource record sets that cover all seven continents, Route 53 will receive
+ // some DNS queries from locations that it can't identify. We recommend that
+ // you create a resource record set for which the value of CountryCode is *,
+ // which handles both queries that come from locations for which you haven't
// created geolocation resource record sets and queries from IP addresses that
// aren't mapped to a location. If you don't create a * resource record set,
- // Amazon Route 53 returns a "no answer" response for queries from those locations.
+ // Route 53 returns a "no answer" response for queries from those locations.
//
// You can't create non-geolocation resource record sets that have the same
// values for the Name and Type elements as geolocation resource record sets.
GeoLocation *GeoLocation `type:"structure"`
// If you want Amazon Route 53 to return this resource record set in response
- // to a DNS query only when a health check is passing, include the HealthCheckId
- // element and specify the ID of the applicable health check.
+ // to a DNS query only when the status of a health check is healthy, include
+ // the HealthCheckId element and specify the ID of the applicable health check.
//
- // Amazon Route 53 determines whether a resource record set is healthy based
- // on one of the following:
+ // Route 53 determines whether a resource record set is healthy based on one
+ // of the following:
//
// * By periodically sending a request to the endpoint that is specified
// in the health check
@@ -12766,61 +13041,88 @@ type ResourceRecordSet struct {
// * By determining the current state of a CloudWatch alarm (CloudWatch metric
// health checks)
//
- // For more information, see How Amazon Route 53 Determines Whether an Endpoint
- // Is Healthy (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html).
- //
- // The HealthCheckId element is only useful when Amazon Route 53 is choosing
- // between two or more resource record sets to respond to a DNS query, and you
- // want Amazon Route 53 to base the choice in part on the status of a health
- // check. Configuring health checks only makes sense in the following configurations:
- //
- // * You're checking the health of the resource record sets in a group of
- // weighted, latency, geolocation, or failover resource record sets, and
- // you specify health check IDs for all of the resource record sets. If the
- // health check for one resource record set specifies an endpoint that is
- // not healthy, Amazon Route 53 stops responding to queries using the value
- // for that resource record set.
- //
- // * You set EvaluateTargetHealth to true for the resource record sets in
- // a group of alias, weighted alias, latency alias, geolocation alias, or
- // failover alias resource record sets, and you specify health check IDs
- // for all of the resource record sets that are referenced by the alias resource
- // record sets.
- //
- // Amazon Route 53 doesn't check the health of the endpoint specified in the
+ // Route 53 doesn't check the health of the endpoint that is specified in the
// resource record set, for example, the endpoint specified by the IP address
// in the Value element. When you add a HealthCheckId element to a resource
- // record set, Amazon Route 53 checks the health of the endpoint that you specified
+ // record set, Route 53 checks the health of the endpoint that you specified
// in the health check.
//
- // For geolocation resource record sets, if an endpoint is unhealthy, Amazon
- // Route 53 looks for a resource record set for the larger, associated geographic
+ // For more information, see the following topics in the Amazon Route 53 Developer
+ // Guide:
+ //
+ // * How Amazon Route 53 Determines Whether an Endpoint Is Healthy (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html)
+ //
+ // * Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html)
+ //
+ // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html)
+ //
+ // When to Specify HealthCheckId
+ //
+ // Specifying a value for HealthCheckId is useful only when Route 53 is choosing
+ // between two or more resource record sets to respond to a DNS query, and you
+ // want Route 53 to base the choice in part on the status of a health check.
+ // Configuring health checks makes sense only in the following configurations:
+ //
+ // * Non-alias resource record sets: You're checking the health of a group
+ // of non-alias resource record sets that have the same routing policy, name,
+ // and type (such as multiple weighted records named www.example.com with
+ // a type of A) and you specify health check IDs for all the resource record
+ // sets. If the health check status for a resource record set is healthy,
+ // Route 53 includes the record among the records that it responds to DNS
+ // queries with. If the health check status for a resource record set is
+ // unhealthy, Route 53 stops responding to DNS queries using the value for
+ // that resource record set. If the health check status for all resource
+ // record sets in the group is unhealthy, Route 53 considers all resource
+ // record sets in the group healthy and responds to DNS queries accordingly.
+ //
+ // * Alias resource record sets: You specify the following settings: You
+ // set EvaluateTargetHealth to true for an alias resource record set in a
+ // group of resource record sets that have the same routing policy, name,
+ // and type (such as multiple weighted records named www.example.com with
+ // a type of A). You configure the alias resource record set to route traffic
+ // to a non-alias resource record set in the same hosted zone. You specify
+ // a health check ID for the non-alias resource record set. If the health
+ // check status is healthy, Route 53 considers the alias resource record
+ // set to be healthy and includes the alias record among the records that
+ // it responds to DNS queries with. If the health check status is unhealthy,
+ // Route 53 stops responding to DNS queries using the alias resource record
+ // set. The alias resource record set can also route traffic to a group of
+ // non-alias resource record sets that have the same routing policy, name,
+ // and type. In that configuration, associate health checks with all of the
+ // resource record sets in the group of non-alias resource record sets.
+ //
+ // Geolocation Routing
+ //
+ // For geolocation resource record sets, if an endpoint is unhealthy, Route
+ // 53 looks for a resource record set for the larger, associated geographic
// region. For example, suppose you have resource record sets for a state in
- // the United States, for the United States, for North America, and for all
+ // the United States, for the entire United States, for North America, and a
+ // resource record set that has * for CountryCode is *, which applies to all
// locations. If the endpoint for the state resource record set is unhealthy,
- // Amazon Route 53 checks the resource record sets for the United States, for
- // North America, and for all locations (a resource record set for which the
- // value of CountryCode is *), in that order, until it finds a resource record
- // set for which the endpoint is healthy.
+ // Route 53 checks for healthy resource record sets in the following order until
+ // it finds a resource record set for which the endpoint is healthy:
+ //
+ // * The United States
+ //
+ // * North America
+ //
+ // * The default resource record set
+ //
+ // Specifying the Health Check Endpoint by Domain Name
//
// If your health checks specify the endpoint only by domain name, we recommend
// that you create a separate health check for each endpoint. For example, create
// a health check for each HTTP server that is serving content for www.example.com.
// For the value of FullyQualifiedDomainName, specify the domain name of the
// server (such as us-east-2-www.example.com), not the name of the resource
- // record sets (example.com).
+ // record sets (www.example.com).
//
- // n this configuration, if you create a health check for which the value of
- // FullyQualifiedDomainName matches the name of the resource record sets and
- // then associate the health check with those resource record sets, health check
- // results will be unpredictable.
+ // Health check results will be unpredictable if you do the following:
//
- // For more information, see the following topics in the Amazon Route 53 Developer
- // Guide:
+ // * Create a health check that has the same value for FullyQualifiedDomainName
+ // as the name of a resource record set.
//
- // * Amazon Route 53 Health Checks and DNS Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html)
- //
- // * Configuring Failover in a Private Hosted Zone (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-private-hosted-zones.html)
+ // * Associate that health check with the resource record set.
HealthCheckId *string `type:"string"`
// Multivalue answer resource record sets only: To route traffic approximately
@@ -12833,17 +13135,17 @@ type ResourceRecordSet struct {
// address only when the health check is healthy.
//
// * If you don't associate a health check with a multivalue answer record,
- // Amazon Route 53 always considers the record to be healthy.
+ // Route 53 always considers the record to be healthy.
//
- // * Amazon Route 53 responds to DNS queries with up to eight healthy records;
- // if you have eight or fewer healthy records, Amazon Route 53 responds to
- // all DNS queries with all the healthy records.
+ // * Route 53 responds to DNS queries with up to eight healthy records; if
+ // you have eight or fewer healthy records, Route 53 responds to all DNS
+ // queries with all the healthy records.
//
- // * If you have more than eight healthy records, Amazon Route 53 responds
- // to different DNS resolvers with different combinations of healthy records.
+ // * If you have more than eight healthy records, Route 53 responds to different
+ // DNS resolvers with different combinations of healthy records.
//
- // * When all records are unhealthy, Amazon Route 53 responds to DNS queries
- // with up to eight unhealthy records.
+ // * When all records are unhealthy, Route 53 responds to DNS queries with
+ // up to eight unhealthy records.
//
// * If a resource becomes unavailable after a resolver caches a response,
// client software typically tries another of the IP addresses in the response.
@@ -12851,13 +13153,17 @@ type ResourceRecordSet struct {
// You can't create multivalue answer alias records.
MultiValueAnswer *bool `type:"boolean"`
- // The name of the domain you want to perform the action on.
+ // For ChangeResourceRecordSets requests, the name of the record that you want
+ // to create, update, or delete. For ListResourceRecordSets responses, the name
+ // of a record in the specified hosted zone.
+ //
+ // ChangeResourceRecordSets Only
//
// Enter a fully qualified domain name, for example, www.example.com. You can
// optionally include a trailing dot. If you omit the trailing dot, Amazon Route
- // 53 still assumes that the domain name that you specify is fully qualified.
- // This means that Amazon Route 53 treats www.example.com (without a trailing
- // dot) and www.example.com. (with a trailing dot) as identical.
+ // 53 assumes that the domain name that you specify is fully qualified. This
+ // means that Route 53 treats www.example.com (without a trailing dot) and www.example.com.
+ // (with a trailing dot) as identical.
//
// For information about how to specify characters other than a-z, 0-9, and
// - (hyphen) and how to specify internationalized domain names, see DNS Domain
@@ -12874,9 +13180,8 @@ type ResourceRecordSet struct {
//
// * If you include * in any position other than the leftmost label in a
// domain name, DNS treats it as an * character (ASCII 42), not as a wildcard.
- //
- // You can't use the * wildcard for resource records sets that have a type of
- // NS.
+ // You can't use the * wildcard for resource records sets that have a type
+ // of NS.
//
// You can use the * wildcard as the leftmost label in a domain name, for example,
// *.example.com. You can't use an * for one of the middle labels, for example,
@@ -12896,10 +13201,10 @@ type ResourceRecordSet struct {
// zones is not supported.
//
// When Amazon Route 53 receives a DNS query for a domain name and type for
- // which you have created latency resource record sets, Amazon Route 53 selects
- // the latency resource record set that has the lowest latency between the end
- // user and the associated Amazon EC2 Region. Amazon Route 53 then returns the
- // value that is associated with the selected resource record set.
+ // which you have created latency resource record sets, Route 53 selects the
+ // latency resource record set that has the lowest latency between the end user
+ // and the associated Amazon EC2 Region. Route 53 then returns the value that
+ // is associated with the selected resource record set.
//
// Note the following:
//
@@ -12910,8 +13215,8 @@ type ResourceRecordSet struct {
// EC2 Region.
//
// * You aren't required to create latency resource record sets for all Amazon
- // EC2 Regions. Amazon Route 53 will choose the region with the best latency
- // from among the regions that you create latency resource record sets for.
+ // EC2 Regions. Route 53 will choose the region with the best latency from
+ // among the regions that you create latency resource record sets for.
//
// * You can't create non-latency resource record sets that have the same
// values for the Name and Type elements as latency resource record sets.
@@ -12922,11 +13227,15 @@ type ResourceRecordSet struct {
// If you're creating an alias resource record set, omit ResourceRecords.
ResourceRecords []*ResourceRecord `locationNameList:"ResourceRecord" min:"1" type:"list"`
- // Weighted, Latency, Geo, and Failover resource record sets only: An identifier
+ // Resource record sets that have a routing policy other than simple: An identifier
// that differentiates among multiple resource record sets that have the same
- // combination of DNS name and type. The value of SetIdentifier must be unique
- // for each resource record set that has the same combination of DNS name and
- // type. Omit SetIdentifier for any other types of record sets.
+ // combination of name and type, such as multiple weighted resource record sets
+ // named acme.example.com that have a type of A. In a group of resource record
+ // sets that have the same name and type, the value of SetIdentifier must be
+ // unique for each resource record set.
+ //
+ // For information about routing policies, see Choosing a Routing Policy (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html)
+ // in the Amazon Route 53 Developer Guide.
SetIdentifier *string `min:"1" type:"string"`
// The resource record cache time to live (TTL), in seconds. Note the following:
@@ -12952,14 +13261,14 @@ type ResourceRecordSet struct {
// When you create a traffic policy instance, Amazon Route 53 automatically
// creates a resource record set. TrafficPolicyInstanceId is the ID of the traffic
- // policy instance that Amazon Route 53 created this resource record set for.
+ // policy instance that Route 53 created this resource record set for.
//
// To delete the resource record set that is associated with a traffic policy
- // instance, use DeleteTrafficPolicyInstance. Amazon Route 53 will delete the
- // resource record set automatically. If you delete the resource record set
- // by using ChangeResourceRecordSets, Amazon Route 53 doesn't automatically
- // delete the traffic policy instance, and you'll continue to be charged for
- // it even though it's no longer in use.
+ // instance, use DeleteTrafficPolicyInstance. Route 53 will delete the resource
+ // record set automatically. If you delete the resource record set by using
+ // ChangeResourceRecordSets, Route 53 doesn't automatically delete the traffic
+ // policy instance, and you'll continue to be charged for it even though it's
+ // no longer in use.
TrafficPolicyInstanceId *string `min:"1" type:"string"`
// The DNS record type. For information about different record types and how
@@ -12988,22 +13297,29 @@ type ResourceRecordSet struct {
//
// Values for alias resource record sets:
//
- // * CloudFront distributions:A
+ // * Amazon API Gateway custom regional APIs and edge-optimized APIs: A
//
- // If IPv6 is enabled for the distribution, create two resource record sets
- // to route traffic to your distribution, one with a value of A and one with
- // a value of AAAA.
+ // * CloudFront distributions: A If IPv6 is enabled for the distribution,
+ // create two resource record sets to route traffic to your distribution,
+ // one with a value of A and one with a value of AAAA.
//
// * AWS Elastic Beanstalk environment that has a regionalized subdomain:
// A
//
- // * ELB load balancers:A | AAAA
+ // * ELB load balancers: A | AAAA
//
- // * Amazon S3 buckets:A
+ // * Amazon S3 buckets: A
+ //
+ // * Amazon Virtual Private Cloud interface VPC endpoints A
//
// * Another resource record set in this hosted zone: Specify the type of
// the resource record set that you're creating the alias for. All values
- // are supported except NS and SOA.
+ // are supported except NS and SOA. If you're creating an alias record that
+ // has the same name as the hosted zone (known as the zone apex), you can't
+ // route traffic to a record for which the value of Type is CNAME. This is
+ // because the alias record must have the same type as the record you're
+ // routing traffic to, and creating a CNAME record for the zone apex isn't
+ // supported even for an alias record.
//
// Type is a required field
Type *string `type:"string" required:"true" enum:"RRType"`
@@ -13011,10 +13327,10 @@ type ResourceRecordSet struct {
// Weighted resource record sets only: Among resource record sets that have
// the same combination of DNS name and type, a value that determines the proportion
// of DNS queries that Amazon Route 53 responds to using the current resource
- // record set. Amazon Route 53 calculates the sum of the weights for the resource
- // record sets that have the same combination of DNS name and type. Amazon Route
- // 53 then responds to queries based on the ratio of a resource's weight to
- // the total. Note the following:
+ // record set. Route 53 calculates the sum of the weights for the resource record
+ // sets that have the same combination of DNS name and type. Route 53 then responds
+ // to queries based on the ratio of a resource's weight to the total. Note the
+ // following:
//
// * You must specify a value for the Weight element for every weighted resource
// record set.
@@ -13030,16 +13346,13 @@ type ResourceRecordSet struct {
// the same values for the Name and Type elements.
//
// * For weighted (but not weighted alias) resource record sets, if you set
- // Weight to 0 for a resource record set, Amazon Route 53 never responds
- // to queries with the applicable value for that resource record set. However,
- // if you set Weight to 0 for all resource record sets that have the same
- // combination of DNS name and type, traffic is routed to all resources with
- // equal probability.
- //
- // The effect of setting Weight to 0 is different when you associate health
+ // Weight to 0 for a resource record set, Route 53 never responds to queries
+ // with the applicable value for that resource record set. However, if you
+ // set Weight to 0 for all resource record sets that have the same combination
+ // of DNS name and type, traffic is routed to all resources with equal probability.
+ // The effect of setting Weight to 0 is different when you associate health
// checks with weighted resource record sets. For more information, see Options
- // for Configuring Amazon Route 53 Active-Active and Active-Passive Failover
- // (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html)
+ // for Configuring Route 53 Active-Active and Active-Passive Failover (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-configuring-options.html)
// in the Amazon Route 53 Developer Guide.
Weight *int64 `type:"long"`
}
@@ -13275,7 +13588,7 @@ type StatusReport struct {
// 8601 format (https://en.wikipedia.org/wiki/ISO_8601) and Coordinated Universal
// Time (UTC). For example, the value 2017-03-27T17:48:16.751Z represents March
// 27, 2017 at 17:48:16.751 UTC.
- CheckedTime *time.Time `type:"timestamp" timestampFormat:"iso8601"`
+ CheckedTime *time.Time `type:"timestamp"`
// A description of the status of the health check endpoint as reported by one
// of the Amazon Route 53 health checkers.
@@ -13317,7 +13630,7 @@ type Tag struct {
// * Edit a tag: Key is the name of the tag that you want to change the Value
// for.
//
- // * Delete a key: Key is the name of the tag you want to remove.
+ // * Delete a key: Key is the name of the tag you want to remove.
//
// * Give a name to a health check: Edit the default Name tag. In the Amazon
// Route 53 console, the list of your health checks includes a Name column
@@ -13372,6 +13685,13 @@ type TestDNSAnswerInput struct {
// and 24 for edns0clientsubnetmask, the checking tool will simulate a request
// from 192.0.2.0/24. The default value is 24 bits for IPv4 addresses and 64
// bits for IPv6 addresses.
+ //
+ // The range of valid values depends on whether edns0clientsubnetip is an IPv4
+ // or an IPv6 address:
+ //
+ // * IPv4: Specify a value between 0 and 32
+ //
+ // * IPv6: Specify a value between 0 and 128
EDNS0ClientSubnetMask *string `location:"querystring" locationName:"edns0clientsubnetmask" type:"string"`
// The ID of the hosted zone that you want Amazon Route 53 to simulate a query
@@ -13559,7 +13879,7 @@ type TrafficPolicy struct {
// The definition of a traffic policy in JSON format. You specify the JSON document
// to use for a new traffic policy in the CreateTrafficPolicy request. For more
- // information about the JSON format, see Traffic Policy Document Format (http://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
+ // information about the JSON format, see Traffic Policy Document Format (https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html).
//
// Document is a required field
Document *string `type:"string" required:"true"`
@@ -13664,15 +13984,21 @@ type TrafficPolicyInstance struct {
// The value of State is one of the following values:
//
- // AppliedAmazon Route 53 has finished creating resource record sets, and changes
- // have propagated to all Amazon Route 53 edge locations.
+ // Applied
//
- // CreatingAmazon Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
+ // Amazon Route 53 has finished creating resource record sets, and changes have
+ // propagated to all Route 53 edge locations.
+ //
+ // Creating
+ //
+ // Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance
// to confirm that the CreateTrafficPolicyInstance request completed successfully.
//
- // FailedAmazon Route 53 wasn't able to create or update the resource record
- // sets. When the value of State is Failed, see Message for an explanation of
- // what caused the request to fail.
+ // Failed
+ //
+ // Route 53 wasn't able to create or update the resource record sets. When the
+ // value of State is Failed, see Message for an explanation of what caused the
+ // request to fail.
//
// State is a required field
State *string `type:"string" required:"true"`
@@ -13845,14 +14171,35 @@ type UpdateHealthCheckInput struct {
_ struct{} `locationName:"UpdateHealthCheckRequest" type:"structure" xmlURI:"https://route53.amazonaws.com/doc/2013-04-01/"`
// A complex type that identifies the CloudWatch alarm that you want Amazon
- // Route 53 health checkers to use to determine whether this health check is
- // healthy.
+ // Route 53 health checkers to use to determine whether the specified health
+ // check is healthy.
AlarmIdentifier *AlarmIdentifier `type:"structure"`
// A complex type that contains one ChildHealthCheck element for each health
// check that you want to associate with a CALCULATED health check.
ChildHealthChecks []*string `locationNameList:"ChildHealthCheck" type:"list"`
+ // Stops Route 53 from performing health checks. When you disable a health check,
+ // here's what happens:
+ //
+ // * Health checks that check the health of endpoints: Route 53 stops submitting
+ // requests to your application, server, or other resource.
+ //
+ // * Calculated health checks: Route 53 stops aggregating the status of the
+ // referenced health checks.
+ //
+ // * Health checks that monitor CloudWatch alarms: Route 53 stops monitoring
+ // the corresponding CloudWatch metrics.
+ //
+ // After you disable a health check, Route 53 considers the status of the health
+ // check to always be healthy. If you configured DNS failover, Route 53 continues
+ // to route traffic to the corresponding resources. If you want to stop routing
+ // traffic to a resource, change the value of Inverted (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-Inverted).
+ //
+ // Charges for a health check still apply when the health check is disabled.
+ // For more information, see Amazon Route 53 Pricing (http://aws.amazon.com/route53/pricing/).
+ Disabled *bool `type:"boolean"`
+
// Specify whether you want Amazon Route 53 to send the value of FullyQualifiedDomainName
// to the endpoint in the client_hello message during TLS negotiation. This
// allows the endpoint to respond to HTTPS health check requests with the applicable
@@ -13891,44 +14238,42 @@ type UpdateHealthCheckInput struct {
// However, you can't update an existing health check to add or remove the value
// of IPAddress.
//
- // If you specify a value forIPAddress:
+ // If you specify a value for IPAddress:
//
- // Amazon Route 53 sends health check requests to the specified IPv4 or IPv6
- // address and passes the value of FullyQualifiedDomainName in the Host header
- // for all health checks except TCP health checks. This is typically the fully
- // qualified DNS name of the endpoint on which you want Amazon Route 53 to perform
- // health checks.
+ // Route 53 sends health check requests to the specified IPv4 or IPv6 address
+ // and passes the value of FullyQualifiedDomainName in the Host header for all
+ // health checks except TCP health checks. This is typically the fully qualified
+ // DNS name of the endpoint on which you want Route 53 to perform health checks.
//
- // When Amazon Route 53 checks the health of an endpoint, here is how it constructs
+ // When Route 53 checks the health of an endpoint, here is how it constructs
// the Host header:
//
// * If you specify a value of 80 for Port and HTTP or HTTP_STR_MATCH for
- // Type, Amazon Route 53 passes the value of FullyQualifiedDomainName to
- // the endpoint in the Host header.
+ // Type, Route 53 passes the value of FullyQualifiedDomainName to the endpoint
+ // in the Host header.
//
// * If you specify a value of 443 for Port and HTTPS or HTTPS_STR_MATCH
- // for Type, Amazon Route 53 passes the value of FullyQualifiedDomainName
- // to the endpoint in the Host header.
+ // for Type, Route 53 passes the value of FullyQualifiedDomainName to the
+ // endpoint in the Host header.
//
// * If you specify another value for Port and any value except TCP for Type,
- // Amazon Route 53 passes FullyQualifiedDomainName:Port to the endpoint in
- // the Host header.
+ // Route 53 passes FullyQualifiedDomainName:Port to the endpoint in the Host
+ // header.
//
- // If you don't specify a value for FullyQualifiedDomainName, Amazon Route 53
- // substitutes the value of IPAddress in the Host header in each of the above
- // cases.
+ // If you don't specify a value for FullyQualifiedDomainName, Route 53 substitutes
+ // the value of IPAddress in the Host header in each of the above cases.
//
- // If you don't specify a value forIPAddress:
+ // If you don't specify a value for IPAddress:
//
- // If you don't specify a value for IPAddress, Amazon Route 53 sends a DNS request
+ // If you don't specify a value for IPAddress, Route 53 sends a DNS request
// to the domain that you specify in FullyQualifiedDomainName at the interval
// you specify in RequestInterval. Using an IPv4 address that is returned by
- // DNS, Amazon Route 53 then checks the health of the endpoint.
+ // DNS, Route 53 then checks the health of the endpoint.
//
- // If you don't specify a value for IPAddress, Amazon Route 53 uses only IPv4
- // to send health checks to the endpoint. If there's no resource record set
- // with a type of A for the name that you specify for FullyQualifiedDomainName,
- // the health check fails with a "DNS resolution failed" error.
+ // If you don't specify a value for IPAddress, Route 53 uses only IPv4 to send
+ // health checks to the endpoint. If there's no resource record set with a type
+ // of A for the name that you specify for FullyQualifiedDomainName, the health
+ // check fails with a "DNS resolution failed" error.
//
// If you want to check the health of weighted, latency, or failover resource
// record sets and you choose to specify the endpoint only by FullyQualifiedDomainName,
@@ -13943,9 +14288,9 @@ type UpdateHealthCheckInput struct {
// with those resource record sets, health check results will be unpredictable.
//
// In addition, if the value of Type is HTTP, HTTPS, HTTP_STR_MATCH, or HTTPS_STR_MATCH,
- // Amazon Route 53 passes the value of FullyQualifiedDomainName in the Host
- // header, as it does when you specify a value for IPAddress. If the value of
- // Type is TCP, Amazon Route 53 doesn't pass a Host header.
+ // Route 53 passes the value of FullyQualifiedDomainName in the Host header,
+ // as it does when you specify a value for IPAddress. If the value of Type is
+ // TCP, Route 53 doesn't pass a Host header.
FullyQualifiedDomainName *string `type:"string"`
// The ID for the health check for which you want detailed information. When
@@ -13961,15 +14306,14 @@ type UpdateHealthCheckInput struct {
// We recommend that you use GetHealthCheck or ListHealthChecks to get the current
// value of HealthCheckVersion for the health check that you want to update,
// and that you include that value in your UpdateHealthCheck request. This prevents
- // Amazon Route 53 from overwriting an intervening update:
+ // Route 53 from overwriting an intervening update:
//
// * If the value in the UpdateHealthCheck request matches the value of HealthCheckVersion
- // in the health check, Amazon Route 53 updates the health check with the
- // new settings.
+ // in the health check, Route 53 updates the health check with the new settings.
//
// * If the value of HealthCheckVersion in the health check is greater, the
- // health check was changed after you got the version number. Amazon Route
- // 53 does not update the health check, and it returns a HealthCheckVersionMismatch
+ // health check was changed after you got the version number. Route 53 does
+ // not update the health check, and it returns a HealthCheckVersionMismatch
// error.
HealthCheckVersion *int64 `min:"1" type:"long"`
@@ -13982,18 +14326,18 @@ type UpdateHealthCheckInput struct {
// Note the following:
//
// * If you specify a number greater than the number of child health checks,
- // Amazon Route 53 always considers this health check to be unhealthy.
+ // Route 53 always considers this health check to be unhealthy.
//
- // * If you specify 0, Amazon Route 53 always considers this health check
- // to be healthy.
+ // * If you specify 0, Route 53 always considers this health check to be
+ // healthy.
HealthThreshold *int64 `type:"integer"`
// The IPv4 or IPv6 IP address for the endpoint that you want Amazon Route 53
// to perform health checks on. If you don't specify a value for IPAddress,
- // Amazon Route 53 sends a DNS request to resolve the domain name that you specify
+ // Route 53 sends a DNS request to resolve the domain name that you specify
// in FullyQualifiedDomainName at the interval that you specify in RequestInterval.
- // Using an IP address that is returned by DNS, Amazon Route 53 then checks
- // the health of the endpoint.
+ // Using an IP address that is returned by DNS, Route 53 then checks the health
+ // of the endpoint.
//
// Use one of the following formats for the value of IPAddress:
//
@@ -14010,21 +14354,21 @@ type UpdateHealthCheckInput struct {
// IP address for IPAddress. This ensures that the IP address of your instance
// never changes. For more information, see the applicable documentation:
//
- // * Linux: Elastic IP Addresses (EIP) (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
+ // * Linux: Elastic IP Addresses (EIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html)
// in the Amazon EC2 User Guide for Linux Instances
//
- // * Windows: Elastic IP Addresses (EIP) (http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-ip-addresses-eip.html)
+ // * Windows: Elastic IP Addresses (EIP) (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-ip-addresses-eip.html)
// in the Amazon EC2 User Guide for Windows Instances
//
// If a health check already has a value for IPAddress, you can change the value.
// However, you can't update an existing health check to add or remove the value
// of IPAddress.
//
- // For more information, see UpdateHealthCheckRequest$FullyQualifiedDomainName.
+ // For more information, see FullyQualifiedDomainName (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName).
//
- // Constraints: Amazon Route 53 can't check the health of endpoints for which
- // the IP address is in local, private, non-routable, or multicast ranges. For
- // more information about IP addresses for which you can't create health checks,
+ // Constraints: Route 53 can't check the health of endpoints for which the IP
+ // address is in local, private, non-routable, or multicast ranges. For more
+ // information about IP addresses for which you can't create health checks,
// see the following documents:
//
// * RFC 5735, Special Use IPv4 Addresses (https://tools.ietf.org/html/rfc5735)
@@ -14037,14 +14381,14 @@ type UpdateHealthCheckInput struct {
// When CloudWatch has insufficient data about the metric to determine the alarm
// state, the status that you want Amazon Route 53 to assign to the health check:
//
- // * Healthy: Amazon Route 53 considers the health check to be healthy.
+ // * Healthy: Route 53 considers the health check to be healthy.
//
- // * Unhealthy: Amazon Route 53 considers the health check to be unhealthy.
+ // * Unhealthy: Route 53 considers the health check to be unhealthy.
//
- // * LastKnownStatus: Amazon Route 53 uses the status of the health check
- // from the last time CloudWatch had sufficient data to determine the alarm
- // state. For new health checks that have no last known status, the default
- // status for the health check is healthy.
+ // * LastKnownStatus: Route 53 uses the status of the health check from the
+ // last time CloudWatch had sufficient data to determine the alarm state.
+ // For new health checks that have no last known status, the default status
+ // for the health check is healthy.
InsufficientDataHealthStatus *string `type:"string" enum:"InsufficientDataHealthStatus"`
// Specify whether you want Amazon Route 53 to invert the status of a health
@@ -14064,30 +14408,31 @@ type UpdateHealthCheckInput struct {
// that you want to reset to the default value. Valid values for ResettableElementName
// include the following:
//
- // * ChildHealthChecks: Amazon Route 53 resets HealthCheckConfig$ChildHealthChecks
+ // * ChildHealthChecks: Amazon Route 53 resets ChildHealthChecks (https://docs.aws.amazon.com/Route53/latest/APIReference/API_HealthCheckConfig.html#Route53-Type-HealthCheckConfig-ChildHealthChecks)
// to null.
//
- // * FullyQualifiedDomainName: Amazon Route 53 resets HealthCheckConfig$FullyQualifiedDomainName
+ // * FullyQualifiedDomainName: Route 53 resets FullyQualifiedDomainName (https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName).
// to null.
//
- // * Regions: Amazon Route 53 resets the HealthCheckConfig$Regions list to
- // the default set of regions.
+ // * Regions: Route 53 resets the Regions (https://docs.aws.amazon.com/Route53/latest/APIReference/API_HealthCheckConfig.html#Route53-Type-HealthCheckConfig-Regions)
+ // list to the default set of regions.
//
- // * ResourcePath: Amazon Route 53 resets HealthCheckConfig$ResourcePath
+ // * ResourcePath: Route 53 resets ResourcePath (https://docs.aws.amazon.com/Route53/latest/APIReference/API_HealthCheckConfig.html#Route53-Type-HealthCheckConfig-ResourcePath)
// to null.
ResetElements []*string `locationNameList:"ResettableElementName" type:"list"`
// The path that you want Amazon Route 53 to request when performing health
// checks. The path can be any value for which your endpoint will return an
// HTTP status code of 2xx or 3xx when the endpoint is healthy, for example
- // the file /docs/route53-health-check.html.
+ // the file /docs/route53-health-check.html. You can also include query string
+ // parameters, for example, /welcome.html?language=jp&login=y.
//
// Specify this value only if you want to change it.
ResourcePath *string `type:"string"`
// If the value of Type is HTTP_STR_MATCH or HTTP_STR_MATCH, the string that
// you want Amazon Route 53 to search for in the response body from the specified
- // resource. If the string appears in the response body, Amazon Route 53 considers
+ // resource. If the string appears in the response body, Route 53 considers
// the resource healthy. (You can't change the value of Type when you update
// a health check.)
SearchString *string `type:"string"`
@@ -14112,6 +14457,9 @@ func (s *UpdateHealthCheckInput) Validate() error {
if s.HealthCheckId == nil {
invalidParams.Add(request.NewErrParamRequired("HealthCheckId"))
}
+ if s.HealthCheckId != nil && len(*s.HealthCheckId) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("HealthCheckId", 1))
+ }
if s.HealthCheckVersion != nil && *s.HealthCheckVersion < 1 {
invalidParams.Add(request.NewErrParamMinValue("HealthCheckVersion", 1))
}
@@ -14145,6 +14493,12 @@ func (s *UpdateHealthCheckInput) SetChildHealthChecks(v []*string) *UpdateHealth
return s
}
+// SetDisabled sets the Disabled field's value.
+func (s *UpdateHealthCheckInput) SetDisabled(v bool) *UpdateHealthCheckInput {
+ s.Disabled = &v
+ return s
+}
+
// SetEnableSNI sets the EnableSNI field's value.
func (s *UpdateHealthCheckInput) SetEnableSNI(v bool) *UpdateHealthCheckInput {
s.EnableSNI = &v
@@ -14229,11 +14583,11 @@ func (s *UpdateHealthCheckInput) SetSearchString(v string) *UpdateHealthCheckInp
return s
}
+// A complex type that contains the response to the UpdateHealthCheck request.
type UpdateHealthCheckOutput struct {
_ struct{} `type:"structure"`
- // A complex type that contains information about one health check that is associated
- // with the current AWS account.
+ // A complex type that contains the response to an UpdateHealthCheck request.
//
// HealthCheck is a required field
HealthCheck *HealthCheck `type:"structure" required:"true"`
@@ -14285,6 +14639,9 @@ func (s *UpdateHostedZoneCommentInput) Validate() error {
if s.Id == nil {
invalidParams.Add(request.NewErrParamRequired("Id"))
}
+ if s.Id != nil && len(*s.Id) < 1 {
+ invalidParams.Add(request.NewErrParamMinLen("Id", 1))
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -14309,7 +14666,8 @@ func (s *UpdateHostedZoneCommentInput) SetId(v string) *UpdateHostedZoneCommentI
type UpdateHostedZoneCommentOutput struct {
_ struct{} `type:"structure"`
- // A complex type that contains general information about the hosted zone.
+ // A complex type that contains the response to the UpdateHostedZoneComment
+ // request.
//
// HostedZone is a required field
HostedZone *HostedZone `type:"structure" required:"true"`
@@ -14562,7 +14920,7 @@ type VPC struct {
// (Private hosted zones only) The ID of an Amazon VPC.
VPCId *string `type:"string"`
- // (Private hosted zones only) The region in which you created an Amazon VPC.
+ // (Private hosted zones only) The region that an Amazon VPC was created in.
VPCRegion *string `min:"1" type:"string" enum:"VPCRegion"`
}
@@ -14665,6 +15023,12 @@ const (
// CloudWatchRegionEuWest3 is a CloudWatchRegion enum value
CloudWatchRegionEuWest3 = "eu-west-3"
+ // CloudWatchRegionApEast1 is a CloudWatchRegion enum value
+ CloudWatchRegionApEast1 = "ap-east-1"
+
+ // CloudWatchRegionMeSouth1 is a CloudWatchRegion enum value
+ CloudWatchRegionMeSouth1 = "me-south-1"
+
// CloudWatchRegionApSouth1 is a CloudWatchRegion enum value
CloudWatchRegionApSouth1 = "ap-south-1"
@@ -14683,8 +15047,17 @@ const (
// CloudWatchRegionApNortheast3 is a CloudWatchRegion enum value
CloudWatchRegionApNortheast3 = "ap-northeast-3"
+ // CloudWatchRegionEuNorth1 is a CloudWatchRegion enum value
+ CloudWatchRegionEuNorth1 = "eu-north-1"
+
// CloudWatchRegionSaEast1 is a CloudWatchRegion enum value
CloudWatchRegionSaEast1 = "sa-east-1"
+
+ // CloudWatchRegionCnNorthwest1 is a CloudWatchRegion enum value
+ CloudWatchRegionCnNorthwest1 = "cn-northwest-1"
+
+ // CloudWatchRegionCnNorth1 is a CloudWatchRegion enum value
+ CloudWatchRegionCnNorth1 = "cn-north-1"
)
const (
@@ -14872,6 +15245,9 @@ const (
// ResourceRecordSetRegionApNortheast3 is a ResourceRecordSetRegion enum value
ResourceRecordSetRegionApNortheast3 = "ap-northeast-3"
+ // ResourceRecordSetRegionEuNorth1 is a ResourceRecordSetRegion enum value
+ ResourceRecordSetRegionEuNorth1 = "eu-north-1"
+
// ResourceRecordSetRegionSaEast1 is a ResourceRecordSetRegion enum value
ResourceRecordSetRegionSaEast1 = "sa-east-1"
@@ -14881,6 +15257,12 @@ const (
// ResourceRecordSetRegionCnNorthwest1 is a ResourceRecordSetRegion enum value
ResourceRecordSetRegionCnNorthwest1 = "cn-northwest-1"
+ // ResourceRecordSetRegionApEast1 is a ResourceRecordSetRegion enum value
+ ResourceRecordSetRegionApEast1 = "ap-east-1"
+
+ // ResourceRecordSetRegionMeSouth1 is a ResourceRecordSetRegion enum value
+ ResourceRecordSetRegionMeSouth1 = "me-south-1"
+
// ResourceRecordSetRegionApSouth1 is a ResourceRecordSetRegion enum value
ResourceRecordSetRegionApSouth1 = "ap-south-1"
)
@@ -14940,6 +15322,12 @@ const (
// VPCRegionEuCentral1 is a VPCRegion enum value
VPCRegionEuCentral1 = "eu-central-1"
+ // VPCRegionApEast1 is a VPCRegion enum value
+ VPCRegionApEast1 = "ap-east-1"
+
+ // VPCRegionMeSouth1 is a VPCRegion enum value
+ VPCRegionMeSouth1 = "me-south-1"
+
// VPCRegionApSoutheast1 is a VPCRegion enum value
VPCRegionApSoutheast1 = "ap-southeast-1"
@@ -14958,6 +15346,9 @@ const (
// VPCRegionApNortheast3 is a VPCRegion enum value
VPCRegionApNortheast3 = "ap-northeast-3"
+ // VPCRegionEuNorth1 is a VPCRegion enum value
+ VPCRegionEuNorth1 = "eu-north-1"
+
// VPCRegionSaEast1 is a VPCRegion enum value
VPCRegionSaEast1 = "sa-east-1"
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go
index efe2d6e7c..7aca8722e 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/customizations.go
@@ -33,7 +33,7 @@ func sanitizeURL(r *request.Request) {
// Update Path so that it reflects the cleaned RawPath
updated, err := url.Parse(r.HTTPRequest.URL.RawPath)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to clean Route53 URL", err)
+ r.Error = awserr.New(request.ErrCodeSerialization, "failed to clean Route53 URL", err)
return
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go b/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go
index 7965fea67..386f616db 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/doc.go
@@ -3,6 +3,9 @@
// Package route53 provides the client and types for making API
// requests to Amazon Route 53.
//
+// Amazon Route 53 is a highly available and scalable Domain Name System (DNS)
+// web service.
+//
// See https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01 for more information on this service.
//
// See route53 package documentation for more information.
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go
index d37e10cde..ce86bd613 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/errors.go
@@ -23,7 +23,7 @@ const (
// the same name as an existing hosted zone or that's the parent or child
// of an existing hosted zone, and you specified a delegation set that shares
// one or more name servers with the existing hosted zone. For more information,
- // see CreateReusableDelegationSet.
+ // see CreateReusableDelegationSet (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateReusableDelegationSet.html).
//
// * Private hosted zone: You specified an Amazon VPC that you're already
// using for another hosted zone, and the domain that you specified for one
@@ -66,8 +66,8 @@ const (
// You can create a hosted zone that has the same name as an existing hosted
// zone (example.com is common), but there is a limit to the number of hosted
// zones that have the same name. If you get this error, Amazon Route 53 has
- // reached that limit. If you own the domain name and Amazon Route 53 generates
- // this error, contact Customer Support.
+ // reached that limit. If you own the domain name and Route 53 generates this
+ // error, contact Customer Support.
ErrCodeDelegationSetNotAvailable = "DelegationSetNotAvailable"
// ErrCodeDelegationSetNotReusable for service response error code
@@ -212,8 +212,9 @@ const (
// reached the limit on reusable delegation sets that it can create or because
// you've reached the limit on the number of Amazon VPCs that you can associate
// with a private hosted zone. To get the current limit on the number of reusable
- // delegation sets, see GetAccountLimit. To get the current limit on the number
- // of Amazon VPCs that you can associate with a private hosted zone, see GetHostedZoneLimit.
+ // delegation sets, see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
+ // To get the current limit on the number of Amazon VPCs that you can associate
+ // with a private hosted zone, see GetHostedZoneLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetHostedZoneLimit.html).
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
ErrCodeLimitsExceeded = "LimitsExceeded"
@@ -239,14 +240,13 @@ const (
// ErrCodeNoSuchGeoLocation for service response error code
// "NoSuchGeoLocation".
//
- // Amazon Route 53 doesn't support the specified geolocation.
+ // Amazon Route 53 doesn't support the specified geographic location.
ErrCodeNoSuchGeoLocation = "NoSuchGeoLocation"
// ErrCodeNoSuchHealthCheck for service response error code
// "NoSuchHealthCheck".
//
- // No health check exists with the ID that you specified in the DeleteHealthCheck
- // request.
+ // No health check exists with the specified ID.
ErrCodeNoSuchHealthCheck = "NoSuchHealthCheck"
// ErrCodeNoSuchHostedZone for service response error code
@@ -285,8 +285,8 @@ const (
//
// If Amazon Route 53 can't process a request before the next request arrives,
// it will reject subsequent requests for the same hosted zone and return an
- // HTTP 400 error (Bad request). If Amazon Route 53 returns this error repeatedly
- // for the same request, we recommend that you wait, in intervals of increasing
+ // HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for
+ // the same request, we recommend that you wait, in intervals of increasing
// duration, before you try the request again.
ErrCodePriorRequestNotComplete = "PriorRequestNotComplete"
@@ -316,10 +316,11 @@ const (
// This health check can't be created because the current account has reached
// the limit on the number of active health checks.
//
- // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+ // For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
- // For information about how to get the current limit for an account, see GetAccountLimit.
+ // For information about how to get the current limit for an account, see GetAccountLimit
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
//
@@ -336,14 +337,14 @@ const (
// the limit on the number of hosted zones that can be associated with a reusable
// delegation set.
//
- // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+ // For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
// To get the current limit on hosted zones that can be created by an account,
- // see GetAccountLimit.
+ // see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To get the current limit on hosted zones that can be associated with a reusable
- // delegation set, see GetReusableDelegationSetLimit.
+ // delegation set, see GetReusableDelegationSetLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetReusableDelegationSetLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -355,10 +356,10 @@ const (
// This traffic policy can't be created because the current account has reached
// the limit on the number of traffic policies.
//
- // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+ // For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
- // To get the current limit for an account, see GetAccountLimit.
+ // To get the current limit for an account, see GetAccountLimit (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -370,10 +371,11 @@ const (
// This traffic policy instance can't be created because the current account
// has reached the limit on the number of traffic policy instances.
//
- // For information about default limits, see Limits (http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
+ // For information about default limits, see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
// in the Amazon Route 53 Developer Guide.
//
- // For information about how to get the current limit for an account, see GetAccountLimit.
+ // For information about how to get the current limit for an account, see GetAccountLimit
+ // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetAccountLimit.html).
//
// To request a higher limit, create a case (http://aws.amazon.com/route53-request)
// with the AWS Support Center.
@@ -386,10 +388,10 @@ const (
// of 1000 on the number of versions that you can create for the current traffic
// policy.
//
- // To create more traffic policy versions, you can use GetTrafficPolicy to get
- // the traffic policy document for a specified traffic policy version, and then
- // use CreateTrafficPolicy to create a new traffic policy using the traffic
- // policy document.
+ // To create more traffic policy versions, you can use GetTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetTrafficPolicy.html)
+ // to get the traffic policy document for a specified traffic policy version,
+ // and then use CreateTrafficPolicy (https://docs.aws.amazon.com/Route53/latest/APIReference/API_CreateTrafficPolicy.html)
+ // to create a new traffic policy using the traffic policy document.
ErrCodeTooManyTrafficPolicyVersionsForCurrentPolicy = "TooManyTrafficPolicyVersionsForCurrentPolicy"
// ErrCodeTooManyVPCAssociationAuthorizations for service response error code
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go
index 98ba1c8f8..dd22cb2cd 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "route53" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "route53" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "Route 53" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the Route53 client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go
index 266e9a8ba..b3b95a126 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/route53/unmarshal_error.go
@@ -1,77 +1,106 @@
package route53
import (
- "bytes"
"encoding/xml"
- "io/ioutil"
+ "fmt"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/private/protocol/restxml"
+ "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
)
-type baseXMLErrorResponse struct {
- XMLName xml.Name
-}
+const errorRespTag = "ErrorResponse"
+const invalidChangeTag = "InvalidChangeBatch"
type standardXMLErrorResponse struct {
- XMLName xml.Name `xml:"ErrorResponse"`
- Code string `xml:"Error>Code"`
- Message string `xml:"Error>Message"`
- RequestID string `xml:"RequestId"`
+ Code string `xml:"Error>Code"`
+ Message string `xml:"Error>Message"`
+ RequestID string `xml:"RequestId"`
+}
+
+func (e standardXMLErrorResponse) FillCommon(c *xmlErrorResponse) {
+ c.Code = e.Code
+ c.Message = e.Message
+ c.RequestID = e.RequestID
}
type invalidChangeBatchXMLErrorResponse struct {
- XMLName xml.Name `xml:"InvalidChangeBatch"`
- Messages []string `xml:"Messages>Message"`
+ Messages []string `xml:"Messages>Message"`
+ RequestID string `xml:"RequestId"`
+}
+
+func (e invalidChangeBatchXMLErrorResponse) FillCommon(c *xmlErrorResponse) {
+ c.Code = invalidChangeTag
+ c.Message = "ChangeBatch errors occurred"
+ c.Messages = e.Messages
+ c.RequestID = e.RequestID
+}
+
+type xmlErrorResponse struct {
+ Code string
+ Message string
+ Messages []string
+ RequestID string
+}
+
+func (e *xmlErrorResponse) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
+ type commonFiller interface {
+ FillCommon(*xmlErrorResponse)
+ }
+
+ var errResp commonFiller
+ switch start.Name.Local {
+ case errorRespTag:
+ errResp = &standardXMLErrorResponse{}
+
+ case invalidChangeTag:
+ errResp = &invalidChangeBatchXMLErrorResponse{}
+
+ default:
+ return fmt.Errorf("unknown error message, %v", start.Name.Local)
+ }
+
+ if err := d.DecodeElement(errResp, &start); err != nil {
+ return err
+ }
+
+ errResp.FillCommon(e)
+ return nil
}
func unmarshalChangeResourceRecordSetsError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
- responseBody, err := ioutil.ReadAll(r.HTTPResponse.Body)
-
+ var errResp xmlErrorResponse
+ err := xmlutil.UnmarshalXMLError(&errResp, r.HTTPResponse.Body)
if err != nil {
- r.Error = awserr.New("SerializationError", "failed to read Route53 XML error response", err)
+ r.Error = awserr.NewRequestFailure(
+ awserr.New(request.ErrCodeSerialization,
+ "failed to unmarshal error message", err),
+ r.HTTPResponse.StatusCode,
+ r.RequestID,
+ )
return
}
- baseError := &baseXMLErrorResponse{}
-
- if err := xml.Unmarshal(responseBody, baseError); err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode Route53 XML error response", err)
- return
+ var baseErr awserr.Error
+ if len(errResp.Messages) != 0 {
+ var errs []error
+ for _, msg := range errResp.Messages {
+ errs = append(errs, awserr.New(invalidChangeTag, msg, nil))
+ }
+ baseErr = awserr.NewBatchError(errResp.Code, errResp.Message, errs)
+ } else {
+ baseErr = awserr.New(errResp.Code, errResp.Message, nil)
}
- switch baseError.XMLName.Local {
- case "InvalidChangeBatch":
- unmarshalInvalidChangeBatchError(r, responseBody)
- default:
- r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewReader(responseBody))
- restxml.UnmarshalError(r)
+ reqID := errResp.RequestID
+ if len(reqID) == 0 {
+ reqID = r.RequestID
}
-}
-
-func unmarshalInvalidChangeBatchError(r *request.Request, requestBody []byte) {
- resp := &invalidChangeBatchXMLErrorResponse{}
- err := xml.Unmarshal(requestBody, resp)
-
- if err != nil {
- r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err)
- return
- }
-
- const errorCode = "InvalidChangeBatch"
- errors := []error{}
-
- for _, msg := range resp.Messages {
- errors = append(errors, awserr.New(errorCode, msg, nil))
- }
-
r.Error = awserr.NewRequestFailure(
- awserr.NewBatchError(errorCode, "ChangeBatch errors occurred", errors),
+ baseErr,
r.HTTPResponse.StatusCode,
- r.RequestID,
+ reqID,
)
-
}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
index b46da12ca..eb0a6a417 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go
@@ -3,10 +3,12 @@
package sts
import (
+ "fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
+ "github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
)
@@ -15,7 +17,7 @@ const opAssumeRole = "AssumeRole"
// AssumeRoleRequest generates a "aws/request.Request" representing the
// client's request for the AssumeRole operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -54,38 +56,26 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
// AssumeRole API operation for AWS Security Token Service.
//
-// Returns a set of temporary security credentials (consisting of an access
-// key ID, a secret access key, and a security token) that you can use to access
-// AWS resources that you might not normally have access to. Typically, you
-// use AssumeRole for cross-account access or federation. For a comparison of
-// AssumeRole with the other APIs that produce temporary credentials, see Requesting
-// Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
-// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
+// Returns a set of temporary security credentials that you can use to access
+// AWS resources that you might not normally have access to. These temporary
+// credentials consist of an access key ID, a secret access key, and a security
+// token. Typically, you use AssumeRole within your account or for cross-account
+// access. For a comparison of AssumeRole with other API operations that produce
+// temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
-// Important: You cannot call AssumeRole by using AWS root account credentials;
-// access is denied. You must use credentials for an IAM user or an IAM role
-// to call AssumeRole.
+// You cannot use AWS account root user credentials to call AssumeRole. You
+// must use credentials for an IAM user or an IAM role to call AssumeRole.
//
// For cross-account access, imagine that you own multiple accounts and need
// to access resources in each account. You could create long-term credentials
// in each account to access those resources. However, managing all those credentials
// and remembering which one can access which account can be time consuming.
-// Instead, you can create one set of long-term credentials in one account and
-// then use temporary security credentials to access all the other accounts
+// Instead, you can create one set of long-term credentials in one account.
+// Then use temporary security credentials to access all the other accounts
// by assuming roles in those accounts. For more information about roles, see
-// IAM Roles (Delegation and Federation) (http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html)
-// in the IAM User Guide.
-//
-// For federation, you can, for example, grant single sign-on access to the
-// AWS Management Console. If you already have an identity and authentication
-// system in your corporate network, you don't have to recreate user identities
-// in AWS in order to grant those user identities access to AWS. Instead, after
-// a user has been authenticated, you call AssumeRole (and specify the role
-// with the appropriate permissions) to get temporary security credentials for
-// that user. With those temporary security credentials, you construct a sign-in
-// URL that users can use to access the console. For more information, see Common
-// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction)
+// IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)
// in the IAM User Guide.
//
// By default, the temporary security credentials created by AssumeRole last
@@ -94,69 +84,73 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
// seconds (15 minutes) up to the maximum session duration setting for the role.
// This setting can have a value from 1 hour to 12 hours. To learn how to view
// the maximum value for your role, see View the Maximum Session Duration Setting
-// for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. The maximum session duration limit applies when you
-// use the AssumeRole* API operations or the assume-role* CLI operations but
-// does not apply when you use those operations to create a console URL. For
-// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
+// use the AssumeRole* API operations or the assume-role* CLI commands. However
+// the limit does not apply when you use those operations to create a console
+// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
// in the IAM User Guide.
//
// The temporary security credentials created by AssumeRole can be used to make
-// API calls to any AWS service with the following exception: you cannot call
-// the STS service's GetFederationToken or GetSessionToken APIs.
+// API calls to any AWS service with the following exception: You cannot call
+// the AWS STS GetFederationToken or GetSessionToken API operations.
//
-// Optionally, you can pass an IAM access policy to this operation. If you choose
-// not to pass a policy, the temporary security credentials that are returned
-// by the operation have the permissions that are defined in the access policy
-// of the role that is being assumed. If you pass a policy to this operation,
-// the temporary security credentials that are returned by the operation have
-// the permissions that are allowed by both the access policy of the role that
-// is being assumed, and the policy that you pass. This gives you a way to further
-// restrict the permissions for the resulting temporary security credentials.
-// You cannot use the passed policy to grant permissions that are in excess
-// of those allowed by the access policy of the role that is being assumed.
-// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,
-// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+// to this operation. You can pass a single JSON policy document to use as an
+// inline session policy. You can also specify up to 10 managed policies to
+// use as managed session policies. The plain text that you use for both inline
+// and managed session policies shouldn't exceed 2048 characters. Passing policies
+// to this operation returns new temporary credentials. The resulting session's
+// permissions are the intersection of the role's identity-based policy and
+// the session policies. You can use the role's temporary credentials in subsequent
+// AWS API calls to access resources in the account that owns the role. You
+// cannot use session policies to grant more permissions than those allowed
+// by the identity-based policy of the role that is being assumed. For more
+// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
-// To assume a role, your AWS account must be trusted by the role. The trust
-// relationship is defined in the role's trust policy when the role is created.
-// That trust policy states which accounts are allowed to delegate access to
-// this account's role.
+// To assume a role from a different account, your AWS account must be trusted
+// by the role. The trust relationship is defined in the role's trust policy
+// when the role is created. That trust policy states which accounts are allowed
+// to delegate that access to users in the account.
//
-// The user who wants to access the role must also have permissions delegated
-// from the role's administrator. If the user is in a different account than
-// the role, then the user's administrator must attach a policy that allows
-// the user to call AssumeRole on the ARN of the role in the other account.
-// If the user is in the same account as the role, then you can either attach
-// a policy to the user (identical to the previous different account user),
-// or you can add the user as a principal directly in the role's trust policy.
-// In this case, the trust policy acts as the only resource-based policy in
-// IAM, and users in the same account as the role do not need explicit permission
-// to assume the role. For more information about trust policies and resource-based
-// policies, see IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
+// A user who wants to access a role in a different account must also have permissions
+// that are delegated from the user account administrator. The administrator
+// must attach a policy that allows the user to call AssumeRole for the ARN
+// of the role in the other account. If the user is in the same account as the
+// role, then you can do either of the following:
+//
+// * Attach a policy to the user (identical to the previous user in a different
+// account).
+//
+// * Add the user as a principal directly in the role's trust policy.
+//
+// In this case, the trust policy acts as an IAM resource-based policy. Users
+// in the same account as the role do not need explicit permission to assume
+// the role. For more information about trust policies and resource-based policies,
+// see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
// in the IAM User Guide.
//
// Using MFA with AssumeRole
//
-// You can optionally include multi-factor authentication (MFA) information
-// when you call AssumeRole. This is useful for cross-account scenarios in which
-// you want to make sure that the user who is assuming the role has been authenticated
-// using an AWS MFA device. In that scenario, the trust policy of the role being
-// assumed includes a condition that tests for MFA authentication; if the caller
-// does not include valid MFA information, the request to assume the role is
-// denied. The condition in a trust policy that tests for MFA authentication
-// might look like the following example.
+// (Optional) You can include multi-factor authentication (MFA) information
+// when you call AssumeRole. This is useful for cross-account scenarios to ensure
+// that the user that assumes the role has been authenticated with an AWS MFA
+// device. In that scenario, the trust policy of the role being assumed includes
+// a condition that tests for MFA authentication. If the caller does not include
+// valid MFA information, the request to assume the role is denied. The condition
+// in a trust policy that tests for MFA authentication might look like the following
+// example.
//
// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}
//
-// For more information, see Configuring MFA-Protected API Access (http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)
+// For more information, see Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)
// in the IAM User Guide guide.
//
// To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode
// parameters. The SerialNumber value identifies the user's hardware or virtual
// MFA device. The TokenCode is the time-based one-time password (TOTP) that
-// the MFA devices produces.
+// the MFA device produces.
//
// 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
@@ -179,7 +173,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
-// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
@@ -209,7 +203,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML"
// AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the
// client's request for the AssumeRoleWithSAML operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -243,6 +237,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
output = &AssumeRoleWithSAMLOutput{}
req = c.newRequest(op, input, output)
+ req.Config.Credentials = credentials.AnonymousCredentials
return
}
@@ -252,9 +247,9 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
// via a SAML authentication response. This operation provides a mechanism for
// tying an enterprise identity store or directory to role-based AWS access
// without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML
-// with the other APIs that produce temporary credentials, see Requesting Temporary
-// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
-// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
+// with the other API operations that produce temporary credentials, see Requesting
+// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
// The temporary security credentials returned by this operation consist of
@@ -269,37 +264,36 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
// a DurationSeconds value from 900 seconds (15 minutes) up to the maximum session
// duration setting for the role. This setting can have a value from 1 hour
// to 12 hours. To learn how to view the maximum value for your role, see View
-// the Maximum Session Duration Setting for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+// the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. The maximum session duration limit applies when you
-// use the AssumeRole* API operations or the assume-role* CLI operations but
-// does not apply when you use those operations to create a console URL. For
-// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
+// use the AssumeRole* API operations or the assume-role* CLI commands. However
+// the limit does not apply when you use those operations to create a console
+// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
// in the IAM User Guide.
//
// The temporary security credentials created by AssumeRoleWithSAML can be used
// to make API calls to any AWS service with the following exception: you cannot
-// call the STS service's GetFederationToken or GetSessionToken APIs.
+// call the STS GetFederationToken or GetSessionToken API operations.
//
-// Optionally, you can pass an IAM access policy to this operation. If you choose
-// not to pass a policy, the temporary security credentials that are returned
-// by the operation have the permissions that are defined in the access policy
-// of the role that is being assumed. If you pass a policy to this operation,
-// the temporary security credentials that are returned by the operation have
-// the permissions that are allowed by the intersection of both the access policy
-// of the role that is being assumed, and the policy that you pass. This means
-// that both policies must grant the permission for the action to be allowed.
-// This gives you a way to further restrict the permissions for the resulting
-// temporary security credentials. You cannot use the passed policy to grant
-// permissions that are in excess of those allowed by the access policy of the
-// role that is being assumed. For more information, see Permissions for AssumeRole,
-// AssumeRoleWithSAML, and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+// to this operation. You can pass a single JSON policy document to use as an
+// inline session policy. You can also specify up to 10 managed policies to
+// use as managed session policies. The plain text that you use for both inline
+// and managed session policies shouldn't exceed 2048 characters. Passing policies
+// to this operation returns new temporary credentials. The resulting session's
+// permissions are the intersection of the role's identity-based policy and
+// the session policies. You can use the role's temporary credentials in subsequent
+// AWS API calls to access resources in the account that owns the role. You
+// cannot use session policies to grant more permissions than those allowed
+// by the identity-based policy of the role that is being assumed. For more
+// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
// Before your application can call AssumeRoleWithSAML, you must configure your
// SAML identity provider (IdP) to issue the claims required by AWS. Additionally,
// you must use AWS Identity and Access Management (IAM) to create a SAML provider
-// entity in your AWS account that represents your identity provider, and create
-// an IAM role that specifies this SAML provider in its trust policy.
+// entity in your AWS account that represents your identity provider. You must
+// also create an IAM role that specifies this SAML provider in its trust policy.
//
// Calling AssumeRoleWithSAML does not require the use of AWS security credentials.
// The identity of the caller is validated by using keys in the metadata document
@@ -313,16 +307,16 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
//
// For more information, see the following resources:
//
-// * About SAML 2.0-based Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
+// * About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
// in the IAM User Guide.
//
-// * Creating SAML Identity Providers (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
+// * Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
// in the IAM User Guide.
//
-// * Configuring a Relying Party and Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
+// * Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
// in the IAM User Guide.
//
-// * Creating a Role for SAML 2.0 Federation (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
+// * Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
// in the IAM User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -361,7 +355,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
-// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
@@ -391,7 +385,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity"
// AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the
// client's request for the AssumeRoleWithWebIdentity operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -425,41 +419,42 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
output = &AssumeRoleWithWebIdentityOutput{}
req = c.newRequest(op, input, output)
+ req.Config.Credentials = credentials.AnonymousCredentials
return
}
// AssumeRoleWithWebIdentity API operation for AWS Security Token Service.
//
// Returns a set of temporary security credentials for users who have been authenticated
-// in a mobile or web application with a web identity provider, such as Amazon
-// Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible
-// identity provider.
+// in a mobile or web application with a web identity provider. Example providers
+// include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID
+// Connect-compatible identity provider.
//
// For mobile applications, we recommend that you use Amazon Cognito. You can
-// use Amazon Cognito with the AWS SDK for iOS (http://aws.amazon.com/sdkforios/)
-// and the AWS SDK for Android (http://aws.amazon.com/sdkforandroid/) to uniquely
-// identify a user and supply the user with a consistent identity throughout
-// the lifetime of an application.
+// use Amazon Cognito with the AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
+// and the AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
+// to uniquely identify a user. You can also supply the user with a consistent
+// identity throughout the lifetime of an application.
//
-// To learn more about Amazon Cognito, see Amazon Cognito Overview (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840)
-// in the AWS SDK for Android Developer Guide guide and Amazon Cognito Overview
-// (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664)
+// To learn more about Amazon Cognito, see Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840)
+// in AWS SDK for Android Developer Guide and Amazon Cognito Overview (https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664)
// in the AWS SDK for iOS Developer Guide.
//
// Calling AssumeRoleWithWebIdentity does not require the use of AWS security
// credentials. Therefore, you can distribute an application (for example, on
// mobile devices) that requests temporary security credentials without including
-// long-term AWS credentials in the application, and without deploying server-based
-// proxy services that use long-term AWS credentials. Instead, the identity
-// of the caller is validated by using a token from the web identity provider.
-// For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce
-// temporary credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
-// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
+// long-term AWS credentials in the application. You also don't need to deploy
+// server-based proxy services that use long-term AWS credentials. Instead,
+// the identity of the caller is validated by using a token from the web identity
+// provider. For a comparison of AssumeRoleWithWebIdentity with the other API
+// operations that produce temporary credentials, see Requesting Temporary Security
+// Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
// The temporary security credentials returned by this API consist of an access
// key ID, a secret access key, and a security token. Applications can use these
-// temporary security credentials to sign calls to AWS service APIs.
+// temporary security credentials to sign calls to AWS service API operations.
//
// By default, the temporary security credentials created by AssumeRoleWithWebIdentity
// last for one hour. However, you can use the optional DurationSeconds parameter
@@ -467,29 +462,29 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
// seconds (15 minutes) up to the maximum session duration setting for the role.
// This setting can have a value from 1 hour to 12 hours. To learn how to view
// the maximum value for your role, see View the Maximum Session Duration Setting
-// for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+// for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. The maximum session duration limit applies when you
-// use the AssumeRole* API operations or the assume-role* CLI operations but
-// does not apply when you use those operations to create a console URL. For
-// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
+// use the AssumeRole* API operations or the assume-role* CLI commands. However
+// the limit does not apply when you use those operations to create a console
+// URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
// in the IAM User Guide.
//
// The temporary security credentials created by AssumeRoleWithWebIdentity can
// be used to make API calls to any AWS service with the following exception:
-// you cannot call the STS service's GetFederationToken or GetSessionToken APIs.
+// you cannot call the STS GetFederationToken or GetSessionToken API operations.
//
-// Optionally, you can pass an IAM access policy to this operation. If you choose
-// not to pass a policy, the temporary security credentials that are returned
-// by the operation have the permissions that are defined in the access policy
-// of the role that is being assumed. If you pass a policy to this operation,
-// the temporary security credentials that are returned by the operation have
-// the permissions that are allowed by both the access policy of the role that
-// is being assumed, and the policy that you pass. This gives you a way to further
-// restrict the permissions for the resulting temporary security credentials.
-// You cannot use the passed policy to grant permissions that are in excess
-// of those allowed by the access policy of the role that is being assumed.
-// For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,
-// and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+// (Optional) You can pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+// to this operation. You can pass a single JSON policy document to use as an
+// inline session policy. You can also specify up to 10 managed policies to
+// use as managed session policies. The plain text that you use for both inline
+// and managed session policies shouldn't exceed 2048 characters. Passing policies
+// to this operation returns new temporary credentials. The resulting session's
+// permissions are the intersection of the role's identity-based policy and
+// the session policies. You can use the role's temporary credentials in subsequent
+// AWS API calls to access resources in the account that owns the role. You
+// cannot use session policies to grant more permissions than those allowed
+// by the identity-based policy of the role that is being assumed. For more
+// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
// Before your application can call AssumeRoleWithWebIdentity, you must have
@@ -508,21 +503,19 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
// For more information about how to use web identity federation and the AssumeRoleWithWebIdentity
// API, see the following resources:
//
-// * Using Web Identity Federation APIs for Mobile Apps (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
-// and Federation Through a Web-based Identity Provider (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
+// * Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
+// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
//
+// * Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html).
+// Walk through the process of authenticating through Login with Amazon,
+// Facebook, or Google, getting temporary security credentials, and then
+// using those credentials to make a request to AWS.
//
-// * Web Identity Federation Playground (https://web-identity-federation-playground.s3.amazonaws.com/index.html).
-// This interactive website lets you walk through the process of authenticating
-// via Login with Amazon, Facebook, or Google, getting temporary security
-// credentials, and then using those credentials to make a request to AWS.
-//
-//
-// * AWS SDK for iOS (http://aws.amazon.com/sdkforios/) and AWS SDK for Android
-// (http://aws.amazon.com/sdkforandroid/). These toolkits contain sample
-// apps that show how to invoke the identity providers, and then how to use
-// the information from these providers to get and use temporary security
-// credentials.
+// * AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and
+// AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/).
+// These toolkits contain sample apps that show how to invoke the identity
+// providers, and then how to use the information from these providers to
+// get and use temporary security credentials.
//
// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications).
// This article discusses web identity federation and shows an example of
@@ -572,7 +565,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
-// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
@@ -602,7 +595,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage"
// DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the
// client's request for the DecodeAuthorizationMessage operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -644,17 +637,17 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
// Decodes additional information about the authorization status of a request
// from an encoded message returned in response to an AWS request.
//
-// For example, if a user is not authorized to perform an action that he or
-// she has requested, the request returns a Client.UnauthorizedOperation response
-// (an HTTP 403 response). Some AWS actions additionally return an encoded message
-// that can provide details about this authorization failure.
+// For example, if a user is not authorized to perform an operation that he
+// or she has requested, the request returns a Client.UnauthorizedOperation
+// response (an HTTP 403 response). Some AWS operations additionally return
+// an encoded message that can provide details about this authorization failure.
//
-// Only certain AWS actions return an encoded authorization message. The documentation
-// for an individual action indicates whether that action returns an encoded
-// message in addition to returning an HTTP code.
+// Only certain AWS operations return an encoded authorization message. The
+// documentation for an individual operation indicates whether that operation
+// returns an encoded message in addition to returning an HTTP code.
//
// The message is encoded because the details of the authorization status can
-// constitute privileged information that the user who requested the action
+// constitute privileged information that the user who requested the operation
// should not see. To decode an authorization status message, a user must be
// granted permissions via an IAM policy to request the DecodeAuthorizationMessage
// (sts:DecodeAuthorizationMessage) action.
@@ -663,7 +656,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
//
// * Whether the request was denied due to an explicit deny or due to the
// absence of an explicit allow. For more information, see Determining Whether
-// a Request is Allowed or Denied (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
+// a Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
// in the IAM User Guide.
//
// * The principal who made the request.
@@ -709,12 +702,108 @@ func (c *STS) DecodeAuthorizationMessageWithContext(ctx aws.Context, input *Deco
return out, req.Send()
}
+const opGetAccessKeyInfo = "GetAccessKeyInfo"
+
+// GetAccessKeyInfoRequest generates a "aws/request.Request" representing the
+// client's request for the GetAccessKeyInfo 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 GetAccessKeyInfo for more information on using the GetAccessKeyInfo
+// 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 GetAccessKeyInfoRequest method.
+// req, resp := client.GetAccessKeyInfoRequest(params)
+//
+// err := req.Send()
+// if err == nil { // resp is now filled
+// fmt.Println(resp)
+// }
+//
+// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo
+func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *request.Request, output *GetAccessKeyInfoOutput) {
+ op := &request.Operation{
+ Name: opGetAccessKeyInfo,
+ HTTPMethod: "POST",
+ HTTPPath: "/",
+ }
+
+ if input == nil {
+ input = &GetAccessKeyInfoInput{}
+ }
+
+ output = &GetAccessKeyInfoOutput{}
+ req = c.newRequest(op, input, output)
+ return
+}
+
+// GetAccessKeyInfo API operation for AWS Security Token Service.
+//
+// Returns the account identifier for the specified access key ID.
+//
+// Access keys consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE)
+// and a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY).
+// For more information about access keys, see Managing Access Keys for IAM
+// Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
+// in the IAM User Guide.
+//
+// When you pass an access key ID to this operation, it returns the ID of the
+// AWS account to which the keys belong. Access key IDs beginning with AKIA
+// are long-term credentials for an IAM user or the AWS account root user. Access
+// key IDs beginning with ASIA are temporary credentials that are created using
+// STS operations. If the account in the response belongs to you, you can sign
+// in as the root user and review your root user access keys. Then, you can
+// pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
+// to learn which IAM user owns the keys. To learn who requested the temporary
+// credentials for an ASIA access key, view the STS events in your CloudTrail
+// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html).
+//
+// This operation does not indicate the state of the access key. The key might
+// be active, inactive, or deleted. Active keys might not have permissions to
+// perform an operation. Providing a deleted access key might return an error
+// that the key doesn't exist.
+//
+// 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 AWS Security Token Service's
+// API operation GetAccessKeyInfo for usage and error information.
+// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo
+func (c *STS) GetAccessKeyInfo(input *GetAccessKeyInfoInput) (*GetAccessKeyInfoOutput, error) {
+ req, out := c.GetAccessKeyInfoRequest(input)
+ return out, req.Send()
+}
+
+// GetAccessKeyInfoWithContext is the same as GetAccessKeyInfo with the addition of
+// the ability to pass a context and additional request options.
+//
+// See GetAccessKeyInfo 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 *STS) GetAccessKeyInfoWithContext(ctx aws.Context, input *GetAccessKeyInfoInput, opts ...request.Option) (*GetAccessKeyInfoOutput, error) {
+ req, out := c.GetAccessKeyInfoRequest(input)
+ req.SetContext(ctx)
+ req.ApplyOptions(opts...)
+ return out, req.Send()
+}
+
const opGetCallerIdentity = "GetCallerIdentity"
// GetCallerIdentityRequest generates a "aws/request.Request" representing the
// client's request for the GetCallerIdentity operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -753,8 +842,15 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ
// GetCallerIdentity API operation for AWS Security Token Service.
//
-// Returns details about the IAM identity whose credentials are used to call
-// the API.
+// Returns details about the IAM user or role whose credentials are used to
+// call the operation.
+//
+// No permissions are required to perform this operation. If an administrator
+// adds a policy to your IAM user or role that explicitly denies access to the
+// sts:GetCallerIdentity action, you can still perform this operation. Permissions
+// are not required because the same information is returned when an IAM user
+// or role is denied access. To view an example response, see I Am Not Authorized
+// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa).
//
// 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
@@ -789,7 +885,7 @@ const opGetFederationToken = "GetFederationToken"
// GetFederationTokenRequest generates a "aws/request.Request" representing the
// client's request for the GetFederationToken operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -831,81 +927,65 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
// Returns a set of temporary security credentials (consisting of an access
// key ID, a secret access key, and a security token) for a federated user.
// A typical use is in a proxy application that gets temporary security credentials
-// on behalf of distributed applications inside a corporate network. Because
-// you must call the GetFederationToken action using the long-term security
-// credentials of an IAM user, this call is appropriate in contexts where those
+// on behalf of distributed applications inside a corporate network. You must
+// call the GetFederationToken operation using the long-term security credentials
+// of an IAM user. As a result, this call is appropriate in contexts where those
// credentials can be safely stored, usually in a server-based application.
-// For a comparison of GetFederationToken with the other APIs that produce temporary
-// credentials, see Requesting Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
-// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
+// For a comparison of GetFederationToken with the other API operations that
+// produce temporary credentials, see Requesting Temporary Security Credentials
+// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
-// If you are creating a mobile-based or browser-based app that can authenticate
+// You can create a mobile-based or browser-based app that can authenticate
// users using a web identity provider like Login with Amazon, Facebook, Google,
-// or an OpenID Connect-compatible identity provider, we recommend that you
-// use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity.
+// or an OpenID Connect-compatible identity provider. In this case, we recommend
+// that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity.
// For more information, see Federation Through a Web-based Identity Provider
-// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
+// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
//
-// The GetFederationToken action must be called by using the long-term AWS security
-// credentials of an IAM user. You can also call GetFederationToken using the
-// security credentials of an AWS root account, but we do not recommended it.
-// Instead, we recommend that you create an IAM user for the purpose of the
-// proxy application and then attach a policy to the IAM user that limits federated
-// users to only the actions and resources that they need access to. For more
-// information, see IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)
+// You can also call GetFederationToken using the security credentials of an
+// AWS account root user, but we do not recommend it. Instead, we recommend
+// that you create an IAM user for the purpose of the proxy application. Then
+// attach a policy to the IAM user that limits federated users to only the actions
+// and resources that they need to access. For more information, see IAM Best
+// Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)
// in the IAM User Guide.
//
-// The temporary security credentials that are obtained by using the long-term
-// credentials of an IAM user are valid for the specified duration, from 900
-// seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default
-// is 43200 seconds (12 hours). Temporary credentials that are obtained by using
-// AWS root account credentials have a maximum duration of 3600 seconds (1 hour).
+// The temporary credentials are valid for the specified duration, from 900
+// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default
+// is 43,200 seconds (12 hours). Temporary credentials that are obtained by
+// using AWS account root user credentials have a maximum duration of 3,600
+// seconds (1 hour).
//
// The temporary security credentials created by GetFederationToken can be used
// to make API calls to any AWS service with the following exceptions:
//
-// * You cannot use these credentials to call any IAM APIs.
+// * You cannot use these credentials to call any IAM API operations.
//
-// * You cannot call any STS APIs except GetCallerIdentity.
+// * You cannot call any STS API operations except GetCallerIdentity.
//
// Permissions
//
-// The permissions for the temporary security credentials returned by GetFederationToken
-// are determined by a combination of the following:
+// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+// to this operation. You can pass a single JSON policy document to use as an
+// inline session policy. You can also specify up to 10 managed policies to
+// use as managed session policies. The plain text that you use for both inline
+// and managed session policies shouldn't exceed 2048 characters.
//
-// * The policy or policies that are attached to the IAM user whose credentials
-// are used to call GetFederationToken.
-//
-// * The policy that is passed as a parameter in the call.
-//
-// The passed policy is attached to the temporary security credentials that
-// result from the GetFederationToken API call--that is, to the federated user.
-// When the federated user makes an AWS request, AWS evaluates the policy attached
-// to the federated user in combination with the policy or policies attached
-// to the IAM user whose credentials were used to call GetFederationToken. AWS
-// allows the federated user's request only when both the federated user and
-// the IAM user are explicitly allowed to perform the requested action. The
-// passed policy cannot grant more permissions than those that are defined in
-// the IAM user policy.
-//
-// A typical use case is that the permissions of the IAM user whose credentials
-// are used to call GetFederationToken are designed to allow access to all the
-// actions and resources that any federated user will need. Then, for individual
-// users, you pass a policy to the operation that scopes down the permissions
-// to a level that's appropriate to that individual user, using a policy that
-// allows only a subset of permissions that are granted to the IAM user.
-//
-// If you do not pass a policy, the resulting temporary security credentials
-// have no effective permissions. The only exception is when the temporary security
-// credentials are used to access a resource that has a resource-based policy
-// that specifically allows the federated user to access the resource.
-//
-// For more information about how permissions work, see Permissions for GetFederationToken
-// (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html).
-// For information about using GetFederationToken to create temporary security
-// credentials, see GetFederationToken—Federation Through a Custom Identity
-// Broker (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken).
+// Though the session policy parameters are optional, if you do not pass a policy,
+// then the resulting federated user session has no permissions. The only exception
+// is when the credentials are used to access a resource that has a resource-based
+// policy that specifically references the federated user session in the Principal
+// element of the policy. When you pass session policies, the session permissions
+// are the intersection of the IAM user policies and the session policies that
+// you pass. This gives you a way to further restrict the permissions for a
+// federated user. You cannot use session policies to grant more permissions
+// than those that are defined in the permissions policy of the IAM user. For
+// more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+// in the IAM User Guide. For information about using GetFederationToken to
+// create temporary security credentials, see GetFederationToken—Federation
+// Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken).
//
// 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
@@ -928,7 +1008,7 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
-// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
@@ -958,7 +1038,7 @@ const opGetSessionToken = "GetSessionToken"
// GetSessionTokenRequest generates a "aws/request.Request" representing the
// client's request for the GetSessionToken operation. The "output" return
// value will be populated with the request's response once the request completes
-// successfuly.
+// 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.
@@ -1000,48 +1080,47 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
// Returns a set of temporary credentials for an AWS account or IAM user. The
// credentials consist of an access key ID, a secret access key, and a security
// token. Typically, you use GetSessionToken if you want to use MFA to protect
-// programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled
-// IAM users would need to call GetSessionToken and submit an MFA code that
-// is associated with their MFA device. Using the temporary security credentials
-// that are returned from the call, IAM users can then make programmatic calls
-// to APIs that require MFA authentication. If you do not supply a correct MFA
-// code, then the API returns an access denied error. For a comparison of GetSessionToken
-// with the other APIs that produce temporary credentials, see Requesting Temporary
-// Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
-// and Comparing the AWS STS APIs (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
+// programmatic calls to specific AWS API operations like Amazon EC2 StopInstances.
+// MFA-enabled IAM users would need to call GetSessionToken and submit an MFA
+// code that is associated with their MFA device. Using the temporary security
+// credentials that are returned from the call, IAM users can then make programmatic
+// calls to API operations that require MFA authentication. If you do not supply
+// a correct MFA code, then the API returns an access denied error. For a comparison
+// of GetSessionToken with the other API operations that produce temporary credentials,
+// see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
+// and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide.
//
-// The GetSessionToken action must be called by using the long-term AWS security
-// credentials of the AWS account or an IAM user. Credentials that are created
-// by IAM users are valid for the duration that you specify, from 900 seconds
-// (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default
-// of 43200 seconds (12 hours); credentials that are created by using account
-// credentials can range from 900 seconds (15 minutes) up to a maximum of 3600
-// seconds (1 hour), with a default of 1 hour.
+// The GetSessionToken operation must be called by using the long-term AWS security
+// credentials of the AWS account root user or an IAM user. Credentials that
+// are created by IAM users are valid for the duration that you specify. This
+// duration can range from 900 seconds (15 minutes) up to a maximum of 129,600
+// seconds (36 hours), with a default of 43,200 seconds (12 hours). Credentials
+// based on account credentials can range from 900 seconds (15 minutes) up to
+// 3,600 seconds (1 hour), with a default of 1 hour.
//
// The temporary security credentials created by GetSessionToken can be used
// to make API calls to any AWS service with the following exceptions:
//
-// * You cannot call any IAM APIs unless MFA authentication information is
-// included in the request.
+// * You cannot call any IAM API operations unless MFA authentication information
+// is included in the request.
//
-// * You cannot call any STS API exceptAssumeRole or GetCallerIdentity.
+// * You cannot call any STS API except AssumeRole or GetCallerIdentity.
//
-// We recommend that you do not call GetSessionToken with root account credentials.
-// Instead, follow our best practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)
+// We recommend that you do not call GetSessionToken with AWS account root user
+// credentials. Instead, follow our best practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)
// by creating one or more IAM users, giving them the necessary permissions,
// and using IAM users for everyday interaction with AWS.
//
-// The permissions associated with the temporary security credentials returned
-// by GetSessionToken are based on the permissions associated with account or
-// IAM user whose credentials are used to call the action. If GetSessionToken
-// is called using root account credentials, the temporary credentials have
-// root account permissions. Similarly, if GetSessionToken is called using the
-// credentials of an IAM user, the temporary credentials have the same permissions
-// as the IAM user.
+// The credentials that are returned by GetSessionToken are based on permissions
+// associated with the user whose credentials were used to call the operation.
+// If GetSessionToken is called using AWS account root user credentials, the
+// temporary credentials have root user permissions. Similarly, if GetSessionToken
+// is called using the credentials of an IAM user, the temporary credentials
+// have the same permissions as the IAM user.
//
// For more information about using GetSessionToken to create temporary credentials,
-// go to Temporary Credentials for Users in Untrusted Environments (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
+// go to Temporary Credentials for Users in Untrusted Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
// in the IAM User Guide.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
@@ -1056,7 +1135,7 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
-// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
@@ -1091,7 +1170,7 @@ type AssumeRoleInput struct {
// a session duration of 12 hours, but your administrator set the maximum session
// duration to 6 hours, your operation fails. To learn how to view the maximum
// value for your role, see View the Maximum Session Duration Setting for a
- // Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+ // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide.
//
// By default, the value is set to 3600 seconds.
@@ -1101,51 +1180,77 @@ type AssumeRoleInput struct {
// to the federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
- // AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
+ // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int64 `min:"900" type:"integer"`
- // A unique identifier that is used by third parties when assuming roles in
- // their customers' accounts. For each role that the third party can assume,
- // they should instruct their customers to ensure the role's trust policy checks
- // for the external ID that the third party generated. Each time the third party
- // assumes the role, they should pass the customer's external ID. The external
- // ID is useful in order to help third parties bind a role to the customer who
- // created it. For more information about the external ID, see How to Use an
- // External ID When Granting Access to Your AWS Resources to a Third Party (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
+ // A unique identifier that might be required when you assume a role in another
+ // account. If the administrator of the account to which the role belongs provided
+ // you with an external ID, then provide that value in the ExternalId parameter.
+ // This value can be any string, such as a passphrase or account number. A cross-account
+ // role is usually set up to trust everyone in an account. Therefore, the administrator
+ // of the trusting account might send an external ID to the administrator of
+ // the trusted account. That way, only someone with the ID can assume the role,
+ // rather than everyone in the account. For more information about the external
+ // ID, see How to Use an External ID When Granting Access to Your AWS Resources
+ // to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
// in the IAM User Guide.
//
- // The regex used to validated this parameter is a string of characters consisting
+ // The regex used to validate this parameter is a string of characters consisting
// of upper- and lower-case alphanumeric characters with no spaces. You can
// also include underscores or any of the following characters: =,.@:/-
ExternalId *string `min:"2" type:"string"`
- // An IAM policy in JSON format.
+ // An IAM policy in JSON format that you want to use as an inline session policy.
//
- // This parameter is optional. If you pass a policy, the temporary security
- // credentials that are returned by the operation have the permissions that
- // are allowed by both (the intersection of) the access policy of the role that
- // is being assumed, and the policy that you pass. This gives you a way to further
- // restrict the permissions for the resulting temporary security credentials.
- // You cannot use the passed policy to grant permissions that are in excess
- // of those allowed by the access policy of the role that is being assumed.
- // For more information, see Permissions for AssumeRole, AssumeRoleWithSAML,
- // and AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+ // This parameter is optional. Passing policies to this operation returns new
+ // temporary credentials. The resulting session's permissions are the intersection
+ // of the role's identity-based policy and the session policies. You can use
+ // the role's temporary credentials in subsequent AWS API calls to access resources
+ // in the account that owns the role. You cannot use session policies to grant
+ // more permissions than those allowed by the identity-based policy of the role
+ // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
- // The format for this parameter, as described by its regex pattern, is a string
- // of characters up to 2048 characters in length. The characters can be any
- // ASCII character from the space character to the end of the valid character
- // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A),
+ // The plain text that you use for both inline and managed session policies
+ // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII
+ // character from the space character to the end of the valid character list
+ // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A),
// and carriage return (\u000D) characters.
//
- // The policy plain text must be 2048 bytes or shorter. However, an internal
- // conversion compresses it into a packed binary format with a separate limit.
- // The PackedPolicySize response element indicates by percentage how close to
- // the upper size limit the policy is, with 100% equaling the maximum allowed
- // size.
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
Policy *string `min:"1" type:"string"`
+ // The Amazon Resource Names (ARNs) of the IAM managed policies that you want
+ // to use as managed session policies. The policies must exist in the same account
+ // as the role.
+ //
+ // This parameter is optional. You can provide up to 10 managed policy ARNs.
+ // However, the plain text that you use for both inline and managed session
+ // policies shouldn't exceed 2048 characters. For more information about ARNs,
+ // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // in the AWS General Reference.
+ //
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
+ //
+ // Passing policies to this operation returns new temporary credentials. The
+ // resulting session's permissions are the intersection of the role's identity-based
+ // policy and the session policies. You can use the role's temporary credentials
+ // in subsequent AWS API calls to access resources in the account that owns
+ // the role. You cannot use session policies to grant more permissions than
+ // those allowed by the identity-based policy of the role that is being assumed.
+ // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // in the IAM User Guide.
+ PolicyArns []*PolicyDescriptorType `type:"list"`
+
// The Amazon Resource Name (ARN) of the role to assume.
//
// RoleArn is a required field
@@ -1158,8 +1263,8 @@ type AssumeRoleInput struct {
// scenarios, the role session name is visible to, and can be logged by the
// account that owns the role. The role session name is also used in the ARN
// of the assumed role principal. This means that subsequent cross-account API
- // requests using the temporary security credentials will expose the role session
- // name to the external account in their CloudTrail logs.
+ // requests that use the temporary security credentials will expose the role
+ // session name to the external account in their AWS CloudTrail logs.
//
// The regex used to validate this parameter is a string of characters consisting
// of upper- and lower-case alphanumeric characters with no spaces. You can
@@ -1229,6 +1334,16 @@ func (s *AssumeRoleInput) Validate() error {
if s.TokenCode != nil && len(*s.TokenCode) < 6 {
invalidParams.Add(request.NewErrParamMinLen("TokenCode", 6))
}
+ if s.PolicyArns != nil {
+ for i, v := range s.PolicyArns {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -1254,6 +1369,12 @@ func (s *AssumeRoleInput) SetPolicy(v string) *AssumeRoleInput {
return s
}
+// SetPolicyArns sets the PolicyArns field's value.
+func (s *AssumeRoleInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleInput {
+ s.PolicyArns = v
+ return s
+}
+
// SetRoleArn sets the RoleArn field's value.
func (s *AssumeRoleInput) SetRoleArn(v string) *AssumeRoleInput {
s.RoleArn = &v
@@ -1293,10 +1414,8 @@ type AssumeRoleOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token.
//
- // Note: The size of the security token that STS APIs return is not fixed. We
- // strongly recommend that you make no assumptions about the maximum size. As
- // of this writing, the typical size is less than 4096 bytes, but that can vary.
- // Also, future updates to AWS might require larger sizes.
+ // The size of the security token that STS API operations return is not fixed.
+ // We strongly recommend that you make no assumptions about the maximum size.
Credentials *Credentials `type:"structure"`
// A percentage value that indicates the size of the policy in packed form.
@@ -1346,7 +1465,7 @@ type AssumeRoleWithSAMLInput struct {
// specify a session duration of 12 hours, but your administrator set the maximum
// session duration to 6 hours, your operation fails. To learn how to view the
// maximum value for your role, see View the Maximum Session Duration Setting
- // for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+ // for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide.
//
// By default, the value is set to 3600 seconds.
@@ -1356,36 +1475,60 @@ type AssumeRoleWithSAMLInput struct {
// to the federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
- // AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
+ // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int64 `min:"900" type:"integer"`
- // An IAM policy in JSON format.
+ // An IAM policy in JSON format that you want to use as an inline session policy.
//
- // The policy parameter is optional. If you pass a policy, the temporary security
- // credentials that are returned by the operation have the permissions that
- // are allowed by both the access policy of the role that is being assumed,
- // and the policy that you pass. This gives you a way to further restrict the
- // permissions for the resulting temporary security credentials. You cannot
- // use the passed policy to grant permissions that are in excess of those allowed
- // by the access policy of the role that is being assumed. For more information,
- // Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity
- // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+ // This parameter is optional. Passing policies to this operation returns new
+ // temporary credentials. The resulting session's permissions are the intersection
+ // of the role's identity-based policy and the session policies. You can use
+ // the role's temporary credentials in subsequent AWS API calls to access resources
+ // in the account that owns the role. You cannot use session policies to grant
+ // more permissions than those allowed by the identity-based policy of the role
+ // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
- // The format for this parameter, as described by its regex pattern, is a string
- // of characters up to 2048 characters in length. The characters can be any
- // ASCII character from the space character to the end of the valid character
- // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A),
+ // The plain text that you use for both inline and managed session policies
+ // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII
+ // character from the space character to the end of the valid character list
+ // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A),
// and carriage return (\u000D) characters.
//
- // The policy plain text must be 2048 bytes or shorter. However, an internal
- // conversion compresses it into a packed binary format with a separate limit.
- // The PackedPolicySize response element indicates by percentage how close to
- // the upper size limit the policy is, with 100% equaling the maximum allowed
- // size.
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
Policy *string `min:"1" type:"string"`
+ // The Amazon Resource Names (ARNs) of the IAM managed policies that you want
+ // to use as managed session policies. The policies must exist in the same account
+ // as the role.
+ //
+ // This parameter is optional. You can provide up to 10 managed policy ARNs.
+ // However, the plain text that you use for both inline and managed session
+ // policies shouldn't exceed 2048 characters. For more information about ARNs,
+ // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // in the AWS General Reference.
+ //
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
+ //
+ // Passing policies to this operation returns new temporary credentials. The
+ // resulting session's permissions are the intersection of the role's identity-based
+ // policy and the session policies. You can use the role's temporary credentials
+ // in subsequent AWS API calls to access resources in the account that owns
+ // the role. You cannot use session policies to grant more permissions than
+ // those allowed by the identity-based policy of the role that is being assumed.
+ // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // in the IAM User Guide.
+ PolicyArns []*PolicyDescriptorType `type:"list"`
+
// The Amazon Resource Name (ARN) of the SAML provider in IAM that describes
// the IdP.
//
@@ -1399,8 +1542,8 @@ type AssumeRoleWithSAMLInput struct {
// The base-64 encoded SAML authentication response provided by the IdP.
//
- // For more information, see Configuring a Relying Party and Adding Claims (http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
- // in the Using IAM guide.
+ // For more information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
+ // in the IAM User Guide.
//
// SAMLAssertion is a required field
SAMLAssertion *string `min:"4" type:"string" required:"true"`
@@ -1443,6 +1586,16 @@ func (s *AssumeRoleWithSAMLInput) Validate() error {
if s.SAMLAssertion != nil && len(*s.SAMLAssertion) < 4 {
invalidParams.Add(request.NewErrParamMinLen("SAMLAssertion", 4))
}
+ if s.PolicyArns != nil {
+ for i, v := range s.PolicyArns {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -1462,6 +1615,12 @@ func (s *AssumeRoleWithSAMLInput) SetPolicy(v string) *AssumeRoleWithSAMLInput {
return s
}
+// SetPolicyArns sets the PolicyArns field's value.
+func (s *AssumeRoleWithSAMLInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithSAMLInput {
+ s.PolicyArns = v
+ return s
+}
+
// SetPrincipalArn sets the PrincipalArn field's value.
func (s *AssumeRoleWithSAMLInput) SetPrincipalArn(v string) *AssumeRoleWithSAMLInput {
s.PrincipalArn = &v
@@ -1496,10 +1655,8 @@ type AssumeRoleWithSAMLOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token.
//
- // Note: The size of the security token that STS APIs return is not fixed. We
- // strongly recommend that you make no assumptions about the maximum size. As
- // of this writing, the typical size is less than 4096 bytes, but that can vary.
- // Also, future updates to AWS might require larger sizes.
+ // The size of the security token that STS API operations return is not fixed.
+ // We strongly recommend that you make no assumptions about the maximum size.
Credentials *Credentials `type:"structure"`
// The value of the Issuer element of the SAML assertion.
@@ -1603,7 +1760,7 @@ type AssumeRoleWithWebIdentityInput struct {
// a session duration of 12 hours, but your administrator set the maximum session
// duration to 6 hours, your operation fails. To learn how to view the maximum
// value for your role, see View the Maximum Session Duration Setting for a
- // Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
+ // Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide.
//
// By default, the value is set to 3600 seconds.
@@ -1613,35 +1770,60 @@ type AssumeRoleWithWebIdentityInput struct {
// to the federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
- // AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
+ // AWS Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int64 `min:"900" type:"integer"`
- // An IAM policy in JSON format.
+ // An IAM policy in JSON format that you want to use as an inline session policy.
//
- // The policy parameter is optional. If you pass a policy, the temporary security
- // credentials that are returned by the operation have the permissions that
- // are allowed by both the access policy of the role that is being assumed,
- // and the policy that you pass. This gives you a way to further restrict the
- // permissions for the resulting temporary security credentials. You cannot
- // use the passed policy to grant permissions that are in excess of those allowed
- // by the access policy of the role that is being assumed. For more information,
- // see Permissions for AssumeRoleWithWebIdentity (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html)
+ // This parameter is optional. Passing policies to this operation returns new
+ // temporary credentials. The resulting session's permissions are the intersection
+ // of the role's identity-based policy and the session policies. You can use
+ // the role's temporary credentials in subsequent AWS API calls to access resources
+ // in the account that owns the role. You cannot use session policies to grant
+ // more permissions than those allowed by the identity-based policy of the role
+ // that is being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
//
- // The format for this parameter, as described by its regex pattern, is a string
- // of characters up to 2048 characters in length. The characters can be any
- // ASCII character from the space character to the end of the valid character
- // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A),
+ // The plain text that you use for both inline and managed session policies
+ // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII
+ // character from the space character to the end of the valid character list
+ // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A),
// and carriage return (\u000D) characters.
//
- // The policy plain text must be 2048 bytes or shorter. However, an internal
- // conversion compresses it into a packed binary format with a separate limit.
- // The PackedPolicySize response element indicates by percentage how close to
- // the upper size limit the policy is, with 100% equaling the maximum allowed
- // size.
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
Policy *string `min:"1" type:"string"`
+ // The Amazon Resource Names (ARNs) of the IAM managed policies that you want
+ // to use as managed session policies. The policies must exist in the same account
+ // as the role.
+ //
+ // This parameter is optional. You can provide up to 10 managed policy ARNs.
+ // However, the plain text that you use for both inline and managed session
+ // policies shouldn't exceed 2048 characters. For more information about ARNs,
+ // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // in the AWS General Reference.
+ //
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
+ //
+ // Passing policies to this operation returns new temporary credentials. The
+ // resulting session's permissions are the intersection of the role's identity-based
+ // policy and the session policies. You can use the role's temporary credentials
+ // in subsequent AWS API calls to access resources in the account that owns
+ // the role. You cannot use session policies to grant more permissions than
+ // those allowed by the identity-based policy of the role that is being assumed.
+ // For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // in the IAM User Guide.
+ PolicyArns []*PolicyDescriptorType `type:"list"`
+
// The fully qualified host component of the domain name of the identity provider.
//
// Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com
@@ -1718,6 +1900,16 @@ func (s *AssumeRoleWithWebIdentityInput) Validate() error {
if s.WebIdentityToken != nil && len(*s.WebIdentityToken) < 4 {
invalidParams.Add(request.NewErrParamMinLen("WebIdentityToken", 4))
}
+ if s.PolicyArns != nil {
+ for i, v := range s.PolicyArns {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -1737,6 +1929,12 @@ func (s *AssumeRoleWithWebIdentityInput) SetPolicy(v string) *AssumeRoleWithWebI
return s
}
+// SetPolicyArns sets the PolicyArns field's value.
+func (s *AssumeRoleWithWebIdentityInput) SetPolicyArns(v []*PolicyDescriptorType) *AssumeRoleWithWebIdentityInput {
+ s.PolicyArns = v
+ return s
+}
+
// SetProviderId sets the ProviderId field's value.
func (s *AssumeRoleWithWebIdentityInput) SetProviderId(v string) *AssumeRoleWithWebIdentityInput {
s.ProviderId = &v
@@ -1781,10 +1979,8 @@ type AssumeRoleWithWebIdentityOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security token.
//
- // Note: The size of the security token that STS APIs return is not fixed. We
- // strongly recommend that you make no assumptions about the maximum size. As
- // of this writing, the typical size is less than 4096 bytes, but that can vary.
- // Also, future updates to AWS might require larger sizes.
+ // The size of the security token that STS API operations return is not fixed.
+ // We strongly recommend that you make no assumptions about the maximum size.
Credentials *Credentials `type:"structure"`
// A percentage value that indicates the size of the policy in packed form.
@@ -1793,7 +1989,7 @@ type AssumeRoleWithWebIdentityOutput struct {
PackedPolicySize *int64 `type:"integer"`
// The issuing authority of the web identity token presented. For OpenID Connect
- // ID Tokens this contains the value of the iss field. For OAuth 2.0 access
+ // ID tokens, this contains the value of the iss field. For OAuth 2.0 access
// tokens, this contains the value of the ProviderId parameter that was passed
// in the AssumeRoleWithWebIdentity request.
Provider *string `type:"string"`
@@ -1860,7 +2056,7 @@ type AssumedRoleUser struct {
// The ARN of the temporary security credentials that are returned from the
// AssumeRole action. For more information about ARNs and how to use them in
- // policies, see IAM Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
+ // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in Using IAM.
//
// Arn is a required field
@@ -1908,7 +2104,7 @@ type Credentials struct {
// The date on which the current credentials expire.
//
// Expiration is a required field
- Expiration *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"`
+ Expiration *time.Time `type:"timestamp" required:"true"`
// The secret access key that can be used to sign requests.
//
@@ -2028,7 +2224,7 @@ type FederatedUser struct {
// The ARN that specifies the federated user that is associated with the credentials.
// For more information about ARNs and how to use them in policies, see IAM
- // Identifiers (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
+ // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in Using IAM.
//
// Arn is a required field
@@ -2063,6 +2259,73 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser {
return s
}
+type GetAccessKeyInfoInput struct {
+ _ struct{} `type:"structure"`
+
+ // The identifier of an access key.
+ //
+ // This parameter allows (through its regex pattern) a string of characters
+ // that can consist of any upper- or lowercased letter or digit.
+ //
+ // AccessKeyId is a required field
+ AccessKeyId *string `min:"16" type:"string" required:"true"`
+}
+
+// String returns the string representation
+func (s GetAccessKeyInfoInput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetAccessKeyInfoInput) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *GetAccessKeyInfoInput) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "GetAccessKeyInfoInput"}
+ if s.AccessKeyId == nil {
+ invalidParams.Add(request.NewErrParamRequired("AccessKeyId"))
+ }
+ if s.AccessKeyId != nil && len(*s.AccessKeyId) < 16 {
+ invalidParams.Add(request.NewErrParamMinLen("AccessKeyId", 16))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetAccessKeyId sets the AccessKeyId field's value.
+func (s *GetAccessKeyInfoInput) SetAccessKeyId(v string) *GetAccessKeyInfoInput {
+ s.AccessKeyId = &v
+ return s
+}
+
+type GetAccessKeyInfoOutput struct {
+ _ struct{} `type:"structure"`
+
+ // The number used to identify the AWS account.
+ Account *string `type:"string"`
+}
+
+// String returns the string representation
+func (s GetAccessKeyInfoOutput) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s GetAccessKeyInfoOutput) GoString() string {
+ return s.String()
+}
+
+// SetAccount sets the Account field's value.
+func (s *GetAccessKeyInfoOutput) SetAccount(v string) *GetAccessKeyInfoOutput {
+ s.Account = &v
+ return s
+}
+
type GetCallerIdentityInput struct {
_ struct{} `type:"structure"`
}
@@ -2090,8 +2353,8 @@ type GetCallerIdentityOutput struct {
Arn *string `min:"20" type:"string"`
// The unique identifier of the calling entity. The exact value depends on the
- // type of entity making the call. The values returned are those listed in the
- // aws:userid column in the Principal table (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
+ // type of entity that is making the call. The values returned are those listed
+ // in the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
// found on the Policy Variables reference page in the IAM User Guide.
UserId *string `type:"string"`
}
@@ -2128,12 +2391,11 @@ type GetFederationTokenInput struct {
_ struct{} `type:"structure"`
// The duration, in seconds, that the session should last. Acceptable durations
- // for federation sessions range from 900 seconds (15 minutes) to 129600 seconds
- // (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained
- // using AWS account (root) credentials are restricted to a maximum of 3600
+ // for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds
+ // (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained
+ // using AWS account root user credentials are restricted to a maximum of 3,600
// seconds (one hour). If the specified duration is longer than one hour, the
- // session obtained by using AWS account (root) credentials defaults to one
- // hour.
+ // session obtained by using root user credentials defaults to one hour.
DurationSeconds *int64 `min:"900" type:"integer"`
// The name of the federated user. The name is used as an identifier for the
@@ -2148,36 +2410,73 @@ type GetFederationTokenInput struct {
// Name is a required field
Name *string `min:"2" type:"string" required:"true"`
- // An IAM policy in JSON format that is passed with the GetFederationToken call
- // and evaluated along with the policy or policies that are attached to the
- // IAM user whose credentials are used to call GetFederationToken. The passed
- // policy is used to scope down the permissions that are available to the IAM
- // user, by allowing only a subset of the permissions that are granted to the
- // IAM user. The passed policy cannot grant more permissions than those granted
- // to the IAM user. The final permissions for the federated user are the most
- // restrictive set based on the intersection of the passed policy and the IAM
- // user policy.
+ // An IAM policy in JSON format that you want to use as an inline session policy.
//
- // If you do not pass a policy, the resulting temporary security credentials
- // have no effective permissions. The only exception is when the temporary security
- // credentials are used to access a resource that has a resource-based policy
- // that specifically allows the federated user to access the resource.
+ // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // to this operation. You can pass a single JSON policy document to use as an
+ // inline session policy. You can also specify up to 10 managed policies to
+ // use as managed session policies.
//
- // The format for this parameter, as described by its regex pattern, is a string
- // of characters up to 2048 characters in length. The characters can be any
- // ASCII character from the space character to the end of the valid character
- // list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A),
+ // This parameter is optional. However, if you do not pass any session policies,
+ // then the resulting federated user session has no permissions. The only exception
+ // is when the credentials are used to access a resource that has a resource-based
+ // policy that specifically references the federated user session in the Principal
+ // element of the policy.
+ //
+ // When you pass session policies, the session permissions are the intersection
+ // of the IAM user policies and the session policies that you pass. This gives
+ // you a way to further restrict the permissions for a federated user. You cannot
+ // use session policies to grant more permissions than those that are defined
+ // in the permissions policy of the IAM user. For more information, see Session
+ // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // in the IAM User Guide.
+ //
+ // The plain text that you use for both inline and managed session policies
+ // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII
+ // character from the space character to the end of the valid character list
+ // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A),
// and carriage return (\u000D) characters.
//
- // The policy plain text must be 2048 bytes or shorter. However, an internal
- // conversion compresses it into a packed binary format with a separate limit.
- // The PackedPolicySize response element indicates by percentage how close to
- // the upper size limit the policy is, with 100% equaling the maximum allowed
- // size.
- //
- // For more information about how permissions work, see Permissions for GetFederationToken
- // (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html).
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
Policy *string `min:"1" type:"string"`
+
+ // The Amazon Resource Names (ARNs) of the IAM managed policies that you want
+ // to use as a managed session policy. The policies must exist in the same account
+ // as the IAM user that is requesting federated access.
+ //
+ // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // to this operation. You can pass a single JSON policy document to use as an
+ // inline session policy. You can also specify up to 10 managed policies to
+ // use as managed session policies. The plain text that you use for both inline
+ // and managed session policies shouldn't exceed 2048 characters. You can provide
+ // up to 10 managed policy ARNs. For more information about ARNs, see Amazon
+ // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // in the AWS General Reference.
+ //
+ // This parameter is optional. However, if you do not pass any session policies,
+ // then the resulting federated user session has no permissions. The only exception
+ // is when the credentials are used to access a resource that has a resource-based
+ // policy that specifically references the federated user session in the Principal
+ // element of the policy.
+ //
+ // When you pass session policies, the session permissions are the intersection
+ // of the IAM user policies and the session policies that you pass. This gives
+ // you a way to further restrict the permissions for a federated user. You cannot
+ // use session policies to grant more permissions than those that are defined
+ // in the permissions policy of the IAM user. For more information, see Session
+ // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
+ // in the IAM User Guide.
+ //
+ // The characters in this parameter count towards the 2048 character session
+ // policy guideline. However, an AWS conversion compresses the session policies
+ // into a packed binary format that has a separate limit. This is the enforced
+ // limit. The PackedPolicySize response element indicates by percentage how
+ // close the policy is to the upper size limit.
+ PolicyArns []*PolicyDescriptorType `type:"list"`
}
// String returns the string representation
@@ -2205,6 +2504,16 @@ func (s *GetFederationTokenInput) Validate() error {
if s.Policy != nil && len(*s.Policy) < 1 {
invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
}
+ if s.PolicyArns != nil {
+ for i, v := range s.PolicyArns {
+ if v == nil {
+ continue
+ }
+ if err := v.Validate(); err != nil {
+ invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PolicyArns", i), err.(request.ErrInvalidParams))
+ }
+ }
+ }
if invalidParams.Len() > 0 {
return invalidParams
@@ -2230,6 +2539,12 @@ func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput {
return s
}
+// SetPolicyArns sets the PolicyArns field's value.
+func (s *GetFederationTokenInput) SetPolicyArns(v []*PolicyDescriptorType) *GetFederationTokenInput {
+ s.PolicyArns = v
+ return s
+}
+
// Contains the response to a successful GetFederationToken request, including
// temporary AWS credentials that can be used to make AWS requests.
type GetFederationTokenOutput struct {
@@ -2238,10 +2553,8 @@ type GetFederationTokenOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token.
//
- // Note: The size of the security token that STS APIs return is not fixed. We
- // strongly recommend that you make no assumptions about the maximum size. As
- // of this writing, the typical size is less than 4096 bytes, but that can vary.
- // Also, future updates to AWS might require larger sizes.
+ // The size of the security token that STS API operations return is not fixed.
+ // We strongly recommend that you make no assumptions about the maximum size.
Credentials *Credentials `type:"structure"`
// Identifiers for the federated user associated with the credentials (such
@@ -2288,11 +2601,11 @@ type GetSessionTokenInput struct {
_ struct{} `type:"structure"`
// The duration, in seconds, that the credentials should remain valid. Acceptable
- // durations for IAM user sessions range from 900 seconds (15 minutes) to 129600
- // seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions
- // for AWS account owners are restricted to a maximum of 3600 seconds (one hour).
- // If the duration is longer than one hour, the session for AWS account owners
- // defaults to one hour.
+ // durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600
+ // seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions
+ // for AWS account owners are restricted to a maximum of 3,600 seconds (one
+ // hour). If the duration is longer than one hour, the session for AWS account
+ // owners defaults to one hour.
DurationSeconds *int64 `min:"900" type:"integer"`
// The identification number of the MFA device that is associated with the IAM
@@ -2303,16 +2616,16 @@ type GetSessionTokenInput struct {
// You can find the device for an IAM user by going to the AWS Management Console
// and viewing the user's security credentials.
//
- // The regex used to validated this parameter is a string of characters consisting
+ // The regex used to validate this parameter is a string of characters consisting
// of upper- and lower-case alphanumeric characters with no spaces. You can
// also include underscores or any of the following characters: =,.@:/-
SerialNumber *string `min:"9" type:"string"`
// The value provided by the MFA device, if MFA is required. If any policy requires
// the IAM user to submit an MFA code, specify this value. If MFA authentication
- // is required, and the user does not provide a code when requesting a set of
- // temporary security credentials, the user will receive an "access denied"
- // response when requesting resources that require MFA authentication.
+ // is required, the user must provide a code when requesting a set of temporary
+ // security credentials. A user who fails to provide the code receives an "access
+ // denied" response when requesting resources that require MFA authentication.
//
// The format for this parameter, as described by its regex pattern, is a sequence
// of six numeric digits.
@@ -2374,10 +2687,8 @@ type GetSessionTokenOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token.
//
- // Note: The size of the security token that STS APIs return is not fixed. We
- // strongly recommend that you make no assumptions about the maximum size. As
- // of this writing, the typical size is less than 4096 bytes, but that can vary.
- // Also, future updates to AWS might require larger sizes.
+ // The size of the security token that STS API operations return is not fixed.
+ // We strongly recommend that you make no assumptions about the maximum size.
Credentials *Credentials `type:"structure"`
}
@@ -2396,3 +2707,44 @@ func (s *GetSessionTokenOutput) SetCredentials(v *Credentials) *GetSessionTokenO
s.Credentials = v
return s
}
+
+// A reference to the IAM managed policy that is passed as a session policy
+// for a role session or a federated user session.
+type PolicyDescriptorType struct {
+ _ struct{} `type:"structure"`
+
+ // The Amazon Resource Name (ARN) of the IAM managed policy to use as a session
+ // policy for the role. For more information about ARNs, see Amazon Resource
+ // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
+ // in the AWS General Reference.
+ Arn *string `locationName:"arn" min:"20" type:"string"`
+}
+
+// String returns the string representation
+func (s PolicyDescriptorType) String() string {
+ return awsutil.Prettify(s)
+}
+
+// GoString returns the string representation
+func (s PolicyDescriptorType) GoString() string {
+ return s.String()
+}
+
+// Validate inspects the fields of the type to determine if they are valid.
+func (s *PolicyDescriptorType) Validate() error {
+ invalidParams := request.ErrInvalidParams{Context: "PolicyDescriptorType"}
+ if s.Arn != nil && len(*s.Arn) < 20 {
+ invalidParams.Add(request.NewErrParamMinLen("Arn", 20))
+ }
+
+ if invalidParams.Len() > 0 {
+ return invalidParams
+ }
+ return nil
+}
+
+// SetArn sets the Arn field's value.
+func (s *PolicyDescriptorType) SetArn(v string) *PolicyDescriptorType {
+ s.Arn = &v
+ return s
+}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go
deleted file mode 100644
index 4010cc7fa..000000000
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package sts
-
-import "github.com/aws/aws-sdk-go/aws/request"
-
-func init() {
- initRequest = func(r *request.Request) {
- switch r.Operation.Name {
- case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity:
- r.Handlers.Sign.Clear() // these operations are unsigned
- }
- }
-}
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
index ef681ab0c..fcb720dca 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/doc.go
@@ -7,22 +7,14 @@
// request temporary, limited-privilege credentials for AWS Identity and Access
// Management (IAM) users or for users that you authenticate (federated users).
// This guide provides descriptions of the STS API. For more detailed information
-// about using this service, go to Temporary Security Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
-//
-// As an alternative to using the API, you can use one of the AWS SDKs, which
-// consist of libraries and sample code for various programming languages and
-// platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient
-// way to create programmatic access to STS. For example, the SDKs take care
-// of cryptographically signing requests, managing errors, and retrying requests
-// automatically. For information about the AWS SDKs, including how to download
-// and install them, see the Tools for Amazon Web Services page (http://aws.amazon.com/tools/).
+// about using this service, go to Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
//
// For information about setting up signatures and authorization through the
-// API, go to Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)
+// API, go to Signing AWS API Requests (https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html)
// in the AWS General Reference. For general information about the Query API,
-// go to Making Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)
+// go to Making Query Requests (https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)
// in Using IAM. For information about using security tokens with other AWS
-// products, go to AWS Services That Work with IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)
+// products, go to AWS Services That Work with IAM (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)
// in the IAM User Guide.
//
// If you're new to AWS and need additional technical information about a specific
@@ -31,14 +23,38 @@
//
// Endpoints
//
-// The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com
-// that maps to the US East (N. Virginia) region. Additional regions are available
-// and are activated by default. For more information, see Activating and Deactivating
-// AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+// By default, AWS Security Token Service (STS) is available as a global service,
+// and all AWS STS requests go to a single endpoint at https://sts.amazonaws.com.
+// Global requests map to the US East (N. Virginia) region. AWS recommends using
+// Regional AWS STS endpoints instead of the global endpoint to reduce latency,
+// build in redundancy, and increase session token validity. For more information,
+// see Managing AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
//
-// For information about STS endpoints, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)
-// in the AWS General Reference.
+// Most AWS Regions are enabled for operations in all AWS services by default.
+// Those Regions are automatically activated for use with AWS STS. Some Regions,
+// such as Asia Pacific (Hong Kong), must be manually enabled. To learn more
+// about enabling and disabling AWS Regions, see Managing AWS Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html)
+// in the AWS General Reference. When you enable these AWS Regions, they are
+// automatically activated for use with AWS STS. You cannot activate the STS
+// endpoint for a Region that is disabled. Tokens that are valid in all AWS
+// Regions are longer than tokens that are valid in Regions that are enabled
+// by default. Changing this setting might affect existing systems where you
+// temporarily store tokens. For more information, see Managing Global Endpoint
+// Session Tokens (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-manage-tokens)
+// in the IAM User Guide.
+//
+// After you activate a Region for use with AWS STS, you can direct AWS STS
+// API calls to that Region. AWS STS recommends that you provide both the Region
+// and endpoint when you make calls to a Regional endpoint. You can provide
+// the Region alone for manually enabled Regions, such as Asia Pacific (Hong
+// Kong). In this case, the calls are directed to the STS Regional endpoint.
+// However, if you provide the Region alone for Regions enabled by default,
+// the calls are directed to the global endpoint of https://sts.amazonaws.com.
+//
+// To view the list of AWS STS endpoints and whether they are active by default,
+// see Writing Code to Use AWS STS Regions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#id_credentials_temp_enable-regions_writing_code)
+// in the IAM User Guide.
//
// Recording API requests
//
@@ -46,8 +62,28 @@
// your AWS account and delivers log files to an Amazon S3 bucket. By using
// information collected by CloudTrail, you can determine what requests were
// successfully made to STS, who made the request, when it was made, and so
-// on. To learn more about CloudTrail, including how to turn it on and find
-// your log files, see the AWS CloudTrail User Guide (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
+// on.
+//
+// If you activate AWS STS endpoints in Regions other than the default global
+// endpoint, then you must also turn on CloudTrail logging in those Regions.
+// This is necessary to record any AWS STS API calls that are made in those
+// Regions. For more information, see Turning On CloudTrail in Additional Regions
+// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/aggregating_logs_regions_turn_on_ct.html)
+// in the AWS CloudTrail User Guide.
+//
+// AWS Security Token Service (STS) is a global service with a single endpoint
+// at https://sts.amazonaws.com. Calls to this endpoint are logged as calls
+// to a global service. However, because this endpoint is physically located
+// in the US East (N. Virginia) Region, your logs list us-east-1 as the event
+// Region. CloudTrail does not write these logs to the US East (Ohio) Region
+// unless you choose to include global service logs in that Region. CloudTrail
+// writes calls to all Regional endpoints to their respective Regions. For example,
+// calls to sts.us-east-2.amazonaws.com are published to the US East (Ohio)
+// Region and calls to sts.eu-central-1.amazonaws.com are published to the EU
+// (Frankfurt) Region.
+//
+// To learn more about CloudTrail, including how to turn it on and find your
+// log files, see the AWS CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
//
// See https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15 for more information on this service.
//
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
index e24884ef3..41ea09c35 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go
@@ -67,7 +67,7 @@ const (
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
- // and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
+ // and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
ErrCodeRegionDisabledException = "RegionDisabledException"
)
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go
index 1ee5839e0..185c914d1 100644
--- a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go
@@ -29,8 +29,9 @@ var initRequest func(*request.Request)
// Service information constants
const (
- ServiceName = "sts" // Service endpoint prefix API calls made to.
- EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
+ ServiceName = "sts" // Name of service.
+ EndpointsID = ServiceName // ID to lookup a service endpoint with.
+ ServiceID = "STS" // ServiceID is a unique identifer of a specific service.
)
// New creates a new instance of the STS client with a session.
@@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
+ ServiceID: ServiceID,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go
new file mode 100644
index 000000000..e2e1d6efe
--- /dev/null
+++ b/vendor/github.com/aws/aws-sdk-go/service/sts/stsiface/interface.go
@@ -0,0 +1,96 @@
+// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
+
+// Package stsiface provides an interface to enable mocking the AWS Security Token Service service client
+// for testing your code.
+//
+// It is important to note that this interface will have breaking changes
+// when the service model is updated and adds new API operations, paginators,
+// and waiters.
+package stsiface
+
+import (
+ "github.com/aws/aws-sdk-go/aws"
+ "github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/service/sts"
+)
+
+// STSAPI provides an interface to enable mocking the
+// sts.STS service client's API operation,
+// paginators, and waiters. This make unit testing your code that calls out
+// to the SDK's service client's calls easier.
+//
+// The best way to use this interface is so the SDK's service client's calls
+// can be stubbed out for unit testing your code with the SDK without needing
+// to inject custom request handlers into the SDK's request pipeline.
+//
+// // myFunc uses an SDK service client to make a request to
+// // AWS Security Token Service.
+// func myFunc(svc stsiface.STSAPI) bool {
+// // Make svc.AssumeRole request
+// }
+//
+// func main() {
+// sess := session.New()
+// svc := sts.New(sess)
+//
+// myFunc(svc)
+// }
+//
+// In your _test.go file:
+//
+// // Define a mock struct to be used in your unit tests of myFunc.
+// type mockSTSClient struct {
+// stsiface.STSAPI
+// }
+// func (m *mockSTSClient) AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error) {
+// // mock response/functionality
+// }
+//
+// func TestMyFunc(t *testing.T) {
+// // Setup Test
+// mockSvc := &mockSTSClient{}
+//
+// myfunc(mockSvc)
+//
+// // Verify myFunc's functionality
+// }
+//
+// It is important to note that this interface will have breaking changes
+// when the service model is updated and adds new API operations, paginators,
+// and waiters. Its suggested to use the pattern above for testing, or using
+// tooling to generate mocks to satisfy the interfaces.
+type STSAPI interface {
+ AssumeRole(*sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
+ AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error)
+ AssumeRoleRequest(*sts.AssumeRoleInput) (*request.Request, *sts.AssumeRoleOutput)
+
+ AssumeRoleWithSAML(*sts.AssumeRoleWithSAMLInput) (*sts.AssumeRoleWithSAMLOutput, error)
+ AssumeRoleWithSAMLWithContext(aws.Context, *sts.AssumeRoleWithSAMLInput, ...request.Option) (*sts.AssumeRoleWithSAMLOutput, error)
+ AssumeRoleWithSAMLRequest(*sts.AssumeRoleWithSAMLInput) (*request.Request, *sts.AssumeRoleWithSAMLOutput)
+
+ AssumeRoleWithWebIdentity(*sts.AssumeRoleWithWebIdentityInput) (*sts.AssumeRoleWithWebIdentityOutput, error)
+ AssumeRoleWithWebIdentityWithContext(aws.Context, *sts.AssumeRoleWithWebIdentityInput, ...request.Option) (*sts.AssumeRoleWithWebIdentityOutput, error)
+ AssumeRoleWithWebIdentityRequest(*sts.AssumeRoleWithWebIdentityInput) (*request.Request, *sts.AssumeRoleWithWebIdentityOutput)
+
+ DecodeAuthorizationMessage(*sts.DecodeAuthorizationMessageInput) (*sts.DecodeAuthorizationMessageOutput, error)
+ DecodeAuthorizationMessageWithContext(aws.Context, *sts.DecodeAuthorizationMessageInput, ...request.Option) (*sts.DecodeAuthorizationMessageOutput, error)
+ DecodeAuthorizationMessageRequest(*sts.DecodeAuthorizationMessageInput) (*request.Request, *sts.DecodeAuthorizationMessageOutput)
+
+ GetAccessKeyInfo(*sts.GetAccessKeyInfoInput) (*sts.GetAccessKeyInfoOutput, error)
+ GetAccessKeyInfoWithContext(aws.Context, *sts.GetAccessKeyInfoInput, ...request.Option) (*sts.GetAccessKeyInfoOutput, error)
+ GetAccessKeyInfoRequest(*sts.GetAccessKeyInfoInput) (*request.Request, *sts.GetAccessKeyInfoOutput)
+
+ GetCallerIdentity(*sts.GetCallerIdentityInput) (*sts.GetCallerIdentityOutput, error)
+ GetCallerIdentityWithContext(aws.Context, *sts.GetCallerIdentityInput, ...request.Option) (*sts.GetCallerIdentityOutput, error)
+ GetCallerIdentityRequest(*sts.GetCallerIdentityInput) (*request.Request, *sts.GetCallerIdentityOutput)
+
+ GetFederationToken(*sts.GetFederationTokenInput) (*sts.GetFederationTokenOutput, error)
+ GetFederationTokenWithContext(aws.Context, *sts.GetFederationTokenInput, ...request.Option) (*sts.GetFederationTokenOutput, error)
+ GetFederationTokenRequest(*sts.GetFederationTokenInput) (*request.Request, *sts.GetFederationTokenOutput)
+
+ GetSessionToken(*sts.GetSessionTokenInput) (*sts.GetSessionTokenOutput, error)
+ GetSessionTokenWithContext(aws.Context, *sts.GetSessionTokenInput, ...request.Option) (*sts.GetSessionTokenOutput, error)
+ GetSessionTokenRequest(*sts.GetSessionTokenInput) (*request.Request, *sts.GetSessionTokenOutput)
+}
+
+var _ STSAPI = (*sts.STS)(nil)
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/LICENSE b/vendor/github.com/census-instrumentation/opencensus-proto/LICENSE
new file mode 100644
index 000000000..d64569567
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/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/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/common.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/common.pb.go
new file mode 100644
index 000000000..a6f0febe2
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1/common.pb.go
@@ -0,0 +1,361 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/agent/common/v1/common.proto
+
+package v1
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ timestamp "github.com/golang/protobuf/ptypes/timestamp"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type LibraryInfo_Language int32
+
+const (
+ LibraryInfo_LANGUAGE_UNSPECIFIED LibraryInfo_Language = 0
+ LibraryInfo_CPP LibraryInfo_Language = 1
+ LibraryInfo_C_SHARP LibraryInfo_Language = 2
+ LibraryInfo_ERLANG LibraryInfo_Language = 3
+ LibraryInfo_GO_LANG LibraryInfo_Language = 4
+ LibraryInfo_JAVA LibraryInfo_Language = 5
+ LibraryInfo_NODE_JS LibraryInfo_Language = 6
+ LibraryInfo_PHP LibraryInfo_Language = 7
+ LibraryInfo_PYTHON LibraryInfo_Language = 8
+ LibraryInfo_RUBY LibraryInfo_Language = 9
+ LibraryInfo_WEB_JS LibraryInfo_Language = 10
+)
+
+var LibraryInfo_Language_name = map[int32]string{
+ 0: "LANGUAGE_UNSPECIFIED",
+ 1: "CPP",
+ 2: "C_SHARP",
+ 3: "ERLANG",
+ 4: "GO_LANG",
+ 5: "JAVA",
+ 6: "NODE_JS",
+ 7: "PHP",
+ 8: "PYTHON",
+ 9: "RUBY",
+ 10: "WEB_JS",
+}
+
+var LibraryInfo_Language_value = map[string]int32{
+ "LANGUAGE_UNSPECIFIED": 0,
+ "CPP": 1,
+ "C_SHARP": 2,
+ "ERLANG": 3,
+ "GO_LANG": 4,
+ "JAVA": 5,
+ "NODE_JS": 6,
+ "PHP": 7,
+ "PYTHON": 8,
+ "RUBY": 9,
+ "WEB_JS": 10,
+}
+
+func (x LibraryInfo_Language) String() string {
+ return proto.EnumName(LibraryInfo_Language_name, int32(x))
+}
+
+func (LibraryInfo_Language) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_126c72ed8a252c84, []int{2, 0}
+}
+
+// Identifier metadata of the Node that produces the span or tracing data.
+// Note, this is not the metadata about the Node or service that is described by associated spans.
+// In the future we plan to extend the identifier proto definition to support
+// additional information (e.g cloud id, etc.)
+type Node struct {
+ // Identifier that uniquely identifies a process within a VM/container.
+ Identifier *ProcessIdentifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
+ // Information on the OpenCensus Library that initiates the stream.
+ LibraryInfo *LibraryInfo `protobuf:"bytes,2,opt,name=library_info,json=libraryInfo,proto3" json:"library_info,omitempty"`
+ // Additional information on service.
+ ServiceInfo *ServiceInfo `protobuf:"bytes,3,opt,name=service_info,json=serviceInfo,proto3" json:"service_info,omitempty"`
+ // Additional attributes.
+ Attributes map[string]string `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Node) Reset() { *m = Node{} }
+func (m *Node) String() string { return proto.CompactTextString(m) }
+func (*Node) ProtoMessage() {}
+func (*Node) Descriptor() ([]byte, []int) {
+ return fileDescriptor_126c72ed8a252c84, []int{0}
+}
+
+func (m *Node) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Node.Unmarshal(m, b)
+}
+func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Node.Marshal(b, m, deterministic)
+}
+func (m *Node) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Node.Merge(m, src)
+}
+func (m *Node) XXX_Size() int {
+ return xxx_messageInfo_Node.Size(m)
+}
+func (m *Node) XXX_DiscardUnknown() {
+ xxx_messageInfo_Node.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Node proto.InternalMessageInfo
+
+func (m *Node) GetIdentifier() *ProcessIdentifier {
+ if m != nil {
+ return m.Identifier
+ }
+ return nil
+}
+
+func (m *Node) GetLibraryInfo() *LibraryInfo {
+ if m != nil {
+ return m.LibraryInfo
+ }
+ return nil
+}
+
+func (m *Node) GetServiceInfo() *ServiceInfo {
+ if m != nil {
+ return m.ServiceInfo
+ }
+ return nil
+}
+
+func (m *Node) GetAttributes() map[string]string {
+ if m != nil {
+ return m.Attributes
+ }
+ return nil
+}
+
+// Identifier that uniquely identifies a process within a VM/container.
+type ProcessIdentifier struct {
+ // The host name. Usually refers to the machine/container name.
+ // For example: os.Hostname() in Go, socket.gethostname() in Python.
+ HostName string `protobuf:"bytes,1,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
+ // Process id.
+ Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
+ // Start time of this ProcessIdentifier. Represented in epoch time.
+ StartTimestamp *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ProcessIdentifier) Reset() { *m = ProcessIdentifier{} }
+func (m *ProcessIdentifier) String() string { return proto.CompactTextString(m) }
+func (*ProcessIdentifier) ProtoMessage() {}
+func (*ProcessIdentifier) Descriptor() ([]byte, []int) {
+ return fileDescriptor_126c72ed8a252c84, []int{1}
+}
+
+func (m *ProcessIdentifier) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ProcessIdentifier.Unmarshal(m, b)
+}
+func (m *ProcessIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ProcessIdentifier.Marshal(b, m, deterministic)
+}
+func (m *ProcessIdentifier) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ProcessIdentifier.Merge(m, src)
+}
+func (m *ProcessIdentifier) XXX_Size() int {
+ return xxx_messageInfo_ProcessIdentifier.Size(m)
+}
+func (m *ProcessIdentifier) XXX_DiscardUnknown() {
+ xxx_messageInfo_ProcessIdentifier.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ProcessIdentifier proto.InternalMessageInfo
+
+func (m *ProcessIdentifier) GetHostName() string {
+ if m != nil {
+ return m.HostName
+ }
+ return ""
+}
+
+func (m *ProcessIdentifier) GetPid() uint32 {
+ if m != nil {
+ return m.Pid
+ }
+ return 0
+}
+
+func (m *ProcessIdentifier) GetStartTimestamp() *timestamp.Timestamp {
+ if m != nil {
+ return m.StartTimestamp
+ }
+ return nil
+}
+
+// Information on OpenCensus Library.
+type LibraryInfo struct {
+ // Language of OpenCensus Library.
+ Language LibraryInfo_Language `protobuf:"varint,1,opt,name=language,proto3,enum=opencensus.proto.agent.common.v1.LibraryInfo_Language" json:"language,omitempty"`
+ // Version of Agent exporter of Library.
+ ExporterVersion string `protobuf:"bytes,2,opt,name=exporter_version,json=exporterVersion,proto3" json:"exporter_version,omitempty"`
+ // Version of OpenCensus Library.
+ CoreLibraryVersion string `protobuf:"bytes,3,opt,name=core_library_version,json=coreLibraryVersion,proto3" json:"core_library_version,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *LibraryInfo) Reset() { *m = LibraryInfo{} }
+func (m *LibraryInfo) String() string { return proto.CompactTextString(m) }
+func (*LibraryInfo) ProtoMessage() {}
+func (*LibraryInfo) Descriptor() ([]byte, []int) {
+ return fileDescriptor_126c72ed8a252c84, []int{2}
+}
+
+func (m *LibraryInfo) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_LibraryInfo.Unmarshal(m, b)
+}
+func (m *LibraryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_LibraryInfo.Marshal(b, m, deterministic)
+}
+func (m *LibraryInfo) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LibraryInfo.Merge(m, src)
+}
+func (m *LibraryInfo) XXX_Size() int {
+ return xxx_messageInfo_LibraryInfo.Size(m)
+}
+func (m *LibraryInfo) XXX_DiscardUnknown() {
+ xxx_messageInfo_LibraryInfo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LibraryInfo proto.InternalMessageInfo
+
+func (m *LibraryInfo) GetLanguage() LibraryInfo_Language {
+ if m != nil {
+ return m.Language
+ }
+ return LibraryInfo_LANGUAGE_UNSPECIFIED
+}
+
+func (m *LibraryInfo) GetExporterVersion() string {
+ if m != nil {
+ return m.ExporterVersion
+ }
+ return ""
+}
+
+func (m *LibraryInfo) GetCoreLibraryVersion() string {
+ if m != nil {
+ return m.CoreLibraryVersion
+ }
+ return ""
+}
+
+// Additional service information.
+type ServiceInfo struct {
+ // Name of the service.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ServiceInfo) Reset() { *m = ServiceInfo{} }
+func (m *ServiceInfo) String() string { return proto.CompactTextString(m) }
+func (*ServiceInfo) ProtoMessage() {}
+func (*ServiceInfo) Descriptor() ([]byte, []int) {
+ return fileDescriptor_126c72ed8a252c84, []int{3}
+}
+
+func (m *ServiceInfo) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ServiceInfo.Unmarshal(m, b)
+}
+func (m *ServiceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ServiceInfo.Marshal(b, m, deterministic)
+}
+func (m *ServiceInfo) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceInfo.Merge(m, src)
+}
+func (m *ServiceInfo) XXX_Size() int {
+ return xxx_messageInfo_ServiceInfo.Size(m)
+}
+func (m *ServiceInfo) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceInfo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceInfo proto.InternalMessageInfo
+
+func (m *ServiceInfo) GetName() string {
+ if m != nil {
+ return m.Name
+ }
+ return ""
+}
+
+func init() {
+ proto.RegisterEnum("opencensus.proto.agent.common.v1.LibraryInfo_Language", LibraryInfo_Language_name, LibraryInfo_Language_value)
+ proto.RegisterType((*Node)(nil), "opencensus.proto.agent.common.v1.Node")
+ proto.RegisterMapType((map[string]string)(nil), "opencensus.proto.agent.common.v1.Node.AttributesEntry")
+ proto.RegisterType((*ProcessIdentifier)(nil), "opencensus.proto.agent.common.v1.ProcessIdentifier")
+ proto.RegisterType((*LibraryInfo)(nil), "opencensus.proto.agent.common.v1.LibraryInfo")
+ proto.RegisterType((*ServiceInfo)(nil), "opencensus.proto.agent.common.v1.ServiceInfo")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/agent/common/v1/common.proto", fileDescriptor_126c72ed8a252c84)
+}
+
+var fileDescriptor_126c72ed8a252c84 = []byte{
+ // 618 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x6e, 0xda, 0x4e,
+ 0x14, 0xc7, 0x7f, 0xc6, 0x24, 0x81, 0xe7, 0x5f, 0x13, 0x77, 0x94, 0x05, 0x4a, 0x17, 0xa5, 0x74,
+ 0x93, 0x2e, 0xb0, 0x9b, 0x44, 0xaa, 0xaa, 0x4a, 0x5d, 0x18, 0xe2, 0x26, 0x44, 0x11, 0x58, 0x26,
+ 0xa1, 0x4a, 0x37, 0x96, 0x21, 0x83, 0x33, 0x2a, 0x9e, 0x41, 0xe3, 0x31, 0x2a, 0x27, 0xe8, 0x09,
+ 0xda, 0x03, 0xf4, 0x50, 0x3d, 0x44, 0x4f, 0x51, 0xcd, 0x8c, 0x01, 0xab, 0x59, 0x90, 0xdd, 0xfb,
+ 0xf3, 0xfd, 0x7e, 0x9e, 0xf5, 0xe6, 0xc9, 0xd0, 0x66, 0x73, 0x4c, 0x27, 0x98, 0x66, 0x79, 0xe6,
+ 0xce, 0x39, 0x13, 0xcc, 0x8d, 0x13, 0x4c, 0x85, 0x3b, 0x61, 0x69, 0xca, 0xa8, 0xbb, 0x38, 0x29,
+ 0x22, 0x47, 0x35, 0x51, 0x73, 0x23, 0xd7, 0x15, 0x47, 0xc9, 0x9d, 0x42, 0xb4, 0x38, 0x39, 0x7a,
+ 0x99, 0x30, 0x96, 0xcc, 0xb0, 0x86, 0x8d, 0xf3, 0xa9, 0x2b, 0x48, 0x8a, 0x33, 0x11, 0xa7, 0x73,
+ 0x6d, 0x68, 0xfd, 0x34, 0xa1, 0xda, 0x67, 0xf7, 0x18, 0x0d, 0x01, 0xc8, 0x3d, 0xa6, 0x82, 0x4c,
+ 0x09, 0xe6, 0x0d, 0xa3, 0x69, 0x1c, 0x5b, 0xa7, 0x67, 0xce, 0xb6, 0x01, 0x4e, 0xc0, 0xd9, 0x04,
+ 0x67, 0x59, 0x6f, 0x6d, 0x0d, 0x4b, 0x18, 0x14, 0xc0, 0xff, 0x33, 0x32, 0xe6, 0x31, 0x5f, 0x46,
+ 0x84, 0x4e, 0x59, 0xa3, 0xa2, 0xb0, 0xed, 0xed, 0xd8, 0x6b, 0xed, 0xea, 0xd1, 0x29, 0x0b, 0xad,
+ 0xd9, 0x26, 0x91, 0xc4, 0x0c, 0xf3, 0x05, 0x99, 0x60, 0x4d, 0x34, 0x9f, 0x4a, 0x1c, 0x6a, 0x97,
+ 0x26, 0x66, 0x9b, 0x04, 0x8d, 0x00, 0x62, 0x21, 0x38, 0x19, 0xe7, 0x02, 0x67, 0x8d, 0x6a, 0xd3,
+ 0x3c, 0xb6, 0x4e, 0xdf, 0x6d, 0xe7, 0xc9, 0xa5, 0x39, 0xde, 0xda, 0xe8, 0x53, 0xc1, 0x97, 0x61,
+ 0x89, 0x74, 0xf4, 0x11, 0x0e, 0xfe, 0x69, 0x23, 0x1b, 0xcc, 0xaf, 0x78, 0xa9, 0x96, 0x5b, 0x0f,
+ 0x65, 0x88, 0x0e, 0x61, 0x67, 0x11, 0xcf, 0x72, 0xac, 0x36, 0x53, 0x0f, 0x75, 0xf2, 0xa1, 0xf2,
+ 0xde, 0x68, 0x7d, 0x37, 0xe0, 0xf9, 0xa3, 0xe5, 0xa2, 0x17, 0x50, 0x7f, 0x60, 0x99, 0x88, 0x68,
+ 0x9c, 0xe2, 0x82, 0x53, 0x93, 0x85, 0x7e, 0x9c, 0x62, 0x89, 0x9f, 0x93, 0x7b, 0x85, 0x7a, 0x16,
+ 0xca, 0x10, 0x75, 0xe1, 0x20, 0x13, 0x31, 0x17, 0xd1, 0xfa, 0xd9, 0x8b, 0x85, 0x1d, 0x39, 0xfa,
+ 0x30, 0x9c, 0xd5, 0x61, 0x38, 0x37, 0x2b, 0x45, 0xb8, 0xaf, 0x2c, 0xeb, 0xbc, 0xf5, 0xbb, 0x02,
+ 0x56, 0xe9, 0x3d, 0x50, 0x08, 0xb5, 0x59, 0x4c, 0x93, 0x3c, 0x4e, 0xf4, 0x27, 0xec, 0x3f, 0x65,
+ 0x5d, 0x25, 0x80, 0x73, 0x5d, 0xb8, 0xc3, 0x35, 0x07, 0xbd, 0x01, 0x1b, 0x7f, 0x9b, 0x33, 0x2e,
+ 0x30, 0x8f, 0x16, 0x98, 0x67, 0x84, 0xd1, 0x62, 0x25, 0x07, 0xab, 0xfa, 0x48, 0x97, 0xd1, 0x5b,
+ 0x38, 0x9c, 0x30, 0x8e, 0xa3, 0xd5, 0x61, 0xad, 0xe4, 0xa6, 0x92, 0x23, 0xd9, 0x2b, 0x86, 0x15,
+ 0x8e, 0xd6, 0x0f, 0x03, 0x6a, 0xab, 0x99, 0xa8, 0x01, 0x87, 0xd7, 0x5e, 0xff, 0xe2, 0xd6, 0xbb,
+ 0xf0, 0xa3, 0xdb, 0xfe, 0x30, 0xf0, 0xbb, 0xbd, 0x4f, 0x3d, 0xff, 0xdc, 0xfe, 0x0f, 0xed, 0x81,
+ 0xd9, 0x0d, 0x02, 0xdb, 0x40, 0x16, 0xec, 0x75, 0xa3, 0xe1, 0xa5, 0x17, 0x06, 0x76, 0x05, 0x01,
+ 0xec, 0xfa, 0xa1, 0x74, 0xd8, 0xa6, 0x6c, 0x5c, 0x0c, 0x22, 0x95, 0x54, 0x51, 0x0d, 0xaa, 0x57,
+ 0xde, 0xc8, 0xb3, 0x77, 0x64, 0xb9, 0x3f, 0x38, 0xf7, 0xa3, 0xab, 0xa1, 0xbd, 0x2b, 0x29, 0xc1,
+ 0x65, 0x60, 0xef, 0x49, 0x63, 0x70, 0x77, 0x73, 0x39, 0xe8, 0xdb, 0x35, 0xa9, 0x0d, 0x6f, 0x3b,
+ 0x77, 0x76, 0x5d, 0x56, 0x3f, 0xfb, 0x1d, 0x29, 0x85, 0xd6, 0x2b, 0xb0, 0x4a, 0x57, 0x89, 0x10,
+ 0x54, 0x4b, 0xcf, 0xaa, 0xe2, 0xce, 0x2f, 0x03, 0x5e, 0x13, 0xb6, 0x75, 0xbd, 0x1d, 0xab, 0xab,
+ 0xc2, 0x40, 0x36, 0x03, 0xe3, 0x4b, 0x2f, 0x21, 0xe2, 0x21, 0x1f, 0x4b, 0x81, 0xab, 0x7d, 0x6d,
+ 0x42, 0x33, 0xc1, 0xf3, 0x14, 0x53, 0x11, 0x0b, 0xc2, 0xa8, 0xbb, 0x41, 0xb6, 0xf5, 0x9f, 0x26,
+ 0xc1, 0xb4, 0x9d, 0x3c, 0xfa, 0xe1, 0xfc, 0xa9, 0x34, 0x07, 0x73, 0x4c, 0xbb, 0x7a, 0xb8, 0xe2,
+ 0x3b, 0x9e, 0x1a, 0xae, 0x27, 0x3a, 0xa3, 0x93, 0xf1, 0xae, 0x02, 0x9c, 0xfd, 0x0d, 0x00, 0x00,
+ 0xff, 0xff, 0xe3, 0x53, 0x74, 0x5e, 0xbe, 0x04, 0x00, 0x00,
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.go
new file mode 100644
index 000000000..5f222b473
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.go
@@ -0,0 +1,275 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/agent/metrics/v1/metrics_service.proto
+
+package v1
+
+import (
+ context "context"
+ fmt "fmt"
+ v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
+ v11 "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
+ v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
+ proto "github.com/golang/protobuf/proto"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type ExportMetricsServiceRequest struct {
+ // This is required only in the first message on the stream or if the
+ // previous sent ExportMetricsServiceRequest message has a different Node (e.g.
+ // when the same RPC is used to send Metrics from multiple Applications).
+ Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
+ // A list of metrics that belong to the last received Node.
+ Metrics []*v11.Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
+ // The resource for the metrics in this message that do not have an explicit
+ // resource set.
+ // If unset, the most recently set resource in the RPC stream applies. It is
+ // valid to never be set within a stream, e.g. when no resource info is known
+ // at all or when all sent metrics have an explicit resource set.
+ Resource *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ExportMetricsServiceRequest) Reset() { *m = ExportMetricsServiceRequest{} }
+func (m *ExportMetricsServiceRequest) String() string { return proto.CompactTextString(m) }
+func (*ExportMetricsServiceRequest) ProtoMessage() {}
+func (*ExportMetricsServiceRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_47e253a956287d04, []int{0}
+}
+
+func (m *ExportMetricsServiceRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ExportMetricsServiceRequest.Unmarshal(m, b)
+}
+func (m *ExportMetricsServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ExportMetricsServiceRequest.Marshal(b, m, deterministic)
+}
+func (m *ExportMetricsServiceRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ExportMetricsServiceRequest.Merge(m, src)
+}
+func (m *ExportMetricsServiceRequest) XXX_Size() int {
+ return xxx_messageInfo_ExportMetricsServiceRequest.Size(m)
+}
+func (m *ExportMetricsServiceRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ExportMetricsServiceRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ExportMetricsServiceRequest proto.InternalMessageInfo
+
+func (m *ExportMetricsServiceRequest) GetNode() *v1.Node {
+ if m != nil {
+ return m.Node
+ }
+ return nil
+}
+
+func (m *ExportMetricsServiceRequest) GetMetrics() []*v11.Metric {
+ if m != nil {
+ return m.Metrics
+ }
+ return nil
+}
+
+func (m *ExportMetricsServiceRequest) GetResource() *v12.Resource {
+ if m != nil {
+ return m.Resource
+ }
+ return nil
+}
+
+type ExportMetricsServiceResponse struct {
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ExportMetricsServiceResponse) Reset() { *m = ExportMetricsServiceResponse{} }
+func (m *ExportMetricsServiceResponse) String() string { return proto.CompactTextString(m) }
+func (*ExportMetricsServiceResponse) ProtoMessage() {}
+func (*ExportMetricsServiceResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_47e253a956287d04, []int{1}
+}
+
+func (m *ExportMetricsServiceResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ExportMetricsServiceResponse.Unmarshal(m, b)
+}
+func (m *ExportMetricsServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ExportMetricsServiceResponse.Marshal(b, m, deterministic)
+}
+func (m *ExportMetricsServiceResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ExportMetricsServiceResponse.Merge(m, src)
+}
+func (m *ExportMetricsServiceResponse) XXX_Size() int {
+ return xxx_messageInfo_ExportMetricsServiceResponse.Size(m)
+}
+func (m *ExportMetricsServiceResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_ExportMetricsServiceResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ExportMetricsServiceResponse proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*ExportMetricsServiceRequest)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceRequest")
+ proto.RegisterType((*ExportMetricsServiceResponse)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceResponse")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/agent/metrics/v1/metrics_service.proto", fileDescriptor_47e253a956287d04)
+}
+
+var fileDescriptor_47e253a956287d04 = []byte{
+ // 361 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x4a, 0xc3, 0x40,
+ 0x14, 0x86, 0x9d, 0x56, 0xaa, 0x4c, 0xc1, 0x45, 0xdc, 0x94, 0x2a, 0xd2, 0x56, 0x91, 0x8a, 0x64,
+ 0x62, 0xea, 0x42, 0x10, 0x54, 0xac, 0xb8, 0x11, 0xd4, 0x12, 0xc1, 0x85, 0x1b, 0x69, 0xd3, 0x47,
+ 0xcc, 0x22, 0x33, 0x71, 0x66, 0x12, 0xbc, 0x85, 0x77, 0x70, 0xef, 0x8d, 0x3c, 0x81, 0xa7, 0x90,
+ 0xe4, 0x4d, 0x5a, 0x4a, 0x8c, 0x05, 0x77, 0x8f, 0xe4, 0xff, 0xfe, 0xf7, 0xff, 0x33, 0x43, 0x4f,
+ 0x44, 0x0c, 0xdc, 0x07, 0xae, 0x12, 0xe5, 0xc4, 0x52, 0x68, 0xe1, 0x8c, 0x03, 0xe0, 0xda, 0x89,
+ 0x40, 0xcb, 0xd0, 0x57, 0x4e, 0xea, 0x16, 0xe3, 0xb3, 0x02, 0x99, 0x86, 0x3e, 0xb0, 0x5c, 0x66,
+ 0x75, 0xe7, 0x20, 0x7e, 0x61, 0x39, 0xc8, 0x8c, 0x9a, 0xa5, 0x6e, 0xdb, 0xae, 0xf0, 0xf6, 0x45,
+ 0x14, 0x09, 0x9e, 0x59, 0xe3, 0x84, 0x7c, 0xfb, 0xa0, 0x24, 0x2f, 0x87, 0x30, 0xd2, 0xc3, 0x92,
+ 0x54, 0x82, 0x12, 0x89, 0xf4, 0x21, 0xd3, 0x16, 0x33, 0x8a, 0x7b, 0x5f, 0x84, 0x6e, 0x5d, 0xbf,
+ 0xc5, 0x42, 0xea, 0x5b, 0x34, 0x79, 0xc0, 0x22, 0x1e, 0xbc, 0x26, 0xa0, 0xb4, 0x75, 0x4a, 0x57,
+ 0xb9, 0x98, 0x42, 0x8b, 0x74, 0x48, 0xbf, 0x39, 0xd8, 0x67, 0x15, 0xc5, 0x4c, 0xd6, 0xd4, 0x65,
+ 0x77, 0x62, 0x0a, 0x5e, 0xce, 0x58, 0x67, 0x74, 0xcd, 0x24, 0x6b, 0xd5, 0x3a, 0xf5, 0x7e, 0x73,
+ 0xb0, 0x5b, 0xc6, 0xe7, 0x27, 0xc2, 0x30, 0x80, 0x57, 0x30, 0xd6, 0x90, 0xae, 0x17, 0x61, 0x5b,
+ 0xf5, 0xaa, 0xf5, 0xb3, 0x3a, 0xa9, 0xcb, 0x3c, 0x33, 0x7b, 0x33, 0xae, 0xb7, 0x43, 0xb7, 0x7f,
+ 0x6f, 0xa7, 0x62, 0xc1, 0x15, 0x0c, 0x3e, 0x08, 0xdd, 0x58, 0xfc, 0x65, 0xbd, 0x13, 0xda, 0x40,
+ 0xc6, 0x3a, 0x67, 0x4b, 0xef, 0x91, 0xfd, 0x71, 0x78, 0xed, 0x8b, 0x7f, 0xf3, 0x18, 0xaf, 0xb7,
+ 0xd2, 0x27, 0x47, 0x64, 0xf8, 0x49, 0xe8, 0x5e, 0x28, 0x96, 0x7b, 0x0d, 0x37, 0x17, 0x6d, 0x46,
+ 0x99, 0x6a, 0x44, 0x9e, 0x6e, 0x82, 0x50, 0xbf, 0x24, 0x93, 0xec, 0x92, 0x1c, 0x34, 0xb0, 0x43,
+ 0xae, 0xb4, 0x4c, 0x22, 0xe0, 0x7a, 0xac, 0x43, 0xc1, 0x9d, 0xb9, 0xb7, 0x8d, 0x4f, 0x26, 0x00,
+ 0x6e, 0x07, 0xe5, 0xf7, 0xfe, 0x5d, 0xeb, 0xde, 0xc7, 0xc0, 0xaf, 0x30, 0x46, 0xbe, 0x80, 0x5d,
+ 0xe6, 0x31, 0xcc, 0x6a, 0xf6, 0xe8, 0x4e, 0x1a, 0xb9, 0xc5, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0x19, 0x28, 0xa4, 0x50, 0x3f, 0x03, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// MetricsServiceClient is the client API for MetricsService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type MetricsServiceClient interface {
+ // For performance reasons, it is recommended to keep this RPC
+ // alive for the entire life of the application.
+ Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error)
+}
+
+type metricsServiceClient struct {
+ cc *grpc.ClientConn
+}
+
+func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
+ return &metricsServiceClient{cc}
+}
+
+func (c *metricsServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[0], "/opencensus.proto.agent.metrics.v1.MetricsService/Export", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &metricsServiceExportClient{stream}
+ return x, nil
+}
+
+type MetricsService_ExportClient interface {
+ Send(*ExportMetricsServiceRequest) error
+ Recv() (*ExportMetricsServiceResponse, error)
+ grpc.ClientStream
+}
+
+type metricsServiceExportClient struct {
+ grpc.ClientStream
+}
+
+func (x *metricsServiceExportClient) Send(m *ExportMetricsServiceRequest) error {
+ return x.ClientStream.SendMsg(m)
+}
+
+func (x *metricsServiceExportClient) Recv() (*ExportMetricsServiceResponse, error) {
+ m := new(ExportMetricsServiceResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+// MetricsServiceServer is the server API for MetricsService service.
+type MetricsServiceServer interface {
+ // For performance reasons, it is recommended to keep this RPC
+ // alive for the entire life of the application.
+ Export(MetricsService_ExportServer) error
+}
+
+// UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedMetricsServiceServer struct {
+}
+
+func (*UnimplementedMetricsServiceServer) Export(srv MetricsService_ExportServer) error {
+ return status.Errorf(codes.Unimplemented, "method Export not implemented")
+}
+
+func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
+ s.RegisterService(&_MetricsService_serviceDesc, srv)
+}
+
+func _MetricsService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(MetricsServiceServer).Export(&metricsServiceExportServer{stream})
+}
+
+type MetricsService_ExportServer interface {
+ Send(*ExportMetricsServiceResponse) error
+ Recv() (*ExportMetricsServiceRequest, error)
+ grpc.ServerStream
+}
+
+type metricsServiceExportServer struct {
+ grpc.ServerStream
+}
+
+func (x *metricsServiceExportServer) Send(m *ExportMetricsServiceResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func (x *metricsServiceExportServer) Recv() (*ExportMetricsServiceRequest, error) {
+ m := new(ExportMetricsServiceRequest)
+ if err := x.ServerStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+var _MetricsService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "opencensus.proto.agent.metrics.v1.MetricsService",
+ HandlerType: (*MetricsServiceServer)(nil),
+ Methods: []grpc.MethodDesc{},
+ Streams: []grpc.StreamDesc{
+ {
+ StreamName: "Export",
+ Handler: _MetricsService_Export_Handler,
+ ServerStreams: true,
+ ClientStreams: true,
+ },
+ },
+ Metadata: "opencensus/proto/agent/metrics/v1/metrics_service.proto",
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.gw.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.gw.go
new file mode 100644
index 000000000..158c16089
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/metrics/v1/metrics_service.pb.gw.go
@@ -0,0 +1,150 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: opencensus/proto/agent/metrics/v1/metrics_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/golang/protobuf/proto"
+ "github.com/grpc-ecosystem/grpc-gateway/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/status"
+)
+
+var _ codes.Code
+var _ io.Reader
+var _ status.Status
+var _ = runtime.String
+var _ = utilities.NewDoubleArray
+
+func request_MetricsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client MetricsServiceClient, req *http.Request, pathParams map[string]string) (MetricsService_ExportClient, runtime.ServerMetadata, error) {
+ var metadata runtime.ServerMetadata
+ stream, err := client.Export(ctx)
+ if err != nil {
+ grpclog.Infof("Failed to start streaming: %v", err)
+ return nil, metadata, err
+ }
+ dec := marshaler.NewDecoder(req.Body)
+ handleSend := func() error {
+ var protoReq ExportMetricsServiceRequest
+ err := dec.Decode(&protoReq)
+ if err == io.EOF {
+ return err
+ }
+ if err != nil {
+ grpclog.Infof("Failed to decode request: %v", err)
+ return err
+ }
+ if err := stream.Send(&protoReq); err != nil {
+ grpclog.Infof("Failed to send request: %v", err)
+ return err
+ }
+ return nil
+ }
+ if err := handleSend(); err != nil {
+ if cerr := stream.CloseSend(); cerr != nil {
+ grpclog.Infof("Failed to terminate client stream: %v", cerr)
+ }
+ if err == io.EOF {
+ return stream, metadata, nil
+ }
+ return nil, metadata, err
+ }
+ go func() {
+ for {
+ if err := handleSend(); err != nil {
+ break
+ }
+ }
+ if err := stream.CloseSend(); err != nil {
+ grpclog.Infof("Failed to terminate client stream: %v", err)
+ }
+ }()
+ header, err := stream.Header()
+ if err != nil {
+ grpclog.Infof("Failed to get header from client: %v", err)
+ return nil, metadata, err
+ }
+ metadata.HeaderMD = header
+ return stream, metadata, nil
+}
+
+// RegisterMetricsServiceHandlerFromEndpoint is same as RegisterMetricsServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterMetricsServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.Dial(endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+
+ return RegisterMetricsServiceHandler(ctx, mux, conn)
+}
+
+// RegisterMetricsServiceHandler registers the http handlers for service MetricsService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterMetricsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterMetricsServiceHandlerClient(ctx, mux, NewMetricsServiceClient(conn))
+}
+
+// RegisterMetricsServiceHandlerClient registers the http handlers for service MetricsService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MetricsServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MetricsServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "MetricsServiceClient" to call the correct interceptors.
+func RegisterMetricsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MetricsServiceClient) error {
+
+ mux.Handle("POST", pattern_MetricsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_MetricsService_Export_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_MetricsService_Export_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+var (
+ pattern_MetricsService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "metrics"}, ""))
+)
+
+var (
+ forward_MetricsService_Export_0 = runtime.ForwardResponseStream
+)
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.go
new file mode 100644
index 000000000..a0a3504dd
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.go
@@ -0,0 +1,457 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/agent/trace/v1/trace_service.proto
+
+package v1
+
+import (
+ context "context"
+ fmt "fmt"
+ v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
+ v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
+ v11 "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
+ proto "github.com/golang/protobuf/proto"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type CurrentLibraryConfig struct {
+ // This is required only in the first message on the stream or if the
+ // previous sent CurrentLibraryConfig message has a different Node (e.g.
+ // when the same RPC is used to configure multiple Applications).
+ Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
+ // Current configuration.
+ Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *CurrentLibraryConfig) Reset() { *m = CurrentLibraryConfig{} }
+func (m *CurrentLibraryConfig) String() string { return proto.CompactTextString(m) }
+func (*CurrentLibraryConfig) ProtoMessage() {}
+func (*CurrentLibraryConfig) Descriptor() ([]byte, []int) {
+ return fileDescriptor_7027f99caf7ac6a5, []int{0}
+}
+
+func (m *CurrentLibraryConfig) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_CurrentLibraryConfig.Unmarshal(m, b)
+}
+func (m *CurrentLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_CurrentLibraryConfig.Marshal(b, m, deterministic)
+}
+func (m *CurrentLibraryConfig) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_CurrentLibraryConfig.Merge(m, src)
+}
+func (m *CurrentLibraryConfig) XXX_Size() int {
+ return xxx_messageInfo_CurrentLibraryConfig.Size(m)
+}
+func (m *CurrentLibraryConfig) XXX_DiscardUnknown() {
+ xxx_messageInfo_CurrentLibraryConfig.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_CurrentLibraryConfig proto.InternalMessageInfo
+
+func (m *CurrentLibraryConfig) GetNode() *v1.Node {
+ if m != nil {
+ return m.Node
+ }
+ return nil
+}
+
+func (m *CurrentLibraryConfig) GetConfig() *v11.TraceConfig {
+ if m != nil {
+ return m.Config
+ }
+ return nil
+}
+
+type UpdatedLibraryConfig struct {
+ // This field is ignored when the RPC is used to configure only one Application.
+ // This is required only in the first message on the stream or if the
+ // previous sent UpdatedLibraryConfig message has a different Node.
+ Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
+ // Requested updated configuration.
+ Config *v11.TraceConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *UpdatedLibraryConfig) Reset() { *m = UpdatedLibraryConfig{} }
+func (m *UpdatedLibraryConfig) String() string { return proto.CompactTextString(m) }
+func (*UpdatedLibraryConfig) ProtoMessage() {}
+func (*UpdatedLibraryConfig) Descriptor() ([]byte, []int) {
+ return fileDescriptor_7027f99caf7ac6a5, []int{1}
+}
+
+func (m *UpdatedLibraryConfig) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_UpdatedLibraryConfig.Unmarshal(m, b)
+}
+func (m *UpdatedLibraryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_UpdatedLibraryConfig.Marshal(b, m, deterministic)
+}
+func (m *UpdatedLibraryConfig) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_UpdatedLibraryConfig.Merge(m, src)
+}
+func (m *UpdatedLibraryConfig) XXX_Size() int {
+ return xxx_messageInfo_UpdatedLibraryConfig.Size(m)
+}
+func (m *UpdatedLibraryConfig) XXX_DiscardUnknown() {
+ xxx_messageInfo_UpdatedLibraryConfig.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UpdatedLibraryConfig proto.InternalMessageInfo
+
+func (m *UpdatedLibraryConfig) GetNode() *v1.Node {
+ if m != nil {
+ return m.Node
+ }
+ return nil
+}
+
+func (m *UpdatedLibraryConfig) GetConfig() *v11.TraceConfig {
+ if m != nil {
+ return m.Config
+ }
+ return nil
+}
+
+type ExportTraceServiceRequest struct {
+ // This is required only in the first message on the stream or if the
+ // previous sent ExportTraceServiceRequest message has a different Node (e.g.
+ // when the same RPC is used to send Spans from multiple Applications).
+ Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
+ // A list of Spans that belong to the last received Node.
+ Spans []*v11.Span `protobuf:"bytes,2,rep,name=spans,proto3" json:"spans,omitempty"`
+ // The resource for the spans in this message that do not have an explicit
+ // resource set.
+ // If unset, the most recently set resource in the RPC stream applies. It is
+ // valid to never be set within a stream, e.g. when no resource info is known.
+ Resource *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ExportTraceServiceRequest) Reset() { *m = ExportTraceServiceRequest{} }
+func (m *ExportTraceServiceRequest) String() string { return proto.CompactTextString(m) }
+func (*ExportTraceServiceRequest) ProtoMessage() {}
+func (*ExportTraceServiceRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_7027f99caf7ac6a5, []int{2}
+}
+
+func (m *ExportTraceServiceRequest) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ExportTraceServiceRequest.Unmarshal(m, b)
+}
+func (m *ExportTraceServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ExportTraceServiceRequest.Marshal(b, m, deterministic)
+}
+func (m *ExportTraceServiceRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ExportTraceServiceRequest.Merge(m, src)
+}
+func (m *ExportTraceServiceRequest) XXX_Size() int {
+ return xxx_messageInfo_ExportTraceServiceRequest.Size(m)
+}
+func (m *ExportTraceServiceRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ExportTraceServiceRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ExportTraceServiceRequest proto.InternalMessageInfo
+
+func (m *ExportTraceServiceRequest) GetNode() *v1.Node {
+ if m != nil {
+ return m.Node
+ }
+ return nil
+}
+
+func (m *ExportTraceServiceRequest) GetSpans() []*v11.Span {
+ if m != nil {
+ return m.Spans
+ }
+ return nil
+}
+
+func (m *ExportTraceServiceRequest) GetResource() *v12.Resource {
+ if m != nil {
+ return m.Resource
+ }
+ return nil
+}
+
+type ExportTraceServiceResponse struct {
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ExportTraceServiceResponse) Reset() { *m = ExportTraceServiceResponse{} }
+func (m *ExportTraceServiceResponse) String() string { return proto.CompactTextString(m) }
+func (*ExportTraceServiceResponse) ProtoMessage() {}
+func (*ExportTraceServiceResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_7027f99caf7ac6a5, []int{3}
+}
+
+func (m *ExportTraceServiceResponse) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ExportTraceServiceResponse.Unmarshal(m, b)
+}
+func (m *ExportTraceServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ExportTraceServiceResponse.Marshal(b, m, deterministic)
+}
+func (m *ExportTraceServiceResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ExportTraceServiceResponse.Merge(m, src)
+}
+func (m *ExportTraceServiceResponse) XXX_Size() int {
+ return xxx_messageInfo_ExportTraceServiceResponse.Size(m)
+}
+func (m *ExportTraceServiceResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_ExportTraceServiceResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ExportTraceServiceResponse proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*CurrentLibraryConfig)(nil), "opencensus.proto.agent.trace.v1.CurrentLibraryConfig")
+ proto.RegisterType((*UpdatedLibraryConfig)(nil), "opencensus.proto.agent.trace.v1.UpdatedLibraryConfig")
+ proto.RegisterType((*ExportTraceServiceRequest)(nil), "opencensus.proto.agent.trace.v1.ExportTraceServiceRequest")
+ proto.RegisterType((*ExportTraceServiceResponse)(nil), "opencensus.proto.agent.trace.v1.ExportTraceServiceResponse")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/agent/trace/v1/trace_service.proto", fileDescriptor_7027f99caf7ac6a5)
+}
+
+var fileDescriptor_7027f99caf7ac6a5 = []byte{
+ // 442 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xcf, 0xaa, 0xd4, 0x30,
+ 0x14, 0xc6, 0x4d, 0xaf, 0x16, 0xc9, 0x75, 0x63, 0x71, 0x51, 0x8b, 0x30, 0x97, 0x82, 0x32, 0xa0,
+ 0x4d, 0xed, 0x5c, 0xee, 0xe6, 0x0a, 0x82, 0x33, 0x08, 0x2e, 0x44, 0x2f, 0x1d, 0x75, 0xe1, 0x66,
+ 0xe8, 0xb4, 0xc7, 0xda, 0xc5, 0x24, 0x31, 0x49, 0x8b, 0x82, 0x7b, 0xf7, 0x2e, 0x7c, 0x03, 0x5f,
+ 0xc8, 0xc7, 0xf0, 0x29, 0xa4, 0x39, 0x9d, 0x3f, 0x3a, 0x53, 0x0b, 0xba, 0xb9, 0xbb, 0x43, 0xf3,
+ 0xfd, 0xbe, 0xf3, 0x25, 0x39, 0x29, 0x3d, 0x15, 0x12, 0x78, 0x0e, 0x5c, 0xd7, 0x3a, 0x96, 0x4a,
+ 0x18, 0x11, 0x67, 0x25, 0x70, 0x13, 0x1b, 0x95, 0xe5, 0x10, 0x37, 0x09, 0x16, 0x0b, 0x0d, 0xaa,
+ 0xa9, 0x72, 0x60, 0x56, 0xe2, 0x8d, 0xb6, 0x10, 0x7e, 0x61, 0x16, 0x62, 0x56, 0xcb, 0x9a, 0x24,
+ 0x88, 0x7a, 0x5c, 0x73, 0xb1, 0x5a, 0x09, 0xde, 0xda, 0x62, 0x85, 0x74, 0x70, 0x7f, 0x4f, 0xae,
+ 0x40, 0x8b, 0x5a, 0x61, 0x82, 0x75, 0xdd, 0x89, 0xef, 0xee, 0x89, 0x7f, 0xcf, 0xda, 0xc9, 0x1e,
+ 0x0c, 0xc8, 0x16, 0xb9, 0xe0, 0xef, 0xaa, 0x12, 0xd5, 0xe1, 0x57, 0x42, 0x6f, 0xcd, 0x6a, 0xa5,
+ 0x80, 0x9b, 0xe7, 0xd5, 0x52, 0x65, 0xea, 0xd3, 0xcc, 0x2e, 0x7b, 0xe7, 0xf4, 0x2a, 0x17, 0x05,
+ 0xf8, 0xe4, 0x84, 0x8c, 0x8f, 0x27, 0xf7, 0x58, 0xcf, 0xce, 0xbb, 0xed, 0x34, 0x09, 0x7b, 0x21,
+ 0x0a, 0x48, 0x2d, 0xe3, 0x3d, 0xa6, 0x2e, 0x36, 0xf1, 0x9d, 0x3e, 0x7a, 0x7d, 0x62, 0xec, 0x55,
+ 0x5b, 0x60, 0xcf, 0xb4, 0xa3, 0x6c, 0xa8, 0xd7, 0xb2, 0xc8, 0x0c, 0x14, 0x97, 0x27, 0xd4, 0x0f,
+ 0x42, 0x6f, 0x3f, 0xfd, 0x28, 0x85, 0x32, 0x76, 0x75, 0x8e, 0x83, 0x91, 0xc2, 0x87, 0x1a, 0xb4,
+ 0xf9, 0xaf, 0x64, 0x67, 0xf4, 0x9a, 0x96, 0x19, 0xd7, 0xbe, 0x73, 0x72, 0x34, 0x3e, 0x9e, 0x8c,
+ 0xfe, 0x12, 0x6c, 0x2e, 0x33, 0x9e, 0xa2, 0xda, 0x9b, 0xd2, 0xeb, 0xeb, 0x09, 0xf1, 0x8f, 0xfa,
+ 0xda, 0x6e, 0x66, 0xa8, 0x49, 0x58, 0xda, 0xd5, 0xe9, 0x86, 0x0b, 0xef, 0xd0, 0xe0, 0xd0, 0x9e,
+ 0xb4, 0x14, 0x5c, 0xc3, 0xe4, 0x9b, 0x43, 0x6f, 0xec, 0x2e, 0x78, 0x9f, 0xa9, 0xdb, 0xdd, 0xc4,
+ 0x19, 0x1b, 0x78, 0x0a, 0xec, 0xd0, 0x54, 0x05, 0xc3, 0xd8, 0xa1, 0x7b, 0x0f, 0xaf, 0x8c, 0xc9,
+ 0x43, 0xe2, 0x7d, 0x21, 0xd4, 0xc5, 0xb4, 0xde, 0xf9, 0xa0, 0x4f, 0xef, 0x55, 0x05, 0x8f, 0xfe,
+ 0x89, 0xc5, 0x23, 0xc1, 0x24, 0xd3, 0xef, 0x84, 0x86, 0x95, 0x18, 0xf2, 0x99, 0xde, 0xdc, 0xb5,
+ 0xb8, 0x68, 0x15, 0x17, 0xe4, 0xed, 0xb3, 0xb2, 0x32, 0xef, 0xeb, 0x65, 0x3b, 0x0a, 0x31, 0xc2,
+ 0x51, 0xc5, 0xb5, 0x51, 0xf5, 0x0a, 0xb8, 0xc9, 0x4c, 0x25, 0x78, 0xbc, 0xf5, 0x8d, 0xf0, 0x05,
+ 0x97, 0xc0, 0xa3, 0xf2, 0xcf, 0x3f, 0xd4, 0x4f, 0x67, 0xf4, 0x52, 0x02, 0x9f, 0x61, 0x00, 0x6b,
+ 0xcf, 0x9e, 0xd8, 0x00, 0xb6, 0x2d, 0x7b, 0x93, 0x2c, 0x5d, 0x8b, 0x9f, 0xfe, 0x0a, 0x00, 0x00,
+ 0xff, 0xff, 0x65, 0x76, 0xd7, 0xb9, 0xed, 0x04, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// TraceServiceClient is the client API for TraceService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type TraceServiceClient interface {
+ // After initialization, this RPC must be kept alive for the entire life of
+ // the application. The agent pushes configs down to applications via a
+ // stream.
+ Config(ctx context.Context, opts ...grpc.CallOption) (TraceService_ConfigClient, error)
+ // For performance reasons, it is recommended to keep this RPC
+ // alive for the entire life of the application.
+ Export(ctx context.Context, opts ...grpc.CallOption) (TraceService_ExportClient, error)
+}
+
+type traceServiceClient struct {
+ cc *grpc.ClientConn
+}
+
+func NewTraceServiceClient(cc *grpc.ClientConn) TraceServiceClient {
+ return &traceServiceClient{cc}
+}
+
+func (c *traceServiceClient) Config(ctx context.Context, opts ...grpc.CallOption) (TraceService_ConfigClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_TraceService_serviceDesc.Streams[0], "/opencensus.proto.agent.trace.v1.TraceService/Config", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &traceServiceConfigClient{stream}
+ return x, nil
+}
+
+type TraceService_ConfigClient interface {
+ Send(*CurrentLibraryConfig) error
+ Recv() (*UpdatedLibraryConfig, error)
+ grpc.ClientStream
+}
+
+type traceServiceConfigClient struct {
+ grpc.ClientStream
+}
+
+func (x *traceServiceConfigClient) Send(m *CurrentLibraryConfig) error {
+ return x.ClientStream.SendMsg(m)
+}
+
+func (x *traceServiceConfigClient) Recv() (*UpdatedLibraryConfig, error) {
+ m := new(UpdatedLibraryConfig)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+func (c *traceServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (TraceService_ExportClient, error) {
+ stream, err := c.cc.NewStream(ctx, &_TraceService_serviceDesc.Streams[1], "/opencensus.proto.agent.trace.v1.TraceService/Export", opts...)
+ if err != nil {
+ return nil, err
+ }
+ x := &traceServiceExportClient{stream}
+ return x, nil
+}
+
+type TraceService_ExportClient interface {
+ Send(*ExportTraceServiceRequest) error
+ Recv() (*ExportTraceServiceResponse, error)
+ grpc.ClientStream
+}
+
+type traceServiceExportClient struct {
+ grpc.ClientStream
+}
+
+func (x *traceServiceExportClient) Send(m *ExportTraceServiceRequest) error {
+ return x.ClientStream.SendMsg(m)
+}
+
+func (x *traceServiceExportClient) Recv() (*ExportTraceServiceResponse, error) {
+ m := new(ExportTraceServiceResponse)
+ if err := x.ClientStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+// TraceServiceServer is the server API for TraceService service.
+type TraceServiceServer interface {
+ // After initialization, this RPC must be kept alive for the entire life of
+ // the application. The agent pushes configs down to applications via a
+ // stream.
+ Config(TraceService_ConfigServer) error
+ // For performance reasons, it is recommended to keep this RPC
+ // alive for the entire life of the application.
+ Export(TraceService_ExportServer) error
+}
+
+// UnimplementedTraceServiceServer can be embedded to have forward compatible implementations.
+type UnimplementedTraceServiceServer struct {
+}
+
+func (*UnimplementedTraceServiceServer) Config(srv TraceService_ConfigServer) error {
+ return status.Errorf(codes.Unimplemented, "method Config not implemented")
+}
+func (*UnimplementedTraceServiceServer) Export(srv TraceService_ExportServer) error {
+ return status.Errorf(codes.Unimplemented, "method Export not implemented")
+}
+
+func RegisterTraceServiceServer(s *grpc.Server, srv TraceServiceServer) {
+ s.RegisterService(&_TraceService_serviceDesc, srv)
+}
+
+func _TraceService_Config_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(TraceServiceServer).Config(&traceServiceConfigServer{stream})
+}
+
+type TraceService_ConfigServer interface {
+ Send(*UpdatedLibraryConfig) error
+ Recv() (*CurrentLibraryConfig, error)
+ grpc.ServerStream
+}
+
+type traceServiceConfigServer struct {
+ grpc.ServerStream
+}
+
+func (x *traceServiceConfigServer) Send(m *UpdatedLibraryConfig) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func (x *traceServiceConfigServer) Recv() (*CurrentLibraryConfig, error) {
+ m := new(CurrentLibraryConfig)
+ if err := x.ServerStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+func _TraceService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(TraceServiceServer).Export(&traceServiceExportServer{stream})
+}
+
+type TraceService_ExportServer interface {
+ Send(*ExportTraceServiceResponse) error
+ Recv() (*ExportTraceServiceRequest, error)
+ grpc.ServerStream
+}
+
+type traceServiceExportServer struct {
+ grpc.ServerStream
+}
+
+func (x *traceServiceExportServer) Send(m *ExportTraceServiceResponse) error {
+ return x.ServerStream.SendMsg(m)
+}
+
+func (x *traceServiceExportServer) Recv() (*ExportTraceServiceRequest, error) {
+ m := new(ExportTraceServiceRequest)
+ if err := x.ServerStream.RecvMsg(m); err != nil {
+ return nil, err
+ }
+ return m, nil
+}
+
+var _TraceService_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "opencensus.proto.agent.trace.v1.TraceService",
+ HandlerType: (*TraceServiceServer)(nil),
+ Methods: []grpc.MethodDesc{},
+ Streams: []grpc.StreamDesc{
+ {
+ StreamName: "Config",
+ Handler: _TraceService_Config_Handler,
+ ServerStreams: true,
+ ClientStreams: true,
+ },
+ {
+ StreamName: "Export",
+ Handler: _TraceService_Export_Handler,
+ ServerStreams: true,
+ ClientStreams: true,
+ },
+ },
+ Metadata: "opencensus/proto/agent/trace/v1/trace_service.proto",
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.gw.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.gw.go
new file mode 100644
index 000000000..334331b0d
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/agent/trace/v1/trace_service.pb.gw.go
@@ -0,0 +1,150 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: opencensus/proto/agent/trace/v1/trace_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/golang/protobuf/proto"
+ "github.com/grpc-ecosystem/grpc-gateway/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/status"
+)
+
+var _ codes.Code
+var _ io.Reader
+var _ status.Status
+var _ = runtime.String
+var _ = utilities.NewDoubleArray
+
+func request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client TraceServiceClient, req *http.Request, pathParams map[string]string) (TraceService_ExportClient, runtime.ServerMetadata, error) {
+ var metadata runtime.ServerMetadata
+ stream, err := client.Export(ctx)
+ if err != nil {
+ grpclog.Infof("Failed to start streaming: %v", err)
+ return nil, metadata, err
+ }
+ dec := marshaler.NewDecoder(req.Body)
+ handleSend := func() error {
+ var protoReq ExportTraceServiceRequest
+ err := dec.Decode(&protoReq)
+ if err == io.EOF {
+ return err
+ }
+ if err != nil {
+ grpclog.Infof("Failed to decode request: %v", err)
+ return err
+ }
+ if err := stream.Send(&protoReq); err != nil {
+ grpclog.Infof("Failed to send request: %v", err)
+ return err
+ }
+ return nil
+ }
+ if err := handleSend(); err != nil {
+ if cerr := stream.CloseSend(); cerr != nil {
+ grpclog.Infof("Failed to terminate client stream: %v", cerr)
+ }
+ if err == io.EOF {
+ return stream, metadata, nil
+ }
+ return nil, metadata, err
+ }
+ go func() {
+ for {
+ if err := handleSend(); err != nil {
+ break
+ }
+ }
+ if err := stream.CloseSend(); err != nil {
+ grpclog.Infof("Failed to terminate client stream: %v", err)
+ }
+ }()
+ header, err := stream.Header()
+ if err != nil {
+ grpclog.Infof("Failed to get header from client: %v", err)
+ return nil, metadata, err
+ }
+ metadata.HeaderMD = header
+ return stream, metadata, nil
+}
+
+// RegisterTraceServiceHandlerFromEndpoint is same as RegisterTraceServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterTraceServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.Dial(endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+
+ return RegisterTraceServiceHandler(ctx, mux, conn)
+}
+
+// RegisterTraceServiceHandler registers the http handlers for service TraceService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterTraceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterTraceServiceHandlerClient(ctx, mux, NewTraceServiceClient(conn))
+}
+
+// RegisterTraceServiceHandlerClient registers the http handlers for service TraceService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TraceServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TraceServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "TraceServiceClient" to call the correct interceptors.
+func RegisterTraceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TraceServiceClient) error {
+
+ mux.Handle("POST", pattern_TraceService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_TraceService_Export_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_TraceService_Export_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+var (
+ pattern_TraceService_Export_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "trace"}, ""))
+)
+
+var (
+ forward_TraceService_Export_0 = runtime.ForwardResponseStream
+)
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/metrics.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/metrics.pb.go
new file mode 100644
index 000000000..466b23428
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1/metrics.pb.go
@@ -0,0 +1,1127 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/metrics/v1/metrics.proto
+
+package v1
+
+import (
+ fmt "fmt"
+ v1 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
+ proto "github.com/golang/protobuf/proto"
+ timestamp "github.com/golang/protobuf/ptypes/timestamp"
+ wrappers "github.com/golang/protobuf/ptypes/wrappers"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// The kind of metric. It describes how the data is reported.
+//
+// A gauge is an instantaneous measurement of a value.
+//
+// A cumulative measurement is a value accumulated over a time interval. In
+// a time series, cumulative measurements should have the same start time,
+// increasing values and increasing end times, until an event resets the
+// cumulative value to zero and sets a new start time for the following
+// points.
+type MetricDescriptor_Type int32
+
+const (
+ // Do not use this default value.
+ MetricDescriptor_UNSPECIFIED MetricDescriptor_Type = 0
+ // Integer gauge. The value can go both up and down.
+ MetricDescriptor_GAUGE_INT64 MetricDescriptor_Type = 1
+ // Floating point gauge. The value can go both up and down.
+ MetricDescriptor_GAUGE_DOUBLE MetricDescriptor_Type = 2
+ // Distribution gauge measurement. The count and sum can go both up and
+ // down. Recorded values are always >= 0.
+ // Used in scenarios like a snapshot of time the current items in a queue
+ // have spent there.
+ MetricDescriptor_GAUGE_DISTRIBUTION MetricDescriptor_Type = 3
+ // Integer cumulative measurement. The value cannot decrease, if resets
+ // then the start_time should also be reset.
+ MetricDescriptor_CUMULATIVE_INT64 MetricDescriptor_Type = 4
+ // Floating point cumulative measurement. The value cannot decrease, if
+ // resets then the start_time should also be reset. Recorded values are
+ // always >= 0.
+ MetricDescriptor_CUMULATIVE_DOUBLE MetricDescriptor_Type = 5
+ // Distribution cumulative measurement. The count and sum cannot decrease,
+ // if resets then the start_time should also be reset.
+ MetricDescriptor_CUMULATIVE_DISTRIBUTION MetricDescriptor_Type = 6
+ // Some frameworks implemented Histograms as a summary of observations
+ // (usually things like request durations and response sizes). While it
+ // also provides a total count of observations and a sum of all observed
+ // values, it calculates configurable percentiles over a sliding time
+ // window. This is not recommended, since it cannot be aggregated.
+ MetricDescriptor_SUMMARY MetricDescriptor_Type = 7
+)
+
+var MetricDescriptor_Type_name = map[int32]string{
+ 0: "UNSPECIFIED",
+ 1: "GAUGE_INT64",
+ 2: "GAUGE_DOUBLE",
+ 3: "GAUGE_DISTRIBUTION",
+ 4: "CUMULATIVE_INT64",
+ 5: "CUMULATIVE_DOUBLE",
+ 6: "CUMULATIVE_DISTRIBUTION",
+ 7: "SUMMARY",
+}
+
+var MetricDescriptor_Type_value = map[string]int32{
+ "UNSPECIFIED": 0,
+ "GAUGE_INT64": 1,
+ "GAUGE_DOUBLE": 2,
+ "GAUGE_DISTRIBUTION": 3,
+ "CUMULATIVE_INT64": 4,
+ "CUMULATIVE_DOUBLE": 5,
+ "CUMULATIVE_DISTRIBUTION": 6,
+ "SUMMARY": 7,
+}
+
+func (x MetricDescriptor_Type) String() string {
+ return proto.EnumName(MetricDescriptor_Type_name, int32(x))
+}
+
+func (MetricDescriptor_Type) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{1, 0}
+}
+
+// Defines a Metric which has one or more timeseries.
+type Metric struct {
+ // The descriptor of the Metric.
+ // TODO(issue #152): consider only sending the name of descriptor for
+ // optimization.
+ MetricDescriptor *MetricDescriptor `protobuf:"bytes,1,opt,name=metric_descriptor,json=metricDescriptor,proto3" json:"metric_descriptor,omitempty"`
+ // One or more timeseries for a single metric, where each timeseries has
+ // one or more points.
+ Timeseries []*TimeSeries `protobuf:"bytes,2,rep,name=timeseries,proto3" json:"timeseries,omitempty"`
+ // The resource for the metric. If unset, it may be set to a default value
+ // provided for a sequence of messages in an RPC stream.
+ Resource *v1.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Metric) Reset() { *m = Metric{} }
+func (m *Metric) String() string { return proto.CompactTextString(m) }
+func (*Metric) ProtoMessage() {}
+func (*Metric) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{0}
+}
+
+func (m *Metric) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Metric.Unmarshal(m, b)
+}
+func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Metric.Marshal(b, m, deterministic)
+}
+func (m *Metric) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Metric.Merge(m, src)
+}
+func (m *Metric) XXX_Size() int {
+ return xxx_messageInfo_Metric.Size(m)
+}
+func (m *Metric) XXX_DiscardUnknown() {
+ xxx_messageInfo_Metric.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Metric proto.InternalMessageInfo
+
+func (m *Metric) GetMetricDescriptor() *MetricDescriptor {
+ if m != nil {
+ return m.MetricDescriptor
+ }
+ return nil
+}
+
+func (m *Metric) GetTimeseries() []*TimeSeries {
+ if m != nil {
+ return m.Timeseries
+ }
+ return nil
+}
+
+func (m *Metric) GetResource() *v1.Resource {
+ if m != nil {
+ return m.Resource
+ }
+ return nil
+}
+
+// Defines a metric type and its schema.
+type MetricDescriptor struct {
+ // The metric type, including its DNS name prefix. It must be unique.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // A detailed description of the metric, which can be used in documentation.
+ Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
+ // The unit in which the metric value is reported. Follows the format
+ // described by http://unitsofmeasure.org/ucum.html.
+ Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"`
+ Type MetricDescriptor_Type `protobuf:"varint,4,opt,name=type,proto3,enum=opencensus.proto.metrics.v1.MetricDescriptor_Type" json:"type,omitempty"`
+ // The label keys associated with the metric descriptor.
+ LabelKeys []*LabelKey `protobuf:"bytes,5,rep,name=label_keys,json=labelKeys,proto3" json:"label_keys,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *MetricDescriptor) Reset() { *m = MetricDescriptor{} }
+func (m *MetricDescriptor) String() string { return proto.CompactTextString(m) }
+func (*MetricDescriptor) ProtoMessage() {}
+func (*MetricDescriptor) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{1}
+}
+
+func (m *MetricDescriptor) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_MetricDescriptor.Unmarshal(m, b)
+}
+func (m *MetricDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_MetricDescriptor.Marshal(b, m, deterministic)
+}
+func (m *MetricDescriptor) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MetricDescriptor.Merge(m, src)
+}
+func (m *MetricDescriptor) XXX_Size() int {
+ return xxx_messageInfo_MetricDescriptor.Size(m)
+}
+func (m *MetricDescriptor) XXX_DiscardUnknown() {
+ xxx_messageInfo_MetricDescriptor.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MetricDescriptor proto.InternalMessageInfo
+
+func (m *MetricDescriptor) GetName() string {
+ if m != nil {
+ return m.Name
+ }
+ return ""
+}
+
+func (m *MetricDescriptor) GetDescription() string {
+ if m != nil {
+ return m.Description
+ }
+ return ""
+}
+
+func (m *MetricDescriptor) GetUnit() string {
+ if m != nil {
+ return m.Unit
+ }
+ return ""
+}
+
+func (m *MetricDescriptor) GetType() MetricDescriptor_Type {
+ if m != nil {
+ return m.Type
+ }
+ return MetricDescriptor_UNSPECIFIED
+}
+
+func (m *MetricDescriptor) GetLabelKeys() []*LabelKey {
+ if m != nil {
+ return m.LabelKeys
+ }
+ return nil
+}
+
+// Defines a label key associated with a metric descriptor.
+type LabelKey struct {
+ // The key for the label.
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+ // A human-readable description of what this label key represents.
+ Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *LabelKey) Reset() { *m = LabelKey{} }
+func (m *LabelKey) String() string { return proto.CompactTextString(m) }
+func (*LabelKey) ProtoMessage() {}
+func (*LabelKey) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{2}
+}
+
+func (m *LabelKey) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_LabelKey.Unmarshal(m, b)
+}
+func (m *LabelKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_LabelKey.Marshal(b, m, deterministic)
+}
+func (m *LabelKey) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LabelKey.Merge(m, src)
+}
+func (m *LabelKey) XXX_Size() int {
+ return xxx_messageInfo_LabelKey.Size(m)
+}
+func (m *LabelKey) XXX_DiscardUnknown() {
+ xxx_messageInfo_LabelKey.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LabelKey proto.InternalMessageInfo
+
+func (m *LabelKey) GetKey() string {
+ if m != nil {
+ return m.Key
+ }
+ return ""
+}
+
+func (m *LabelKey) GetDescription() string {
+ if m != nil {
+ return m.Description
+ }
+ return ""
+}
+
+// A collection of data points that describes the time-varying values
+// of a metric.
+type TimeSeries struct {
+ // Must be present for cumulative metrics. The time when the cumulative value
+ // was reset to zero. Exclusive. The cumulative value is over the time interval
+ // (start_timestamp, timestamp]. If not specified, the backend can use the
+ // previous recorded value.
+ StartTimestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"`
+ // The set of label values that uniquely identify this timeseries. Applies to
+ // all points. The order of label values must match that of label keys in the
+ // metric descriptor.
+ LabelValues []*LabelValue `protobuf:"bytes,2,rep,name=label_values,json=labelValues,proto3" json:"label_values,omitempty"`
+ // The data points of this timeseries. Point.value type MUST match the
+ // MetricDescriptor.type.
+ Points []*Point `protobuf:"bytes,3,rep,name=points,proto3" json:"points,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *TimeSeries) Reset() { *m = TimeSeries{} }
+func (m *TimeSeries) String() string { return proto.CompactTextString(m) }
+func (*TimeSeries) ProtoMessage() {}
+func (*TimeSeries) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{3}
+}
+
+func (m *TimeSeries) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_TimeSeries.Unmarshal(m, b)
+}
+func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_TimeSeries.Marshal(b, m, deterministic)
+}
+func (m *TimeSeries) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_TimeSeries.Merge(m, src)
+}
+func (m *TimeSeries) XXX_Size() int {
+ return xxx_messageInfo_TimeSeries.Size(m)
+}
+func (m *TimeSeries) XXX_DiscardUnknown() {
+ xxx_messageInfo_TimeSeries.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TimeSeries proto.InternalMessageInfo
+
+func (m *TimeSeries) GetStartTimestamp() *timestamp.Timestamp {
+ if m != nil {
+ return m.StartTimestamp
+ }
+ return nil
+}
+
+func (m *TimeSeries) GetLabelValues() []*LabelValue {
+ if m != nil {
+ return m.LabelValues
+ }
+ return nil
+}
+
+func (m *TimeSeries) GetPoints() []*Point {
+ if m != nil {
+ return m.Points
+ }
+ return nil
+}
+
+type LabelValue struct {
+ // The value for the label.
+ Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+ // If false the value field is ignored and considered not set.
+ // This is used to differentiate a missing label from an empty string.
+ HasValue bool `protobuf:"varint,2,opt,name=has_value,json=hasValue,proto3" json:"has_value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *LabelValue) Reset() { *m = LabelValue{} }
+func (m *LabelValue) String() string { return proto.CompactTextString(m) }
+func (*LabelValue) ProtoMessage() {}
+func (*LabelValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{4}
+}
+
+func (m *LabelValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_LabelValue.Unmarshal(m, b)
+}
+func (m *LabelValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_LabelValue.Marshal(b, m, deterministic)
+}
+func (m *LabelValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_LabelValue.Merge(m, src)
+}
+func (m *LabelValue) XXX_Size() int {
+ return xxx_messageInfo_LabelValue.Size(m)
+}
+func (m *LabelValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_LabelValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_LabelValue proto.InternalMessageInfo
+
+func (m *LabelValue) GetValue() string {
+ if m != nil {
+ return m.Value
+ }
+ return ""
+}
+
+func (m *LabelValue) GetHasValue() bool {
+ if m != nil {
+ return m.HasValue
+ }
+ return false
+}
+
+// A timestamped measurement.
+type Point struct {
+ // The moment when this point was recorded. Inclusive.
+ // If not specified, the timestamp will be decided by the backend.
+ Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
+ // The actual point value.
+ //
+ // Types that are valid to be assigned to Value:
+ // *Point_Int64Value
+ // *Point_DoubleValue
+ // *Point_DistributionValue
+ // *Point_SummaryValue
+ Value isPoint_Value `protobuf_oneof:"value"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Point) Reset() { *m = Point{} }
+func (m *Point) String() string { return proto.CompactTextString(m) }
+func (*Point) ProtoMessage() {}
+func (*Point) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{5}
+}
+
+func (m *Point) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Point.Unmarshal(m, b)
+}
+func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Point.Marshal(b, m, deterministic)
+}
+func (m *Point) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Point.Merge(m, src)
+}
+func (m *Point) XXX_Size() int {
+ return xxx_messageInfo_Point.Size(m)
+}
+func (m *Point) XXX_DiscardUnknown() {
+ xxx_messageInfo_Point.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Point proto.InternalMessageInfo
+
+func (m *Point) GetTimestamp() *timestamp.Timestamp {
+ if m != nil {
+ return m.Timestamp
+ }
+ return nil
+}
+
+type isPoint_Value interface {
+ isPoint_Value()
+}
+
+type Point_Int64Value struct {
+ Int64Value int64 `protobuf:"varint,2,opt,name=int64_value,json=int64Value,proto3,oneof"`
+}
+
+type Point_DoubleValue struct {
+ DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,proto3,oneof"`
+}
+
+type Point_DistributionValue struct {
+ DistributionValue *DistributionValue `protobuf:"bytes,4,opt,name=distribution_value,json=distributionValue,proto3,oneof"`
+}
+
+type Point_SummaryValue struct {
+ SummaryValue *SummaryValue `protobuf:"bytes,5,opt,name=summary_value,json=summaryValue,proto3,oneof"`
+}
+
+func (*Point_Int64Value) isPoint_Value() {}
+
+func (*Point_DoubleValue) isPoint_Value() {}
+
+func (*Point_DistributionValue) isPoint_Value() {}
+
+func (*Point_SummaryValue) isPoint_Value() {}
+
+func (m *Point) GetValue() isPoint_Value {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (m *Point) GetInt64Value() int64 {
+ if x, ok := m.GetValue().(*Point_Int64Value); ok {
+ return x.Int64Value
+ }
+ return 0
+}
+
+func (m *Point) GetDoubleValue() float64 {
+ if x, ok := m.GetValue().(*Point_DoubleValue); ok {
+ return x.DoubleValue
+ }
+ return 0
+}
+
+func (m *Point) GetDistributionValue() *DistributionValue {
+ if x, ok := m.GetValue().(*Point_DistributionValue); ok {
+ return x.DistributionValue
+ }
+ return nil
+}
+
+func (m *Point) GetSummaryValue() *SummaryValue {
+ if x, ok := m.GetValue().(*Point_SummaryValue); ok {
+ return x.SummaryValue
+ }
+ return nil
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*Point) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*Point_Int64Value)(nil),
+ (*Point_DoubleValue)(nil),
+ (*Point_DistributionValue)(nil),
+ (*Point_SummaryValue)(nil),
+ }
+}
+
+// Distribution contains summary statistics for a population of values. It
+// optionally contains a histogram representing the distribution of those
+// values across a set of buckets.
+type DistributionValue struct {
+ // The number of values in the population. Must be non-negative. This value
+ // must equal the sum of the values in bucket_counts if a histogram is
+ // provided.
+ Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
+ // The sum of the values in the population. If count is zero then this field
+ // must be zero.
+ Sum float64 `protobuf:"fixed64,2,opt,name=sum,proto3" json:"sum,omitempty"`
+ // The sum of squared deviations from the mean of the values in the
+ // population. For values x_i this is:
+ //
+ // Sum[i=1..n]((x_i - mean)^2)
+ //
+ // Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition
+ // describes Welford's method for accumulating this sum in one pass.
+ //
+ // If count is zero then this field must be zero.
+ SumOfSquaredDeviation float64 `protobuf:"fixed64,3,opt,name=sum_of_squared_deviation,json=sumOfSquaredDeviation,proto3" json:"sum_of_squared_deviation,omitempty"`
+ // Don't change bucket boundaries within a TimeSeries if your backend doesn't
+ // support this.
+ // TODO(issue #152): consider not required to send bucket options for
+ // optimization.
+ BucketOptions *DistributionValue_BucketOptions `protobuf:"bytes,4,opt,name=bucket_options,json=bucketOptions,proto3" json:"bucket_options,omitempty"`
+ // If the distribution does not have a histogram, then omit this field.
+ // If there is a histogram, then the sum of the values in the Bucket counts
+ // must equal the value in the count field of the distribution.
+ Buckets []*DistributionValue_Bucket `protobuf:"bytes,5,rep,name=buckets,proto3" json:"buckets,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DistributionValue) Reset() { *m = DistributionValue{} }
+func (m *DistributionValue) String() string { return proto.CompactTextString(m) }
+func (*DistributionValue) ProtoMessage() {}
+func (*DistributionValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{6}
+}
+
+func (m *DistributionValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DistributionValue.Unmarshal(m, b)
+}
+func (m *DistributionValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DistributionValue.Marshal(b, m, deterministic)
+}
+func (m *DistributionValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DistributionValue.Merge(m, src)
+}
+func (m *DistributionValue) XXX_Size() int {
+ return xxx_messageInfo_DistributionValue.Size(m)
+}
+func (m *DistributionValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_DistributionValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DistributionValue proto.InternalMessageInfo
+
+func (m *DistributionValue) GetCount() int64 {
+ if m != nil {
+ return m.Count
+ }
+ return 0
+}
+
+func (m *DistributionValue) GetSum() float64 {
+ if m != nil {
+ return m.Sum
+ }
+ return 0
+}
+
+func (m *DistributionValue) GetSumOfSquaredDeviation() float64 {
+ if m != nil {
+ return m.SumOfSquaredDeviation
+ }
+ return 0
+}
+
+func (m *DistributionValue) GetBucketOptions() *DistributionValue_BucketOptions {
+ if m != nil {
+ return m.BucketOptions
+ }
+ return nil
+}
+
+func (m *DistributionValue) GetBuckets() []*DistributionValue_Bucket {
+ if m != nil {
+ return m.Buckets
+ }
+ return nil
+}
+
+// A Distribution may optionally contain a histogram of the values in the
+// population. The bucket boundaries for that histogram are described by
+// BucketOptions.
+//
+// If bucket_options has no type, then there is no histogram associated with
+// the Distribution.
+type DistributionValue_BucketOptions struct {
+ // Types that are valid to be assigned to Type:
+ // *DistributionValue_BucketOptions_Explicit_
+ Type isDistributionValue_BucketOptions_Type `protobuf_oneof:"type"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DistributionValue_BucketOptions) Reset() { *m = DistributionValue_BucketOptions{} }
+func (m *DistributionValue_BucketOptions) String() string { return proto.CompactTextString(m) }
+func (*DistributionValue_BucketOptions) ProtoMessage() {}
+func (*DistributionValue_BucketOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{6, 0}
+}
+
+func (m *DistributionValue_BucketOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DistributionValue_BucketOptions.Unmarshal(m, b)
+}
+func (m *DistributionValue_BucketOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DistributionValue_BucketOptions.Marshal(b, m, deterministic)
+}
+func (m *DistributionValue_BucketOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DistributionValue_BucketOptions.Merge(m, src)
+}
+func (m *DistributionValue_BucketOptions) XXX_Size() int {
+ return xxx_messageInfo_DistributionValue_BucketOptions.Size(m)
+}
+func (m *DistributionValue_BucketOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_DistributionValue_BucketOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DistributionValue_BucketOptions proto.InternalMessageInfo
+
+type isDistributionValue_BucketOptions_Type interface {
+ isDistributionValue_BucketOptions_Type()
+}
+
+type DistributionValue_BucketOptions_Explicit_ struct {
+ Explicit *DistributionValue_BucketOptions_Explicit `protobuf:"bytes,1,opt,name=explicit,proto3,oneof"`
+}
+
+func (*DistributionValue_BucketOptions_Explicit_) isDistributionValue_BucketOptions_Type() {}
+
+func (m *DistributionValue_BucketOptions) GetType() isDistributionValue_BucketOptions_Type {
+ if m != nil {
+ return m.Type
+ }
+ return nil
+}
+
+func (m *DistributionValue_BucketOptions) GetExplicit() *DistributionValue_BucketOptions_Explicit {
+ if x, ok := m.GetType().(*DistributionValue_BucketOptions_Explicit_); ok {
+ return x.Explicit
+ }
+ return nil
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*DistributionValue_BucketOptions) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*DistributionValue_BucketOptions_Explicit_)(nil),
+ }
+}
+
+// Specifies a set of buckets with arbitrary upper-bounds.
+// This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
+// index i are:
+//
+// [0, bucket_bounds[i]) for i == 0
+// [bucket_bounds[i-1], bucket_bounds[i]) for 0 < i < N-1
+// [bucket_bounds[i], +infinity) for i == N-1
+type DistributionValue_BucketOptions_Explicit struct {
+ // The values must be strictly increasing and > 0.
+ Bounds []float64 `protobuf:"fixed64,1,rep,packed,name=bounds,proto3" json:"bounds,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DistributionValue_BucketOptions_Explicit) Reset() {
+ *m = DistributionValue_BucketOptions_Explicit{}
+}
+func (m *DistributionValue_BucketOptions_Explicit) String() string { return proto.CompactTextString(m) }
+func (*DistributionValue_BucketOptions_Explicit) ProtoMessage() {}
+func (*DistributionValue_BucketOptions_Explicit) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{6, 0, 0}
+}
+
+func (m *DistributionValue_BucketOptions_Explicit) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DistributionValue_BucketOptions_Explicit.Unmarshal(m, b)
+}
+func (m *DistributionValue_BucketOptions_Explicit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DistributionValue_BucketOptions_Explicit.Marshal(b, m, deterministic)
+}
+func (m *DistributionValue_BucketOptions_Explicit) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DistributionValue_BucketOptions_Explicit.Merge(m, src)
+}
+func (m *DistributionValue_BucketOptions_Explicit) XXX_Size() int {
+ return xxx_messageInfo_DistributionValue_BucketOptions_Explicit.Size(m)
+}
+func (m *DistributionValue_BucketOptions_Explicit) XXX_DiscardUnknown() {
+ xxx_messageInfo_DistributionValue_BucketOptions_Explicit.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DistributionValue_BucketOptions_Explicit proto.InternalMessageInfo
+
+func (m *DistributionValue_BucketOptions_Explicit) GetBounds() []float64 {
+ if m != nil {
+ return m.Bounds
+ }
+ return nil
+}
+
+type DistributionValue_Bucket struct {
+ // The number of values in each bucket of the histogram, as described in
+ // bucket_bounds.
+ Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
+ // If the distribution does not have a histogram, then omit this field.
+ Exemplar *DistributionValue_Exemplar `protobuf:"bytes,2,opt,name=exemplar,proto3" json:"exemplar,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DistributionValue_Bucket) Reset() { *m = DistributionValue_Bucket{} }
+func (m *DistributionValue_Bucket) String() string { return proto.CompactTextString(m) }
+func (*DistributionValue_Bucket) ProtoMessage() {}
+func (*DistributionValue_Bucket) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{6, 1}
+}
+
+func (m *DistributionValue_Bucket) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DistributionValue_Bucket.Unmarshal(m, b)
+}
+func (m *DistributionValue_Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DistributionValue_Bucket.Marshal(b, m, deterministic)
+}
+func (m *DistributionValue_Bucket) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DistributionValue_Bucket.Merge(m, src)
+}
+func (m *DistributionValue_Bucket) XXX_Size() int {
+ return xxx_messageInfo_DistributionValue_Bucket.Size(m)
+}
+func (m *DistributionValue_Bucket) XXX_DiscardUnknown() {
+ xxx_messageInfo_DistributionValue_Bucket.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DistributionValue_Bucket proto.InternalMessageInfo
+
+func (m *DistributionValue_Bucket) GetCount() int64 {
+ if m != nil {
+ return m.Count
+ }
+ return 0
+}
+
+func (m *DistributionValue_Bucket) GetExemplar() *DistributionValue_Exemplar {
+ if m != nil {
+ return m.Exemplar
+ }
+ return nil
+}
+
+// Exemplars are example points that may be used to annotate aggregated
+// Distribution values. They are metadata that gives information about a
+// particular value added to a Distribution bucket.
+type DistributionValue_Exemplar struct {
+ // Value of the exemplar point. It determines which bucket the exemplar
+ // belongs to.
+ Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
+ // The observation (sampling) time of the above value.
+ Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
+ // Contextual information about the example value.
+ Attachments map[string]string `protobuf:"bytes,3,rep,name=attachments,proto3" json:"attachments,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DistributionValue_Exemplar) Reset() { *m = DistributionValue_Exemplar{} }
+func (m *DistributionValue_Exemplar) String() string { return proto.CompactTextString(m) }
+func (*DistributionValue_Exemplar) ProtoMessage() {}
+func (*DistributionValue_Exemplar) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{6, 2}
+}
+
+func (m *DistributionValue_Exemplar) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DistributionValue_Exemplar.Unmarshal(m, b)
+}
+func (m *DistributionValue_Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DistributionValue_Exemplar.Marshal(b, m, deterministic)
+}
+func (m *DistributionValue_Exemplar) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DistributionValue_Exemplar.Merge(m, src)
+}
+func (m *DistributionValue_Exemplar) XXX_Size() int {
+ return xxx_messageInfo_DistributionValue_Exemplar.Size(m)
+}
+func (m *DistributionValue_Exemplar) XXX_DiscardUnknown() {
+ xxx_messageInfo_DistributionValue_Exemplar.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DistributionValue_Exemplar proto.InternalMessageInfo
+
+func (m *DistributionValue_Exemplar) GetValue() float64 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+func (m *DistributionValue_Exemplar) GetTimestamp() *timestamp.Timestamp {
+ if m != nil {
+ return m.Timestamp
+ }
+ return nil
+}
+
+func (m *DistributionValue_Exemplar) GetAttachments() map[string]string {
+ if m != nil {
+ return m.Attachments
+ }
+ return nil
+}
+
+// The start_timestamp only applies to the count and sum in the SummaryValue.
+type SummaryValue struct {
+ // The total number of recorded values since start_time. Optional since
+ // some systems don't expose this.
+ Count *wrappers.Int64Value `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
+ // The total sum of recorded values since start_time. Optional since some
+ // systems don't expose this. If count is zero then this field must be zero.
+ // This field must be unset if the sum is not available.
+ Sum *wrappers.DoubleValue `protobuf:"bytes,2,opt,name=sum,proto3" json:"sum,omitempty"`
+ // Values calculated over an arbitrary time window.
+ Snapshot *SummaryValue_Snapshot `protobuf:"bytes,3,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SummaryValue) Reset() { *m = SummaryValue{} }
+func (m *SummaryValue) String() string { return proto.CompactTextString(m) }
+func (*SummaryValue) ProtoMessage() {}
+func (*SummaryValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{7}
+}
+
+func (m *SummaryValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SummaryValue.Unmarshal(m, b)
+}
+func (m *SummaryValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SummaryValue.Marshal(b, m, deterministic)
+}
+func (m *SummaryValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SummaryValue.Merge(m, src)
+}
+func (m *SummaryValue) XXX_Size() int {
+ return xxx_messageInfo_SummaryValue.Size(m)
+}
+func (m *SummaryValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_SummaryValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SummaryValue proto.InternalMessageInfo
+
+func (m *SummaryValue) GetCount() *wrappers.Int64Value {
+ if m != nil {
+ return m.Count
+ }
+ return nil
+}
+
+func (m *SummaryValue) GetSum() *wrappers.DoubleValue {
+ if m != nil {
+ return m.Sum
+ }
+ return nil
+}
+
+func (m *SummaryValue) GetSnapshot() *SummaryValue_Snapshot {
+ if m != nil {
+ return m.Snapshot
+ }
+ return nil
+}
+
+// The values in this message can be reset at arbitrary unknown times, with
+// the requirement that all of them are reset at the same time.
+type SummaryValue_Snapshot struct {
+ // The number of values in the snapshot. Optional since some systems don't
+ // expose this.
+ Count *wrappers.Int64Value `protobuf:"bytes,1,opt,name=count,proto3" json:"count,omitempty"`
+ // The sum of values in the snapshot. Optional since some systems don't
+ // expose this. If count is zero then this field must be zero or not set
+ // (if not supported).
+ Sum *wrappers.DoubleValue `protobuf:"bytes,2,opt,name=sum,proto3" json:"sum,omitempty"`
+ // A list of values at different percentiles of the distribution calculated
+ // from the current snapshot. The percentiles must be strictly increasing.
+ PercentileValues []*SummaryValue_Snapshot_ValueAtPercentile `protobuf:"bytes,3,rep,name=percentile_values,json=percentileValues,proto3" json:"percentile_values,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SummaryValue_Snapshot) Reset() { *m = SummaryValue_Snapshot{} }
+func (m *SummaryValue_Snapshot) String() string { return proto.CompactTextString(m) }
+func (*SummaryValue_Snapshot) ProtoMessage() {}
+func (*SummaryValue_Snapshot) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{7, 0}
+}
+
+func (m *SummaryValue_Snapshot) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SummaryValue_Snapshot.Unmarshal(m, b)
+}
+func (m *SummaryValue_Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SummaryValue_Snapshot.Marshal(b, m, deterministic)
+}
+func (m *SummaryValue_Snapshot) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SummaryValue_Snapshot.Merge(m, src)
+}
+func (m *SummaryValue_Snapshot) XXX_Size() int {
+ return xxx_messageInfo_SummaryValue_Snapshot.Size(m)
+}
+func (m *SummaryValue_Snapshot) XXX_DiscardUnknown() {
+ xxx_messageInfo_SummaryValue_Snapshot.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SummaryValue_Snapshot proto.InternalMessageInfo
+
+func (m *SummaryValue_Snapshot) GetCount() *wrappers.Int64Value {
+ if m != nil {
+ return m.Count
+ }
+ return nil
+}
+
+func (m *SummaryValue_Snapshot) GetSum() *wrappers.DoubleValue {
+ if m != nil {
+ return m.Sum
+ }
+ return nil
+}
+
+func (m *SummaryValue_Snapshot) GetPercentileValues() []*SummaryValue_Snapshot_ValueAtPercentile {
+ if m != nil {
+ return m.PercentileValues
+ }
+ return nil
+}
+
+// Represents the value at a given percentile of a distribution.
+type SummaryValue_Snapshot_ValueAtPercentile struct {
+ // The percentile of a distribution. Must be in the interval
+ // (0.0, 100.0].
+ Percentile float64 `protobuf:"fixed64,1,opt,name=percentile,proto3" json:"percentile,omitempty"`
+ // The value at the given percentile of a distribution.
+ Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SummaryValue_Snapshot_ValueAtPercentile) Reset() {
+ *m = SummaryValue_Snapshot_ValueAtPercentile{}
+}
+func (m *SummaryValue_Snapshot_ValueAtPercentile) String() string { return proto.CompactTextString(m) }
+func (*SummaryValue_Snapshot_ValueAtPercentile) ProtoMessage() {}
+func (*SummaryValue_Snapshot_ValueAtPercentile) Descriptor() ([]byte, []int) {
+ return fileDescriptor_0ee3deb72053811a, []int{7, 0, 0}
+}
+
+func (m *SummaryValue_Snapshot_ValueAtPercentile) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile.Unmarshal(m, b)
+}
+func (m *SummaryValue_Snapshot_ValueAtPercentile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile.Marshal(b, m, deterministic)
+}
+func (m *SummaryValue_Snapshot_ValueAtPercentile) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile.Merge(m, src)
+}
+func (m *SummaryValue_Snapshot_ValueAtPercentile) XXX_Size() int {
+ return xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile.Size(m)
+}
+func (m *SummaryValue_Snapshot_ValueAtPercentile) XXX_DiscardUnknown() {
+ xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SummaryValue_Snapshot_ValueAtPercentile proto.InternalMessageInfo
+
+func (m *SummaryValue_Snapshot_ValueAtPercentile) GetPercentile() float64 {
+ if m != nil {
+ return m.Percentile
+ }
+ return 0
+}
+
+func (m *SummaryValue_Snapshot_ValueAtPercentile) GetValue() float64 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+func init() {
+ proto.RegisterEnum("opencensus.proto.metrics.v1.MetricDescriptor_Type", MetricDescriptor_Type_name, MetricDescriptor_Type_value)
+ proto.RegisterType((*Metric)(nil), "opencensus.proto.metrics.v1.Metric")
+ proto.RegisterType((*MetricDescriptor)(nil), "opencensus.proto.metrics.v1.MetricDescriptor")
+ proto.RegisterType((*LabelKey)(nil), "opencensus.proto.metrics.v1.LabelKey")
+ proto.RegisterType((*TimeSeries)(nil), "opencensus.proto.metrics.v1.TimeSeries")
+ proto.RegisterType((*LabelValue)(nil), "opencensus.proto.metrics.v1.LabelValue")
+ proto.RegisterType((*Point)(nil), "opencensus.proto.metrics.v1.Point")
+ proto.RegisterType((*DistributionValue)(nil), "opencensus.proto.metrics.v1.DistributionValue")
+ proto.RegisterType((*DistributionValue_BucketOptions)(nil), "opencensus.proto.metrics.v1.DistributionValue.BucketOptions")
+ proto.RegisterType((*DistributionValue_BucketOptions_Explicit)(nil), "opencensus.proto.metrics.v1.DistributionValue.BucketOptions.Explicit")
+ proto.RegisterType((*DistributionValue_Bucket)(nil), "opencensus.proto.metrics.v1.DistributionValue.Bucket")
+ proto.RegisterType((*DistributionValue_Exemplar)(nil), "opencensus.proto.metrics.v1.DistributionValue.Exemplar")
+ proto.RegisterMapType((map[string]string)(nil), "opencensus.proto.metrics.v1.DistributionValue.Exemplar.AttachmentsEntry")
+ proto.RegisterType((*SummaryValue)(nil), "opencensus.proto.metrics.v1.SummaryValue")
+ proto.RegisterType((*SummaryValue_Snapshot)(nil), "opencensus.proto.metrics.v1.SummaryValue.Snapshot")
+ proto.RegisterType((*SummaryValue_Snapshot_ValueAtPercentile)(nil), "opencensus.proto.metrics.v1.SummaryValue.Snapshot.ValueAtPercentile")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/metrics/v1/metrics.proto", fileDescriptor_0ee3deb72053811a)
+}
+
+var fileDescriptor_0ee3deb72053811a = []byte{
+ // 1118 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdd, 0x6e, 0x1b, 0xc5,
+ 0x17, 0xcf, 0xda, 0x8e, 0xe3, 0x9c, 0x75, 0xd2, 0xf5, 0xa8, 0xed, 0xdf, 0x72, 0xfe, 0x0a, 0x61,
+ 0x11, 0x90, 0x0a, 0x65, 0xad, 0x98, 0xd2, 0x56, 0x15, 0x2a, 0x8a, 0x63, 0x37, 0x31, 0x24, 0xb1,
+ 0x35, 0xb6, 0x23, 0xd1, 0x1b, 0x6b, 0xbd, 0x9e, 0x24, 0x4b, 0xbc, 0x1f, 0xdd, 0x99, 0x0d, 0xf8,
+ 0x05, 0x78, 0x02, 0xc4, 0x35, 0xb7, 0x88, 0xe7, 0xe0, 0x8a, 0x27, 0xe0, 0x15, 0xb8, 0x41, 0xbc,
+ 0x01, 0xda, 0x99, 0xd9, 0x8f, 0xc4, 0x60, 0xea, 0x22, 0x71, 0x77, 0xe6, 0xcc, 0x39, 0xbf, 0xfd,
+ 0x9d, 0xcf, 0x1d, 0x78, 0xe4, 0xf9, 0xc4, 0xb5, 0x88, 0x4b, 0x43, 0x5a, 0xf7, 0x03, 0x8f, 0x79,
+ 0x75, 0x87, 0xb0, 0xc0, 0xb6, 0x68, 0xfd, 0x66, 0x3f, 0x16, 0x0d, 0x7e, 0x81, 0xb6, 0x52, 0x53,
+ 0xa1, 0x31, 0xe2, 0xfb, 0x9b, 0xfd, 0xda, 0x3b, 0x97, 0x9e, 0x77, 0x39, 0x25, 0x02, 0x63, 0x1c,
+ 0x5e, 0xd4, 0x99, 0xed, 0x10, 0xca, 0x4c, 0xc7, 0x17, 0xb6, 0xb5, 0xed, 0xbb, 0x06, 0x5f, 0x07,
+ 0xa6, 0xef, 0x93, 0x40, 0x62, 0xd5, 0x3e, 0x9a, 0x23, 0x12, 0x10, 0xea, 0x85, 0x81, 0x45, 0x22,
+ 0x26, 0xb1, 0x2c, 0x8c, 0xf5, 0x3f, 0x14, 0x28, 0x9e, 0xf2, 0x8f, 0xa3, 0x57, 0x50, 0x11, 0x34,
+ 0x46, 0x13, 0x42, 0xad, 0xc0, 0xf6, 0x99, 0x17, 0x54, 0x95, 0x1d, 0x65, 0x57, 0x6d, 0xec, 0x19,
+ 0x0b, 0x18, 0x1b, 0xc2, 0xbf, 0x95, 0x38, 0x61, 0xcd, 0xb9, 0xa3, 0x41, 0x47, 0x00, 0x3c, 0x0c,
+ 0x12, 0xd8, 0x84, 0x56, 0x73, 0x3b, 0xf9, 0x5d, 0xb5, 0xf1, 0xe1, 0x42, 0xd0, 0x81, 0xed, 0x90,
+ 0x3e, 0x37, 0xc7, 0x19, 0x57, 0xd4, 0x84, 0x52, 0x1c, 0x41, 0x35, 0xcf, 0xb9, 0x7d, 0x30, 0x0f,
+ 0x93, 0xc4, 0x78, 0xb3, 0x6f, 0x60, 0x29, 0xe3, 0xc4, 0x4f, 0xff, 0x3e, 0x0f, 0xda, 0x5d, 0xce,
+ 0x08, 0x41, 0xc1, 0x35, 0x1d, 0xc2, 0x03, 0x5e, 0xc7, 0x5c, 0x46, 0x3b, 0xa0, 0xc6, 0xa9, 0xb0,
+ 0x3d, 0xb7, 0x9a, 0xe3, 0x57, 0x59, 0x55, 0xe4, 0x15, 0xba, 0x36, 0xe3, 0x54, 0xd6, 0x31, 0x97,
+ 0xd1, 0x4b, 0x28, 0xb0, 0x99, 0x4f, 0xaa, 0x85, 0x1d, 0x65, 0x77, 0xb3, 0xd1, 0x58, 0x2a, 0x75,
+ 0xc6, 0x60, 0xe6, 0x13, 0xcc, 0xfd, 0x51, 0x0b, 0x60, 0x6a, 0x8e, 0xc9, 0x74, 0x74, 0x4d, 0x66,
+ 0xb4, 0xba, 0xca, 0x73, 0xf6, 0xfe, 0x42, 0xb4, 0x93, 0xc8, 0xfc, 0x0b, 0x32, 0xc3, 0xeb, 0x53,
+ 0x29, 0x51, 0xfd, 0x47, 0x05, 0x0a, 0x11, 0x28, 0xba, 0x07, 0xea, 0xf0, 0xac, 0xdf, 0x6b, 0x1f,
+ 0x76, 0x5e, 0x76, 0xda, 0x2d, 0x6d, 0x25, 0x52, 0x1c, 0x1d, 0x0c, 0x8f, 0xda, 0xa3, 0xce, 0xd9,
+ 0xe0, 0xc9, 0x63, 0x4d, 0x41, 0x1a, 0x94, 0x85, 0xa2, 0xd5, 0x1d, 0x36, 0x4f, 0xda, 0x5a, 0x0e,
+ 0x3d, 0x04, 0x24, 0x35, 0x9d, 0xfe, 0x00, 0x77, 0x9a, 0xc3, 0x41, 0xa7, 0x7b, 0xa6, 0xe5, 0xd1,
+ 0x7d, 0xd0, 0x0e, 0x87, 0xa7, 0xc3, 0x93, 0x83, 0x41, 0xe7, 0x3c, 0xf6, 0x2f, 0xa0, 0x07, 0x50,
+ 0xc9, 0x68, 0x25, 0xc8, 0x2a, 0xda, 0x82, 0xff, 0x65, 0xd5, 0x59, 0xa4, 0x22, 0x52, 0x61, 0xad,
+ 0x3f, 0x3c, 0x3d, 0x3d, 0xc0, 0x5f, 0x6a, 0x6b, 0xfa, 0x0b, 0x28, 0xc5, 0x21, 0x20, 0x0d, 0xf2,
+ 0xd7, 0x64, 0x26, 0xcb, 0x11, 0x89, 0xff, 0x5c, 0x0d, 0xfd, 0x57, 0x05, 0x20, 0xed, 0x1b, 0x74,
+ 0x08, 0xf7, 0x28, 0x33, 0x03, 0x36, 0x4a, 0x26, 0x48, 0xb6, 0x73, 0xcd, 0x10, 0x23, 0x64, 0xc4,
+ 0x23, 0xc4, 0xbb, 0x8d, 0x5b, 0xe0, 0x4d, 0xee, 0x92, 0x9c, 0xd1, 0xe7, 0x50, 0x16, 0x55, 0xb8,
+ 0x31, 0xa7, 0xe1, 0x1b, 0xf6, 0x2e, 0x0f, 0xe2, 0x3c, 0xb2, 0xc7, 0xea, 0x34, 0x91, 0x29, 0x7a,
+ 0x0e, 0x45, 0xdf, 0xb3, 0x5d, 0x46, 0xab, 0x79, 0x8e, 0xa2, 0x2f, 0x44, 0xe9, 0x45, 0xa6, 0x58,
+ 0x7a, 0xe8, 0x9f, 0x01, 0xa4, 0xb0, 0xe8, 0x3e, 0xac, 0x72, 0x3e, 0x32, 0x3f, 0xe2, 0x80, 0xb6,
+ 0x60, 0xfd, 0xca, 0xa4, 0x82, 0x29, 0xcf, 0x4f, 0x09, 0x97, 0xae, 0x4c, 0xca, 0x5d, 0xf4, 0x9f,
+ 0x73, 0xb0, 0xca, 0x21, 0xd1, 0x33, 0x58, 0x5f, 0x26, 0x23, 0xa9, 0x31, 0x7a, 0x17, 0x54, 0xdb,
+ 0x65, 0x4f, 0x1e, 0x67, 0x3e, 0x91, 0x3f, 0x5e, 0xc1, 0xc0, 0x95, 0x82, 0xd9, 0x7b, 0x50, 0x9e,
+ 0x78, 0xe1, 0x78, 0x4a, 0xa4, 0x4d, 0x34, 0x19, 0xca, 0xf1, 0x0a, 0x56, 0x85, 0x56, 0x18, 0x8d,
+ 0x00, 0x4d, 0x6c, 0xca, 0x02, 0x7b, 0x1c, 0x46, 0x85, 0x93, 0xa6, 0x05, 0x4e, 0xc5, 0x58, 0x98,
+ 0x94, 0x56, 0xc6, 0x8d, 0x63, 0x1d, 0xaf, 0xe0, 0xca, 0xe4, 0xae, 0x12, 0xf5, 0x60, 0x83, 0x86,
+ 0x8e, 0x63, 0x06, 0x33, 0x89, 0xbd, 0xca, 0xb1, 0x1f, 0x2d, 0xc4, 0xee, 0x0b, 0x8f, 0x18, 0xb6,
+ 0x4c, 0x33, 0xe7, 0xe6, 0x9a, 0xcc, 0xb8, 0xfe, 0x4b, 0x11, 0x2a, 0x73, 0x2c, 0xa2, 0x82, 0x58,
+ 0x5e, 0xe8, 0x32, 0x9e, 0xcf, 0x3c, 0x16, 0x87, 0xa8, 0x89, 0x69, 0xe8, 0xf0, 0x3c, 0x29, 0x38,
+ 0x12, 0xd1, 0x53, 0xa8, 0xd2, 0xd0, 0x19, 0x79, 0x17, 0x23, 0xfa, 0x3a, 0x34, 0x03, 0x32, 0x19,
+ 0x4d, 0xc8, 0x8d, 0x6d, 0xf2, 0x8e, 0xe6, 0xa9, 0xc2, 0x0f, 0x68, 0xe8, 0x74, 0x2f, 0xfa, 0xe2,
+ 0xb6, 0x15, 0x5f, 0x22, 0x0b, 0x36, 0xc7, 0xa1, 0x75, 0x4d, 0xd8, 0xc8, 0xe3, 0xcd, 0x4e, 0x65,
+ 0xba, 0x3e, 0x5d, 0x2e, 0x5d, 0x46, 0x93, 0x83, 0x74, 0x05, 0x06, 0xde, 0x18, 0x67, 0x8f, 0xa8,
+ 0x0b, 0x6b, 0x42, 0x11, 0xef, 0x9b, 0x4f, 0xde, 0x0a, 0x1d, 0xc7, 0x28, 0xb5, 0x1f, 0x14, 0xd8,
+ 0xb8, 0xf5, 0x45, 0x64, 0x41, 0x89, 0x7c, 0xe3, 0x4f, 0x6d, 0xcb, 0x66, 0xb2, 0xf7, 0xda, 0xff,
+ 0x26, 0x02, 0xa3, 0x2d, 0xc1, 0x8e, 0x57, 0x70, 0x02, 0x5c, 0xd3, 0xa1, 0x14, 0xeb, 0xd1, 0x43,
+ 0x28, 0x8e, 0xbd, 0xd0, 0x9d, 0xd0, 0xaa, 0xb2, 0x93, 0xdf, 0x55, 0xb0, 0x3c, 0x35, 0x8b, 0x62,
+ 0x4d, 0xd7, 0x28, 0x14, 0x05, 0xe2, 0xdf, 0xd4, 0xb0, 0x1f, 0x11, 0x26, 0x8e, 0x3f, 0x35, 0x03,
+ 0x5e, 0x48, 0xb5, 0xf1, 0x74, 0x49, 0xc2, 0x6d, 0xe9, 0x8e, 0x13, 0xa0, 0xda, 0xb7, 0xb9, 0x88,
+ 0xa1, 0x38, 0xdc, 0x1e, 0x66, 0x25, 0x1e, 0xe6, 0x5b, 0x53, 0x9a, 0x5b, 0x66, 0x4a, 0xbf, 0x02,
+ 0xd5, 0x64, 0xcc, 0xb4, 0xae, 0x1c, 0x92, 0xee, 0x9a, 0xe3, 0xb7, 0x24, 0x6d, 0x1c, 0xa4, 0x50,
+ 0x6d, 0x97, 0x05, 0x33, 0x9c, 0x05, 0xaf, 0xbd, 0x00, 0xed, 0xae, 0xc1, 0x5f, 0xac, 0xee, 0x24,
+ 0xc2, 0x5c, 0x66, 0x5d, 0x3d, 0xcf, 0x3d, 0x53, 0xf4, 0xdf, 0xf3, 0x50, 0xce, 0xce, 0x1d, 0xda,
+ 0xcf, 0x16, 0x41, 0x6d, 0x6c, 0xcd, 0x85, 0xdc, 0x49, 0x76, 0x4d, 0x5c, 0x21, 0x23, 0x9d, 0x32,
+ 0xb5, 0xf1, 0xff, 0x39, 0x87, 0x56, 0xba, 0x78, 0xc4, 0x0c, 0x9e, 0x41, 0x89, 0xba, 0xa6, 0x4f,
+ 0xaf, 0x3c, 0x26, 0xdf, 0x10, 0x8d, 0x37, 0xde, 0x0b, 0x46, 0x5f, 0x7a, 0xe2, 0x04, 0xa3, 0xf6,
+ 0x53, 0x0e, 0x4a, 0xb1, 0xfa, 0xbf, 0xe0, 0xff, 0x1a, 0x2a, 0x3e, 0x09, 0x2c, 0xe2, 0x32, 0x3b,
+ 0x5e, 0xb3, 0x71, 0x95, 0x5b, 0xcb, 0x07, 0x62, 0xf0, 0xe3, 0x01, 0xeb, 0x25, 0x90, 0x58, 0x4b,
+ 0xe1, 0xc5, 0x9f, 0xab, 0xd6, 0x81, 0xca, 0x9c, 0x19, 0xda, 0x06, 0x48, 0x0d, 0x65, 0xf3, 0x66,
+ 0x34, 0xb7, 0xab, 0x1e, 0xf7, 0x75, 0xf3, 0x3b, 0x05, 0xb6, 0x6d, 0x6f, 0x11, 0xcf, 0x66, 0x59,
+ 0x3c, 0x8b, 0x68, 0x2f, 0xba, 0xe8, 0x29, 0xaf, 0x5a, 0x97, 0x36, 0xbb, 0x0a, 0xc7, 0x86, 0xe5,
+ 0x39, 0x75, 0xe1, 0xb3, 0x67, 0xbb, 0x94, 0x05, 0x61, 0xd4, 0x74, 0x7c, 0x3d, 0xd6, 0x53, 0xb8,
+ 0x3d, 0xf1, 0xe6, 0xbd, 0x24, 0xee, 0xde, 0x65, 0xf6, 0x0d, 0xfe, 0x5b, 0x6e, 0xab, 0xeb, 0x13,
+ 0xf7, 0x50, 0x7c, 0x93, 0x43, 0xcb, 0xe7, 0x17, 0x35, 0xce, 0xf7, 0xc7, 0x45, 0xee, 0xf6, 0xf1,
+ 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xd0, 0xb4, 0x8d, 0xc7, 0x0b, 0x00, 0x00,
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go
new file mode 100644
index 000000000..5dba6a2a0
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1/resource.pb.go
@@ -0,0 +1,100 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/resource/v1/resource.proto
+
+package v1
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// Resource information.
+type Resource struct {
+ // Type identifier for the resource.
+ Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
+ // Set of labels that describe the resource.
+ Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Resource) Reset() { *m = Resource{} }
+func (m *Resource) String() string { return proto.CompactTextString(m) }
+func (*Resource) ProtoMessage() {}
+func (*Resource) Descriptor() ([]byte, []int) {
+ return fileDescriptor_584700775a2fc762, []int{0}
+}
+
+func (m *Resource) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Resource.Unmarshal(m, b)
+}
+func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Resource.Marshal(b, m, deterministic)
+}
+func (m *Resource) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Resource.Merge(m, src)
+}
+func (m *Resource) XXX_Size() int {
+ return xxx_messageInfo_Resource.Size(m)
+}
+func (m *Resource) XXX_DiscardUnknown() {
+ xxx_messageInfo_Resource.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Resource proto.InternalMessageInfo
+
+func (m *Resource) GetType() string {
+ if m != nil {
+ return m.Type
+ }
+ return ""
+}
+
+func (m *Resource) GetLabels() map[string]string {
+ if m != nil {
+ return m.Labels
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*Resource)(nil), "opencensus.proto.resource.v1.Resource")
+ proto.RegisterMapType((map[string]string)(nil), "opencensus.proto.resource.v1.Resource.LabelsEntry")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/resource/v1/resource.proto", fileDescriptor_584700775a2fc762)
+}
+
+var fileDescriptor_584700775a2fc762 = []byte{
+ // 251 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xce, 0x2f, 0x48, 0xcd,
+ 0x4b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x4a, 0x2d,
+ 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0x84, 0xb3, 0xf5, 0xc0, 0x52, 0x42, 0x32, 0x08,
+ 0xc5, 0x10, 0x11, 0x3d, 0xb8, 0x82, 0x32, 0x43, 0xa5, 0xa5, 0x8c, 0x5c, 0x1c, 0x41, 0x50, 0xbe,
+ 0x90, 0x10, 0x17, 0x4b, 0x49, 0x65, 0x41, 0xaa, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x98,
+ 0x2d, 0xe4, 0xc5, 0xc5, 0x96, 0x93, 0x98, 0x94, 0x9a, 0x53, 0x2c, 0xc1, 0xa4, 0xc0, 0xac, 0xc1,
+ 0x6d, 0x64, 0xa4, 0x87, 0xcf, 0x3c, 0x3d, 0x98, 0x59, 0x7a, 0x3e, 0x60, 0x4d, 0xae, 0x79, 0x25,
+ 0x45, 0x95, 0x41, 0x50, 0x13, 0xa4, 0x2c, 0xb9, 0xb8, 0x91, 0x84, 0x85, 0x04, 0xb8, 0x98, 0xb3,
+ 0x53, 0x2b, 0xa1, 0xb6, 0x81, 0x98, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12,
+ 0x4c, 0x60, 0x31, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, 0x69, 0x06, 0x23, 0x97, 0x7c, 0x66, 0x3e,
+ 0x5e, 0xbb, 0x9d, 0x78, 0x61, 0x96, 0x07, 0x80, 0xa4, 0x02, 0x18, 0xa3, 0x5c, 0xd3, 0x33, 0x4b,
+ 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x21, 0xba, 0x74, 0x33, 0xf3, 0x8a, 0x4b, 0x8a,
+ 0x4a, 0x73, 0x53, 0xf3, 0x4a, 0x12, 0x4b, 0x32, 0xf3, 0xf3, 0xf4, 0x11, 0x06, 0xea, 0x42, 0x42,
+ 0x32, 0x3d, 0x35, 0x4f, 0x37, 0x1d, 0x25, 0x40, 0x5f, 0x31, 0xc9, 0xf8, 0x17, 0xa4, 0xe6, 0x39,
+ 0x43, 0xac, 0x05, 0x9b, 0x8d, 0xf0, 0x66, 0x98, 0x61, 0x12, 0x1b, 0x58, 0xa3, 0x31, 0x20, 0x00,
+ 0x00, 0xff, 0xff, 0xcf, 0x32, 0xff, 0x46, 0x96, 0x01, 0x00, 0x00,
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go
new file mode 100644
index 000000000..2f4ab19b5
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace.pb.go
@@ -0,0 +1,1553 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/trace/v1/trace.proto
+
+package v1
+
+import (
+ fmt "fmt"
+ v1 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
+ proto "github.com/golang/protobuf/proto"
+ timestamp "github.com/golang/protobuf/ptypes/timestamp"
+ wrappers "github.com/golang/protobuf/ptypes/wrappers"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// Type of span. Can be used to specify additional relationships between spans
+// in addition to a parent/child relationship.
+type Span_SpanKind int32
+
+const (
+ // Unspecified.
+ Span_SPAN_KIND_UNSPECIFIED Span_SpanKind = 0
+ // Indicates that the span covers server-side handling of an RPC or other
+ // remote network request.
+ Span_SERVER Span_SpanKind = 1
+ // Indicates that the span covers the client-side wrapper around an RPC or
+ // other remote request.
+ Span_CLIENT Span_SpanKind = 2
+)
+
+var Span_SpanKind_name = map[int32]string{
+ 0: "SPAN_KIND_UNSPECIFIED",
+ 1: "SERVER",
+ 2: "CLIENT",
+}
+
+var Span_SpanKind_value = map[string]int32{
+ "SPAN_KIND_UNSPECIFIED": 0,
+ "SERVER": 1,
+ "CLIENT": 2,
+}
+
+func (x Span_SpanKind) String() string {
+ return proto.EnumName(Span_SpanKind_name, int32(x))
+}
+
+func (Span_SpanKind) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 0}
+}
+
+// Indicates whether the message was sent or received.
+type Span_TimeEvent_MessageEvent_Type int32
+
+const (
+ // Unknown event type.
+ Span_TimeEvent_MessageEvent_TYPE_UNSPECIFIED Span_TimeEvent_MessageEvent_Type = 0
+ // Indicates a sent message.
+ Span_TimeEvent_MessageEvent_SENT Span_TimeEvent_MessageEvent_Type = 1
+ // Indicates a received message.
+ Span_TimeEvent_MessageEvent_RECEIVED Span_TimeEvent_MessageEvent_Type = 2
+)
+
+var Span_TimeEvent_MessageEvent_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "SENT",
+ 2: "RECEIVED",
+}
+
+var Span_TimeEvent_MessageEvent_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "SENT": 1,
+ "RECEIVED": 2,
+}
+
+func (x Span_TimeEvent_MessageEvent_Type) String() string {
+ return proto.EnumName(Span_TimeEvent_MessageEvent_Type_name, int32(x))
+}
+
+func (Span_TimeEvent_MessageEvent_Type) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 2, 1, 0}
+}
+
+// The relationship of the current span relative to the linked span: child,
+// parent, or unspecified.
+type Span_Link_Type int32
+
+const (
+ // The relationship of the two spans is unknown, or known but other
+ // than parent-child.
+ Span_Link_TYPE_UNSPECIFIED Span_Link_Type = 0
+ // The linked span is a child of the current span.
+ Span_Link_CHILD_LINKED_SPAN Span_Link_Type = 1
+ // The linked span is a parent of the current span.
+ Span_Link_PARENT_LINKED_SPAN Span_Link_Type = 2
+)
+
+var Span_Link_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "CHILD_LINKED_SPAN",
+ 2: "PARENT_LINKED_SPAN",
+}
+
+var Span_Link_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "CHILD_LINKED_SPAN": 1,
+ "PARENT_LINKED_SPAN": 2,
+}
+
+func (x Span_Link_Type) String() string {
+ return proto.EnumName(Span_Link_Type_name, int32(x))
+}
+
+func (Span_Link_Type) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 4, 0}
+}
+
+// A span represents a single operation within a trace. Spans can be
+// nested to form a trace tree. Spans may also be linked to other spans
+// from the same or different trace. And form graphs. Often, a trace
+// contains a root span that describes the end-to-end latency, and one
+// or more subspans for its sub-operations. A trace can also contain
+// multiple root spans, or none at all. Spans do not need to be
+// contiguous - there may be gaps or overlaps between spans in a trace.
+//
+// The next id is 17.
+// TODO(bdrutu): Add an example.
+type Span struct {
+ // A unique identifier for a trace. All spans from the same trace share
+ // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
+ // is considered invalid.
+ //
+ // This field is semantically required. Receiver should generate new
+ // random trace_id if empty or invalid trace_id was received.
+ //
+ // This field is required.
+ TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
+ // A unique identifier for a span within a trace, assigned when the span
+ // is created. The ID is an 8-byte array. An ID with all zeroes is considered
+ // invalid.
+ //
+ // This field is semantically required. Receiver should generate new
+ // random span_id if empty or invalid span_id was received.
+ //
+ // This field is required.
+ SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"`
+ // The Tracestate on the span.
+ Tracestate *Span_Tracestate `protobuf:"bytes,15,opt,name=tracestate,proto3" json:"tracestate,omitempty"`
+ // The `span_id` of this span's parent span. If this is a root span, then this
+ // field must be empty. The ID is an 8-byte array.
+ ParentSpanId []byte `protobuf:"bytes,3,opt,name=parent_span_id,json=parentSpanId,proto3" json:"parent_span_id,omitempty"`
+ // A description of the span's operation.
+ //
+ // For example, the name can be a qualified method name or a file name
+ // and a line number where the operation is called. A best practice is to use
+ // the same display name at the same call point in an application.
+ // This makes it easier to correlate spans in different traces.
+ //
+ // This field is semantically required to be set to non-empty string.
+ // When null or empty string received - receiver may use string "name"
+ // as a replacement. There might be smarted algorithms implemented by
+ // receiver to fix the empty span name.
+ //
+ // This field is required.
+ Name *TruncatableString `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
+ // Distinguishes between spans generated in a particular context. For example,
+ // two spans with the same name may be distinguished using `CLIENT` (caller)
+ // and `SERVER` (callee) to identify queueing latency associated with the span.
+ Kind Span_SpanKind `protobuf:"varint,14,opt,name=kind,proto3,enum=opencensus.proto.trace.v1.Span_SpanKind" json:"kind,omitempty"`
+ // The start time of the span. On the client side, this is the time kept by
+ // the local machine where the span execution starts. On the server side, this
+ // is the time when the server's application handler starts running.
+ //
+ // This field is semantically required. When not set on receive -
+ // receiver should set it to the value of end_time field if it was
+ // set. Or to the current time if neither was set. It is important to
+ // keep end_time > start_time for consistency.
+ //
+ // This field is required.
+ StartTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
+ // The end time of the span. On the client side, this is the time kept by
+ // the local machine where the span execution ends. On the server side, this
+ // is the time when the server application handler stops running.
+ //
+ // This field is semantically required. When not set on receive -
+ // receiver should set it to start_time value. It is important to
+ // keep end_time > start_time for consistency.
+ //
+ // This field is required.
+ EndTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
+ // A set of attributes on the span.
+ Attributes *Span_Attributes `protobuf:"bytes,7,opt,name=attributes,proto3" json:"attributes,omitempty"`
+ // A stack trace captured at the start of the span.
+ StackTrace *StackTrace `protobuf:"bytes,8,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"`
+ // The included time events.
+ TimeEvents *Span_TimeEvents `protobuf:"bytes,9,opt,name=time_events,json=timeEvents,proto3" json:"time_events,omitempty"`
+ // The included links.
+ Links *Span_Links `protobuf:"bytes,10,opt,name=links,proto3" json:"links,omitempty"`
+ // An optional final status for this span. Semantically when Status
+ // wasn't set it is means span ended without errors and assume
+ // Status.Ok (code = 0).
+ Status *Status `protobuf:"bytes,11,opt,name=status,proto3" json:"status,omitempty"`
+ // An optional resource that is associated with this span. If not set, this span
+ // should be part of a batch that does include the resource information, unless resource
+ // information is unknown.
+ Resource *v1.Resource `protobuf:"bytes,16,opt,name=resource,proto3" json:"resource,omitempty"`
+ // A highly recommended but not required flag that identifies when a
+ // trace crosses a process boundary. True when the parent_span belongs
+ // to the same process as the current span. This flag is most commonly
+ // used to indicate the need to adjust time as clocks in different
+ // processes may not be synchronized.
+ SameProcessAsParentSpan *wrappers.BoolValue `protobuf:"bytes,12,opt,name=same_process_as_parent_span,json=sameProcessAsParentSpan,proto3" json:"same_process_as_parent_span,omitempty"`
+ // An optional number of child spans that were generated while this span
+ // was active. If set, allows an implementation to detect missing child spans.
+ ChildSpanCount *wrappers.UInt32Value `protobuf:"bytes,13,opt,name=child_span_count,json=childSpanCount,proto3" json:"child_span_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span) Reset() { *m = Span{} }
+func (m *Span) String() string { return proto.CompactTextString(m) }
+func (*Span) ProtoMessage() {}
+func (*Span) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0}
+}
+
+func (m *Span) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span.Unmarshal(m, b)
+}
+func (m *Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span.Marshal(b, m, deterministic)
+}
+func (m *Span) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span.Merge(m, src)
+}
+func (m *Span) XXX_Size() int {
+ return xxx_messageInfo_Span.Size(m)
+}
+func (m *Span) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span proto.InternalMessageInfo
+
+func (m *Span) GetTraceId() []byte {
+ if m != nil {
+ return m.TraceId
+ }
+ return nil
+}
+
+func (m *Span) GetSpanId() []byte {
+ if m != nil {
+ return m.SpanId
+ }
+ return nil
+}
+
+func (m *Span) GetTracestate() *Span_Tracestate {
+ if m != nil {
+ return m.Tracestate
+ }
+ return nil
+}
+
+func (m *Span) GetParentSpanId() []byte {
+ if m != nil {
+ return m.ParentSpanId
+ }
+ return nil
+}
+
+func (m *Span) GetName() *TruncatableString {
+ if m != nil {
+ return m.Name
+ }
+ return nil
+}
+
+func (m *Span) GetKind() Span_SpanKind {
+ if m != nil {
+ return m.Kind
+ }
+ return Span_SPAN_KIND_UNSPECIFIED
+}
+
+func (m *Span) GetStartTime() *timestamp.Timestamp {
+ if m != nil {
+ return m.StartTime
+ }
+ return nil
+}
+
+func (m *Span) GetEndTime() *timestamp.Timestamp {
+ if m != nil {
+ return m.EndTime
+ }
+ return nil
+}
+
+func (m *Span) GetAttributes() *Span_Attributes {
+ if m != nil {
+ return m.Attributes
+ }
+ return nil
+}
+
+func (m *Span) GetStackTrace() *StackTrace {
+ if m != nil {
+ return m.StackTrace
+ }
+ return nil
+}
+
+func (m *Span) GetTimeEvents() *Span_TimeEvents {
+ if m != nil {
+ return m.TimeEvents
+ }
+ return nil
+}
+
+func (m *Span) GetLinks() *Span_Links {
+ if m != nil {
+ return m.Links
+ }
+ return nil
+}
+
+func (m *Span) GetStatus() *Status {
+ if m != nil {
+ return m.Status
+ }
+ return nil
+}
+
+func (m *Span) GetResource() *v1.Resource {
+ if m != nil {
+ return m.Resource
+ }
+ return nil
+}
+
+func (m *Span) GetSameProcessAsParentSpan() *wrappers.BoolValue {
+ if m != nil {
+ return m.SameProcessAsParentSpan
+ }
+ return nil
+}
+
+func (m *Span) GetChildSpanCount() *wrappers.UInt32Value {
+ if m != nil {
+ return m.ChildSpanCount
+ }
+ return nil
+}
+
+// This field conveys information about request position in multiple distributed tracing graphs.
+// It is a list of Tracestate.Entry with a maximum of 32 members in the list.
+//
+// See the https://github.com/w3c/distributed-tracing for more details about this field.
+type Span_Tracestate struct {
+ // A list of entries that represent the Tracestate.
+ Entries []*Span_Tracestate_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_Tracestate) Reset() { *m = Span_Tracestate{} }
+func (m *Span_Tracestate) String() string { return proto.CompactTextString(m) }
+func (*Span_Tracestate) ProtoMessage() {}
+func (*Span_Tracestate) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 0}
+}
+
+func (m *Span_Tracestate) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_Tracestate.Unmarshal(m, b)
+}
+func (m *Span_Tracestate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_Tracestate.Marshal(b, m, deterministic)
+}
+func (m *Span_Tracestate) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_Tracestate.Merge(m, src)
+}
+func (m *Span_Tracestate) XXX_Size() int {
+ return xxx_messageInfo_Span_Tracestate.Size(m)
+}
+func (m *Span_Tracestate) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_Tracestate.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_Tracestate proto.InternalMessageInfo
+
+func (m *Span_Tracestate) GetEntries() []*Span_Tracestate_Entry {
+ if m != nil {
+ return m.Entries
+ }
+ return nil
+}
+
+type Span_Tracestate_Entry struct {
+ // The key must begin with a lowercase letter, and can only contain
+ // lowercase letters 'a'-'z', digits '0'-'9', underscores '_', dashes
+ // '-', asterisks '*', and forward slashes '/'.
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
+ // The value is opaque string up to 256 characters printable ASCII
+ // RFC0020 characters (i.e., the range 0x20 to 0x7E) except ',' and '='.
+ // Note that this also excludes tabs, newlines, carriage returns, etc.
+ Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_Tracestate_Entry) Reset() { *m = Span_Tracestate_Entry{} }
+func (m *Span_Tracestate_Entry) String() string { return proto.CompactTextString(m) }
+func (*Span_Tracestate_Entry) ProtoMessage() {}
+func (*Span_Tracestate_Entry) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 0, 0}
+}
+
+func (m *Span_Tracestate_Entry) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_Tracestate_Entry.Unmarshal(m, b)
+}
+func (m *Span_Tracestate_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_Tracestate_Entry.Marshal(b, m, deterministic)
+}
+func (m *Span_Tracestate_Entry) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_Tracestate_Entry.Merge(m, src)
+}
+func (m *Span_Tracestate_Entry) XXX_Size() int {
+ return xxx_messageInfo_Span_Tracestate_Entry.Size(m)
+}
+func (m *Span_Tracestate_Entry) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_Tracestate_Entry.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_Tracestate_Entry proto.InternalMessageInfo
+
+func (m *Span_Tracestate_Entry) GetKey() string {
+ if m != nil {
+ return m.Key
+ }
+ return ""
+}
+
+func (m *Span_Tracestate_Entry) GetValue() string {
+ if m != nil {
+ return m.Value
+ }
+ return ""
+}
+
+// A set of attributes, each with a key and a value.
+type Span_Attributes struct {
+ // The set of attributes. The value can be a string, an integer, a double
+ // or the Boolean values `true` or `false`. Note, global attributes like
+ // server name can be set as tags using resource API. Examples of attributes:
+ //
+ // "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
+ // "/http/server_latency": 300
+ // "abc.com/myattribute": true
+ // "abc.com/score": 10.239
+ AttributeMap map[string]*AttributeValue `protobuf:"bytes,1,rep,name=attribute_map,json=attributeMap,proto3" json:"attribute_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ // The number of attributes that were discarded. Attributes can be discarded
+ // because their keys are too long or because there are too many attributes.
+ // If this value is 0, then no attributes were dropped.
+ DroppedAttributesCount int32 `protobuf:"varint,2,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_Attributes) Reset() { *m = Span_Attributes{} }
+func (m *Span_Attributes) String() string { return proto.CompactTextString(m) }
+func (*Span_Attributes) ProtoMessage() {}
+func (*Span_Attributes) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 1}
+}
+
+func (m *Span_Attributes) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_Attributes.Unmarshal(m, b)
+}
+func (m *Span_Attributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_Attributes.Marshal(b, m, deterministic)
+}
+func (m *Span_Attributes) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_Attributes.Merge(m, src)
+}
+func (m *Span_Attributes) XXX_Size() int {
+ return xxx_messageInfo_Span_Attributes.Size(m)
+}
+func (m *Span_Attributes) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_Attributes.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_Attributes proto.InternalMessageInfo
+
+func (m *Span_Attributes) GetAttributeMap() map[string]*AttributeValue {
+ if m != nil {
+ return m.AttributeMap
+ }
+ return nil
+}
+
+func (m *Span_Attributes) GetDroppedAttributesCount() int32 {
+ if m != nil {
+ return m.DroppedAttributesCount
+ }
+ return 0
+}
+
+// A time-stamped annotation or message event in the Span.
+type Span_TimeEvent struct {
+ // The time the event occurred.
+ Time *timestamp.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"`
+ // A `TimeEvent` can contain either an `Annotation` object or a
+ // `MessageEvent` object, but not both.
+ //
+ // Types that are valid to be assigned to Value:
+ // *Span_TimeEvent_Annotation_
+ // *Span_TimeEvent_MessageEvent_
+ Value isSpan_TimeEvent_Value `protobuf_oneof:"value"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_TimeEvent) Reset() { *m = Span_TimeEvent{} }
+func (m *Span_TimeEvent) String() string { return proto.CompactTextString(m) }
+func (*Span_TimeEvent) ProtoMessage() {}
+func (*Span_TimeEvent) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 2}
+}
+
+func (m *Span_TimeEvent) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_TimeEvent.Unmarshal(m, b)
+}
+func (m *Span_TimeEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_TimeEvent.Marshal(b, m, deterministic)
+}
+func (m *Span_TimeEvent) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_TimeEvent.Merge(m, src)
+}
+func (m *Span_TimeEvent) XXX_Size() int {
+ return xxx_messageInfo_Span_TimeEvent.Size(m)
+}
+func (m *Span_TimeEvent) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_TimeEvent.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_TimeEvent proto.InternalMessageInfo
+
+func (m *Span_TimeEvent) GetTime() *timestamp.Timestamp {
+ if m != nil {
+ return m.Time
+ }
+ return nil
+}
+
+type isSpan_TimeEvent_Value interface {
+ isSpan_TimeEvent_Value()
+}
+
+type Span_TimeEvent_Annotation_ struct {
+ Annotation *Span_TimeEvent_Annotation `protobuf:"bytes,2,opt,name=annotation,proto3,oneof"`
+}
+
+type Span_TimeEvent_MessageEvent_ struct {
+ MessageEvent *Span_TimeEvent_MessageEvent `protobuf:"bytes,3,opt,name=message_event,json=messageEvent,proto3,oneof"`
+}
+
+func (*Span_TimeEvent_Annotation_) isSpan_TimeEvent_Value() {}
+
+func (*Span_TimeEvent_MessageEvent_) isSpan_TimeEvent_Value() {}
+
+func (m *Span_TimeEvent) GetValue() isSpan_TimeEvent_Value {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (m *Span_TimeEvent) GetAnnotation() *Span_TimeEvent_Annotation {
+ if x, ok := m.GetValue().(*Span_TimeEvent_Annotation_); ok {
+ return x.Annotation
+ }
+ return nil
+}
+
+func (m *Span_TimeEvent) GetMessageEvent() *Span_TimeEvent_MessageEvent {
+ if x, ok := m.GetValue().(*Span_TimeEvent_MessageEvent_); ok {
+ return x.MessageEvent
+ }
+ return nil
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*Span_TimeEvent) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*Span_TimeEvent_Annotation_)(nil),
+ (*Span_TimeEvent_MessageEvent_)(nil),
+ }
+}
+
+// A text annotation with a set of attributes.
+type Span_TimeEvent_Annotation struct {
+ // A user-supplied message describing the event.
+ Description *TruncatableString `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
+ // A set of attributes on the annotation.
+ Attributes *Span_Attributes `protobuf:"bytes,2,opt,name=attributes,proto3" json:"attributes,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_TimeEvent_Annotation) Reset() { *m = Span_TimeEvent_Annotation{} }
+func (m *Span_TimeEvent_Annotation) String() string { return proto.CompactTextString(m) }
+func (*Span_TimeEvent_Annotation) ProtoMessage() {}
+func (*Span_TimeEvent_Annotation) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 2, 0}
+}
+
+func (m *Span_TimeEvent_Annotation) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_TimeEvent_Annotation.Unmarshal(m, b)
+}
+func (m *Span_TimeEvent_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_TimeEvent_Annotation.Marshal(b, m, deterministic)
+}
+func (m *Span_TimeEvent_Annotation) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_TimeEvent_Annotation.Merge(m, src)
+}
+func (m *Span_TimeEvent_Annotation) XXX_Size() int {
+ return xxx_messageInfo_Span_TimeEvent_Annotation.Size(m)
+}
+func (m *Span_TimeEvent_Annotation) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_TimeEvent_Annotation.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_TimeEvent_Annotation proto.InternalMessageInfo
+
+func (m *Span_TimeEvent_Annotation) GetDescription() *TruncatableString {
+ if m != nil {
+ return m.Description
+ }
+ return nil
+}
+
+func (m *Span_TimeEvent_Annotation) GetAttributes() *Span_Attributes {
+ if m != nil {
+ return m.Attributes
+ }
+ return nil
+}
+
+// An event describing a message sent/received between Spans.
+type Span_TimeEvent_MessageEvent struct {
+ // The type of MessageEvent. Indicates whether the message was sent or
+ // received.
+ Type Span_TimeEvent_MessageEvent_Type `protobuf:"varint,1,opt,name=type,proto3,enum=opencensus.proto.trace.v1.Span_TimeEvent_MessageEvent_Type" json:"type,omitempty"`
+ // An identifier for the MessageEvent's message that can be used to match
+ // SENT and RECEIVED MessageEvents. For example, this field could
+ // represent a sequence ID for a streaming RPC. It is recommended to be
+ // unique within a Span.
+ Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
+ // The number of uncompressed bytes sent or received.
+ UncompressedSize uint64 `protobuf:"varint,3,opt,name=uncompressed_size,json=uncompressedSize,proto3" json:"uncompressed_size,omitempty"`
+ // The number of compressed bytes sent or received. If zero, assumed to
+ // be the same size as uncompressed.
+ CompressedSize uint64 `protobuf:"varint,4,opt,name=compressed_size,json=compressedSize,proto3" json:"compressed_size,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_TimeEvent_MessageEvent) Reset() { *m = Span_TimeEvent_MessageEvent{} }
+func (m *Span_TimeEvent_MessageEvent) String() string { return proto.CompactTextString(m) }
+func (*Span_TimeEvent_MessageEvent) ProtoMessage() {}
+func (*Span_TimeEvent_MessageEvent) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 2, 1}
+}
+
+func (m *Span_TimeEvent_MessageEvent) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_TimeEvent_MessageEvent.Unmarshal(m, b)
+}
+func (m *Span_TimeEvent_MessageEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_TimeEvent_MessageEvent.Marshal(b, m, deterministic)
+}
+func (m *Span_TimeEvent_MessageEvent) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_TimeEvent_MessageEvent.Merge(m, src)
+}
+func (m *Span_TimeEvent_MessageEvent) XXX_Size() int {
+ return xxx_messageInfo_Span_TimeEvent_MessageEvent.Size(m)
+}
+func (m *Span_TimeEvent_MessageEvent) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_TimeEvent_MessageEvent.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_TimeEvent_MessageEvent proto.InternalMessageInfo
+
+func (m *Span_TimeEvent_MessageEvent) GetType() Span_TimeEvent_MessageEvent_Type {
+ if m != nil {
+ return m.Type
+ }
+ return Span_TimeEvent_MessageEvent_TYPE_UNSPECIFIED
+}
+
+func (m *Span_TimeEvent_MessageEvent) GetId() uint64 {
+ if m != nil {
+ return m.Id
+ }
+ return 0
+}
+
+func (m *Span_TimeEvent_MessageEvent) GetUncompressedSize() uint64 {
+ if m != nil {
+ return m.UncompressedSize
+ }
+ return 0
+}
+
+func (m *Span_TimeEvent_MessageEvent) GetCompressedSize() uint64 {
+ if m != nil {
+ return m.CompressedSize
+ }
+ return 0
+}
+
+// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
+// on the span, consisting of either user-supplied key-value pairs, or
+// details of a message sent/received between Spans.
+type Span_TimeEvents struct {
+ // A collection of `TimeEvent`s.
+ TimeEvent []*Span_TimeEvent `protobuf:"bytes,1,rep,name=time_event,json=timeEvent,proto3" json:"time_event,omitempty"`
+ // The number of dropped annotations in all the included time events.
+ // If the value is 0, then no annotations were dropped.
+ DroppedAnnotationsCount int32 `protobuf:"varint,2,opt,name=dropped_annotations_count,json=droppedAnnotationsCount,proto3" json:"dropped_annotations_count,omitempty"`
+ // The number of dropped message events in all the included time events.
+ // If the value is 0, then no message events were dropped.
+ DroppedMessageEventsCount int32 `protobuf:"varint,3,opt,name=dropped_message_events_count,json=droppedMessageEventsCount,proto3" json:"dropped_message_events_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_TimeEvents) Reset() { *m = Span_TimeEvents{} }
+func (m *Span_TimeEvents) String() string { return proto.CompactTextString(m) }
+func (*Span_TimeEvents) ProtoMessage() {}
+func (*Span_TimeEvents) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 3}
+}
+
+func (m *Span_TimeEvents) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_TimeEvents.Unmarshal(m, b)
+}
+func (m *Span_TimeEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_TimeEvents.Marshal(b, m, deterministic)
+}
+func (m *Span_TimeEvents) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_TimeEvents.Merge(m, src)
+}
+func (m *Span_TimeEvents) XXX_Size() int {
+ return xxx_messageInfo_Span_TimeEvents.Size(m)
+}
+func (m *Span_TimeEvents) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_TimeEvents.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_TimeEvents proto.InternalMessageInfo
+
+func (m *Span_TimeEvents) GetTimeEvent() []*Span_TimeEvent {
+ if m != nil {
+ return m.TimeEvent
+ }
+ return nil
+}
+
+func (m *Span_TimeEvents) GetDroppedAnnotationsCount() int32 {
+ if m != nil {
+ return m.DroppedAnnotationsCount
+ }
+ return 0
+}
+
+func (m *Span_TimeEvents) GetDroppedMessageEventsCount() int32 {
+ if m != nil {
+ return m.DroppedMessageEventsCount
+ }
+ return 0
+}
+
+// A pointer from the current span to another span in the same trace or in a
+// different trace. For example, this can be used in batching operations,
+// where a single batch handler processes multiple requests from different
+// traces or when the handler receives a request from a different project.
+type Span_Link struct {
+ // A unique identifier of a trace that this linked span is part of. The ID is a
+ // 16-byte array.
+ TraceId []byte `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
+ // A unique identifier for the linked span. The ID is an 8-byte array.
+ SpanId []byte `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"`
+ // The relationship of the current span relative to the linked span.
+ Type Span_Link_Type `protobuf:"varint,3,opt,name=type,proto3,enum=opencensus.proto.trace.v1.Span_Link_Type" json:"type,omitempty"`
+ // A set of attributes on the link.
+ Attributes *Span_Attributes `protobuf:"bytes,4,opt,name=attributes,proto3" json:"attributes,omitempty"`
+ // The Tracestate associated with the link.
+ Tracestate *Span_Tracestate `protobuf:"bytes,5,opt,name=tracestate,proto3" json:"tracestate,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_Link) Reset() { *m = Span_Link{} }
+func (m *Span_Link) String() string { return proto.CompactTextString(m) }
+func (*Span_Link) ProtoMessage() {}
+func (*Span_Link) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 4}
+}
+
+func (m *Span_Link) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_Link.Unmarshal(m, b)
+}
+func (m *Span_Link) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_Link.Marshal(b, m, deterministic)
+}
+func (m *Span_Link) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_Link.Merge(m, src)
+}
+func (m *Span_Link) XXX_Size() int {
+ return xxx_messageInfo_Span_Link.Size(m)
+}
+func (m *Span_Link) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_Link.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_Link proto.InternalMessageInfo
+
+func (m *Span_Link) GetTraceId() []byte {
+ if m != nil {
+ return m.TraceId
+ }
+ return nil
+}
+
+func (m *Span_Link) GetSpanId() []byte {
+ if m != nil {
+ return m.SpanId
+ }
+ return nil
+}
+
+func (m *Span_Link) GetType() Span_Link_Type {
+ if m != nil {
+ return m.Type
+ }
+ return Span_Link_TYPE_UNSPECIFIED
+}
+
+func (m *Span_Link) GetAttributes() *Span_Attributes {
+ if m != nil {
+ return m.Attributes
+ }
+ return nil
+}
+
+func (m *Span_Link) GetTracestate() *Span_Tracestate {
+ if m != nil {
+ return m.Tracestate
+ }
+ return nil
+}
+
+// A collection of links, which are references from this span to a span
+// in the same or different trace.
+type Span_Links struct {
+ // A collection of links.
+ Link []*Span_Link `protobuf:"bytes,1,rep,name=link,proto3" json:"link,omitempty"`
+ // The number of dropped links after the maximum size was enforced. If
+ // this value is 0, then no links were dropped.
+ DroppedLinksCount int32 `protobuf:"varint,2,opt,name=dropped_links_count,json=droppedLinksCount,proto3" json:"dropped_links_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Span_Links) Reset() { *m = Span_Links{} }
+func (m *Span_Links) String() string { return proto.CompactTextString(m) }
+func (*Span_Links) ProtoMessage() {}
+func (*Span_Links) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{0, 5}
+}
+
+func (m *Span_Links) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Span_Links.Unmarshal(m, b)
+}
+func (m *Span_Links) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Span_Links.Marshal(b, m, deterministic)
+}
+func (m *Span_Links) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Span_Links.Merge(m, src)
+}
+func (m *Span_Links) XXX_Size() int {
+ return xxx_messageInfo_Span_Links.Size(m)
+}
+func (m *Span_Links) XXX_DiscardUnknown() {
+ xxx_messageInfo_Span_Links.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Span_Links proto.InternalMessageInfo
+
+func (m *Span_Links) GetLink() []*Span_Link {
+ if m != nil {
+ return m.Link
+ }
+ return nil
+}
+
+func (m *Span_Links) GetDroppedLinksCount() int32 {
+ if m != nil {
+ return m.DroppedLinksCount
+ }
+ return 0
+}
+
+// The `Status` type defines a logical error model that is suitable for different
+// programming environments, including REST APIs and RPC APIs. This proto's fields
+// are a subset of those of
+// [google.rpc.Status](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto),
+// which is used by [gRPC](https://github.com/grpc).
+type Status struct {
+ // The status code. This is optional field. It is safe to assume 0 (OK)
+ // when not set.
+ Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
+ // A developer-facing error message, which should be in English.
+ Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Status) Reset() { *m = Status{} }
+func (m *Status) String() string { return proto.CompactTextString(m) }
+func (*Status) ProtoMessage() {}
+func (*Status) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{1}
+}
+
+func (m *Status) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Status.Unmarshal(m, b)
+}
+func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Status.Marshal(b, m, deterministic)
+}
+func (m *Status) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Status.Merge(m, src)
+}
+func (m *Status) XXX_Size() int {
+ return xxx_messageInfo_Status.Size(m)
+}
+func (m *Status) XXX_DiscardUnknown() {
+ xxx_messageInfo_Status.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Status proto.InternalMessageInfo
+
+func (m *Status) GetCode() int32 {
+ if m != nil {
+ return m.Code
+ }
+ return 0
+}
+
+func (m *Status) GetMessage() string {
+ if m != nil {
+ return m.Message
+ }
+ return ""
+}
+
+// The value of an Attribute.
+type AttributeValue struct {
+ // The type of the value.
+ //
+ // Types that are valid to be assigned to Value:
+ // *AttributeValue_StringValue
+ // *AttributeValue_IntValue
+ // *AttributeValue_BoolValue
+ // *AttributeValue_DoubleValue
+ Value isAttributeValue_Value `protobuf_oneof:"value"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *AttributeValue) Reset() { *m = AttributeValue{} }
+func (m *AttributeValue) String() string { return proto.CompactTextString(m) }
+func (*AttributeValue) ProtoMessage() {}
+func (*AttributeValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{2}
+}
+
+func (m *AttributeValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_AttributeValue.Unmarshal(m, b)
+}
+func (m *AttributeValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_AttributeValue.Marshal(b, m, deterministic)
+}
+func (m *AttributeValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_AttributeValue.Merge(m, src)
+}
+func (m *AttributeValue) XXX_Size() int {
+ return xxx_messageInfo_AttributeValue.Size(m)
+}
+func (m *AttributeValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_AttributeValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_AttributeValue proto.InternalMessageInfo
+
+type isAttributeValue_Value interface {
+ isAttributeValue_Value()
+}
+
+type AttributeValue_StringValue struct {
+ StringValue *TruncatableString `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type AttributeValue_IntValue struct {
+ IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
+}
+
+type AttributeValue_BoolValue struct {
+ BoolValue bool `protobuf:"varint,3,opt,name=bool_value,json=boolValue,proto3,oneof"`
+}
+
+type AttributeValue_DoubleValue struct {
+ DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"`
+}
+
+func (*AttributeValue_StringValue) isAttributeValue_Value() {}
+
+func (*AttributeValue_IntValue) isAttributeValue_Value() {}
+
+func (*AttributeValue_BoolValue) isAttributeValue_Value() {}
+
+func (*AttributeValue_DoubleValue) isAttributeValue_Value() {}
+
+func (m *AttributeValue) GetValue() isAttributeValue_Value {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (m *AttributeValue) GetStringValue() *TruncatableString {
+ if x, ok := m.GetValue().(*AttributeValue_StringValue); ok {
+ return x.StringValue
+ }
+ return nil
+}
+
+func (m *AttributeValue) GetIntValue() int64 {
+ if x, ok := m.GetValue().(*AttributeValue_IntValue); ok {
+ return x.IntValue
+ }
+ return 0
+}
+
+func (m *AttributeValue) GetBoolValue() bool {
+ if x, ok := m.GetValue().(*AttributeValue_BoolValue); ok {
+ return x.BoolValue
+ }
+ return false
+}
+
+func (m *AttributeValue) GetDoubleValue() float64 {
+ if x, ok := m.GetValue().(*AttributeValue_DoubleValue); ok {
+ return x.DoubleValue
+ }
+ return 0
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*AttributeValue) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*AttributeValue_StringValue)(nil),
+ (*AttributeValue_IntValue)(nil),
+ (*AttributeValue_BoolValue)(nil),
+ (*AttributeValue_DoubleValue)(nil),
+ }
+}
+
+// The call stack which originated this span.
+type StackTrace struct {
+ // Stack frames in this stack trace.
+ StackFrames *StackTrace_StackFrames `protobuf:"bytes,1,opt,name=stack_frames,json=stackFrames,proto3" json:"stack_frames,omitempty"`
+ // The hash ID is used to conserve network bandwidth for duplicate
+ // stack traces within a single trace.
+ //
+ // Often multiple spans will have identical stack traces.
+ // The first occurrence of a stack trace should contain both
+ // `stack_frames` and a value in `stack_trace_hash_id`.
+ //
+ // Subsequent spans within the same request can refer
+ // to that stack trace by setting only `stack_trace_hash_id`.
+ //
+ // TODO: describe how to deal with the case where stack_trace_hash_id is
+ // zero because it was not set.
+ StackTraceHashId uint64 `protobuf:"varint,2,opt,name=stack_trace_hash_id,json=stackTraceHashId,proto3" json:"stack_trace_hash_id,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *StackTrace) Reset() { *m = StackTrace{} }
+func (m *StackTrace) String() string { return proto.CompactTextString(m) }
+func (*StackTrace) ProtoMessage() {}
+func (*StackTrace) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{3}
+}
+
+func (m *StackTrace) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_StackTrace.Unmarshal(m, b)
+}
+func (m *StackTrace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_StackTrace.Marshal(b, m, deterministic)
+}
+func (m *StackTrace) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StackTrace.Merge(m, src)
+}
+func (m *StackTrace) XXX_Size() int {
+ return xxx_messageInfo_StackTrace.Size(m)
+}
+func (m *StackTrace) XXX_DiscardUnknown() {
+ xxx_messageInfo_StackTrace.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StackTrace proto.InternalMessageInfo
+
+func (m *StackTrace) GetStackFrames() *StackTrace_StackFrames {
+ if m != nil {
+ return m.StackFrames
+ }
+ return nil
+}
+
+func (m *StackTrace) GetStackTraceHashId() uint64 {
+ if m != nil {
+ return m.StackTraceHashId
+ }
+ return 0
+}
+
+// A single stack frame in a stack trace.
+type StackTrace_StackFrame struct {
+ // The fully-qualified name that uniquely identifies the function or
+ // method that is active in this frame.
+ FunctionName *TruncatableString `protobuf:"bytes,1,opt,name=function_name,json=functionName,proto3" json:"function_name,omitempty"`
+ // An un-mangled function name, if `function_name` is
+ // [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can
+ // be fully qualified.
+ OriginalFunctionName *TruncatableString `protobuf:"bytes,2,opt,name=original_function_name,json=originalFunctionName,proto3" json:"original_function_name,omitempty"`
+ // The name of the source file where the function call appears.
+ FileName *TruncatableString `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
+ // The line number in `file_name` where the function call appears.
+ LineNumber int64 `protobuf:"varint,4,opt,name=line_number,json=lineNumber,proto3" json:"line_number,omitempty"`
+ // The column number where the function call appears, if available.
+ // This is important in JavaScript because of its anonymous functions.
+ ColumnNumber int64 `protobuf:"varint,5,opt,name=column_number,json=columnNumber,proto3" json:"column_number,omitempty"`
+ // The binary module from where the code was loaded.
+ LoadModule *Module `protobuf:"bytes,6,opt,name=load_module,json=loadModule,proto3" json:"load_module,omitempty"`
+ // The version of the deployed source code.
+ SourceVersion *TruncatableString `protobuf:"bytes,7,opt,name=source_version,json=sourceVersion,proto3" json:"source_version,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *StackTrace_StackFrame) Reset() { *m = StackTrace_StackFrame{} }
+func (m *StackTrace_StackFrame) String() string { return proto.CompactTextString(m) }
+func (*StackTrace_StackFrame) ProtoMessage() {}
+func (*StackTrace_StackFrame) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{3, 0}
+}
+
+func (m *StackTrace_StackFrame) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_StackTrace_StackFrame.Unmarshal(m, b)
+}
+func (m *StackTrace_StackFrame) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_StackTrace_StackFrame.Marshal(b, m, deterministic)
+}
+func (m *StackTrace_StackFrame) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StackTrace_StackFrame.Merge(m, src)
+}
+func (m *StackTrace_StackFrame) XXX_Size() int {
+ return xxx_messageInfo_StackTrace_StackFrame.Size(m)
+}
+func (m *StackTrace_StackFrame) XXX_DiscardUnknown() {
+ xxx_messageInfo_StackTrace_StackFrame.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StackTrace_StackFrame proto.InternalMessageInfo
+
+func (m *StackTrace_StackFrame) GetFunctionName() *TruncatableString {
+ if m != nil {
+ return m.FunctionName
+ }
+ return nil
+}
+
+func (m *StackTrace_StackFrame) GetOriginalFunctionName() *TruncatableString {
+ if m != nil {
+ return m.OriginalFunctionName
+ }
+ return nil
+}
+
+func (m *StackTrace_StackFrame) GetFileName() *TruncatableString {
+ if m != nil {
+ return m.FileName
+ }
+ return nil
+}
+
+func (m *StackTrace_StackFrame) GetLineNumber() int64 {
+ if m != nil {
+ return m.LineNumber
+ }
+ return 0
+}
+
+func (m *StackTrace_StackFrame) GetColumnNumber() int64 {
+ if m != nil {
+ return m.ColumnNumber
+ }
+ return 0
+}
+
+func (m *StackTrace_StackFrame) GetLoadModule() *Module {
+ if m != nil {
+ return m.LoadModule
+ }
+ return nil
+}
+
+func (m *StackTrace_StackFrame) GetSourceVersion() *TruncatableString {
+ if m != nil {
+ return m.SourceVersion
+ }
+ return nil
+}
+
+// A collection of stack frames, which can be truncated.
+type StackTrace_StackFrames struct {
+ // Stack frames in this call stack.
+ Frame []*StackTrace_StackFrame `protobuf:"bytes,1,rep,name=frame,proto3" json:"frame,omitempty"`
+ // The number of stack frames that were dropped because there
+ // were too many stack frames.
+ // If this value is 0, then no stack frames were dropped.
+ DroppedFramesCount int32 `protobuf:"varint,2,opt,name=dropped_frames_count,json=droppedFramesCount,proto3" json:"dropped_frames_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *StackTrace_StackFrames) Reset() { *m = StackTrace_StackFrames{} }
+func (m *StackTrace_StackFrames) String() string { return proto.CompactTextString(m) }
+func (*StackTrace_StackFrames) ProtoMessage() {}
+func (*StackTrace_StackFrames) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{3, 1}
+}
+
+func (m *StackTrace_StackFrames) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_StackTrace_StackFrames.Unmarshal(m, b)
+}
+func (m *StackTrace_StackFrames) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_StackTrace_StackFrames.Marshal(b, m, deterministic)
+}
+func (m *StackTrace_StackFrames) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StackTrace_StackFrames.Merge(m, src)
+}
+func (m *StackTrace_StackFrames) XXX_Size() int {
+ return xxx_messageInfo_StackTrace_StackFrames.Size(m)
+}
+func (m *StackTrace_StackFrames) XXX_DiscardUnknown() {
+ xxx_messageInfo_StackTrace_StackFrames.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StackTrace_StackFrames proto.InternalMessageInfo
+
+func (m *StackTrace_StackFrames) GetFrame() []*StackTrace_StackFrame {
+ if m != nil {
+ return m.Frame
+ }
+ return nil
+}
+
+func (m *StackTrace_StackFrames) GetDroppedFramesCount() int32 {
+ if m != nil {
+ return m.DroppedFramesCount
+ }
+ return 0
+}
+
+// A description of a binary module.
+type Module struct {
+ // TODO: document the meaning of this field.
+ // For example: main binary, kernel modules, and dynamic libraries
+ // such as libc.so, sharedlib.so.
+ Module *TruncatableString `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"`
+ // A unique identifier for the module, usually a hash of its
+ // contents.
+ BuildId *TruncatableString `protobuf:"bytes,2,opt,name=build_id,json=buildId,proto3" json:"build_id,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Module) Reset() { *m = Module{} }
+func (m *Module) String() string { return proto.CompactTextString(m) }
+func (*Module) ProtoMessage() {}
+func (*Module) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{4}
+}
+
+func (m *Module) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Module.Unmarshal(m, b)
+}
+func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Module.Marshal(b, m, deterministic)
+}
+func (m *Module) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Module.Merge(m, src)
+}
+func (m *Module) XXX_Size() int {
+ return xxx_messageInfo_Module.Size(m)
+}
+func (m *Module) XXX_DiscardUnknown() {
+ xxx_messageInfo_Module.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Module proto.InternalMessageInfo
+
+func (m *Module) GetModule() *TruncatableString {
+ if m != nil {
+ return m.Module
+ }
+ return nil
+}
+
+func (m *Module) GetBuildId() *TruncatableString {
+ if m != nil {
+ return m.BuildId
+ }
+ return nil
+}
+
+// A string that might be shortened to a specified length.
+type TruncatableString struct {
+ // The shortened string. For example, if the original string was 500 bytes long and
+ // the limit of the string was 128 bytes, then this value contains the first 128
+ // bytes of the 500-byte string. Note that truncation always happens on a
+ // character boundary, to ensure that a truncated string is still valid UTF-8.
+ // Because it may contain multi-byte characters, the size of the truncated string
+ // may be less than the truncation limit.
+ Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+ // The number of bytes removed from the original string. If this
+ // value is 0, then the string was not shortened.
+ TruncatedByteCount int32 `protobuf:"varint,2,opt,name=truncated_byte_count,json=truncatedByteCount,proto3" json:"truncated_byte_count,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *TruncatableString) Reset() { *m = TruncatableString{} }
+func (m *TruncatableString) String() string { return proto.CompactTextString(m) }
+func (*TruncatableString) ProtoMessage() {}
+func (*TruncatableString) Descriptor() ([]byte, []int) {
+ return fileDescriptor_8ea38bbb821bf584, []int{5}
+}
+
+func (m *TruncatableString) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_TruncatableString.Unmarshal(m, b)
+}
+func (m *TruncatableString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_TruncatableString.Marshal(b, m, deterministic)
+}
+func (m *TruncatableString) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_TruncatableString.Merge(m, src)
+}
+func (m *TruncatableString) XXX_Size() int {
+ return xxx_messageInfo_TruncatableString.Size(m)
+}
+func (m *TruncatableString) XXX_DiscardUnknown() {
+ xxx_messageInfo_TruncatableString.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TruncatableString proto.InternalMessageInfo
+
+func (m *TruncatableString) GetValue() string {
+ if m != nil {
+ return m.Value
+ }
+ return ""
+}
+
+func (m *TruncatableString) GetTruncatedByteCount() int32 {
+ if m != nil {
+ return m.TruncatedByteCount
+ }
+ return 0
+}
+
+func init() {
+ proto.RegisterEnum("opencensus.proto.trace.v1.Span_SpanKind", Span_SpanKind_name, Span_SpanKind_value)
+ proto.RegisterEnum("opencensus.proto.trace.v1.Span_TimeEvent_MessageEvent_Type", Span_TimeEvent_MessageEvent_Type_name, Span_TimeEvent_MessageEvent_Type_value)
+ proto.RegisterEnum("opencensus.proto.trace.v1.Span_Link_Type", Span_Link_Type_name, Span_Link_Type_value)
+ proto.RegisterType((*Span)(nil), "opencensus.proto.trace.v1.Span")
+ proto.RegisterType((*Span_Tracestate)(nil), "opencensus.proto.trace.v1.Span.Tracestate")
+ proto.RegisterType((*Span_Tracestate_Entry)(nil), "opencensus.proto.trace.v1.Span.Tracestate.Entry")
+ proto.RegisterType((*Span_Attributes)(nil), "opencensus.proto.trace.v1.Span.Attributes")
+ proto.RegisterMapType((map[string]*AttributeValue)(nil), "opencensus.proto.trace.v1.Span.Attributes.AttributeMapEntry")
+ proto.RegisterType((*Span_TimeEvent)(nil), "opencensus.proto.trace.v1.Span.TimeEvent")
+ proto.RegisterType((*Span_TimeEvent_Annotation)(nil), "opencensus.proto.trace.v1.Span.TimeEvent.Annotation")
+ proto.RegisterType((*Span_TimeEvent_MessageEvent)(nil), "opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent")
+ proto.RegisterType((*Span_TimeEvents)(nil), "opencensus.proto.trace.v1.Span.TimeEvents")
+ proto.RegisterType((*Span_Link)(nil), "opencensus.proto.trace.v1.Span.Link")
+ proto.RegisterType((*Span_Links)(nil), "opencensus.proto.trace.v1.Span.Links")
+ proto.RegisterType((*Status)(nil), "opencensus.proto.trace.v1.Status")
+ proto.RegisterType((*AttributeValue)(nil), "opencensus.proto.trace.v1.AttributeValue")
+ proto.RegisterType((*StackTrace)(nil), "opencensus.proto.trace.v1.StackTrace")
+ proto.RegisterType((*StackTrace_StackFrame)(nil), "opencensus.proto.trace.v1.StackTrace.StackFrame")
+ proto.RegisterType((*StackTrace_StackFrames)(nil), "opencensus.proto.trace.v1.StackTrace.StackFrames")
+ proto.RegisterType((*Module)(nil), "opencensus.proto.trace.v1.Module")
+ proto.RegisterType((*TruncatableString)(nil), "opencensus.proto.trace.v1.TruncatableString")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/trace/v1/trace.proto", fileDescriptor_8ea38bbb821bf584)
+}
+
+var fileDescriptor_8ea38bbb821bf584 = []byte{
+ // 1581 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdb, 0x6e, 0x1b, 0x41,
+ 0x19, 0xce, 0xfa, 0xec, 0xdf, 0x8e, 0xeb, 0x4c, 0xd3, 0x74, 0x63, 0x0a, 0x0d, 0x6e, 0x0b, 0x29,
+ 0x25, 0x9b, 0x26, 0x2d, 0x55, 0x8f, 0x2a, 0x71, 0xe2, 0x60, 0x37, 0xa9, 0xeb, 0x8e, 0xdd, 0x88,
+ 0x83, 0xd0, 0x6a, 0xed, 0x9d, 0x38, 0x4b, 0xec, 0xd9, 0x65, 0x77, 0x36, 0x28, 0x7d, 0x01, 0x84,
+ 0xe0, 0x86, 0x0b, 0xc4, 0x0b, 0x70, 0xc1, 0xeb, 0x20, 0xee, 0x79, 0x00, 0x24, 0x9e, 0x80, 0x1b,
+ 0x34, 0x33, 0x7b, 0x72, 0xd2, 0x26, 0xc6, 0xbd, 0xb1, 0xe6, 0xf0, 0x7f, 0xdf, 0x3f, 0xff, 0xcc,
+ 0x7f, 0x5a, 0xc3, 0x03, 0xdb, 0x21, 0x74, 0x48, 0xa8, 0xe7, 0x7b, 0x9b, 0x8e, 0x6b, 0x33, 0x7b,
+ 0x93, 0xb9, 0xc6, 0x90, 0x6c, 0x9e, 0x6d, 0xc9, 0x81, 0x26, 0x16, 0xd1, 0x6a, 0x2c, 0x26, 0x57,
+ 0x34, 0xb9, 0x7b, 0xb6, 0x55, 0x7b, 0x74, 0x89, 0xc1, 0x25, 0x9e, 0xed, 0xbb, 0x92, 0x24, 0x1c,
+ 0x4b, 0x54, 0xed, 0xee, 0xc8, 0xb6, 0x47, 0x63, 0x22, 0x05, 0x07, 0xfe, 0xf1, 0x26, 0xb3, 0x26,
+ 0xc4, 0x63, 0xc6, 0xc4, 0x09, 0x04, 0xbe, 0x77, 0x51, 0xe0, 0x77, 0xae, 0xe1, 0x38, 0xc4, 0x0d,
+ 0xd4, 0xd6, 0xff, 0xbc, 0x02, 0x99, 0x9e, 0x63, 0x50, 0xb4, 0x0a, 0x05, 0x71, 0x04, 0xdd, 0x32,
+ 0x55, 0x65, 0x4d, 0x59, 0x2f, 0xe3, 0xbc, 0x98, 0xb7, 0x4d, 0x74, 0x1b, 0xf2, 0x9e, 0x63, 0x50,
+ 0xbe, 0x93, 0x12, 0x3b, 0x39, 0x3e, 0x6d, 0x9b, 0xe8, 0x1d, 0x80, 0x90, 0xf1, 0x98, 0xc1, 0x88,
+ 0x7a, 0x63, 0x4d, 0x59, 0x2f, 0x6d, 0xff, 0x48, 0xfb, 0xaa, 0x69, 0x1a, 0x57, 0xa4, 0xf5, 0x23,
+ 0x04, 0x4e, 0xa0, 0xd1, 0x7d, 0xa8, 0x38, 0x86, 0x4b, 0x28, 0xd3, 0x43, 0x5d, 0x69, 0xa1, 0xab,
+ 0x2c, 0x57, 0x7b, 0x52, 0xe3, 0x4f, 0x21, 0x43, 0x8d, 0x09, 0x51, 0x33, 0x42, 0xd7, 0x8f, 0xaf,
+ 0xd0, 0xd5, 0x77, 0x7d, 0x3a, 0x34, 0x98, 0x31, 0x18, 0x93, 0x1e, 0x73, 0x2d, 0x3a, 0xc2, 0x02,
+ 0x89, 0x5e, 0x43, 0xe6, 0xd4, 0xa2, 0xa6, 0x5a, 0x59, 0x53, 0xd6, 0x2b, 0xdb, 0xeb, 0xd7, 0x9d,
+ 0x96, 0xff, 0x1c, 0x58, 0xd4, 0xc4, 0x02, 0x85, 0x5e, 0x00, 0x78, 0xcc, 0x70, 0x99, 0xce, 0xef,
+ 0x59, 0xcd, 0x8a, 0x53, 0xd4, 0x34, 0x79, 0xc7, 0x5a, 0x78, 0xc7, 0x5a, 0x3f, 0x7c, 0x04, 0x5c,
+ 0x14, 0xd2, 0x7c, 0x8e, 0x7e, 0x02, 0x05, 0x42, 0x4d, 0x09, 0xcc, 0x5d, 0x0b, 0xcc, 0x13, 0x6a,
+ 0x0a, 0xd8, 0x3b, 0x00, 0x83, 0x31, 0xd7, 0x1a, 0xf8, 0x8c, 0x78, 0x6a, 0x7e, 0xb6, 0x3b, 0xde,
+ 0x89, 0x10, 0x38, 0x81, 0x46, 0xfb, 0x50, 0xf2, 0x98, 0x31, 0x3c, 0xd5, 0x85, 0xb4, 0x5a, 0x10,
+ 0x64, 0x0f, 0xae, 0x22, 0xe3, 0xd2, 0xe2, 0xc1, 0x30, 0x78, 0xd1, 0x18, 0x1d, 0x40, 0x89, 0x9b,
+ 0xa1, 0x93, 0x33, 0x42, 0x99, 0xa7, 0x16, 0x67, 0x7c, 0x78, 0x6b, 0x42, 0x9a, 0x02, 0x81, 0x81,
+ 0x45, 0x63, 0xf4, 0x0a, 0xb2, 0x63, 0x8b, 0x9e, 0x7a, 0x2a, 0x5c, 0x7f, 0x1c, 0x4e, 0x73, 0xc8,
+ 0x85, 0xb1, 0xc4, 0xa0, 0x17, 0x90, 0xe3, 0xee, 0xe3, 0x7b, 0x6a, 0x49, 0xa0, 0xbf, 0x7f, 0xb5,
+ 0x31, 0xcc, 0xf7, 0x70, 0x00, 0x40, 0x0d, 0x28, 0x84, 0xc1, 0xa4, 0x56, 0x05, 0xf8, 0x07, 0x97,
+ 0xc1, 0x51, 0xb8, 0x9d, 0x6d, 0x69, 0x38, 0x18, 0xe3, 0x08, 0x87, 0x7e, 0x0e, 0xdf, 0xf1, 0x8c,
+ 0x09, 0xd1, 0x1d, 0xd7, 0x1e, 0x12, 0xcf, 0xd3, 0x0d, 0x4f, 0x4f, 0x38, 0xb1, 0x5a, 0xfe, 0xca,
+ 0x33, 0x37, 0x6c, 0x7b, 0x7c, 0x64, 0x8c, 0x7d, 0x82, 0x6f, 0x73, 0x78, 0x57, 0xa2, 0x77, 0xbc,
+ 0x6e, 0xe4, 0xea, 0x68, 0x1f, 0xaa, 0xc3, 0x13, 0x6b, 0x6c, 0xca, 0x68, 0x18, 0xda, 0x3e, 0x65,
+ 0xea, 0xa2, 0xa0, 0xbb, 0x73, 0x89, 0xee, 0x53, 0x9b, 0xb2, 0x27, 0xdb, 0x92, 0xb0, 0x22, 0x50,
+ 0x9c, 0x62, 0x97, 0x63, 0x6a, 0x7f, 0x50, 0x00, 0xe2, 0x88, 0x43, 0xef, 0x20, 0x4f, 0x28, 0x73,
+ 0x2d, 0xe2, 0xa9, 0xca, 0x5a, 0x7a, 0xbd, 0xb4, 0xfd, 0x78, 0xf6, 0x70, 0xd5, 0x9a, 0x94, 0xb9,
+ 0xe7, 0x38, 0x24, 0xa8, 0x6d, 0x42, 0x56, 0xac, 0xa0, 0x2a, 0xa4, 0x4f, 0xc9, 0xb9, 0xc8, 0x1a,
+ 0x45, 0xcc, 0x87, 0x68, 0x19, 0xb2, 0x67, 0xfc, 0x38, 0x22, 0x5f, 0x14, 0xb1, 0x9c, 0xd4, 0xfe,
+ 0x92, 0x02, 0x88, 0x3d, 0x13, 0x19, 0xb0, 0x18, 0xf9, 0xa6, 0x3e, 0x31, 0x9c, 0xe0, 0x44, 0xaf,
+ 0x67, 0x77, 0xee, 0x78, 0xf8, 0xde, 0x70, 0xe4, 0xe9, 0xca, 0x46, 0x62, 0x09, 0x3d, 0x07, 0xd5,
+ 0x74, 0x6d, 0xc7, 0x21, 0xa6, 0x1e, 0x87, 0x41, 0x70, 0x9b, 0xfc, 0x68, 0x59, 0xbc, 0x12, 0xec,
+ 0xc7, 0xa4, 0xf2, 0xde, 0x7e, 0x03, 0x4b, 0x97, 0xc8, 0xbf, 0x60, 0xe8, 0xdb, 0xa4, 0xa1, 0xa5,
+ 0xed, 0x87, 0x57, 0x9c, 0x3d, 0xa2, 0x93, 0x0f, 0x25, 0x71, 0x2f, 0x53, 0xcf, 0x95, 0xda, 0xdf,
+ 0xb2, 0x50, 0x8c, 0x82, 0x03, 0x69, 0x90, 0x11, 0x39, 0x42, 0xb9, 0x36, 0x47, 0x08, 0x39, 0x74,
+ 0x04, 0x60, 0x50, 0x6a, 0x33, 0x83, 0x59, 0x36, 0x0d, 0xce, 0xf1, 0x74, 0xe6, 0x58, 0xd4, 0x76,
+ 0x22, 0x6c, 0x6b, 0x01, 0x27, 0x98, 0xd0, 0xaf, 0x61, 0x71, 0x42, 0x3c, 0xcf, 0x18, 0x05, 0x71,
+ 0x2e, 0xf2, 0x71, 0x69, 0xfb, 0xd9, 0xec, 0xd4, 0xef, 0x25, 0x5c, 0x4c, 0x5a, 0x0b, 0xb8, 0x3c,
+ 0x49, 0xcc, 0x6b, 0x7f, 0x57, 0x00, 0x62, 0xdd, 0xa8, 0x03, 0x25, 0x93, 0x78, 0x43, 0xd7, 0x72,
+ 0x84, 0x19, 0xca, 0x1c, 0xf9, 0x3d, 0x49, 0x70, 0x21, 0x6d, 0xa6, 0xbe, 0x25, 0x6d, 0xd6, 0xfe,
+ 0xab, 0x40, 0x39, 0x69, 0x0b, 0xfa, 0x00, 0x19, 0x76, 0xee, 0xc8, 0x27, 0xaa, 0x6c, 0xbf, 0x9a,
+ 0xef, 0x46, 0xb4, 0xfe, 0xb9, 0x43, 0xb0, 0x20, 0x42, 0x15, 0x48, 0x05, 0xc5, 0x35, 0x83, 0x53,
+ 0x96, 0x89, 0x1e, 0xc1, 0x92, 0x4f, 0x87, 0xf6, 0xc4, 0x71, 0x89, 0xe7, 0x11, 0x53, 0xf7, 0xac,
+ 0xcf, 0x44, 0xdc, 0x7f, 0x06, 0x57, 0x93, 0x1b, 0x3d, 0xeb, 0x33, 0x41, 0x3f, 0x84, 0x1b, 0x17,
+ 0x45, 0x33, 0x42, 0xb4, 0x32, 0x2d, 0x58, 0x7f, 0x0a, 0x19, 0xae, 0x13, 0x2d, 0x43, 0xb5, 0xff,
+ 0x8b, 0x6e, 0x53, 0xff, 0xd4, 0xe9, 0x75, 0x9b, 0xbb, 0xed, 0xfd, 0x76, 0x73, 0xaf, 0xba, 0x80,
+ 0x0a, 0x90, 0xe9, 0x35, 0x3b, 0xfd, 0xaa, 0x82, 0xca, 0x50, 0xc0, 0xcd, 0xdd, 0x66, 0xfb, 0xa8,
+ 0xb9, 0x57, 0x4d, 0x35, 0xf2, 0x81, 0x8b, 0xd7, 0xfe, 0xc9, 0x53, 0x49, 0x9c, 0xb7, 0x5b, 0x00,
+ 0x71, 0x11, 0x08, 0x62, 0xf7, 0xe1, 0xcc, 0x57, 0x81, 0x8b, 0x51, 0x09, 0x40, 0x2f, 0x61, 0x35,
+ 0x8a, 0xd2, 0xc8, 0x23, 0xa6, 0xc3, 0xf4, 0x76, 0x18, 0xa6, 0xf1, 0xbe, 0x88, 0x53, 0xf4, 0x16,
+ 0xee, 0x84, 0xd8, 0x29, 0x6f, 0x0d, 0xe1, 0x69, 0x01, 0x0f, 0xf9, 0x93, 0xf7, 0x1f, 0x04, 0xfa,
+ 0xbf, 0x52, 0x90, 0xe1, 0x25, 0x65, 0xae, 0x06, 0xe8, 0x4d, 0xe0, 0x08, 0x69, 0xe1, 0x08, 0x0f,
+ 0x67, 0x29, 0x5d, 0xc9, 0x67, 0x9f, 0x76, 0xd2, 0xcc, 0x37, 0xd5, 0xf6, 0xe9, 0x5e, 0x2c, 0xfb,
+ 0x2d, 0xbd, 0x58, 0xfd, 0xe0, 0x4a, 0x47, 0xb9, 0x05, 0x4b, 0xbb, 0xad, 0xf6, 0xe1, 0x9e, 0x7e,
+ 0xd8, 0xee, 0x1c, 0x34, 0xf7, 0xf4, 0x5e, 0x77, 0xa7, 0x53, 0x55, 0xd0, 0x0a, 0xa0, 0xee, 0x0e,
+ 0x6e, 0x76, 0xfa, 0x53, 0xeb, 0xa9, 0xda, 0x6f, 0x21, 0x2b, 0x4a, 0x36, 0x7a, 0x0e, 0x19, 0x5e,
+ 0xb4, 0x03, 0x57, 0xb9, 0x3f, 0xcb, 0x65, 0x61, 0x81, 0x40, 0x1a, 0xdc, 0x0c, 0x1f, 0x59, 0x94,
+ 0xfd, 0x29, 0xd7, 0x58, 0x0a, 0xb6, 0x84, 0x12, 0xf1, 0xa6, 0xf5, 0x37, 0x50, 0x08, 0xfb, 0x36,
+ 0xb4, 0x0a, 0xb7, 0xf8, 0x41, 0xf4, 0x83, 0x76, 0x67, 0xef, 0x82, 0x21, 0x00, 0xb9, 0x5e, 0x13,
+ 0x1f, 0x35, 0x71, 0x55, 0xe1, 0xe3, 0xdd, 0xc3, 0x36, 0xf7, 0xff, 0x54, 0xfd, 0x19, 0xe4, 0x64,
+ 0xaf, 0x80, 0x10, 0x64, 0x86, 0xb6, 0x29, 0x03, 0x3d, 0x8b, 0xc5, 0x18, 0xa9, 0x90, 0x0f, 0x3c,
+ 0x2d, 0xa8, 0x6e, 0xe1, 0xb4, 0xfe, 0x0f, 0x05, 0x2a, 0xd3, 0x59, 0x1e, 0x7d, 0x84, 0xb2, 0x27,
+ 0xb2, 0x93, 0x2e, 0xcb, 0xc4, 0x1c, 0x79, 0xad, 0xb5, 0x80, 0x4b, 0x92, 0x43, 0x52, 0x7e, 0x17,
+ 0x8a, 0x16, 0x65, 0x7a, 0x5c, 0x76, 0xd2, 0xad, 0x05, 0x5c, 0xb0, 0x28, 0x93, 0xdb, 0x77, 0x01,
+ 0x06, 0xb6, 0x3d, 0x0e, 0xf6, 0xb9, 0x63, 0x16, 0x5a, 0x0b, 0xb8, 0x38, 0x08, 0x5b, 0x0e, 0x74,
+ 0x0f, 0xca, 0xa6, 0xed, 0x0f, 0xc6, 0x24, 0x10, 0xe1, 0x6e, 0xa7, 0x70, 0x25, 0x72, 0x55, 0x08,
+ 0x45, 0x41, 0x5f, 0xff, 0x63, 0x0e, 0x20, 0xee, 0x02, 0x51, 0x9f, 0xdb, 0xc3, 0x3b, 0xc8, 0x63,
+ 0xd7, 0x98, 0x88, 0x26, 0x82, 0xdb, 0xb3, 0x35, 0x53, 0x0b, 0x29, 0x87, 0xfb, 0x02, 0x88, 0x65,
+ 0x23, 0x2a, 0x27, 0x68, 0x03, 0x6e, 0x26, 0xfa, 0x52, 0xfd, 0xc4, 0xf0, 0x4e, 0xf4, 0x28, 0x1f,
+ 0x56, 0xe3, 0xc6, 0xb3, 0x65, 0x78, 0x27, 0x6d, 0xb3, 0xf6, 0x9f, 0x74, 0x70, 0x26, 0x01, 0x47,
+ 0x1f, 0x61, 0xf1, 0xd8, 0xa7, 0x43, 0x9e, 0x14, 0x74, 0xf1, 0x71, 0x30, 0x4f, 0xf1, 0x28, 0x87,
+ 0x14, 0x1d, 0x4e, 0x39, 0x80, 0x15, 0xdb, 0xb5, 0x46, 0x16, 0x35, 0xc6, 0xfa, 0x34, 0x77, 0x6a,
+ 0x0e, 0xee, 0xe5, 0x90, 0x6b, 0x3f, 0xa9, 0xa3, 0x0d, 0xc5, 0x63, 0x6b, 0x4c, 0x24, 0x6d, 0x7a,
+ 0x0e, 0xda, 0x02, 0x87, 0x0b, 0xaa, 0xbb, 0x50, 0x1a, 0x5b, 0x94, 0xe8, 0xd4, 0x9f, 0x0c, 0x88,
+ 0x2b, 0x5e, 0x34, 0x8d, 0x81, 0x2f, 0x75, 0xc4, 0x0a, 0xba, 0x07, 0x8b, 0x43, 0x7b, 0xec, 0x4f,
+ 0x68, 0x28, 0x92, 0x15, 0x22, 0x65, 0xb9, 0x18, 0x08, 0x35, 0xa0, 0x34, 0xb6, 0x0d, 0x53, 0x9f,
+ 0xd8, 0xa6, 0x3f, 0x0e, 0xbf, 0x51, 0xae, 0x6a, 0xa8, 0xdf, 0x0b, 0x41, 0x0c, 0x1c, 0x25, 0xc7,
+ 0xa8, 0x07, 0x15, 0xd9, 0x1a, 0xeb, 0x67, 0xc4, 0xf5, 0x78, 0x25, 0xcf, 0xcf, 0x61, 0xd9, 0xa2,
+ 0xe4, 0x38, 0x92, 0x14, 0xb5, 0xdf, 0x2b, 0x50, 0x4a, 0xf8, 0x0e, 0xda, 0x87, 0xac, 0x70, 0xbf,
+ 0x59, 0x5a, 0xd8, 0x2f, 0x79, 0x1f, 0x96, 0x70, 0xf4, 0x18, 0x96, 0xc3, 0xb4, 0x22, 0xdd, 0x79,
+ 0x2a, 0xaf, 0xa0, 0x60, 0x4f, 0x2a, 0x95, 0x89, 0xe5, 0xaf, 0x0a, 0xe4, 0x02, 0x4b, 0xf7, 0x20,
+ 0x17, 0x5c, 0xd4, 0x3c, 0xee, 0x16, 0x60, 0xd1, 0xcf, 0xa0, 0x30, 0xf0, 0x79, 0x9b, 0x1f, 0xb8,
+ 0xfb, 0xff, 0xcb, 0x93, 0x17, 0xe8, 0xb6, 0x59, 0xff, 0x15, 0x2c, 0x5d, 0xda, 0x8d, 0xdb, 0x70,
+ 0x25, 0xd1, 0x86, 0x73, 0xb3, 0x99, 0x14, 0x25, 0xa6, 0x3e, 0x38, 0x67, 0x64, 0xda, 0xec, 0x68,
+ 0xaf, 0x71, 0xce, 0x88, 0x30, 0xbb, 0xf1, 0x27, 0x05, 0xee, 0x58, 0xf6, 0xd7, 0x0f, 0xd6, 0x90,
+ 0x9f, 0x18, 0x5d, 0xbe, 0xd8, 0x55, 0x7e, 0xd9, 0x18, 0x59, 0xec, 0xc4, 0x1f, 0x68, 0x43, 0x7b,
+ 0xb2, 0x29, 0xe5, 0x37, 0x2c, 0xea, 0x31, 0xd7, 0x9f, 0x10, 0x2a, 0x8b, 0xf7, 0x66, 0x4c, 0xb5,
+ 0x21, 0xff, 0xe3, 0x18, 0x11, 0xba, 0x31, 0x8a, 0xff, 0x2c, 0xf9, 0x77, 0x6a, 0xf5, 0x83, 0x43,
+ 0xe8, 0xae, 0xd4, 0x26, 0x88, 0x65, 0xb1, 0xd2, 0x8e, 0xb6, 0x06, 0x39, 0x01, 0x79, 0xf2, 0xbf,
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x56, 0xb6, 0xfd, 0x6c, 0x11, 0x00, 0x00,
+}
diff --git a/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go
new file mode 100644
index 000000000..025387784
--- /dev/null
+++ b/vendor/github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1/trace_config.pb.go
@@ -0,0 +1,359 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: opencensus/proto/trace/v1/trace_config.proto
+
+package v1
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// How spans should be sampled:
+// - Always off
+// - Always on
+// - Always follow the parent Span's decision (off if no parent).
+type ConstantSampler_ConstantDecision int32
+
+const (
+ ConstantSampler_ALWAYS_OFF ConstantSampler_ConstantDecision = 0
+ ConstantSampler_ALWAYS_ON ConstantSampler_ConstantDecision = 1
+ ConstantSampler_ALWAYS_PARENT ConstantSampler_ConstantDecision = 2
+)
+
+var ConstantSampler_ConstantDecision_name = map[int32]string{
+ 0: "ALWAYS_OFF",
+ 1: "ALWAYS_ON",
+ 2: "ALWAYS_PARENT",
+}
+
+var ConstantSampler_ConstantDecision_value = map[string]int32{
+ "ALWAYS_OFF": 0,
+ "ALWAYS_ON": 1,
+ "ALWAYS_PARENT": 2,
+}
+
+func (x ConstantSampler_ConstantDecision) String() string {
+ return proto.EnumName(ConstantSampler_ConstantDecision_name, int32(x))
+}
+
+func (ConstantSampler_ConstantDecision) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_5359209b41ff50c5, []int{2, 0}
+}
+
+// Global configuration of the trace service. All fields must be specified, or
+// the default (zero) values will be used for each type.
+type TraceConfig struct {
+ // The global default sampler used to make decisions on span sampling.
+ //
+ // Types that are valid to be assigned to Sampler:
+ // *TraceConfig_ProbabilitySampler
+ // *TraceConfig_ConstantSampler
+ // *TraceConfig_RateLimitingSampler
+ Sampler isTraceConfig_Sampler `protobuf_oneof:"sampler"`
+ // The global default max number of attributes per span.
+ MaxNumberOfAttributes int64 `protobuf:"varint,4,opt,name=max_number_of_attributes,json=maxNumberOfAttributes,proto3" json:"max_number_of_attributes,omitempty"`
+ // The global default max number of annotation events per span.
+ MaxNumberOfAnnotations int64 `protobuf:"varint,5,opt,name=max_number_of_annotations,json=maxNumberOfAnnotations,proto3" json:"max_number_of_annotations,omitempty"`
+ // The global default max number of message events per span.
+ MaxNumberOfMessageEvents int64 `protobuf:"varint,6,opt,name=max_number_of_message_events,json=maxNumberOfMessageEvents,proto3" json:"max_number_of_message_events,omitempty"`
+ // The global default max number of link entries per span.
+ MaxNumberOfLinks int64 `protobuf:"varint,7,opt,name=max_number_of_links,json=maxNumberOfLinks,proto3" json:"max_number_of_links,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *TraceConfig) Reset() { *m = TraceConfig{} }
+func (m *TraceConfig) String() string { return proto.CompactTextString(m) }
+func (*TraceConfig) ProtoMessage() {}
+func (*TraceConfig) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5359209b41ff50c5, []int{0}
+}
+
+func (m *TraceConfig) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_TraceConfig.Unmarshal(m, b)
+}
+func (m *TraceConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_TraceConfig.Marshal(b, m, deterministic)
+}
+func (m *TraceConfig) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_TraceConfig.Merge(m, src)
+}
+func (m *TraceConfig) XXX_Size() int {
+ return xxx_messageInfo_TraceConfig.Size(m)
+}
+func (m *TraceConfig) XXX_DiscardUnknown() {
+ xxx_messageInfo_TraceConfig.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_TraceConfig proto.InternalMessageInfo
+
+type isTraceConfig_Sampler interface {
+ isTraceConfig_Sampler()
+}
+
+type TraceConfig_ProbabilitySampler struct {
+ ProbabilitySampler *ProbabilitySampler `protobuf:"bytes,1,opt,name=probability_sampler,json=probabilitySampler,proto3,oneof"`
+}
+
+type TraceConfig_ConstantSampler struct {
+ ConstantSampler *ConstantSampler `protobuf:"bytes,2,opt,name=constant_sampler,json=constantSampler,proto3,oneof"`
+}
+
+type TraceConfig_RateLimitingSampler struct {
+ RateLimitingSampler *RateLimitingSampler `protobuf:"bytes,3,opt,name=rate_limiting_sampler,json=rateLimitingSampler,proto3,oneof"`
+}
+
+func (*TraceConfig_ProbabilitySampler) isTraceConfig_Sampler() {}
+
+func (*TraceConfig_ConstantSampler) isTraceConfig_Sampler() {}
+
+func (*TraceConfig_RateLimitingSampler) isTraceConfig_Sampler() {}
+
+func (m *TraceConfig) GetSampler() isTraceConfig_Sampler {
+ if m != nil {
+ return m.Sampler
+ }
+ return nil
+}
+
+func (m *TraceConfig) GetProbabilitySampler() *ProbabilitySampler {
+ if x, ok := m.GetSampler().(*TraceConfig_ProbabilitySampler); ok {
+ return x.ProbabilitySampler
+ }
+ return nil
+}
+
+func (m *TraceConfig) GetConstantSampler() *ConstantSampler {
+ if x, ok := m.GetSampler().(*TraceConfig_ConstantSampler); ok {
+ return x.ConstantSampler
+ }
+ return nil
+}
+
+func (m *TraceConfig) GetRateLimitingSampler() *RateLimitingSampler {
+ if x, ok := m.GetSampler().(*TraceConfig_RateLimitingSampler); ok {
+ return x.RateLimitingSampler
+ }
+ return nil
+}
+
+func (m *TraceConfig) GetMaxNumberOfAttributes() int64 {
+ if m != nil {
+ return m.MaxNumberOfAttributes
+ }
+ return 0
+}
+
+func (m *TraceConfig) GetMaxNumberOfAnnotations() int64 {
+ if m != nil {
+ return m.MaxNumberOfAnnotations
+ }
+ return 0
+}
+
+func (m *TraceConfig) GetMaxNumberOfMessageEvents() int64 {
+ if m != nil {
+ return m.MaxNumberOfMessageEvents
+ }
+ return 0
+}
+
+func (m *TraceConfig) GetMaxNumberOfLinks() int64 {
+ if m != nil {
+ return m.MaxNumberOfLinks
+ }
+ return 0
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*TraceConfig) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*TraceConfig_ProbabilitySampler)(nil),
+ (*TraceConfig_ConstantSampler)(nil),
+ (*TraceConfig_RateLimitingSampler)(nil),
+ }
+}
+
+// Sampler that tries to uniformly sample traces with a given probability.
+// The probability of sampling a trace is equal to that of the specified probability.
+type ProbabilitySampler struct {
+ // The desired probability of sampling. Must be within [0.0, 1.0].
+ SamplingProbability float64 `protobuf:"fixed64,1,opt,name=samplingProbability,proto3" json:"samplingProbability,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ProbabilitySampler) Reset() { *m = ProbabilitySampler{} }
+func (m *ProbabilitySampler) String() string { return proto.CompactTextString(m) }
+func (*ProbabilitySampler) ProtoMessage() {}
+func (*ProbabilitySampler) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5359209b41ff50c5, []int{1}
+}
+
+func (m *ProbabilitySampler) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ProbabilitySampler.Unmarshal(m, b)
+}
+func (m *ProbabilitySampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ProbabilitySampler.Marshal(b, m, deterministic)
+}
+func (m *ProbabilitySampler) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ProbabilitySampler.Merge(m, src)
+}
+func (m *ProbabilitySampler) XXX_Size() int {
+ return xxx_messageInfo_ProbabilitySampler.Size(m)
+}
+func (m *ProbabilitySampler) XXX_DiscardUnknown() {
+ xxx_messageInfo_ProbabilitySampler.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ProbabilitySampler proto.InternalMessageInfo
+
+func (m *ProbabilitySampler) GetSamplingProbability() float64 {
+ if m != nil {
+ return m.SamplingProbability
+ }
+ return 0
+}
+
+// Sampler that always makes a constant decision on span sampling.
+type ConstantSampler struct {
+ Decision ConstantSampler_ConstantDecision `protobuf:"varint,1,opt,name=decision,proto3,enum=opencensus.proto.trace.v1.ConstantSampler_ConstantDecision" json:"decision,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ConstantSampler) Reset() { *m = ConstantSampler{} }
+func (m *ConstantSampler) String() string { return proto.CompactTextString(m) }
+func (*ConstantSampler) ProtoMessage() {}
+func (*ConstantSampler) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5359209b41ff50c5, []int{2}
+}
+
+func (m *ConstantSampler) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ConstantSampler.Unmarshal(m, b)
+}
+func (m *ConstantSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ConstantSampler.Marshal(b, m, deterministic)
+}
+func (m *ConstantSampler) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ConstantSampler.Merge(m, src)
+}
+func (m *ConstantSampler) XXX_Size() int {
+ return xxx_messageInfo_ConstantSampler.Size(m)
+}
+func (m *ConstantSampler) XXX_DiscardUnknown() {
+ xxx_messageInfo_ConstantSampler.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ConstantSampler proto.InternalMessageInfo
+
+func (m *ConstantSampler) GetDecision() ConstantSampler_ConstantDecision {
+ if m != nil {
+ return m.Decision
+ }
+ return ConstantSampler_ALWAYS_OFF
+}
+
+// Sampler that tries to sample with a rate per time window.
+type RateLimitingSampler struct {
+ // Rate per second.
+ Qps int64 `protobuf:"varint,1,opt,name=qps,proto3" json:"qps,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *RateLimitingSampler) Reset() { *m = RateLimitingSampler{} }
+func (m *RateLimitingSampler) String() string { return proto.CompactTextString(m) }
+func (*RateLimitingSampler) ProtoMessage() {}
+func (*RateLimitingSampler) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5359209b41ff50c5, []int{3}
+}
+
+func (m *RateLimitingSampler) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_RateLimitingSampler.Unmarshal(m, b)
+}
+func (m *RateLimitingSampler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_RateLimitingSampler.Marshal(b, m, deterministic)
+}
+func (m *RateLimitingSampler) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_RateLimitingSampler.Merge(m, src)
+}
+func (m *RateLimitingSampler) XXX_Size() int {
+ return xxx_messageInfo_RateLimitingSampler.Size(m)
+}
+func (m *RateLimitingSampler) XXX_DiscardUnknown() {
+ xxx_messageInfo_RateLimitingSampler.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_RateLimitingSampler proto.InternalMessageInfo
+
+func (m *RateLimitingSampler) GetQps() int64 {
+ if m != nil {
+ return m.Qps
+ }
+ return 0
+}
+
+func init() {
+ proto.RegisterEnum("opencensus.proto.trace.v1.ConstantSampler_ConstantDecision", ConstantSampler_ConstantDecision_name, ConstantSampler_ConstantDecision_value)
+ proto.RegisterType((*TraceConfig)(nil), "opencensus.proto.trace.v1.TraceConfig")
+ proto.RegisterType((*ProbabilitySampler)(nil), "opencensus.proto.trace.v1.ProbabilitySampler")
+ proto.RegisterType((*ConstantSampler)(nil), "opencensus.proto.trace.v1.ConstantSampler")
+ proto.RegisterType((*RateLimitingSampler)(nil), "opencensus.proto.trace.v1.RateLimitingSampler")
+}
+
+func init() {
+ proto.RegisterFile("opencensus/proto/trace/v1/trace_config.proto", fileDescriptor_5359209b41ff50c5)
+}
+
+var fileDescriptor_5359209b41ff50c5 = []byte{
+ // 506 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6e, 0xd3, 0x30,
+ 0x18, 0xc7, 0x97, 0x76, 0x6c, 0xec, 0x9b, 0xb6, 0x05, 0x57, 0x43, 0xa9, 0xb4, 0xc3, 0x94, 0x0b,
+ 0x13, 0x22, 0x09, 0x1d, 0x07, 0x84, 0x90, 0x90, 0xda, 0x6e, 0x15, 0x87, 0xd2, 0x56, 0xd9, 0x44,
+ 0x05, 0x97, 0xe0, 0x64, 0x6e, 0xb0, 0x68, 0xec, 0x60, 0x3b, 0xd5, 0x78, 0x0d, 0xce, 0x3c, 0x04,
+ 0xcf, 0xc5, 0x53, 0xa0, 0x3a, 0x21, 0x49, 0xdb, 0x6d, 0xe2, 0x96, 0xef, 0xfb, 0x7f, 0xbf, 0x9f,
+ 0xad, 0xd8, 0x86, 0x17, 0x3c, 0x25, 0x2c, 0x22, 0x4c, 0x66, 0xd2, 0x4b, 0x05, 0x57, 0xdc, 0x53,
+ 0x02, 0x47, 0xc4, 0x5b, 0x74, 0xf2, 0x8f, 0x20, 0xe2, 0x6c, 0x46, 0x63, 0x57, 0x67, 0xa8, 0x5d,
+ 0x4d, 0xe7, 0x1d, 0x57, 0x0f, 0xb9, 0x8b, 0x8e, 0xfd, 0x6b, 0x1b, 0xf6, 0xaf, 0x97, 0x45, 0x5f,
+ 0x03, 0xe8, 0x0b, 0xb4, 0x52, 0xc1, 0x43, 0x1c, 0xd2, 0x39, 0x55, 0x3f, 0x02, 0x89, 0x93, 0x74,
+ 0x4e, 0x84, 0x65, 0x9c, 0x1a, 0x67, 0xfb, 0xe7, 0x8e, 0x7b, 0xaf, 0xc8, 0x9d, 0x54, 0xd4, 0x55,
+ 0x0e, 0xbd, 0xdf, 0xf2, 0x51, 0xba, 0xd1, 0x45, 0x53, 0x30, 0x23, 0xce, 0xa4, 0xc2, 0x4c, 0x95,
+ 0xfa, 0x86, 0xd6, 0x3f, 0x7f, 0x40, 0xdf, 0x2f, 0x90, 0xca, 0x7d, 0x14, 0xad, 0xb6, 0xd0, 0x0d,
+ 0x1c, 0x0b, 0xac, 0x48, 0x30, 0xa7, 0x09, 0x55, 0x94, 0xc5, 0xa5, 0xbd, 0xa9, 0xed, 0xee, 0x03,
+ 0x76, 0x1f, 0x2b, 0x32, 0x2c, 0xb0, 0x6a, 0x85, 0x96, 0xd8, 0x6c, 0xa3, 0xd7, 0x60, 0x25, 0xf8,
+ 0x36, 0x60, 0x59, 0x12, 0x12, 0x11, 0xf0, 0x59, 0x80, 0x95, 0x12, 0x34, 0xcc, 0x14, 0x91, 0xd6,
+ 0xf6, 0xa9, 0x71, 0xd6, 0xf4, 0x8f, 0x13, 0x7c, 0x3b, 0xd2, 0xf1, 0x78, 0xd6, 0x2d, 0x43, 0xf4,
+ 0x06, 0xda, 0x6b, 0x20, 0x63, 0x5c, 0x61, 0x45, 0x39, 0x93, 0xd6, 0x23, 0x4d, 0x3e, 0xad, 0x93,
+ 0x55, 0x8a, 0xde, 0xc1, 0xc9, 0x2a, 0x9a, 0x10, 0x29, 0x71, 0x4c, 0x02, 0xb2, 0x20, 0x4c, 0x49,
+ 0x6b, 0x47, 0xd3, 0x56, 0x8d, 0xfe, 0x90, 0x0f, 0x5c, 0xea, 0x1c, 0x39, 0xd0, 0x5a, 0xe5, 0xe7,
+ 0x94, 0x7d, 0x93, 0xd6, 0xae, 0xc6, 0xcc, 0x1a, 0x36, 0x5c, 0xf6, 0x7b, 0x7b, 0xb0, 0x5b, 0xfc,
+ 0x3a, 0x7b, 0x00, 0x68, 0xf3, 0x60, 0xd1, 0x4b, 0x68, 0xe9, 0x01, 0xca, 0xe2, 0x5a, 0xaa, 0x2f,
+ 0x89, 0xe1, 0xdf, 0x15, 0xd9, 0xbf, 0x0d, 0x38, 0x5a, 0x3b, 0x42, 0x34, 0x85, 0xc7, 0x37, 0x24,
+ 0xa2, 0x92, 0x72, 0xa6, 0xd1, 0xc3, 0xf3, 0xb7, 0xff, 0x7f, 0x01, 0xca, 0xfa, 0xa2, 0x50, 0xf8,
+ 0xa5, 0xcc, 0xbe, 0x00, 0x73, 0x3d, 0x45, 0x87, 0x00, 0xdd, 0xe1, 0xb4, 0xfb, 0xe9, 0x2a, 0x18,
+ 0x0f, 0x06, 0xe6, 0x16, 0x3a, 0x80, 0xbd, 0x7f, 0xf5, 0xc8, 0x34, 0xd0, 0x13, 0x38, 0x28, 0xca,
+ 0x49, 0xd7, 0xbf, 0x1c, 0x5d, 0x9b, 0x0d, 0xfb, 0x19, 0xb4, 0xee, 0xb8, 0x16, 0xc8, 0x84, 0xe6,
+ 0xf7, 0x54, 0xea, 0x0d, 0x37, 0xfd, 0xe5, 0x67, 0xef, 0xa7, 0x01, 0x27, 0x94, 0xdf, 0xbf, 0xf5,
+ 0x9e, 0x59, 0x7b, 0x60, 0x93, 0x65, 0x34, 0x31, 0x3e, 0xf7, 0x62, 0xaa, 0xbe, 0x66, 0xa1, 0x1b,
+ 0xf1, 0xc4, 0xcb, 0x29, 0x87, 0x32, 0xa9, 0x44, 0x96, 0x10, 0x96, 0x1f, 0xbb, 0x57, 0x09, 0x9d,
+ 0xfc, 0x89, 0xc7, 0x84, 0x39, 0x71, 0xf5, 0xd2, 0xff, 0x34, 0xda, 0xe3, 0x94, 0xb0, 0x7e, 0xbe,
+ 0xa6, 0x16, 0xbb, 0x7a, 0x25, 0xf7, 0x63, 0x27, 0xdc, 0xd1, 0xc8, 0xab, 0xbf, 0x01, 0x00, 0x00,
+ 0xff, 0xff, 0x50, 0x0c, 0xfe, 0x32, 0x29, 0x04, 0x00, 0x00,
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_application.go b/vendor/github.com/cloudflare/cloudflare-go/access_application.go
new file mode 100644
index 000000000..0893c5681
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/access_application.go
@@ -0,0 +1,180 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// AccessApplication represents an Access application.
+type AccessApplication struct {
+ ID string `json:"id,omitempty"`
+ CreatedAt *time.Time `json:"created_at,omitempty"`
+ UpdatedAt *time.Time `json:"updated_at,omitempty"`
+ AUD string `json:"aud,omitempty"`
+ Name string `json:"name"`
+ Domain string `json:"domain"`
+ SessionDuration string `json:"session_duration,omitempty"`
+}
+
+// AccessApplicationListResponse represents the response from the list
+// access applications endpoint.
+type AccessApplicationListResponse struct {
+ Result []AccessApplication `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccessApplicationDetailResponse is the API response, containing a single
+// access application.
+type AccessApplicationDetailResponse struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result AccessApplication `json:"result"`
+}
+
+// AccessApplications returns all applications within a zone.
+//
+// API reference: https://api.cloudflare.com/#access-applications-list-access-applications
+func (api *API) AccessApplications(zoneID string, pageOpts PaginationOptions) ([]AccessApplication, ResultInfo, error) {
+ v := url.Values{}
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ uri := "/zones/" + zoneID + "/access/apps"
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []AccessApplication{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessApplicationListResponse AccessApplicationListResponse
+ err = json.Unmarshal(res, &accessApplicationListResponse)
+ if err != nil {
+ return []AccessApplication{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessApplicationListResponse.Result, accessApplicationListResponse.ResultInfo, nil
+}
+
+// AccessApplication returns a single application based on the
+// application ID.
+//
+// API reference: https://api.cloudflare.com/#access-applications-access-applications-details
+func (api *API) AccessApplication(zoneID, applicationID string) (AccessApplication, error) {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s",
+ zoneID,
+ applicationID,
+ )
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessApplicationDetailResponse AccessApplicationDetailResponse
+ err = json.Unmarshal(res, &accessApplicationDetailResponse)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessApplicationDetailResponse.Result, nil
+}
+
+// CreateAccessApplication creates a new access application.
+//
+// API reference: https://api.cloudflare.com/#access-applications-create-access-application
+func (api *API) CreateAccessApplication(zoneID string, accessApplication AccessApplication) (AccessApplication, error) {
+ uri := "/zones/" + zoneID + "/access/apps"
+
+ res, err := api.makeRequest("POST", uri, accessApplication)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessApplicationDetailResponse AccessApplicationDetailResponse
+ err = json.Unmarshal(res, &accessApplicationDetailResponse)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessApplicationDetailResponse.Result, nil
+}
+
+// UpdateAccessApplication updates an existing access application.
+//
+// API reference: https://api.cloudflare.com/#access-applications-update-access-application
+func (api *API) UpdateAccessApplication(zoneID string, accessApplication AccessApplication) (AccessApplication, error) {
+ if accessApplication.ID == "" {
+ return AccessApplication{}, errors.Errorf("access application ID cannot be empty")
+ }
+
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s",
+ zoneID,
+ accessApplication.ID,
+ )
+
+ res, err := api.makeRequest("PUT", uri, accessApplication)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessApplicationDetailResponse AccessApplicationDetailResponse
+ err = json.Unmarshal(res, &accessApplicationDetailResponse)
+ if err != nil {
+ return AccessApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessApplicationDetailResponse.Result, nil
+}
+
+// DeleteAccessApplication deletes an access application.
+//
+// API reference: https://api.cloudflare.com/#access-applications-delete-access-application
+func (api *API) DeleteAccessApplication(zoneID, applicationID string) error {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s",
+ zoneID,
+ applicationID,
+ )
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
+
+// RevokeAccessApplicationTokens revokes tokens associated with an
+// access application.
+//
+// API reference: https://api.cloudflare.com/#access-applications-revoke-access-tokens
+func (api *API) RevokeAccessApplicationTokens(zoneID, applicationID string) error {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/revoke-tokens",
+ zoneID,
+ applicationID,
+ )
+
+ _, err := api.makeRequest("POST", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_policy.go b/vendor/github.com/cloudflare/cloudflare-go/access_policy.go
new file mode 100644
index 000000000..dbf63e49f
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/access_policy.go
@@ -0,0 +1,221 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// AccessPolicy defines a policy for allowing or disallowing access to
+// one or more Access applications.
+type AccessPolicy struct {
+ ID string `json:"id,omitempty"`
+ Precedence int `json:"precedence"`
+ Decision string `json:"decision"`
+ CreatedAt *time.Time `json:"created_at"`
+ UpdatedAt *time.Time `json:"updated_at"`
+ Name string `json:"name"`
+
+ // The include policy works like an OR logical operator. The user must
+ // satisfy one of the rules.
+ Include []interface{} `json:"include"`
+
+ // The exclude policy works like a NOT logical operator. The user must
+ // not satisfy all of the rules in exclude.
+ Exclude []interface{} `json:"exclude"`
+
+ // The require policy works like a AND logical operator. The user must
+ // satisfy all of the rules in require.
+ Require []interface{} `json:"require"`
+}
+
+// AccessPolicyEmail is used for managing access based on the email.
+// For example, restrict access to users with the email addresses
+// `test@example.com` or `someone@example.com`.
+type AccessPolicyEmail struct {
+ Email struct {
+ Email string `json:"email"`
+ } `json:"email"`
+}
+
+// AccessPolicyEmailDomain is used for managing access based on an email
+// domain domain such as `example.com` instead of individual addresses.
+type AccessPolicyEmailDomain struct {
+ EmailDomain struct {
+ Domain string `json:"domain"`
+ } `json:"email_domain"`
+}
+
+// AccessPolicyIP is used for managing access based in the IP. It
+// accepts individual IPs or CIDRs.
+type AccessPolicyIP struct {
+ IP struct {
+ IP string `json:"ip"`
+ } `json:"ip"`
+}
+
+// AccessPolicyEveryone is used for managing access to everyone.
+type AccessPolicyEveryone struct {
+ Everyone struct{} `json:"everyone"`
+}
+
+// AccessPolicyAccessGroup is used for managing access based on an
+// access group.
+type AccessPolicyAccessGroup struct {
+ Group struct {
+ ID string `json:"id"`
+ } `json:"group"`
+}
+
+// AccessPolicyListResponse represents the response from the list
+// access polciies endpoint.
+type AccessPolicyListResponse struct {
+ Result []AccessPolicy `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccessPolicyDetailResponse is the API response, containing a single
+// access policy.
+type AccessPolicyDetailResponse struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result AccessPolicy `json:"result"`
+}
+
+// AccessPolicies returns all access policies for an access application.
+//
+// API reference: https://api.cloudflare.com/#access-policy-list-access-policies
+func (api *API) AccessPolicies(zoneID, applicationID string, pageOpts PaginationOptions) ([]AccessPolicy, ResultInfo, error) {
+ v := url.Values{}
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/policies",
+ zoneID,
+ applicationID,
+ )
+
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []AccessPolicy{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessPolicyListResponse AccessPolicyListResponse
+ err = json.Unmarshal(res, &accessPolicyListResponse)
+ if err != nil {
+ return []AccessPolicy{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessPolicyListResponse.Result, accessPolicyListResponse.ResultInfo, nil
+}
+
+// AccessPolicy returns a single policy based on the policy ID.
+//
+// API reference: https://api.cloudflare.com/#access-policy-access-policy-details
+func (api *API) AccessPolicy(zoneID, applicationID, policyID string) (AccessPolicy, error) {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/policies/%s",
+ zoneID,
+ applicationID,
+ policyID,
+ )
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessPolicyDetailResponse AccessPolicyDetailResponse
+ err = json.Unmarshal(res, &accessPolicyDetailResponse)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessPolicyDetailResponse.Result, nil
+}
+
+// CreateAccessPolicy creates a new access policy.
+//
+// API reference: https://api.cloudflare.com/#access-policy-create-access-policy
+func (api *API) CreateAccessPolicy(zoneID, applicationID string, accessPolicy AccessPolicy) (AccessPolicy, error) {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/policies",
+ zoneID,
+ applicationID,
+ )
+
+ res, err := api.makeRequest("POST", uri, accessPolicy)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessPolicyDetailResponse AccessPolicyDetailResponse
+ err = json.Unmarshal(res, &accessPolicyDetailResponse)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessPolicyDetailResponse.Result, nil
+}
+
+// UpdateAccessPolicy updates an existing access policy.
+//
+// API reference: https://api.cloudflare.com/#access-policy-update-access-policy
+func (api *API) UpdateAccessPolicy(zoneID, applicationID string, accessPolicy AccessPolicy) (AccessPolicy, error) {
+ if accessPolicy.ID == "" {
+ return AccessPolicy{}, errors.Errorf("access policy ID cannot be empty")
+ }
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/policies/%s",
+ zoneID,
+ applicationID,
+ accessPolicy.ID,
+ )
+
+ res, err := api.makeRequest("PUT", uri, accessPolicy)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accessPolicyDetailResponse AccessPolicyDetailResponse
+ err = json.Unmarshal(res, &accessPolicyDetailResponse)
+ if err != nil {
+ return AccessPolicy{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accessPolicyDetailResponse.Result, nil
+}
+
+// DeleteAccessPolicy deletes an access policy.
+//
+// API reference: https://api.cloudflare.com/#access-policy-update-access-policy
+func (api *API) DeleteAccessPolicy(zoneID, applicationID, accessPolicyID string) error {
+ uri := fmt.Sprintf(
+ "/zones/%s/access/apps/%s/policies/%s",
+ zoneID,
+ applicationID,
+ accessPolicyID,
+ )
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/account_members.go b/vendor/github.com/cloudflare/cloudflare-go/account_members.go
new file mode 100644
index 000000000..42166e922
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/account_members.go
@@ -0,0 +1,186 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+
+ "github.com/pkg/errors"
+)
+
+// AccountMember is the definition of a member of an account.
+type AccountMember struct {
+ ID string `json:"id"`
+ Code string `json:"code"`
+ User AccountMemberUserDetails `json:"user"`
+ Status string `json:"status"`
+ Roles []AccountRole `json:"roles"`
+}
+
+// AccountMemberUserDetails outlines all the personal information about
+// a member.
+type AccountMemberUserDetails struct {
+ ID string `json:"id"`
+ FirstName string `json:"first_name"`
+ LastName string `json:"last_name"`
+ Email string `json:"email"`
+ TwoFactorAuthenticationEnabled bool
+}
+
+// AccountMembersListResponse represents the response from the list
+// account members endpoint.
+type AccountMembersListResponse struct {
+ Result []AccountMember `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccountMemberDetailResponse is the API response, containing a single
+// account member.
+type AccountMemberDetailResponse struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result AccountMember `json:"result"`
+}
+
+// AccountMemberInvitation represents the invitation for a new member to
+// the account.
+type AccountMemberInvitation struct {
+ Email string `json:"email"`
+ Roles []string `json:"roles"`
+}
+
+// AccountMembers returns all members of an account.
+//
+// API reference: https://api.cloudflare.com/#accounts-list-accounts
+func (api *API) AccountMembers(accountID string, pageOpts PaginationOptions) ([]AccountMember, ResultInfo, error) {
+ if accountID == "" {
+ return []AccountMember{}, ResultInfo{}, errors.New(errMissingAccountID)
+ }
+
+ v := url.Values{}
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ uri := "/accounts/" + accountID + "/members"
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []AccountMember{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountMemberListresponse AccountMembersListResponse
+ err = json.Unmarshal(res, &accountMemberListresponse)
+ if err != nil {
+ return []AccountMember{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountMemberListresponse.Result, accountMemberListresponse.ResultInfo, nil
+}
+
+// CreateAccountMember invites a new member to join an account.
+//
+// API reference: https://api.cloudflare.com/#account-members-add-member
+func (api *API) CreateAccountMember(accountID string, emailAddress string, roles []string) (AccountMember, error) {
+ if accountID == "" {
+ return AccountMember{}, errors.New(errMissingAccountID)
+ }
+
+ uri := "/accounts/" + accountID + "/members"
+
+ var newMember = AccountMemberInvitation{
+ Email: emailAddress,
+ Roles: roles,
+ }
+ res, err := api.makeRequest("POST", uri, newMember)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountMemberListResponse AccountMemberDetailResponse
+ err = json.Unmarshal(res, &accountMemberListResponse)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountMemberListResponse.Result, nil
+}
+
+// DeleteAccountMember removes a member from an account.
+//
+// API reference: https://api.cloudflare.com/#account-members-remove-member
+func (api *API) DeleteAccountMember(accountID string, userID string) error {
+ if accountID == "" {
+ return errors.New(errMissingAccountID)
+ }
+
+ uri := fmt.Sprintf("/accounts/%s/members/%s", accountID, userID)
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
+
+// UpdateAccountMember modifies an existing account member.
+//
+// API reference: https://api.cloudflare.com/#account-members-update-member
+func (api *API) UpdateAccountMember(accountID string, userID string, member AccountMember) (AccountMember, error) {
+ if accountID == "" {
+ return AccountMember{}, errors.New(errMissingAccountID)
+ }
+
+ uri := fmt.Sprintf("/accounts/%s/members/%s", accountID, userID)
+
+ res, err := api.makeRequest("PUT", uri, member)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountMemberListResponse AccountMemberDetailResponse
+ err = json.Unmarshal(res, &accountMemberListResponse)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountMemberListResponse.Result, nil
+}
+
+// AccountMember returns details of a single account member.
+//
+// API reference: https://api.cloudflare.com/#account-members-member-details
+func (api *API) AccountMember(accountID string, memberID string) (AccountMember, error) {
+ if accountID == "" {
+ return AccountMember{}, errors.New(errMissingAccountID)
+ }
+
+ uri := fmt.Sprintf(
+ "/accounts/%s/members/%s",
+ accountID,
+ memberID,
+ )
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountMemberResponse AccountMemberDetailResponse
+ err = json.Unmarshal(res, &accountMemberResponse)
+ if err != nil {
+ return AccountMember{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountMemberResponse.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/account_roles.go b/vendor/github.com/cloudflare/cloudflare-go/account_roles.go
new file mode 100644
index 000000000..3704313b5
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/account_roles.go
@@ -0,0 +1,80 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+
+ "github.com/pkg/errors"
+)
+
+// AccountRole defines the roles that a member can have attached.
+type AccountRole struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+ Permissions map[string]AccountRolePermission `json:"permissions"`
+}
+
+// AccountRolePermission is the shared structure for all permissions
+// that can be assigned to a member.
+type AccountRolePermission struct {
+ Read bool `json:"read"`
+ Edit bool `json:"edit"`
+}
+
+// AccountRolesListResponse represents the list response from the
+// account roles.
+type AccountRolesListResponse struct {
+ Result []AccountRole `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccountRoleDetailResponse is the API response, containing a single
+// account role.
+type AccountRoleDetailResponse struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result AccountRole `json:"result"`
+}
+
+// AccountRoles returns all roles of an account.
+//
+// API reference: https://api.cloudflare.com/#account-roles-list-roles
+func (api *API) AccountRoles(accountID string) ([]AccountRole, error) {
+ uri := "/accounts/" + accountID + "/roles"
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []AccountRole{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountRolesListResponse AccountRolesListResponse
+ err = json.Unmarshal(res, &accountRolesListResponse)
+ if err != nil {
+ return []AccountRole{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountRolesListResponse.Result, nil
+}
+
+// AccountRole returns the details of a single account role.
+//
+// API reference: https://api.cloudflare.com/#account-roles-role-details
+func (api *API) AccountRole(accountID string, roleID string) (AccountRole, error) {
+ uri := fmt.Sprintf("/accounts/%s/roles/%s", accountID, roleID)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AccountRole{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accountRole AccountRoleDetailResponse
+ err = json.Unmarshal(res, &accountRole)
+ if err != nil {
+ return AccountRole{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accountRole.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/accounts.go b/vendor/github.com/cloudflare/cloudflare-go/accounts.go
new file mode 100644
index 000000000..7d34b7b8f
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/accounts.go
@@ -0,0 +1,114 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "net/url"
+ "strconv"
+
+ "github.com/pkg/errors"
+)
+
+// AccountSettings outlines the available options for an account.
+type AccountSettings struct {
+ EnforceTwoFactor bool `json:"enforce_twofactor"`
+}
+
+// Account represents the root object that owns resources.
+type Account struct {
+ ID string `json:"id,omitempty"`
+ Name string `json:"name,omitempty"`
+ Settings *AccountSettings `json:"settings"`
+}
+
+// AccountResponse represents the response from the accounts endpoint for a
+// single account ID.
+type AccountResponse struct {
+ Result Account `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccountListResponse represents the response from the list accounts endpoint.
+type AccountListResponse struct {
+ Result []Account `json:"result"`
+ Response
+ ResultInfo `json:"result_info"`
+}
+
+// AccountDetailResponse is the API response, containing a single Account.
+type AccountDetailResponse struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result Account `json:"result"`
+}
+
+// Accounts returns all accounts the logged in user has access to.
+//
+// API reference: https://api.cloudflare.com/#accounts-list-accounts
+func (api *API) Accounts(pageOpts PaginationOptions) ([]Account, ResultInfo, error) {
+ v := url.Values{}
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ uri := "/accounts"
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []Account{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accListResponse AccountListResponse
+ err = json.Unmarshal(res, &accListResponse)
+ if err != nil {
+ return []Account{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return accListResponse.Result, accListResponse.ResultInfo, nil
+}
+
+// Account returns a single account based on the ID.
+//
+// API reference: https://api.cloudflare.com/#accounts-account-details
+func (api *API) Account(accountID string) (Account, ResultInfo, error) {
+ uri := "/accounts/" + accountID
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return Account{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var accResponse AccountResponse
+ err = json.Unmarshal(res, &accResponse)
+ if err != nil {
+ return Account{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return accResponse.Result, accResponse.ResultInfo, nil
+}
+
+// UpdateAccount allows management of an account using the account ID.
+//
+// API reference: https://api.cloudflare.com/#accounts-update-account
+func (api *API) UpdateAccount(accountID string, account Account) (Account, error) {
+ uri := "/accounts/" + accountID
+
+ res, err := api.makeRequest("PUT", uri, account)
+ if err != nil {
+ return Account{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var a AccountDetailResponse
+ err = json.Unmarshal(res, &a)
+ if err != nil {
+ return Account{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return a.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/argo.go b/vendor/github.com/cloudflare/cloudflare-go/argo.go
new file mode 100644
index 000000000..320c7fc25
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/argo.go
@@ -0,0 +1,120 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+var validSettingValues = []string{"on", "off"}
+
+// ArgoFeatureSetting is the structure of the API object for the
+// argo smart routing and tiered caching settings.
+type ArgoFeatureSetting struct {
+ Editable bool `json:"editable,omitempty"`
+ ID string `json:"id,omitempty"`
+ ModifiedOn time.Time `json:"modified_on,omitempty"`
+ Value string `json:"value"`
+}
+
+// ArgoDetailsResponse is the API response for the argo smart routing
+// and tiered caching response.
+type ArgoDetailsResponse struct {
+ Result ArgoFeatureSetting `json:"result"`
+ Response
+}
+
+// ArgoSmartRouting returns the current settings for smart routing.
+//
+// API reference: https://api.cloudflare.com/#argo-smart-routing-get-argo-smart-routing-setting
+func (api *API) ArgoSmartRouting(zoneID string) (ArgoFeatureSetting, error) {
+ uri := "/zones/" + zoneID + "/argo/smart_routing"
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var argoDetailsResponse ArgoDetailsResponse
+ err = json.Unmarshal(res, &argoDetailsResponse)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return argoDetailsResponse.Result, nil
+}
+
+// UpdateArgoSmartRouting updates the setting for smart routing.
+//
+// API reference: https://api.cloudflare.com/#argo-smart-routing-patch-argo-smart-routing-setting
+func (api *API) UpdateArgoSmartRouting(zoneID, settingValue string) (ArgoFeatureSetting, error) {
+ if !contains(validSettingValues, settingValue) {
+ return ArgoFeatureSetting{}, errors.New(fmt.Sprintf("invalid setting value '%s'. must be 'on' or 'off'", settingValue))
+ }
+
+ uri := "/zones/" + zoneID + "/argo/smart_routing"
+
+ res, err := api.makeRequest("PATCH", uri, ArgoFeatureSetting{Value: settingValue})
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var argoDetailsResponse ArgoDetailsResponse
+ err = json.Unmarshal(res, &argoDetailsResponse)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return argoDetailsResponse.Result, nil
+}
+
+// ArgoTieredCaching returns the current settings for tiered caching.
+//
+// API reference: TBA
+func (api *API) ArgoTieredCaching(zoneID string) (ArgoFeatureSetting, error) {
+ uri := "/zones/" + zoneID + "/argo/tiered_caching"
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var argoDetailsResponse ArgoDetailsResponse
+ err = json.Unmarshal(res, &argoDetailsResponse)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return argoDetailsResponse.Result, nil
+}
+
+// UpdateArgoTieredCaching updates the setting for tiered caching.
+//
+// API reference: TBA
+func (api *API) UpdateArgoTieredCaching(zoneID, settingValue string) (ArgoFeatureSetting, error) {
+ if !contains(validSettingValues, settingValue) {
+ return ArgoFeatureSetting{}, errors.New(fmt.Sprintf("invalid setting value '%s'. must be 'on' or 'off'", settingValue))
+ }
+
+ uri := "/zones/" + zoneID + "/argo/tiered_caching"
+
+ res, err := api.makeRequest("PATCH", uri, ArgoFeatureSetting{Value: settingValue})
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var argoDetailsResponse ArgoDetailsResponse
+ err = json.Unmarshal(res, &argoDetailsResponse)
+ if err != nil {
+ return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return argoDetailsResponse.Result, nil
+}
+
+func contains(s []string, e string) bool {
+ for _, a := range s {
+ if a == e {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go b/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go
new file mode 100644
index 000000000..8cb8eab69
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go
@@ -0,0 +1,143 @@
+package cloudflare
+
+import (
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "time"
+)
+
+// AuditLogAction is a member of AuditLog, the action that was taken.
+type AuditLogAction struct {
+ Result bool `json:"result"`
+ Type string `json:"type"`
+}
+
+// AuditLogActor is a member of AuditLog, who performed the action.
+type AuditLogActor struct {
+ Email string `json:"email"`
+ ID string `json:"id"`
+ IP string `json:"ip"`
+ Type string `json:"type"`
+}
+
+// AuditLogOwner is a member of AuditLog, who owns this audit log.
+type AuditLogOwner struct {
+ ID string `json:"id"`
+}
+
+// AuditLogResource is a member of AuditLog, what was the action performed on.
+type AuditLogResource struct {
+ ID string `json:"id"`
+ Type string `json:"type"`
+}
+
+// AuditLog is an resource that represents an update in the cloudflare dash
+type AuditLog struct {
+ Action AuditLogAction `json:"action"`
+ Actor AuditLogActor `json:"actor"`
+ ID string `json:"id"`
+ Metadata map[string]interface{} `json:"metadata"`
+ NewValue string `json:"newValue"`
+ OldValue string `json:"oldValue"`
+ Owner AuditLogOwner `json:"owner"`
+ Resource AuditLogResource `json:"resource"`
+ When time.Time `json:"when"`
+}
+
+// AuditLogResponse is the response returned from the cloudflare v4 api
+type AuditLogResponse struct {
+ Response Response
+ Result []AuditLog `json:"result"`
+ ResultInfo `json:"result_info"`
+}
+
+// AuditLogFilter is an object for filtering the audit log response from the api.
+type AuditLogFilter struct {
+ ID string
+ ActorIP string
+ ActorEmail string
+ Direction string
+ ZoneName string
+ Since string
+ Before string
+ PerPage int
+ Page int
+}
+
+// String turns an audit log filter in to an HTTP Query Param
+// list. It will not inclue empty members of the struct in the
+// query parameters.
+func (a AuditLogFilter) String() string {
+ params := "?"
+ if a.ID != "" {
+ params += "&id=" + a.ID
+ }
+ if a.ActorIP != "" {
+ params += "&actor.ip=" + a.ActorIP
+ }
+ if a.ActorEmail != "" {
+ params += "&actor.email=" + a.ActorEmail
+ }
+ if a.ZoneName != "" {
+ params += "&zone.name=" + a.ZoneName
+ }
+ if a.Direction != "" {
+ params += "&direction=" + a.Direction
+ }
+ if a.Since != "" {
+ params += "&since=" + a.Since
+ }
+ if a.Before != "" {
+ params += "&before=" + a.Before
+ }
+ if a.PerPage > 0 {
+ params += "&per_page=" + fmt.Sprintf("%d", a.PerPage)
+ }
+ if a.Page > 0 {
+ params += "&page=" + fmt.Sprintf("%d", a.Page)
+ }
+ return params
+}
+
+// GetOrganizationAuditLogs will return the audit logs of a specific
+// organization, based on the ID passed in. The audit logs can be
+// filtered based on any argument in the AuditLogFilter
+//
+// API Reference: https://api.cloudflare.com/#audit-logs-list-organization-audit-logs
+func (api *API) GetOrganizationAuditLogs(organizationID string, a AuditLogFilter) (AuditLogResponse, error) {
+ uri := "/organizations/" + organizationID + "/audit_logs" + fmt.Sprintf("%s", a)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AuditLogResponse{}, err
+ }
+ buf, err := base64.RawStdEncoding.DecodeString(string(res))
+ if err != nil {
+ return AuditLogResponse{}, err
+ }
+ return unmarshalReturn(buf)
+}
+
+// unmarshalReturn will unmarshal bytes and return an auditlogresponse
+func unmarshalReturn(res []byte) (AuditLogResponse, error) {
+ var auditResponse AuditLogResponse
+ err := json.Unmarshal(res, &auditResponse)
+ if err != nil {
+ return auditResponse, err
+ }
+ return auditResponse, nil
+}
+
+// GetUserAuditLogs will return your user's audit logs. The audit logs can be
+// filtered based on any argument in the AuditLogFilter
+//
+// API Reference: https://api.cloudflare.com/#audit-logs-list-user-audit-logs
+func (api *API) GetUserAuditLogs(a AuditLogFilter) (AuditLogResponse, error) {
+ uri := "/user/audit_logs" + fmt.Sprintf("%s", a)
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return AuditLogResponse{}, err
+ }
+ return unmarshalReturn(res)
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go
index 818cdf8ae..b0ae65cd8 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go
@@ -10,6 +10,8 @@ import (
"log"
"math"
"net/http"
+ "net/url"
+ "strconv"
"strings"
"time"
@@ -18,11 +20,14 @@ import (
)
const apiURL = "https://api.cloudflare.com/client/v4"
+
const (
// AuthKeyEmail specifies that we should authenticate with API key and email address
AuthKeyEmail = 1 << iota
// AuthUserService specifies that we should authenticate with a User-Service key
AuthUserService
+ // AuthToken specifies that we should authenticate with an API Token
+ AuthToken
)
// API holds the configuration for the current API client. A client should not
@@ -31,8 +36,10 @@ type API struct {
APIKey string
APIEmail string
APIUserServiceKey string
+ APIToken string
BaseURL string
- organizationID string
+ OrganizationID string
+ UserAgent string
headers http.Header
httpClient *http.Client
authType int
@@ -41,20 +48,13 @@ type API struct {
logger Logger
}
-// New creates a new Cloudflare v4 API client.
-func New(key, email string, opts ...Option) (*API, error) {
- if key == "" || email == "" {
- return nil, errors.New(errEmptyCredentials)
- }
-
+// newClient provides shared logic for New and NewWithUserServiceKey
+func newClient(opts ...Option) (*API, error) {
silentLogger := log.New(ioutil.Discard, "", log.LstdFlags)
api := &API{
- APIKey: key,
- APIEmail: email,
BaseURL: apiURL,
headers: make(http.Header),
- authType: AuthKeyEmail,
rateLimiter: rate.NewLimiter(rate.Limit(4), 1), // 4rps equates to default api limit (1200 req/5 min)
retryPolicy: RetryPolicy{
MaxRetries: 3,
@@ -78,39 +78,120 @@ func New(key, email string, opts ...Option) (*API, error) {
return api, nil
}
-// SetAuthType sets the authentication method (AuthyKeyEmail or AuthUserService).
+// New creates a new Cloudflare v4 API client.
+func New(key, email string, opts ...Option) (*API, error) {
+ if key == "" || email == "" {
+ return nil, errors.New(errEmptyCredentials)
+ }
+
+ api, err := newClient(opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ api.APIKey = key
+ api.APIEmail = email
+ api.authType = AuthKeyEmail
+
+ return api, nil
+}
+
+// NewWithAPIToken creates a new Cloudflare v4 API client using API Tokens
+func NewWithAPIToken(token string, opts ...Option) (*API, error) {
+ if token == "" {
+ return nil, errors.New(errEmptyAPIToken)
+ }
+
+ api, err := newClient(opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ api.APIToken = token
+ api.authType = AuthToken
+
+ return api, nil
+}
+
+// NewWithUserServiceKey creates a new Cloudflare v4 API client using service key authentication.
+func NewWithUserServiceKey(key string, opts ...Option) (*API, error) {
+ if key == "" {
+ return nil, errors.New(errEmptyCredentials)
+ }
+
+ api, err := newClient(opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ api.APIUserServiceKey = key
+ api.authType = AuthUserService
+
+ return api, nil
+}
+
+// SetAuthType sets the authentication method (AuthKeyEmail, AuthToken, or AuthUserService).
func (api *API) SetAuthType(authType int) {
api.authType = authType
}
// ZoneIDByName retrieves a zone's ID from the name.
func (api *API) ZoneIDByName(zoneName string) (string, error) {
- res, err := api.ListZones(zoneName)
+ res, err := api.ListZonesContext(context.TODO(), WithZoneFilter(zoneName))
if err != nil {
- return "", errors.Wrap(err, "ListZones command failed")
+ return "", errors.Wrap(err, "ListZonesContext command failed")
}
- for _, zone := range res {
- if zone.Name == zoneName {
- return zone.ID, nil
+
+ if len(res.Result) > 1 && api.OrganizationID == "" {
+ return "", errors.New("ambiguous zone name used without an account ID")
+ }
+
+ for _, zone := range res.Result {
+ if api.OrganizationID != "" {
+ if zone.Name == zoneName && api.OrganizationID == zone.Account.ID {
+ return zone.ID, nil
+ }
+ } else {
+ if zone.Name == zoneName {
+ return zone.ID, nil
+ }
}
}
+
return "", errors.New("Zone could not be found")
}
// makeRequest makes a HTTP request and returns the body as a byte slice,
-// closing it before returnng. params will be serialized to JSON.
+// closing it before returning. params will be serialized to JSON.
func (api *API) makeRequest(method, uri string, params interface{}) ([]byte, error) {
- return api.makeRequestWithAuthType(method, uri, params, api.authType)
+ return api.makeRequestWithAuthType(context.TODO(), method, uri, params, api.authType)
}
-func (api *API) makeRequestWithAuthType(method, uri string, params interface{}, authType int) ([]byte, error) {
+func (api *API) makeRequestContext(ctx context.Context, method, uri string, params interface{}) ([]byte, error) {
+ return api.makeRequestWithAuthType(ctx, method, uri, params, api.authType)
+}
+
+func (api *API) makeRequestWithHeaders(method, uri string, params interface{}, headers http.Header) ([]byte, error) {
+ return api.makeRequestWithAuthTypeAndHeaders(context.TODO(), method, uri, params, api.authType, headers)
+}
+
+func (api *API) makeRequestWithAuthType(ctx context.Context, method, uri string, params interface{}, authType int) ([]byte, error) {
+ return api.makeRequestWithAuthTypeAndHeaders(ctx, method, uri, params, authType, nil)
+}
+
+func (api *API) makeRequestWithAuthTypeAndHeaders(ctx context.Context, method, uri string, params interface{}, authType int, headers http.Header) ([]byte, error) {
// Replace nil with a JSON object if needed
var jsonBody []byte
var err error
+
if params != nil {
- jsonBody, err = json.Marshal(params)
- if err != nil {
- return nil, errors.Wrap(err, "error marshalling params to JSON")
+ if paramBytes, ok := params.([]byte); ok {
+ jsonBody = paramBytes
+ } else {
+ jsonBody, err = json.Marshal(params)
+ if err != nil {
+ return nil, errors.Wrap(err, "error marshalling params to JSON")
+ }
}
} else {
jsonBody = nil
@@ -124,10 +205,9 @@ func (api *API) makeRequestWithAuthType(method, uri string, params interface{},
if jsonBody != nil {
reqBody = bytes.NewReader(jsonBody)
}
-
if i > 0 {
// expect the backoff introduced here on errored requests to dominate the effect of rate limiting
- // dont need a random component here as the rate limiter should do something similar
+ // don't need a random component here as the rate limiter should do something similar
// nb time duration could truncate an arbitrary float. Since our inputs are all ints, we should be ok
sleepDuration := time.Duration(math.Pow(2, float64(i-1)) * float64(api.retryPolicy.MinRetryDelay))
@@ -137,12 +217,13 @@ func (api *API) makeRequestWithAuthType(method, uri string, params interface{},
// useful to do some simple logging here, maybe introduce levels later
api.logger.Printf("Sleeping %s before retry attempt number %d for request %s %s", sleepDuration.String(), i, method, uri)
time.Sleep(sleepDuration)
+
}
- api.rateLimiter.Wait(context.TODO())
+ err = api.rateLimiter.Wait(context.TODO())
if err != nil {
return nil, errors.Wrap(err, "Error caused by request rate limiting")
}
- resp, respErr = api.request(method, uri, reqBody, authType)
+ resp, respErr = api.request(ctx, method, uri, reqBody, authType, headers)
// retry if the server is rate limiting us or if it failed
// assumes server operations are rolled back on failure
@@ -187,6 +268,11 @@ func (api *API) makeRequestWithAuthType(method, uri string, params interface{},
resp.StatusCode == 523,
resp.StatusCode == 524:
return nil, errors.Errorf("HTTP status %d: service failure", resp.StatusCode)
+ // This isn't a great solution due to the way the `default` case is
+ // a catch all and that the `filters/validate-expr` returns a HTTP 400
+ // yet the clients need to use the HTTP body as a JSON string.
+ case resp.StatusCode == 400 && strings.HasSuffix(resp.Request.URL.Path, "/filters/validate-expr"):
+ return nil, errors.Errorf("%s", respBody)
default:
var s string
if respBody != nil {
@@ -201,14 +287,18 @@ func (api *API) makeRequestWithAuthType(method, uri string, params interface{},
// request makes a HTTP request to the given API endpoint, returning the raw
// *http.Response, or an error if one occurred. The caller is responsible for
// closing the response body.
-func (api *API) request(method, uri string, reqBody io.Reader, authType int) (*http.Response, error) {
+func (api *API) request(ctx context.Context, method, uri string, reqBody io.Reader, authType int, headers http.Header) (*http.Response, error) {
req, err := http.NewRequest(method, api.BaseURL+uri, reqBody)
if err != nil {
return nil, errors.Wrap(err, "HTTP request creation failed")
}
+ req.WithContext(ctx)
+
+ combinedHeaders := make(http.Header)
+ copyHeader(combinedHeaders, api.headers)
+ copyHeader(combinedHeaders, headers)
+ req.Header = combinedHeaders
- // Apply any user-defined headers first.
- req.Header = cloneHeader(api.headers)
if authType&AuthKeyEmail != 0 {
req.Header.Set("X-Auth-Key", api.APIKey)
req.Header.Set("X-Auth-Email", api.APIEmail)
@@ -216,6 +306,13 @@ func (api *API) request(method, uri string, reqBody io.Reader, authType int) (*h
if authType&AuthUserService != 0 {
req.Header.Set("X-Auth-User-Service-Key", api.APIUserServiceKey)
}
+ if authType&AuthToken != 0 {
+ req.Header.Set("Authorization", "Bearer "+api.APIToken)
+ }
+
+ if api.UserAgent != "" {
+ req.Header.Set("User-Agent", api.UserAgent)
+ }
if req.Header.Get("Content-Type") == "" {
req.Header.Set("Content-Type", "application/json")
@@ -235,20 +332,18 @@ func (api *API) request(method, uri string, reqBody io.Reader, authType int) (*h
// accountBase is the base URL for endpoints referring to the current user. It exists as a
// parameter because it is not consistent across APIs.
func (api *API) userBaseURL(accountBase string) string {
- if api.organizationID != "" {
- return "/organizations/" + api.organizationID
+ if api.OrganizationID != "" {
+ return "/accounts/" + api.OrganizationID
}
return accountBase
}
-// cloneHeader returns a shallow copy of the header.
-// copied from https://godoc.org/github.com/golang/gddo/httputil/header#Copy
-func cloneHeader(header http.Header) http.Header {
- h := make(http.Header)
- for k, vs := range header {
- h[k] = vs
+// copyHeader copies all headers for `source` and sets them on `target`.
+// based on https://godoc.org/github.com/golang/gddo/httputil/header#Copy
+func copyHeader(target, source http.Header) {
+ for k, vs := range source {
+ target[k] = vs
}
- return h
}
// ResponseInfo contains a code and message returned by the API as errors or
@@ -316,3 +411,24 @@ type RetryPolicy struct {
type Logger interface {
Printf(format string, v ...interface{})
}
+
+// ReqOption is a functional option for configuring API requests
+type ReqOption func(opt *reqOption)
+type reqOption struct {
+ params url.Values
+}
+
+// WithZoneFilter applies a filter based on zone name.
+func WithZoneFilter(zone string) ReqOption {
+ return func(opt *reqOption) {
+ opt.params.Set("name", zone)
+ }
+}
+
+// WithPagination configures the pagination for a response.
+func WithPagination(opts PaginationOptions) ReqOption {
+ return func(opt *reqOption) {
+ opt.params.Set("page", strconv.Itoa(opts.Page))
+ opt.params.Set("per_page", strconv.Itoa(opts.PerPage))
+ }
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/cpage.go b/vendor/github.com/cloudflare/cloudflare-go/cpage.go
deleted file mode 100644
index 87e50ce84..000000000
--- a/vendor/github.com/cloudflare/cloudflare-go/cpage.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package cloudflare
-
-import "time"
-
-// CustomPage represents a custom page configuration.
-type CustomPage struct {
- CreatedOn string `json:"created_on"`
- ModifiedOn time.Time `json:"modified_on"`
- URL string `json:"url"`
- State string `json:"state"`
- RequiredTokens []string `json:"required_tokens"`
- PreviewTarget string `json:"preview_target"`
- Description string `json:"description"`
-}
-
-// CustomPageResponse represents the response from the custom pages endpoint.
-type CustomPageResponse struct {
- Response
- Result []CustomPage `json:"result"`
-}
-
-// https://api.cloudflare.com/#custom-pages-for-a-zone-available-custom-pages
-// GET /zones/:zone_identifier/custom_pages
-
-// https://api.cloudflare.com/#custom-pages-for-a-zone-custom-page-details
-// GET /zones/:zone_identifier/custom_pages/:identifier
-
-// https://api.cloudflare.com/#custom-pages-for-a-zone-update-custom-page-url
-// PUT /zones/:zone_identifier/custom_pages/:identifier
diff --git a/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go b/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go
index 44dbc4068..03216938b 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go
@@ -8,13 +8,22 @@ import (
"github.com/pkg/errors"
)
+// CustomHostnameSSLSettings represents the SSL settings for a custom hostname.
+type CustomHostnameSSLSettings struct {
+ HTTP2 string `json:"http2,omitempty"`
+ TLS13 string `json:"tls_1_3,omitempty"`
+ MinTLSVersion string `json:"min_tls_version,omitempty"`
+ Ciphers []string `json:"ciphers,omitempty"`
+}
+
// CustomHostnameSSL represents the SSL section in a given custom hostname.
type CustomHostnameSSL struct {
- Status string `json:"status,omitempty"`
- Method string `json:"method,omitempty"`
- Type string `json:"type,omitempty"`
- CnameTarget string `json:"cname_target,omitempty"`
- CnameName string `json:"cname_name,omitempty"`
+ Status string `json:"status,omitempty"`
+ Method string `json:"method,omitempty"`
+ Type string `json:"type,omitempty"`
+ CnameTarget string `json:"cname_target,omitempty"`
+ CnameName string `json:"cname,omitempty"`
+ Settings CustomHostnameSSLSettings `json:"settings,omitempty"`
}
// CustomMetadata defines custom metadata for the hostname. This requires logic to be implemented by Cloudflare to act on the data provided.
@@ -28,7 +37,7 @@ type CustomHostname struct {
CustomMetadata CustomMetadata `json:"custom_metadata,omitempty"`
}
-// CustomHostNameResponse represents a response from the Custom Hostnames endpoints.
+// CustomHostnameResponse represents a response from the Custom Hostnames endpoints.
type CustomHostnameResponse struct {
Result CustomHostname `json:"result"`
Response
@@ -41,14 +50,16 @@ type CustomHostnameListResponse struct {
ResultInfo `json:"result_info"`
}
-// Modify SSL configuration for the given custom hostname in the given zone.
+// UpdateCustomHostnameSSL modifies SSL configuration for the given custom
+// hostname in the given zone.
//
// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-update-custom-hostname-configuration
func (api *API) UpdateCustomHostnameSSL(zoneID string, customHostnameID string, ssl CustomHostnameSSL) (CustomHostname, error) {
return CustomHostname{}, errors.New("Not implemented")
}
-// Delete a custom hostname (and any issued SSL certificates)
+// DeleteCustomHostname deletes a custom hostname (and any issued SSL
+// certificates).
//
// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-delete-a-custom-hostname-and-any-issued-ssl-certificates-
func (api *API) DeleteCustomHostname(zoneID string, customHostnameID string) error {
diff --git a/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go b/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go
new file mode 100644
index 000000000..d96788fc8
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go
@@ -0,0 +1,176 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// CustomPage represents a custom page configuration.
+type CustomPage struct {
+ CreatedOn time.Time `json:"created_on"`
+ ModifiedOn time.Time `json:"modified_on"`
+ URL interface{} `json:"url"`
+ State string `json:"state"`
+ RequiredTokens []string `json:"required_tokens"`
+ PreviewTarget string `json:"preview_target"`
+ Description string `json:"description"`
+ ID string `json:"id"`
+}
+
+// CustomPageResponse represents the response from the custom pages endpoint.
+type CustomPageResponse struct {
+ Response
+ Result []CustomPage `json:"result"`
+}
+
+// CustomPageDetailResponse represents the response from the custom page endpoint.
+type CustomPageDetailResponse struct {
+ Response
+ Result CustomPage `json:"result"`
+}
+
+// CustomPageOptions is used to determine whether or not the operation
+// should take place on an account or zone level based on which is
+// provided to the function.
+//
+// A non-empty value denotes desired use.
+type CustomPageOptions struct {
+ AccountID string
+ ZoneID string
+}
+
+// CustomPageParameters is used to update a particular custom page with
+// the values provided.
+type CustomPageParameters struct {
+ URL interface{} `json:"url"`
+ State string `json:"state"`
+}
+
+// CustomPages lists custom pages for a zone or account.
+//
+// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-list-available-custom-pages
+// Account API reference: https://api.cloudflare.com/#custom-pages-account--list-custom-pages
+func (api *API) CustomPages(options *CustomPageOptions) ([]CustomPage, error) {
+ var (
+ pageType, identifier string
+ )
+
+ if options.AccountID == "" && options.ZoneID == "" {
+ return nil, errors.New("either account ID or zone ID must be provided")
+ }
+
+ if options.AccountID != "" && options.ZoneID != "" {
+ return nil, errors.New("account ID and zone ID are mutually exclusive")
+ }
+
+ // Should the account ID be defined, treat this as an account level operation.
+ if options.AccountID != "" {
+ pageType = "accounts"
+ identifier = options.AccountID
+ } else {
+ pageType = "zones"
+ identifier = options.ZoneID
+ }
+
+ uri := fmt.Sprintf("/%s/%s/custom_pages", pageType, identifier)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return nil, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var customPageResponse CustomPageResponse
+ err = json.Unmarshal(res, &customPageResponse)
+ if err != nil {
+ return nil, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return customPageResponse.Result, nil
+}
+
+// CustomPage lists a single custom page based on the ID.
+//
+// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-custom-page-details
+// Account API reference: https://api.cloudflare.com/#custom-pages-account--custom-page-details
+func (api *API) CustomPage(options *CustomPageOptions, customPageID string) (CustomPage, error) {
+ var (
+ pageType, identifier string
+ )
+
+ if options.AccountID == "" && options.ZoneID == "" {
+ return CustomPage{}, errors.New("either account ID or zone ID must be provided")
+ }
+
+ if options.AccountID != "" && options.ZoneID != "" {
+ return CustomPage{}, errors.New("account ID and zone ID are mutually exclusive")
+ }
+
+ // Should the account ID be defined, treat this as an account level operation.
+ if options.AccountID != "" {
+ pageType = "accounts"
+ identifier = options.AccountID
+ } else {
+ pageType = "zones"
+ identifier = options.ZoneID
+ }
+
+ uri := fmt.Sprintf("/%s/%s/custom_pages/%s", pageType, identifier, customPageID)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return CustomPage{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var customPageResponse CustomPageDetailResponse
+ err = json.Unmarshal(res, &customPageResponse)
+ if err != nil {
+ return CustomPage{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return customPageResponse.Result, nil
+}
+
+// UpdateCustomPage updates a single custom page setting.
+//
+// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-update-custom-page-url
+// Account API reference: https://api.cloudflare.com/#custom-pages-account--update-custom-page
+func (api *API) UpdateCustomPage(options *CustomPageOptions, customPageID string, pageParameters CustomPageParameters) (CustomPage, error) {
+ var (
+ pageType, identifier string
+ )
+
+ if options.AccountID == "" && options.ZoneID == "" {
+ return CustomPage{}, errors.New("either account ID or zone ID must be provided")
+ }
+
+ if options.AccountID != "" && options.ZoneID != "" {
+ return CustomPage{}, errors.New("account ID and zone ID are mutually exclusive")
+ }
+
+ // Should the account ID be defined, treat this as an account level operation.
+ if options.AccountID != "" {
+ pageType = "accounts"
+ identifier = options.AccountID
+ } else {
+ pageType = "zones"
+ identifier = options.ZoneID
+ }
+
+ uri := fmt.Sprintf("/%s/%s/custom_pages/%s", pageType, identifier, customPageID)
+
+ res, err := api.makeRequest("PUT", uri, pageParameters)
+ if err != nil {
+ return CustomPage{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var customPageResponse CustomPageDetailResponse
+ err = json.Unmarshal(res, &customPageResponse)
+ if err != nil {
+ return CustomPage{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return customPageResponse.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/dns.go b/vendor/github.com/cloudflare/cloudflare-go/dns.go
index 3303e9d02..6bcac2480 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/dns.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/dns.go
@@ -16,7 +16,7 @@ type DNSRecord struct {
Name string `json:"name,omitempty"`
Content string `json:"content,omitempty"`
Proxiable bool `json:"proxiable,omitempty"`
- Proxied bool `json:"proxied,omitempty"`
+ Proxied bool `json:"proxied"`
TTL int `json:"ttl,omitempty"`
Locked bool `json:"locked,omitempty"`
ZoneID string `json:"zone_id,omitempty"`
@@ -25,7 +25,7 @@ type DNSRecord struct {
ModifiedOn time.Time `json:"modified_on,omitempty"`
Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC
Meta interface{} `json:"meta,omitempty"`
- Priority int `json:"priority,omitempty"`
+ Priority int `json:"priority"`
}
// DNSRecordResponse represents the response from the DNS endpoint.
@@ -143,7 +143,7 @@ func (api *API) UpdateDNSRecord(zoneID, recordID string, rr DNSRecord) error {
}
rr.Type = rec.Type
uri := "/zones/" + zoneID + "/dns_records/" + recordID
- res, err := api.makeRequest("PUT", uri, rr)
+ res, err := api.makeRequest("PATCH", uri, rr)
if err != nil {
return errors.Wrap(err, errMakeRequestError)
}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/duration.go b/vendor/github.com/cloudflare/cloudflare-go/duration.go
new file mode 100644
index 000000000..ba2418acd
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/duration.go
@@ -0,0 +1,40 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "time"
+)
+
+// Duration implements json.Marshaler and json.Unmarshaler for time.Duration
+// using the fmt.Stringer interface of time.Duration and time.ParseDuration.
+type Duration struct {
+ time.Duration
+}
+
+// MarshalJSON encodes a Duration as a JSON string formatted using String.
+func (d Duration) MarshalJSON() ([]byte, error) {
+ return json.Marshal(d.Duration.String())
+}
+
+// UnmarshalJSON decodes a Duration from a JSON string parsed using time.ParseDuration.
+func (d *Duration) UnmarshalJSON(buf []byte) error {
+ var str string
+
+ err := json.Unmarshal(buf, &str)
+ if err != nil {
+ return err
+ }
+
+ dur, err := time.ParseDuration(str)
+ if err != nil {
+ return err
+ }
+
+ d.Duration = dur
+ return nil
+}
+
+var (
+ _ = json.Marshaler((*Duration)(nil))
+ _ = json.Unmarshaler((*Duration)(nil))
+)
diff --git a/vendor/github.com/cloudflare/cloudflare-go/errors.go b/vendor/github.com/cloudflare/cloudflare-go/errors.go
index 2fff3db30..21c38b168 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/errors.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/errors.go
@@ -3,9 +3,11 @@ package cloudflare
// Error messages
const (
errEmptyCredentials = "invalid credentials: key & email must not be empty"
+ errEmptyAPIToken = "invalid credentials: API Token must not be empty"
errMakeRequestError = "error from makeRequest"
errUnmarshalError = "error unmarshalling the JSON response"
errRequestNotSuccessful = "error reported by API"
+ errMissingAccountID = "account ID is empty and must be provided"
)
var _ Error = &UserError{}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/filter.go b/vendor/github.com/cloudflare/cloudflare-go/filter.go
new file mode 100644
index 000000000..cf3ef1c20
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/filter.go
@@ -0,0 +1,241 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+ "strings"
+
+ "github.com/pkg/errors"
+)
+
+// Filter holds the structure of the filter type.
+type Filter struct {
+ ID string `json:"id,omitempty"`
+ Expression string `json:"expression"`
+ Paused bool `json:"paused"`
+ Description string `json:"description"`
+
+ // Property is mentioned in documentation however isn't populated in
+ // any of the API requests. For now, let's just omit it unless it's
+ // provided.
+ Ref string `json:"ref,omitempty"`
+}
+
+// FiltersDetailResponse is the API response that is returned
+// for requesting all filters on a zone.
+type FiltersDetailResponse struct {
+ Result []Filter `json:"result"`
+ ResultInfo `json:"result_info"`
+ Response
+}
+
+// FilterDetailResponse is the API response that is returned
+// for requesting a single filter on a zone.
+type FilterDetailResponse struct {
+ Result Filter `json:"result"`
+ ResultInfo `json:"result_info"`
+ Response
+}
+
+// FilterValidateExpression represents the JSON payload for checking
+// an expression.
+type FilterValidateExpression struct {
+ Expression string `json:"expression"`
+}
+
+// FilterValidateExpressionResponse represents the API response for
+// checking the expression. It conforms to the JSON API approach however
+// we don't need all of the fields exposed.
+type FilterValidateExpressionResponse struct {
+ Success bool `json:"success"`
+ Errors []FilterValidationExpressionMessage `json:"errors"`
+}
+
+// FilterValidationExpressionMessage represents the API error message.
+type FilterValidationExpressionMessage struct {
+ Message string `json:"message"`
+}
+
+// Filter returns a single filter in a zone based on the filter ID.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-by-filter-id
+func (api *API) Filter(zoneID, filterID string) (Filter, error) {
+ uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filterID)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return Filter{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var filterResponse FilterDetailResponse
+ err = json.Unmarshal(res, &filterResponse)
+ if err != nil {
+ return Filter{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return filterResponse.Result, nil
+}
+
+// Filters returns all filters for a zone.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-all-filters
+func (api *API) Filters(zoneID string, pageOpts PaginationOptions) ([]Filter, error) {
+ uri := "/zones/" + zoneID + "/filters"
+ v := url.Values{}
+
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var filtersResponse FiltersDetailResponse
+ err = json.Unmarshal(res, &filtersResponse)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return filtersResponse.Result, nil
+}
+
+// CreateFilters creates new filters.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/post/
+func (api *API) CreateFilters(zoneID string, filters []Filter) ([]Filter, error) {
+ uri := "/zones/" + zoneID + "/filters"
+
+ res, err := api.makeRequest("POST", uri, filters)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var filtersResponse FiltersDetailResponse
+ err = json.Unmarshal(res, &filtersResponse)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return filtersResponse.Result, nil
+}
+
+// UpdateFilter updates a single filter.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-a-single-filter
+func (api *API) UpdateFilter(zoneID string, filter Filter) (Filter, error) {
+ if filter.ID == "" {
+ return Filter{}, errors.Errorf("filter ID cannot be empty")
+ }
+
+ uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filter.ID)
+
+ res, err := api.makeRequest("PUT", uri, filter)
+ if err != nil {
+ return Filter{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var filterResponse FilterDetailResponse
+ err = json.Unmarshal(res, &filterResponse)
+ if err != nil {
+ return Filter{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return filterResponse.Result, nil
+}
+
+// UpdateFilters updates many filters at once.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-multiple-filters
+func (api *API) UpdateFilters(zoneID string, filters []Filter) ([]Filter, error) {
+ for _, filter := range filters {
+ if filter.ID == "" {
+ return []Filter{}, errors.Errorf("filter ID cannot be empty")
+ }
+ }
+
+ uri := "/zones/" + zoneID + "/filters"
+
+ res, err := api.makeRequest("PUT", uri, filters)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var filtersResponse FiltersDetailResponse
+ err = json.Unmarshal(res, &filtersResponse)
+ if err != nil {
+ return []Filter{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return filtersResponse.Result, nil
+}
+
+// DeleteFilter deletes a single filter.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-a-single-filter
+func (api *API) DeleteFilter(zoneID, filterID string) error {
+ if filterID == "" {
+ return errors.Errorf("filter ID cannot be empty")
+ }
+
+ uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filterID)
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
+
+// DeleteFilters deletes multiple filters.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-multiple-filters
+func (api *API) DeleteFilters(zoneID string, filterIDs []string) error {
+ ids := strings.Join(filterIDs, ",")
+ uri := fmt.Sprintf("/zones/%s/filters?id=%s", zoneID, ids)
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
+
+// ValidateFilterExpression checks correctness of a filter expression.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/validation/
+func (api *API) ValidateFilterExpression(expression string) error {
+ uri := fmt.Sprintf("/filters/validate-expr")
+ expressionPayload := FilterValidateExpression{Expression: expression}
+
+ _, err := api.makeRequest("POST", uri, expressionPayload)
+ if err != nil {
+ var filterValidationResponse FilterValidateExpressionResponse
+
+ jsonErr := json.Unmarshal([]byte(err.Error()), &filterValidationResponse)
+ if jsonErr != nil {
+ return errors.Wrap(jsonErr, errUnmarshalError)
+ }
+
+ if filterValidationResponse.Success != true {
+ // Unsure why but the API returns `errors` as an array but it only
+ // ever shows the issue with one problem at a time ¯\_(ツ)_/¯
+ return errors.Errorf(filterValidationResponse.Errors[0].Message)
+ }
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/firewall.go b/vendor/github.com/cloudflare/cloudflare-go/firewall.go
index 9246b7e65..1f1dfe5e0 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/firewall.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/firewall.go
@@ -68,6 +68,13 @@ func (api *API) CreateUserAccessRule(accessRule AccessRule) (*AccessRuleResponse
return api.createAccessRule("/user", accessRule)
}
+// UserAccessRule returns the details of a user's account access rule.
+//
+// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules
+func (api *API) UserAccessRule(accessRuleID string) (*AccessRuleResponse, error) {
+ return api.retrieveAccessRule("/user", accessRuleID)
+}
+
// UpdateUserAccessRule updates a single access rule for the logged-in user &
// given access rule identifier.
//
@@ -102,6 +109,13 @@ func (api *API) CreateZoneAccessRule(zoneID string, accessRule AccessRule) (*Acc
return api.createAccessRule("/zones/"+zoneID, accessRule)
}
+// ZoneAccessRule returns the details of a zone's access rule.
+//
+// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules
+func (api *API) ZoneAccessRule(zoneID string, accessRuleID string) (*AccessRuleResponse, error) {
+ return api.retrieveAccessRule("/zones/"+zoneID, accessRuleID)
+}
+
// UpdateZoneAccessRule updates a single access rule for the given zone &
// access rule identifiers.
//
@@ -125,7 +139,7 @@ func (api *API) DeleteZoneAccessRule(zoneID, accessRuleID string) (*AccessRuleRe
//
// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-list-access-rules
func (api *API) ListOrganizationAccessRules(organizationID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) {
- return api.listAccessRules("/organizations/"+organizationID, accessRule, page)
+ return api.listAccessRules("/accounts/"+organizationID, accessRule, page)
}
// CreateOrganizationAccessRule creates a firewall access rule for the given
@@ -133,7 +147,14 @@ func (api *API) ListOrganizationAccessRules(organizationID string, accessRule Ac
//
// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-create-access-rule
func (api *API) CreateOrganizationAccessRule(organizationID string, accessRule AccessRule) (*AccessRuleResponse, error) {
- return api.createAccessRule("/organizations/"+organizationID, accessRule)
+ return api.createAccessRule("/accounts/"+organizationID, accessRule)
+}
+
+// OrganizationAccessRule returns the details of an organization's access rule.
+//
+// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-access-rule-details
+func (api *API) OrganizationAccessRule(organizationID string, accessRuleID string) (*AccessRuleResponse, error) {
+ return api.retrieveAccessRule("/accounts/"+organizationID, accessRuleID)
}
// UpdateOrganizationAccessRule updates a single access rule for the given
@@ -141,7 +162,7 @@ func (api *API) CreateOrganizationAccessRule(organizationID string, accessRule A
//
// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-update-access-rule
func (api *API) UpdateOrganizationAccessRule(organizationID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) {
- return api.updateAccessRule("/organizations/"+organizationID, accessRuleID, accessRule)
+ return api.updateAccessRule("/accounts/"+organizationID, accessRuleID, accessRule)
}
// DeleteOrganizationAccessRule deletes a single access rule for the given
@@ -149,7 +170,7 @@ func (api *API) UpdateOrganizationAccessRule(organizationID, accessRuleID string
//
// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-delete-access-rule
func (api *API) DeleteOrganizationAccessRule(organizationID, accessRuleID string) (*AccessRuleResponse, error) {
- return api.deleteAccessRule("/organizations/"+organizationID, accessRuleID)
+ return api.deleteAccessRule("/accounts/"+organizationID, accessRuleID)
}
func (api *API) listAccessRules(prefix string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) {
@@ -209,6 +230,24 @@ func (api *API) createAccessRule(prefix string, accessRule AccessRule) (*AccessR
return response, nil
}
+func (api *API) retrieveAccessRule(prefix, accessRuleID string) (*AccessRuleResponse, error) {
+ uri := prefix + "/firewall/access_rules/rules/" + accessRuleID
+
+ res, err := api.makeRequest("GET", uri, nil)
+
+ if err != nil {
+ return nil, errors.Wrap(err, errMakeRequestError)
+ }
+
+ response := &AccessRuleResponse{}
+ err = json.Unmarshal(res, &response)
+ if err != nil {
+ return nil, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return response, nil
+}
+
func (api *API) updateAccessRule(prefix, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) {
uri := prefix + "/firewall/access_rules/rules/" + accessRuleID
res, err := api.makeRequest("PATCH", uri, accessRule)
diff --git a/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go b/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go
new file mode 100644
index 000000000..7a6ce5c70
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go
@@ -0,0 +1,196 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/url"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// FirewallRule is the struct of the firewall rule.
+type FirewallRule struct {
+ ID string `json:"id,omitempty"`
+ Paused bool `json:"paused"`
+ Description string `json:"description"`
+ Action string `json:"action"`
+ Priority interface{} `json:"priority"`
+ Filter Filter `json:"filter"`
+ CreatedOn time.Time `json:"created_on,omitempty"`
+ ModifiedOn time.Time `json:"modified_on,omitempty"`
+}
+
+// FirewallRulesDetailResponse is the API response for the firewall
+// rules.
+type FirewallRulesDetailResponse struct {
+ Result []FirewallRule `json:"result"`
+ ResultInfo `json:"result_info"`
+ Response
+}
+
+// FirewallRuleResponse is the API response that is returned
+// for requesting a single firewall rule on a zone.
+type FirewallRuleResponse struct {
+ Result FirewallRule `json:"result"`
+ ResultInfo `json:"result_info"`
+ Response
+}
+
+// FirewallRules returns all firewall rules.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-all-rules
+func (api *API) FirewallRules(zoneID string, pageOpts PaginationOptions) ([]FirewallRule, error) {
+ uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID)
+ v := url.Values{}
+
+ if pageOpts.PerPage > 0 {
+ v.Set("per_page", strconv.Itoa(pageOpts.PerPage))
+ }
+
+ if pageOpts.Page > 0 {
+ v.Set("page", strconv.Itoa(pageOpts.Page))
+ }
+
+ if len(v) > 0 {
+ uri = uri + "?" + v.Encode()
+ }
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var firewallDetailResponse FirewallRulesDetailResponse
+ err = json.Unmarshal(res, &firewallDetailResponse)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return firewallDetailResponse.Result, nil
+}
+
+// FirewallRule returns a single firewall rule based on the ID.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-by-rule-id
+func (api *API) FirewallRule(zoneID, firewallRuleID string) (FirewallRule, error) {
+ uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRuleID)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return FirewallRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var firewallRuleResponse FirewallRuleResponse
+ err = json.Unmarshal(res, &firewallRuleResponse)
+ if err != nil {
+ return FirewallRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return firewallRuleResponse.Result, nil
+}
+
+// CreateFirewallRules creates new firewall rules.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/post/
+func (api *API) CreateFirewallRules(zoneID string, firewallRules []FirewallRule) ([]FirewallRule, error) {
+ uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID)
+
+ res, err := api.makeRequest("POST", uri, firewallRules)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var firewallRulesDetailResponse FirewallRulesDetailResponse
+ err = json.Unmarshal(res, &firewallRulesDetailResponse)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return firewallRulesDetailResponse.Result, nil
+}
+
+// UpdateFirewallRule updates a single firewall rule.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-a-single-rule
+func (api *API) UpdateFirewallRule(zoneID string, firewallRule FirewallRule) (FirewallRule, error) {
+ if firewallRule.ID == "" {
+ return FirewallRule{}, errors.Errorf("firewall rule ID cannot be empty")
+ }
+
+ uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRule.ID)
+
+ res, err := api.makeRequest("PUT", uri, firewallRule)
+ if err != nil {
+ return FirewallRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var firewallRuleResponse FirewallRuleResponse
+ err = json.Unmarshal(res, &firewallRuleResponse)
+ if err != nil {
+ return FirewallRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return firewallRuleResponse.Result, nil
+}
+
+// UpdateFirewallRules updates a single firewall rule.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-multiple-rules
+func (api *API) UpdateFirewallRules(zoneID string, firewallRules []FirewallRule) ([]FirewallRule, error) {
+ for _, firewallRule := range firewallRules {
+ if firewallRule.ID == "" {
+ return []FirewallRule{}, errors.Errorf("firewall ID cannot be empty")
+ }
+ }
+
+ uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID)
+
+ res, err := api.makeRequest("PUT", uri, firewallRules)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var firewallRulesDetailResponse FirewallRulesDetailResponse
+ err = json.Unmarshal(res, &firewallRulesDetailResponse)
+ if err != nil {
+ return []FirewallRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return firewallRulesDetailResponse.Result, nil
+}
+
+// DeleteFirewallRule updates a single firewall rule.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-a-single-rule
+func (api *API) DeleteFirewallRule(zoneID, firewallRuleID string) error {
+ if firewallRuleID == "" {
+ return errors.Errorf("firewall rule ID cannot be empty")
+ }
+
+ uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRuleID)
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
+
+// DeleteFirewallRules updates a single firewall rule.
+//
+// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-multiple-rules
+func (api *API) DeleteFirewallRules(zoneID string, firewallRuleIDs []string) error {
+ ids := strings.Join(firewallRuleIDs, ",")
+ uri := fmt.Sprintf("/zones/%s/firewall/rules?id=%s", zoneID, ids)
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go b/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go
index e1af07b57..8b2f89a65 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go
@@ -25,6 +25,7 @@ type LoadBalancerPool struct {
CheckRegions []string `json:"check_regions"`
}
+// LoadBalancerOrigin represents a Load Balancer origin's properties.
type LoadBalancerOrigin struct {
Name string `json:"name"`
Address string `json:"address"`
@@ -34,35 +35,69 @@ type LoadBalancerOrigin struct {
// LoadBalancerMonitor represents a load balancer monitor's properties.
type LoadBalancerMonitor struct {
- ID string `json:"id,omitempty"`
- CreatedOn *time.Time `json:"created_on,omitempty"`
- ModifiedOn *time.Time `json:"modified_on,omitempty"`
- Type string `json:"type"`
- Description string `json:"description"`
- Method string `json:"method"`
- Path string `json:"path"`
- Header map[string][]string `json:"header"`
- Timeout int `json:"timeout"`
- Retries int `json:"retries"`
- Interval int `json:"interval"`
- ExpectedBody string `json:"expected_body"`
- ExpectedCodes string `json:"expected_codes"`
+ ID string `json:"id,omitempty"`
+ CreatedOn *time.Time `json:"created_on,omitempty"`
+ ModifiedOn *time.Time `json:"modified_on,omitempty"`
+ Type string `json:"type"`
+ Description string `json:"description"`
+ Method string `json:"method"`
+ Path string `json:"path"`
+ Header map[string][]string `json:"header"`
+ Timeout int `json:"timeout"`
+ Retries int `json:"retries"`
+ Interval int `json:"interval"`
+ Port uint16 `json:"port,omitempty"`
+ ExpectedBody string `json:"expected_body"`
+ ExpectedCodes string `json:"expected_codes"`
+ FollowRedirects bool `json:"follow_redirects"`
+ AllowInsecure bool `json:"allow_insecure"`
+ ProbeZone string `json:"probe_zone"`
}
// LoadBalancer represents a load balancer's properties.
type LoadBalancer struct {
- ID string `json:"id,omitempty"`
- CreatedOn *time.Time `json:"created_on,omitempty"`
- ModifiedOn *time.Time `json:"modified_on,omitempty"`
- Description string `json:"description"`
- Name string `json:"name"`
- TTL int `json:"ttl,omitempty"`
- FallbackPool string `json:"fallback_pool"`
- DefaultPools []string `json:"default_pools"`
- RegionPools map[string][]string `json:"region_pools"`
- PopPools map[string][]string `json:"pop_pools"`
- Proxied bool `json:"proxied"`
- Persistence string `json:"session_affinity,omitempty"`
+ ID string `json:"id,omitempty"`
+ CreatedOn *time.Time `json:"created_on,omitempty"`
+ ModifiedOn *time.Time `json:"modified_on,omitempty"`
+ Description string `json:"description"`
+ Name string `json:"name"`
+ TTL int `json:"ttl,omitempty"`
+ FallbackPool string `json:"fallback_pool"`
+ DefaultPools []string `json:"default_pools"`
+ RegionPools map[string][]string `json:"region_pools"`
+ PopPools map[string][]string `json:"pop_pools"`
+ Proxied bool `json:"proxied"`
+ Enabled *bool `json:"enabled,omitempty"`
+ Persistence string `json:"session_affinity,omitempty"`
+ PersistenceTTL int `json:"session_affinity_ttl,omitempty"`
+
+ // SteeringPolicy controls pool selection logic.
+ // "off" select pools in DefaultPools order
+ // "geo" select pools based on RegionPools/PopPools
+ // "dynamic_latency" select pools based on RTT (requires health checks)
+ // "random" selects pools in a random order
+ // "" maps to "geo" if RegionPools or PopPools have entries otherwise "off"
+ SteeringPolicy string `json:"steering_policy,omitempty"`
+}
+
+// LoadBalancerOriginHealth represents the health of the origin.
+type LoadBalancerOriginHealth struct {
+ Healthy bool `json:"healthy,omitempty"`
+ RTT Duration `json:"rtt,omitempty"`
+ FailureReason string `json:"failure_reason,omitempty"`
+ ResponseCode int `json:"response_code,omitempty"`
+}
+
+// LoadBalancerPoolPopHealth represents the health of the pool for given PoP.
+type LoadBalancerPoolPopHealth struct {
+ Healthy bool `json:"healthy,omitempty"`
+ Origins []map[string]LoadBalancerOriginHealth `json:"origins,omitempty"`
+}
+
+// LoadBalancerPoolHealth represents the healthchecks from different PoPs for a pool.
+type LoadBalancerPoolHealth struct {
+ ID string `json:"pool_id,omitempty"`
+ PopHealth map[string]LoadBalancerPoolPopHealth `json:"pop_health,omitempty"`
}
// loadBalancerPoolResponse represents the response from the load balancer pool endpoints.
@@ -104,6 +139,12 @@ type loadBalancerListResponse struct {
ResultInfo ResultInfo `json:"result_info"`
}
+// loadBalancerPoolHealthResponse represents the response from the Pool Health Details endpoint.
+type loadBalancerPoolHealthResponse struct {
+ Response
+ Result LoadBalancerPoolHealth `json:"result"`
+}
+
// CreateLoadBalancerPool creates a new load balancer pool.
//
// API reference: https://api.cloudflare.com/#load-balancer-pools-create-a-pool
@@ -328,3 +369,19 @@ func (api *API) ModifyLoadBalancer(zoneID string, lb LoadBalancer) (LoadBalancer
}
return r.Result, nil
}
+
+// PoolHealthDetails fetches the latest healtcheck details for a single pool.
+//
+// API reference: https://api.cloudflare.com/#load-balancer-pools-pool-health-details
+func (api *API) PoolHealthDetails(poolID string) (LoadBalancerPoolHealth, error) {
+ uri := api.userBaseURL("/user") + "/load_balancers/pools/" + poolID + "/health"
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return LoadBalancerPoolHealth{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r loadBalancerPoolHealthResponse
+ if err := json.Unmarshal(res, &r); err != nil {
+ return LoadBalancerPoolHealth{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/lockdown.go b/vendor/github.com/cloudflare/cloudflare-go/lockdown.go
index 3dba81c21..164129bc5 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/lockdown.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/lockdown.go
@@ -16,6 +16,7 @@ type ZoneLockdown struct {
URLs []string `json:"urls"`
Configurations []ZoneLockdownConfig `json:"configurations"`
Paused bool `json:"paused"`
+ Priority int `json:"priority,omitempty"`
}
// ZoneLockdownConfig represents a Zone Lockdown config, which comprises
@@ -65,7 +66,7 @@ func (api *API) CreateZoneLockdown(zoneID string, ld ZoneLockdown) (*ZoneLockdow
//
// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-update-ZoneLockdown-rule
func (api *API) UpdateZoneLockdown(zoneID string, id string, ld ZoneLockdown) (*ZoneLockdownResponse, error) {
- uri := "/zones/" + zoneID + "/firewall/lockdowns"
+ uri := "/zones/" + zoneID + "/firewall/lockdowns/" + id
res, err := api.makeRequest("PUT", uri, ld)
if err != nil {
return nil, errors.Wrap(err, errMakeRequestError)
diff --git a/vendor/github.com/cloudflare/cloudflare-go/logpush.go b/vendor/github.com/cloudflare/cloudflare-go/logpush.go
new file mode 100644
index 000000000..a0134aded
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/logpush.go
@@ -0,0 +1,224 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "strconv"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// LogpushJob describes a Logpush job.
+type LogpushJob struct {
+ ID int `json:"id,omitempty"`
+ Enabled bool `json:"enabled"`
+ Name string `json:"name"`
+ LogpullOptions string `json:"logpull_options"`
+ DestinationConf string `json:"destination_conf"`
+ OwnershipChallenge string `json:"ownership_challenge,omitempty"`
+ LastComplete *time.Time `json:"last_complete,omitempty"`
+ LastError *time.Time `json:"last_error,omitempty"`
+ ErrorMessage string `json:"error_message,omitempty"`
+}
+
+// LogpushJobsResponse is the API response, containing an array of Logpush Jobs.
+type LogpushJobsResponse struct {
+ Response
+ Result []LogpushJob `json:"result"`
+}
+
+// LogpushJobDetailsResponse is the API response, containing a single Logpush Job.
+type LogpushJobDetailsResponse struct {
+ Response
+ Result LogpushJob `json:"result"`
+}
+
+// LogpushGetOwnershipChallenge describes a ownership validation.
+type LogpushGetOwnershipChallenge struct {
+ Filename string `json:"filename"`
+ Valid bool `json:"valid"`
+ Message string `json:"message"`
+}
+
+// LogpushGetOwnershipChallengeResponse is the API response, containing a ownership challenge.
+type LogpushGetOwnershipChallengeResponse struct {
+ Response
+ Result LogpushGetOwnershipChallenge `json:"result"`
+}
+
+// LogpushGetOwnershipChallengeRequest is the API request for get ownership challenge.
+type LogpushGetOwnershipChallengeRequest struct {
+ DestinationConf string `json:"destination_conf"`
+}
+
+// LogpushOwnershipChallangeValidationResponse is the API response,
+// containing a ownership challenge validation result.
+type LogpushOwnershipChallangeValidationResponse struct {
+ Response
+ Result struct {
+ Valid bool `json:"valid"`
+ }
+}
+
+// LogpushValidateOwnershipChallengeRequest is the API request for validate ownership challenge.
+type LogpushValidateOwnershipChallengeRequest struct {
+ DestinationConf string `json:"destination_conf"`
+ OwnershipChallenge string `json:"ownership_challenge"`
+}
+
+// LogpushDestinationExistsResponse is the API response,
+// containing a destination exists check result.
+type LogpushDestinationExistsResponse struct {
+ Response
+ Result struct {
+ Exists bool `json:"exists"`
+ }
+}
+
+// LogpushDestinationExistsRequest is the API request for check destination exists.
+type LogpushDestinationExistsRequest struct {
+ DestinationConf string `json:"destination_conf"`
+}
+
+// CreateLogpushJob creates a new LogpushJob for a zone.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-create-logpush-job
+func (api *API) CreateLogpushJob(zoneID string, job LogpushJob) (*LogpushJob, error) {
+ uri := "/zones/" + zoneID + "/logpush/jobs"
+ res, err := api.makeRequest("POST", uri, job)
+ if err != nil {
+ return nil, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushJobDetailsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return nil, errors.Wrap(err, errUnmarshalError)
+ }
+ return &r.Result, nil
+}
+
+// LogpushJobs returns all Logpush Jobs for a zone.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-list-logpush-jobs
+func (api *API) LogpushJobs(zoneID string) ([]LogpushJob, error) {
+ uri := "/zones/" + zoneID + "/logpush/jobs"
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []LogpushJob{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushJobsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return []LogpushJob{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// LogpushJob fetches detail about one Logpush Job for a zone.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-logpush-job-details
+func (api *API) LogpushJob(zoneID string, jobID int) (LogpushJob, error) {
+ uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID)
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return LogpushJob{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushJobDetailsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return LogpushJob{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// UpdateLogpushJob lets you update a Logpush Job.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-update-logpush-job
+func (api *API) UpdateLogpushJob(zoneID string, jobID int, job LogpushJob) error {
+ uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID)
+ res, err := api.makeRequest("PUT", uri, job)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushJobDetailsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return errors.Wrap(err, errUnmarshalError)
+ }
+ return nil
+}
+
+// DeleteLogpushJob deletes a Logpush Job for a zone.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-delete-logpush-job
+func (api *API) DeleteLogpushJob(zoneID string, jobID int) error {
+ uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID)
+ res, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushJobDetailsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return errors.Wrap(err, errUnmarshalError)
+ }
+ return nil
+}
+
+// GetLogpushOwnershipChallenge returns ownership challenge.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-get-ownership-challenge
+func (api *API) GetLogpushOwnershipChallenge(zoneID, destinationConf string) (*LogpushGetOwnershipChallenge, error) {
+ uri := "/zones/" + zoneID + "/logpush/ownership"
+ res, err := api.makeRequest("POST", uri, LogpushGetOwnershipChallengeRequest{
+ DestinationConf: destinationConf,
+ })
+ if err != nil {
+ return nil, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushGetOwnershipChallengeResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return nil, errors.Wrap(err, errUnmarshalError)
+ }
+ return &r.Result, nil
+}
+
+// ValidateLogpushOwnershipChallenge returns ownership challenge validation result.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-validate-ownership-challenge
+func (api *API) ValidateLogpushOwnershipChallenge(zoneID, destinationConf, ownershipChallenge string) (bool, error) {
+ uri := "/zones/" + zoneID + "/logpush/ownership/validate"
+ res, err := api.makeRequest("POST", uri, LogpushValidateOwnershipChallengeRequest{
+ DestinationConf: destinationConf,
+ OwnershipChallenge: ownershipChallenge,
+ })
+ if err != nil {
+ return false, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushGetOwnershipChallengeResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return false, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result.Valid, nil
+}
+
+// CheckLogpushDestinationExists returns destination exists check result.
+//
+// API reference: https://api.cloudflare.com/#logpush-jobs-check-destination-exists
+func (api *API) CheckLogpushDestinationExists(zoneID, destinationConf string) (bool, error) {
+ uri := "/zones/" + zoneID + "/logpush/validate/destination/exists"
+ res, err := api.makeRequest("POST", uri, LogpushDestinationExistsRequest{
+ DestinationConf: destinationConf,
+ })
+ if err != nil {
+ return false, errors.Wrap(err, errMakeRequestError)
+ }
+ var r LogpushDestinationExistsResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return false, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result.Exists, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/options.go b/vendor/github.com/cloudflare/cloudflare-go/options.go
index 1a113ee10..6cd6fc116 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/options.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/options.go
@@ -28,11 +28,11 @@ func Headers(headers http.Header) Option {
}
}
-// Organization allows you to apply account-level changes (Load Balancing, Railguns)
-// to an organization instead.
+// UsingOrganization allows you to apply account-level changes (Load Balancing,
+// Railguns) to an organization instead.
func UsingOrganization(orgID string) Option {
return func(api *API) error {
- api.organizationID = orgID
+ api.OrganizationID = orgID
return nil
}
}
@@ -73,6 +73,17 @@ func UsingLogger(logger Logger) Option {
}
}
+// UserAgent can be set if you want to send a software name and version for HTTP access logs.
+// It is recommended to set it in order to help future Customer Support diagnostics
+// and prevent collateral damage by sharing generic User-Agent string with abusive users.
+// E.g. "my-software/1.2.3". By default generic Go User-Agent is used.
+func UserAgent(userAgent string) Option {
+ return func(api *API) error {
+ api.UserAgent = userAgent
+ return nil
+ }
+}
+
// parseOptions parses the supplied options functions and returns a configured
// *API instance.
func (api *API) parseOptions(opts ...Option) error {
diff --git a/vendor/github.com/cloudflare/cloudflare-go/organizations.go b/vendor/github.com/cloudflare/cloudflare-go/organizations.go
index 97a67e778..02765159c 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/organizations.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/organizations.go
@@ -139,7 +139,8 @@ type organizationInvitesResponse struct {
ResultInfo `json:"result_info"`
}
-// OrganizationMembers returns list of invites for specified organization of the logged-in user.
+// OrganizationInvites returns list of invites for specified organization of
+// the logged-in user.
//
// API reference: https://api.cloudflare.com/#organization-invites
func (api *API) OrganizationInvites(organizationID string) ([]OrganizationInvite, ResultInfo, error) {
diff --git a/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go b/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go
index 486033afd..fdd8c4273 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go
@@ -1,6 +1,7 @@
package cloudflare
import (
+ "context"
"encoding/json"
"net/url"
"time"
@@ -57,7 +58,7 @@ type originCACertificateResponseRevoke struct {
// API reference: https://api.cloudflare.com/#cloudflare-ca-create-certificate
func (api *API) CreateOriginCertificate(certificate OriginCACertificate) (*OriginCACertificate, error) {
uri := "/certificates"
- res, err := api.makeRequestWithAuthType("POST", uri, certificate, AuthUserService)
+ res, err := api.makeRequestWithAuthType(context.TODO(), "POST", uri, certificate, AuthUserService)
if err != nil {
return nil, errors.Wrap(err, errMakeRequestError)
@@ -89,7 +90,7 @@ func (api *API) OriginCertificates(options OriginCACertificateListOptions) ([]Or
v.Set("zone_id", options.ZoneID)
}
uri := "/certificates" + "?" + v.Encode()
- res, err := api.makeRequestWithAuthType("GET", uri, nil, AuthUserService)
+ res, err := api.makeRequestWithAuthType(context.TODO(), "GET", uri, nil, AuthUserService)
if err != nil {
return nil, errors.Wrap(err, errMakeRequestError)
@@ -117,7 +118,7 @@ func (api *API) OriginCertificates(options OriginCACertificateListOptions) ([]Or
// API reference: https://api.cloudflare.com/#cloudflare-ca-certificate-details
func (api *API) OriginCertificate(certificateID string) (*OriginCACertificate, error) {
uri := "/certificates/" + certificateID
- res, err := api.makeRequestWithAuthType("GET", uri, nil, AuthUserService)
+ res, err := api.makeRequestWithAuthType(context.TODO(), "GET", uri, nil, AuthUserService)
if err != nil {
return nil, errors.Wrap(err, errMakeRequestError)
@@ -145,7 +146,7 @@ func (api *API) OriginCertificate(certificateID string) (*OriginCACertificate, e
// API reference: https://api.cloudflare.com/#cloudflare-ca-revoke-certificate
func (api *API) RevokeOriginCertificate(certificateID string) (*OriginCACertificateID, error) {
uri := "/certificates/" + certificateID
- res, err := api.makeRequestWithAuthType("DELETE", uri, nil, AuthUserService)
+ res, err := api.makeRequestWithAuthType(context.TODO(), "DELETE", uri, nil, AuthUserService)
if err != nil {
return nil, errors.Wrap(err, errMakeRequestError)
diff --git a/vendor/github.com/cloudflare/cloudflare-go/page_rules.go b/vendor/github.com/cloudflare/cloudflare-go/page_rules.go
index 8749b2c51..36f62e62f 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/page_rules.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/page_rules.go
@@ -23,26 +23,40 @@ type PageRuleTarget struct {
PageRuleAction is the action to take when the target is matched.
Valid IDs are:
-
always_online
always_use_https
+ automatic_https_rewrites
browser_cache_ttl
browser_check
+ bypass_cache_on_cookie
+ cache_by_device_type
+ cache_deception_armor
cache_level
+ cache_on_cookie
disable_apps
disable_performance
disable_railgun
disable_security
edge_cache_ttl
email_obfuscation
+ explicit_cache_control
forwarding_url
+ host_header_override
ip_geolocation
+ minify
mirage
+ opportunistic_encryption
+ origin_error_page_pass_thru
+ polish
+ resolve_override
+ respect_strong_etag
+ response_buffering
rocket_loader
security_level
server_side_exclude
- smart_errors
+ sort_query_string_for_cache
ssl
+ true_client_ip_header
waf
*/
type PageRuleAction struct {
@@ -52,26 +66,41 @@ type PageRuleAction struct {
// PageRuleActions maps API action IDs to human-readable strings.
var PageRuleActions = map[string]string{
- "always_online": "Always Online", // Value of type string
- "always_use_https": "Always Use HTTPS", // Value of type interface{}
- "browser_cache_ttl": "Browser Cache TTL", // Value of type int
- "browser_check": "Browser Integrity Check", // Value of type string
- "cache_level": "Cache Level", // Value of type string
- "disable_apps": "Disable Apps", // Value of type interface{}
- "disable_performance": "Disable Performance", // Value of type interface{}
- "disable_railgun": "Disable Railgun", // Value of type string
- "disable_security": "Disable Security", // Value of type interface{}
- "edge_cache_ttl": "Edge Cache TTL", // Value of type int
- "email_obfuscation": "Email Obfuscation", // Value of type string
- "forwarding_url": "Forwarding URL", // Value of type map[string]interface
- "ip_geolocation": "IP Geolocation Header", // Value of type string
- "mirage": "Mirage", // Value of type string
- "rocket_loader": "Rocker Loader", // Value of type string
- "security_level": "Security Level", // Value of type string
- "server_side_exclude": "Server Side Excludes", // Value of type string
- "smart_errors": "Smart Errors", // Value of type string
- "ssl": "SSL", // Value of type string
- "waf": "Web Application Firewall", // Value of type string
+ "always_online": "Always Online", // Value of type string
+ "always_use_https": "Always Use HTTPS", // Value of type interface{}
+ "automatic_https_rewrites": "Automatic HTTPS Rewrites", // Value of type string
+ "browser_cache_ttl": "Browser Cache TTL", // Value of type int
+ "browser_check": "Browser Integrity Check", // Value of type string
+ "bypass_cache_on_cookie": "Bypass Cache on Cookie", // Value of type string
+ "cache_by_device_type": "Cache By Device Type", // Value of type string
+ "cache_deception_armor": "Cache Deception Armor", // Value of type string
+ "cache_level": "Cache Level", // Value of type string
+ "cache_on_cookie": "Cache On Cookie", // Value of type string
+ "disable_apps": "Disable Apps", // Value of type interface{}
+ "disable_performance": "Disable Performance", // Value of type interface{}
+ "disable_railgun": "Disable Railgun", // Value of type string
+ "disable_security": "Disable Security", // Value of type interface{}
+ "edge_cache_ttl": "Edge Cache TTL", // Value of type int
+ "email_obfuscation": "Email Obfuscation", // Value of type string
+ "explicit_cache_control": "Origin Cache Control", // Value of type string
+ "forwarding_url": "Forwarding URL", // Value of type map[string]interface
+ "host_header_override": "Host Header Override", // Value of type string
+ "ip_geolocation": "IP Geolocation Header", // Value of type string
+ "minify": "Minify", // Value of type map[string]interface
+ "mirage": "Mirage", // Value of type string
+ "opportunistic_encryption": "Opportunistic Encryption", // Value of type string
+ "origin_error_page_pass_thru": "Origin Error Page Pass-thru", // Value of type string
+ "polish": "Polish", // Value of type string
+ "resolve_override": "Resolve Override", // Value of type string
+ "respect_strong_etag": "Respect Strong ETags", // Value of type string
+ "response_buffering": "Response Buffering", // Value of type string
+ "rocket_loader": "Rocker Loader", // Value of type string
+ "security_level": "Security Level", // Value of type string
+ "server_side_exclude": "Server Side Excludes", // Value of type string
+ "sort_query_string_for_cache": "Query String Sort", // Value of type string
+ "ssl": "SSL", // Value of type string
+ "true_client_ip_header": "True Client IP Header", // Value of type string
+ "waf": "Web Application Firewall", // Value of type string
}
// PageRule describes a Page Rule.
@@ -176,7 +205,7 @@ func (api *API) ChangePageRule(zoneID, ruleID string, rule PageRule) error {
// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-update-a-page-rule
func (api *API) UpdatePageRule(zoneID, ruleID string, rule PageRule) error {
uri := "/zones/" + zoneID + "/pagerules/" + ruleID
- res, err := api.makeRequest("PUT", uri, nil)
+ res, err := api.makeRequest("PUT", uri, rule)
if err != nil {
return errors.Wrap(err, errMakeRequestError)
}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go b/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go
index 96ad70ee9..e3eb3e2e7 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go
@@ -18,6 +18,7 @@ type RateLimit struct {
Threshold int `json:"threshold"`
Period int `json:"period"`
Action RateLimitAction `json:"action"`
+ Correlate *RateLimitCorrelate `json:"correlate,omitempty"`
}
// RateLimitTrafficMatcher contains the rules that will be used to apply a rate limit to traffic
@@ -35,8 +36,17 @@ type RateLimitRequestMatcher struct {
// RateLimitResponseMatcher contains the matching rules pertaining to responses
type RateLimitResponseMatcher struct {
- Statuses []int `json:"status,omitempty"`
- OriginTraffic *bool `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value
+ Statuses []int `json:"status,omitempty"`
+ OriginTraffic *bool `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value
+ Headers []RateLimitResponseMatcherHeader `json:"headers,omitempty"`
+}
+
+// RateLimitResponseMatcherHeader contains the structure of the origin
+// HTTP headers used in request matcher checks.
+type RateLimitResponseMatcherHeader struct {
+ Name string `json:"name"`
+ Op string `json:"op"`
+ Value string `json:"value"`
}
// RateLimitKeyValue is k-v formatted as expected in the rate limit description
@@ -58,6 +68,11 @@ type RateLimitActionResponse struct {
Body string `json:"body"`
}
+// RateLimitCorrelate pertainings to NAT support
+type RateLimitCorrelate struct {
+ By string `json:"by"`
+}
+
type rateLimitResponse struct {
Response
Result RateLimit `json:"result"`
diff --git a/vendor/github.com/cloudflare/cloudflare-go/registrar.go b/vendor/github.com/cloudflare/cloudflare-go/registrar.go
new file mode 100644
index 000000000..e26d8a4f4
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/registrar.go
@@ -0,0 +1,175 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// RegistrarDomain is the structure of the API response for a new
+// Cloudflare Registrar domain.
+type RegistrarDomain struct {
+ ID string `json:"id"`
+ Available bool `json:"available"`
+ SupportedTLD bool `json:"supported_tld"`
+ CanRegister bool `json:"can_register"`
+ TransferIn RegistrarTransferIn `json:"transfer_in"`
+ CurrentRegistrar string `json:"current_registrar"`
+ ExpiresAt time.Time `json:"expires_at"`
+ RegistryStatuses string `json:"registry_statuses"`
+ Locked bool `json:"locked"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ RegistrantContact RegistrantContact `json:"registrant_contact"`
+}
+
+// RegistrarTransferIn contains the structure for a domain transfer in
+// request.
+type RegistrarTransferIn struct {
+ UnlockDomain string `json:"unlock_domain"`
+ DisablePrivacy string `json:"disable_privacy"`
+ EnterAuthCode string `json:"enter_auth_code"`
+ ApproveTransfer string `json:"approve_transfer"`
+ AcceptFoa string `json:"accept_foa"`
+ CanCancelTransfer bool `json:"can_cancel_transfer"`
+}
+
+// RegistrantContact is the contact details for the domain registration.
+type RegistrantContact struct {
+ ID string `json:"id"`
+ FirstName string `json:"first_name"`
+ LastName string `json:"last_name"`
+ Organization string `json:"organization"`
+ Address string `json:"address"`
+ Address2 string `json:"address2"`
+ City string `json:"city"`
+ State string `json:"state"`
+ Zip string `json:"zip"`
+ Country string `json:"country"`
+ Phone string `json:"phone"`
+ Email string `json:"email"`
+ Fax string `json:"fax"`
+}
+
+// RegistrarDomainConfiguration is the structure for making updates to
+// and existing domain.
+type RegistrarDomainConfiguration struct {
+ NameServers []string `json:"name_servers"`
+ Privacy bool `json:"privacy"`
+ Locked bool `json:"locked"`
+ AutoRenew bool `json:"auto_renew"`
+}
+
+// RegistrarDomainDetailResponse is the structure of the detailed
+// response from the API for a single domain.
+type RegistrarDomainDetailResponse struct {
+ Response
+ Result RegistrarDomain `json:"result"`
+}
+
+// RegistrarDomainsDetailResponse is the structure of the detailed
+// response from the API.
+type RegistrarDomainsDetailResponse struct {
+ Response
+ Result []RegistrarDomain `json:"result"`
+}
+
+// RegistrarDomain returns a single domain based on the account ID and
+// domain name.
+//
+// API reference: https://api.cloudflare.com/#registrar-domains-get-domain
+func (api *API) RegistrarDomain(accountID, domainName string) (RegistrarDomain, error) {
+ uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s", accountID, domainName)
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r RegistrarDomainDetailResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// RegistrarDomains returns all registrar domains based on the account
+// ID.
+//
+// API reference: https://api.cloudflare.com/#registrar-domains-list-domains
+func (api *API) RegistrarDomains(accountID string) ([]RegistrarDomain, error) {
+ uri := "/accounts/" + accountID + "/registrar/domains"
+
+ res, err := api.makeRequest("POST", uri, nil)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r RegistrarDomainsDetailResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// TransferRegistrarDomain initiates the transfer from another registrar
+// to Cloudflare Registrar.
+//
+// API reference: https://api.cloudflare.com/#registrar-domains-transfer-domain
+func (api *API) TransferRegistrarDomain(accountID, domainName string) ([]RegistrarDomain, error) {
+ uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s/transfer", accountID, domainName)
+
+ res, err := api.makeRequest("POST", uri, nil)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r RegistrarDomainsDetailResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// CancelRegistrarDomainTransfer cancels a pending domain transfer.
+//
+// API reference: https://api.cloudflare.com/#registrar-domains-cancel-transfer
+func (api *API) CancelRegistrarDomainTransfer(accountID, domainName string) ([]RegistrarDomain, error) {
+ uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s/cancel_transfer", accountID, domainName)
+
+ res, err := api.makeRequest("POST", uri, nil)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r RegistrarDomainsDetailResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// UpdateRegistrarDomain updates an existing Registrar Domain configuration.
+//
+// API reference: https://api.cloudflare.com/#registrar-domains-update-domain
+func (api *API) UpdateRegistrarDomain(accountID, domainName string, domainConfiguration RegistrarDomainConfiguration) (RegistrarDomain, error) {
+ uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s", accountID, domainName)
+
+ res, err := api.makeRequest("PUT", uri, domainConfiguration)
+ if err != nil {
+ return RegistrarDomain{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r RegistrarDomainDetailResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return RegistrarDomain{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/spectrum.go b/vendor/github.com/cloudflare/cloudflare-go/spectrum.go
new file mode 100644
index 000000000..a95a2cd7f
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/spectrum.go
@@ -0,0 +1,158 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "fmt"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// SpectrumApplication defines a single Spectrum Application.
+type SpectrumApplication struct {
+ ID string `json:"id,omitempty"`
+ Protocol string `json:"protocol,omitempty"`
+ IPv4 bool `json:"ipv4,omitempty"`
+ DNS SpectrumApplicationDNS `json:"dns,omitempty"`
+ OriginDirect []string `json:"origin_direct,omitempty"`
+ OriginPort int `json:"origin_port,omitempty"`
+ OriginDNS *SpectrumApplicationOriginDNS `json:"origin_dns,omitempty"`
+ IPFirewall bool `json:"ip_firewall,omitempty"`
+ ProxyProtocol bool `json:"proxy_protocol,omitempty"`
+ TLS string `json:"tls,omitempty"`
+ CreatedOn *time.Time `json:"created_on,omitempty"`
+ ModifiedOn *time.Time `json:"modified_on,omitempty"`
+}
+
+// SpectrumApplicationDNS holds the external DNS configuration for a Spectrum
+// Application.
+type SpectrumApplicationDNS struct {
+ Type string `json:"type"`
+ Name string `json:"name"`
+}
+
+// SpectrumApplicationOriginDNS holds the origin DNS configuration for a Spectrum
+// Application.
+type SpectrumApplicationOriginDNS struct {
+ Name string `json:"name"`
+}
+
+// SpectrumApplicationDetailResponse is the structure of the detailed response
+// from the API.
+type SpectrumApplicationDetailResponse struct {
+ Response
+ Result SpectrumApplication `json:"result"`
+}
+
+// SpectrumApplicationsDetailResponse is the structure of the detailed response
+// from the API.
+type SpectrumApplicationsDetailResponse struct {
+ Response
+ Result []SpectrumApplication `json:"result"`
+}
+
+// SpectrumApplications fetches all of the Spectrum applications for a zone.
+//
+// API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications
+func (api *API) SpectrumApplications(zoneID string) ([]SpectrumApplication, error) {
+ uri := "/zones/" + zoneID + "/spectrum/apps"
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []SpectrumApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var spectrumApplications SpectrumApplicationsDetailResponse
+ err = json.Unmarshal(res, &spectrumApplications)
+ if err != nil {
+ return []SpectrumApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return spectrumApplications.Result, nil
+}
+
+// SpectrumApplication fetches a single Spectrum application based on the ID.
+//
+// API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications
+func (api *API) SpectrumApplication(zoneID string, applicationID string) (SpectrumApplication, error) {
+ uri := fmt.Sprintf(
+ "/zones/%s/spectrum/apps/%s",
+ zoneID,
+ applicationID,
+ )
+
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var spectrumApplication SpectrumApplicationDetailResponse
+ err = json.Unmarshal(res, &spectrumApplication)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return spectrumApplication.Result, nil
+}
+
+// CreateSpectrumApplication creates a new Spectrum application.
+//
+// API reference: https://developers.cloudflare.com/spectrum/api-reference/#create-a-spectrum-application
+func (api *API) CreateSpectrumApplication(zoneID string, appDetails SpectrumApplication) (SpectrumApplication, error) {
+ uri := "/zones/" + zoneID + "/spectrum/apps"
+
+ res, err := api.makeRequest("POST", uri, appDetails)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var spectrumApplication SpectrumApplicationDetailResponse
+ err = json.Unmarshal(res, &spectrumApplication)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return spectrumApplication.Result, nil
+}
+
+// UpdateSpectrumApplication updates an existing Spectrum application.
+//
+// API reference: https://developers.cloudflare.com/spectrum/api-reference/#update-a-spectrum-application
+func (api *API) UpdateSpectrumApplication(zoneID, appID string, appDetails SpectrumApplication) (SpectrumApplication, error) {
+ uri := fmt.Sprintf(
+ "/zones/%s/spectrum/apps/%s",
+ zoneID,
+ appID,
+ )
+
+ res, err := api.makeRequest("PUT", uri, appDetails)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var spectrumApplication SpectrumApplicationDetailResponse
+ err = json.Unmarshal(res, &spectrumApplication)
+ if err != nil {
+ return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return spectrumApplication.Result, nil
+}
+
+// DeleteSpectrumApplication removes a Spectrum application based on the ID.
+//
+// API reference: https://developers.cloudflare.com/spectrum/api-reference/#delete-a-spectrum-application
+func (api *API) DeleteSpectrumApplication(zoneID string, applicationID string) error {
+ uri := fmt.Sprintf(
+ "/zones/%s/spectrum/apps/%s",
+ zoneID,
+ applicationID,
+ )
+
+ _, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return errors.Wrap(err, errMakeRequestError)
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/ssl.go b/vendor/github.com/cloudflare/cloudflare-go/ssl.go
index def81ea01..505dfa650 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/ssl.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/ssl.go
@@ -9,18 +9,25 @@ import (
// ZoneCustomSSL represents custom SSL certificate metadata.
type ZoneCustomSSL struct {
- ID string `json:"id"`
- Hosts []string `json:"hosts"`
- Issuer string `json:"issuer"`
- Signature string `json:"signature"`
- Status string `json:"status"`
- BundleMethod string `json:"bundle_method"`
- ZoneID string `json:"zone_id"`
- UploadedOn time.Time `json:"uploaded_on"`
- ModifiedOn time.Time `json:"modified_on"`
- ExpiresOn time.Time `json:"expires_on"`
- Priority int `json:"priority"`
- KeylessServer KeylessSSL `json:"keyless_server"`
+ ID string `json:"id"`
+ Hosts []string `json:"hosts"`
+ Issuer string `json:"issuer"`
+ Signature string `json:"signature"`
+ Status string `json:"status"`
+ BundleMethod string `json:"bundle_method"`
+ GeoRestrictions ZoneCustomSSLGeoRestrictions `json:"geo_restrictions"`
+ ZoneID string `json:"zone_id"`
+ UploadedOn time.Time `json:"uploaded_on"`
+ ModifiedOn time.Time `json:"modified_on"`
+ ExpiresOn time.Time `json:"expires_on"`
+ Priority int `json:"priority"`
+ KeylessServer KeylessSSL `json:"keyless_server"`
+}
+
+// ZoneCustomSSLGeoRestrictions represents the parameter to create or update
+// geographic restrictions on a custom ssl certificate.
+type ZoneCustomSSLGeoRestrictions struct {
+ Label string `json:"label"`
}
// zoneCustomSSLResponse represents the response from the zone SSL details endpoint.
@@ -38,9 +45,11 @@ type zoneCustomSSLsResponse struct {
// ZoneCustomSSLOptions represents the parameters to create or update an existing
// custom SSL configuration.
type ZoneCustomSSLOptions struct {
- Certificate string `json:"certificate"`
- PrivateKey string `json:"private_key"`
- BundleMethod string `json:"bundle_method,omitempty"`
+ Certificate string `json:"certificate"`
+ PrivateKey string `json:"private_key"`
+ BundleMethod string `json:"bundle_method,omitempty"`
+ GeoRestrictions ZoneCustomSSLGeoRestrictions `json:"geo_restrictions,omitempty"`
+ Type string `json:"type,omitempty"`
}
// ZoneCustomSSLPriority represents a certificate's ID and priority. It is a
diff --git a/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go
new file mode 100644
index 000000000..ae809e5c7
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go
@@ -0,0 +1,50 @@
+package cloudflare
+
+import (
+ "encoding/json"
+
+ "github.com/pkg/errors"
+)
+
+// UniversalSSLSetting represents a universal ssl setting's properties.
+type UniversalSSLSetting struct {
+ Enabled bool `json:"enabled"`
+}
+
+type universalSSLSettingResponse struct {
+ Response
+ Result UniversalSSLSetting `json:"result"`
+}
+
+// UniversalSSLSettingDetails returns the details for a universal ssl setting
+//
+// API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-universal-ssl-settings-details
+func (api *API) UniversalSSLSettingDetails(zoneID string) (UniversalSSLSetting, error) {
+ uri := "/zones/" + zoneID + "/ssl/universal/settings"
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return UniversalSSLSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r universalSSLSettingResponse
+ if err := json.Unmarshal(res, &r); err != nil {
+ return UniversalSSLSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
+// EditUniversalSSLSetting edits the uniersal ssl setting for a zone
+//
+// API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-edit-universal-ssl-settings
+func (api *API) EditUniversalSSLSetting(zoneID string, setting UniversalSSLSetting) (UniversalSSLSetting, error) {
+ uri := "/zones/" + zoneID + "/ssl/universal/settings"
+ res, err := api.makeRequest("PATCH", uri, setting)
+ if err != nil {
+ return UniversalSSLSetting{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r universalSSLSettingResponse
+ if err := json.Unmarshal(res, &r); err != nil {
+ return UniversalSSLSetting{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go b/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go
index 6eb7629f0..f8082e1f0 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go
@@ -2,6 +2,9 @@ package cloudflare
import (
"encoding/json"
+ "net/url"
+ "strings"
+ "time"
"github.com/pkg/errors"
)
@@ -18,6 +21,32 @@ type VirtualDNS struct {
ModifiedOn string `json:"modified_on"`
}
+// VirtualDNSAnalyticsMetrics respresents a group of aggregated Virtual DNS metrics.
+type VirtualDNSAnalyticsMetrics struct {
+ QueryCount *int64 `json:"queryCount"`
+ UncachedCount *int64 `json:"uncachedCount"`
+ StaleCount *int64 `json:"staleCount"`
+ ResponseTimeAvg *float64 `json:"responseTimeAvg"`
+ ResponseTimeMedian *float64 `json:"responseTimeMedian"`
+ ResponseTime90th *float64 `json:"responseTime90th"`
+ ResponseTime99th *float64 `json:"responseTime99th"`
+}
+
+// VirtualDNSAnalytics represents a set of aggregated Virtual DNS metrics.
+// TODO: Add the queried data and not only the aggregated values.
+type VirtualDNSAnalytics struct {
+ Totals VirtualDNSAnalyticsMetrics `json:"totals"`
+ Min VirtualDNSAnalyticsMetrics `json:"min"`
+ Max VirtualDNSAnalyticsMetrics `json:"max"`
+}
+
+// VirtualDNSUserAnalyticsOptions represents range and dimension selection on analytics endpoint
+type VirtualDNSUserAnalyticsOptions struct {
+ Metrics []string
+ Since *time.Time
+ Until *time.Time
+}
+
// VirtualDNSResponse represents a Virtual DNS response.
type VirtualDNSResponse struct {
Response
@@ -30,6 +59,12 @@ type VirtualDNSListResponse struct {
Result []*VirtualDNS `json:"result"`
}
+// VirtualDNSAnalyticsResponse represents a Virtual DNS analytics response.
+type VirtualDNSAnalyticsResponse struct {
+ Response
+ Result VirtualDNSAnalytics `json:"result"`
+}
+
// CreateVirtualDNS creates a new Virtual DNS cluster.
//
// API reference: https://api.cloudflare.com/#virtual-dns-users--create-a-virtual-dns-cluster
@@ -123,3 +158,35 @@ func (api *API) DeleteVirtualDNS(virtualDNSID string) error {
return nil
}
+
+// encode encodes non-nil fields into URL encoded form.
+func (o VirtualDNSUserAnalyticsOptions) encode() string {
+ v := url.Values{}
+ if o.Since != nil {
+ v.Set("since", (*o.Since).UTC().Format(time.RFC3339))
+ }
+ if o.Until != nil {
+ v.Set("until", (*o.Until).UTC().Format(time.RFC3339))
+ }
+ if o.Metrics != nil {
+ v.Set("metrics", strings.Join(o.Metrics, ","))
+ }
+ return v.Encode()
+}
+
+// VirtualDNSUserAnalytics retrieves analytics report for a specified dimension and time range
+func (api *API) VirtualDNSUserAnalytics(virtualDNSID string, o VirtualDNSUserAnalyticsOptions) (VirtualDNSAnalytics, error) {
+ uri := "/user/virtual_dns/" + virtualDNSID + "/dns_analytics/report?" + o.encode()
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return VirtualDNSAnalytics{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ response := VirtualDNSAnalyticsResponse{}
+ err = json.Unmarshal(res, &response)
+ if err != nil {
+ return VirtualDNSAnalytics{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return response.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/waf.go b/vendor/github.com/cloudflare/cloudflare-go/waf.go
index 4ed156236..cc7c5e78c 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/waf.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/waf.go
@@ -39,14 +39,28 @@ type WAFRule struct {
AllowedModes []string `json:"allowed_modes"`
}
-// WAFRulesResponse represents the response from the WAF rule endpoint.
+// WAFRulesResponse represents the response from the WAF rules endpoint.
type WAFRulesResponse struct {
Response
Result []WAFRule `json:"result"`
ResultInfo ResultInfo `json:"result_info"`
}
+// WAFRuleResponse represents the response from the WAF rule endpoint.
+type WAFRuleResponse struct {
+ Response
+ Result WAFRule `json:"result"`
+ ResultInfo ResultInfo `json:"result_info"`
+}
+
+// WAFRuleOptions is a subset of WAFRule, for editable options.
+type WAFRuleOptions struct {
+ Mode string `json:"mode"`
+}
+
// ListWAFPackages returns a slice of the WAF packages for the given zone.
+//
+// API Reference: https://api.cloudflare.com/#waf-rule-packages-list-firewall-packages
func (api *API) ListWAFPackages(zoneID string) ([]WAFPackage, error) {
var p WAFPackagesResponse
var packages []WAFPackage
@@ -72,26 +86,70 @@ func (api *API) ListWAFPackages(zoneID string) ([]WAFPackage, error) {
}
// ListWAFRules returns a slice of the WAF rules for the given WAF package.
+//
+// API Reference: https://api.cloudflare.com/#waf-rules-list-rules
func (api *API) ListWAFRules(zoneID, packageID string) ([]WAFRule, error) {
- var r WAFRulesResponse
var rules []WAFRule
var res []byte
var err error
+
uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules"
res, err = api.makeRequest("GET", uri, nil)
if err != nil {
return []WAFRule{}, errors.Wrap(err, errMakeRequestError)
}
+
+ var r WAFRulesResponse
err = json.Unmarshal(res, &r)
if err != nil {
return []WAFRule{}, errors.Wrap(err, errUnmarshalError)
}
+
if !r.Success {
// TODO: Provide an actual error message instead of always returning nil
return []WAFRule{}, err
}
+
for ri := range r.Result {
rules = append(rules, r.Result[ri])
}
return rules, nil
}
+
+// WAFRule returns a WAF rule from the given WAF package.
+//
+// API Reference: https://api.cloudflare.com/#waf-rules-rule-details
+func (api *API) WAFRule(zoneID, packageID, ruleID string) (WAFRule, error) {
+ uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules/" + ruleID
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return WAFRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r WAFRuleResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WAFRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return r.Result, nil
+}
+
+// UpdateWAFRule lets you update the mode of a WAF Rule.
+//
+// API Reference: https://api.cloudflare.com/#waf-rules-edit-rule
+func (api *API) UpdateWAFRule(zoneID, packageID, ruleID, mode string) (WAFRule, error) {
+ opts := WAFRuleOptions{Mode: mode}
+ uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules/" + ruleID
+ res, err := api.makeRequest("PATCH", uri, opts)
+ if err != nil {
+ return WAFRule{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ var r WAFRuleResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WAFRule{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers.go b/vendor/github.com/cloudflare/cloudflare-go/workers.go
new file mode 100644
index 000000000..ee7267caf
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/workers.go
@@ -0,0 +1,312 @@
+package cloudflare
+
+import (
+ "encoding/json"
+ "net/http"
+ "time"
+
+ "github.com/pkg/errors"
+)
+
+// WorkerRequestParams provides parameters for worker requests for both enterprise and standard requests
+type WorkerRequestParams struct {
+ ZoneID string
+ ScriptName string
+}
+
+// WorkerRoute aka filters are patterns used to enable or disable workers that match requests.
+//
+// API reference: https://api.cloudflare.com/#worker-filters-properties
+type WorkerRoute struct {
+ ID string `json:"id,omitempty"`
+ Pattern string `json:"pattern"`
+ Enabled bool `json:"enabled"`
+ Script string `json:"script,omitempty"`
+}
+
+// WorkerRoutesResponse embeds Response struct and slice of WorkerRoutes
+type WorkerRoutesResponse struct {
+ Response
+ Routes []WorkerRoute `json:"result"`
+}
+
+// WorkerRouteResponse embeds Response struct and a single WorkerRoute
+type WorkerRouteResponse struct {
+ Response
+ WorkerRoute `json:"result"`
+}
+
+// WorkerScript Cloudflare Worker struct with metadata
+type WorkerScript struct {
+ WorkerMetaData
+ Script string `json:"script"`
+}
+
+// WorkerMetaData contains worker script information such as size, creation & modification dates
+type WorkerMetaData struct {
+ ID string `json:"id,omitempty"`
+ ETAG string `json:"etag,omitempty"`
+ Size int `json:"size,omitempty"`
+ CreatedOn time.Time `json:"created_on,omitempty"`
+ ModifiedOn time.Time `json:"modified_on,omitempty"`
+}
+
+// WorkerListResponse wrapper struct for API response to worker script list API call
+type WorkerListResponse struct {
+ Response
+ WorkerList []WorkerMetaData `json:"result"`
+}
+
+// WorkerScriptResponse wrapper struct for API response to worker script calls
+type WorkerScriptResponse struct {
+ Response
+ WorkerScript `json:"result"`
+}
+
+// DeleteWorker deletes worker for a zone.
+//
+// API reference: https://api.cloudflare.com/#worker-script-delete-worker
+func (api *API) DeleteWorker(requestParams *WorkerRequestParams) (WorkerScriptResponse, error) {
+ // if ScriptName is provided we will treat as org request
+ if requestParams.ScriptName != "" {
+ return api.deleteWorkerWithName(requestParams.ScriptName)
+ }
+ uri := "/zones/" + requestParams.ZoneID + "/workers/script"
+ res, err := api.makeRequest("DELETE", uri, nil)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return r, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// DeleteWorkerWithName deletes worker for a zone.
+// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise
+// organizationID must be specified as api option https://godoc.org/github.com/cloudflare/cloudflare-go#UsingOrganization
+//
+// API reference: https://api.cloudflare.com/#worker-script-delete-worker
+func (api *API) deleteWorkerWithName(scriptName string) (WorkerScriptResponse, error) {
+ if api.OrganizationID == "" {
+ return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName
+ res, err := api.makeRequest("DELETE", uri, nil)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return r, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// DownloadWorker fetch raw script content for your worker returns []byte containing worker code js
+//
+// API reference: https://api.cloudflare.com/#worker-script-download-worker
+func (api *API) DownloadWorker(requestParams *WorkerRequestParams) (WorkerScriptResponse, error) {
+ if requestParams.ScriptName != "" {
+ return api.downloadWorkerWithName(requestParams.ScriptName)
+ }
+ uri := "/zones/" + requestParams.ZoneID + "/workers/script"
+ res, err := api.makeRequest("GET", uri, nil)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ r.Script = string(res)
+ r.Success = true
+ return r, nil
+}
+
+// DownloadWorkerWithName fetch raw script content for your worker returns string containing worker code js
+// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise/
+//
+// API reference: https://api.cloudflare.com/#worker-script-download-worker
+func (api *API) downloadWorkerWithName(scriptName string) (WorkerScriptResponse, error) {
+ if api.OrganizationID == "" {
+ return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName
+ res, err := api.makeRequest("GET", uri, nil)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ r.Script = string(res)
+ r.Success = true
+ return r, nil
+}
+
+// ListWorkerScripts returns list of worker scripts for given organization
+// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise
+//
+// API reference: https://developers.cloudflare.com/workers/api/config-api-for-enterprise/
+func (api *API) ListWorkerScripts() (WorkerListResponse, error) {
+ if api.OrganizationID == "" {
+ return WorkerListResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ uri := "/accounts/" + api.OrganizationID + "/workers/scripts"
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return WorkerListResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r WorkerListResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WorkerListResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// UploadWorker push raw script content for your worker
+//
+// API reference: https://api.cloudflare.com/#worker-script-upload-worker
+func (api *API) UploadWorker(requestParams *WorkerRequestParams, data string) (WorkerScriptResponse, error) {
+ if requestParams.ScriptName != "" {
+ return api.uploadWorkerWithName(requestParams.ScriptName, data)
+ }
+ uri := "/zones/" + requestParams.ZoneID + "/workers/script"
+ headers := make(http.Header)
+ headers.Set("Content-Type", "application/javascript")
+ res, err := api.makeRequestWithHeaders("PUT", uri, []byte(data), headers)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return r, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// UploadWorkerWithName push raw script content for your worker
+// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise/
+//
+// API reference: https://api.cloudflare.com/#worker-script-upload-worker
+func (api *API) uploadWorkerWithName(scriptName string, data string) (WorkerScriptResponse, error) {
+ if api.OrganizationID == "" {
+ return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName
+ headers := make(http.Header)
+ headers.Set("Content-Type", "application/javascript")
+ res, err := api.makeRequestWithHeaders("PUT", uri, []byte(data), headers)
+ var r WorkerScriptResponse
+ if err != nil {
+ return r, errors.Wrap(err, errMakeRequestError)
+ }
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return r, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// CreateWorkerRoute creates worker route for a zone
+//
+// API reference: https://api.cloudflare.com/#worker-filters-create-filter
+func (api *API) CreateWorkerRoute(zoneID string, route WorkerRoute) (WorkerRouteResponse, error) {
+ // Check whether a script name is defined in order to determine whether
+ // to use the single-script or multi-script endpoint.
+ pathComponent := "filters"
+ if route.Script != "" {
+ if api.OrganizationID == "" {
+ return WorkerRouteResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ pathComponent = "routes"
+ }
+
+ uri := "/zones/" + zoneID + "/workers/" + pathComponent
+ res, err := api.makeRequest("POST", uri, route)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r WorkerRouteResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// DeleteWorkerRoute deletes worker route for a zone
+//
+// API reference: https://api.cloudflare.com/#worker-filters-delete-filter
+func (api *API) DeleteWorkerRoute(zoneID string, routeID string) (WorkerRouteResponse, error) {
+ // For deleting a route, it doesn't matter whether we use the
+ // single-script or multi-script endpoint
+ uri := "/zones/" + zoneID + "/workers/filters/" + routeID
+ res, err := api.makeRequest("DELETE", uri, nil)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r WorkerRouteResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
+
+// ListWorkerRoutes returns list of worker routes
+//
+// API reference: https://api.cloudflare.com/#worker-filters-list-filters
+func (api *API) ListWorkerRoutes(zoneID string) (WorkerRoutesResponse, error) {
+ pathComponent := "filters"
+ if api.OrganizationID != "" {
+ pathComponent = "routes"
+ }
+ uri := "/zones/" + zoneID + "/workers/" + pathComponent
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return WorkerRoutesResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r WorkerRoutesResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WorkerRoutesResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+ for i := range r.Routes {
+ route := &r.Routes[i]
+ // The Enabled flag will not be set in the multi-script API response
+ // so we manually set it to true if the script name is not empty
+ // in case any multi-script customers rely on the Enabled field
+ if route.Script != "" {
+ route.Enabled = true
+ }
+ }
+ return r, nil
+}
+
+// UpdateWorkerRoute updates worker route for a zone.
+//
+// API reference: https://api.cloudflare.com/#worker-filters-update-filter
+func (api *API) UpdateWorkerRoute(zoneID string, routeID string, route WorkerRoute) (WorkerRouteResponse, error) {
+ // Check whether a script name is defined in order to determine whether
+ // to use the single-script or multi-script endpoint.
+ pathComponent := "filters"
+ if route.Script != "" {
+ if api.OrganizationID == "" {
+ return WorkerRouteResponse{}, errors.New("organization ID required for enterprise only request")
+ }
+ pathComponent = "routes"
+ }
+ uri := "/zones/" + zoneID + "/workers/" + pathComponent + "/" + routeID
+ res, err := api.makeRequest("PUT", uri, route)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r WorkerRouteResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r, nil
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go
new file mode 100644
index 000000000..f5df6fae4
--- /dev/null
+++ b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go
@@ -0,0 +1,192 @@
+package cloudflare
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+
+ "github.com/pkg/errors"
+)
+
+// WorkersKVNamespaceRequest provides parameters for creating and updating storage namespaces
+type WorkersKVNamespaceRequest struct {
+ Title string `json:"title"`
+}
+
+// WorkersKVNamespaceResponse is the response received when creating storage namespaces
+type WorkersKVNamespaceResponse struct {
+ Response
+ Result WorkersKVNamespace `json:"result"`
+}
+
+// WorkersKVNamespace contains the unique identifier and title of a storage namespace
+type WorkersKVNamespace struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+}
+
+// ListWorkersKVNamespacesResponse contains a slice of storage namespaces associated with an
+// account, pagination information, and an embedded response struct
+type ListWorkersKVNamespacesResponse struct {
+ Response
+ Result []WorkersKVNamespace `json:"result"`
+ ResultInfo `json:"result_info"`
+}
+
+// StorageKey is a key name used to identify a storage value
+type StorageKey struct {
+ Name string `json:"name"`
+}
+
+// ListStorageKeysResponse contains a slice of keys belonging to a storage namespace,
+// pagination information, and an embedded response struct
+type ListStorageKeysResponse struct {
+ Response
+ Result []StorageKey `json:"result"`
+ ResultInfo `json:"result_info"`
+}
+
+// CreateWorkersKVNamespace creates a namespace under the given title.
+// A 400 is returned if the account already owns a namespace with this title.
+// A namespace must be explicitly deleted to be replaced.
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-create-a-namespace
+func (api *API) CreateWorkersKVNamespace(ctx context.Context, req *WorkersKVNamespaceRequest) (WorkersKVNamespaceResponse, error) {
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.OrganizationID)
+ res, err := api.makeRequestContext(ctx, http.MethodPost, uri, req)
+ if err != nil {
+ return WorkersKVNamespaceResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := WorkersKVNamespaceResponse{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return result, err
+}
+
+// ListWorkersKVNamespaces lists storage namespaces
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-list-namespaces
+func (api *API) ListWorkersKVNamespaces(ctx context.Context) (ListWorkersKVNamespacesResponse, error) {
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.OrganizationID)
+ res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
+ if err != nil {
+ return ListWorkersKVNamespacesResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := ListWorkersKVNamespacesResponse{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return result, err
+}
+
+// DeleteWorkersKVNamespace deletes the namespace corresponding to the given ID
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-remove-a-namespace
+func (api *API) DeleteWorkersKVNamespace(ctx context.Context, namespaceID string) (Response, error) {
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.OrganizationID, namespaceID)
+ res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil)
+ if err != nil {
+ return Response{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := Response{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return result, err
+}
+
+// UpdateWorkersKVNamespace modifies a namespace's title
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-rename-a-namespace
+func (api *API) UpdateWorkersKVNamespace(ctx context.Context, namespaceID string, req *WorkersKVNamespaceRequest) (Response, error) {
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.OrganizationID, namespaceID)
+ res, err := api.makeRequestContext(ctx, http.MethodPut, uri, req)
+ if err != nil {
+ return Response{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := Response{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return result, err
+}
+
+// WriteWorkersKV writes a value identified by a key.
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-write-key-value-pair
+func (api *API) WriteWorkersKV(ctx context.Context, namespaceID, key string, value []byte) (Response, error) {
+ key = url.PathEscape(key)
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key)
+ res, err := api.makeRequestWithAuthTypeAndHeaders(
+ ctx, http.MethodPut, uri, value, api.authType, http.Header{"Content-Type": []string{"application/octet-stream"}},
+ )
+ if err != nil {
+ return Response{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := Response{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return result, err
+}
+
+// ReadWorkersKV returns the value associated with the given key in the given namespace
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-read-key-value-pair
+func (api API) ReadWorkersKV(ctx context.Context, namespaceID, key string) ([]byte, error) {
+ key = url.PathEscape(key)
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key)
+ res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
+ if err != nil {
+ return nil, errors.Wrap(err, errMakeRequestError)
+ }
+ return res, nil
+}
+
+// DeleteWorkersKV deletes a key and value for a provided storage namespace
+//
+// API reference: https://api.cloudflare.com/#workers-kv-namespace-delete-key-value-pair
+func (api API) DeleteWorkersKV(ctx context.Context, namespaceID, key string) (Response, error) {
+ key = url.PathEscape(key)
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key)
+ res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil)
+ if err != nil {
+ return Response{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := Response{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+ return result, err
+}
+
+// ListWorkersKVs lists a namespace's keys
+//
+// API Reference: https://api.cloudflare.com/#workers-kv-namespace-list-a-namespace-s-keys
+func (api API) ListWorkersKVs(ctx context.Context, namespaceID string) (ListStorageKeysResponse, error) {
+ uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/keys", api.OrganizationID, namespaceID)
+ res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil)
+ if err != nil {
+ return ListStorageKeysResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+
+ result := ListStorageKeysResponse{}
+ if err := json.Unmarshal(res, &result); err != nil {
+ return result, errors.Wrap(err, errUnmarshalError)
+ }
+ return result, err
+}
diff --git a/vendor/github.com/cloudflare/cloudflare-go/zone.go b/vendor/github.com/cloudflare/cloudflare-go/zone.go
index fe222d33e..d54581976 100644
--- a/vendor/github.com/cloudflare/cloudflare-go/zone.go
+++ b/vendor/github.com/cloudflare/cloudflare-go/zone.go
@@ -1,9 +1,11 @@
package cloudflare
import (
+ "context"
"encoding/json"
"fmt"
"net/url"
+ "sync"
"time"
"github.com/pkg/errors"
@@ -13,7 +15,8 @@ import (
type Owner struct {
ID string `json:"id"`
Email string `json:"email"`
- OwnerType string `json:"owner_type"`
+ Name string `json:"name"`
+ OwnerType string `json:"type"`
}
// Zone describes a Cloudflare zone.
@@ -22,20 +25,20 @@ type Zone struct {
Name string `json:"name"`
// DevMode contains the time in seconds until development expires (if
// positive) or since it expired (if negative). It will be 0 if never used.
- DevMode int `json:"development_mode"`
- OriginalNS []string `json:"original_name_servers"`
- OriginalRegistrar string `json:"original_registrar"`
- OriginalDNSHost string `json:"original_dnshost"`
- CreatedOn time.Time `json:"created_on"`
- ModifiedOn time.Time `json:"modified_on"`
- NameServers []string `json:"name_servers"`
- Owner Owner `json:"owner"`
- Permissions []string `json:"permissions"`
- Plan ZoneRatePlan `json:"plan"`
- PlanPending ZoneRatePlan `json:"plan_pending,omitempty"`
- Status string `json:"status"`
- Paused bool `json:"paused"`
- Type string `json:"type"`
+ DevMode int `json:"development_mode"`
+ OriginalNS []string `json:"original_name_servers"`
+ OriginalRegistrar string `json:"original_registrar"`
+ OriginalDNSHost string `json:"original_dnshost"`
+ CreatedOn time.Time `json:"created_on"`
+ ModifiedOn time.Time `json:"modified_on"`
+ NameServers []string `json:"name_servers"`
+ Owner Owner `json:"owner"`
+ Permissions []string `json:"permissions"`
+ Plan ZonePlan `json:"plan"`
+ PlanPending ZonePlan `json:"plan_pending,omitempty"`
+ Status string `json:"status"`
+ Paused bool `json:"paused"`
+ Type string `json:"type"`
Host struct {
Name string
Website string
@@ -44,6 +47,7 @@ type Zone struct {
Betas []string `json:"betas"`
DeactReason string `json:"deactivation_reason"`
Meta ZoneMeta `json:"meta"`
+ Account Account `json:"account"`
}
// ZoneMeta describes metadata about a zone.
@@ -55,17 +59,31 @@ type ZoneMeta struct {
PhishingDetected bool `json:"phishing_detected"`
}
+// ZonePlan contains the plan information for a zone.
+type ZonePlan struct {
+ ZonePlanCommon
+ IsSubscribed bool `json:"is_subscribed"`
+ CanSubscribe bool `json:"can_subscribe"`
+ LegacyID string `json:"legacy_id"`
+ LegacyDiscount bool `json:"legacy_discount"`
+ ExternallyManaged bool `json:"externally_managed"`
+}
+
// ZoneRatePlan contains the plan information for a zone.
type ZoneRatePlan struct {
- ID string `json:"id"`
- Name string `json:"name,omitempty"`
- Price int `json:"price,omitempty"`
- Currency string `json:"currency,omitempty"`
- Duration int `json:"duration,omitempty"`
- Frequency string `json:"frequency,omitempty"`
+ ZonePlanCommon
Components []zoneRatePlanComponents `json:"components,omitempty"`
}
+// ZonePlanCommon contains fields used by various Plan endpoints
+type ZonePlanCommon struct {
+ ID string `json:"id"`
+ Name string `json:"name,omitempty"`
+ Price int `json:"price,omitempty"`
+ Currency string `json:"currency,omitempty"`
+ Frequency string `json:"frequency,omitempty"`
+}
+
type zoneRatePlanComponents struct {
Name string `json:"name"`
Default int `json:"Default"`
@@ -86,7 +104,8 @@ type ZoneResponse struct {
// ZonesResponse represents the response from the Zone endpoint containing an array of zones.
type ZonesResponse struct {
Response
- Result []Zone `json:"result"`
+ Result []Zone `json:"result"`
+ ResultInfo `json:"result_info"`
}
// ZoneIDResponse represents the response from the Zone endpoint, containing only a zone ID.
@@ -98,7 +117,14 @@ type ZoneIDResponse struct {
// AvailableZoneRatePlansResponse represents the response from the Available Rate Plans endpoint.
type AvailableZoneRatePlansResponse struct {
Response
- Result []ZoneRatePlan `json:"result"`
+ Result []ZoneRatePlan `json:"result"`
+ ResultInfo `json:"result_info"`
+}
+
+// AvailableZonePlansResponse represents the response from the Available Plans endpoint.
+type AvailableZonePlansResponse struct {
+ Response
+ Result []ZonePlan `json:"result"`
ResultInfo
}
@@ -132,7 +158,8 @@ type ZoneSSLSetting struct {
CertificateStatus string `json:"certificate_status"`
}
-// ZoneSettingResponse represents the response from the Zone SSL Setting endpoint.
+// ZoneSSLSettingResponse represents the response from the Zone SSL Setting
+// endpoint.
type ZoneSSLSettingResponse struct {
Response
Result ZoneSSLSetting `json:"result"`
@@ -235,6 +262,7 @@ type PurgeCacheResponse struct {
type newZone struct {
Name string `json:"name"`
JumpStart bool `json:"jump_start"`
+ Type string `json:"type"`
// We use a pointer to get a nil type when the field is empty.
// This allows us to completely omit this with json.Marshal().
Organization *Organization `json:"organization,omitempty"`
@@ -249,7 +277,7 @@ type newZone struct {
// This will add the new zone to the specified multi-user organization.
//
// API reference: https://api.cloudflare.com/#zone-create-a-zone
-func (api *API) CreateZone(name string, jumpstart bool, org Organization) (Zone, error) {
+func (api *API) CreateZone(name string, jumpstart bool, org Organization, zoneType string) (Zone, error) {
var newzone newZone
newzone.Name = name
newzone.JumpStart = jumpstart
@@ -257,6 +285,12 @@ func (api *API) CreateZone(name string, jumpstart bool, org Organization) (Zone,
newzone.Organization = &org
}
+ if zoneType == "partial" {
+ newzone.Type = "partial"
+ } else {
+ newzone.Type = "full"
+ }
+
res, err := api.makeRequest("POST", "/zones", newzone)
if err != nil {
return Zone{}, errors.Wrap(err, errMakeRequestError)
@@ -316,10 +350,7 @@ func (api *API) ListZones(z ...string) ([]Zone, error) {
}
}
} else {
- // TODO: Paginate here. We only grab the first page of results.
- // Could do this concurrently after the first request by creating a
- // sync.WaitGroup or just a channel + workers.
- res, err = api.makeRequest("GET", "/zones", nil)
+ res, err = api.makeRequest("GET", "/zones?per_page=50", nil)
if err != nil {
return []Zone{}, errors.Wrap(err, errMakeRequestError)
}
@@ -327,12 +358,67 @@ func (api *API) ListZones(z ...string) ([]Zone, error) {
if err != nil {
return []Zone{}, errors.Wrap(err, errUnmarshalError)
}
- zones = r.Result
+
+ totalPageCount := r.TotalPages
+ var wg sync.WaitGroup
+ wg.Add(totalPageCount)
+ errc := make(chan error)
+
+ for i := 1; i <= totalPageCount; i++ {
+ go func(pageNumber int) error {
+ res, err = api.makeRequest("GET", fmt.Sprintf("/zones?per_page=50&page=%d", pageNumber), nil)
+ if err != nil {
+ errc <- err
+ }
+
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ errc <- err
+ }
+
+ for _, zone := range r.Result {
+ zones = append(zones, zone)
+ }
+
+ select {
+ case err := <-errc:
+ return err
+ default:
+ wg.Done()
+ }
+
+ return nil
+ }(i)
+ }
+
+ wg.Wait()
}
return zones, nil
}
+// ListZonesContext lists zones on an account. Optionally takes a list of ReqOptions.
+func (api *API) ListZonesContext(ctx context.Context, opts ...ReqOption) (r ZonesResponse, err error) {
+ var res []byte
+ opt := reqOption{
+ params: url.Values{},
+ }
+ for _, of := range opts {
+ of(&opt)
+ }
+
+ res, err = api.makeRequestContext(ctx, "GET", "/zones?"+opt.params.Encode(), nil)
+ if err != nil {
+ return ZonesResponse{}, errors.Wrap(err, errMakeRequestError)
+ }
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return ZonesResponse{}, errors.Wrap(err, errUnmarshalError)
+ }
+
+ return r, nil
+}
+
// ZoneDetails fetches information about a zone.
//
// API reference: https://api.cloudflare.com/#zone-zone-details
@@ -351,9 +437,9 @@ func (api *API) ZoneDetails(zoneID string) (Zone, error) {
// ZoneOptions is a subset of Zone, for editable options.
type ZoneOptions struct {
- Paused *bool `json:"paused,omitempty"`
- VanityNS []string `json:"vanity_name_servers,omitempty"`
- Plan *ZoneRatePlan `json:"plan,omitempty"`
+ Paused *bool `json:"paused,omitempty"`
+ VanityNS []string `json:"vanity_name_servers,omitempty"`
+ Plan *ZonePlan `json:"plan,omitempty"`
}
// ZoneSetPaused pauses Cloudflare service for the entire zone, sending all
@@ -380,8 +466,8 @@ func (api *API) ZoneSetVanityNS(zoneID string, ns []string) (Zone, error) {
return zone, nil
}
-// ZoneSetRatePlan changes the zone plan.
-func (api *API) ZoneSetRatePlan(zoneID string, plan ZoneRatePlan) (Zone, error) {
+// ZoneSetPlan changes the zone plan.
+func (api *API) ZoneSetPlan(zoneID string, plan ZonePlan) (Zone, error) {
zoneopts := ZoneOptions{Plan: &plan}
zone, err := api.EditZone(zoneID, zoneopts)
if err != nil {
@@ -418,7 +504,7 @@ func (api *API) EditZone(zoneID string, zoneOpts ZoneOptions) (Zone, error) {
// API reference: https://api.cloudflare.com/#zone-purge-all-files
func (api *API) PurgeEverything(zoneID string) (PurgeCacheResponse, error) {
uri := "/zones/" + zoneID + "/purge_cache"
- res, err := api.makeRequest("DELETE", uri, PurgeCacheRequest{true, nil, nil, nil})
+ res, err := api.makeRequest("POST", uri, PurgeCacheRequest{true, nil, nil, nil})
if err != nil {
return PurgeCacheResponse{}, errors.Wrap(err, errMakeRequestError)
}
@@ -435,7 +521,7 @@ func (api *API) PurgeEverything(zoneID string) (PurgeCacheResponse, error) {
// API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags
func (api *API) PurgeCache(zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error) {
uri := "/zones/" + zoneID + "/purge_cache"
- res, err := api.makeRequest("DELETE", uri, pcr)
+ res, err := api.makeRequest("POST", uri, pcr)
if err != nil {
return PurgeCacheResponse{}, errors.Wrap(err, errMakeRequestError)
}
@@ -480,6 +566,23 @@ func (api *API) AvailableZoneRatePlans(zoneID string) ([]ZoneRatePlan, error) {
return r.Result, nil
}
+// AvailableZonePlans returns information about all plans available to the specified zone.
+//
+// API reference: https://api.cloudflare.com/#zone-rate-plan-list-available-plans
+func (api *API) AvailableZonePlans(zoneID string) ([]ZonePlan, error) {
+ uri := "/zones/" + zoneID + "/available_plans"
+ res, err := api.makeRequest("GET", uri, nil)
+ if err != nil {
+ return []ZonePlan{}, errors.Wrap(err, errMakeRequestError)
+ }
+ var r AvailableZonePlansResponse
+ err = json.Unmarshal(res, &r)
+ if err != nil {
+ return []ZonePlan{}, errors.Wrap(err, errUnmarshalError)
+ }
+ return r.Result, nil
+}
+
// encode encodes non-nil fields into URL encoded form.
func (o ZoneAnalyticsOptions) encode() string {
v := url.Values{}
diff --git a/vendor/github.com/decker502/dnspod-go/dnspod.go b/vendor/github.com/decker502/dnspod-go/dnspod.go
index ad6671b2b..17e67488a 100644
--- a/vendor/github.com/decker502/dnspod-go/dnspod.go
+++ b/vendor/github.com/decker502/dnspod-go/dnspod.go
@@ -8,6 +8,7 @@ import (
"encoding/json"
"fmt"
"io"
+ "net"
"net/http"
"net/url"
"strings"
@@ -20,6 +21,8 @@ const (
userAgent = "dnspod-go/" + libraryVersion
apiVersion = "v1"
+ timeout = 5
+ keepAlive = 30
)
// dnspod API docs: https://www.dnspod.cn/docs/info.html
@@ -30,6 +33,8 @@ type CommonParams struct {
Lang string
ErrorOnEmpty string
UserID string
+ Timeout int
+ KeepAlive int
}
func newPayLoad(params CommonParams) url.Values {
@@ -49,7 +54,6 @@ func newPayLoad(params CommonParams) url.Values {
}
if params.UserID != "" {
p.Set("user_id", params.UserID)
-
}
return p
@@ -82,7 +86,27 @@ type Client struct {
// NewClient returns a new dnspod API client.
func NewClient(CommonParams CommonParams) *Client {
- c := &Client{HttpClient: &http.Client{}, CommonParams: CommonParams, BaseURL: baseURL, UserAgent: userAgent}
+ var _timeout, _keepalive int
+ _timeout = timeout
+ _keepalive = keepAlive
+
+ if CommonParams.Timeout != 0 {
+ _timeout = CommonParams.Timeout
+ }
+ if CommonParams.KeepAlive != 0 {
+ _keepalive = CommonParams.KeepAlive
+ }
+
+ cli := http.Client{
+ Transport: &http.Transport{
+ Dial: (&net.Dialer{
+ Timeout: time.Duration(_timeout) * time.Second,
+ KeepAlive: time.Duration(_keepalive) * time.Second,
+ }).Dial,
+ },
+ }
+
+ c := &Client{HttpClient: &cli, CommonParams: CommonParams, BaseURL: baseURL, UserAgent: userAgent}
c.Domains = &DomainsService{client: c}
return c
diff --git a/vendor/github.com/decker502/dnspod-go/domain_records.go b/vendor/github.com/decker502/dnspod-go/domain_records.go
index c236ccbf3..dea4ad97c 100644
--- a/vendor/github.com/decker502/dnspod-go/domain_records.go
+++ b/vendor/github.com/decker502/dnspod-go/domain_records.go
@@ -44,12 +44,12 @@ func recordAction(action string) string {
// List the domain records.
//
// dnspod API docs: https://www.dnspod.cn/docs/records.html#record-list
-func (s *DomainsService) ListRecords(domain string, recordName string) ([]Record, *Response, error) {
+func (s *DomainsService) ListRecords(domainID string, recordName string) ([]Record, *Response, error) {
path := recordAction("List")
payload := newPayLoad(s.client.CommonParams)
- payload.Add("domain_id", domain)
+ payload.Add("domain_id", domainID)
if recordName != "" {
payload.Add("sub_domain", recordName)
diff --git a/vendor/github.com/decker502/dnspod-go/domains.go b/vendor/github.com/decker502/dnspod-go/domains.go
index 8cd524639..befd4bd25 100644
--- a/vendor/github.com/decker502/dnspod-go/domains.go
+++ b/vendor/github.com/decker502/dnspod-go/domains.go
@@ -1,6 +1,7 @@
package dnspod
import (
+ "encoding/json"
"fmt"
"strconv"
// "time"
@@ -30,26 +31,26 @@ type DomainInfo struct {
}
type Domain struct {
- ID int `json:"id,omitempty"`
- Name string `json:"name,omitempty"`
- PunyCode string `json:"punycode,omitempty"`
- Grade string `json:"grade,omitempty"`
- GradeTitle string `json:"grade_title,omitempty"`
- Status string `json:"status,omitempty"`
- ExtStatus string `json:"ext_status,omitempty"`
- Records string `json:"records,omitempty"`
- GroupID string `json:"group_id,omitempty"`
- IsMark string `json:"is_mark,omitempty"`
- Remark string `json:"remark,omitempty"`
- IsVIP string `json:"is_vip,omitempty"`
- SearchenginePush string `json:"searchengine_push,omitempty"`
- UserID string `json:"user_id,omitempty"`
- CreatedOn string `json:"created_on,omitempty"`
- UpdatedOn string `json:"updated_on,omitempty"`
- TTL string `json:"ttl,omitempty"`
- CNameSpeedUp string `json:"cname_speedup,omitempty"`
- Owner string `json:"owner,omitempty"`
- AuthToAnquanBao bool `json:"auth_to_anquanbao,omitempty"`
+ ID json.Number `json:"id,omitempty"`
+ Name string `json:"name,omitempty"`
+ PunyCode string `json:"punycode,omitempty"`
+ Grade string `json:"grade,omitempty"`
+ GradeTitle string `json:"grade_title,omitempty"`
+ Status string `json:"status,omitempty"`
+ ExtStatus string `json:"ext_status,omitempty"`
+ Records string `json:"records,omitempty"`
+ GroupID json.Number `json:"group_id,omitempty"`
+ IsMark string `json:"is_mark,omitempty"`
+ Remark string `json:"remark,omitempty"`
+ IsVIP string `json:"is_vip,omitempty"`
+ SearchenginePush string `json:"searchengine_push,omitempty"`
+ UserID string `json:"user_id,omitempty"`
+ CreatedOn string `json:"created_on,omitempty"`
+ UpdatedOn string `json:"updated_on,omitempty"`
+ TTL string `json:"ttl,omitempty"`
+ CNameSpeedUp string `json:"cname_speedup,omitempty"`
+ Owner string `json:"owner,omitempty"`
+ AuthToAnquanBao bool `json:"auth_to_anquanbao,omitempty"`
}
type domainListWrapper struct {
@@ -113,7 +114,7 @@ func (s *DomainsService) Create(domainAttributes Domain) (Domain, *Response, err
payload := newPayLoad(s.client.CommonParams)
payload.Set("domain", domainAttributes.Name)
- payload.Set("group_id", domainAttributes.GroupID)
+ payload.Set("group_id", domainAttributes.GroupID.String())
payload.Set("is_mark", domainAttributes.IsMark)
res, err := s.client.post(path, payload, &returnedDomain)
diff --git a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/dnsimple.go b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/dnsimple.go
index 6c32e1632..0738aa03a 100644
--- a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/dnsimple.go
+++ b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/dnsimple.go
@@ -23,7 +23,7 @@ const (
// This is a pro-forma convention given that Go dependencies
// tends to be fetched directly from the repo.
// It is also used in the user-agent identify the client.
- Version = "0.21.0"
+ Version = "0.30.0"
// defaultBaseURL to the DNSimple production API.
defaultBaseURL = "https://api.dnsimple.com"
diff --git a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/domains.go b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/domains.go
index 6cd8fd7fb..8ca687144 100644
--- a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/domains.go
+++ b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/domains.go
@@ -129,18 +129,10 @@ func (s *DomainsService) DeleteDomain(accountID string, domainIdentifier string)
return domainResponse, nil
}
-// ResetDomainToken resets the domain token.
+// DEPRECATED
//
// See https://developer.dnsimple.com/v2/domains/#reset-token
func (s *DomainsService) ResetDomainToken(accountID string, domainIdentifier string) (*domainResponse, error) {
- path := versioned(domainPath(accountID, domainIdentifier) + "/token")
- domainResponse := &domainResponse{}
-
- resp, err := s.client.post(path, nil, domainResponse)
- if err != nil {
- return nil, err
- }
-
- domainResponse.HttpResponse = resp
- return domainResponse, nil
+ // noop
+ return &domainResponse{}, nil
}
diff --git a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar.go b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar.go
index 625bbb2dc..1013bd607 100644
--- a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar.go
+++ b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar.go
@@ -62,7 +62,7 @@ type DomainPremiumPriceOptions struct {
Action string `url:"action,omitempty"`
}
-// Gets the premium price for a domain.
+// GetDomainPremiumPrice gets the premium price for a domain.
//
// You must specify an action to get the price for. Valid actions are:
// - registration
diff --git a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar_whois_privacy.go b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar_whois_privacy.go
index edf47b12a..730fd8a44 100644
--- a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar_whois_privacy.go
+++ b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/registrar_whois_privacy.go
@@ -14,12 +14,30 @@ type WhoisPrivacy struct {
UpdatedAt string `json:"updated_at,omitempty"`
}
+// WhoisPrivacyRenewal represents a whois privacy renewal in DNSimple.
+type WhoisPrivacyRenewal struct {
+ ID int64 `json:"id,omitempty"`
+ DomainID int64 `json:"domain_id,omitempty"`
+ WhoisPrivacyID int64 `json:"whois_privacy_id,omitempty"`
+ State string `json:"string,omitempty"`
+ Enabled bool `json:"enabled,omitempty"`
+ ExpiresOn string `json:"expires_on,omitempty"`
+ CreatedAt string `json:"created_at,omitempty"`
+ UpdatedAt string `json:"updated_at,omitempty"`
+}
+
// whoisPrivacyResponse represents a response from an API method that returns a WhoisPrivacy struct.
type whoisPrivacyResponse struct {
Response
Data *WhoisPrivacy `json:"data"`
}
+// whoisPrivacyRenewalResponse represents a response from an API method that returns a WhoisPrivacyRenewal struct.
+type whoisPrivacyRenewalResponse struct {
+ Response
+ Data *WhoisPrivacyRenewal `json:"data"`
+}
+
// GetWhoisPrivacy gets the whois privacy for the domain.
//
// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#get
@@ -52,7 +70,7 @@ func (s *RegistrarService) EnableWhoisPrivacy(accountID string, domainName strin
return privacyResponse, nil
}
-// DisablePrivacy disables the whois privacy for the domain.
+// DisableWhoisPrivacy disables the whois privacy for the domain.
//
// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#enable
func (s *RegistrarService) DisableWhoisPrivacy(accountID string, domainName string) (*whoisPrivacyResponse, error) {
@@ -67,3 +85,19 @@ func (s *RegistrarService) DisableWhoisPrivacy(accountID string, domainName stri
privacyResponse.HttpResponse = resp
return privacyResponse, nil
}
+
+// RenewWhoisPrivacy renews the whois privacy for the domain.
+//
+// See https://developer.dnsimple.com/v2/registrar/whois-privacy/#renew
+func (s *RegistrarService) RenewWhoisPrivacy(accountID string, domainName string) (*whoisPrivacyRenewalResponse, error) {
+ path := versioned(fmt.Sprintf("/%v/registrar/domains/%v/whois_privacy/renewals", accountID, domainName))
+ privacyRenewalResponse := &whoisPrivacyRenewalResponse{}
+
+ resp, err := s.client.post(path, nil, privacyRenewalResponse)
+ if err != nil {
+ return nil, err
+ }
+
+ privacyRenewalResponse.HttpResponse = resp
+ return privacyRenewalResponse, nil
+}
diff --git a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/tlds.go b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/tlds.go
index ee0da04fe..9c5c250dd 100644
--- a/vendor/github.com/dnsimple/dnsimple-go/dnsimple/tlds.go
+++ b/vendor/github.com/dnsimple/dnsimple-go/dnsimple/tlds.go
@@ -100,7 +100,7 @@ func (s *TldsService) GetTld(tld string) (*tldResponse, error) {
return tldResponse, nil
}
-// GetTld fetches the extended attributes of a TLD.
+// GetTldExtendedAttributes fetches the extended attributes of a TLD.
//
// See https://developer.dnsimple.com/v2/tlds/#get
func (s *TldsService) GetTldExtendedAttributes(tld string) (*tldExtendedAttributesResponse, error) {
diff --git a/vendor/github.com/exoscale/egoscale/addresses.go b/vendor/github.com/exoscale/egoscale/addresses.go
index 602915f7d..d828f52e0 100644
--- a/vendor/github.com/exoscale/egoscale/addresses.go
+++ b/vendor/github.com/exoscale/egoscale/addresses.go
@@ -6,6 +6,17 @@ import (
"net"
)
+// Healthcheck represents an Healthcheck attached to an IP
+type Healthcheck struct {
+ Interval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"`
+ Mode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"`
+ Path string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."`
+ Port int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."`
+ StrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"`
+ StrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"`
+ Timeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."`
+}
+
// IPAddress represents an IP Address
type IPAddress struct {
Allocated string `json:"allocated,omitempty" doc:"date the public IP address was acquired"`
@@ -13,6 +24,7 @@ type IPAddress struct {
AssociatedNetworkID *UUID `json:"associatednetworkid,omitempty" doc:"the ID of the Network associated with the IP address"`
AssociatedNetworkName string `json:"associatednetworkname,omitempty" doc:"the name of the Network associated with the IP address"`
ForVirtualNetwork bool `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the IP address"`
+ Healthcheck *Healthcheck `json:"healthcheck,omitempty" doc:"The IP healthcheck configuration"`
ID *UUID `json:"id,omitempty" doc:"public IP address id"`
IPAddress net.IP `json:"ipaddress,omitempty" doc:"public IP address"`
IsElastic bool `json:"iselastic,omitempty" doc:"is an elastic ip"`
@@ -77,10 +89,15 @@ func (ipaddress IPAddress) Delete(ctx context.Context, client *Client) error {
// AssociateIPAddress (Async) represents the IP creation
type AssociateIPAddress struct {
- IsPortable *bool `json:"isportable,omitempty" doc:"should be set to true if public IP is required to be transferable across zones, if not specified defaults to false"`
- NetworkdID *UUID `json:"networkid,omitempty" doc:"The network this ip address should be associated to."`
- ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the availability zone you want to acquire an public IP address from"`
- _ bool `name:"associateIpAddress" description:"Acquires and associates a public IP to an account."`
+ HealthcheckInterval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"`
+ HealthcheckMode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"`
+ HealthcheckPath string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."`
+ HealthcheckPort int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."`
+ HealthcheckStrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"`
+ HealthcheckStrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"`
+ HealthcheckTimeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."`
+ ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the availability zone you want to acquire a public IP address from"`
+ _ bool `name:"associateIpAddress" description:"Acquires and associates a public IP to an account."`
}
// Response returns the struct to unmarshal
@@ -111,9 +128,15 @@ func (DisassociateIPAddress) AsyncResponse() interface{} {
// UpdateIPAddress (Async) represents the IP modification
type UpdateIPAddress struct {
- ID *UUID `json:"id" doc:"the id of the public ip address to update"`
- CustomID *UUID `json:"customid,omitempty" doc:"an optional field, in case you want to set a custom id to the resource. Allowed to Root Admins only"`
- _ bool `name:"updateIpAddress" description:"Updates an ip address"`
+ HealthcheckInterval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"`
+ HealthcheckMode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"`
+ HealthcheckPath string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."`
+ HealthcheckPort int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."`
+ HealthcheckStrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"`
+ HealthcheckStrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"`
+ HealthcheckTimeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."`
+ ID *UUID `json:"id" doc:"the id of the public IP address to update"`
+ _ bool `name:"updateIpAddress" description:"Updates an IP address"`
}
// Response returns the struct to unmarshal
diff --git a/vendor/github.com/exoscale/egoscale/async_jobs.go b/vendor/github.com/exoscale/egoscale/async_jobs.go
index d815aabda..ab4b52cff 100644
--- a/vendor/github.com/exoscale/egoscale/async_jobs.go
+++ b/vendor/github.com/exoscale/egoscale/async_jobs.go
@@ -21,6 +21,48 @@ type AsyncJobResult struct {
UserID *UUID `json:"userid,omitempty" doc:"the user that executed the async command"`
}
+// DeepCopy create a true copy of the receiver.
+func (a *AsyncJobResult) DeepCopy() *AsyncJobResult {
+ if a == nil {
+ return nil
+ }
+
+ return &AsyncJobResult{
+ AccountID: a.AccountID.DeepCopy(),
+ Cmd: a.Cmd,
+ Created: a.Created,
+ JobID: a.JobID.DeepCopy(),
+ JobInstanceID: a.JobInstanceID.DeepCopy(),
+ JobInstanceType: a.JobInstanceType,
+ JobProcStatus: a.JobProcStatus,
+ JobResult: a.JobResult,
+ JobResultCode: a.JobResultCode,
+ JobResultType: a.JobResultType,
+ JobStatus: a.JobStatus,
+ UserID: a.UserID.DeepCopy(),
+ }
+}
+
+// DeepCopyInto copies the receiver into out.
+//
+// In (a) must be non nil. out must be non nil
+func (a *AsyncJobResult) DeepCopyInto(out *AsyncJobResult) {
+ *out = AsyncJobResult{
+ AccountID: a.AccountID.DeepCopy(),
+ Cmd: a.Cmd,
+ Created: a.Created,
+ JobID: a.JobID.DeepCopy(),
+ JobInstanceID: a.JobInstanceID.DeepCopy(),
+ JobInstanceType: a.JobInstanceType,
+ JobProcStatus: a.JobProcStatus,
+ JobResult: a.JobResult,
+ JobResultCode: a.JobResultCode,
+ JobResultType: a.JobResultType,
+ JobStatus: a.JobStatus,
+ UserID: a.UserID.DeepCopy(),
+ }
+}
+
// ListRequest buils the (empty) ListAsyncJobs request
func (a AsyncJobResult) ListRequest() (ListCommand, error) {
req := &ListAsyncJobs{
diff --git a/vendor/github.com/exoscale/egoscale/client.go b/vendor/github.com/exoscale/egoscale/client.go
index 083deddc5..81c5f07b6 100644
--- a/vendor/github.com/exoscale/egoscale/client.go
+++ b/vendor/github.com/exoscale/egoscale/client.go
@@ -9,10 +9,18 @@ import (
"net/http/httputil"
"os"
"reflect"
+ "runtime"
"strings"
"time"
)
+// UserAgent is the "User-Agent" HTTP request header added to outgoing HTTP requests.
+var UserAgent = fmt.Sprintf("egoscale/%s (%s; %s/%s)",
+ Version,
+ runtime.Version(),
+ runtime.GOOS,
+ runtime.GOARCH)
+
// Taggable represents a resource to which tags can be attached
//
// This is a helper to fill the resourcetype of a CreateTags call
diff --git a/vendor/github.com/exoscale/egoscale/dns.go b/vendor/github.com/exoscale/egoscale/dns.go
index 4b6535c14..3d3af4078 100644
--- a/vendor/github.com/exoscale/egoscale/dns.go
+++ b/vendor/github.com/exoscale/egoscale/dns.go
@@ -14,9 +14,6 @@ import (
// DNSDomain represents a domain
type DNSDomain struct {
ID int64 `json:"id"`
- AccountID int64 `json:"account_id,omitempty"`
- UserID int64 `json:"user_id,omitempty"`
- RegistrantID int64 `json:"registrant_id,omitempty"`
Name string `json:"name"`
UnicodeName string `json:"unicode_name"`
Token string `json:"token"`
@@ -332,7 +329,7 @@ func (client *Client) dnsRequest(ctx context.Context, uri string, urlValues url.
var hdr = make(http.Header)
hdr.Add("X-DNS-TOKEN", client.APIKey+":"+client.apiSecret)
- hdr.Add("User-Agent", fmt.Sprintf("exoscale/egoscale (%v)", Version))
+ hdr.Add("User-Agent", UserAgent)
hdr.Add("Accept", "application/json")
if params != "" {
hdr.Add("Content-Type", "application/json")
diff --git a/vendor/github.com/exoscale/egoscale/request.go b/vendor/github.com/exoscale/egoscale/request.go
index f02971477..079c626c0 100644
--- a/vendor/github.com/exoscale/egoscale/request.go
+++ b/vendor/github.com/exoscale/egoscale/request.go
@@ -345,7 +345,7 @@ func (client *Client) request(ctx context.Context, command Command) (json.RawMes
return nil, err
}
request = request.WithContext(ctx)
- request.Header.Add("User-Agent", fmt.Sprintf("exoscale/egoscale (%v)", Version))
+ request.Header.Add("User-Agent", UserAgent)
if method == "POST" {
request.Header.Add("Content-Type", "application/x-www-form-urlencoded")
diff --git a/vendor/github.com/exoscale/egoscale/runstatus.go b/vendor/github.com/exoscale/egoscale/runstatus.go
index 268e36eaa..48905962e 100644
--- a/vendor/github.com/exoscale/egoscale/runstatus.go
+++ b/vendor/github.com/exoscale/egoscale/runstatus.go
@@ -82,7 +82,7 @@ func (client *Client) runstatusRequest(ctx context.Context, uri string, structPa
hdr.Add("Authorization", fmt.Sprintf("Exoscale-HMAC-SHA256 %s:%s", client.APIKey, signature))
hdr.Add("Exoscale-Date", time)
- hdr.Add("User-Agent", fmt.Sprintf("exoscale/egoscale (%v)", Version))
+ hdr.Add("User-Agent", UserAgent)
hdr.Add("Accept", "application/json")
if params != "" {
hdr.Add("Content-Type", "application/json")
diff --git a/vendor/github.com/exoscale/egoscale/templates.go b/vendor/github.com/exoscale/egoscale/templates.go
index 51c077a7d..9f49369d2 100644
--- a/vendor/github.com/exoscale/egoscale/templates.go
+++ b/vendor/github.com/exoscale/egoscale/templates.go
@@ -13,6 +13,7 @@ type Template struct {
Format string `json:"format,omitempty" doc:"the format of the template."`
HostID *UUID `json:"hostid,omitempty" doc:"the ID of the secondary storage host for the template"`
HostName string `json:"hostname,omitempty" doc:"the name of the secondary storage host for the template"`
+ Hypervisor string `json:"hypervisor,omitempty" doc:"the target hypervisor for the template"`
ID *UUID `json:"id,omitempty" doc:"the template ID"`
IsDynamicallyScalable bool `json:"isdynamicallyscalable,omitempty" doc:"true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory"`
IsExtractable bool `json:"isextractable,omitempty" doc:"true if the template is extractable, false otherwise"`
@@ -20,8 +21,10 @@ type Template struct {
IsPublic bool `json:"ispublic,omitempty" doc:"true if this template is a public template, false otherwise"`
IsReady bool `json:"isready,omitempty" doc:"true if the template is ready to be deployed from, false otherwise."`
Name string `json:"name,omitempty" doc:"the template name"`
- OsTypeID *UUID `json:"ostypeid,omitempty" doc:"the ID of the OS type for this template."`
- OsTypeName string `json:"ostypename,omitempty" doc:"the name of the OS type for this template."`
+ OsCategoryID *UUID `json:"oscategoryid,omitempty" doc:"the ID of the OS category for this template"`
+ OsCategoryName string `json:"oscategoryname,omitempty" doc:"the name of the OS category for this template"`
+ OsTypeID *UUID `json:"ostypeid,omitempty" doc:"the ID of the OS type for this template"`
+ OsTypeName string `json:"ostypename,omitempty" doc:"the name of the OS type for this template"`
PasswordEnabled bool `json:"passwordenabled,omitempty" doc:"true if the reset password feature is enabled, false otherwise"`
Removed string `json:"removed,omitempty" doc:"the date this template was removed"`
Size int64 `json:"size,omitempty" doc:"the size of the template"`
@@ -118,3 +121,43 @@ type ListOSCategoriesResponse struct {
Count int `json:"count"`
OSCategory []OSCategory `json:"oscategory"`
}
+
+// DeleteTemplate deletes a template by ID
+type DeleteTemplate struct {
+ _ bool `name:"deleteTemplate" description:"Deletes a template"`
+ ID *UUID `json:"id" doc:"the ID of the template"`
+}
+
+// Response returns the struct to unmarshal
+func (DeleteTemplate) Response() interface{} {
+ return new(AsyncJobResult)
+}
+
+// AsyncResponse returns the struct to unmarshal the async job
+func (DeleteTemplate) AsyncResponse() interface{} {
+ return new(BooleanResponse)
+}
+
+// RegisterCustomTemplate registers a new template
+type RegisterCustomTemplate struct {
+ _ bool `name:"registerCustomTemplate" description:"Register a new template."`
+ Checksum string `json:"checksum" doc:"the MD5 checksum value of this template"`
+ Details map[string]string `json:"details,omitempty" doc:"Template details in key/value pairs"`
+ Displaytext string `json:"displaytext" doc:"the display text of the template"`
+ Name string `json:"name" doc:"the name of the template"`
+ PasswordEnabled *bool `json:"passwordenabled,omitempty" doc:"true if the template supports the password reset feature; default is false"`
+ SSHKeyEnabled *bool `json:"sshkeyenabled,omitempty" doc:"true if the template supports the sshkey upload feature; default is false"`
+ TemplateTag string `json:"templatetag,omitempty" doc:"the tag for this template"`
+ URL string `json:"url" doc:"the URL of where the template is hosted"`
+ ZoneID *UUID `json:"zoneid" doc:"the ID of the zone the template is to be hosted on"`
+}
+
+// Response returns the struct to unmarshal
+func (RegisterCustomTemplate) Response() interface{} {
+ return new(AsyncJobResult)
+}
+
+// AsyncResponse returns the struct to unmarshal the async job
+func (RegisterCustomTemplate) AsyncResponse() interface{} {
+ return new([]Template)
+}
diff --git a/vendor/github.com/exoscale/egoscale/uuid.go b/vendor/github.com/exoscale/egoscale/uuid.go
index 839f4d2fe..dd8be1557 100644
--- a/vendor/github.com/exoscale/egoscale/uuid.go
+++ b/vendor/github.com/exoscale/egoscale/uuid.go
@@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
- uuid "github.com/satori/go.uuid"
+ uuid "github.com/gofrs/uuid"
)
// UUID holds a UUID v4
@@ -38,7 +38,7 @@ func (u *UUID) DeepCopyInto(out *UUID) {
// Equal returns true if itself is equal to other.
func (u UUID) Equal(other UUID) bool {
- return uuid.Equal(u.UUID, other.UUID)
+ return u == other
}
// UnmarshalJSON unmarshals the raw JSON into the UUID.
diff --git a/vendor/github.com/exoscale/egoscale/version.go b/vendor/github.com/exoscale/egoscale/version.go
index f8164f086..d96946140 100644
--- a/vendor/github.com/exoscale/egoscale/version.go
+++ b/vendor/github.com/exoscale/egoscale/version.go
@@ -1,4 +1,4 @@
package egoscale
// Version of the library
-const Version = "0.14.3"
+const Version = "0.18.1"
diff --git a/vendor/github.com/exoscale/egoscale/virtual_machines.go b/vendor/github.com/exoscale/egoscale/virtual_machines.go
index f48ef58fe..da6ce65c5 100644
--- a/vendor/github.com/exoscale/egoscale/virtual_machines.go
+++ b/vendor/github.com/exoscale/egoscale/virtual_machines.go
@@ -314,8 +314,9 @@ func (DeployVirtualMachine) AsyncResponse() interface{} {
// StartVirtualMachine (Async) represents the creation of the virtual machine
type StartVirtualMachine struct {
- ID *UUID `json:"id" doc:"The ID of the virtual machine"`
- _ bool `name:"startVirtualMachine" description:"Starts a virtual machine."`
+ ID *UUID `json:"id" doc:"The ID of the virtual machine"`
+ RescueProfile string `json:"rescueprofile,omitempty" doc:"An optional rescue profile to use when booting"`
+ _ bool `name:"startVirtualMachine" description:"Starts a virtual machine."`
}
// Response returns the struct to unmarshal
diff --git a/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go b/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go
index 9671434cf..9b3452f1b 100644
--- a/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go
+++ b/vendor/github.com/go-acme/lego/acme/api/internal/sender/useragent.go
@@ -5,7 +5,7 @@ package sender
const (
// ourUserAgent is the User-Agent of this underlying library package.
- ourUserAgent = "xenolf-acme/2.6.0"
+ ourUserAgent = "xenolf-acme/2.7.2"
// ourUserAgentComment is part of the UA comment linked to the version status of this underlying library package.
// values: detach|release
diff --git a/vendor/github.com/go-acme/lego/certificate/authorization.go b/vendor/github.com/go-acme/lego/certificate/authorization.go
index 00062504b..e8d41d1dd 100644
--- a/vendor/github.com/go-acme/lego/certificate/authorization.go
+++ b/vendor/github.com/go-acme/lego/certificate/authorization.go
@@ -62,8 +62,8 @@ func (c *Certifier) getAuthorizations(order acme.ExtendedOrder) ([]acme.Authoriz
func (c *Certifier) deactivateAuthorizations(order acme.ExtendedOrder) {
for _, auth := range order.Authorizations {
- if err := c.core.Authorizations.Deactivate(auth); err != nil {
- log.Infof("Unable to deactivated authorizations: %s", auth)
+ if c.core.Authorizations.Deactivate(auth) != nil {
+ log.Infof("Unable to deactivate the authorization: %s", auth)
}
}
}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go b/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go
index 194db1d30..0743f097d 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/dns_providers.go
@@ -44,6 +44,7 @@ import (
"github.com/go-acme/lego/providers/dns/mydnsjp"
"github.com/go-acme/lego/providers/dns/namecheap"
"github.com/go-acme/lego/providers/dns/namedotcom"
+ "github.com/go-acme/lego/providers/dns/namesilo"
"github.com/go-acme/lego/providers/dns/netcup"
"github.com/go-acme/lego/providers/dns/nifcloud"
"github.com/go-acme/lego/providers/dns/ns1"
@@ -59,6 +60,7 @@ import (
"github.com/go-acme/lego/providers/dns/stackpath"
"github.com/go-acme/lego/providers/dns/transip"
"github.com/go-acme/lego/providers/dns/vegadns"
+ "github.com/go-acme/lego/providers/dns/versio"
"github.com/go-acme/lego/providers/dns/vscale"
"github.com/go-acme/lego/providers/dns/vultr"
"github.com/go-acme/lego/providers/dns/zoneee"
@@ -147,6 +149,8 @@ func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
return namecheap.NewDNSProvider()
case "namedotcom":
return namedotcom.NewDNSProvider()
+ case "namesilo":
+ return namesilo.NewDNSProvider()
case "netcup":
return netcup.NewDNSProvider()
case "nifcloud":
@@ -177,6 +181,8 @@ func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
return transip.NewDNSProvider()
case "vegadns":
return vegadns.NewDNSProvider()
+ case "versio":
+ return versio.NewDNSProvider()
case "vultr":
return vultr.NewDNSProvider()
case "vscale":
@@ -184,6 +190,6 @@ func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
case "zoneee":
return zoneee.NewDNSProvider()
default:
- return nil, fmt.Errorf("unrecognised DNS provider: %s", name)
+ return nil, fmt.Errorf("unrecognized DNS provider: %s", name)
}
}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/dnspod/dnspod.go b/vendor/github.com/go-acme/lego/providers/dns/dnspod/dnspod.go
index 506836dc7..8d381dc48 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/dnspod/dnspod.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/dnspod/dnspod.go
@@ -137,9 +137,8 @@ func (d *DNSProvider) getHostedZone(domain string) (string, string, error) {
}
}
- if hostedZone.ID == 0 {
+ if hostedZone.ID == "" || hostedZone.ID == "0" {
return "", "", fmt.Errorf("zone %s not found in dnspod for domain %s", authZone, domain)
-
}
return fmt.Sprintf("%v", hostedZone.ID), hostedZone.Name, nil
diff --git a/vendor/github.com/go-acme/lego/providers/dns/joker/client.go b/vendor/github.com/go-acme/lego/providers/dns/joker/client.go
index 18265a85e..8e8fabda0 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/joker/client.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/joker/client.go
@@ -70,7 +70,20 @@ func (d *DNSProvider) login() (*response, error) {
return nil, nil
}
- response, err := d.postRequest("login", url.Values{"api-key": {d.config.APIKey}})
+ var values url.Values
+ switch {
+ case d.config.Username != "" && d.config.Password != "":
+ values = url.Values{
+ "username": {d.config.Username},
+ "password": {d.config.Password},
+ }
+ case d.config.APIKey != "":
+ values = url.Values{"api-key": {d.config.APIKey}}
+ default:
+ return nil, fmt.Errorf("no username and password or api-key")
+ }
+
+ response, err := d.postRequest("login", values)
if err != nil {
return response, err
}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/joker/joker.go b/vendor/github.com/go-acme/lego/providers/dns/joker/joker.go
index d2dc1cac2..c39fb9ed8 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/joker/joker.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/joker/joker.go
@@ -18,6 +18,8 @@ type Config struct {
Debug bool
BaseURL string
APIKey string
+ Username string
+ Password string
PropagationTimeout time.Duration
PollingInterval time.Duration
TTL int
@@ -50,11 +52,17 @@ type DNSProvider struct {
func NewDNSProvider() (*DNSProvider, error) {
values, err := env.Get("JOKER_API_KEY")
if err != nil {
- return nil, fmt.Errorf("joker: %v", err)
+ var errU error
+ values, errU = env.Get("JOKER_USERNAME", "JOKER_PASSWORD")
+ if errU != nil {
+ return nil, fmt.Errorf("joker: %v or %v", errU, err)
+ }
}
config := NewDefaultConfig()
config.APIKey = values["JOKER_API_KEY"]
+ config.Username = values["JOKER_USERNAME"]
+ config.Password = values["JOKER_PASSWORD"]
return NewDNSProviderConfig(config)
}
@@ -66,7 +74,9 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
}
if config.APIKey == "" {
- return nil, fmt.Errorf("joker: credentials missing")
+ if config.Username == "" || config.Password == "" {
+ return nil, fmt.Errorf("joker: credentials missing")
+ }
}
if !strings.HasSuffix(config.BaseURL, "/") {
diff --git a/vendor/github.com/go-acme/lego/providers/dns/namesilo/namesilo.go b/vendor/github.com/go-acme/lego/providers/dns/namesilo/namesilo.go
new file mode 100644
index 000000000..b308eabf7
--- /dev/null
+++ b/vendor/github.com/go-acme/lego/providers/dns/namesilo/namesilo.go
@@ -0,0 +1,142 @@
+// Package namesilo implements a DNS provider for solving the DNS-01 challenge using namesilo DNS.
+package namesilo
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+ "time"
+
+ "github.com/go-acme/lego/challenge/dns01"
+ "github.com/go-acme/lego/platform/config/env"
+ "github.com/nrdcg/namesilo"
+)
+
+const (
+ defaultTTL = 3600
+ maxTTL = 2592000
+)
+
+// Config is used to configure the creation of the DNSProvider
+type Config struct {
+ APIKey string
+ PropagationTimeout time.Duration
+ PollingInterval time.Duration
+ TTL int
+}
+
+// NewDefaultConfig returns a default configuration for the DNSProvider
+func NewDefaultConfig() *Config {
+ return &Config{
+ PropagationTimeout: env.GetOrDefaultSecond("NAMESILO_PROPAGATION_TIMEOUT", dns01.DefaultPropagationTimeout),
+ PollingInterval: env.GetOrDefaultSecond("NAMESILO_POLLING_INTERVAL", dns01.DefaultPollingInterval),
+ TTL: env.GetOrDefaultInt("NAMESILO_TTL", defaultTTL),
+ }
+}
+
+// DNSProvider is an implementation of the acme.ChallengeProvider interface.
+type DNSProvider struct {
+ client *namesilo.Client
+ config *Config
+}
+
+// NewDNSProvider returns a DNSProvider instance configured for namesilo.
+// API_KEY must be passed in the environment variables: NAMESILO_API_KEY.
+//
+// See: https://www.namesilo.com/api_reference.php
+func NewDNSProvider() (*DNSProvider, error) {
+ values, err := env.Get("NAMESILO_API_KEY")
+ if err != nil {
+ return nil, fmt.Errorf("namesilo: %v", err)
+ }
+
+ config := NewDefaultConfig()
+ config.APIKey = values["NAMESILO_API_KEY"]
+
+ return NewDNSProviderConfig(config)
+}
+
+// NewDNSProviderConfig return a DNSProvider instance configured for DNSimple.
+func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
+ if config == nil {
+ return nil, errors.New("namesilo: the configuration of the DNS provider is nil")
+ }
+
+ if config.TTL < defaultTTL || config.TTL > maxTTL {
+ return nil, fmt.Errorf("namesilo: TTL should be in [%d, %d]", defaultTTL, maxTTL)
+ }
+
+ transport, err := namesilo.NewTokenTransport(config.APIKey)
+ if err != nil {
+ return nil, fmt.Errorf("namesilo: %v", err)
+ }
+
+ return &DNSProvider{client: namesilo.NewClient(transport.Client()), config: config}, nil
+}
+
+// Present creates a TXT record to fulfill the dns-01 challenge.
+func (d *DNSProvider) Present(domain, token, keyAuth string) error {
+ fqdn, value := dns01.GetRecord(domain, keyAuth)
+
+ zoneName, err := getZoneNameByDomain(domain)
+ if err != nil {
+ return fmt.Errorf("namesilo: %v", err)
+ }
+
+ _, err = d.client.DnsAddRecord(&namesilo.DnsAddRecordParams{
+ Domain: zoneName,
+ Type: "TXT",
+ Host: getRecordName(fqdn, zoneName),
+ Value: value,
+ TTL: d.config.TTL,
+ })
+ if err != nil {
+ return fmt.Errorf("namesilo: failed to add record %v", err)
+ }
+ return nil
+}
+
+// CleanUp removes the TXT record matching the specified parameters.
+func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
+ fqdn, _ := dns01.GetRecord(domain, keyAuth)
+
+ zoneName, err := getZoneNameByDomain(domain)
+ if err != nil {
+ return fmt.Errorf("namesilo: %v", err)
+ }
+
+ resp, err := d.client.DnsListRecords(&namesilo.DnsListRecordsParams{Domain: zoneName})
+ if err != nil {
+ return fmt.Errorf("namesilo: %v", err)
+ }
+
+ var lastErr error
+ name := getRecordName(fqdn, zoneName)
+ for _, r := range resp.Reply.ResourceRecord {
+ if r.Type == "TXT" && r.Host == name {
+ _, err := d.client.DnsDeleteRecord(&namesilo.DnsDeleteRecordParams{Domain: zoneName, ID: r.RecordID})
+ if err != nil {
+ lastErr = fmt.Errorf("namesilo: %v", err)
+ }
+ }
+ }
+ return lastErr
+}
+
+// Timeout returns the timeout and interval to use when checking for DNS propagation.
+// Adjusting here to cope with spikes in propagation times.
+func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
+ return d.config.PropagationTimeout, d.config.PollingInterval
+}
+
+func getZoneNameByDomain(domain string) (string, error) {
+ zone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(domain))
+ if err != nil {
+ return "", fmt.Errorf("failed to find zone for domain: %s, %v", domain, err)
+ }
+ return dns01.UnFqdn(zone), nil
+}
+
+func getRecordName(domain, zone string) string {
+ return strings.TrimSuffix(dns01.ToFqdn(domain), "."+dns01.ToFqdn(zone))
+}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/otc/client.go b/vendor/github.com/go-acme/lego/providers/dns/otc/client.go
index 1cd71f551..fa4c5edc5 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/otc/client.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/otc/client.go
@@ -230,12 +230,16 @@ func (d *DNSProvider) deleteRecordSet(zoneID, recordID string) error {
func (d *DNSProvider) sendRequest(method, resource string, payload interface{}) (io.Reader, error) {
url := fmt.Sprintf("%s/%s", d.baseURL, resource)
- body, err := json.Marshal(payload)
- if err != nil {
- return nil, err
+ var body io.Reader
+ if payload != nil {
+ content, err := json.Marshal(payload)
+ if err != nil {
+ return nil, err
+ }
+ body = bytes.NewReader(content)
}
- req, err := http.NewRequest(method, url, bytes.NewReader(body))
+ req, err := http.NewRequest(method, url, body)
if err != nil {
return nil, err
}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/versio/client.go b/vendor/github.com/go-acme/lego/providers/dns/versio/client.go
new file mode 100644
index 000000000..a0f483784
--- /dev/null
+++ b/vendor/github.com/go-acme/lego/providers/dns/versio/client.go
@@ -0,0 +1,127 @@
+package versio
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "path"
+)
+
+const defaultBaseURL = "https://www.versio.nl/api/v1/"
+
+type dnsRecordsResponse struct {
+ Record dnsRecord `json:"domainInfo"`
+}
+
+type dnsRecord struct {
+ DNSRecords []record `json:"dns_records"`
+}
+
+type record struct {
+ Type string `json:"type,omitempty"`
+ Name string `json:"name,omitempty"`
+ Value string `json:"value,omitempty"`
+ Priority int `json:"prio,omitempty"`
+ TTL int `json:"ttl,omitempty"`
+}
+
+type dnsErrorResponse struct {
+ Error errorMessage `json:"error"`
+}
+
+type errorMessage struct {
+ Code int `json:"code,omitempty"`
+ Message string `json:"message,omitempty"`
+}
+
+func (d *DNSProvider) postDNSRecords(domain string, msg interface{}) error {
+ reqBody := &bytes.Buffer{}
+ err := json.NewEncoder(reqBody).Encode(msg)
+ if err != nil {
+ return err
+ }
+
+ req, err := d.makeRequest(http.MethodPost, "domains/"+domain+"/update", reqBody)
+ if err != nil {
+ return err
+ }
+
+ return d.do(req, nil)
+}
+
+func (d *DNSProvider) getDNSRecords(domain string) (*dnsRecordsResponse, error) {
+ req, err := d.makeRequest(http.MethodGet, "domains/"+domain+"?show_dns_records=true", nil)
+ if err != nil {
+ return nil, err
+ }
+
+ // we'll need all the dns_records to add the new TXT record
+ respData := &dnsRecordsResponse{}
+ err = d.do(req, respData)
+ if err != nil {
+ return nil, err
+ }
+
+ return respData, nil
+}
+
+func (d *DNSProvider) makeRequest(method string, uri string, body io.Reader) (*http.Request, error) {
+ endpoint, err := d.config.BaseURL.Parse(path.Join(d.config.BaseURL.EscapedPath(), uri))
+ if err != nil {
+ return nil, err
+ }
+
+ req, err := http.NewRequest(method, endpoint.String(), body)
+ if err != nil {
+ return nil, err
+ }
+
+ req.Header.Set("Content-Type", "application/json")
+
+ if len(d.config.Username) > 0 && len(d.config.Password) > 0 {
+ req.SetBasicAuth(d.config.Username, d.config.Password)
+ }
+
+ return req, nil
+}
+
+func (d *DNSProvider) do(req *http.Request, result interface{}) error {
+ resp, err := d.config.HTTPClient.Do(req)
+ if resp != nil {
+ defer resp.Body.Close()
+ }
+ if err != nil {
+ return err
+ }
+
+ if resp.StatusCode >= http.StatusBadRequest {
+ var body []byte
+ body, err = ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return fmt.Errorf("%d: failed to read response body: %v", resp.StatusCode, err)
+ }
+
+ respError := &dnsErrorResponse{}
+ err = json.Unmarshal(body, respError)
+ if err != nil {
+ return fmt.Errorf("%d: request failed: %s", resp.StatusCode, string(body))
+ }
+ return fmt.Errorf("%d: request failed: %s", resp.StatusCode, respError.Error.Message)
+ }
+
+ if result != nil {
+ content, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return fmt.Errorf("request failed: %v", err)
+ }
+
+ if err = json.Unmarshal(content, result); err != nil {
+ return fmt.Errorf("%v: %s", err, content)
+ }
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/versio/versio.go b/vendor/github.com/go-acme/lego/providers/dns/versio/versio.go
new file mode 100644
index 000000000..66644db17
--- /dev/null
+++ b/vendor/github.com/go-acme/lego/providers/dns/versio/versio.go
@@ -0,0 +1,155 @@
+// Package versio implements a DNS provider for solving the DNS-01 challenge using versio DNS.
+package versio
+
+import (
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "sync"
+ "time"
+
+ "github.com/go-acme/lego/challenge/dns01"
+ "github.com/go-acme/lego/platform/config/env"
+)
+
+// Config is used to configure the creation of the DNSProvider
+type Config struct {
+ BaseURL *url.URL
+ TTL int
+ Username string
+ Password string
+ PropagationTimeout time.Duration
+ PollingInterval time.Duration
+ SequenceInterval time.Duration
+ HTTPClient *http.Client
+}
+
+// NewDefaultConfig returns a default configuration for the DNSProvider
+func NewDefaultConfig() *Config {
+ baseURL, err := url.Parse(env.GetOrDefaultString("VERSIO_ENDPOINT", defaultBaseURL))
+ if err != nil {
+ baseURL, _ = url.Parse(defaultBaseURL)
+ }
+
+ return &Config{
+ BaseURL: baseURL,
+ TTL: env.GetOrDefaultInt("VERSIO_TTL", 300),
+ PropagationTimeout: env.GetOrDefaultSecond("VERSIO_PROPAGATION_TIMEOUT", 60*time.Second),
+ PollingInterval: env.GetOrDefaultSecond("VERSIO_POLLING_INTERVAL", 5*time.Second),
+ SequenceInterval: env.GetOrDefaultSecond("VERSIO_SEQUENCE_INTERVAL", dns01.DefaultPropagationTimeout),
+ HTTPClient: &http.Client{
+ Timeout: env.GetOrDefaultSecond("VERSIO_HTTP_TIMEOUT", 30*time.Second),
+ },
+ }
+}
+
+// DNSProvider describes a provider for acme-proxy
+type DNSProvider struct {
+ config *Config
+ dnsEntriesMu sync.Mutex
+}
+
+// NewDNSProvider returns a DNSProvider instance.
+func NewDNSProvider() (*DNSProvider, error) {
+ values, err := env.Get("VERSIO_USERNAME", "VERSIO_PASSWORD")
+ if err != nil {
+ return nil, fmt.Errorf("versio: %v", err)
+ }
+
+ config := NewDefaultConfig()
+ config.Username = values["VERSIO_USERNAME"]
+ config.Password = values["VERSIO_PASSWORD"]
+
+ return NewDNSProviderConfig(config)
+}
+
+// NewDNSProviderConfig return a DNSProvider .
+func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
+ if config == nil {
+ return nil, errors.New("versio: the configuration of the DNS provider is nil")
+ }
+ if config.Username == "" {
+ return nil, errors.New("versio: the versio username is missing")
+ }
+ if config.Password == "" {
+ return nil, errors.New("versio: the versio password is missing")
+ }
+
+ return &DNSProvider{config: config}, nil
+}
+
+// Timeout returns the timeout and interval to use when checking for DNS propagation.
+// Adjusting here to cope with spikes in propagation times.
+func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
+ return d.config.PropagationTimeout, d.config.PollingInterval
+}
+
+// Present creates a TXT record to fulfill the dns-01 challenge
+func (d *DNSProvider) Present(domain, token, keyAuth string) error {
+ fqdn, value := dns01.GetRecord(domain, keyAuth)
+
+ authZone, err := dns01.FindZoneByFqdn(fqdn)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+
+ // use mutex to prevent race condition from getDNSRecords until postDNSRecords
+ d.dnsEntriesMu.Lock()
+ defer d.dnsEntriesMu.Unlock()
+
+ zoneName := dns01.UnFqdn(authZone)
+ domains, err := d.getDNSRecords(zoneName)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+
+ txtRecord := record{
+ Type: "TXT",
+ Name: fqdn,
+ Value: `"` + value + `"`,
+ TTL: d.config.TTL,
+ }
+ // Add new txtRercord to existing array of DNSRecords
+ msg := &domains.Record
+ msg.DNSRecords = append(msg.DNSRecords, txtRecord)
+
+ err = d.postDNSRecords(zoneName, msg)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+ return nil
+}
+
+// CleanUp removes the TXT record matching the specified parameters
+func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
+ fqdn, _ := dns01.GetRecord(domain, keyAuth)
+ authZone, err := dns01.FindZoneByFqdn(fqdn)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+
+ // use mutex to prevent race condition from getDNSRecords until postDNSRecords
+ d.dnsEntriesMu.Lock()
+ defer d.dnsEntriesMu.Unlock()
+
+ zoneName := dns01.UnFqdn(authZone)
+ domains, err := d.getDNSRecords(zoneName)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+
+ // loop through the existing entries and remove the specific record
+ msg := &dnsRecord{}
+ for _, e := range domains.Record.DNSRecords {
+ if e.Name != fqdn {
+ msg.DNSRecords = append(msg.DNSRecords, e)
+ }
+ }
+
+ err = d.postDNSRecords(zoneName, msg)
+ if err != nil {
+ return fmt.Errorf("versio: %v", err)
+ }
+ return nil
+}
diff --git a/vendor/github.com/go-acme/lego/providers/dns/vultr/vultr.go b/vendor/github.com/go-acme/lego/providers/dns/vultr/vultr.go
index 94e5d8639..988267c85 100644
--- a/vendor/github.com/go-acme/lego/providers/dns/vultr/vultr.go
+++ b/vendor/github.com/go-acme/lego/providers/dns/vultr/vultr.go
@@ -1,18 +1,20 @@
-// Package vultr implements a DNS provider for solving the DNS-01 challenge using the vultr DNS.
+// Package vultr implements a DNS provider for solving the DNS-01 challenge using the Vultr DNS.
// See https://www.vultr.com/api/#dns
package vultr
import (
+ "context"
"crypto/tls"
"errors"
"fmt"
"net/http"
+ "strconv"
"strings"
"time"
- vultr "github.com/JamesClonk/vultr/lib"
"github.com/go-acme/lego/challenge/dns01"
"github.com/go-acme/lego/platform/config/env"
+ "github.com/vultr/govultr"
)
// Config is used to configure the creation of the DNSProvider
@@ -43,7 +45,7 @@ func NewDefaultConfig() *Config {
// DNSProvider is an implementation of the acme.ChallengeProvider interface.
type DNSProvider struct {
config *Config
- client *vultr.Client
+ client *govultr.Client
}
// NewDNSProvider returns a DNSProvider instance with a configured Vultr client.
@@ -70,26 +72,25 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
return nil, fmt.Errorf("vultr: credentials missing")
}
- options := &vultr.Options{
- HTTPClient: config.HTTPClient,
- }
- client := vultr.NewClient(config.APIKey, options)
+ client := govultr.NewClient(config.HTTPClient, config.APIKey)
return &DNSProvider{client: client, config: config}, nil
}
// Present creates a TXT record to fulfill the DNS-01 challenge.
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
+ ctx := context.Background()
+
fqdn, value := dns01.GetRecord(domain, keyAuth)
- zoneDomain, err := d.getHostedZone(domain)
+ zoneDomain, err := d.getHostedZone(ctx, domain)
if err != nil {
return fmt.Errorf("vultr: %v", err)
}
name := d.extractRecordName(fqdn, zoneDomain)
- err = d.client.CreateDNSRecord(zoneDomain, name, "TXT", `"`+value+`"`, 0, d.config.TTL)
+ err = d.client.DNSRecord.Create(ctx, zoneDomain, "TXT", name, `"`+value+`"`, d.config.TTL, 0)
if err != nil {
return fmt.Errorf("vultr: API call failed: %v", err)
}
@@ -99,16 +100,18 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
// CleanUp removes the TXT record matching the specified parameters.
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
+ ctx := context.Background()
+
fqdn, _ := dns01.GetRecord(domain, keyAuth)
- zoneDomain, records, err := d.findTxtRecords(domain, fqdn)
+ zoneDomain, records, err := d.findTxtRecords(ctx, domain, fqdn)
if err != nil {
return fmt.Errorf("vultr: %v", err)
}
var allErr []string
for _, rec := range records {
- err := d.client.DeleteDNSRecord(zoneDomain, rec.RecordID)
+ err := d.client.DNSRecord.Delete(ctx, zoneDomain, strconv.Itoa(rec.RecordID))
if err != nil {
allErr = append(allErr, err.Error())
}
@@ -127,13 +130,13 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
return d.config.PropagationTimeout, d.config.PollingInterval
}
-func (d *DNSProvider) getHostedZone(domain string) (string, error) {
- domains, err := d.client.GetDNSDomains()
+func (d *DNSProvider) getHostedZone(ctx context.Context, domain string) (string, error) {
+ domains, err := d.client.DNSDomain.List(ctx)
if err != nil {
return "", fmt.Errorf("API call failed: %v", err)
}
- var hostedDomain vultr.DNSDomain
+ var hostedDomain govultr.DNSDomain
for _, dom := range domains {
if strings.HasSuffix(domain, dom.Domain) {
if len(dom.Domain) > len(hostedDomain.Domain) {
@@ -148,14 +151,14 @@ func (d *DNSProvider) getHostedZone(domain string) (string, error) {
return hostedDomain.Domain, nil
}
-func (d *DNSProvider) findTxtRecords(domain, fqdn string) (string, []vultr.DNSRecord, error) {
- zoneDomain, err := d.getHostedZone(domain)
+func (d *DNSProvider) findTxtRecords(ctx context.Context, domain, fqdn string) (string, []govultr.DNSRecord, error) {
+ zoneDomain, err := d.getHostedZone(ctx, domain)
if err != nil {
return "", nil, err
}
- var records []vultr.DNSRecord
- result, err := d.client.GetDNSRecords(zoneDomain)
+ var records []govultr.DNSRecord
+ result, err := d.client.DNSRecord.List(ctx, zoneDomain)
if err != nil {
return "", records, fmt.Errorf("API call has failed: %v", err)
}
diff --git a/vendor/github.com/go-acme/lego/registration/registar.go b/vendor/github.com/go-acme/lego/registration/registar.go
index 09e866574..2ec935c37 100644
--- a/vendor/github.com/go-acme/lego/registration/registar.go
+++ b/vendor/github.com/go-acme/lego/registration/registar.go
@@ -11,7 +11,7 @@ import (
// Resource represents all important information about a registration
// of which the client needs to keep track itself.
-// Deprecated: will be remove in the future (acme.ExtendedAccount).
+// WARNING: will be remove in the future (acme.ExtendedAccount), https://github.com/go-acme/lego/issues/855.
type Resource struct {
Body acme.Account `json:"body,omitempty"`
URI string `json:"uri,omitempty"`
diff --git a/vendor/github.com/go-resty/resty/resty.go b/vendor/github.com/go-resty/resty/resty.go
deleted file mode 100644
index 8cb6e3e80..000000000
--- a/vendor/github.com/go-resty/resty/resty.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2015-2018 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.
-
-// Package resty provides simple HTTP and REST client for Go inspired by Ruby rest-client.
-package resty
-
-// Version # of resty
-const Version = "1.9.1"
diff --git a/vendor/github.com/satori/go.uuid/LICENSE b/vendor/github.com/gofrs/uuid/LICENSE
similarity index 100%
rename from vendor/github.com/satori/go.uuid/LICENSE
rename to vendor/github.com/gofrs/uuid/LICENSE
diff --git a/vendor/github.com/satori/go.uuid/codec.go b/vendor/github.com/gofrs/uuid/codec.go
similarity index 58%
rename from vendor/github.com/satori/go.uuid/codec.go
rename to vendor/github.com/gofrs/uuid/codec.go
index 656892c53..e3d8cfb4d 100644
--- a/vendor/github.com/satori/go.uuid/codec.go
+++ b/vendor/github.com/gofrs/uuid/codec.go
@@ -27,15 +27,16 @@ import (
"fmt"
)
-// FromBytes returns UUID converted from raw byte slice input.
-// It will return error if the slice isn't 16 bytes long.
-func FromBytes(input []byte) (u UUID, err error) {
- err = u.UnmarshalBinary(input)
- return
+// FromBytes returns a UUID generated from the raw byte slice input.
+// It will return an error if the slice isn't 16 bytes long.
+func FromBytes(input []byte) (UUID, error) {
+ u := UUID{}
+ err := u.UnmarshalBinary(input)
+ return u, err
}
-// FromBytesOrNil returns UUID converted from raw byte slice input.
-// Same behavior as FromBytes, but returns a Nil UUID on error.
+// FromBytesOrNil returns a UUID generated from the raw byte slice input.
+// Same behavior as FromBytes(), but returns uuid.Nil instead of an error.
func FromBytesOrNil(input []byte) UUID {
uuid, err := FromBytes(input)
if err != nil {
@@ -44,15 +45,16 @@ func FromBytesOrNil(input []byte) UUID {
return uuid
}
-// FromString returns UUID parsed from string input.
+// FromString returns a UUID parsed from the input string.
// Input is expected in a form accepted by UnmarshalText.
-func FromString(input string) (u UUID, err error) {
- err = u.UnmarshalText([]byte(input))
- return
+func FromString(input string) (UUID, error) {
+ u := UUID{}
+ err := u.UnmarshalText([]byte(input))
+ return u, err
}
-// FromStringOrNil returns UUID parsed from string input.
-// Same behavior as FromString, but returns a Nil UUID on error.
+// FromStringOrNil returns a UUID parsed from the input string.
+// Same behavior as FromString(), but returns uuid.Nil instead of an error.
func FromStringOrNil(input string) UUID {
uuid, err := FromString(input)
if err != nil {
@@ -62,93 +64,99 @@ func FromStringOrNil(input string) UUID {
}
// MarshalText implements the encoding.TextMarshaler interface.
-// The encoding is the same as returned by String.
-func (u UUID) MarshalText() (text []byte, err error) {
- text = []byte(u.String())
- return
+// The encoding is the same as returned by the String() method.
+func (u UUID) MarshalText() ([]byte, error) {
+ return []byte(u.String()), nil
}
// UnmarshalText implements the encoding.TextUnmarshaler interface.
// Following formats are supported:
+//
// "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}",
// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8"
// "6ba7b8109dad11d180b400c04fd430c8"
+// "{6ba7b8109dad11d180b400c04fd430c8}",
+// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8"
+//
// ABNF for supported UUID text representation follows:
-// uuid := canonical | hashlike | braced | urn
-// plain := canonical | hashlike
-// canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct
-// hashlike := 12hexoct
-// braced := '{' plain '}'
-// urn := URN ':' UUID-NID ':' plain
+//
// URN := 'urn'
// UUID-NID := 'uuid'
-// 12hexoct := 6hexoct 6hexoct
-// 6hexoct := 4hexoct 2hexoct
-// 4hexoct := 2hexoct 2hexoct
-// 2hexoct := hexoct hexoct
-// hexoct := hexdig hexdig
+//
// hexdig := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' |
// 'a' | 'b' | 'c' | 'd' | 'e' | 'f' |
// 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
-func (u *UUID) UnmarshalText(text []byte) (err error) {
+//
+// hexoct := hexdig hexdig
+// 2hexoct := hexoct hexoct
+// 4hexoct := 2hexoct 2hexoct
+// 6hexoct := 4hexoct 2hexoct
+// 12hexoct := 6hexoct 6hexoct
+//
+// hashlike := 12hexoct
+// canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct
+//
+// plain := canonical | hashlike
+// uuid := canonical | hashlike | braced | urn
+//
+// braced := '{' plain '}' | '{' hashlike '}'
+// urn := URN ':' UUID-NID ':' plain
+//
+func (u *UUID) UnmarshalText(text []byte) error {
switch len(text) {
case 32:
return u.decodeHashLike(text)
+ case 34, 38:
+ return u.decodeBraced(text)
case 36:
return u.decodeCanonical(text)
- case 38:
- return u.decodeBraced(text)
- case 41:
- fallthrough
- case 45:
+ case 41, 45:
return u.decodeURN(text)
default:
return fmt.Errorf("uuid: incorrect UUID length: %s", text)
}
}
-// decodeCanonical decodes UUID string in format
+// decodeCanonical decodes UUID strings that are formatted as defined in RFC-4122 (section 3):
// "6ba7b810-9dad-11d1-80b4-00c04fd430c8".
-func (u *UUID) decodeCanonical(t []byte) (err error) {
+func (u *UUID) decodeCanonical(t []byte) error {
if t[8] != '-' || t[13] != '-' || t[18] != '-' || t[23] != '-' {
return fmt.Errorf("uuid: incorrect UUID format %s", t)
}
- src := t[:]
+ src := t
dst := u[:]
for i, byteGroup := range byteGroups {
if i > 0 {
src = src[1:] // skip dash
}
- _, err = hex.Decode(dst[:byteGroup/2], src[:byteGroup])
+ _, err := hex.Decode(dst[:byteGroup/2], src[:byteGroup])
if err != nil {
- return
+ return err
}
src = src[byteGroup:]
dst = dst[byteGroup/2:]
}
- return
+ return nil
}
-// decodeHashLike decodes UUID string in format
-// "6ba7b8109dad11d180b400c04fd430c8".
-func (u *UUID) decodeHashLike(t []byte) (err error) {
+// decodeHashLike decodes UUID strings that are using the following format:
+// "6ba7b8109dad11d180b400c04fd430c8".
+func (u *UUID) decodeHashLike(t []byte) error {
src := t[:]
dst := u[:]
- if _, err = hex.Decode(dst, src); err != nil {
- return err
- }
- return
+ _, err := hex.Decode(dst, src)
+ return err
}
-// decodeBraced decodes UUID string in format
-// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}" or in format
-// "{6ba7b8109dad11d180b400c04fd430c8}".
-func (u *UUID) decodeBraced(t []byte) (err error) {
+// decodeBraced decodes UUID strings that are using the following formats:
+// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}"
+// "{6ba7b8109dad11d180b400c04fd430c8}".
+func (u *UUID) decodeBraced(t []byte) error {
l := len(t)
if t[0] != '{' || t[l-1] != '}' {
@@ -158,49 +166,47 @@ func (u *UUID) decodeBraced(t []byte) (err error) {
return u.decodePlain(t[1 : l-1])
}
-// decodeURN decodes UUID string in format
-// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in format
-// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8".
-func (u *UUID) decodeURN(t []byte) (err error) {
+// decodeURN decodes UUID strings that are using the following formats:
+// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8"
+// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8".
+func (u *UUID) decodeURN(t []byte) error {
total := len(t)
- urn_uuid_prefix := t[:9]
+ urnUUIDPrefix := t[:9]
- if !bytes.Equal(urn_uuid_prefix, urnPrefix) {
+ if !bytes.Equal(urnUUIDPrefix, urnPrefix) {
return fmt.Errorf("uuid: incorrect UUID format: %s", t)
}
return u.decodePlain(t[9:total])
}
-// decodePlain decodes UUID string in canonical format
-// "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format
-// "6ba7b8109dad11d180b400c04fd430c8".
-func (u *UUID) decodePlain(t []byte) (err error) {
+// decodePlain decodes UUID strings that are using the following formats:
+// "6ba7b810-9dad-11d1-80b4-00c04fd430c8" or in hash-like format
+// "6ba7b8109dad11d180b400c04fd430c8".
+func (u *UUID) decodePlain(t []byte) error {
switch len(t) {
case 32:
return u.decodeHashLike(t)
case 36:
return u.decodeCanonical(t)
default:
- return fmt.Errorf("uuid: incorrrect UUID length: %s", t)
+ return fmt.Errorf("uuid: incorrect UUID length: %s", t)
}
}
// MarshalBinary implements the encoding.BinaryMarshaler interface.
-func (u UUID) MarshalBinary() (data []byte, err error) {
- data = u.Bytes()
- return
+func (u UUID) MarshalBinary() ([]byte, error) {
+ return u.Bytes(), nil
}
// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
-// It will return error if the slice isn't 16 bytes long.
-func (u *UUID) UnmarshalBinary(data []byte) (err error) {
+// It will return an error if the slice isn't 16 bytes long.
+func (u *UUID) UnmarshalBinary(data []byte) error {
if len(data) != Size {
- err = fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data))
- return
+ return fmt.Errorf("uuid: UUID must be exactly 16 bytes long, got %d bytes", len(data))
}
copy(u[:], data)
- return
+ return nil
}
diff --git a/vendor/github.com/gofrs/uuid/fuzz.go b/vendor/github.com/gofrs/uuid/fuzz.go
new file mode 100644
index 000000000..afaefbc8e
--- /dev/null
+++ b/vendor/github.com/gofrs/uuid/fuzz.go
@@ -0,0 +1,47 @@
+// Copyright (c) 2018 Andrei Tudor Călin
+//
+// 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.
+
+// +build gofuzz
+
+package uuid
+
+// Fuzz implements a simple fuzz test for FromString / UnmarshalText.
+//
+// To run:
+//
+// $ go get github.com/dvyukov/go-fuzz/...
+// $ cd $GOPATH/src/github.com/gofrs/uuid
+// $ go-fuzz-build github.com/gofrs/uuid
+// $ go-fuzz -bin=uuid-fuzz.zip -workdir=./testdata
+//
+// If you make significant changes to FromString / UnmarshalText and add
+// new cases to fromStringTests (in codec_test.go), please run
+//
+// $ go test -seed_fuzz_corpus
+//
+// to seed the corpus with the new interesting inputs, then run the fuzzer.
+func Fuzz(data []byte) int {
+ _, err := FromString(string(data))
+ if err != nil {
+ return 0
+ }
+ return 1
+}
diff --git a/vendor/github.com/gofrs/uuid/generator.go b/vendor/github.com/gofrs/uuid/generator.go
new file mode 100644
index 000000000..4257761f1
--- /dev/null
+++ b/vendor/github.com/gofrs/uuid/generator.go
@@ -0,0 +1,299 @@
+// Copyright (C) 2013-2018 by Maxim Bublis
+//
+// 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.
+
+package uuid
+
+import (
+ "crypto/md5"
+ "crypto/rand"
+ "crypto/sha1"
+ "encoding/binary"
+ "fmt"
+ "hash"
+ "io"
+ "net"
+ "os"
+ "sync"
+ "time"
+)
+
+// Difference in 100-nanosecond intervals between
+// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970).
+const epochStart = 122192928000000000
+
+type epochFunc func() time.Time
+
+// HWAddrFunc is the function type used to provide hardware (MAC) addresses.
+type HWAddrFunc func() (net.HardwareAddr, error)
+
+// DefaultGenerator is the default UUID Generator used by this package.
+var DefaultGenerator Generator = NewGen()
+
+var (
+ posixUID = uint32(os.Getuid())
+ posixGID = uint32(os.Getgid())
+)
+
+// NewV1 returns a UUID based on the current timestamp and MAC address.
+func NewV1() (UUID, error) {
+ return DefaultGenerator.NewV1()
+}
+
+// NewV2 returns a DCE Security UUID based on the POSIX UID/GID.
+func NewV2(domain byte) (UUID, error) {
+ return DefaultGenerator.NewV2(domain)
+}
+
+// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name.
+func NewV3(ns UUID, name string) UUID {
+ return DefaultGenerator.NewV3(ns, name)
+}
+
+// NewV4 returns a randomly generated UUID.
+func NewV4() (UUID, error) {
+ return DefaultGenerator.NewV4()
+}
+
+// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name.
+func NewV5(ns UUID, name string) UUID {
+ return DefaultGenerator.NewV5(ns, name)
+}
+
+// Generator provides an interface for generating UUIDs.
+type Generator interface {
+ NewV1() (UUID, error)
+ NewV2(domain byte) (UUID, error)
+ NewV3(ns UUID, name string) UUID
+ NewV4() (UUID, error)
+ NewV5(ns UUID, name string) UUID
+}
+
+// Gen is a reference UUID generator based on the specifications laid out in
+// RFC-4122 and DCE 1.1: Authentication and Security Services. This type
+// satisfies the Generator interface as defined in this package.
+//
+// For consumers who are generating V1 UUIDs, but don't want to expose the MAC
+// address of the node generating the UUIDs, the NewGenWithHWAF() function has been
+// provided as a convenience. See the function's documentation for more info.
+//
+// The authors of this package do not feel that the majority of users will need
+// to obfuscate their MAC address, and so we recommend using NewGen() to create
+// a new generator.
+type Gen struct {
+ clockSequenceOnce sync.Once
+ hardwareAddrOnce sync.Once
+ storageMutex sync.Mutex
+
+ rand io.Reader
+
+ epochFunc epochFunc
+ hwAddrFunc HWAddrFunc
+ lastTime uint64
+ clockSequence uint16
+ hardwareAddr [6]byte
+}
+
+// interface check -- build will fail if *Gen doesn't satisfy Generator
+var _ Generator = (*Gen)(nil)
+
+// NewGen returns a new instance of Gen with some default values set. Most
+// people should use this.
+func NewGen() *Gen {
+ return NewGenWithHWAF(defaultHWAddrFunc)
+}
+
+// NewGenWithHWAF builds a new UUID generator with the HWAddrFunc provided. Most
+// consumers should use NewGen() instead.
+//
+// This is used so that consumers can generate their own MAC addresses, for use
+// in the generated UUIDs, if there is some concern about exposing the physical
+// address of the machine generating the UUID.
+//
+// The Gen generator will only invoke the HWAddrFunc once, and cache that MAC
+// address for all the future UUIDs generated by it. If you'd like to switch the
+// MAC address being used, you'll need to create a new generator using this
+// function.
+func NewGenWithHWAF(hwaf HWAddrFunc) *Gen {
+ return &Gen{
+ epochFunc: time.Now,
+ hwAddrFunc: hwaf,
+ rand: rand.Reader,
+ }
+}
+
+// NewV1 returns a UUID based on the current timestamp and MAC address.
+func (g *Gen) NewV1() (UUID, error) {
+ u := UUID{}
+
+ timeNow, clockSeq, err := g.getClockSequence()
+ if err != nil {
+ return Nil, err
+ }
+ binary.BigEndian.PutUint32(u[0:], uint32(timeNow))
+ binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32))
+ binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48))
+ binary.BigEndian.PutUint16(u[8:], clockSeq)
+
+ hardwareAddr, err := g.getHardwareAddr()
+ if err != nil {
+ return Nil, err
+ }
+ copy(u[10:], hardwareAddr)
+
+ u.SetVersion(V1)
+ u.SetVariant(VariantRFC4122)
+
+ return u, nil
+}
+
+// NewV2 returns a DCE Security UUID based on the POSIX UID/GID.
+func (g *Gen) NewV2(domain byte) (UUID, error) {
+ u, err := g.NewV1()
+ if err != nil {
+ return Nil, err
+ }
+
+ switch domain {
+ case DomainPerson:
+ binary.BigEndian.PutUint32(u[:], posixUID)
+ case DomainGroup:
+ binary.BigEndian.PutUint32(u[:], posixGID)
+ }
+
+ u[9] = domain
+
+ u.SetVersion(V2)
+ u.SetVariant(VariantRFC4122)
+
+ return u, nil
+}
+
+// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name.
+func (g *Gen) NewV3(ns UUID, name string) UUID {
+ u := newFromHash(md5.New(), ns, name)
+ u.SetVersion(V3)
+ u.SetVariant(VariantRFC4122)
+
+ return u
+}
+
+// NewV4 returns a randomly generated UUID.
+func (g *Gen) NewV4() (UUID, error) {
+ u := UUID{}
+ if _, err := io.ReadFull(g.rand, u[:]); err != nil {
+ return Nil, err
+ }
+ u.SetVersion(V4)
+ u.SetVariant(VariantRFC4122)
+
+ return u, nil
+}
+
+// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name.
+func (g *Gen) NewV5(ns UUID, name string) UUID {
+ u := newFromHash(sha1.New(), ns, name)
+ u.SetVersion(V5)
+ u.SetVariant(VariantRFC4122)
+
+ return u
+}
+
+// Returns the epoch and clock sequence.
+func (g *Gen) getClockSequence() (uint64, uint16, error) {
+ var err error
+ g.clockSequenceOnce.Do(func() {
+ buf := make([]byte, 2)
+ if _, err = io.ReadFull(g.rand, buf); err != nil {
+ return
+ }
+ g.clockSequence = binary.BigEndian.Uint16(buf)
+ })
+ if err != nil {
+ return 0, 0, err
+ }
+
+ g.storageMutex.Lock()
+ defer g.storageMutex.Unlock()
+
+ timeNow := g.getEpoch()
+ // Clock didn't change since last UUID generation.
+ // Should increase clock sequence.
+ if timeNow <= g.lastTime {
+ g.clockSequence++
+ }
+ g.lastTime = timeNow
+
+ return timeNow, g.clockSequence, nil
+}
+
+// Returns the hardware address.
+func (g *Gen) getHardwareAddr() ([]byte, error) {
+ var err error
+ g.hardwareAddrOnce.Do(func() {
+ var hwAddr net.HardwareAddr
+ if hwAddr, err = g.hwAddrFunc(); err == nil {
+ copy(g.hardwareAddr[:], hwAddr)
+ return
+ }
+
+ // Initialize hardwareAddr randomly in case
+ // of real network interfaces absence.
+ if _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil {
+ return
+ }
+ // Set multicast bit as recommended by RFC-4122
+ g.hardwareAddr[0] |= 0x01
+ })
+ if err != nil {
+ return []byte{}, err
+ }
+ return g.hardwareAddr[:], nil
+}
+
+// Returns the difference between UUID epoch (October 15, 1582)
+// and current time in 100-nanosecond intervals.
+func (g *Gen) getEpoch() uint64 {
+ return epochStart + uint64(g.epochFunc().UnixNano()/100)
+}
+
+// Returns the UUID based on the hashing of the namespace UUID and name.
+func newFromHash(h hash.Hash, ns UUID, name string) UUID {
+ u := UUID{}
+ h.Write(ns[:])
+ h.Write([]byte(name))
+ copy(u[:], h.Sum(nil))
+
+ return u
+}
+
+// Returns the hardware address.
+func defaultHWAddrFunc() (net.HardwareAddr, error) {
+ ifaces, err := net.Interfaces()
+ if err != nil {
+ return []byte{}, err
+ }
+ for _, iface := range ifaces {
+ if len(iface.HardwareAddr) >= 6 {
+ return iface.HardwareAddr, nil
+ }
+ }
+ return []byte{}, fmt.Errorf("uuid: no HW address found")
+}
diff --git a/vendor/github.com/satori/go.uuid/sql.go b/vendor/github.com/gofrs/uuid/sql.go
similarity index 74%
rename from vendor/github.com/satori/go.uuid/sql.go
rename to vendor/github.com/gofrs/uuid/sql.go
index 56759d390..6f254a4fd 100644
--- a/vendor/github.com/satori/go.uuid/sql.go
+++ b/vendor/github.com/gofrs/uuid/sql.go
@@ -22,7 +22,9 @@
package uuid
import (
+ "bytes"
"database/sql/driver"
+ "encoding/json"
"fmt"
)
@@ -32,10 +34,14 @@ func (u UUID) Value() (driver.Value, error) {
}
// Scan implements the sql.Scanner interface.
-// A 16-byte slice is handled by UnmarshalBinary, while
-// a longer byte slice or a string is handled by UnmarshalText.
+// A 16-byte slice will be handled by UnmarshalBinary, while
+// a longer byte slice or a string will be handled by UnmarshalText.
func (u *UUID) Scan(src interface{}) error {
switch src := src.(type) {
+ case UUID: // support gorm convert from UUID to NullUUID
+ *u = src
+ return nil
+
case []byte:
if len(src) == Size {
return u.UnmarshalBinary(src)
@@ -50,7 +56,7 @@ func (u *UUID) Scan(src interface{}) error {
}
// NullUUID can be used with the standard sql package to represent a
-// UUID value that can be NULL in the database
+// UUID value that can be NULL in the database.
type NullUUID struct {
UUID UUID
Valid bool
@@ -76,3 +82,28 @@ func (u *NullUUID) Scan(src interface{}) error {
u.Valid = true
return u.UUID.Scan(src)
}
+
+// MarshalJSON marshals the NullUUID as null or the nested UUID
+func (u NullUUID) MarshalJSON() ([]byte, error) {
+ if !u.Valid {
+ return json.Marshal(nil)
+ }
+
+ return json.Marshal(u.UUID)
+}
+
+// UnmarshalJSON unmarshals a NullUUID
+func (u *NullUUID) UnmarshalJSON(b []byte) error {
+ if bytes.Equal(b, []byte("null")) {
+ u.UUID, u.Valid = Nil, false
+ return nil
+ }
+
+ if err := json.Unmarshal(b, &u.UUID); err != nil {
+ return err
+ }
+
+ u.Valid = true
+
+ return nil
+}
diff --git a/vendor/github.com/satori/go.uuid/uuid.go b/vendor/github.com/gofrs/uuid/uuid.go
similarity index 58%
rename from vendor/github.com/satori/go.uuid/uuid.go
rename to vendor/github.com/gofrs/uuid/uuid.go
index a2b8e2ca2..29ef44059 100644
--- a/vendor/github.com/satori/go.uuid/uuid.go
+++ b/vendor/github.com/gofrs/uuid/uuid.go
@@ -19,31 +19,37 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-// Package uuid provides implementation of Universally Unique Identifier (UUID).
-// Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and
-// version 2 (as specified in DCE 1.1).
+// Package uuid provides implementations of the Universally Unique Identifier (UUID), as specified in RFC-4122 and DCE 1.1.
+//
+// RFC-4122[1] provides the specification for versions 1, 3, 4, and 5.
+//
+// DCE 1.1[2] provides the specification for version 2.
+//
+// [1] https://tools.ietf.org/html/rfc4122
+// [2] http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01
package uuid
import (
- "bytes"
+ "encoding/binary"
"encoding/hex"
+ "fmt"
+ "time"
)
// Size of a UUID in bytes.
const Size = 16
-// UUID representation compliant with specification
-// described in RFC 4122.
+// UUID is an array type to represent the value of a UUID, as defined in RFC-4122.
type UUID [Size]byte
-// UUID versions
+// UUID versions.
const (
- _ byte = iota
- V1
- V2
- V3
- V4
- V5
+ _ byte = iota
+ V1 // Version 1 (date-time and MAC address)
+ V2 // Version 2 (date-time and MAC address, DCE security version)
+ V3 // Version 3 (namespace name-based)
+ V4 // Version 4 (random)
+ V5 // Version 5 (namespace name-based)
)
// UUID layout variants.
@@ -61,14 +67,41 @@ const (
DomainOrg
)
+// Timestamp is the count of 100-nanosecond intervals since 00:00:00.00,
+// 15 October 1582 within a V1 UUID. This type has no meaning for V2-V5
+// UUIDs since they don't have an embedded timestamp.
+type Timestamp uint64
+
+const _100nsPerSecond = 10000000
+
+// Time returns the UTC time.Time representation of a Timestamp
+func (t Timestamp) Time() (time.Time, error) {
+ secs := uint64(t) / _100nsPerSecond
+ nsecs := 100 * (uint64(t) % _100nsPerSecond)
+ return time.Unix(int64(secs)-(epochStart/_100nsPerSecond), int64(nsecs)), nil
+}
+
+// TimestampFromV1 returns the Timestamp embedded within a V1 UUID.
+// Returns an error if the UUID is any version other than 1.
+func TimestampFromV1(u UUID) (Timestamp, error) {
+ if u.Version() != 1 {
+ err := fmt.Errorf("uuid: %s is version %d, not version 1", u, u.Version())
+ return 0, err
+ }
+ low := binary.BigEndian.Uint32(u[0:4])
+ mid := binary.BigEndian.Uint16(u[4:6])
+ hi := binary.BigEndian.Uint16(u[6:8]) & 0xfff
+ return Timestamp(uint64(low) + (uint64(mid) << 32) + (uint64(hi) << 48)), nil
+}
+
// String parse helpers.
var (
urnPrefix = []byte("urn:uuid:")
byteGroups = []int{8, 4, 4, 4, 12}
)
-// Nil is special form of UUID that is specified to have all
-// 128 bits set to zero.
+// Nil is the nil UUID, as specified in RFC-4122, that has all 128 bits set to
+// zero.
var Nil = UUID{}
// Predefined namespace UUIDs.
@@ -79,17 +112,12 @@ var (
NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8"))
)
-// Equal returns true if u1 and u2 equals, otherwise returns false.
-func Equal(u1 UUID, u2 UUID) bool {
- return bytes.Equal(u1[:], u2[:])
-}
-
-// Version returns algorithm version used to generate UUID.
+// Version returns the algorithm version used to generate the UUID.
func (u UUID) Version() byte {
return u[6] >> 4
}
-// Variant returns UUID layout variant.
+// Variant returns the UUID layout variant.
func (u UUID) Variant() byte {
switch {
case (u[8] >> 7) == 0x00:
@@ -105,12 +133,12 @@ func (u UUID) Variant() byte {
}
}
-// Bytes returns bytes slice representation of UUID.
+// Bytes returns a byte slice representation of the UUID.
func (u UUID) Bytes() []byte {
return u[:]
}
-// Returns canonical string representation of UUID:
+// String returns a canonical RFC-4122 string representation of the UUID:
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
func (u UUID) String() string {
buf := make([]byte, 36)
@@ -128,12 +156,12 @@ func (u UUID) String() string {
return string(buf)
}
-// SetVersion sets version bits.
+// SetVersion sets the version bits.
func (u *UUID) SetVersion(v byte) {
u[6] = (u[6] & 0x0f) | (v << 4)
}
-// SetVariant sets variant bits.
+// SetVariant sets the variant bits.
func (u *UUID) SetVariant(v byte) {
switch v {
case VariantNCS:
@@ -152,7 +180,7 @@ func (u *UUID) SetVariant(v byte) {
// Must is a helper that wraps a call to a function returning (UUID, error)
// and panics if the error is non-nil. It is intended for use in variable
// initializations such as
-// var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000"));
+// var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000"))
func Must(u UUID, err error) UUID {
if err != nil {
panic(err)
diff --git a/vendor/github.com/golang/protobuf/LICENSE b/vendor/github.com/golang/protobuf/LICENSE
index 1b1b1921e..0f646931a 100644
--- a/vendor/github.com/golang/protobuf/LICENSE
+++ b/vendor/github.com/golang/protobuf/LICENSE
@@ -1,7 +1,4 @@
-Go support for Protocol Buffers - Google's data interchange format
-
Copyright 2010 The Go Authors. All rights reserved.
-https://github.com/golang/protobuf
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
new file mode 100644
index 000000000..e9cc20258
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go
@@ -0,0 +1,1284 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2015 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// 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 jsonpb provides marshaling and unmarshaling between protocol buffers and JSON.
+It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json.
+
+This package produces a different output than the standard "encoding/json" package,
+which does not operate correctly on protocol buffers.
+*/
+package jsonpb
+
+import (
+ "bytes"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/golang/protobuf/proto"
+
+ stpb "github.com/golang/protobuf/ptypes/struct"
+)
+
+const secondInNanos = int64(time.Second / time.Nanosecond)
+const maxSecondsInDuration = 315576000000
+
+// Marshaler is a configurable object for converting between
+// protocol buffer objects and a JSON representation for them.
+type Marshaler struct {
+ // Whether to render enum values as integers, as opposed to string values.
+ EnumsAsInts bool
+
+ // Whether to render fields with zero values.
+ EmitDefaults bool
+
+ // A string to indent each level by. The presence of this field will
+ // also cause a space to appear between the field separator and
+ // value, and for newlines to be appear between fields and array
+ // elements.
+ Indent string
+
+ // Whether to use the original (.proto) name for fields.
+ OrigName bool
+
+ // A custom URL resolver to use when marshaling Any messages to JSON.
+ // If unset, the default resolution strategy is to extract the
+ // fully-qualified type name from the type URL and pass that to
+ // proto.MessageType(string).
+ AnyResolver AnyResolver
+}
+
+// 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)
+}
+
+func defaultResolveAny(typeUrl string) (proto.Message, error) {
+ // Only the part of typeUrl after the last slash is relevant.
+ mname := typeUrl
+ if slash := strings.LastIndex(mname, "/"); slash >= 0 {
+ mname = mname[slash+1:]
+ }
+ mt := proto.MessageType(mname)
+ if mt == nil {
+ return nil, fmt.Errorf("unknown message type %q", mname)
+ }
+ return reflect.New(mt.Elem()).Interface().(proto.Message), nil
+}
+
+// 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
+type JSONPBMarshaler interface {
+ MarshalJSONPB(*Marshaler) ([]byte, error)
+}
+
+// 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
+type JSONPBUnmarshaler interface {
+ UnmarshalJSONPB(*Unmarshaler, []byte) error
+}
+
+// Marshal marshals a protocol buffer into JSON.
+func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error {
+ v := reflect.ValueOf(pb)
+ if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) {
+ return errors.New("Marshal called with nil")
+ }
+ // Check for unset required fields first.
+ if err := checkRequiredFields(pb); err != nil {
+ return err
+ }
+ writer := &errWriter{writer: out}
+ return m.marshalObject(writer, pb, "", "")
+}
+
+// MarshalToString converts a protocol buffer object to JSON string.
+func (m *Marshaler) MarshalToString(pb proto.Message) (string, error) {
+ var buf bytes.Buffer
+ if err := m.Marshal(&buf, pb); err != nil {
+ return "", err
+ }
+ return buf.String(), nil
+}
+
+type int32Slice []int32
+
+var nonFinite = map[string]float64{
+ `"NaN"`: math.NaN(),
+ `"Infinity"`: math.Inf(1),
+ `"-Infinity"`: math.Inf(-1),
+}
+
+// For sorting extensions ids to ensure stable output.
+func (s int32Slice) Len() int { return len(s) }
+func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] }
+func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+
+type wkt interface {
+ XXX_WellKnownType() string
+}
+
+// marshalObject writes a struct to the Writer.
+func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeURL string) error {
+ if jsm, ok := v.(JSONPBMarshaler); ok {
+ b, err := jsm.MarshalJSONPB(m)
+ 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", v, 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 m.Indent != "" {
+ b, err = json.MarshalIndent(js, indent, m.Indent)
+ } else {
+ b, err = json.Marshal(js)
+ }
+ if err != nil {
+ return err
+ }
+ }
+
+ out.write(string(b))
+ return out.err
+ }
+
+ s := reflect.ValueOf(v).Elem()
+
+ // Handle well-known types.
+ if wkt, ok := v.(wkt); ok {
+ switch wkt.XXX_WellKnownType() {
+ case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value",
+ "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue":
+ // "Wrappers use the same representation in JSON
+ // as the wrapped primitive type, ..."
+ sprop := proto.GetProperties(s.Type())
+ return m.marshalValue(out, sprop.Prop[0], s.Field(0), indent)
+ case "Any":
+ // Any is a bit more involved.
+ return m.marshalAny(out, v, indent)
+ case "Duration":
+ s, ns := s.Field(0).Int(), s.Field(1).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")
+ }
+ // Generated output always contains 0, 3, 6, or 9 fractional digits,
+ // depending on required precision, followed by the suffix "s".
+ f := "%d.%09d"
+ if ns < 0 {
+ ns = -ns
+ if s == 0 {
+ f = "-%d.%09d"
+ }
+ }
+ x := fmt.Sprintf(f, s, ns)
+ x = strings.TrimSuffix(x, "000")
+ x = strings.TrimSuffix(x, "000")
+ x = strings.TrimSuffix(x, ".000")
+ out.write(`"`)
+ out.write(x)
+ out.write(`s"`)
+ return out.err
+ case "Struct", "ListValue":
+ // Let marshalValue handle the `Struct.fields` map or the `ListValue.values` slice.
+ // TODO: pass the correct Properties if needed.
+ return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent)
+ case "Timestamp":
+ // "RFC 3339, where generated output will always be Z-normalized
+ // and uses 0, 3, 6 or 9 fractional digits."
+ s, ns := s.Field(0).Int(), s.Field(1).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")
+ out.write(`"`)
+ out.write(x)
+ out.write(`Z"`)
+ return out.err
+ case "Value":
+ // Value has a single oneof.
+ kind := s.Field(0)
+ if kind.IsNil() {
+ // "absence of any variant indicates an error"
+ return errors.New("nil Value")
+ }
+ // oneof -> *T -> T -> T.F
+ x := kind.Elem().Elem().Field(0)
+ // TODO: pass the correct Properties if needed.
+ return m.marshalValue(out, &proto.Properties{}, x, indent)
+ }
+ }
+
+ out.write("{")
+ if m.Indent != "" {
+ out.write("\n")
+ }
+
+ firstField := true
+
+ if typeURL != "" {
+ if err := m.marshalTypeURL(out, indent, typeURL); err != nil {
+ return err
+ }
+ firstField = false
+ }
+
+ for i := 0; i < s.NumField(); i++ {
+ value := s.Field(i)
+ valueField := s.Type().Field(i)
+ if strings.HasPrefix(valueField.Name, "XXX_") {
+ continue
+ }
+
+ // IsNil will panic on most value kinds.
+ switch value.Kind() {
+ case reflect.Chan, reflect.Func, reflect.Interface:
+ if value.IsNil() {
+ continue
+ }
+ }
+
+ if !m.EmitDefaults {
+ switch value.Kind() {
+ case reflect.Bool:
+ if !value.Bool() {
+ continue
+ }
+ case reflect.Int32, reflect.Int64:
+ if value.Int() == 0 {
+ continue
+ }
+ case reflect.Uint32, reflect.Uint64:
+ if value.Uint() == 0 {
+ continue
+ }
+ case reflect.Float32, reflect.Float64:
+ if value.Float() == 0 {
+ continue
+ }
+ case reflect.String:
+ if value.Len() == 0 {
+ continue
+ }
+ case reflect.Map, reflect.Ptr, reflect.Slice:
+ if value.IsNil() {
+ continue
+ }
+ }
+ }
+
+ // Oneof fields need special handling.
+ if valueField.Tag.Get("protobuf_oneof") != "" {
+ // value is an interface containing &T{real_value}.
+ sv := value.Elem().Elem() // interface -> *T -> T
+ value = sv.Field(0)
+ valueField = sv.Type().Field(0)
+ }
+ prop := jsonProperties(valueField, m.OrigName)
+ if !firstField {
+ m.writeSep(out)
+ }
+ if err := m.marshalField(out, prop, value, indent); err != nil {
+ return err
+ }
+ firstField = false
+ }
+
+ // Handle proto2 extensions.
+ if ep, ok := v.(proto.Message); ok {
+ extensions := proto.RegisteredExtensions(v)
+ // Sort extensions for stable output.
+ ids := make([]int32, 0, len(extensions))
+ for id, desc := range extensions {
+ if !proto.HasExtension(ep, desc) {
+ continue
+ }
+ ids = append(ids, id)
+ }
+ sort.Sort(int32Slice(ids))
+ for _, id := range ids {
+ desc := extensions[id]
+ if desc == nil {
+ // unknown extension
+ continue
+ }
+ ext, extErr := proto.GetExtension(ep, desc)
+ if extErr != nil {
+ return extErr
+ }
+ value := reflect.ValueOf(ext)
+ var prop proto.Properties
+ prop.Parse(desc.Tag)
+ prop.JSONName = fmt.Sprintf("[%s]", desc.Name)
+ if !firstField {
+ m.writeSep(out)
+ }
+ if err := m.marshalField(out, &prop, value, indent); err != nil {
+ return err
+ }
+ firstField = false
+ }
+
+ }
+
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ }
+ out.write("}")
+ return out.err
+}
+
+func (m *Marshaler) writeSep(out *errWriter) {
+ if m.Indent != "" {
+ out.write(",\n")
+ } else {
+ out.write(",")
+ }
+}
+
+func (m *Marshaler) marshalAny(out *errWriter, any proto.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."
+ v := reflect.ValueOf(any).Elem()
+ turl := v.Field(0).String()
+ val := v.Field(1).Bytes()
+
+ var msg proto.Message
+ var err error
+ if m.AnyResolver != nil {
+ msg, err = m.AnyResolver.Resolve(turl)
+ } else {
+ msg, err = defaultResolveAny(turl)
+ }
+ if err != nil {
+ return err
+ }
+
+ if err := proto.Unmarshal(val, msg); err != nil {
+ return err
+ }
+
+ if _, ok := msg.(wkt); ok {
+ out.write("{")
+ if m.Indent != "" {
+ out.write("\n")
+ }
+ if err := m.marshalTypeURL(out, indent, turl); err != nil {
+ return err
+ }
+ m.writeSep(out)
+ if m.Indent != "" {
+ out.write(indent)
+ out.write(m.Indent)
+ out.write(`"value": `)
+ } else {
+ out.write(`"value":`)
+ }
+ if err := m.marshalObject(out, msg, indent+m.Indent, ""); err != nil {
+ return err
+ }
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ }
+ out.write("}")
+ return out.err
+ }
+
+ return m.marshalObject(out, msg, indent, turl)
+}
+
+func (m *Marshaler) marshalTypeURL(out *errWriter, indent, typeURL string) error {
+ if m.Indent != "" {
+ out.write(indent)
+ out.write(m.Indent)
+ }
+ out.write(`"@type":`)
+ if m.Indent != "" {
+ out.write(" ")
+ }
+ b, err := json.Marshal(typeURL)
+ if err != nil {
+ return err
+ }
+ out.write(string(b))
+ return out.err
+}
+
+// marshalField writes field description and value to the Writer.
+func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {
+ if m.Indent != "" {
+ out.write(indent)
+ out.write(m.Indent)
+ }
+ out.write(`"`)
+ out.write(prop.JSONName)
+ out.write(`":`)
+ if m.Indent != "" {
+ out.write(" ")
+ }
+ if err := m.marshalValue(out, prop, v, indent); err != nil {
+ return err
+ }
+ return nil
+}
+
+// marshalValue writes the value to the Writer.
+func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error {
+ var err error
+ v = reflect.Indirect(v)
+
+ // Handle nil pointer
+ if v.Kind() == reflect.Invalid {
+ out.write("null")
+ return out.err
+ }
+
+ // Handle repeated elements.
+ if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 {
+ out.write("[")
+ comma := ""
+ for i := 0; i < v.Len(); i++ {
+ sliceVal := v.Index(i)
+ out.write(comma)
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ out.write(m.Indent)
+ out.write(m.Indent)
+ }
+ if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil {
+ return err
+ }
+ comma = ","
+ }
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ out.write(m.Indent)
+ }
+ out.write("]")
+ return out.err
+ }
+
+ // Handle well-known types.
+ // Most are handled up in marshalObject (because 99% are messages).
+ if wkt, ok := v.Interface().(wkt); ok {
+ switch wkt.XXX_WellKnownType() {
+ case "NullValue":
+ out.write("null")
+ return out.err
+ }
+ }
+
+ // Handle enumerations.
+ if !m.EnumsAsInts && prop.Enum != "" {
+ // Unknown enum values will are stringified by the proto library as their
+ // value. Such values should _not_ be quoted or they will be interpreted
+ // as an enum string instead of their value.
+ enumStr := v.Interface().(fmt.Stringer).String()
+ var valStr string
+ if v.Kind() == reflect.Ptr {
+ valStr = strconv.Itoa(int(v.Elem().Int()))
+ } else {
+ valStr = strconv.Itoa(int(v.Int()))
+ }
+ isKnownEnum := enumStr != valStr
+ if isKnownEnum {
+ out.write(`"`)
+ }
+ out.write(enumStr)
+ if isKnownEnum {
+ out.write(`"`)
+ }
+ return out.err
+ }
+
+ // Handle nested messages.
+ if v.Kind() == reflect.Struct {
+ return m.marshalObject(out, v.Addr().Interface().(proto.Message), indent+m.Indent, "")
+ }
+
+ // Handle maps.
+ // Since Go randomizes map iteration, we sort keys for stable output.
+ if v.Kind() == reflect.Map {
+ out.write(`{`)
+ keys := v.MapKeys()
+ sort.Sort(mapKeys(keys))
+ for i, k := range keys {
+ if i > 0 {
+ out.write(`,`)
+ }
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ out.write(m.Indent)
+ out.write(m.Indent)
+ }
+
+ // TODO handle map key prop properly
+ b, err := json.Marshal(k.Interface())
+ if err != nil {
+ return err
+ }
+ s := string(b)
+
+ // If the JSON is not a string value, encode it again to make it one.
+ if !strings.HasPrefix(s, `"`) {
+ b, err := json.Marshal(s)
+ if err != nil {
+ return err
+ }
+ s = string(b)
+ }
+
+ out.write(s)
+ out.write(`:`)
+ if m.Indent != "" {
+ out.write(` `)
+ }
+
+ vprop := prop
+ if prop != nil && prop.MapValProp != nil {
+ vprop = prop.MapValProp
+ }
+ if err := m.marshalValue(out, vprop, v.MapIndex(k), indent+m.Indent); err != nil {
+ return err
+ }
+ }
+ if m.Indent != "" {
+ out.write("\n")
+ out.write(indent)
+ out.write(m.Indent)
+ }
+ out.write(`}`)
+ return out.err
+ }
+
+ // Handle non-finite floats, e.g. NaN, Infinity and -Infinity.
+ if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 {
+ f := v.Float()
+ var sval string
+ switch {
+ case math.IsInf(f, 1):
+ sval = `"Infinity"`
+ case math.IsInf(f, -1):
+ sval = `"-Infinity"`
+ case math.IsNaN(f):
+ sval = `"NaN"`
+ }
+ if sval != "" {
+ out.write(sval)
+ return out.err
+ }
+ }
+
+ // Default handling defers to the encoding/json library.
+ b, err := json.Marshal(v.Interface())
+ if err != nil {
+ return err
+ }
+ needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64)
+ if needToQuote {
+ out.write(`"`)
+ }
+ out.write(string(b))
+ if needToQuote {
+ out.write(`"`)
+ }
+ return out.err
+}
+
+// Unmarshaler is a configurable object for converting from a JSON
+// representation to a protocol buffer object.
+type Unmarshaler struct {
+ // Whether to allow messages to contain unknown fields, as opposed to
+ // failing to unmarshal.
+ AllowUnknownFields bool
+
+ // A custom URL resolver to use when unmarshaling Any messages from JSON.
+ // If unset, the default resolution strategy is to extract the
+ // fully-qualified type name from the type URL and pass that to
+ // proto.MessageType(string).
+ AnyResolver AnyResolver
+}
+
+// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream.
+// This function is lenient and will decode any options permutations of the
+// related Marshaler.
+func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error {
+ inputValue := json.RawMessage{}
+ if err := dec.Decode(&inputValue); err != nil {
+ return err
+ }
+ if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil {
+ return err
+ }
+ return checkRequiredFields(pb)
+}
+
+// Unmarshal unmarshals a JSON object stream into a protocol
+// buffer. This function is lenient and will decode any options
+// permutations of the related Marshaler.
+func (u *Unmarshaler) Unmarshal(r io.Reader, pb proto.Message) error {
+ dec := json.NewDecoder(r)
+ return u.UnmarshalNext(dec, pb)
+}
+
+// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream.
+// This function is lenient and will decode any options permutations of the
+// related Marshaler.
+func UnmarshalNext(dec *json.Decoder, pb proto.Message) error {
+ return new(Unmarshaler).UnmarshalNext(dec, pb)
+}
+
+// Unmarshal unmarshals a JSON object stream into a protocol
+// buffer. This function is lenient and will decode any options
+// permutations of the related Marshaler.
+func Unmarshal(r io.Reader, pb proto.Message) error {
+ return new(Unmarshaler).Unmarshal(r, pb)
+}
+
+// UnmarshalString will populate the fields of a protocol buffer based
+// on a JSON string. This function is lenient and will decode any options
+// permutations of the related Marshaler.
+func UnmarshalString(str string, pb proto.Message) error {
+ return new(Unmarshaler).Unmarshal(strings.NewReader(str), pb)
+}
+
+// unmarshalValue converts/copies a value into the target.
+// prop may be nil.
+func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.Properties) error {
+ targetType := target.Type()
+
+ // Allocate memory for pointer fields.
+ if targetType.Kind() == reflect.Ptr {
+ // If input value is "null" and target is a pointer type, then the field should be treated as not set
+ // UNLESS the target is structpb.Value, in which case it should be set to structpb.NullValue.
+ _, isJSONPBUnmarshaler := target.Interface().(JSONPBUnmarshaler)
+ if string(inputValue) == "null" && targetType != reflect.TypeOf(&stpb.Value{}) && !isJSONPBUnmarshaler {
+ return nil
+ }
+ target.Set(reflect.New(targetType.Elem()))
+
+ return u.unmarshalValue(target.Elem(), inputValue, prop)
+ }
+
+ if jsu, ok := target.Addr().Interface().(JSONPBUnmarshaler); ok {
+ return jsu.UnmarshalJSONPB(u, []byte(inputValue))
+ }
+
+ // Handle well-known types that are not pointers.
+ if w, ok := target.Addr().Interface().(wkt); ok {
+ switch w.XXX_WellKnownType() {
+ case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value",
+ "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue":
+ return u.unmarshalValue(target.Field(0), inputValue, prop)
+ case "Any":
+ // Use json.RawMessage pointer type instead of value to support pre-1.8 version.
+ // 1.8 changed RawMessage.MarshalJSON from pointer type to value type, see
+ // https://github.com/golang/go/issues/14493
+ var jsonFields map[string]*json.RawMessage
+ if err := json.Unmarshal(inputValue, &jsonFields); err != nil {
+ return err
+ }
+
+ val, ok := jsonFields["@type"]
+ if !ok || val == nil {
+ return errors.New("Any JSON doesn't have '@type'")
+ }
+
+ var turl string
+ if err := json.Unmarshal([]byte(*val), &turl); err != nil {
+ return fmt.Errorf("can't unmarshal Any's '@type': %q", *val)
+ }
+ target.Field(0).SetString(turl)
+
+ var m proto.Message
+ var err error
+ if u.AnyResolver != nil {
+ m, err = u.AnyResolver.Resolve(turl)
+ } else {
+ m, err = defaultResolveAny(turl)
+ }
+ if err != nil {
+ return err
+ }
+
+ if _, ok := m.(wkt); ok {
+ val, ok := jsonFields["value"]
+ if !ok {
+ return errors.New("Any JSON doesn't have 'value'")
+ }
+
+ if err := u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil {
+ return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err)
+ }
+ } else {
+ delete(jsonFields, "@type")
+ nestedProto, err := json.Marshal(jsonFields)
+ if err != nil {
+ return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err)
+ }
+
+ if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil {
+ return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err)
+ }
+ }
+
+ b, err := proto.Marshal(m)
+ if err != nil {
+ return fmt.Errorf("can't marshal proto %T into Any.Value: %v", m, err)
+ }
+ target.Field(1).SetBytes(b)
+
+ return nil
+ case "Duration":
+ unq, err := unquote(string(inputValue))
+ if err != nil {
+ return err
+ }
+
+ d, err := time.ParseDuration(unq)
+ if err != nil {
+ return fmt.Errorf("bad Duration: %v", err)
+ }
+
+ ns := d.Nanoseconds()
+ s := ns / 1e9
+ ns %= 1e9
+ target.Field(0).SetInt(s)
+ target.Field(1).SetInt(ns)
+ return nil
+ case "Timestamp":
+ unq, err := unquote(string(inputValue))
+ if err != nil {
+ return err
+ }
+
+ t, err := time.Parse(time.RFC3339Nano, unq)
+ if err != nil {
+ return fmt.Errorf("bad Timestamp: %v", err)
+ }
+
+ target.Field(0).SetInt(t.Unix())
+ target.Field(1).SetInt(int64(t.Nanosecond()))
+ return nil
+ case "Struct":
+ var m map[string]json.RawMessage
+ if err := json.Unmarshal(inputValue, &m); err != nil {
+ return fmt.Errorf("bad StructValue: %v", err)
+ }
+
+ target.Field(0).Set(reflect.ValueOf(map[string]*stpb.Value{}))
+ for k, jv := range m {
+ pv := &stpb.Value{}
+ if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil {
+ return fmt.Errorf("bad value in StructValue for key %q: %v", k, err)
+ }
+ target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv))
+ }
+ return nil
+ case "ListValue":
+ var s []json.RawMessage
+ if err := json.Unmarshal(inputValue, &s); err != nil {
+ return fmt.Errorf("bad ListValue: %v", err)
+ }
+
+ target.Field(0).Set(reflect.ValueOf(make([]*stpb.Value, len(s))))
+ for i, sv := range s {
+ if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil {
+ return err
+ }
+ }
+ return nil
+ case "Value":
+ ivStr := string(inputValue)
+ if ivStr == "null" {
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_NullValue{}))
+ } else if v, err := strconv.ParseFloat(ivStr, 0); err == nil {
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_NumberValue{v}))
+ } else if v, err := unquote(ivStr); err == nil {
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_StringValue{v}))
+ } else if v, err := strconv.ParseBool(ivStr); err == nil {
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_BoolValue{v}))
+ } else if err := json.Unmarshal(inputValue, &[]json.RawMessage{}); err == nil {
+ lv := &stpb.ListValue{}
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_ListValue{lv}))
+ return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop)
+ } else if err := json.Unmarshal(inputValue, &map[string]json.RawMessage{}); err == nil {
+ sv := &stpb.Struct{}
+ target.Field(0).Set(reflect.ValueOf(&stpb.Value_StructValue{sv}))
+ return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop)
+ } else {
+ return fmt.Errorf("unrecognized type for Value %q", ivStr)
+ }
+ return nil
+ }
+ }
+
+ // Handle enums, which have an underlying type of int32,
+ // and may appear as strings.
+ // The case of an enum appearing as a number is handled
+ // at the bottom of this function.
+ if inputValue[0] == '"' && prop != nil && prop.Enum != "" {
+ vmap := proto.EnumValueMap(prop.Enum)
+ // Don't need to do unquoting; valid enum names
+ // are from a limited character set.
+ s := inputValue[1 : len(inputValue)-1]
+ n, ok := vmap[string(s)]
+ if !ok {
+ return fmt.Errorf("unknown value %q for enum %s", s, prop.Enum)
+ }
+ if target.Kind() == reflect.Ptr { // proto2
+ target.Set(reflect.New(targetType.Elem()))
+ target = target.Elem()
+ }
+ if targetType.Kind() != reflect.Int32 {
+ return fmt.Errorf("invalid target %q for enum %s", targetType.Kind(), prop.Enum)
+ }
+ target.SetInt(int64(n))
+ return nil
+ }
+
+ // Handle nested messages.
+ if targetType.Kind() == reflect.Struct {
+ var jsonFields map[string]json.RawMessage
+ if err := json.Unmarshal(inputValue, &jsonFields); err != nil {
+ return err
+ }
+
+ consumeField := func(prop *proto.Properties) (json.RawMessage, bool) {
+ // Be liberal in what names we accept; both orig_name and camelName are okay.
+ fieldNames := acceptedJSONFieldNames(prop)
+
+ vOrig, okOrig := jsonFields[fieldNames.orig]
+ vCamel, okCamel := jsonFields[fieldNames.camel]
+ if !okOrig && !okCamel {
+ return nil, false
+ }
+ // If, for some reason, both are present in the data, favour the camelName.
+ var raw json.RawMessage
+ if okOrig {
+ raw = vOrig
+ delete(jsonFields, fieldNames.orig)
+ }
+ if okCamel {
+ raw = vCamel
+ delete(jsonFields, fieldNames.camel)
+ }
+ return raw, true
+ }
+
+ sprops := proto.GetProperties(targetType)
+ for i := 0; i < target.NumField(); i++ {
+ ft := target.Type().Field(i)
+ if strings.HasPrefix(ft.Name, "XXX_") {
+ continue
+ }
+
+ valueForField, ok := consumeField(sprops.Prop[i])
+ if !ok {
+ continue
+ }
+
+ if err := u.unmarshalValue(target.Field(i), valueForField, sprops.Prop[i]); err != nil {
+ return err
+ }
+ }
+ // Check for any oneof fields.
+ if len(jsonFields) > 0 {
+ for _, oop := range sprops.OneofTypes {
+ raw, ok := consumeField(oop.Prop)
+ if !ok {
+ continue
+ }
+ nv := reflect.New(oop.Type.Elem())
+ target.Field(oop.Field).Set(nv)
+ if err := u.unmarshalValue(nv.Elem().Field(0), raw, oop.Prop); err != nil {
+ return err
+ }
+ }
+ }
+ // Handle proto2 extensions.
+ if len(jsonFields) > 0 {
+ if ep, ok := target.Addr().Interface().(proto.Message); ok {
+ for _, ext := range proto.RegisteredExtensions(ep) {
+ name := fmt.Sprintf("[%s]", ext.Name)
+ raw, ok := jsonFields[name]
+ if !ok {
+ continue
+ }
+ delete(jsonFields, name)
+ nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem())
+ if err := u.unmarshalValue(nv.Elem(), raw, nil); err != nil {
+ return err
+ }
+ if err := proto.SetExtension(ep, ext, nv.Interface()); err != nil {
+ return err
+ }
+ }
+ }
+ }
+ if !u.AllowUnknownFields && len(jsonFields) > 0 {
+ // Pick any field to be the scapegoat.
+ var f string
+ for fname := range jsonFields {
+ f = fname
+ break
+ }
+ return fmt.Errorf("unknown field %q in %v", f, targetType)
+ }
+ return nil
+ }
+
+ // Handle arrays (which aren't encoded bytes)
+ if targetType.Kind() == reflect.Slice && targetType.Elem().Kind() != reflect.Uint8 {
+ var slc []json.RawMessage
+ if err := json.Unmarshal(inputValue, &slc); err != nil {
+ return err
+ }
+ if slc != nil {
+ l := len(slc)
+ target.Set(reflect.MakeSlice(targetType, l, l))
+ for i := 0; i < l; i++ {
+ if err := u.unmarshalValue(target.Index(i), slc[i], prop); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+
+ // Handle maps (whose keys are always strings)
+ if targetType.Kind() == reflect.Map {
+ var mp map[string]json.RawMessage
+ if err := json.Unmarshal(inputValue, &mp); err != nil {
+ return err
+ }
+ if mp != nil {
+ target.Set(reflect.MakeMap(targetType))
+ for ks, raw := range mp {
+ // Unmarshal map key. The core json library already decoded the key into a
+ // string, so we handle that specially. Other types were quoted post-serialization.
+ var k reflect.Value
+ if targetType.Key().Kind() == reflect.String {
+ k = reflect.ValueOf(ks)
+ } else {
+ k = reflect.New(targetType.Key()).Elem()
+ var kprop *proto.Properties
+ if prop != nil && prop.MapKeyProp != nil {
+ kprop = prop.MapKeyProp
+ }
+ if err := u.unmarshalValue(k, json.RawMessage(ks), kprop); err != nil {
+ return err
+ }
+ }
+
+ // Unmarshal map value.
+ v := reflect.New(targetType.Elem()).Elem()
+ var vprop *proto.Properties
+ if prop != nil && prop.MapValProp != nil {
+ vprop = prop.MapValProp
+ }
+ if err := u.unmarshalValue(v, raw, vprop); err != nil {
+ return err
+ }
+ target.SetMapIndex(k, v)
+ }
+ }
+ return nil
+ }
+
+ // Non-finite numbers can be encoded as strings.
+ isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64
+ if isFloat {
+ if num, ok := nonFinite[string(inputValue)]; ok {
+ target.SetFloat(num)
+ return nil
+ }
+ }
+
+ // integers & floats can be encoded as strings. In this case we drop
+ // the quotes and proceed as normal.
+ isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 ||
+ targetType.Kind() == reflect.Int32 || targetType.Kind() == reflect.Uint32 ||
+ targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64
+ if isNum && strings.HasPrefix(string(inputValue), `"`) {
+ inputValue = inputValue[1 : len(inputValue)-1]
+ }
+
+ // Use the encoding/json for parsing other value types.
+ return json.Unmarshal(inputValue, target.Addr().Interface())
+}
+
+func unquote(s string) (string, error) {
+ var ret string
+ err := json.Unmarshal([]byte(s), &ret)
+ return ret, err
+}
+
+// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute.
+func jsonProperties(f reflect.StructField, origName bool) *proto.Properties {
+ var prop proto.Properties
+ prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f)
+ if origName || prop.JSONName == "" {
+ prop.JSONName = prop.OrigName
+ }
+ return &prop
+}
+
+type fieldNames struct {
+ orig, camel string
+}
+
+func acceptedJSONFieldNames(prop *proto.Properties) fieldNames {
+ opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName}
+ if prop.JSONName != "" {
+ opts.camel = prop.JSONName
+ }
+ return opts
+}
+
+// Writer wrapper inspired by https://blog.golang.org/errors-are-values
+type errWriter struct {
+ writer io.Writer
+ err error
+}
+
+func (w *errWriter) write(str string) {
+ if w.err != nil {
+ return
+ }
+ _, w.err = w.writer.Write([]byte(str))
+}
+
+// Map fields may have key types of non-float scalars, strings and enums.
+// The easiest way to sort them in some deterministic order is to use fmt.
+// If this turns out to be inefficient we can always consider other options,
+// such as doing a Schwartzian transform.
+//
+// Numeric keys are sorted in numeric order per
+// https://developers.google.com/protocol-buffers/docs/proto#maps.
+type mapKeys []reflect.Value
+
+func (s mapKeys) Len() int { return len(s) }
+func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+func (s mapKeys) Less(i, j int) bool {
+ if k := s[i].Kind(); k == s[j].Kind() {
+ switch k {
+ case reflect.String:
+ return s[i].String() < s[j].String()
+ case reflect.Int32, reflect.Int64:
+ return s[i].Int() < s[j].Int()
+ case reflect.Uint32, reflect.Uint64:
+ return s[i].Uint() < s[j].Uint()
+ }
+ }
+ return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface())
+}
+
+// checkRequiredFields returns an error if any required field in the given proto message is not set.
+// This function is used by both Marshal and Unmarshal. While required fields only exist in a
+// proto2 message, a proto3 message can contain proto2 message(s).
+func checkRequiredFields(pb proto.Message) error {
+ // Most well-known type messages do not contain required fields. The "Any" type may contain
+ // a message that has required fields.
+ //
+ // When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value
+ // field in order to transform that into JSON, and that should have returned an error if a
+ // required field is not set in the embedded message.
+ //
+ // When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the
+ // embedded message to store the serialized message in Any.Value field, and that should have
+ // returned an error if a required field is not set.
+ if _, ok := pb.(wkt); ok {
+ return nil
+ }
+
+ v := reflect.ValueOf(pb)
+ // Skip message if it is not a struct pointer.
+ if v.Kind() != reflect.Ptr {
+ return nil
+ }
+ v = v.Elem()
+ if v.Kind() != reflect.Struct {
+ return nil
+ }
+
+ for i := 0; i < v.NumField(); i++ {
+ field := v.Field(i)
+ sfield := v.Type().Field(i)
+
+ if sfield.PkgPath != "" {
+ // blank PkgPath means the field is exported; skip if not exported
+ continue
+ }
+
+ if strings.HasPrefix(sfield.Name, "XXX_") {
+ continue
+ }
+
+ // Oneof field is an interface implemented by wrapper structs containing the actual oneof
+ // field, i.e. an interface containing &T{real_value}.
+ if sfield.Tag.Get("protobuf_oneof") != "" {
+ if field.Kind() != reflect.Interface {
+ continue
+ }
+ v := field.Elem()
+ if v.Kind() != reflect.Ptr || v.IsNil() {
+ continue
+ }
+ v = v.Elem()
+ if v.Kind() != reflect.Struct || v.NumField() < 1 {
+ continue
+ }
+ field = v.Field(0)
+ sfield = v.Type().Field(0)
+ }
+
+ protoTag := sfield.Tag.Get("protobuf")
+ if protoTag == "" {
+ continue
+ }
+ var prop proto.Properties
+ prop.Init(sfield.Type, sfield.Name, protoTag, &sfield)
+
+ switch field.Kind() {
+ case reflect.Map:
+ if field.IsNil() {
+ continue
+ }
+ // Check each map value.
+ keys := field.MapKeys()
+ for _, k := range keys {
+ v := field.MapIndex(k)
+ if err := checkRequiredFieldsInValue(v); err != nil {
+ return err
+ }
+ }
+ case reflect.Slice:
+ // Handle non-repeated type, e.g. bytes.
+ if !prop.Repeated {
+ if prop.Required && field.IsNil() {
+ return fmt.Errorf("required field %q is not set", prop.Name)
+ }
+ continue
+ }
+
+ // Handle repeated type.
+ if field.IsNil() {
+ continue
+ }
+ // Check each slice item.
+ for i := 0; i < field.Len(); i++ {
+ v := field.Index(i)
+ if err := checkRequiredFieldsInValue(v); err != nil {
+ return err
+ }
+ }
+ case reflect.Ptr:
+ if field.IsNil() {
+ if prop.Required {
+ return fmt.Errorf("required field %q is not set", prop.Name)
+ }
+ continue
+ }
+ if err := checkRequiredFieldsInValue(field); err != nil {
+ return err
+ }
+ }
+ }
+
+ // Handle proto2 extensions.
+ for _, ext := range proto.RegisteredExtensions(pb) {
+ if !proto.HasExtension(pb, ext) {
+ continue
+ }
+ ep, err := proto.GetExtension(pb, ext)
+ if err != nil {
+ return err
+ }
+ err = checkRequiredFieldsInValue(reflect.ValueOf(ep))
+ if err != nil {
+ return err
+ }
+ }
+
+ return nil
+}
+
+func checkRequiredFieldsInValue(v reflect.Value) error {
+ if pm, ok := v.Interface().(proto.Message); ok {
+ return checkRequiredFields(pm)
+ }
+ return nil
+}
diff --git a/vendor/github.com/golang/protobuf/proto/decode.go b/vendor/github.com/golang/protobuf/proto/decode.go
index d9aa3c42d..63b0f08be 100644
--- a/vendor/github.com/golang/protobuf/proto/decode.go
+++ b/vendor/github.com/golang/protobuf/proto/decode.go
@@ -186,7 +186,6 @@ func (p *Buffer) DecodeVarint() (x uint64, err error) {
if b&0x80 == 0 {
goto done
}
- // x -= 0x80 << 63 // Always zero.
return 0, errOverflow
diff --git a/vendor/github.com/golang/protobuf/proto/deprecated.go b/vendor/github.com/golang/protobuf/proto/deprecated.go
new file mode 100644
index 000000000..35b882c09
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/proto/deprecated.go
@@ -0,0 +1,63 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2018 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// 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 proto
+
+import "errors"
+
+// Deprecated: do not use.
+type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 }
+
+// Deprecated: do not use.
+func GetStats() Stats { return Stats{} }
+
+// Deprecated: do not use.
+func MarshalMessageSet(interface{}) ([]byte, error) {
+ return nil, errors.New("proto: not implemented")
+}
+
+// Deprecated: do not use.
+func UnmarshalMessageSet([]byte, interface{}) error {
+ return errors.New("proto: not implemented")
+}
+
+// Deprecated: do not use.
+func MarshalMessageSetJSON(interface{}) ([]byte, error) {
+ return nil, errors.New("proto: not implemented")
+}
+
+// Deprecated: do not use.
+func UnmarshalMessageSetJSON([]byte, interface{}) error {
+ return errors.New("proto: not implemented")
+}
+
+// Deprecated: do not use.
+func RegisterMessageSetType(Message, int32, string) {}
diff --git a/vendor/github.com/golang/protobuf/proto/encode.go b/vendor/github.com/golang/protobuf/proto/encode.go
index c27d35f86..3abfed2cf 100644
--- a/vendor/github.com/golang/protobuf/proto/encode.go
+++ b/vendor/github.com/golang/protobuf/proto/encode.go
@@ -37,27 +37,9 @@ package proto
import (
"errors"
- "fmt"
"reflect"
)
-// RequiredNotSetError is the error returned if Marshal is called with
-// a protocol buffer struct whose required fields have not
-// all been initialized. It is also the error returned if Unmarshal is
-// called with an encoded protocol buffer that does not include all the
-// required fields.
-//
-// When printed, RequiredNotSetError reports the first unset required field in a
-// message. If the field cannot be precisely determined, it is reported as
-// "{Unknown}".
-type RequiredNotSetError struct {
- field string
-}
-
-func (e *RequiredNotSetError) Error() string {
- return fmt.Sprintf("proto: required field %q not set", e.field)
-}
-
var (
// errRepeatedHasNil is the error returned if Marshal is called with
// a struct with a repeated field containing a nil element.
diff --git a/vendor/github.com/golang/protobuf/proto/equal.go b/vendor/github.com/golang/protobuf/proto/equal.go
index d4db5a1c1..f9b6e41b3 100644
--- a/vendor/github.com/golang/protobuf/proto/equal.go
+++ b/vendor/github.com/golang/protobuf/proto/equal.go
@@ -246,7 +246,8 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
return false
}
- m1, m2 := e1.value, e2.value
+ m1 := extensionAsLegacyType(e1.value)
+ m2 := extensionAsLegacyType(e2.value)
if m1 == nil && m2 == nil {
// Both have only encoded form.
diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go
index 816a3b9d6..fa88add30 100644
--- a/vendor/github.com/golang/protobuf/proto/extensions.go
+++ b/vendor/github.com/golang/protobuf/proto/extensions.go
@@ -185,9 +185,25 @@ type Extension struct {
// extension will have only enc set. When such an extension is
// accessed using GetExtension (or GetExtensions) desc and value
// will be set.
- desc *ExtensionDesc
+ desc *ExtensionDesc
+
+ // value is a concrete value for the extension field. Let the type of
+ // desc.ExtensionType be the "API type" and the type of Extension.value
+ // be the "storage type". The API type and storage type are the same except:
+ // * For scalars (except []byte), the API type uses *T,
+ // while the storage type uses T.
+ // * For repeated fields, the API type uses []T, while the storage type
+ // uses *[]T.
+ //
+ // The reason for the divergence is so that the storage type more naturally
+ // matches what is expected of when retrieving the values through the
+ // protobuf reflection APIs.
+ //
+ // The value may only be populated if desc is also populated.
value interface{}
- enc []byte
+
+ // enc is the raw bytes for the extension field.
+ enc []byte
}
// SetRawExtension is for testing only.
@@ -334,7 +350,7 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
// descriptors with the same field number.
return nil, errors.New("proto: descriptor conflict")
}
- return e.value, nil
+ return extensionAsLegacyType(e.value), nil
}
if extension.ExtensionType == nil {
@@ -349,11 +365,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
// Remember the decoded version and drop the encoded version.
// That way it is safe to mutate what we return.
- e.value = v
+ e.value = extensionAsStorageType(v)
e.desc = extension
e.enc = nil
emap[extension.Field] = e
- return e.value, nil
+ return extensionAsLegacyType(e.value), nil
}
// defaultExtensionValue returns the default value for extension.
@@ -488,7 +504,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
}
typ := reflect.TypeOf(extension.ExtensionType)
if typ != reflect.TypeOf(value) {
- return errors.New("proto: bad extension value type")
+ return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType)
}
// nil extension values need to be caught early, because the
// encoder can't distinguish an ErrNil due to a nil extension
@@ -500,7 +516,7 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
}
extmap := epb.extensionsWrite()
- extmap[extension.Field] = Extension{desc: extension, value: value}
+ extmap[extension.Field] = Extension{desc: extension, value: extensionAsStorageType(value)}
return nil
}
@@ -541,3 +557,51 @@ func RegisterExtension(desc *ExtensionDesc) {
func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc {
return extensionMaps[reflect.TypeOf(pb).Elem()]
}
+
+// extensionAsLegacyType converts an value in the storage type as the API type.
+// See Extension.value.
+func extensionAsLegacyType(v interface{}) interface{} {
+ switch rv := reflect.ValueOf(v); rv.Kind() {
+ case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
+ // Represent primitive types as a pointer to the value.
+ rv2 := reflect.New(rv.Type())
+ rv2.Elem().Set(rv)
+ v = rv2.Interface()
+ case reflect.Ptr:
+ // Represent slice types as the value itself.
+ switch rv.Type().Elem().Kind() {
+ case reflect.Slice:
+ if rv.IsNil() {
+ v = reflect.Zero(rv.Type().Elem()).Interface()
+ } else {
+ v = rv.Elem().Interface()
+ }
+ }
+ }
+ return v
+}
+
+// extensionAsStorageType converts an value in the API type as the storage type.
+// See Extension.value.
+func extensionAsStorageType(v interface{}) interface{} {
+ switch rv := reflect.ValueOf(v); rv.Kind() {
+ case reflect.Ptr:
+ // Represent slice types as the value itself.
+ switch rv.Type().Elem().Kind() {
+ case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String:
+ if rv.IsNil() {
+ v = reflect.Zero(rv.Type().Elem()).Interface()
+ } else {
+ v = rv.Elem().Interface()
+ }
+ }
+ case reflect.Slice:
+ // Represent slice types as a pointer to the value.
+ if rv.Type().Elem().Kind() != reflect.Uint8 {
+ rv2 := reflect.New(rv.Type())
+ rv2.Elem().Set(rv)
+ v = rv2.Interface()
+ }
+ }
+ return v
+}
diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go
index 0e2191b8a..fdd328bb7 100644
--- a/vendor/github.com/golang/protobuf/proto/lib.go
+++ b/vendor/github.com/golang/protobuf/proto/lib.go
@@ -265,7 +265,6 @@ package proto
import (
"encoding/json"
- "errors"
"fmt"
"log"
"reflect"
@@ -274,7 +273,66 @@ import (
"sync"
)
-var errInvalidUTF8 = errors.New("proto: invalid UTF-8 string")
+// RequiredNotSetError is an error type returned by either Marshal or Unmarshal.
+// Marshal reports this when a required field is not initialized.
+// Unmarshal reports this when a required field is missing from the wire data.
+type RequiredNotSetError struct{ field string }
+
+func (e *RequiredNotSetError) Error() string {
+ if e.field == "" {
+ return fmt.Sprintf("proto: required field not set")
+ }
+ return fmt.Sprintf("proto: required field %q not set", e.field)
+}
+func (e *RequiredNotSetError) RequiredNotSet() bool {
+ return true
+}
+
+type invalidUTF8Error struct{ field string }
+
+func (e *invalidUTF8Error) Error() string {
+ if e.field == "" {
+ return "proto: invalid UTF-8 detected"
+ }
+ return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field)
+}
+func (e *invalidUTF8Error) InvalidUTF8() bool {
+ return true
+}
+
+// errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8.
+// This error should not be exposed to the external API as such errors should
+// be recreated with the field information.
+var errInvalidUTF8 = &invalidUTF8Error{}
+
+// isNonFatal reports whether the error is either a RequiredNotSet error
+// or a InvalidUTF8 error.
+func isNonFatal(err error) bool {
+ if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() {
+ return true
+ }
+ if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() {
+ return true
+ }
+ return false
+}
+
+type nonFatal struct{ E error }
+
+// Merge merges err into nf and reports whether it was successful.
+// Otherwise it returns false for any fatal non-nil errors.
+func (nf *nonFatal) Merge(err error) (ok bool) {
+ if err == nil {
+ return true // not an error
+ }
+ if !isNonFatal(err) {
+ return false // fatal error
+ }
+ if nf.E == nil {
+ nf.E = err // store first instance of non-fatal error
+ }
+ return true
+}
// Message is implemented by generated protocol buffer messages.
type Message interface {
@@ -283,26 +341,6 @@ type Message interface {
ProtoMessage()
}
-// Stats records allocation details about the protocol buffer encoders
-// and decoders. Useful for tuning the library itself.
-type Stats struct {
- Emalloc uint64 // mallocs in encode
- Dmalloc uint64 // mallocs in decode
- Encode uint64 // number of encodes
- Decode uint64 // number of decodes
- Chit uint64 // number of cache hits
- Cmiss uint64 // number of cache misses
- Size uint64 // number of sizes
-}
-
-// Set to true to enable stats collection.
-const collectStats = false
-
-var stats Stats
-
-// GetStats returns a copy of the global Stats structure.
-func GetStats() Stats { return stats }
-
// A Buffer is a buffer manager for marshaling and unmarshaling
// protocol buffers. It may be reused between invocations to
// reduce memory usage. It is not necessary to use a Buffer;
@@ -902,13 +940,19 @@ func isProto3Zero(v reflect.Value) bool {
return false
}
-// ProtoPackageIsVersion2 is referenced from generated protocol buffer files
-// to assert that that code is compatible with this version of the proto package.
-const ProtoPackageIsVersion2 = true
+const (
+ // ProtoPackageIsVersion3 is referenced from generated protocol buffer files
+ // to assert that that code is compatible with this version of the proto package.
+ ProtoPackageIsVersion3 = true
-// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
-// to assert that that code is compatible with this version of the proto package.
-const ProtoPackageIsVersion1 = true
+ // ProtoPackageIsVersion2 is referenced from generated protocol buffer files
+ // to assert that that code is compatible with this version of the proto package.
+ ProtoPackageIsVersion2 = true
+
+ // ProtoPackageIsVersion1 is referenced from generated protocol buffer files
+ // to assert that that code is compatible with this version of the proto package.
+ ProtoPackageIsVersion1 = true
+)
// InternalMessageInfo is a type used internally by generated .pb.go files.
// This type is not intended to be used by non-generated code.
diff --git a/vendor/github.com/golang/protobuf/proto/message_set.go b/vendor/github.com/golang/protobuf/proto/message_set.go
index 3b6ca41d5..f48a75676 100644
--- a/vendor/github.com/golang/protobuf/proto/message_set.go
+++ b/vendor/github.com/golang/protobuf/proto/message_set.go
@@ -36,13 +36,7 @@ package proto
*/
import (
- "bytes"
- "encoding/json"
"errors"
- "fmt"
- "reflect"
- "sort"
- "sync"
)
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
@@ -145,46 +139,9 @@ func skipVarint(buf []byte) []byte {
return buf[i+1:]
}
-// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
-// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
-func MarshalMessageSet(exts interface{}) ([]byte, error) {
- return marshalMessageSet(exts, false)
-}
-
-// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal.
-func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) {
- switch exts := exts.(type) {
- case *XXX_InternalExtensions:
- var u marshalInfo
- siz := u.sizeMessageSet(exts)
- b := make([]byte, 0, siz)
- return u.appendMessageSet(b, exts, deterministic)
-
- case map[int32]Extension:
- // This is an old-style extension map.
- // Wrap it in a new-style XXX_InternalExtensions.
- ie := XXX_InternalExtensions{
- p: &struct {
- mu sync.Mutex
- extensionMap map[int32]Extension
- }{
- extensionMap: exts,
- },
- }
-
- var u marshalInfo
- siz := u.sizeMessageSet(&ie)
- b := make([]byte, 0, siz)
- return u.appendMessageSet(b, &ie, deterministic)
-
- default:
- return nil, errors.New("proto: not an extension map")
- }
-}
-
-// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
+// unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
-func UnmarshalMessageSet(buf []byte, exts interface{}) error {
+func unmarshalMessageSet(buf []byte, exts interface{}) error {
var m map[int32]Extension
switch exts := exts.(type) {
case *XXX_InternalExtensions:
@@ -222,93 +179,3 @@ func UnmarshalMessageSet(buf []byte, exts interface{}) error {
}
return nil
}
-
-// MarshalMessageSetJSON encodes the extension map represented by m in JSON format.
-// It is called by generated MarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
-func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
- var m map[int32]Extension
- switch exts := exts.(type) {
- case *XXX_InternalExtensions:
- var mu sync.Locker
- m, mu = exts.extensionsRead()
- if m != nil {
- // Keep the extensions map locked until we're done marshaling to prevent
- // races between marshaling and unmarshaling the lazily-{en,de}coded
- // values.
- mu.Lock()
- defer mu.Unlock()
- }
- case map[int32]Extension:
- m = exts
- default:
- return nil, errors.New("proto: not an extension map")
- }
- var b bytes.Buffer
- b.WriteByte('{')
-
- // Process the map in key order for deterministic output.
- ids := make([]int32, 0, len(m))
- for id := range m {
- ids = append(ids, id)
- }
- sort.Sort(int32Slice(ids)) // int32Slice defined in text.go
-
- for i, id := range ids {
- ext := m[id]
- msd, ok := messageSetMap[id]
- if !ok {
- // Unknown type; we can't render it, so skip it.
- continue
- }
-
- if i > 0 && b.Len() > 1 {
- b.WriteByte(',')
- }
-
- fmt.Fprintf(&b, `"[%s]":`, msd.name)
-
- x := ext.value
- if x == nil {
- x = reflect.New(msd.t.Elem()).Interface()
- if err := Unmarshal(ext.enc, x.(Message)); err != nil {
- return nil, err
- }
- }
- d, err := json.Marshal(x)
- if err != nil {
- return nil, err
- }
- b.Write(d)
- }
- b.WriteByte('}')
- return b.Bytes(), nil
-}
-
-// UnmarshalMessageSetJSON decodes the extension map encoded in buf in JSON format.
-// It is called by generated UnmarshalJSON methods on protocol buffer messages with the message_set_wire_format option.
-func UnmarshalMessageSetJSON(buf []byte, exts interface{}) error {
- // Common-case fast path.
- if len(buf) == 0 || bytes.Equal(buf, []byte("{}")) {
- return nil
- }
-
- // This is fairly tricky, and it's not clear that it is needed.
- return errors.New("TODO: UnmarshalMessageSetJSON not yet implemented")
-}
-
-// A global registry of types that can be used in a MessageSet.
-
-var messageSetMap = make(map[int32]messageSetDesc)
-
-type messageSetDesc struct {
- t reflect.Type // pointer to struct
- name string
-}
-
-// RegisterMessageSetType is called from the generated code.
-func RegisterMessageSetType(m Message, fieldNum int32, name string) {
- messageSetMap[fieldNum] = messageSetDesc{
- t: reflect.TypeOf(m),
- name: name,
- }
-}
diff --git a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
index b6cad9083..94fa9194a 100644
--- a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
+++ b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
@@ -79,10 +79,13 @@ func toPointer(i *Message) pointer {
// toAddrPointer converts an interface to a pointer that points to
// the interface data.
-func toAddrPointer(i *interface{}, isptr bool) pointer {
+func toAddrPointer(i *interface{}, isptr, deref bool) pointer {
v := reflect.ValueOf(*i)
u := reflect.New(v.Type())
u.Elem().Set(v)
+ if deref {
+ u = u.Elem()
+ }
return pointer{v: u}
}
diff --git a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
index d55a335d9..dbfffe071 100644
--- a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
+++ b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
@@ -85,16 +85,21 @@ func toPointer(i *Message) pointer {
// toAddrPointer converts an interface to a pointer that points to
// the interface data.
-func toAddrPointer(i *interface{}, isptr bool) pointer {
+func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) {
// Super-tricky - read or get the address of data word of interface value.
if isptr {
// The interface is of pointer type, thus it is a direct interface.
// The data word is the pointer data itself. We take its address.
- return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
+ p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
+ } else {
+ // The interface is not of pointer type. The data word is the pointer
+ // to the data.
+ p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
}
- // The interface is not of pointer type. The data word is the pointer
- // to the data.
- return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
+ if deref {
+ p.p = *(*unsafe.Pointer)(p.p)
+ }
+ return p
}
// valToPointer converts v to a pointer. v must be of pointer type.
diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go
index f710adab0..a4b8c0cd3 100644
--- a/vendor/github.com/golang/protobuf/proto/properties.go
+++ b/vendor/github.com/golang/protobuf/proto/properties.go
@@ -38,7 +38,6 @@ package proto
import (
"fmt"
"log"
- "os"
"reflect"
"sort"
"strconv"
@@ -139,7 +138,7 @@ type Properties struct {
Repeated bool
Packed bool // relevant for repeated primitives only
Enum string // set for enum types only
- proto3 bool // whether this is known to be a proto3 field; set for []byte only
+ proto3 bool // whether this is known to be a proto3 field
oneof bool // whether this is a oneof field
Default string // default value
@@ -148,9 +147,9 @@ type Properties struct {
stype reflect.Type // set for struct types only
sprop *StructProperties // set for struct types only
- mtype reflect.Type // set for map types only
- mkeyprop *Properties // set for map types only
- mvalprop *Properties // set for map types only
+ mtype reflect.Type // set for map types only
+ MapKeyProp *Properties // set for map types only
+ MapValProp *Properties // set for map types only
}
// String formats the properties in the protobuf struct field tag style.
@@ -194,7 +193,7 @@ func (p *Properties) Parse(s string) {
// "bytes,49,opt,name=foo,def=hello!"
fields := strings.Split(s, ",") // breaks def=, but handled below.
if len(fields) < 2 {
- fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s)
+ log.Printf("proto: tag has too few fields: %q", s)
return
}
@@ -214,7 +213,7 @@ func (p *Properties) Parse(s string) {
p.WireType = WireBytes
// no numeric converter for non-numeric types
default:
- fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s)
+ log.Printf("proto: tag has unknown wire type: %q", s)
return
}
@@ -275,16 +274,16 @@ func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, loc
case reflect.Map:
p.mtype = t1
- p.mkeyprop = &Properties{}
- p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
- p.mvalprop = &Properties{}
+ p.MapKeyProp = &Properties{}
+ p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
+ p.MapValProp = &Properties{}
vtype := p.mtype.Elem()
if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice {
// The value type is not a message (*T) or bytes ([]byte),
// so we need encoders for the pointer to this type.
vtype = reflect.PtrTo(vtype)
}
- p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
+ p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
}
if p.stype != nil {
@@ -334,9 +333,6 @@ func GetProperties(t reflect.Type) *StructProperties {
sprop, ok := propertiesMap[t]
propertiesMu.RUnlock()
if ok {
- if collectStats {
- stats.Chit++
- }
return sprop
}
@@ -346,17 +342,20 @@ func GetProperties(t reflect.Type) *StructProperties {
return sprop
}
+type (
+ oneofFuncsIface interface {
+ XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
+ }
+ oneofWrappersIface interface {
+ XXX_OneofWrappers() []interface{}
+ }
+)
+
// getPropertiesLocked requires that propertiesMu is held.
func getPropertiesLocked(t reflect.Type) *StructProperties {
if prop, ok := propertiesMap[t]; ok {
- if collectStats {
- stats.Chit++
- }
return prop
}
- if collectStats {
- stats.Cmiss++
- }
prop := new(StructProperties)
// in case of recursive protos, fill this in now.
@@ -391,13 +390,14 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
// Re-order prop.order.
sort.Sort(prop)
- type oneofMessage interface {
- XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
+ var oots []interface{}
+ switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
+ case oneofFuncsIface:
+ _, _, _, oots = m.XXX_OneofFuncs()
+ case oneofWrappersIface:
+ oots = m.XXX_OneofWrappers()
}
- if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
- var oots []interface{}
- _, _, _, oots = om.XXX_OneofFuncs()
-
+ if len(oots) > 0 {
// Interpret oneof metadata.
prop.OneofTypes = make(map[string]*OneofProperties)
for _, oot := range oots {
diff --git a/vendor/github.com/golang/protobuf/proto/table_marshal.go b/vendor/github.com/golang/protobuf/proto/table_marshal.go
index 0f212b302..5cb11fa95 100644
--- a/vendor/github.com/golang/protobuf/proto/table_marshal.go
+++ b/vendor/github.com/golang/protobuf/proto/table_marshal.go
@@ -87,6 +87,7 @@ type marshalElemInfo struct {
sizer sizer
marshaler marshaler
isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only)
+ deref bool // dereference the pointer before operating on it; implies isptr
}
var (
@@ -231,7 +232,7 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
return b, err
}
- var err, errreq error
+ var err, errLater error
// The old marshaler encodes extensions at beginning.
if u.extensions.IsValid() {
e := ptr.offset(u.extensions).toExtensions()
@@ -252,11 +253,13 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
}
}
for _, f := range u.fields {
- if f.required && errreq == nil {
+ if f.required {
if ptr.offset(f.field).getPointer().isNil() {
// Required field is not set.
// We record the error but keep going, to give a complete marshaling.
- errreq = &RequiredNotSetError{f.name}
+ if errLater == nil {
+ errLater = &RequiredNotSetError{f.name}
+ }
continue
}
}
@@ -269,14 +272,21 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
if err1, ok := err.(*RequiredNotSetError); ok {
// Required field in submessage is not set.
// We record the error but keep going, to give a complete marshaling.
- if errreq == nil {
- errreq = &RequiredNotSetError{f.name + "." + err1.field}
+ if errLater == nil {
+ errLater = &RequiredNotSetError{f.name + "." + err1.field}
}
continue
}
if err == errRepeatedHasNil {
err = errors.New("proto: repeated field " + f.name + " has nil element")
}
+ if err == errInvalidUTF8 {
+ if errLater == nil {
+ fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
+ errLater = &invalidUTF8Error{fullName}
+ }
+ continue
+ }
return b, err
}
}
@@ -284,7 +294,7 @@ func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte
s := *ptr.offset(u.unrecognized).toBytes()
b = append(b, s...)
}
- return b, errreq
+ return b, errLater
}
// computeMarshalInfo initializes the marshal info.
@@ -311,8 +321,11 @@ func (u *marshalInfo) computeMarshalInfo() {
// get oneof implementers
var oneofImplementers []interface{}
- if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
+ switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
+ case oneofFuncsIface:
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
+ case oneofWrappersIface:
+ oneofImplementers = m.XXX_OneofWrappers()
}
n := t.NumField()
@@ -398,13 +411,22 @@ func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo {
panic("tag is not an integer")
}
wt := wiretype(tags[0])
+ if t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct {
+ t = t.Elem()
+ }
sizer, marshaler := typeMarshaler(t, tags, false, false)
+ var deref bool
+ if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
+ t = reflect.PtrTo(t)
+ deref = true
+ }
e = &marshalElemInfo{
wiretag: uint64(tag)<<3 | wt,
tagsize: SizeVarint(uint64(tag) << 3),
sizer: sizer,
marshaler: marshaler,
isptr: t.Kind() == reflect.Ptr,
+ deref: deref,
}
// update cache
@@ -439,7 +461,7 @@ func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {
func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
fi.field = toField(f)
- fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
+ fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
fi.isPointer = true
fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
@@ -467,10 +489,6 @@ func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofI
}
}
-type oneofMessage interface {
- XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
-}
-
// wiretype returns the wire encoding of the type.
func wiretype(encoding string) uint64 {
switch encoding {
@@ -530,6 +548,7 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
packed := false
proto3 := false
+ validateUTF8 := true
for i := 2; i < len(tags); i++ {
if tags[i] == "packed" {
packed = true
@@ -538,6 +557,7 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
proto3 = true
}
}
+ validateUTF8 = validateUTF8 && proto3
switch t.Kind() {
case reflect.Bool:
@@ -735,6 +755,18 @@ func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, ma
}
return sizeFloat64Value, appendFloat64Value
case reflect.String:
+ if validateUTF8 {
+ if pointer {
+ return sizeStringPtr, appendUTF8StringPtr
+ }
+ if slice {
+ return sizeStringSlice, appendUTF8StringSlice
+ }
+ if nozero {
+ return sizeStringValueNoZero, appendUTF8StringValueNoZero
+ }
+ return sizeStringValue, appendUTF8StringValue
+ }
if pointer {
return sizeStringPtr, appendStringPtr
}
@@ -1984,9 +2016,6 @@ func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byt
}
func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
v := *ptr.toString()
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
b = appendVarint(b, wiretag)
b = appendVarint(b, uint64(len(v)))
b = append(b, v...)
@@ -1997,9 +2026,6 @@ func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]b
if v == "" {
return b, nil
}
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
b = appendVarint(b, wiretag)
b = appendVarint(b, uint64(len(v)))
b = append(b, v...)
@@ -2011,24 +2037,83 @@ func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, err
return b, nil
}
v := *p
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
b = appendVarint(b, wiretag)
b = appendVarint(b, uint64(len(v)))
b = append(b, v...)
return b, nil
}
func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toStringSlice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ }
+ return b, nil
+}
+func appendUTF8StringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ var invalidUTF8 bool
+ v := *ptr.toString()
+ if !utf8.ValidString(v) {
+ invalidUTF8 = true
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ if invalidUTF8 {
+ return b, errInvalidUTF8
+ }
+ return b, nil
+}
+func appendUTF8StringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ var invalidUTF8 bool
+ v := *ptr.toString()
+ if v == "" {
+ return b, nil
+ }
+ if !utf8.ValidString(v) {
+ invalidUTF8 = true
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ if invalidUTF8 {
+ return b, errInvalidUTF8
+ }
+ return b, nil
+}
+func appendUTF8StringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ var invalidUTF8 bool
+ p := *ptr.toStringPtr()
+ if p == nil {
+ return b, nil
+ }
+ v := *p
+ if !utf8.ValidString(v) {
+ invalidUTF8 = true
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ if invalidUTF8 {
+ return b, errInvalidUTF8
+ }
+ return b, nil
+}
+func appendUTF8StringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ var invalidUTF8 bool
s := *ptr.toStringSlice()
for _, v := range s {
if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
+ invalidUTF8 = true
}
b = appendVarint(b, wiretag)
b = appendVarint(b, uint64(len(v)))
b = append(b, v...)
}
+ if invalidUTF8 {
+ return b, errInvalidUTF8
+ }
return b, nil
}
func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
@@ -2107,7 +2192,8 @@ func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
},
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
s := ptr.getPointerSlice()
- var err, errreq error
+ var err error
+ var nerr nonFatal
for _, v := range s {
if v.isNil() {
return b, errRepeatedHasNil
@@ -2115,22 +2201,14 @@ func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
b = appendVarint(b, wiretag) // start group
b, err = u.marshal(b, v, deterministic)
b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
- if err != nil {
- if _, ok := err.(*RequiredNotSetError); ok {
- // Required field in submessage is not set.
- // We record the error but keep going, to give a complete marshaling.
- if errreq == nil {
- errreq = err
- }
- continue
- }
+ if !nerr.Merge(err) {
if err == ErrNil {
err = errRepeatedHasNil
}
return b, err
}
}
- return b, errreq
+ return b, nerr.E
}
}
@@ -2174,7 +2252,8 @@ func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
},
func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
s := ptr.getPointerSlice()
- var err, errreq error
+ var err error
+ var nerr nonFatal
for _, v := range s {
if v.isNil() {
return b, errRepeatedHasNil
@@ -2184,22 +2263,14 @@ func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
b = appendVarint(b, uint64(siz))
b, err = u.marshal(b, v, deterministic)
- if err != nil {
- if _, ok := err.(*RequiredNotSetError); ok {
- // Required field in submessage is not set.
- // We record the error but keep going, to give a complete marshaling.
- if errreq == nil {
- errreq = err
- }
- continue
- }
+ if !nerr.Merge(err) {
if err == ErrNil {
err = errRepeatedHasNil
}
return b, err
}
}
- return b, errreq
+ return b, nerr.E
}
}
@@ -2223,14 +2294,33 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
// value.
// Key cannot be pointer-typed.
valIsPtr := valType.Kind() == reflect.Ptr
+
+ // If value is a message with nested maps, calling
+ // valSizer in marshal may be quadratic. We should use
+ // cached version in marshal (but not in size).
+ // If value is not message type, we don't have size cache,
+ // but it cannot be nested either. Just use valSizer.
+ valCachedSizer := valSizer
+ if valIsPtr && valType.Elem().Kind() == reflect.Struct {
+ u := getMarshalInfo(valType.Elem())
+ valCachedSizer = func(ptr pointer, tagsize int) int {
+ // Same as message sizer, but use cache.
+ p := ptr.getPointer()
+ if p.isNil() {
+ return 0
+ }
+ siz := u.cachedsize(p)
+ return siz + SizeVarint(uint64(siz)) + tagsize
+ }
+ }
return func(ptr pointer, tagsize int) int {
m := ptr.asPointerTo(t).Elem() // the map
n := 0
for _, k := range m.MapKeys() {
ki := k.Interface()
vi := m.MapIndex(k).Interface()
- kaddr := toAddrPointer(&ki, false) // pointer to key
- vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
+ kaddr := toAddrPointer(&ki, false, false) // pointer to key
+ vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value
siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
n += siz + SizeVarint(uint64(siz)) + tagsize
}
@@ -2243,24 +2333,26 @@ func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
if len(keys) > 1 && deterministic {
sort.Sort(mapKeys(keys))
}
+
+ var nerr nonFatal
for _, k := range keys {
ki := k.Interface()
vi := m.MapIndex(k).Interface()
- kaddr := toAddrPointer(&ki, false) // pointer to key
- vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
+ kaddr := toAddrPointer(&ki, false, false) // pointer to key
+ vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value
b = appendVarint(b, tag)
- siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
+ siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
b = appendVarint(b, uint64(siz))
b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
b, err = valMarshaler(b, vaddr, valWireTag, deterministic)
- if err != nil && err != ErrNil { // allow nil value in map
+ if err != ErrNil && !nerr.Merge(err) { // allow nil value in map
return b, err
}
}
- return b, nil
+ return b, nerr.E
}
}
@@ -2316,7 +2408,7 @@ func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int {
// the last time this function was called.
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
n += ei.sizer(p, ei.tagsize)
}
mu.Unlock()
@@ -2333,6 +2425,7 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
defer mu.Unlock()
var err error
+ var nerr nonFatal
// Fast-path for common cases: zero or one extensions.
// Don't bother sorting the keys.
@@ -2350,13 +2443,13 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
}
- return b, nil
+ return b, nerr.E
}
// Sort the keys to provide a deterministic encoding.
@@ -2381,13 +2474,13 @@ func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, de
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
}
- return b, nil
+ return b, nerr.E
}
// message set format is:
@@ -2426,7 +2519,7 @@ func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int {
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
n += ei.sizer(p, 1) // message, tag = 3 (size=1)
}
mu.Unlock()
@@ -2444,6 +2537,7 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
defer mu.Unlock()
var err error
+ var nerr nonFatal
// Fast-path for common cases: zero or one extensions.
// Don't bother sorting the keys.
@@ -2468,14 +2562,14 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
b = append(b, 1<<3|WireEndGroup)
}
- return b, nil
+ return b, nerr.E
}
// Sort the keys to provide a deterministic encoding.
@@ -2506,14 +2600,14 @@ func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, de
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
b = append(b, 1<<3|WireEndGroup)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
}
- return b, nil
+ return b, nerr.E
}
// sizeV1Extensions computes the size of encoded data for a V1-API extension field.
@@ -2536,7 +2630,7 @@ func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int {
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
n += ei.sizer(p, ei.tagsize)
}
return n
@@ -2556,6 +2650,7 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ
sort.Ints(keys)
var err error
+ var nerr nonFatal
for _, k := range keys {
e := m[int32(k)]
if e.value == nil || e.desc == nil {
@@ -2570,13 +2665,13 @@ func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, determ
ei := u.getExtElemInfo(e.desc)
v := e.value
- p := toAddrPointer(&v, ei.isptr)
+ p := toAddrPointer(&v, ei.isptr, ei.deref)
b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
- if err != nil {
+ if !nerr.Merge(err) {
return b, err
}
}
- return b, nil
+ return b, nerr.E
}
// newMarshaler is the interface representing objects that can marshal themselves.
diff --git a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go
index 55f0340a3..acee2fc52 100644
--- a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go
+++ b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go
@@ -97,6 +97,8 @@ type unmarshalFieldInfo struct {
// if a required field, contains a single set bit at this field's index in the required field list.
reqMask uint64
+
+ name string // name of the field, for error reporting
}
var (
@@ -134,10 +136,10 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
u.computeUnmarshalInfo()
}
if u.isMessageSet {
- return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
+ return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
}
- var reqMask uint64 // bitmask of required fields we've seen.
- var rnse *RequiredNotSetError // an instance of a RequiredNotSetError returned by a submessage.
+ var reqMask uint64 // bitmask of required fields we've seen.
+ var errLater error
for len(b) > 0 {
// Read tag and wire type.
// Special case 1 and 2 byte varints.
@@ -176,11 +178,20 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
if r, ok := err.(*RequiredNotSetError); ok {
// Remember this error, but keep parsing. We need to produce
// a full parse even if a required field is missing.
- rnse = r
+ if errLater == nil {
+ errLater = r
+ }
reqMask |= f.reqMask
continue
}
if err != errInternalBadWireType {
+ if err == errInvalidUTF8 {
+ if errLater == nil {
+ fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
+ errLater = &invalidUTF8Error{fullName}
+ }
+ continue
+ }
return err
}
// Fragments with bad wire type are treated as unknown fields.
@@ -239,20 +250,16 @@ func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
emap[int32(tag)] = e
}
}
- if rnse != nil {
- // A required field of a submessage/group is missing. Return that error.
- return rnse
- }
- if reqMask != u.reqMask {
+ if reqMask != u.reqMask && errLater == nil {
// A required field of this message is missing.
for _, n := range u.reqFields {
if reqMask&1 == 0 {
- return &RequiredNotSetError{n}
+ errLater = &RequiredNotSetError{n}
}
reqMask >>= 1
}
}
- return nil
+ return errLater
}
// computeUnmarshalInfo fills in u with information for use
@@ -351,43 +358,52 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
}
// Store the info in the correct slot in the message.
- u.setTag(tag, toField(&f), unmarshal, reqMask)
+ u.setTag(tag, toField(&f), unmarshal, reqMask, name)
}
// Find any types associated with oneof fields.
- // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it?
- fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs")
- if fn.IsValid() {
- res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{}
- for i := res.Len() - 1; i >= 0; i-- {
- v := res.Index(i) // interface{}
- tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X
- typ := tptr.Elem() // Msg_X
+ var oneofImplementers []interface{}
+ switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
+ case oneofFuncsIface:
+ _, _, _, oneofImplementers = m.XXX_OneofFuncs()
+ case oneofWrappersIface:
+ oneofImplementers = m.XXX_OneofWrappers()
+ }
+ for _, v := range oneofImplementers {
+ tptr := reflect.TypeOf(v) // *Msg_X
+ typ := tptr.Elem() // Msg_X
- f := typ.Field(0) // oneof implementers have one field
- baseUnmarshal := fieldUnmarshaler(&f)
- tagstr := strings.Split(f.Tag.Get("protobuf"), ",")[1]
- tag, err := strconv.Atoi(tagstr)
- if err != nil {
- panic("protobuf tag field not an integer: " + tagstr)
- }
-
- // Find the oneof field that this struct implements.
- // Might take O(n^2) to process all of the oneofs, but who cares.
- for _, of := range oneofFields {
- if tptr.Implements(of.ityp) {
- // We have found the corresponding interface for this struct.
- // That lets us know where this struct should be stored
- // when we encounter it during unmarshaling.
- unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
- u.setTag(tag, of.field, unmarshal, 0)
- }
+ f := typ.Field(0) // oneof implementers have one field
+ baseUnmarshal := fieldUnmarshaler(&f)
+ tags := strings.Split(f.Tag.Get("protobuf"), ",")
+ fieldNum, err := strconv.Atoi(tags[1])
+ if err != nil {
+ panic("protobuf tag field not an integer: " + tags[1])
+ }
+ var name string
+ for _, tag := range tags {
+ if strings.HasPrefix(tag, "name=") {
+ name = strings.TrimPrefix(tag, "name=")
+ break
}
}
+
+ // Find the oneof field that this struct implements.
+ // Might take O(n^2) to process all of the oneofs, but who cares.
+ for _, of := range oneofFields {
+ if tptr.Implements(of.ityp) {
+ // We have found the corresponding interface for this struct.
+ // That lets us know where this struct should be stored
+ // when we encounter it during unmarshaling.
+ unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
+ u.setTag(fieldNum, of.field, unmarshal, 0, name)
+ }
+ }
+
}
// Get extension ranges, if any.
- fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
+ fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
if fn.IsValid() {
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() {
panic("a message with extensions, but no extensions field in " + t.Name())
@@ -401,7 +417,7 @@ func (u *unmarshalInfo) computeUnmarshalInfo() {
// [0 0] is [tag=0/wiretype=varint varint-encoded-0].
u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
- }, 0)
+ }, 0, "")
// Set mask for required field check.
u.reqMask = uint64(1)<= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
for len(u.dense) <= tag {
@@ -442,11 +459,17 @@ func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
tagArray := strings.Split(tags, ",")
encoding := tagArray[0]
name := "unknown"
+ proto3 := false
+ validateUTF8 := true
for _, tag := range tagArray[3:] {
if strings.HasPrefix(tag, "name=") {
name = tag[5:]
}
+ if tag == "proto3" {
+ proto3 = true
+ }
}
+ validateUTF8 = validateUTF8 && proto3
// Figure out packaging (pointer, slice, or both)
slice := false
@@ -594,6 +617,15 @@ func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
}
return unmarshalBytesValue
case reflect.String:
+ if validateUTF8 {
+ if pointer {
+ return unmarshalUTF8StringPtr
+ }
+ if slice {
+ return unmarshalUTF8StringSlice
+ }
+ return unmarshalUTF8StringValue
+ }
if pointer {
return unmarshalStringPtr
}
@@ -1448,9 +1480,6 @@ func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
*f.toString() = v
return b[x:], nil
}
@@ -1468,9 +1497,6 @@ func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
*f.toStringPtr() = &v
return b[x:], nil
}
@@ -1488,14 +1514,72 @@ func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
- if !utf8.ValidString(v) {
- return nil, errInvalidUTF8
- }
s := f.toStringSlice()
*s = append(*s, v)
return b[x:], nil
}
+func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ *f.toString() = v
+ if !utf8.ValidString(v) {
+ return b[x:], errInvalidUTF8
+ }
+ return b[x:], nil
+}
+
+func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ *f.toStringPtr() = &v
+ if !utf8.ValidString(v) {
+ return b[x:], errInvalidUTF8
+ }
+ return b[x:], nil
+}
+
+func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ s := f.toStringSlice()
+ *s = append(*s, v)
+ if !utf8.ValidString(v) {
+ return b[x:], errInvalidUTF8
+ }
+ return b[x:], nil
+}
+
var emptyBuf [0]byte
func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
@@ -1674,6 +1758,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
// Maps will be somewhat slow. Oh well.
// Read key and value from data.
+ var nerr nonFatal
k := reflect.New(kt)
v := reflect.New(vt)
for len(b) > 0 {
@@ -1694,7 +1779,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
err = errInternalBadWireType // skip unknown tag
}
- if err == nil {
+ if nerr.Merge(err) {
continue
}
if err != errInternalBadWireType {
@@ -1717,7 +1802,7 @@ func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
// Insert into map.
m.SetMapIndex(k.Elem(), v.Elem())
- return r, nil
+ return r, nerr.E
}
}
@@ -1743,15 +1828,16 @@ func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshal
// Unmarshal data into holder.
// We unmarshal into the first field of the holder object.
var err error
+ var nerr nonFatal
b, err = unmarshal(b, valToPointer(v).offset(field0), w)
- if err != nil {
+ if !nerr.Merge(err) {
return nil, err
}
// Write pointer to holder into target field.
f.asPointerTo(ityp).Elem().Set(v)
- return b, nil
+ return b, nerr.E
}
}
@@ -1864,7 +1950,7 @@ func encodeVarint(b []byte, x uint64) []byte {
// If there is an error, it returns 0,0.
func decodeVarint(b []byte) (uint64, int) {
var x, y uint64
- if len(b) <= 0 {
+ if len(b) == 0 {
goto bad
}
x = uint64(b[0])
diff --git a/vendor/github.com/golang/protobuf/proto/text.go b/vendor/github.com/golang/protobuf/proto/text.go
index 2205fdaad..1aaee725b 100644
--- a/vendor/github.com/golang/protobuf/proto/text.go
+++ b/vendor/github.com/golang/protobuf/proto/text.go
@@ -353,7 +353,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return err
}
}
- if err := tm.writeAny(w, key, props.mkeyprop); err != nil {
+ if err := tm.writeAny(w, key, props.MapKeyProp); err != nil {
return err
}
if err := w.WriteByte('\n'); err != nil {
@@ -370,7 +370,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return err
}
}
- if err := tm.writeAny(w, val, props.mvalprop); err != nil {
+ if err := tm.writeAny(w, val, props.MapValProp); err != nil {
return err
}
if err := w.WriteByte('\n'); err != nil {
diff --git a/vendor/github.com/golang/protobuf/proto/text_parser.go b/vendor/github.com/golang/protobuf/proto/text_parser.go
index 0685bae36..bb55a3af2 100644
--- a/vendor/github.com/golang/protobuf/proto/text_parser.go
+++ b/vendor/github.com/golang/protobuf/proto/text_parser.go
@@ -630,17 +630,17 @@ func (p *textParser) readStruct(sv reflect.Value, terminator string) error {
if err := p.consumeToken(":"); err != nil {
return err
}
- if err := p.readAny(key, props.mkeyprop); err != nil {
+ if err := p.readAny(key, props.MapKeyProp); err != nil {
return err
}
if err := p.consumeOptionalSeparator(); err != nil {
return err
}
case "value":
- if err := p.checkForColon(props.mvalprop, dst.Type().Elem()); err != nil {
+ if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil {
return err
}
- if err := p.readAny(val, props.mvalprop); err != nil {
+ if err := p.readAny(val, props.MapValProp); err != nil {
return err
}
if err := p.consumeOptionalSeparator(); err != nil {
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
new file mode 100644
index 000000000..1ded05bbe
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
@@ -0,0 +1,2887 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/protobuf/descriptor.proto
+
+package descriptor
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type FieldDescriptorProto_Type int32
+
+const (
+ // 0 is reserved for errors.
+ // Order is weird for historical reasons.
+ FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1
+ FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if
+ // negative values are likely.
+ FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3
+ FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4
+ // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if
+ // negative values are likely.
+ FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5
+ FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6
+ FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7
+ FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8
+ FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9
+ // Tag-delimited aggregate.
+ // Group type is deprecated and not supported in proto3. However, Proto3
+ // implementations should still be able to parse the group wire format and
+ // treat group fields as unknown fields.
+ FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10
+ FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11
+ // New in version 2.
+ FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12
+ FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13
+ FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14
+ FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15
+ FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16
+ FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17
+ FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18
+)
+
+var FieldDescriptorProto_Type_name = map[int32]string{
+ 1: "TYPE_DOUBLE",
+ 2: "TYPE_FLOAT",
+ 3: "TYPE_INT64",
+ 4: "TYPE_UINT64",
+ 5: "TYPE_INT32",
+ 6: "TYPE_FIXED64",
+ 7: "TYPE_FIXED32",
+ 8: "TYPE_BOOL",
+ 9: "TYPE_STRING",
+ 10: "TYPE_GROUP",
+ 11: "TYPE_MESSAGE",
+ 12: "TYPE_BYTES",
+ 13: "TYPE_UINT32",
+ 14: "TYPE_ENUM",
+ 15: "TYPE_SFIXED32",
+ 16: "TYPE_SFIXED64",
+ 17: "TYPE_SINT32",
+ 18: "TYPE_SINT64",
+}
+
+var FieldDescriptorProto_Type_value = map[string]int32{
+ "TYPE_DOUBLE": 1,
+ "TYPE_FLOAT": 2,
+ "TYPE_INT64": 3,
+ "TYPE_UINT64": 4,
+ "TYPE_INT32": 5,
+ "TYPE_FIXED64": 6,
+ "TYPE_FIXED32": 7,
+ "TYPE_BOOL": 8,
+ "TYPE_STRING": 9,
+ "TYPE_GROUP": 10,
+ "TYPE_MESSAGE": 11,
+ "TYPE_BYTES": 12,
+ "TYPE_UINT32": 13,
+ "TYPE_ENUM": 14,
+ "TYPE_SFIXED32": 15,
+ "TYPE_SFIXED64": 16,
+ "TYPE_SINT32": 17,
+ "TYPE_SINT64": 18,
+}
+
+func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type {
+ p := new(FieldDescriptorProto_Type)
+ *p = x
+ return p
+}
+
+func (x FieldDescriptorProto_Type) String() string {
+ return proto.EnumName(FieldDescriptorProto_Type_name, int32(x))
+}
+
+func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type")
+ if err != nil {
+ return err
+ }
+ *x = FieldDescriptorProto_Type(value)
+ return nil
+}
+
+func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{4, 0}
+}
+
+type FieldDescriptorProto_Label int32
+
+const (
+ // 0 is reserved for errors
+ FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1
+ FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2
+ FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3
+)
+
+var FieldDescriptorProto_Label_name = map[int32]string{
+ 1: "LABEL_OPTIONAL",
+ 2: "LABEL_REQUIRED",
+ 3: "LABEL_REPEATED",
+}
+
+var FieldDescriptorProto_Label_value = map[string]int32{
+ "LABEL_OPTIONAL": 1,
+ "LABEL_REQUIRED": 2,
+ "LABEL_REPEATED": 3,
+}
+
+func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label {
+ p := new(FieldDescriptorProto_Label)
+ *p = x
+ return p
+}
+
+func (x FieldDescriptorProto_Label) String() string {
+ return proto.EnumName(FieldDescriptorProto_Label_name, int32(x))
+}
+
+func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label")
+ if err != nil {
+ return err
+ }
+ *x = FieldDescriptorProto_Label(value)
+ return nil
+}
+
+func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{4, 1}
+}
+
+// Generated classes can be optimized for speed or code size.
+type FileOptions_OptimizeMode int32
+
+const (
+ FileOptions_SPEED FileOptions_OptimizeMode = 1
+ // etc.
+ FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2
+ FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3
+)
+
+var FileOptions_OptimizeMode_name = map[int32]string{
+ 1: "SPEED",
+ 2: "CODE_SIZE",
+ 3: "LITE_RUNTIME",
+}
+
+var FileOptions_OptimizeMode_value = map[string]int32{
+ "SPEED": 1,
+ "CODE_SIZE": 2,
+ "LITE_RUNTIME": 3,
+}
+
+func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode {
+ p := new(FileOptions_OptimizeMode)
+ *p = x
+ return p
+}
+
+func (x FileOptions_OptimizeMode) String() string {
+ return proto.EnumName(FileOptions_OptimizeMode_name, int32(x))
+}
+
+func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode")
+ if err != nil {
+ return err
+ }
+ *x = FileOptions_OptimizeMode(value)
+ return nil
+}
+
+func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{10, 0}
+}
+
+type FieldOptions_CType int32
+
+const (
+ // Default mode.
+ FieldOptions_STRING FieldOptions_CType = 0
+ FieldOptions_CORD FieldOptions_CType = 1
+ FieldOptions_STRING_PIECE FieldOptions_CType = 2
+)
+
+var FieldOptions_CType_name = map[int32]string{
+ 0: "STRING",
+ 1: "CORD",
+ 2: "STRING_PIECE",
+}
+
+var FieldOptions_CType_value = map[string]int32{
+ "STRING": 0,
+ "CORD": 1,
+ "STRING_PIECE": 2,
+}
+
+func (x FieldOptions_CType) Enum() *FieldOptions_CType {
+ p := new(FieldOptions_CType)
+ *p = x
+ return p
+}
+
+func (x FieldOptions_CType) String() string {
+ return proto.EnumName(FieldOptions_CType_name, int32(x))
+}
+
+func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType")
+ if err != nil {
+ return err
+ }
+ *x = FieldOptions_CType(value)
+ return nil
+}
+
+func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{12, 0}
+}
+
+type FieldOptions_JSType int32
+
+const (
+ // Use the default type.
+ FieldOptions_JS_NORMAL FieldOptions_JSType = 0
+ // Use JavaScript strings.
+ FieldOptions_JS_STRING FieldOptions_JSType = 1
+ // Use JavaScript numbers.
+ FieldOptions_JS_NUMBER FieldOptions_JSType = 2
+)
+
+var FieldOptions_JSType_name = map[int32]string{
+ 0: "JS_NORMAL",
+ 1: "JS_STRING",
+ 2: "JS_NUMBER",
+}
+
+var FieldOptions_JSType_value = map[string]int32{
+ "JS_NORMAL": 0,
+ "JS_STRING": 1,
+ "JS_NUMBER": 2,
+}
+
+func (x FieldOptions_JSType) Enum() *FieldOptions_JSType {
+ p := new(FieldOptions_JSType)
+ *p = x
+ return p
+}
+
+func (x FieldOptions_JSType) String() string {
+ return proto.EnumName(FieldOptions_JSType_name, int32(x))
+}
+
+func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType")
+ if err != nil {
+ return err
+ }
+ *x = FieldOptions_JSType(value)
+ return nil
+}
+
+func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{12, 1}
+}
+
+// Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
+// or neither? HTTP based RPC implementation may choose GET verb for safe
+// methods, and PUT verb for idempotent methods instead of the default POST.
+type MethodOptions_IdempotencyLevel int32
+
+const (
+ MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0
+ MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1
+ MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2
+)
+
+var MethodOptions_IdempotencyLevel_name = map[int32]string{
+ 0: "IDEMPOTENCY_UNKNOWN",
+ 1: "NO_SIDE_EFFECTS",
+ 2: "IDEMPOTENT",
+}
+
+var MethodOptions_IdempotencyLevel_value = map[string]int32{
+ "IDEMPOTENCY_UNKNOWN": 0,
+ "NO_SIDE_EFFECTS": 1,
+ "IDEMPOTENT": 2,
+}
+
+func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel {
+ p := new(MethodOptions_IdempotencyLevel)
+ *p = x
+ return p
+}
+
+func (x MethodOptions_IdempotencyLevel) String() string {
+ return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x))
+}
+
+func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error {
+ value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel")
+ if err != nil {
+ return err
+ }
+ *x = MethodOptions_IdempotencyLevel(value)
+ return nil
+}
+
+func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{17, 0}
+}
+
+// The protocol compiler can output a FileDescriptorSet containing the .proto
+// files it parses.
+type FileDescriptorSet struct {
+ File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} }
+func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) }
+func (*FileDescriptorSet) ProtoMessage() {}
+func (*FileDescriptorSet) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{0}
+}
+
+func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b)
+}
+func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic)
+}
+func (m *FileDescriptorSet) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FileDescriptorSet.Merge(m, src)
+}
+func (m *FileDescriptorSet) XXX_Size() int {
+ return xxx_messageInfo_FileDescriptorSet.Size(m)
+}
+func (m *FileDescriptorSet) XXX_DiscardUnknown() {
+ xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo
+
+func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto {
+ if m != nil {
+ return m.File
+ }
+ return nil
+}
+
+// Describes a complete .proto file.
+type FileDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"`
+ // Names of files imported by this file.
+ Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"`
+ // Indexes of the public imported files in the dependency list above.
+ PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"`
+ // Indexes of the weak imported files in the dependency list.
+ // For Google-internal migration only. Do not use.
+ WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"`
+ // All top-level definitions in this file.
+ MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"`
+ EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
+ Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"`
+ Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"`
+ Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
+ // This field contains optional information about the original source code.
+ // You may safely remove this entire field without harming runtime
+ // functionality of the descriptors -- the information is needed only by
+ // development tools.
+ SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"`
+ // The syntax of the proto file.
+ // The supported values are "proto2" and "proto3".
+ Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} }
+func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*FileDescriptorProto) ProtoMessage() {}
+func (*FileDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{1}
+}
+
+func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b)
+}
+func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *FileDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FileDescriptorProto.Merge(m, src)
+}
+func (m *FileDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_FileDescriptorProto.Size(m)
+}
+func (m *FileDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo
+
+func (m *FileDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *FileDescriptorProto) GetPackage() string {
+ if m != nil && m.Package != nil {
+ return *m.Package
+ }
+ return ""
+}
+
+func (m *FileDescriptorProto) GetDependency() []string {
+ if m != nil {
+ return m.Dependency
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetPublicDependency() []int32 {
+ if m != nil {
+ return m.PublicDependency
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetWeakDependency() []int32 {
+ if m != nil {
+ return m.WeakDependency
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto {
+ if m != nil {
+ return m.MessageType
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto {
+ if m != nil {
+ return m.EnumType
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto {
+ if m != nil {
+ return m.Service
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto {
+ if m != nil {
+ return m.Extension
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetOptions() *FileOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo {
+ if m != nil {
+ return m.SourceCodeInfo
+ }
+ return nil
+}
+
+func (m *FileDescriptorProto) GetSyntax() string {
+ if m != nil && m.Syntax != nil {
+ return *m.Syntax
+ }
+ return ""
+}
+
+// Describes a message type.
+type DescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"`
+ Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"`
+ NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"`
+ EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"`
+ ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"`
+ OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"`
+ Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"`
+ ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
+ // Reserved field names, which may not be used by fields in the same message.
+ // A given name may only be reserved once.
+ ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DescriptorProto) Reset() { *m = DescriptorProto{} }
+func (m *DescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*DescriptorProto) ProtoMessage() {}
+func (*DescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{2}
+}
+
+func (m *DescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DescriptorProto.Unmarshal(m, b)
+}
+func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *DescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DescriptorProto.Merge(m, src)
+}
+func (m *DescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_DescriptorProto.Size(m)
+}
+func (m *DescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_DescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo
+
+func (m *DescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *DescriptorProto) GetField() []*FieldDescriptorProto {
+ if m != nil {
+ return m.Field
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto {
+ if m != nil {
+ return m.Extension
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetNestedType() []*DescriptorProto {
+ if m != nil {
+ return m.NestedType
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto {
+ if m != nil {
+ return m.EnumType
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange {
+ if m != nil {
+ return m.ExtensionRange
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto {
+ if m != nil {
+ return m.OneofDecl
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetOptions() *MessageOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange {
+ if m != nil {
+ return m.ReservedRange
+ }
+ return nil
+}
+
+func (m *DescriptorProto) GetReservedName() []string {
+ if m != nil {
+ return m.ReservedName
+ }
+ return nil
+}
+
+type DescriptorProto_ExtensionRange struct {
+ Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
+ End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
+ Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} }
+func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) }
+func (*DescriptorProto_ExtensionRange) ProtoMessage() {}
+func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{2, 0}
+}
+
+func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b)
+}
+func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic)
+}
+func (m *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(m, src)
+}
+func (m *DescriptorProto_ExtensionRange) XXX_Size() int {
+ return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m)
+}
+func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() {
+ xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo
+
+func (m *DescriptorProto_ExtensionRange) GetStart() int32 {
+ if m != nil && m.Start != nil {
+ return *m.Start
+ }
+ return 0
+}
+
+func (m *DescriptorProto_ExtensionRange) GetEnd() int32 {
+ if m != nil && m.End != nil {
+ return *m.End
+ }
+ return 0
+}
+
+func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+// Range of reserved tag numbers. Reserved tag numbers may not be used by
+// fields or extension ranges in the same message. Reserved ranges may
+// not overlap.
+type DescriptorProto_ReservedRange struct {
+ Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
+ End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} }
+func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) }
+func (*DescriptorProto_ReservedRange) ProtoMessage() {}
+func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{2, 1}
+}
+
+func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b)
+}
+func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic)
+}
+func (m *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DescriptorProto_ReservedRange.Merge(m, src)
+}
+func (m *DescriptorProto_ReservedRange) XXX_Size() int {
+ return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m)
+}
+func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() {
+ xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo
+
+func (m *DescriptorProto_ReservedRange) GetStart() int32 {
+ if m != nil && m.Start != nil {
+ return *m.Start
+ }
+ return 0
+}
+
+func (m *DescriptorProto_ReservedRange) GetEnd() int32 {
+ if m != nil && m.End != nil {
+ return *m.End
+ }
+ return 0
+}
+
+type ExtensionRangeOptions struct {
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} }
+func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) }
+func (*ExtensionRangeOptions) ProtoMessage() {}
+func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{3}
+}
+
+var extRange_ExtensionRangeOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_ExtensionRangeOptions
+}
+
+func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b)
+}
+func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic)
+}
+func (m *ExtensionRangeOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ExtensionRangeOptions.Merge(m, src)
+}
+func (m *ExtensionRangeOptions) XXX_Size() int {
+ return xxx_messageInfo_ExtensionRangeOptions.Size(m)
+}
+func (m *ExtensionRangeOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo
+
+func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+// Describes a field within a message.
+type FieldDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"`
+ Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"`
+ // If type_name is set, this need not be set. If both this and type_name
+ // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
+ Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"`
+ // For message and enum types, this is the name of the type. If the name
+ // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping
+ // rules are used to find the type (i.e. first the nested types within this
+ // message are searched, then within the parent, on up to the root
+ // namespace).
+ TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"`
+ // For extensions, this is the name of the type being extended. It is
+ // resolved in the same manner as type_name.
+ Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"`
+ // For numeric types, contains the original text representation of the value.
+ // For booleans, "true" or "false".
+ // For strings, contains the default text contents (not escaped in any way).
+ // For bytes, contains the C escaped value. All bytes >= 128 are escaped.
+ // TODO(kenton): Base-64 encode?
+ DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"`
+ // If set, gives the index of a oneof in the containing type's oneof_decl
+ // list. This field is a member of that oneof.
+ OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"`
+ // JSON name of this field. The value is set by protocol compiler. If the
+ // user has set a "json_name" option on this field, that option's value
+ // will be used. Otherwise, it's deduced from the field's name by converting
+ // it to camelCase.
+ JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"`
+ Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} }
+func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*FieldDescriptorProto) ProtoMessage() {}
+func (*FieldDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{4}
+}
+
+func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b)
+}
+func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *FieldDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FieldDescriptorProto.Merge(m, src)
+}
+func (m *FieldDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_FieldDescriptorProto.Size(m)
+}
+func (m *FieldDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo
+
+func (m *FieldDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *FieldDescriptorProto) GetNumber() int32 {
+ if m != nil && m.Number != nil {
+ return *m.Number
+ }
+ return 0
+}
+
+func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label {
+ if m != nil && m.Label != nil {
+ return *m.Label
+ }
+ return FieldDescriptorProto_LABEL_OPTIONAL
+}
+
+func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type {
+ if m != nil && m.Type != nil {
+ return *m.Type
+ }
+ return FieldDescriptorProto_TYPE_DOUBLE
+}
+
+func (m *FieldDescriptorProto) GetTypeName() string {
+ if m != nil && m.TypeName != nil {
+ return *m.TypeName
+ }
+ return ""
+}
+
+func (m *FieldDescriptorProto) GetExtendee() string {
+ if m != nil && m.Extendee != nil {
+ return *m.Extendee
+ }
+ return ""
+}
+
+func (m *FieldDescriptorProto) GetDefaultValue() string {
+ if m != nil && m.DefaultValue != nil {
+ return *m.DefaultValue
+ }
+ return ""
+}
+
+func (m *FieldDescriptorProto) GetOneofIndex() int32 {
+ if m != nil && m.OneofIndex != nil {
+ return *m.OneofIndex
+ }
+ return 0
+}
+
+func (m *FieldDescriptorProto) GetJsonName() string {
+ if m != nil && m.JsonName != nil {
+ return *m.JsonName
+ }
+ return ""
+}
+
+func (m *FieldDescriptorProto) GetOptions() *FieldOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+// Describes a oneof.
+type OneofDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} }
+func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*OneofDescriptorProto) ProtoMessage() {}
+func (*OneofDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{5}
+}
+
+func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b)
+}
+func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *OneofDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_OneofDescriptorProto.Merge(m, src)
+}
+func (m *OneofDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_OneofDescriptorProto.Size(m)
+}
+func (m *OneofDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo
+
+func (m *OneofDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *OneofDescriptorProto) GetOptions() *OneofOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+// Describes an enum type.
+type EnumDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"`
+ Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
+ // Range of reserved numeric values. Reserved numeric values may not be used
+ // by enum values in the same enum declaration. Reserved ranges may not
+ // overlap.
+ ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"`
+ // Reserved enum value names, which may not be reused. A given name may only
+ // be reserved once.
+ ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} }
+func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*EnumDescriptorProto) ProtoMessage() {}
+func (*EnumDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{6}
+}
+
+func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b)
+}
+func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *EnumDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EnumDescriptorProto.Merge(m, src)
+}
+func (m *EnumDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_EnumDescriptorProto.Size(m)
+}
+func (m *EnumDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo
+
+func (m *EnumDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func (m *EnumDescriptorProto) GetOptions() *EnumOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange {
+ if m != nil {
+ return m.ReservedRange
+ }
+ return nil
+}
+
+func (m *EnumDescriptorProto) GetReservedName() []string {
+ if m != nil {
+ return m.ReservedName
+ }
+ return nil
+}
+
+// Range of reserved numeric values. Reserved values may not be used by
+// entries in the same enum. Reserved ranges may not overlap.
+//
+// Note that this is distinct from DescriptorProto.ReservedRange in that it
+// is inclusive such that it can appropriately represent the entire int32
+// domain.
+type EnumDescriptorProto_EnumReservedRange struct {
+ Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"`
+ End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} }
+func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) }
+func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {}
+func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{6, 0}
+}
+
+func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b)
+}
+func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic)
+}
+func (m *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(m, src)
+}
+func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int {
+ return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m)
+}
+func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() {
+ xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo
+
+func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 {
+ if m != nil && m.Start != nil {
+ return *m.Start
+ }
+ return 0
+}
+
+func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 {
+ if m != nil && m.End != nil {
+ return *m.End
+ }
+ return 0
+}
+
+// Describes a value within an enum.
+type EnumValueDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"`
+ Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} }
+func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*EnumValueDescriptorProto) ProtoMessage() {}
+func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{7}
+}
+
+func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b)
+}
+func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *EnumValueDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EnumValueDescriptorProto.Merge(m, src)
+}
+func (m *EnumValueDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_EnumValueDescriptorProto.Size(m)
+}
+func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo
+
+func (m *EnumValueDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *EnumValueDescriptorProto) GetNumber() int32 {
+ if m != nil && m.Number != nil {
+ return *m.Number
+ }
+ return 0
+}
+
+func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+// Describes a service.
+type ServiceDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"`
+ Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} }
+func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*ServiceDescriptorProto) ProtoMessage() {}
+func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{8}
+}
+
+func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b)
+}
+func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *ServiceDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceDescriptorProto.Merge(m, src)
+}
+func (m *ServiceDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_ServiceDescriptorProto.Size(m)
+}
+func (m *ServiceDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo
+
+func (m *ServiceDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto {
+ if m != nil {
+ return m.Method
+ }
+ return nil
+}
+
+func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+// Describes a method of a service.
+type MethodDescriptorProto struct {
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ // Input and output type names. These are resolved in the same way as
+ // FieldDescriptorProto.type_name, but must refer to a message type.
+ InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"`
+ OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"`
+ Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"`
+ // Identifies if client streams multiple client messages
+ ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"`
+ // Identifies if server streams multiple server messages
+ ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} }
+func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) }
+func (*MethodDescriptorProto) ProtoMessage() {}
+func (*MethodDescriptorProto) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{9}
+}
+
+func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b)
+}
+func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic)
+}
+func (m *MethodDescriptorProto) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MethodDescriptorProto.Merge(m, src)
+}
+func (m *MethodDescriptorProto) XXX_Size() int {
+ return xxx_messageInfo_MethodDescriptorProto.Size(m)
+}
+func (m *MethodDescriptorProto) XXX_DiscardUnknown() {
+ xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo
+
+const Default_MethodDescriptorProto_ClientStreaming bool = false
+const Default_MethodDescriptorProto_ServerStreaming bool = false
+
+func (m *MethodDescriptorProto) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *MethodDescriptorProto) GetInputType() string {
+ if m != nil && m.InputType != nil {
+ return *m.InputType
+ }
+ return ""
+}
+
+func (m *MethodDescriptorProto) GetOutputType() string {
+ if m != nil && m.OutputType != nil {
+ return *m.OutputType
+ }
+ return ""
+}
+
+func (m *MethodDescriptorProto) GetOptions() *MethodOptions {
+ if m != nil {
+ return m.Options
+ }
+ return nil
+}
+
+func (m *MethodDescriptorProto) GetClientStreaming() bool {
+ if m != nil && m.ClientStreaming != nil {
+ return *m.ClientStreaming
+ }
+ return Default_MethodDescriptorProto_ClientStreaming
+}
+
+func (m *MethodDescriptorProto) GetServerStreaming() bool {
+ if m != nil && m.ServerStreaming != nil {
+ return *m.ServerStreaming
+ }
+ return Default_MethodDescriptorProto_ServerStreaming
+}
+
+type FileOptions struct {
+ // Sets the Java package where classes generated from this .proto will be
+ // placed. By default, the proto package is used, but this is often
+ // inappropriate because proto packages do not normally start with backwards
+ // domain names.
+ JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"`
+ // If set, all the classes from the .proto file are wrapped in a single
+ // outer class with the given name. This applies to both Proto1
+ // (equivalent to the old "--one_java_file" option) and Proto2 (where
+ // a .proto always translates to a single class, but you may want to
+ // explicitly choose the class name).
+ JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"`
+ // If set true, then the Java code generator will generate a separate .java
+ // file for each top-level message, enum, and service defined in the .proto
+ // file. Thus, these types will *not* be nested inside the outer class
+ // named by java_outer_classname. However, the outer class will still be
+ // generated to contain the file's getDescriptor() method as well as any
+ // top-level extensions defined in the file.
+ JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"`
+ // This option does nothing.
+ JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use.
+ // If set true, then the Java2 code generator will generate code that
+ // throws an exception whenever an attempt is made to assign a non-UTF-8
+ // byte sequence to a string field.
+ // Message reflection will do the same.
+ // However, an extension field still accepts non-UTF-8 byte sequences.
+ // This option has no effect on when used with the lite runtime.
+ JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"`
+ OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"`
+ // Sets the Go package where structs generated from this .proto will be
+ // placed. If omitted, the Go package will be derived from the following:
+ // - The basename of the package import path, if provided.
+ // - Otherwise, the package statement in the .proto file, if present.
+ // - Otherwise, the basename of the .proto file, without extension.
+ GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"`
+ // Should generic services be generated in each language? "Generic" services
+ // are not specific to any particular RPC system. They are generated by the
+ // main code generators in each language (without additional plugins).
+ // Generic services were the only kind of service generation supported by
+ // early versions of google.protobuf.
+ //
+ // Generic services are now considered deprecated in favor of using plugins
+ // that generate code specific to your particular RPC system. Therefore,
+ // these default to false. Old code which depends on generic services should
+ // explicitly set them to true.
+ CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"`
+ JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"`
+ PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"`
+ PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"`
+ // Is this file deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for everything in the file, or it will be completely ignored; in the very
+ // least, this is a formalization for deprecating files.
+ Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // Enables the use of arenas for the proto messages in this file. This applies
+ // only to generated classes for C++.
+ CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"`
+ // Sets the objective c class prefix which is prepended to all objective c
+ // generated classes from this .proto. There is no default.
+ ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"`
+ // Namespace for generated classes; defaults to the package.
+ CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"`
+ // By default Swift generators will take the proto package and CamelCase it
+ // replacing '.' with underscore and use that to prefix the types/symbols
+ // defined. When this options is provided, they will use this value instead
+ // to prefix the types/symbols defined.
+ SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"`
+ // Sets the php class prefix which is prepended to all php generated classes
+ // from this .proto. Default is empty.
+ PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"`
+ // Use this option to change the namespace of php generated classes. Default
+ // is empty. When this option is empty, the package name will be used for
+ // determining the namespace.
+ PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"`
+ // Use this option to change the namespace of php generated metadata classes.
+ // Default is empty. When this option is empty, the proto file name will be used
+ // for determining the namespace.
+ PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"`
+ // Use this option to change the package of ruby generated classes. Default
+ // is empty. When this option is not set, the package name will be used for
+ // determining the ruby package.
+ RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"`
+ // The parser stores options it doesn't recognize here.
+ // See the documentation for the "Options" section above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FileOptions) Reset() { *m = FileOptions{} }
+func (m *FileOptions) String() string { return proto.CompactTextString(m) }
+func (*FileOptions) ProtoMessage() {}
+func (*FileOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{10}
+}
+
+var extRange_FileOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_FileOptions
+}
+
+func (m *FileOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FileOptions.Unmarshal(m, b)
+}
+func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic)
+}
+func (m *FileOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FileOptions.Merge(m, src)
+}
+func (m *FileOptions) XXX_Size() int {
+ return xxx_messageInfo_FileOptions.Size(m)
+}
+func (m *FileOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_FileOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FileOptions proto.InternalMessageInfo
+
+const Default_FileOptions_JavaMultipleFiles bool = false
+const Default_FileOptions_JavaStringCheckUtf8 bool = false
+const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED
+const Default_FileOptions_CcGenericServices bool = false
+const Default_FileOptions_JavaGenericServices bool = false
+const Default_FileOptions_PyGenericServices bool = false
+const Default_FileOptions_PhpGenericServices bool = false
+const Default_FileOptions_Deprecated bool = false
+const Default_FileOptions_CcEnableArenas bool = false
+
+func (m *FileOptions) GetJavaPackage() string {
+ if m != nil && m.JavaPackage != nil {
+ return *m.JavaPackage
+ }
+ return ""
+}
+
+func (m *FileOptions) GetJavaOuterClassname() string {
+ if m != nil && m.JavaOuterClassname != nil {
+ return *m.JavaOuterClassname
+ }
+ return ""
+}
+
+func (m *FileOptions) GetJavaMultipleFiles() bool {
+ if m != nil && m.JavaMultipleFiles != nil {
+ return *m.JavaMultipleFiles
+ }
+ return Default_FileOptions_JavaMultipleFiles
+}
+
+// Deprecated: Do not use.
+func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool {
+ if m != nil && m.JavaGenerateEqualsAndHash != nil {
+ return *m.JavaGenerateEqualsAndHash
+ }
+ return false
+}
+
+func (m *FileOptions) GetJavaStringCheckUtf8() bool {
+ if m != nil && m.JavaStringCheckUtf8 != nil {
+ return *m.JavaStringCheckUtf8
+ }
+ return Default_FileOptions_JavaStringCheckUtf8
+}
+
+func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode {
+ if m != nil && m.OptimizeFor != nil {
+ return *m.OptimizeFor
+ }
+ return Default_FileOptions_OptimizeFor
+}
+
+func (m *FileOptions) GetGoPackage() string {
+ if m != nil && m.GoPackage != nil {
+ return *m.GoPackage
+ }
+ return ""
+}
+
+func (m *FileOptions) GetCcGenericServices() bool {
+ if m != nil && m.CcGenericServices != nil {
+ return *m.CcGenericServices
+ }
+ return Default_FileOptions_CcGenericServices
+}
+
+func (m *FileOptions) GetJavaGenericServices() bool {
+ if m != nil && m.JavaGenericServices != nil {
+ return *m.JavaGenericServices
+ }
+ return Default_FileOptions_JavaGenericServices
+}
+
+func (m *FileOptions) GetPyGenericServices() bool {
+ if m != nil && m.PyGenericServices != nil {
+ return *m.PyGenericServices
+ }
+ return Default_FileOptions_PyGenericServices
+}
+
+func (m *FileOptions) GetPhpGenericServices() bool {
+ if m != nil && m.PhpGenericServices != nil {
+ return *m.PhpGenericServices
+ }
+ return Default_FileOptions_PhpGenericServices
+}
+
+func (m *FileOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_FileOptions_Deprecated
+}
+
+func (m *FileOptions) GetCcEnableArenas() bool {
+ if m != nil && m.CcEnableArenas != nil {
+ return *m.CcEnableArenas
+ }
+ return Default_FileOptions_CcEnableArenas
+}
+
+func (m *FileOptions) GetObjcClassPrefix() string {
+ if m != nil && m.ObjcClassPrefix != nil {
+ return *m.ObjcClassPrefix
+ }
+ return ""
+}
+
+func (m *FileOptions) GetCsharpNamespace() string {
+ if m != nil && m.CsharpNamespace != nil {
+ return *m.CsharpNamespace
+ }
+ return ""
+}
+
+func (m *FileOptions) GetSwiftPrefix() string {
+ if m != nil && m.SwiftPrefix != nil {
+ return *m.SwiftPrefix
+ }
+ return ""
+}
+
+func (m *FileOptions) GetPhpClassPrefix() string {
+ if m != nil && m.PhpClassPrefix != nil {
+ return *m.PhpClassPrefix
+ }
+ return ""
+}
+
+func (m *FileOptions) GetPhpNamespace() string {
+ if m != nil && m.PhpNamespace != nil {
+ return *m.PhpNamespace
+ }
+ return ""
+}
+
+func (m *FileOptions) GetPhpMetadataNamespace() string {
+ if m != nil && m.PhpMetadataNamespace != nil {
+ return *m.PhpMetadataNamespace
+ }
+ return ""
+}
+
+func (m *FileOptions) GetRubyPackage() string {
+ if m != nil && m.RubyPackage != nil {
+ return *m.RubyPackage
+ }
+ return ""
+}
+
+func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type MessageOptions struct {
+ // Set true to use the old proto1 MessageSet wire format for extensions.
+ // This is provided for backwards-compatibility with the MessageSet wire
+ // format. You should not use this for any other reason: It's less
+ // efficient, has fewer features, and is more complicated.
+ //
+ // The message must be defined exactly as follows:
+ // message Foo {
+ // option message_set_wire_format = true;
+ // extensions 4 to max;
+ // }
+ // Note that the message cannot have any defined fields; MessageSets only
+ // have extensions.
+ //
+ // All extensions of your type must be singular messages; e.g. they cannot
+ // be int32s, enums, or repeated messages.
+ //
+ // Because this is an option, the above two restrictions are not enforced by
+ // the protocol compiler.
+ MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"`
+ // Disables the generation of the standard "descriptor()" accessor, which can
+ // conflict with a field of the same name. This is meant to make migration
+ // from proto1 easier; new code should avoid fields named "descriptor".
+ NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"`
+ // Is this message deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the message, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating messages.
+ Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // Whether the message is an automatically generated map entry type for the
+ // maps field.
+ //
+ // For maps fields:
+ // map map_field = 1;
+ // The parsed descriptor looks like:
+ // message MapFieldEntry {
+ // option map_entry = true;
+ // optional KeyType key = 1;
+ // optional ValueType value = 2;
+ // }
+ // repeated MapFieldEntry map_field = 1;
+ //
+ // Implementations may choose not to generate the map_entry=true message, but
+ // use a native map in the target language to hold the keys and values.
+ // The reflection APIs in such implementions still need to work as
+ // if the field is a repeated message field.
+ //
+ // NOTE: Do not set the option in .proto files. Always use the maps syntax
+ // instead. The option should only be implicitly set by the proto compiler
+ // parser.
+ MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *MessageOptions) Reset() { *m = MessageOptions{} }
+func (m *MessageOptions) String() string { return proto.CompactTextString(m) }
+func (*MessageOptions) ProtoMessage() {}
+func (*MessageOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{11}
+}
+
+var extRange_MessageOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_MessageOptions
+}
+
+func (m *MessageOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_MessageOptions.Unmarshal(m, b)
+}
+func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic)
+}
+func (m *MessageOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MessageOptions.Merge(m, src)
+}
+func (m *MessageOptions) XXX_Size() int {
+ return xxx_messageInfo_MessageOptions.Size(m)
+}
+func (m *MessageOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_MessageOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MessageOptions proto.InternalMessageInfo
+
+const Default_MessageOptions_MessageSetWireFormat bool = false
+const Default_MessageOptions_NoStandardDescriptorAccessor bool = false
+const Default_MessageOptions_Deprecated bool = false
+
+func (m *MessageOptions) GetMessageSetWireFormat() bool {
+ if m != nil && m.MessageSetWireFormat != nil {
+ return *m.MessageSetWireFormat
+ }
+ return Default_MessageOptions_MessageSetWireFormat
+}
+
+func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool {
+ if m != nil && m.NoStandardDescriptorAccessor != nil {
+ return *m.NoStandardDescriptorAccessor
+ }
+ return Default_MessageOptions_NoStandardDescriptorAccessor
+}
+
+func (m *MessageOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_MessageOptions_Deprecated
+}
+
+func (m *MessageOptions) GetMapEntry() bool {
+ if m != nil && m.MapEntry != nil {
+ return *m.MapEntry
+ }
+ return false
+}
+
+func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type FieldOptions struct {
+ // The ctype option instructs the C++ code generator to use a different
+ // representation of the field than it normally would. See the specific
+ // options below. This option is not yet implemented in the open source
+ // release -- sorry, we'll try to include it in a future version!
+ Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"`
+ // The packed option can be enabled for repeated primitive fields to enable
+ // a more efficient representation on the wire. Rather than repeatedly
+ // writing the tag and type for each element, the entire array is encoded as
+ // a single length-delimited blob. In proto3, only explicit setting it to
+ // false will avoid using packed encoding.
+ Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"`
+ // The jstype option determines the JavaScript type used for values of the
+ // field. The option is permitted only for 64 bit integral and fixed types
+ // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
+ // is represented as JavaScript string, which avoids loss of precision that
+ // can happen when a large value is converted to a floating point JavaScript.
+ // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
+ // use the JavaScript "number" type. The behavior of the default option
+ // JS_NORMAL is implementation dependent.
+ //
+ // This option is an enum to permit additional types to be added, e.g.
+ // goog.math.Integer.
+ Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"`
+ // Should this field be parsed lazily? Lazy applies only to message-type
+ // fields. It means that when the outer message is initially parsed, the
+ // inner message's contents will not be parsed but instead stored in encoded
+ // form. The inner message will actually be parsed when it is first accessed.
+ //
+ // This is only a hint. Implementations are free to choose whether to use
+ // eager or lazy parsing regardless of the value of this option. However,
+ // setting this option true suggests that the protocol author believes that
+ // using lazy parsing on this field is worth the additional bookkeeping
+ // overhead typically needed to implement it.
+ //
+ // This option does not affect the public interface of any generated code;
+ // all method signatures remain the same. Furthermore, thread-safety of the
+ // interface is not affected by this option; const methods remain safe to
+ // call from multiple threads concurrently, while non-const methods continue
+ // to require exclusive access.
+ //
+ //
+ // Note that implementations may choose not to check required fields within
+ // a lazy sub-message. That is, calling IsInitialized() on the outer message
+ // may return true even if the inner message has missing required fields.
+ // This is necessary because otherwise the inner message would have to be
+ // parsed in order to perform the check, defeating the purpose of lazy
+ // parsing. An implementation which chooses not to check required fields
+ // must be consistent about it. That is, for any particular sub-message, the
+ // implementation must either *always* check its required fields, or *never*
+ // check its required fields, regardless of whether or not the message has
+ // been parsed.
+ Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"`
+ // Is this field deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for accessors, or it will be completely ignored; in the very least, this
+ // is a formalization for deprecating fields.
+ Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // For Google-internal migration only. Do not use.
+ Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FieldOptions) Reset() { *m = FieldOptions{} }
+func (m *FieldOptions) String() string { return proto.CompactTextString(m) }
+func (*FieldOptions) ProtoMessage() {}
+func (*FieldOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{12}
+}
+
+var extRange_FieldOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_FieldOptions
+}
+
+func (m *FieldOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FieldOptions.Unmarshal(m, b)
+}
+func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic)
+}
+func (m *FieldOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FieldOptions.Merge(m, src)
+}
+func (m *FieldOptions) XXX_Size() int {
+ return xxx_messageInfo_FieldOptions.Size(m)
+}
+func (m *FieldOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_FieldOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FieldOptions proto.InternalMessageInfo
+
+const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING
+const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL
+const Default_FieldOptions_Lazy bool = false
+const Default_FieldOptions_Deprecated bool = false
+const Default_FieldOptions_Weak bool = false
+
+func (m *FieldOptions) GetCtype() FieldOptions_CType {
+ if m != nil && m.Ctype != nil {
+ return *m.Ctype
+ }
+ return Default_FieldOptions_Ctype
+}
+
+func (m *FieldOptions) GetPacked() bool {
+ if m != nil && m.Packed != nil {
+ return *m.Packed
+ }
+ return false
+}
+
+func (m *FieldOptions) GetJstype() FieldOptions_JSType {
+ if m != nil && m.Jstype != nil {
+ return *m.Jstype
+ }
+ return Default_FieldOptions_Jstype
+}
+
+func (m *FieldOptions) GetLazy() bool {
+ if m != nil && m.Lazy != nil {
+ return *m.Lazy
+ }
+ return Default_FieldOptions_Lazy
+}
+
+func (m *FieldOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_FieldOptions_Deprecated
+}
+
+func (m *FieldOptions) GetWeak() bool {
+ if m != nil && m.Weak != nil {
+ return *m.Weak
+ }
+ return Default_FieldOptions_Weak
+}
+
+func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type OneofOptions struct {
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *OneofOptions) Reset() { *m = OneofOptions{} }
+func (m *OneofOptions) String() string { return proto.CompactTextString(m) }
+func (*OneofOptions) ProtoMessage() {}
+func (*OneofOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{13}
+}
+
+var extRange_OneofOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_OneofOptions
+}
+
+func (m *OneofOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_OneofOptions.Unmarshal(m, b)
+}
+func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic)
+}
+func (m *OneofOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_OneofOptions.Merge(m, src)
+}
+func (m *OneofOptions) XXX_Size() int {
+ return xxx_messageInfo_OneofOptions.Size(m)
+}
+func (m *OneofOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_OneofOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_OneofOptions proto.InternalMessageInfo
+
+func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type EnumOptions struct {
+ // Set this option to true to allow mapping different tag names to the same
+ // value.
+ AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"`
+ // Is this enum deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the enum, or it will be completely ignored; in the very least, this
+ // is a formalization for deprecating enums.
+ Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EnumOptions) Reset() { *m = EnumOptions{} }
+func (m *EnumOptions) String() string { return proto.CompactTextString(m) }
+func (*EnumOptions) ProtoMessage() {}
+func (*EnumOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{14}
+}
+
+var extRange_EnumOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_EnumOptions
+}
+
+func (m *EnumOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EnumOptions.Unmarshal(m, b)
+}
+func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic)
+}
+func (m *EnumOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EnumOptions.Merge(m, src)
+}
+func (m *EnumOptions) XXX_Size() int {
+ return xxx_messageInfo_EnumOptions.Size(m)
+}
+func (m *EnumOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_EnumOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EnumOptions proto.InternalMessageInfo
+
+const Default_EnumOptions_Deprecated bool = false
+
+func (m *EnumOptions) GetAllowAlias() bool {
+ if m != nil && m.AllowAlias != nil {
+ return *m.AllowAlias
+ }
+ return false
+}
+
+func (m *EnumOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_EnumOptions_Deprecated
+}
+
+func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type EnumValueOptions struct {
+ // Is this enum value deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the enum value, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating enum values.
+ Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} }
+func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) }
+func (*EnumValueOptions) ProtoMessage() {}
+func (*EnumValueOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{15}
+}
+
+var extRange_EnumValueOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_EnumValueOptions
+}
+
+func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b)
+}
+func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic)
+}
+func (m *EnumValueOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_EnumValueOptions.Merge(m, src)
+}
+func (m *EnumValueOptions) XXX_Size() int {
+ return xxx_messageInfo_EnumValueOptions.Size(m)
+}
+func (m *EnumValueOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_EnumValueOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo
+
+const Default_EnumValueOptions_Deprecated bool = false
+
+func (m *EnumValueOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_EnumValueOptions_Deprecated
+}
+
+func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type ServiceOptions struct {
+ // Is this service deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the service, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating services.
+ Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ServiceOptions) Reset() { *m = ServiceOptions{} }
+func (m *ServiceOptions) String() string { return proto.CompactTextString(m) }
+func (*ServiceOptions) ProtoMessage() {}
+func (*ServiceOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{16}
+}
+
+var extRange_ServiceOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_ServiceOptions
+}
+
+func (m *ServiceOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ServiceOptions.Unmarshal(m, b)
+}
+func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic)
+}
+func (m *ServiceOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ServiceOptions.Merge(m, src)
+}
+func (m *ServiceOptions) XXX_Size() int {
+ return xxx_messageInfo_ServiceOptions.Size(m)
+}
+func (m *ServiceOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_ServiceOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo
+
+const Default_ServiceOptions_Deprecated bool = false
+
+func (m *ServiceOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_ServiceOptions_Deprecated
+}
+
+func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+type MethodOptions struct {
+ // Is this method deprecated?
+ // Depending on the target platform, this can emit Deprecated annotations
+ // for the method, or it will be completely ignored; in the very least,
+ // this is a formalization for deprecating methods.
+ Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"`
+ IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"`
+ // The parser stores options it doesn't recognize here. See above.
+ UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ proto.XXX_InternalExtensions `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *MethodOptions) Reset() { *m = MethodOptions{} }
+func (m *MethodOptions) String() string { return proto.CompactTextString(m) }
+func (*MethodOptions) ProtoMessage() {}
+func (*MethodOptions) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{17}
+}
+
+var extRange_MethodOptions = []proto.ExtensionRange{
+ {Start: 1000, End: 536870911},
+}
+
+func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange {
+ return extRange_MethodOptions
+}
+
+func (m *MethodOptions) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_MethodOptions.Unmarshal(m, b)
+}
+func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic)
+}
+func (m *MethodOptions) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MethodOptions.Merge(m, src)
+}
+func (m *MethodOptions) XXX_Size() int {
+ return xxx_messageInfo_MethodOptions.Size(m)
+}
+func (m *MethodOptions) XXX_DiscardUnknown() {
+ xxx_messageInfo_MethodOptions.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MethodOptions proto.InternalMessageInfo
+
+const Default_MethodOptions_Deprecated bool = false
+const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN
+
+func (m *MethodOptions) GetDeprecated() bool {
+ if m != nil && m.Deprecated != nil {
+ return *m.Deprecated
+ }
+ return Default_MethodOptions_Deprecated
+}
+
+func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel {
+ if m != nil && m.IdempotencyLevel != nil {
+ return *m.IdempotencyLevel
+ }
+ return Default_MethodOptions_IdempotencyLevel
+}
+
+func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption {
+ if m != nil {
+ return m.UninterpretedOption
+ }
+ return nil
+}
+
+// A message representing a option the parser does not recognize. This only
+// appears in options protos created by the compiler::Parser class.
+// DescriptorPool resolves these when building Descriptor objects. Therefore,
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
+// in them.
+type UninterpretedOption struct {
+ Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"`
+ // The value of the uninterpreted option, in whatever type the tokenizer
+ // identified it as during parsing. Exactly one of these should be set.
+ IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"`
+ PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"`
+ NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"`
+ DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"`
+ StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"`
+ AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} }
+func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) }
+func (*UninterpretedOption) ProtoMessage() {}
+func (*UninterpretedOption) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{18}
+}
+
+func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b)
+}
+func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic)
+}
+func (m *UninterpretedOption) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_UninterpretedOption.Merge(m, src)
+}
+func (m *UninterpretedOption) XXX_Size() int {
+ return xxx_messageInfo_UninterpretedOption.Size(m)
+}
+func (m *UninterpretedOption) XXX_DiscardUnknown() {
+ xxx_messageInfo_UninterpretedOption.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo
+
+func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart {
+ if m != nil {
+ return m.Name
+ }
+ return nil
+}
+
+func (m *UninterpretedOption) GetIdentifierValue() string {
+ if m != nil && m.IdentifierValue != nil {
+ return *m.IdentifierValue
+ }
+ return ""
+}
+
+func (m *UninterpretedOption) GetPositiveIntValue() uint64 {
+ if m != nil && m.PositiveIntValue != nil {
+ return *m.PositiveIntValue
+ }
+ return 0
+}
+
+func (m *UninterpretedOption) GetNegativeIntValue() int64 {
+ if m != nil && m.NegativeIntValue != nil {
+ return *m.NegativeIntValue
+ }
+ return 0
+}
+
+func (m *UninterpretedOption) GetDoubleValue() float64 {
+ if m != nil && m.DoubleValue != nil {
+ return *m.DoubleValue
+ }
+ return 0
+}
+
+func (m *UninterpretedOption) GetStringValue() []byte {
+ if m != nil {
+ return m.StringValue
+ }
+ return nil
+}
+
+func (m *UninterpretedOption) GetAggregateValue() string {
+ if m != nil && m.AggregateValue != nil {
+ return *m.AggregateValue
+ }
+ return ""
+}
+
+// The name of the uninterpreted option. Each string represents a segment in
+// a dot-separated name. is_extension is true iff a segment represents an
+// extension (denoted with parentheses in options specs in .proto files).
+// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
+// "foo.(bar.baz).qux".
+type UninterpretedOption_NamePart struct {
+ NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"`
+ IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} }
+func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) }
+func (*UninterpretedOption_NamePart) ProtoMessage() {}
+func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{18, 0}
+}
+
+func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b)
+}
+func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic)
+}
+func (m *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_UninterpretedOption_NamePart.Merge(m, src)
+}
+func (m *UninterpretedOption_NamePart) XXX_Size() int {
+ return xxx_messageInfo_UninterpretedOption_NamePart.Size(m)
+}
+func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() {
+ xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo
+
+func (m *UninterpretedOption_NamePart) GetNamePart() string {
+ if m != nil && m.NamePart != nil {
+ return *m.NamePart
+ }
+ return ""
+}
+
+func (m *UninterpretedOption_NamePart) GetIsExtension() bool {
+ if m != nil && m.IsExtension != nil {
+ return *m.IsExtension
+ }
+ return false
+}
+
+// Encapsulates information about the original source file from which a
+// FileDescriptorProto was generated.
+type SourceCodeInfo struct {
+ // A Location identifies a piece of source code in a .proto file which
+ // corresponds to a particular definition. This information is intended
+ // to be useful to IDEs, code indexers, documentation generators, and similar
+ // tools.
+ //
+ // For example, say we have a file like:
+ // message Foo {
+ // optional string foo = 1;
+ // }
+ // Let's look at just the field definition:
+ // optional string foo = 1;
+ // ^ ^^ ^^ ^ ^^^
+ // a bc de f ghi
+ // We have the following locations:
+ // span path represents
+ // [a,i) [ 4, 0, 2, 0 ] The whole field definition.
+ // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).
+ // [c,d) [ 4, 0, 2, 0, 5 ] The type (string).
+ // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).
+ // [g,h) [ 4, 0, 2, 0, 3 ] The number (1).
+ //
+ // Notes:
+ // - A location may refer to a repeated field itself (i.e. not to any
+ // particular index within it). This is used whenever a set of elements are
+ // logically enclosed in a single code segment. For example, an entire
+ // extend block (possibly containing multiple extension definitions) will
+ // have an outer location whose path refers to the "extensions" repeated
+ // field without an index.
+ // - Multiple locations may have the same path. This happens when a single
+ // logical declaration is spread out across multiple places. The most
+ // obvious example is the "extend" block again -- there may be multiple
+ // extend blocks in the same scope, each of which will have the same path.
+ // - A location's span is not always a subset of its parent's span. For
+ // example, the "extendee" of an extension declaration appears at the
+ // beginning of the "extend" block and is shared by all extensions within
+ // the block.
+ // - Just because a location's span is a subset of some other location's span
+ // does not mean that it is a descendent. For example, a "group" defines
+ // both a type and a field in a single declaration. Thus, the locations
+ // corresponding to the type and field and their components will overlap.
+ // - Code which tries to interpret locations should probably be designed to
+ // ignore those that it doesn't understand, as more types of locations could
+ // be recorded in the future.
+ Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} }
+func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) }
+func (*SourceCodeInfo) ProtoMessage() {}
+func (*SourceCodeInfo) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{19}
+}
+
+func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b)
+}
+func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic)
+}
+func (m *SourceCodeInfo) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SourceCodeInfo.Merge(m, src)
+}
+func (m *SourceCodeInfo) XXX_Size() int {
+ return xxx_messageInfo_SourceCodeInfo.Size(m)
+}
+func (m *SourceCodeInfo) XXX_DiscardUnknown() {
+ xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo
+
+func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location {
+ if m != nil {
+ return m.Location
+ }
+ return nil
+}
+
+type SourceCodeInfo_Location struct {
+ // Identifies which part of the FileDescriptorProto was defined at this
+ // location.
+ //
+ // Each element is a field number or an index. They form a path from
+ // the root FileDescriptorProto to the place where the definition. For
+ // example, this path:
+ // [ 4, 3, 2, 7, 1 ]
+ // refers to:
+ // file.message_type(3) // 4, 3
+ // .field(7) // 2, 7
+ // .name() // 1
+ // This is because FileDescriptorProto.message_type has field number 4:
+ // repeated DescriptorProto message_type = 4;
+ // and DescriptorProto.field has field number 2:
+ // repeated FieldDescriptorProto field = 2;
+ // and FieldDescriptorProto.name has field number 1:
+ // optional string name = 1;
+ //
+ // Thus, the above path gives the location of a field name. If we removed
+ // the last element:
+ // [ 4, 3, 2, 7 ]
+ // this path refers to the whole field declaration (from the beginning
+ // of the label to the terminating semicolon).
+ Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
+ // Always has exactly three or four elements: start line, start column,
+ // end line (optional, otherwise assumed same as start line), end column.
+ // These are packed into a single field for efficiency. Note that line
+ // and column numbers are zero-based -- typically you will want to add
+ // 1 to each before displaying to a user.
+ Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"`
+ // If this SourceCodeInfo represents a complete declaration, these are any
+ // comments appearing before and after the declaration which appear to be
+ // attached to the declaration.
+ //
+ // A series of line comments appearing on consecutive lines, with no other
+ // tokens appearing on those lines, will be treated as a single comment.
+ //
+ // leading_detached_comments will keep paragraphs of comments that appear
+ // before (but not connected to) the current element. Each paragraph,
+ // separated by empty lines, will be one comment element in the repeated
+ // field.
+ //
+ // Only the comment content is provided; comment markers (e.g. //) are
+ // stripped out. For block comments, leading whitespace and an asterisk
+ // will be stripped from the beginning of each line other than the first.
+ // Newlines are included in the output.
+ //
+ // Examples:
+ //
+ // optional int32 foo = 1; // Comment attached to foo.
+ // // Comment attached to bar.
+ // optional int32 bar = 2;
+ //
+ // optional string baz = 3;
+ // // Comment attached to baz.
+ // // Another line attached to baz.
+ //
+ // // Comment attached to qux.
+ // //
+ // // Another line attached to qux.
+ // optional double qux = 4;
+ //
+ // // Detached comment for corge. This is not leading or trailing comments
+ // // to qux or corge because there are blank lines separating it from
+ // // both.
+ //
+ // // Detached comment for corge paragraph 2.
+ //
+ // optional string corge = 5;
+ // /* Block comment attached
+ // * to corge. Leading asterisks
+ // * will be removed. */
+ // /* Block comment attached to
+ // * grault. */
+ // optional int32 grault = 6;
+ //
+ // // ignored detached comments.
+ LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"`
+ TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"`
+ LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} }
+func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) }
+func (*SourceCodeInfo_Location) ProtoMessage() {}
+func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{19, 0}
+}
+
+func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b)
+}
+func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic)
+}
+func (m *SourceCodeInfo_Location) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_SourceCodeInfo_Location.Merge(m, src)
+}
+func (m *SourceCodeInfo_Location) XXX_Size() int {
+ return xxx_messageInfo_SourceCodeInfo_Location.Size(m)
+}
+func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() {
+ xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo
+
+func (m *SourceCodeInfo_Location) GetPath() []int32 {
+ if m != nil {
+ return m.Path
+ }
+ return nil
+}
+
+func (m *SourceCodeInfo_Location) GetSpan() []int32 {
+ if m != nil {
+ return m.Span
+ }
+ return nil
+}
+
+func (m *SourceCodeInfo_Location) GetLeadingComments() string {
+ if m != nil && m.LeadingComments != nil {
+ return *m.LeadingComments
+ }
+ return ""
+}
+
+func (m *SourceCodeInfo_Location) GetTrailingComments() string {
+ if m != nil && m.TrailingComments != nil {
+ return *m.TrailingComments
+ }
+ return ""
+}
+
+func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string {
+ if m != nil {
+ return m.LeadingDetachedComments
+ }
+ return nil
+}
+
+// Describes the relationship between generated code and its original source
+// file. A GeneratedCodeInfo message is associated with only one generated
+// source file, but may contain references to different source .proto files.
+type GeneratedCodeInfo struct {
+ // An Annotation connects some span of text in generated code to an element
+ // of its generating .proto file.
+ Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} }
+func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) }
+func (*GeneratedCodeInfo) ProtoMessage() {}
+func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{20}
+}
+
+func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b)
+}
+func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic)
+}
+func (m *GeneratedCodeInfo) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GeneratedCodeInfo.Merge(m, src)
+}
+func (m *GeneratedCodeInfo) XXX_Size() int {
+ return xxx_messageInfo_GeneratedCodeInfo.Size(m)
+}
+func (m *GeneratedCodeInfo) XXX_DiscardUnknown() {
+ xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo
+
+func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation {
+ if m != nil {
+ return m.Annotation
+ }
+ return nil
+}
+
+type GeneratedCodeInfo_Annotation struct {
+ // Identifies the element in the original source .proto file. This field
+ // is formatted the same as SourceCodeInfo.Location.path.
+ Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"`
+ // Identifies the filesystem path to the original source .proto.
+ SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"`
+ // Identifies the starting offset in bytes in the generated code
+ // that relates to the identified object.
+ Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"`
+ // Identifies the ending offset in bytes in the generated code that
+ // relates to the identified offset. The end offset should be one past
+ // the last relevant byte (so the length of the text = end - begin).
+ End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} }
+func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) }
+func (*GeneratedCodeInfo_Annotation) ProtoMessage() {}
+func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) {
+ return fileDescriptor_e5baabe45344a177, []int{20, 0}
+}
+
+func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b)
+}
+func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic)
+}
+func (m *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(m, src)
+}
+func (m *GeneratedCodeInfo_Annotation) XXX_Size() int {
+ return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m)
+}
+func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() {
+ xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo
+
+func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 {
+ if m != nil {
+ return m.Path
+ }
+ return nil
+}
+
+func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string {
+ if m != nil && m.SourceFile != nil {
+ return *m.SourceFile
+ }
+ return ""
+}
+
+func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 {
+ if m != nil && m.Begin != nil {
+ return *m.Begin
+ }
+ return 0
+}
+
+func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 {
+ if m != nil && m.End != nil {
+ return *m.End
+ }
+ return 0
+}
+
+func init() {
+ proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value)
+ proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value)
+ proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value)
+ proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value)
+ proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value)
+ proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value)
+ proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet")
+ proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto")
+ proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto")
+ proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange")
+ proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange")
+ proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions")
+ proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto")
+ proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto")
+ proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto")
+ proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange")
+ proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto")
+ proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto")
+ proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto")
+ proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions")
+ proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions")
+ proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions")
+ proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions")
+ proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions")
+ proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions")
+ proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions")
+ proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions")
+ proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption")
+ proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart")
+ proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo")
+ proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location")
+ proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo")
+ proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation")
+}
+
+func init() { proto.RegisterFile("google/protobuf/descriptor.proto", fileDescriptor_e5baabe45344a177) }
+
+var fileDescriptor_e5baabe45344a177 = []byte{
+ // 2589 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xdd, 0x8e, 0xdb, 0xc6,
+ 0x15, 0x0e, 0xf5, 0xb7, 0xd2, 0x91, 0x56, 0x3b, 0x3b, 0xbb, 0xb1, 0xe9, 0xcd, 0x8f, 0xd7, 0xca,
+ 0x8f, 0xd7, 0x4e, 0xac, 0x0d, 0x1c, 0xdb, 0x71, 0xd6, 0x45, 0x5a, 0xad, 0x44, 0x6f, 0xe4, 0xee,
+ 0x4a, 0x2a, 0xa5, 0x6d, 0x7e, 0x80, 0x82, 0x98, 0x25, 0x47, 0x12, 0x6d, 0x8a, 0x64, 0x48, 0xca,
+ 0xf6, 0x06, 0xbd, 0x30, 0xd0, 0xab, 0x5e, 0x15, 0xe8, 0x55, 0x51, 0x14, 0xbd, 0xe8, 0x4d, 0x80,
+ 0x3e, 0x40, 0x81, 0xde, 0xf5, 0x09, 0x0a, 0xe4, 0x0d, 0x8a, 0xb6, 0x40, 0xfb, 0x08, 0xbd, 0x2c,
+ 0x66, 0x86, 0xa4, 0x48, 0x49, 0x1b, 0x6f, 0x02, 0xc4, 0xb9, 0x92, 0xe6, 0x3b, 0xdf, 0x39, 0x73,
+ 0xe6, 0xcc, 0x99, 0x99, 0x33, 0x43, 0xd8, 0x1e, 0x39, 0xce, 0xc8, 0xa2, 0xbb, 0xae, 0xe7, 0x04,
+ 0xce, 0xc9, 0x74, 0xb8, 0x6b, 0x50, 0x5f, 0xf7, 0x4c, 0x37, 0x70, 0xbc, 0x3a, 0xc7, 0xf0, 0x9a,
+ 0x60, 0xd4, 0x23, 0x46, 0xed, 0x08, 0xd6, 0xef, 0x9b, 0x16, 0x6d, 0xc5, 0xc4, 0x3e, 0x0d, 0xf0,
+ 0x5d, 0xc8, 0x0d, 0x4d, 0x8b, 0xca, 0xd2, 0x76, 0x76, 0xa7, 0x7c, 0xf3, 0xcd, 0xfa, 0x9c, 0x52,
+ 0x3d, 0xad, 0xd1, 0x63, 0xb0, 0xca, 0x35, 0x6a, 0xff, 0xce, 0xc1, 0xc6, 0x12, 0x29, 0xc6, 0x90,
+ 0xb3, 0xc9, 0x84, 0x59, 0x94, 0x76, 0x4a, 0x2a, 0xff, 0x8f, 0x65, 0x58, 0x71, 0x89, 0xfe, 0x88,
+ 0x8c, 0xa8, 0x9c, 0xe1, 0x70, 0xd4, 0xc4, 0xaf, 0x03, 0x18, 0xd4, 0xa5, 0xb6, 0x41, 0x6d, 0xfd,
+ 0x54, 0xce, 0x6e, 0x67, 0x77, 0x4a, 0x6a, 0x02, 0xc1, 0xef, 0xc0, 0xba, 0x3b, 0x3d, 0xb1, 0x4c,
+ 0x5d, 0x4b, 0xd0, 0x60, 0x3b, 0xbb, 0x93, 0x57, 0x91, 0x10, 0xb4, 0x66, 0xe4, 0xab, 0xb0, 0xf6,
+ 0x84, 0x92, 0x47, 0x49, 0x6a, 0x99, 0x53, 0xab, 0x0c, 0x4e, 0x10, 0x9b, 0x50, 0x99, 0x50, 0xdf,
+ 0x27, 0x23, 0xaa, 0x05, 0xa7, 0x2e, 0x95, 0x73, 0x7c, 0xf4, 0xdb, 0x0b, 0xa3, 0x9f, 0x1f, 0x79,
+ 0x39, 0xd4, 0x1a, 0x9c, 0xba, 0x14, 0x37, 0xa0, 0x44, 0xed, 0xe9, 0x44, 0x58, 0xc8, 0x9f, 0x11,
+ 0x3f, 0xc5, 0x9e, 0x4e, 0xe6, 0xad, 0x14, 0x99, 0x5a, 0x68, 0x62, 0xc5, 0xa7, 0xde, 0x63, 0x53,
+ 0xa7, 0x72, 0x81, 0x1b, 0xb8, 0xba, 0x60, 0xa0, 0x2f, 0xe4, 0xf3, 0x36, 0x22, 0x3d, 0xdc, 0x84,
+ 0x12, 0x7d, 0x1a, 0x50, 0xdb, 0x37, 0x1d, 0x5b, 0x5e, 0xe1, 0x46, 0xde, 0x5a, 0x32, 0x8b, 0xd4,
+ 0x32, 0xe6, 0x4d, 0xcc, 0xf4, 0xf0, 0x1d, 0x58, 0x71, 0xdc, 0xc0, 0x74, 0x6c, 0x5f, 0x2e, 0x6e,
+ 0x4b, 0x3b, 0xe5, 0x9b, 0xaf, 0x2e, 0x4d, 0x84, 0xae, 0xe0, 0xa8, 0x11, 0x19, 0xb7, 0x01, 0xf9,
+ 0xce, 0xd4, 0xd3, 0xa9, 0xa6, 0x3b, 0x06, 0xd5, 0x4c, 0x7b, 0xe8, 0xc8, 0x25, 0x6e, 0xe0, 0xf2,
+ 0xe2, 0x40, 0x38, 0xb1, 0xe9, 0x18, 0xb4, 0x6d, 0x0f, 0x1d, 0xb5, 0xea, 0xa7, 0xda, 0xf8, 0x02,
+ 0x14, 0xfc, 0x53, 0x3b, 0x20, 0x4f, 0xe5, 0x0a, 0xcf, 0x90, 0xb0, 0x55, 0xfb, 0x6b, 0x01, 0xd6,
+ 0xce, 0x93, 0x62, 0xf7, 0x20, 0x3f, 0x64, 0xa3, 0x94, 0x33, 0xdf, 0x26, 0x06, 0x42, 0x27, 0x1d,
+ 0xc4, 0xc2, 0x77, 0x0c, 0x62, 0x03, 0xca, 0x36, 0xf5, 0x03, 0x6a, 0x88, 0x8c, 0xc8, 0x9e, 0x33,
+ 0xa7, 0x40, 0x28, 0x2d, 0xa6, 0x54, 0xee, 0x3b, 0xa5, 0xd4, 0xa7, 0xb0, 0x16, 0xbb, 0xa4, 0x79,
+ 0xc4, 0x1e, 0x45, 0xb9, 0xb9, 0xfb, 0x3c, 0x4f, 0xea, 0x4a, 0xa4, 0xa7, 0x32, 0x35, 0xb5, 0x4a,
+ 0x53, 0x6d, 0xdc, 0x02, 0x70, 0x6c, 0xea, 0x0c, 0x35, 0x83, 0xea, 0x96, 0x5c, 0x3c, 0x23, 0x4a,
+ 0x5d, 0x46, 0x59, 0x88, 0x92, 0x23, 0x50, 0xdd, 0xc2, 0x1f, 0xce, 0x52, 0x6d, 0xe5, 0x8c, 0x4c,
+ 0x39, 0x12, 0x8b, 0x6c, 0x21, 0xdb, 0x8e, 0xa1, 0xea, 0x51, 0x96, 0xf7, 0xd4, 0x08, 0x47, 0x56,
+ 0xe2, 0x4e, 0xd4, 0x9f, 0x3b, 0x32, 0x35, 0x54, 0x13, 0x03, 0x5b, 0xf5, 0x92, 0x4d, 0xfc, 0x06,
+ 0xc4, 0x80, 0xc6, 0xd3, 0x0a, 0xf8, 0x2e, 0x54, 0x89, 0xc0, 0x0e, 0x99, 0xd0, 0xad, 0x2f, 0xa1,
+ 0x9a, 0x0e, 0x0f, 0xde, 0x84, 0xbc, 0x1f, 0x10, 0x2f, 0xe0, 0x59, 0x98, 0x57, 0x45, 0x03, 0x23,
+ 0xc8, 0x52, 0xdb, 0xe0, 0xbb, 0x5c, 0x5e, 0x65, 0x7f, 0xf1, 0x4f, 0x66, 0x03, 0xce, 0xf2, 0x01,
+ 0xbf, 0xbd, 0x38, 0xa3, 0x29, 0xcb, 0xf3, 0xe3, 0xde, 0xfa, 0x00, 0x56, 0x53, 0x03, 0x38, 0x6f,
+ 0xd7, 0xb5, 0x5f, 0xc2, 0xcb, 0x4b, 0x4d, 0xe3, 0x4f, 0x61, 0x73, 0x6a, 0x9b, 0x76, 0x40, 0x3d,
+ 0xd7, 0xa3, 0x2c, 0x63, 0x45, 0x57, 0xf2, 0x7f, 0x56, 0xce, 0xc8, 0xb9, 0xe3, 0x24, 0x5b, 0x58,
+ 0x51, 0x37, 0xa6, 0x8b, 0xe0, 0xf5, 0x52, 0xf1, 0xbf, 0x2b, 0xe8, 0xd9, 0xb3, 0x67, 0xcf, 0x32,
+ 0xb5, 0xdf, 0x15, 0x60, 0x73, 0xd9, 0x9a, 0x59, 0xba, 0x7c, 0x2f, 0x40, 0xc1, 0x9e, 0x4e, 0x4e,
+ 0xa8, 0xc7, 0x83, 0x94, 0x57, 0xc3, 0x16, 0x6e, 0x40, 0xde, 0x22, 0x27, 0xd4, 0x92, 0x73, 0xdb,
+ 0xd2, 0x4e, 0xf5, 0xe6, 0x3b, 0xe7, 0x5a, 0x95, 0xf5, 0x43, 0xa6, 0xa2, 0x0a, 0x4d, 0xfc, 0x11,
+ 0xe4, 0xc2, 0x2d, 0x9a, 0x59, 0xb8, 0x7e, 0x3e, 0x0b, 0x6c, 0x2d, 0xa9, 0x5c, 0x0f, 0xbf, 0x02,
+ 0x25, 0xf6, 0x2b, 0x72, 0xa3, 0xc0, 0x7d, 0x2e, 0x32, 0x80, 0xe5, 0x05, 0xde, 0x82, 0x22, 0x5f,
+ 0x26, 0x06, 0x8d, 0x8e, 0xb6, 0xb8, 0xcd, 0x12, 0xcb, 0xa0, 0x43, 0x32, 0xb5, 0x02, 0xed, 0x31,
+ 0xb1, 0xa6, 0x94, 0x27, 0x7c, 0x49, 0xad, 0x84, 0xe0, 0xcf, 0x19, 0x86, 0x2f, 0x43, 0x59, 0xac,
+ 0x2a, 0xd3, 0x36, 0xe8, 0x53, 0xbe, 0x7b, 0xe6, 0x55, 0xb1, 0xd0, 0xda, 0x0c, 0x61, 0xdd, 0x3f,
+ 0xf4, 0x1d, 0x3b, 0x4a, 0x4d, 0xde, 0x05, 0x03, 0x78, 0xf7, 0x1f, 0xcc, 0x6f, 0xdc, 0xaf, 0x2d,
+ 0x1f, 0xde, 0x7c, 0x4e, 0xd5, 0xfe, 0x92, 0x81, 0x1c, 0xdf, 0x2f, 0xd6, 0xa0, 0x3c, 0xf8, 0xac,
+ 0xa7, 0x68, 0xad, 0xee, 0xf1, 0xfe, 0xa1, 0x82, 0x24, 0x5c, 0x05, 0xe0, 0xc0, 0xfd, 0xc3, 0x6e,
+ 0x63, 0x80, 0x32, 0x71, 0xbb, 0xdd, 0x19, 0xdc, 0xb9, 0x85, 0xb2, 0xb1, 0xc2, 0xb1, 0x00, 0x72,
+ 0x49, 0xc2, 0xfb, 0x37, 0x51, 0x1e, 0x23, 0xa8, 0x08, 0x03, 0xed, 0x4f, 0x95, 0xd6, 0x9d, 0x5b,
+ 0xa8, 0x90, 0x46, 0xde, 0xbf, 0x89, 0x56, 0xf0, 0x2a, 0x94, 0x38, 0xb2, 0xdf, 0xed, 0x1e, 0xa2,
+ 0x62, 0x6c, 0xb3, 0x3f, 0x50, 0xdb, 0x9d, 0x03, 0x54, 0x8a, 0x6d, 0x1e, 0xa8, 0xdd, 0xe3, 0x1e,
+ 0x82, 0xd8, 0xc2, 0x91, 0xd2, 0xef, 0x37, 0x0e, 0x14, 0x54, 0x8e, 0x19, 0xfb, 0x9f, 0x0d, 0x94,
+ 0x3e, 0xaa, 0xa4, 0xdc, 0x7a, 0xff, 0x26, 0x5a, 0x8d, 0xbb, 0x50, 0x3a, 0xc7, 0x47, 0xa8, 0x8a,
+ 0xd7, 0x61, 0x55, 0x74, 0x11, 0x39, 0xb1, 0x36, 0x07, 0xdd, 0xb9, 0x85, 0xd0, 0xcc, 0x11, 0x61,
+ 0x65, 0x3d, 0x05, 0xdc, 0xb9, 0x85, 0x70, 0xad, 0x09, 0x79, 0x9e, 0x5d, 0x18, 0x43, 0xf5, 0xb0,
+ 0xb1, 0xaf, 0x1c, 0x6a, 0xdd, 0xde, 0xa0, 0xdd, 0xed, 0x34, 0x0e, 0x91, 0x34, 0xc3, 0x54, 0xe5,
+ 0x67, 0xc7, 0x6d, 0x55, 0x69, 0xa1, 0x4c, 0x12, 0xeb, 0x29, 0x8d, 0x81, 0xd2, 0x42, 0xd9, 0x9a,
+ 0x0e, 0x9b, 0xcb, 0xf6, 0xc9, 0xa5, 0x2b, 0x23, 0x31, 0xc5, 0x99, 0x33, 0xa6, 0x98, 0xdb, 0x5a,
+ 0x98, 0xe2, 0x7f, 0x65, 0x60, 0x63, 0xc9, 0x59, 0xb1, 0xb4, 0x93, 0x1f, 0x43, 0x5e, 0xa4, 0xa8,
+ 0x38, 0x3d, 0xaf, 0x2d, 0x3d, 0x74, 0x78, 0xc2, 0x2e, 0x9c, 0xa0, 0x5c, 0x2f, 0x59, 0x41, 0x64,
+ 0xcf, 0xa8, 0x20, 0x98, 0x89, 0x85, 0x3d, 0xfd, 0x17, 0x0b, 0x7b, 0xba, 0x38, 0xf6, 0xee, 0x9c,
+ 0xe7, 0xd8, 0xe3, 0xd8, 0xb7, 0xdb, 0xdb, 0xf3, 0x4b, 0xf6, 0xf6, 0x7b, 0xb0, 0xbe, 0x60, 0xe8,
+ 0xdc, 0x7b, 0xec, 0xaf, 0x24, 0x90, 0xcf, 0x0a, 0xce, 0x73, 0x76, 0xba, 0x4c, 0x6a, 0xa7, 0xbb,
+ 0x37, 0x1f, 0xc1, 0x2b, 0x67, 0x4f, 0xc2, 0xc2, 0x5c, 0x7f, 0x25, 0xc1, 0x85, 0xe5, 0x95, 0xe2,
+ 0x52, 0x1f, 0x3e, 0x82, 0xc2, 0x84, 0x06, 0x63, 0x27, 0xaa, 0x96, 0xde, 0x5e, 0x72, 0x06, 0x33,
+ 0xf1, 0xfc, 0x64, 0x87, 0x5a, 0xc9, 0x43, 0x3c, 0x7b, 0x56, 0xb9, 0x27, 0xbc, 0x59, 0xf0, 0xf4,
+ 0xd7, 0x19, 0x78, 0x79, 0xa9, 0xf1, 0xa5, 0x8e, 0xbe, 0x06, 0x60, 0xda, 0xee, 0x34, 0x10, 0x15,
+ 0x91, 0xd8, 0x60, 0x4b, 0x1c, 0xe1, 0x9b, 0x17, 0xdb, 0x3c, 0xa7, 0x41, 0x2c, 0xcf, 0x72, 0x39,
+ 0x08, 0x88, 0x13, 0xee, 0xce, 0x1c, 0xcd, 0x71, 0x47, 0x5f, 0x3f, 0x63, 0xa4, 0x0b, 0x89, 0xf9,
+ 0x1e, 0x20, 0xdd, 0x32, 0xa9, 0x1d, 0x68, 0x7e, 0xe0, 0x51, 0x32, 0x31, 0xed, 0x11, 0x3f, 0x41,
+ 0x8a, 0x7b, 0xf9, 0x21, 0xb1, 0x7c, 0xaa, 0xae, 0x09, 0x71, 0x3f, 0x92, 0x32, 0x0d, 0x9e, 0x40,
+ 0x5e, 0x42, 0xa3, 0x90, 0xd2, 0x10, 0xe2, 0x58, 0xa3, 0xf6, 0xdb, 0x12, 0x94, 0x13, 0x75, 0x35,
+ 0xbe, 0x02, 0x95, 0x87, 0xe4, 0x31, 0xd1, 0xa2, 0xbb, 0x92, 0x88, 0x44, 0x99, 0x61, 0xbd, 0xf0,
+ 0xbe, 0xf4, 0x1e, 0x6c, 0x72, 0x8a, 0x33, 0x0d, 0xa8, 0xa7, 0xe9, 0x16, 0xf1, 0x7d, 0x1e, 0xb4,
+ 0x22, 0xa7, 0x62, 0x26, 0xeb, 0x32, 0x51, 0x33, 0x92, 0xe0, 0xdb, 0xb0, 0xc1, 0x35, 0x26, 0x53,
+ 0x2b, 0x30, 0x5d, 0x8b, 0x6a, 0xec, 0xf6, 0xe6, 0xf3, 0x93, 0x24, 0xf6, 0x6c, 0x9d, 0x31, 0x8e,
+ 0x42, 0x02, 0xf3, 0xc8, 0xc7, 0x2d, 0x78, 0x8d, 0xab, 0x8d, 0xa8, 0x4d, 0x3d, 0x12, 0x50, 0x8d,
+ 0x7e, 0x31, 0x25, 0x96, 0xaf, 0x11, 0xdb, 0xd0, 0xc6, 0xc4, 0x1f, 0xcb, 0x9b, 0xcc, 0xc0, 0x7e,
+ 0x46, 0x96, 0xd4, 0x4b, 0x8c, 0x78, 0x10, 0xf2, 0x14, 0x4e, 0x6b, 0xd8, 0xc6, 0xc7, 0xc4, 0x1f,
+ 0xe3, 0x3d, 0xb8, 0xc0, 0xad, 0xf8, 0x81, 0x67, 0xda, 0x23, 0x4d, 0x1f, 0x53, 0xfd, 0x91, 0x36,
+ 0x0d, 0x86, 0x77, 0xe5, 0x57, 0x92, 0xfd, 0x73, 0x0f, 0xfb, 0x9c, 0xd3, 0x64, 0x94, 0xe3, 0x60,
+ 0x78, 0x17, 0xf7, 0xa1, 0xc2, 0x26, 0x63, 0x62, 0x7e, 0x49, 0xb5, 0xa1, 0xe3, 0xf1, 0xa3, 0xb1,
+ 0xba, 0x64, 0x6b, 0x4a, 0x44, 0xb0, 0xde, 0x0d, 0x15, 0x8e, 0x1c, 0x83, 0xee, 0xe5, 0xfb, 0x3d,
+ 0x45, 0x69, 0xa9, 0xe5, 0xc8, 0xca, 0x7d, 0xc7, 0x63, 0x09, 0x35, 0x72, 0xe2, 0x00, 0x97, 0x45,
+ 0x42, 0x8d, 0x9c, 0x28, 0xbc, 0xb7, 0x61, 0x43, 0xd7, 0xc5, 0x98, 0x4d, 0x5d, 0x0b, 0xef, 0x58,
+ 0xbe, 0x8c, 0x52, 0xc1, 0xd2, 0xf5, 0x03, 0x41, 0x08, 0x73, 0xdc, 0xc7, 0x1f, 0xc2, 0xcb, 0xb3,
+ 0x60, 0x25, 0x15, 0xd7, 0x17, 0x46, 0x39, 0xaf, 0x7a, 0x1b, 0x36, 0xdc, 0xd3, 0x45, 0x45, 0x9c,
+ 0xea, 0xd1, 0x3d, 0x9d, 0x57, 0xfb, 0x00, 0x36, 0xdd, 0xb1, 0xbb, 0xa8, 0x77, 0x3d, 0xa9, 0x87,
+ 0xdd, 0xb1, 0x3b, 0xaf, 0xf8, 0x16, 0xbf, 0x70, 0x7b, 0x54, 0x27, 0x01, 0x35, 0xe4, 0x8b, 0x49,
+ 0x7a, 0x42, 0x80, 0x77, 0x01, 0xe9, 0xba, 0x46, 0x6d, 0x72, 0x62, 0x51, 0x8d, 0x78, 0xd4, 0x26,
+ 0xbe, 0x7c, 0x39, 0x49, 0xae, 0xea, 0xba, 0xc2, 0xa5, 0x0d, 0x2e, 0xc4, 0xd7, 0x61, 0xdd, 0x39,
+ 0x79, 0xa8, 0x8b, 0x94, 0xd4, 0x5c, 0x8f, 0x0e, 0xcd, 0xa7, 0xf2, 0x9b, 0x3c, 0xbe, 0x6b, 0x4c,
+ 0xc0, 0x13, 0xb2, 0xc7, 0x61, 0x7c, 0x0d, 0x90, 0xee, 0x8f, 0x89, 0xe7, 0xf2, 0x3d, 0xd9, 0x77,
+ 0x89, 0x4e, 0xe5, 0xb7, 0x04, 0x55, 0xe0, 0x9d, 0x08, 0x66, 0x4b, 0xc2, 0x7f, 0x62, 0x0e, 0x83,
+ 0xc8, 0xe2, 0x55, 0xb1, 0x24, 0x38, 0x16, 0x5a, 0xdb, 0x01, 0xc4, 0x42, 0x91, 0xea, 0x78, 0x87,
+ 0xd3, 0xaa, 0xee, 0xd8, 0x4d, 0xf6, 0xfb, 0x06, 0xac, 0x32, 0xe6, 0xac, 0xd3, 0x6b, 0xa2, 0x20,
+ 0x73, 0xc7, 0x89, 0x1e, 0x6f, 0xc1, 0x05, 0x46, 0x9a, 0xd0, 0x80, 0x18, 0x24, 0x20, 0x09, 0xf6,
+ 0xbb, 0x9c, 0xcd, 0xe2, 0x7e, 0x14, 0x0a, 0x53, 0x7e, 0x7a, 0xd3, 0x93, 0xd3, 0x38, 0xb3, 0x6e,
+ 0x08, 0x3f, 0x19, 0x16, 0xe5, 0xd6, 0xf7, 0x56, 0x74, 0xd7, 0xf6, 0xa0, 0x92, 0x4c, 0x7c, 0x5c,
+ 0x02, 0x91, 0xfa, 0x48, 0x62, 0x55, 0x50, 0xb3, 0xdb, 0x62, 0xf5, 0xcb, 0xe7, 0x0a, 0xca, 0xb0,
+ 0x3a, 0xea, 0xb0, 0x3d, 0x50, 0x34, 0xf5, 0xb8, 0x33, 0x68, 0x1f, 0x29, 0x28, 0x9b, 0x28, 0xd8,
+ 0x1f, 0xe4, 0x8a, 0x6f, 0xa3, 0xab, 0xb5, 0xaf, 0x33, 0x50, 0x4d, 0xdf, 0xc0, 0xf0, 0x8f, 0xe0,
+ 0x62, 0xf4, 0x5c, 0xe2, 0xd3, 0x40, 0x7b, 0x62, 0x7a, 0x7c, 0x45, 0x4e, 0x88, 0x38, 0x1d, 0xe3,
+ 0x9c, 0xd8, 0x0c, 0x59, 0x7d, 0x1a, 0x7c, 0x62, 0x7a, 0x6c, 0xbd, 0x4d, 0x48, 0x80, 0x0f, 0xe1,
+ 0xb2, 0xed, 0x68, 0x7e, 0x40, 0x6c, 0x83, 0x78, 0x86, 0x36, 0x7b, 0xa8, 0xd2, 0x88, 0xae, 0x53,
+ 0xdf, 0x77, 0xc4, 0x49, 0x18, 0x5b, 0x79, 0xd5, 0x76, 0xfa, 0x21, 0x79, 0x76, 0x44, 0x34, 0x42,
+ 0xea, 0x5c, 0xfe, 0x66, 0xcf, 0xca, 0xdf, 0x57, 0xa0, 0x34, 0x21, 0xae, 0x46, 0xed, 0xc0, 0x3b,
+ 0xe5, 0x75, 0x77, 0x51, 0x2d, 0x4e, 0x88, 0xab, 0xb0, 0xf6, 0x0b, 0xb9, 0xfe, 0x3c, 0xc8, 0x15,
+ 0x8b, 0xa8, 0xf4, 0x20, 0x57, 0x2c, 0x21, 0xa8, 0xfd, 0x33, 0x0b, 0x95, 0x64, 0x1d, 0xce, 0xae,
+ 0x35, 0x3a, 0x3f, 0xb2, 0x24, 0xbe, 0xa9, 0xbd, 0xf1, 0x8d, 0x55, 0x7b, 0xbd, 0xc9, 0xce, 0xb2,
+ 0xbd, 0x82, 0xa8, 0x8e, 0x55, 0xa1, 0xc9, 0xea, 0x08, 0x96, 0x6c, 0x54, 0x54, 0x23, 0x45, 0x35,
+ 0x6c, 0xe1, 0x03, 0x28, 0x3c, 0xf4, 0xb9, 0xed, 0x02, 0xb7, 0xfd, 0xe6, 0x37, 0xdb, 0x7e, 0xd0,
+ 0xe7, 0xc6, 0x4b, 0x0f, 0xfa, 0x5a, 0xa7, 0xab, 0x1e, 0x35, 0x0e, 0xd5, 0x50, 0x1d, 0x5f, 0x82,
+ 0x9c, 0x45, 0xbe, 0x3c, 0x4d, 0x9f, 0x7a, 0x1c, 0x3a, 0xef, 0x24, 0x5c, 0x82, 0xdc, 0x13, 0x4a,
+ 0x1e, 0xa5, 0xcf, 0x1a, 0x0e, 0x7d, 0x8f, 0x8b, 0x61, 0x17, 0xf2, 0x3c, 0x5e, 0x18, 0x20, 0x8c,
+ 0x18, 0x7a, 0x09, 0x17, 0x21, 0xd7, 0xec, 0xaa, 0x6c, 0x41, 0x20, 0xa8, 0x08, 0x54, 0xeb, 0xb5,
+ 0x95, 0xa6, 0x82, 0x32, 0xb5, 0xdb, 0x50, 0x10, 0x41, 0x60, 0x8b, 0x25, 0x0e, 0x03, 0x7a, 0x29,
+ 0x6c, 0x86, 0x36, 0xa4, 0x48, 0x7a, 0x7c, 0xb4, 0xaf, 0xa8, 0x28, 0x93, 0x9e, 0xea, 0x1c, 0xca,
+ 0xd7, 0x7c, 0xa8, 0x24, 0x0b, 0xf1, 0x17, 0x73, 0xc9, 0xfe, 0x9b, 0x04, 0xe5, 0x44, 0x61, 0xcd,
+ 0x2a, 0x22, 0x62, 0x59, 0xce, 0x13, 0x8d, 0x58, 0x26, 0xf1, 0xc3, 0xd4, 0x00, 0x0e, 0x35, 0x18,
+ 0x72, 0xde, 0xa9, 0x7b, 0x41, 0x4b, 0x24, 0x8f, 0x0a, 0xb5, 0x3f, 0x4a, 0x80, 0xe6, 0x2b, 0xdb,
+ 0x39, 0x37, 0xa5, 0x1f, 0xd2, 0xcd, 0xda, 0x1f, 0x24, 0xa8, 0xa6, 0xcb, 0xd9, 0x39, 0xf7, 0xae,
+ 0xfc, 0xa0, 0xee, 0xfd, 0x23, 0x03, 0xab, 0xa9, 0x22, 0xf6, 0xbc, 0xde, 0x7d, 0x01, 0xeb, 0xa6,
+ 0x41, 0x27, 0xae, 0x13, 0x50, 0x5b, 0x3f, 0xd5, 0x2c, 0xfa, 0x98, 0x5a, 0x72, 0x8d, 0x6f, 0x1a,
+ 0xbb, 0xdf, 0x5c, 0x26, 0xd7, 0xdb, 0x33, 0xbd, 0x43, 0xa6, 0xb6, 0xb7, 0xd1, 0x6e, 0x29, 0x47,
+ 0xbd, 0xee, 0x40, 0xe9, 0x34, 0x3f, 0xd3, 0x8e, 0x3b, 0x3f, 0xed, 0x74, 0x3f, 0xe9, 0xa8, 0xc8,
+ 0x9c, 0xa3, 0x7d, 0x8f, 0xcb, 0xbe, 0x07, 0x68, 0xde, 0x29, 0x7c, 0x11, 0x96, 0xb9, 0x85, 0x5e,
+ 0xc2, 0x1b, 0xb0, 0xd6, 0xe9, 0x6a, 0xfd, 0x76, 0x4b, 0xd1, 0x94, 0xfb, 0xf7, 0x95, 0xe6, 0xa0,
+ 0x2f, 0x1e, 0x3e, 0x62, 0xf6, 0x20, 0xb5, 0xc0, 0x6b, 0xbf, 0xcf, 0xc2, 0xc6, 0x12, 0x4f, 0x70,
+ 0x23, 0xbc, 0xb2, 0x88, 0x5b, 0xd4, 0x8d, 0xf3, 0x78, 0x5f, 0x67, 0x35, 0x43, 0x8f, 0x78, 0x41,
+ 0x78, 0xc3, 0xb9, 0x06, 0x2c, 0x4a, 0x76, 0x60, 0x0e, 0x4d, 0xea, 0x85, 0xef, 0x44, 0xe2, 0x1e,
+ 0xb3, 0x36, 0xc3, 0xc5, 0x53, 0xd1, 0xbb, 0x80, 0x5d, 0xc7, 0x37, 0x03, 0xf3, 0x31, 0xd5, 0x4c,
+ 0x3b, 0x7a, 0x54, 0x62, 0xf7, 0x9a, 0x9c, 0x8a, 0x22, 0x49, 0xdb, 0x0e, 0x62, 0xb6, 0x4d, 0x47,
+ 0x64, 0x8e, 0xcd, 0x36, 0xf3, 0xac, 0x8a, 0x22, 0x49, 0xcc, 0xbe, 0x02, 0x15, 0xc3, 0x99, 0xb2,
+ 0x62, 0x4f, 0xf0, 0xd8, 0xd9, 0x21, 0xa9, 0x65, 0x81, 0xc5, 0x94, 0xb0, 0x8c, 0x9f, 0xbd, 0x66,
+ 0x55, 0xd4, 0xb2, 0xc0, 0x04, 0xe5, 0x2a, 0xac, 0x91, 0xd1, 0xc8, 0x63, 0xc6, 0x23, 0x43, 0xe2,
+ 0x62, 0x52, 0x8d, 0x61, 0x4e, 0xdc, 0x7a, 0x00, 0xc5, 0x28, 0x0e, 0xec, 0xa8, 0x66, 0x91, 0xd0,
+ 0x5c, 0x71, 0xdb, 0xce, 0xec, 0x94, 0xd4, 0xa2, 0x1d, 0x09, 0xaf, 0x40, 0xc5, 0xf4, 0xb5, 0xd9,
+ 0xe3, 0x7c, 0x66, 0x3b, 0xb3, 0x53, 0x54, 0xcb, 0xa6, 0x1f, 0x3f, 0x6c, 0xd6, 0xbe, 0xca, 0x40,
+ 0x35, 0xfd, 0x71, 0x01, 0xb7, 0xa0, 0x68, 0x39, 0x3a, 0xe1, 0xa9, 0x25, 0xbe, 0x6c, 0xed, 0x3c,
+ 0xe7, 0x7b, 0x44, 0xfd, 0x30, 0xe4, 0xab, 0xb1, 0xe6, 0xd6, 0xdf, 0x25, 0x28, 0x46, 0x30, 0xbe,
+ 0x00, 0x39, 0x97, 0x04, 0x63, 0x6e, 0x2e, 0xbf, 0x9f, 0x41, 0x92, 0xca, 0xdb, 0x0c, 0xf7, 0x5d,
+ 0x62, 0xf3, 0x14, 0x08, 0x71, 0xd6, 0x66, 0xf3, 0x6a, 0x51, 0x62, 0xf0, 0x5b, 0x8f, 0x33, 0x99,
+ 0x50, 0x3b, 0xf0, 0xa3, 0x79, 0x0d, 0xf1, 0x66, 0x08, 0xe3, 0x77, 0x60, 0x3d, 0xf0, 0x88, 0x69,
+ 0xa5, 0xb8, 0x39, 0xce, 0x45, 0x91, 0x20, 0x26, 0xef, 0xc1, 0xa5, 0xc8, 0xae, 0x41, 0x03, 0xa2,
+ 0x8f, 0xa9, 0x31, 0x53, 0x2a, 0xf0, 0xd7, 0x8d, 0x8b, 0x21, 0xa1, 0x15, 0xca, 0x23, 0xdd, 0xda,
+ 0xd7, 0x12, 0xac, 0x47, 0xf7, 0x34, 0x23, 0x0e, 0xd6, 0x11, 0x00, 0xb1, 0x6d, 0x27, 0x48, 0x86,
+ 0x6b, 0x31, 0x95, 0x17, 0xf4, 0xea, 0x8d, 0x58, 0x49, 0x4d, 0x18, 0xd8, 0x9a, 0x00, 0xcc, 0x24,
+ 0x67, 0x86, 0xed, 0x32, 0x94, 0xc3, 0x2f, 0x47, 0xfc, 0xf3, 0xa3, 0xb8, 0xd9, 0x83, 0x80, 0xd8,
+ 0x85, 0x0e, 0x6f, 0x42, 0xfe, 0x84, 0x8e, 0x4c, 0x3b, 0x7c, 0x0f, 0x16, 0x8d, 0xe8, 0xfd, 0x25,
+ 0x17, 0xbf, 0xbf, 0xec, 0xff, 0x46, 0x82, 0x0d, 0xdd, 0x99, 0xcc, 0xfb, 0xbb, 0x8f, 0xe6, 0x9e,
+ 0x17, 0xfc, 0x8f, 0xa5, 0xcf, 0x3f, 0x1a, 0x99, 0xc1, 0x78, 0x7a, 0x52, 0xd7, 0x9d, 0xc9, 0xee,
+ 0xc8, 0xb1, 0x88, 0x3d, 0x9a, 0x7d, 0x3f, 0xe5, 0x7f, 0xf4, 0x1b, 0x23, 0x6a, 0xdf, 0x18, 0x39,
+ 0x89, 0xaf, 0xa9, 0xf7, 0x66, 0x7f, 0xff, 0x27, 0x49, 0x7f, 0xca, 0x64, 0x0f, 0x7a, 0xfb, 0x7f,
+ 0xce, 0x6c, 0x1d, 0x88, 0xee, 0x7a, 0x51, 0x78, 0x54, 0x3a, 0xb4, 0xa8, 0xce, 0x86, 0xfc, 0xff,
+ 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xe8, 0xef, 0xc4, 0x9b, 0x1d, 0x00, 0x00,
+}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
new file mode 100644
index 000000000..6f4a902b5
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
@@ -0,0 +1,2806 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2010 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// 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.
+
+/*
+ The code generator for the plugin for the Google protocol buffer compiler.
+ It generates Go code from the protocol buffer description files read by the
+ main routine.
+*/
+package generator
+
+import (
+ "bufio"
+ "bytes"
+ "compress/gzip"
+ "crypto/sha256"
+ "encoding/hex"
+ "fmt"
+ "go/ast"
+ "go/build"
+ "go/parser"
+ "go/printer"
+ "go/token"
+ "log"
+ "os"
+ "path"
+ "sort"
+ "strconv"
+ "strings"
+ "unicode"
+ "unicode/utf8"
+
+ "github.com/golang/protobuf/proto"
+ "github.com/golang/protobuf/protoc-gen-go/generator/internal/remap"
+
+ "github.com/golang/protobuf/protoc-gen-go/descriptor"
+ plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
+)
+
+// generatedCodeVersion indicates a version of the generated code.
+// It is incremented whenever an incompatibility between the generated code and
+// proto package is introduced; the generated code references
+// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
+const generatedCodeVersion = 3
+
+// A Plugin provides functionality to add to the output during Go code generation,
+// such as to produce RPC stubs.
+type Plugin interface {
+ // Name identifies the plugin.
+ Name() string
+ // Init is called once after data structures are built but before
+ // code generation begins.
+ Init(g *Generator)
+ // Generate produces the code generated by the plugin for this file,
+ // except for the imports, by calling the generator's methods P, In, and Out.
+ Generate(file *FileDescriptor)
+ // GenerateImports produces the import declarations for this file.
+ // It is called after Generate.
+ GenerateImports(file *FileDescriptor)
+}
+
+var plugins []Plugin
+
+// RegisterPlugin installs a (second-order) plugin to be run when the Go output is generated.
+// It is typically called during initialization.
+func RegisterPlugin(p Plugin) {
+ plugins = append(plugins, p)
+}
+
+// A GoImportPath is the import path of a Go package. e.g., "google.golang.org/genproto/protobuf".
+type GoImportPath string
+
+func (p GoImportPath) String() string { return strconv.Quote(string(p)) }
+
+// A GoPackageName is the name of a Go package. e.g., "protobuf".
+type GoPackageName string
+
+// Each type we import as a protocol buffer (other than FileDescriptorProto) needs
+// a pointer to the FileDescriptorProto that represents it. These types achieve that
+// wrapping by placing each Proto inside a struct with the pointer to its File. The
+// structs have the same names as their contents, with "Proto" removed.
+// FileDescriptor is used to store the things that it points to.
+
+// The file and package name method are common to messages and enums.
+type common struct {
+ file *FileDescriptor // File this object comes from.
+}
+
+// GoImportPath is the import path of the Go package containing the type.
+func (c *common) GoImportPath() GoImportPath {
+ return c.file.importPath
+}
+
+func (c *common) File() *FileDescriptor { return c.file }
+
+func fileIsProto3(file *descriptor.FileDescriptorProto) bool {
+ return file.GetSyntax() == "proto3"
+}
+
+func (c *common) proto3() bool { return fileIsProto3(c.file.FileDescriptorProto) }
+
+// Descriptor represents a protocol buffer message.
+type Descriptor struct {
+ common
+ *descriptor.DescriptorProto
+ parent *Descriptor // The containing message, if any.
+ nested []*Descriptor // Inner messages, if any.
+ enums []*EnumDescriptor // Inner enums, if any.
+ ext []*ExtensionDescriptor // Extensions, if any.
+ typename []string // Cached typename vector.
+ index int // The index into the container, whether the file or another message.
+ path string // The SourceCodeInfo path as comma-separated integers.
+ group bool
+}
+
+// TypeName returns the elements of the dotted type name.
+// The package name is not part of this name.
+func (d *Descriptor) TypeName() []string {
+ if d.typename != nil {
+ return d.typename
+ }
+ n := 0
+ for parent := d; parent != nil; parent = parent.parent {
+ n++
+ }
+ s := make([]string, n)
+ for parent := d; parent != nil; parent = parent.parent {
+ n--
+ s[n] = parent.GetName()
+ }
+ d.typename = s
+ return s
+}
+
+// EnumDescriptor describes an enum. If it's at top level, its parent will be nil.
+// Otherwise it will be the descriptor of the message in which it is defined.
+type EnumDescriptor struct {
+ common
+ *descriptor.EnumDescriptorProto
+ parent *Descriptor // The containing message, if any.
+ typename []string // Cached typename vector.
+ index int // The index into the container, whether the file or a message.
+ path string // The SourceCodeInfo path as comma-separated integers.
+}
+
+// TypeName returns the elements of the dotted type name.
+// The package name is not part of this name.
+func (e *EnumDescriptor) TypeName() (s []string) {
+ if e.typename != nil {
+ return e.typename
+ }
+ name := e.GetName()
+ if e.parent == nil {
+ s = make([]string, 1)
+ } else {
+ pname := e.parent.TypeName()
+ s = make([]string, len(pname)+1)
+ copy(s, pname)
+ }
+ s[len(s)-1] = name
+ e.typename = s
+ return s
+}
+
+// Everything but the last element of the full type name, CamelCased.
+// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .
+func (e *EnumDescriptor) prefix() string {
+ if e.parent == nil {
+ // If the enum is not part of a message, the prefix is just the type name.
+ return CamelCase(*e.Name) + "_"
+ }
+ typeName := e.TypeName()
+ return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_"
+}
+
+// The integer value of the named constant in this enumerated type.
+func (e *EnumDescriptor) integerValueAsString(name string) string {
+ for _, c := range e.Value {
+ if c.GetName() == name {
+ return fmt.Sprint(c.GetNumber())
+ }
+ }
+ log.Fatal("cannot find value for enum constant")
+ return ""
+}
+
+// ExtensionDescriptor describes an extension. If it's at top level, its parent will be nil.
+// Otherwise it will be the descriptor of the message in which it is defined.
+type ExtensionDescriptor struct {
+ common
+ *descriptor.FieldDescriptorProto
+ parent *Descriptor // The containing message, if any.
+}
+
+// TypeName returns the elements of the dotted type name.
+// The package name is not part of this name.
+func (e *ExtensionDescriptor) TypeName() (s []string) {
+ name := e.GetName()
+ if e.parent == nil {
+ // top-level extension
+ s = make([]string, 1)
+ } else {
+ pname := e.parent.TypeName()
+ s = make([]string, len(pname)+1)
+ copy(s, pname)
+ }
+ s[len(s)-1] = name
+ return s
+}
+
+// DescName returns the variable name used for the generated descriptor.
+func (e *ExtensionDescriptor) DescName() string {
+ // The full type name.
+ typeName := e.TypeName()
+ // Each scope of the extension is individually CamelCased, and all are joined with "_" with an "E_" prefix.
+ for i, s := range typeName {
+ typeName[i] = CamelCase(s)
+ }
+ return "E_" + strings.Join(typeName, "_")
+}
+
+// ImportedDescriptor describes a type that has been publicly imported from another file.
+type ImportedDescriptor struct {
+ common
+ o Object
+}
+
+func (id *ImportedDescriptor) TypeName() []string { return id.o.TypeName() }
+
+// FileDescriptor describes an protocol buffer descriptor file (.proto).
+// It includes slices of all the messages and enums defined within it.
+// Those slices are constructed by WrapTypes.
+type FileDescriptor struct {
+ *descriptor.FileDescriptorProto
+ desc []*Descriptor // All the messages defined in this file.
+ enum []*EnumDescriptor // All the enums defined in this file.
+ ext []*ExtensionDescriptor // All the top-level extensions defined in this file.
+ imp []*ImportedDescriptor // All types defined in files publicly imported by this file.
+
+ // Comments, stored as a map of path (comma-separated integers) to the comment.
+ comments map[string]*descriptor.SourceCodeInfo_Location
+
+ // The full list of symbols that are exported,
+ // as a map from the exported object to its symbols.
+ // This is used for supporting public imports.
+ exported map[Object][]symbol
+
+ importPath GoImportPath // Import path of this file's package.
+ packageName GoPackageName // Name of this file's Go package.
+
+ proto3 bool // whether to generate proto3 code for this file
+}
+
+// VarName is the variable name we'll use in the generated code to refer
+// to the compressed bytes of this descriptor. It is not exported, so
+// it is only valid inside the generated package.
+func (d *FileDescriptor) VarName() string {
+ h := sha256.Sum256([]byte(d.GetName()))
+ return fmt.Sprintf("fileDescriptor_%s", hex.EncodeToString(h[:8]))
+}
+
+// goPackageOption interprets the file's go_package option.
+// If there is no go_package, it returns ("", "", false).
+// If there's a simple name, it returns ("", pkg, true).
+// If the option implies an import path, it returns (impPath, pkg, true).
+func (d *FileDescriptor) goPackageOption() (impPath GoImportPath, pkg GoPackageName, ok bool) {
+ opt := d.GetOptions().GetGoPackage()
+ if opt == "" {
+ return "", "", false
+ }
+ // A semicolon-delimited suffix delimits the import path and package name.
+ sc := strings.Index(opt, ";")
+ if sc >= 0 {
+ return GoImportPath(opt[:sc]), cleanPackageName(opt[sc+1:]), true
+ }
+ // The presence of a slash implies there's an import path.
+ slash := strings.LastIndex(opt, "/")
+ if slash >= 0 {
+ return GoImportPath(opt), cleanPackageName(opt[slash+1:]), true
+ }
+ return "", cleanPackageName(opt), true
+}
+
+// goFileName returns the output name for the generated Go file.
+func (d *FileDescriptor) goFileName(pathType pathType) string {
+ name := *d.Name
+ if ext := path.Ext(name); ext == ".proto" || ext == ".protodevel" {
+ name = name[:len(name)-len(ext)]
+ }
+ name += ".pb.go"
+
+ if pathType == pathTypeSourceRelative {
+ return name
+ }
+
+ // Does the file have a "go_package" option?
+ // If it does, it may override the filename.
+ if impPath, _, ok := d.goPackageOption(); ok && impPath != "" {
+ // Replace the existing dirname with the declared import path.
+ _, name = path.Split(name)
+ name = path.Join(string(impPath), name)
+ return name
+ }
+
+ return name
+}
+
+func (d *FileDescriptor) addExport(obj Object, sym symbol) {
+ d.exported[obj] = append(d.exported[obj], sym)
+}
+
+// symbol is an interface representing an exported Go symbol.
+type symbol interface {
+ // GenerateAlias should generate an appropriate alias
+ // for the symbol from the named package.
+ GenerateAlias(g *Generator, filename string, pkg GoPackageName)
+}
+
+type messageSymbol struct {
+ sym string
+ hasExtensions, isMessageSet bool
+ oneofTypes []string
+}
+
+type getterSymbol struct {
+ name string
+ typ string
+ typeName string // canonical name in proto world; empty for proto.Message and similar
+ genType bool // whether typ contains a generated type (message/group/enum)
+}
+
+func (ms *messageSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
+ g.P("// ", ms.sym, " from public import ", filename)
+ g.P("type ", ms.sym, " = ", pkg, ".", ms.sym)
+ for _, name := range ms.oneofTypes {
+ g.P("type ", name, " = ", pkg, ".", name)
+ }
+}
+
+type enumSymbol struct {
+ name string
+ proto3 bool // Whether this came from a proto3 file.
+}
+
+func (es enumSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
+ s := es.name
+ g.P("// ", s, " from public import ", filename)
+ g.P("type ", s, " = ", pkg, ".", s)
+ g.P("var ", s, "_name = ", pkg, ".", s, "_name")
+ g.P("var ", s, "_value = ", pkg, ".", s, "_value")
+}
+
+type constOrVarSymbol struct {
+ sym string
+ typ string // either "const" or "var"
+ cast string // if non-empty, a type cast is required (used for enums)
+}
+
+func (cs constOrVarSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
+ v := string(pkg) + "." + cs.sym
+ if cs.cast != "" {
+ v = cs.cast + "(" + v + ")"
+ }
+ g.P(cs.typ, " ", cs.sym, " = ", v)
+}
+
+// Object is an interface abstracting the abilities shared by enums, messages, extensions and imported objects.
+type Object interface {
+ GoImportPath() GoImportPath
+ TypeName() []string
+ File() *FileDescriptor
+}
+
+// Generator is the type whose methods generate the output, stored in the associated response structure.
+type Generator struct {
+ *bytes.Buffer
+
+ Request *plugin.CodeGeneratorRequest // The input.
+ Response *plugin.CodeGeneratorResponse // The output.
+
+ Param map[string]string // Command-line parameters.
+ PackageImportPath string // Go import path of the package we're generating code for
+ ImportPrefix string // String to prefix to imported package file names.
+ ImportMap map[string]string // Mapping from .proto file name to import path
+
+ Pkg map[string]string // The names under which we import support packages
+
+ outputImportPath GoImportPath // Package we're generating code for.
+ allFiles []*FileDescriptor // All files in the tree
+ allFilesByName map[string]*FileDescriptor // All files by filename.
+ genFiles []*FileDescriptor // Those files we will generate output for.
+ file *FileDescriptor // The file we are compiling now.
+ packageNames map[GoImportPath]GoPackageName // Imported package names in the current file.
+ usedPackages map[GoImportPath]bool // Packages used in current file.
+ usedPackageNames map[GoPackageName]bool // Package names used in the current file.
+ addedImports map[GoImportPath]bool // Additional imports to emit.
+ typeNameToObject map[string]Object // Key is a fully-qualified name in input syntax.
+ init []string // Lines to emit in the init function.
+ indent string
+ pathType pathType // How to generate output filenames.
+ writeOutput bool
+ annotateCode bool // whether to store annotations
+ annotations []*descriptor.GeneratedCodeInfo_Annotation // annotations to store
+}
+
+type pathType int
+
+const (
+ pathTypeImport pathType = iota
+ pathTypeSourceRelative
+)
+
+// New creates a new generator and allocates the request and response protobufs.
+func New() *Generator {
+ g := new(Generator)
+ g.Buffer = new(bytes.Buffer)
+ g.Request = new(plugin.CodeGeneratorRequest)
+ g.Response = new(plugin.CodeGeneratorResponse)
+ return g
+}
+
+// Error reports a problem, including an error, and exits the program.
+func (g *Generator) Error(err error, msgs ...string) {
+ s := strings.Join(msgs, " ") + ":" + err.Error()
+ log.Print("protoc-gen-go: error:", s)
+ os.Exit(1)
+}
+
+// Fail reports a problem and exits the program.
+func (g *Generator) Fail(msgs ...string) {
+ s := strings.Join(msgs, " ")
+ log.Print("protoc-gen-go: error:", s)
+ os.Exit(1)
+}
+
+// CommandLineParameters breaks the comma-separated list of key=value pairs
+// in the parameter (a member of the request protobuf) into a key/value map.
+// It then sets file name mappings defined by those entries.
+func (g *Generator) CommandLineParameters(parameter string) {
+ g.Param = make(map[string]string)
+ for _, p := range strings.Split(parameter, ",") {
+ if i := strings.Index(p, "="); i < 0 {
+ g.Param[p] = ""
+ } else {
+ g.Param[p[0:i]] = p[i+1:]
+ }
+ }
+
+ g.ImportMap = make(map[string]string)
+ pluginList := "none" // Default list of plugin names to enable (empty means all).
+ for k, v := range g.Param {
+ switch k {
+ case "import_prefix":
+ g.ImportPrefix = v
+ case "import_path":
+ g.PackageImportPath = v
+ case "paths":
+ switch v {
+ case "import":
+ g.pathType = pathTypeImport
+ case "source_relative":
+ g.pathType = pathTypeSourceRelative
+ default:
+ g.Fail(fmt.Sprintf(`Unknown path type %q: want "import" or "source_relative".`, v))
+ }
+ case "plugins":
+ pluginList = v
+ case "annotate_code":
+ if v == "true" {
+ g.annotateCode = true
+ }
+ default:
+ if len(k) > 0 && k[0] == 'M' {
+ g.ImportMap[k[1:]] = v
+ }
+ }
+ }
+ if pluginList != "" {
+ // Amend the set of plugins.
+ enabled := make(map[string]bool)
+ for _, name := range strings.Split(pluginList, "+") {
+ enabled[name] = true
+ }
+ var nplugins []Plugin
+ for _, p := range plugins {
+ if enabled[p.Name()] {
+ nplugins = append(nplugins, p)
+ }
+ }
+ plugins = nplugins
+ }
+}
+
+// DefaultPackageName returns the package name printed for the object.
+// If its file is in a different package, it returns the package name we're using for this file, plus ".".
+// Otherwise it returns the empty string.
+func (g *Generator) DefaultPackageName(obj Object) string {
+ importPath := obj.GoImportPath()
+ if importPath == g.outputImportPath {
+ return ""
+ }
+ return string(g.GoPackageName(importPath)) + "."
+}
+
+// GoPackageName returns the name used for a package.
+func (g *Generator) GoPackageName(importPath GoImportPath) GoPackageName {
+ if name, ok := g.packageNames[importPath]; ok {
+ return name
+ }
+ name := cleanPackageName(baseName(string(importPath)))
+ for i, orig := 1, name; g.usedPackageNames[name] || isGoPredeclaredIdentifier[string(name)]; i++ {
+ name = orig + GoPackageName(strconv.Itoa(i))
+ }
+ g.packageNames[importPath] = name
+ g.usedPackageNames[name] = true
+ return name
+}
+
+// AddImport adds a package to the generated file's import section.
+// It returns the name used for the package.
+func (g *Generator) AddImport(importPath GoImportPath) GoPackageName {
+ g.addedImports[importPath] = true
+ return g.GoPackageName(importPath)
+}
+
+var globalPackageNames = map[GoPackageName]bool{
+ "fmt": true,
+ "math": true,
+ "proto": true,
+}
+
+// Create and remember a guaranteed unique package name. Pkg is the candidate name.
+// The FileDescriptor parameter is unused.
+func RegisterUniquePackageName(pkg string, f *FileDescriptor) string {
+ name := cleanPackageName(pkg)
+ for i, orig := 1, name; globalPackageNames[name]; i++ {
+ name = orig + GoPackageName(strconv.Itoa(i))
+ }
+ globalPackageNames[name] = true
+ return string(name)
+}
+
+var isGoKeyword = map[string]bool{
+ "break": true,
+ "case": true,
+ "chan": true,
+ "const": true,
+ "continue": true,
+ "default": true,
+ "else": true,
+ "defer": true,
+ "fallthrough": true,
+ "for": true,
+ "func": true,
+ "go": true,
+ "goto": true,
+ "if": true,
+ "import": true,
+ "interface": true,
+ "map": true,
+ "package": true,
+ "range": true,
+ "return": true,
+ "select": true,
+ "struct": true,
+ "switch": true,
+ "type": true,
+ "var": true,
+}
+
+var isGoPredeclaredIdentifier = map[string]bool{
+ "append": true,
+ "bool": true,
+ "byte": true,
+ "cap": true,
+ "close": true,
+ "complex": true,
+ "complex128": true,
+ "complex64": true,
+ "copy": true,
+ "delete": true,
+ "error": true,
+ "false": true,
+ "float32": true,
+ "float64": true,
+ "imag": true,
+ "int": true,
+ "int16": true,
+ "int32": true,
+ "int64": true,
+ "int8": true,
+ "iota": true,
+ "len": true,
+ "make": true,
+ "new": true,
+ "nil": true,
+ "panic": true,
+ "print": true,
+ "println": true,
+ "real": true,
+ "recover": true,
+ "rune": true,
+ "string": true,
+ "true": true,
+ "uint": true,
+ "uint16": true,
+ "uint32": true,
+ "uint64": true,
+ "uint8": true,
+ "uintptr": true,
+}
+
+func cleanPackageName(name string) GoPackageName {
+ name = strings.Map(badToUnderscore, name)
+ // Identifier must not be keyword or predeclared identifier: insert _.
+ if isGoKeyword[name] {
+ name = "_" + name
+ }
+ // Identifier must not begin with digit: insert _.
+ if r, _ := utf8.DecodeRuneInString(name); unicode.IsDigit(r) {
+ name = "_" + name
+ }
+ return GoPackageName(name)
+}
+
+// defaultGoPackage returns the package name to use,
+// derived from the import path of the package we're building code for.
+func (g *Generator) defaultGoPackage() GoPackageName {
+ p := g.PackageImportPath
+ if i := strings.LastIndex(p, "/"); i >= 0 {
+ p = p[i+1:]
+ }
+ return cleanPackageName(p)
+}
+
+// SetPackageNames sets the package name for this run.
+// The package name must agree across all files being generated.
+// It also defines unique package names for all imported files.
+func (g *Generator) SetPackageNames() {
+ g.outputImportPath = g.genFiles[0].importPath
+
+ defaultPackageNames := make(map[GoImportPath]GoPackageName)
+ for _, f := range g.genFiles {
+ if _, p, ok := f.goPackageOption(); ok {
+ defaultPackageNames[f.importPath] = p
+ }
+ }
+ for _, f := range g.genFiles {
+ if _, p, ok := f.goPackageOption(); ok {
+ // Source file: option go_package = "quux/bar";
+ f.packageName = p
+ } else if p, ok := defaultPackageNames[f.importPath]; ok {
+ // A go_package option in another file in the same package.
+ //
+ // This is a poor choice in general, since every source file should
+ // contain a go_package option. Supported mainly for historical
+ // compatibility.
+ f.packageName = p
+ } else if p := g.defaultGoPackage(); p != "" {
+ // Command-line: import_path=quux/bar.
+ //
+ // The import_path flag sets a package name for files which don't
+ // contain a go_package option.
+ f.packageName = p
+ } else if p := f.GetPackage(); p != "" {
+ // Source file: package quux.bar;
+ f.packageName = cleanPackageName(p)
+ } else {
+ // Source filename.
+ f.packageName = cleanPackageName(baseName(f.GetName()))
+ }
+ }
+
+ // Check that all files have a consistent package name and import path.
+ for _, f := range g.genFiles[1:] {
+ if a, b := g.genFiles[0].importPath, f.importPath; a != b {
+ g.Fail(fmt.Sprintf("inconsistent package import paths: %v, %v", a, b))
+ }
+ if a, b := g.genFiles[0].packageName, f.packageName; a != b {
+ g.Fail(fmt.Sprintf("inconsistent package names: %v, %v", a, b))
+ }
+ }
+
+ // Names of support packages. These never vary (if there are conflicts,
+ // we rename the conflicting package), so this could be removed someday.
+ g.Pkg = map[string]string{
+ "fmt": "fmt",
+ "math": "math",
+ "proto": "proto",
+ }
+}
+
+// WrapTypes walks the incoming data, wrapping DescriptorProtos, EnumDescriptorProtos
+// and FileDescriptorProtos into file-referenced objects within the Generator.
+// It also creates the list of files to generate and so should be called before GenerateAllFiles.
+func (g *Generator) WrapTypes() {
+ g.allFiles = make([]*FileDescriptor, 0, len(g.Request.ProtoFile))
+ g.allFilesByName = make(map[string]*FileDescriptor, len(g.allFiles))
+ genFileNames := make(map[string]bool)
+ for _, n := range g.Request.FileToGenerate {
+ genFileNames[n] = true
+ }
+ for _, f := range g.Request.ProtoFile {
+ fd := &FileDescriptor{
+ FileDescriptorProto: f,
+ exported: make(map[Object][]symbol),
+ proto3: fileIsProto3(f),
+ }
+ // The import path may be set in a number of ways.
+ if substitution, ok := g.ImportMap[f.GetName()]; ok {
+ // Command-line: M=foo.proto=quux/bar.
+ //
+ // Explicit mapping of source file to import path.
+ fd.importPath = GoImportPath(substitution)
+ } else if genFileNames[f.GetName()] && g.PackageImportPath != "" {
+ // Command-line: import_path=quux/bar.
+ //
+ // The import_path flag sets the import path for every file that
+ // we generate code for.
+ fd.importPath = GoImportPath(g.PackageImportPath)
+ } else if p, _, _ := fd.goPackageOption(); p != "" {
+ // Source file: option go_package = "quux/bar";
+ //
+ // The go_package option sets the import path. Most users should use this.
+ fd.importPath = p
+ } else {
+ // Source filename.
+ //
+ // Last resort when nothing else is available.
+ fd.importPath = GoImportPath(path.Dir(f.GetName()))
+ }
+ // We must wrap the descriptors before we wrap the enums
+ fd.desc = wrapDescriptors(fd)
+ g.buildNestedDescriptors(fd.desc)
+ fd.enum = wrapEnumDescriptors(fd, fd.desc)
+ g.buildNestedEnums(fd.desc, fd.enum)
+ fd.ext = wrapExtensions(fd)
+ extractComments(fd)
+ g.allFiles = append(g.allFiles, fd)
+ g.allFilesByName[f.GetName()] = fd
+ }
+ for _, fd := range g.allFiles {
+ fd.imp = wrapImported(fd, g)
+ }
+
+ g.genFiles = make([]*FileDescriptor, 0, len(g.Request.FileToGenerate))
+ for _, fileName := range g.Request.FileToGenerate {
+ fd := g.allFilesByName[fileName]
+ if fd == nil {
+ g.Fail("could not find file named", fileName)
+ }
+ g.genFiles = append(g.genFiles, fd)
+ }
+}
+
+// Scan the descriptors in this file. For each one, build the slice of nested descriptors
+func (g *Generator) buildNestedDescriptors(descs []*Descriptor) {
+ for _, desc := range descs {
+ if len(desc.NestedType) != 0 {
+ for _, nest := range descs {
+ if nest.parent == desc {
+ desc.nested = append(desc.nested, nest)
+ }
+ }
+ if len(desc.nested) != len(desc.NestedType) {
+ g.Fail("internal error: nesting failure for", desc.GetName())
+ }
+ }
+ }
+}
+
+func (g *Generator) buildNestedEnums(descs []*Descriptor, enums []*EnumDescriptor) {
+ for _, desc := range descs {
+ if len(desc.EnumType) != 0 {
+ for _, enum := range enums {
+ if enum.parent == desc {
+ desc.enums = append(desc.enums, enum)
+ }
+ }
+ if len(desc.enums) != len(desc.EnumType) {
+ g.Fail("internal error: enum nesting failure for", desc.GetName())
+ }
+ }
+ }
+}
+
+// Construct the Descriptor
+func newDescriptor(desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *Descriptor {
+ d := &Descriptor{
+ common: common{file},
+ DescriptorProto: desc,
+ parent: parent,
+ index: index,
+ }
+ if parent == nil {
+ d.path = fmt.Sprintf("%d,%d", messagePath, index)
+ } else {
+ d.path = fmt.Sprintf("%s,%d,%d", parent.path, messageMessagePath, index)
+ }
+
+ // The only way to distinguish a group from a message is whether
+ // the containing message has a TYPE_GROUP field that matches.
+ if parent != nil {
+ parts := d.TypeName()
+ if file.Package != nil {
+ parts = append([]string{*file.Package}, parts...)
+ }
+ exp := "." + strings.Join(parts, ".")
+ for _, field := range parent.Field {
+ if field.GetType() == descriptor.FieldDescriptorProto_TYPE_GROUP && field.GetTypeName() == exp {
+ d.group = true
+ break
+ }
+ }
+ }
+
+ for _, field := range desc.Extension {
+ d.ext = append(d.ext, &ExtensionDescriptor{common{file}, field, d})
+ }
+
+ return d
+}
+
+// Return a slice of all the Descriptors defined within this file
+func wrapDescriptors(file *FileDescriptor) []*Descriptor {
+ sl := make([]*Descriptor, 0, len(file.MessageType)+10)
+ for i, desc := range file.MessageType {
+ sl = wrapThisDescriptor(sl, desc, nil, file, i)
+ }
+ return sl
+}
+
+// Wrap this Descriptor, recursively
+func wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) []*Descriptor {
+ sl = append(sl, newDescriptor(desc, parent, file, index))
+ me := sl[len(sl)-1]
+ for i, nested := range desc.NestedType {
+ sl = wrapThisDescriptor(sl, nested, me, file, i)
+ }
+ return sl
+}
+
+// Construct the EnumDescriptor
+func newEnumDescriptor(desc *descriptor.EnumDescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *EnumDescriptor {
+ ed := &EnumDescriptor{
+ common: common{file},
+ EnumDescriptorProto: desc,
+ parent: parent,
+ index: index,
+ }
+ if parent == nil {
+ ed.path = fmt.Sprintf("%d,%d", enumPath, index)
+ } else {
+ ed.path = fmt.Sprintf("%s,%d,%d", parent.path, messageEnumPath, index)
+ }
+ return ed
+}
+
+// Return a slice of all the EnumDescriptors defined within this file
+func wrapEnumDescriptors(file *FileDescriptor, descs []*Descriptor) []*EnumDescriptor {
+ sl := make([]*EnumDescriptor, 0, len(file.EnumType)+10)
+ // Top-level enums.
+ for i, enum := range file.EnumType {
+ sl = append(sl, newEnumDescriptor(enum, nil, file, i))
+ }
+ // Enums within messages. Enums within embedded messages appear in the outer-most message.
+ for _, nested := range descs {
+ for i, enum := range nested.EnumType {
+ sl = append(sl, newEnumDescriptor(enum, nested, file, i))
+ }
+ }
+ return sl
+}
+
+// Return a slice of all the top-level ExtensionDescriptors defined within this file.
+func wrapExtensions(file *FileDescriptor) []*ExtensionDescriptor {
+ var sl []*ExtensionDescriptor
+ for _, field := range file.Extension {
+ sl = append(sl, &ExtensionDescriptor{common{file}, field, nil})
+ }
+ return sl
+}
+
+// Return a slice of all the types that are publicly imported into this file.
+func wrapImported(file *FileDescriptor, g *Generator) (sl []*ImportedDescriptor) {
+ for _, index := range file.PublicDependency {
+ df := g.fileByName(file.Dependency[index])
+ for _, d := range df.desc {
+ if d.GetOptions().GetMapEntry() {
+ continue
+ }
+ sl = append(sl, &ImportedDescriptor{common{file}, d})
+ }
+ for _, e := range df.enum {
+ sl = append(sl, &ImportedDescriptor{common{file}, e})
+ }
+ for _, ext := range df.ext {
+ sl = append(sl, &ImportedDescriptor{common{file}, ext})
+ }
+ }
+ return
+}
+
+func extractComments(file *FileDescriptor) {
+ file.comments = make(map[string]*descriptor.SourceCodeInfo_Location)
+ for _, loc := range file.GetSourceCodeInfo().GetLocation() {
+ if loc.LeadingComments == nil {
+ continue
+ }
+ var p []string
+ for _, n := range loc.Path {
+ p = append(p, strconv.Itoa(int(n)))
+ }
+ file.comments[strings.Join(p, ",")] = loc
+ }
+}
+
+// BuildTypeNameMap builds the map from fully qualified type names to objects.
+// The key names for the map come from the input data, which puts a period at the beginning.
+// It should be called after SetPackageNames and before GenerateAllFiles.
+func (g *Generator) BuildTypeNameMap() {
+ g.typeNameToObject = make(map[string]Object)
+ for _, f := range g.allFiles {
+ // The names in this loop are defined by the proto world, not us, so the
+ // package name may be empty. If so, the dotted package name of X will
+ // be ".X"; otherwise it will be ".pkg.X".
+ dottedPkg := "." + f.GetPackage()
+ if dottedPkg != "." {
+ dottedPkg += "."
+ }
+ for _, enum := range f.enum {
+ name := dottedPkg + dottedSlice(enum.TypeName())
+ g.typeNameToObject[name] = enum
+ }
+ for _, desc := range f.desc {
+ name := dottedPkg + dottedSlice(desc.TypeName())
+ g.typeNameToObject[name] = desc
+ }
+ }
+}
+
+// ObjectNamed, given a fully-qualified input type name as it appears in the input data,
+// returns the descriptor for the message or enum with that name.
+func (g *Generator) ObjectNamed(typeName string) Object {
+ o, ok := g.typeNameToObject[typeName]
+ if !ok {
+ g.Fail("can't find object with type", typeName)
+ }
+ return o
+}
+
+// AnnotatedAtoms is a list of atoms (as consumed by P) that records the file name and proto AST path from which they originated.
+type AnnotatedAtoms struct {
+ source string
+ path string
+ atoms []interface{}
+}
+
+// Annotate records the file name and proto AST path of a list of atoms
+// so that a later call to P can emit a link from each atom to its origin.
+func Annotate(file *FileDescriptor, path string, atoms ...interface{}) *AnnotatedAtoms {
+ return &AnnotatedAtoms{source: *file.Name, path: path, atoms: atoms}
+}
+
+// printAtom prints the (atomic, non-annotation) argument to the generated output.
+func (g *Generator) printAtom(v interface{}) {
+ switch v := v.(type) {
+ case string:
+ g.WriteString(v)
+ case *string:
+ g.WriteString(*v)
+ case bool:
+ fmt.Fprint(g, v)
+ case *bool:
+ fmt.Fprint(g, *v)
+ case int:
+ fmt.Fprint(g, v)
+ case *int32:
+ fmt.Fprint(g, *v)
+ case *int64:
+ fmt.Fprint(g, *v)
+ case float64:
+ fmt.Fprint(g, v)
+ case *float64:
+ fmt.Fprint(g, *v)
+ case GoPackageName:
+ g.WriteString(string(v))
+ case GoImportPath:
+ g.WriteString(strconv.Quote(string(v)))
+ default:
+ g.Fail(fmt.Sprintf("unknown type in printer: %T", v))
+ }
+}
+
+// P prints the arguments to the generated output. It handles strings and int32s, plus
+// handling indirections because they may be *string, etc. Any inputs of type AnnotatedAtoms may emit
+// annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode
+// is true).
+func (g *Generator) P(str ...interface{}) {
+ if !g.writeOutput {
+ return
+ }
+ g.WriteString(g.indent)
+ for _, v := range str {
+ switch v := v.(type) {
+ case *AnnotatedAtoms:
+ begin := int32(g.Len())
+ for _, v := range v.atoms {
+ g.printAtom(v)
+ }
+ if g.annotateCode {
+ end := int32(g.Len())
+ var path []int32
+ for _, token := range strings.Split(v.path, ",") {
+ val, err := strconv.ParseInt(token, 10, 32)
+ if err != nil {
+ g.Fail("could not parse proto AST path: ", err.Error())
+ }
+ path = append(path, int32(val))
+ }
+ g.annotations = append(g.annotations, &descriptor.GeneratedCodeInfo_Annotation{
+ Path: path,
+ SourceFile: &v.source,
+ Begin: &begin,
+ End: &end,
+ })
+ }
+ default:
+ g.printAtom(v)
+ }
+ }
+ g.WriteByte('\n')
+}
+
+// addInitf stores the given statement to be printed inside the file's init function.
+// The statement is given as a format specifier and arguments.
+func (g *Generator) addInitf(stmt string, a ...interface{}) {
+ g.init = append(g.init, fmt.Sprintf(stmt, a...))
+}
+
+// In Indents the output one tab stop.
+func (g *Generator) In() { g.indent += "\t" }
+
+// Out unindents the output one tab stop.
+func (g *Generator) Out() {
+ if len(g.indent) > 0 {
+ g.indent = g.indent[1:]
+ }
+}
+
+// GenerateAllFiles generates the output for all the files we're outputting.
+func (g *Generator) GenerateAllFiles() {
+ // Initialize the plugins
+ for _, p := range plugins {
+ p.Init(g)
+ }
+ // Generate the output. The generator runs for every file, even the files
+ // that we don't generate output for, so that we can collate the full list
+ // of exported symbols to support public imports.
+ genFileMap := make(map[*FileDescriptor]bool, len(g.genFiles))
+ for _, file := range g.genFiles {
+ genFileMap[file] = true
+ }
+ for _, file := range g.allFiles {
+ g.Reset()
+ g.annotations = nil
+ g.writeOutput = genFileMap[file]
+ g.generate(file)
+ if !g.writeOutput {
+ continue
+ }
+ fname := file.goFileName(g.pathType)
+ g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
+ Name: proto.String(fname),
+ Content: proto.String(g.String()),
+ })
+ if g.annotateCode {
+ // Store the generated code annotations in text, as the protoc plugin protocol requires that
+ // strings contain valid UTF-8.
+ g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
+ Name: proto.String(file.goFileName(g.pathType) + ".meta"),
+ Content: proto.String(proto.CompactTextString(&descriptor.GeneratedCodeInfo{Annotation: g.annotations})),
+ })
+ }
+ }
+}
+
+// Run all the plugins associated with the file.
+func (g *Generator) runPlugins(file *FileDescriptor) {
+ for _, p := range plugins {
+ p.Generate(file)
+ }
+}
+
+// Fill the response protocol buffer with the generated output for all the files we're
+// supposed to generate.
+func (g *Generator) generate(file *FileDescriptor) {
+ g.file = file
+ g.usedPackages = make(map[GoImportPath]bool)
+ g.packageNames = make(map[GoImportPath]GoPackageName)
+ g.usedPackageNames = make(map[GoPackageName]bool)
+ g.addedImports = make(map[GoImportPath]bool)
+ for name := range globalPackageNames {
+ g.usedPackageNames[name] = true
+ }
+
+ g.P("// This is a compile-time assertion to ensure that this generated file")
+ g.P("// is compatible with the proto package it is being compiled against.")
+ g.P("// A compilation error at this line likely means your copy of the")
+ g.P("// proto package needs to be updated.")
+ g.P("const _ = ", g.Pkg["proto"], ".ProtoPackageIsVersion", generatedCodeVersion, " // please upgrade the proto package")
+ g.P()
+
+ for _, td := range g.file.imp {
+ g.generateImported(td)
+ }
+ for _, enum := range g.file.enum {
+ g.generateEnum(enum)
+ }
+ for _, desc := range g.file.desc {
+ // Don't generate virtual messages for maps.
+ if desc.GetOptions().GetMapEntry() {
+ continue
+ }
+ g.generateMessage(desc)
+ }
+ for _, ext := range g.file.ext {
+ g.generateExtension(ext)
+ }
+ g.generateInitFunction()
+ g.generateFileDescriptor(file)
+
+ // Run the plugins before the imports so we know which imports are necessary.
+ g.runPlugins(file)
+
+ // Generate header and imports last, though they appear first in the output.
+ rem := g.Buffer
+ remAnno := g.annotations
+ g.Buffer = new(bytes.Buffer)
+ g.annotations = nil
+ g.generateHeader()
+ g.generateImports()
+ if !g.writeOutput {
+ return
+ }
+ // Adjust the offsets for annotations displaced by the header and imports.
+ for _, anno := range remAnno {
+ *anno.Begin += int32(g.Len())
+ *anno.End += int32(g.Len())
+ g.annotations = append(g.annotations, anno)
+ }
+ g.Write(rem.Bytes())
+
+ // Reformat generated code and patch annotation locations.
+ fset := token.NewFileSet()
+ original := g.Bytes()
+ if g.annotateCode {
+ // make a copy independent of g; we'll need it after Reset.
+ original = append([]byte(nil), original...)
+ }
+ fileAST, err := parser.ParseFile(fset, "", original, parser.ParseComments)
+ if err != nil {
+ // Print out the bad code with line numbers.
+ // This should never happen in practice, but it can while changing generated code,
+ // so consider this a debugging aid.
+ var src bytes.Buffer
+ s := bufio.NewScanner(bytes.NewReader(original))
+ for line := 1; s.Scan(); line++ {
+ fmt.Fprintf(&src, "%5d\t%s\n", line, s.Bytes())
+ }
+ g.Fail("bad Go source code was generated:", err.Error(), "\n"+src.String())
+ }
+ ast.SortImports(fset, fileAST)
+ g.Reset()
+ err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(g, fset, fileAST)
+ if err != nil {
+ g.Fail("generated Go source code could not be reformatted:", err.Error())
+ }
+ if g.annotateCode {
+ m, err := remap.Compute(original, g.Bytes())
+ if err != nil {
+ g.Fail("formatted generated Go source code could not be mapped back to the original code:", err.Error())
+ }
+ for _, anno := range g.annotations {
+ new, ok := m.Find(int(*anno.Begin), int(*anno.End))
+ if !ok {
+ g.Fail("span in formatted generated Go source code could not be mapped back to the original code")
+ }
+ *anno.Begin = int32(new.Pos)
+ *anno.End = int32(new.End)
+ }
+ }
+}
+
+// Generate the header, including package definition
+func (g *Generator) generateHeader() {
+ g.P("// Code generated by protoc-gen-go. DO NOT EDIT.")
+ if g.file.GetOptions().GetDeprecated() {
+ g.P("// ", g.file.Name, " is a deprecated file.")
+ } else {
+ g.P("// source: ", g.file.Name)
+ }
+ g.P()
+ g.PrintComments(strconv.Itoa(packagePath))
+ g.P()
+ g.P("package ", g.file.packageName)
+ g.P()
+}
+
+// deprecationComment is the standard comment added to deprecated
+// messages, fields, enums, and enum values.
+var deprecationComment = "// Deprecated: Do not use."
+
+// PrintComments prints any comments from the source .proto file.
+// The path is a comma-separated list of integers.
+// It returns an indication of whether any comments were printed.
+// See descriptor.proto for its format.
+func (g *Generator) PrintComments(path string) bool {
+ if !g.writeOutput {
+ return false
+ }
+ if c, ok := g.makeComments(path); ok {
+ g.P(c)
+ return true
+ }
+ return false
+}
+
+// makeComments generates the comment string for the field, no "\n" at the end
+func (g *Generator) makeComments(path string) (string, bool) {
+ loc, ok := g.file.comments[path]
+ if !ok {
+ return "", false
+ }
+ w := new(bytes.Buffer)
+ nl := ""
+ for _, line := range strings.Split(strings.TrimSuffix(loc.GetLeadingComments(), "\n"), "\n") {
+ fmt.Fprintf(w, "%s//%s", nl, line)
+ nl = "\n"
+ }
+ return w.String(), true
+}
+
+func (g *Generator) fileByName(filename string) *FileDescriptor {
+ return g.allFilesByName[filename]
+}
+
+// weak returns whether the ith import of the current file is a weak import.
+func (g *Generator) weak(i int32) bool {
+ for _, j := range g.file.WeakDependency {
+ if j == i {
+ return true
+ }
+ }
+ return false
+}
+
+// Generate the imports
+func (g *Generator) generateImports() {
+ imports := make(map[GoImportPath]GoPackageName)
+ for i, s := range g.file.Dependency {
+ fd := g.fileByName(s)
+ importPath := fd.importPath
+ // Do not import our own package.
+ if importPath == g.file.importPath {
+ continue
+ }
+ // Do not import weak imports.
+ if g.weak(int32(i)) {
+ continue
+ }
+ // Do not import a package twice.
+ if _, ok := imports[importPath]; ok {
+ continue
+ }
+ // We need to import all the dependencies, even if we don't reference them,
+ // because other code and tools depend on having the full transitive closure
+ // of protocol buffer types in the binary.
+ packageName := g.GoPackageName(importPath)
+ if _, ok := g.usedPackages[importPath]; !ok {
+ packageName = "_"
+ }
+ imports[importPath] = packageName
+ }
+ for importPath := range g.addedImports {
+ imports[importPath] = g.GoPackageName(importPath)
+ }
+ // We almost always need a proto import. Rather than computing when we
+ // do, which is tricky when there's a plugin, just import it and
+ // reference it later. The same argument applies to the fmt and math packages.
+ g.P("import (")
+ g.P(g.Pkg["fmt"] + ` "fmt"`)
+ g.P(g.Pkg["math"] + ` "math"`)
+ g.P(g.Pkg["proto"]+" ", GoImportPath(g.ImportPrefix)+"github.com/golang/protobuf/proto")
+ for importPath, packageName := range imports {
+ g.P(packageName, " ", GoImportPath(g.ImportPrefix)+importPath)
+ }
+ g.P(")")
+ g.P()
+ // TODO: may need to worry about uniqueness across plugins
+ for _, p := range plugins {
+ p.GenerateImports(g.file)
+ g.P()
+ }
+ g.P("// Reference imports to suppress errors if they are not otherwise used.")
+ g.P("var _ = ", g.Pkg["proto"], ".Marshal")
+ g.P("var _ = ", g.Pkg["fmt"], ".Errorf")
+ g.P("var _ = ", g.Pkg["math"], ".Inf")
+ g.P()
+}
+
+func (g *Generator) generateImported(id *ImportedDescriptor) {
+ df := id.o.File()
+ filename := *df.Name
+ if df.importPath == g.file.importPath {
+ // Don't generate type aliases for files in the same Go package as this one.
+ return
+ }
+ if !supportTypeAliases {
+ g.Fail(fmt.Sprintf("%s: public imports require at least go1.9", filename))
+ }
+ g.usedPackages[df.importPath] = true
+
+ for _, sym := range df.exported[id.o] {
+ sym.GenerateAlias(g, filename, g.GoPackageName(df.importPath))
+ }
+
+ g.P()
+}
+
+// Generate the enum definitions for this EnumDescriptor.
+func (g *Generator) generateEnum(enum *EnumDescriptor) {
+ // The full type name
+ typeName := enum.TypeName()
+ // The full type name, CamelCased.
+ ccTypeName := CamelCaseSlice(typeName)
+ ccPrefix := enum.prefix()
+
+ deprecatedEnum := ""
+ if enum.GetOptions().GetDeprecated() {
+ deprecatedEnum = deprecationComment
+ }
+ g.PrintComments(enum.path)
+ g.P("type ", Annotate(enum.file, enum.path, ccTypeName), " int32", deprecatedEnum)
+ g.file.addExport(enum, enumSymbol{ccTypeName, enum.proto3()})
+ g.P("const (")
+ for i, e := range enum.Value {
+ etorPath := fmt.Sprintf("%s,%d,%d", enum.path, enumValuePath, i)
+ g.PrintComments(etorPath)
+
+ deprecatedValue := ""
+ if e.GetOptions().GetDeprecated() {
+ deprecatedValue = deprecationComment
+ }
+
+ name := ccPrefix + *e.Name
+ g.P(Annotate(enum.file, etorPath, name), " ", ccTypeName, " = ", e.Number, " ", deprecatedValue)
+ g.file.addExport(enum, constOrVarSymbol{name, "const", ccTypeName})
+ }
+ g.P(")")
+ g.P()
+ g.P("var ", ccTypeName, "_name = map[int32]string{")
+ generated := make(map[int32]bool) // avoid duplicate values
+ for _, e := range enum.Value {
+ duplicate := ""
+ if _, present := generated[*e.Number]; present {
+ duplicate = "// Duplicate value: "
+ }
+ g.P(duplicate, e.Number, ": ", strconv.Quote(*e.Name), ",")
+ generated[*e.Number] = true
+ }
+ g.P("}")
+ g.P()
+ g.P("var ", ccTypeName, "_value = map[string]int32{")
+ for _, e := range enum.Value {
+ g.P(strconv.Quote(*e.Name), ": ", e.Number, ",")
+ }
+ g.P("}")
+ g.P()
+
+ if !enum.proto3() {
+ g.P("func (x ", ccTypeName, ") Enum() *", ccTypeName, " {")
+ g.P("p := new(", ccTypeName, ")")
+ g.P("*p = x")
+ g.P("return p")
+ g.P("}")
+ g.P()
+ }
+
+ g.P("func (x ", ccTypeName, ") String() string {")
+ g.P("return ", g.Pkg["proto"], ".EnumName(", ccTypeName, "_name, int32(x))")
+ g.P("}")
+ g.P()
+
+ if !enum.proto3() {
+ g.P("func (x *", ccTypeName, ") UnmarshalJSON(data []byte) error {")
+ g.P("value, err := ", g.Pkg["proto"], ".UnmarshalJSONEnum(", ccTypeName, `_value, data, "`, ccTypeName, `")`)
+ g.P("if err != nil {")
+ g.P("return err")
+ g.P("}")
+ g.P("*x = ", ccTypeName, "(value)")
+ g.P("return nil")
+ g.P("}")
+ g.P()
+ }
+
+ var indexes []string
+ for m := enum.parent; m != nil; m = m.parent {
+ // XXX: skip groups?
+ indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
+ }
+ indexes = append(indexes, strconv.Itoa(enum.index))
+ g.P("func (", ccTypeName, ") EnumDescriptor() ([]byte, []int) {")
+ g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
+ g.P("}")
+ g.P()
+ if enum.file.GetPackage() == "google.protobuf" && enum.GetName() == "NullValue" {
+ g.P("func (", ccTypeName, `) XXX_WellKnownType() string { return "`, enum.GetName(), `" }`)
+ g.P()
+ }
+
+ g.generateEnumRegistration(enum)
+}
+
+// The tag is a string like "varint,2,opt,name=fieldname,def=7" that
+// identifies details of the field for the protocol buffer marshaling and unmarshaling
+// code. The fields are:
+// wire encoding
+// protocol tag number
+// opt,req,rep for optional, required, or repeated
+// packed whether the encoding is "packed" (optional; repeated primitives only)
+// name= the original declared name
+// enum= the name of the enum type if it is an enum-typed field.
+// proto3 if this field is in a proto3 message
+// def= string representation of the default value, if any.
+// The default value must be in a representation that can be used at run-time
+// to generate the default value. Thus bools become 0 and 1, for instance.
+func (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string {
+ optrepreq := ""
+ switch {
+ case isOptional(field):
+ optrepreq = "opt"
+ case isRequired(field):
+ optrepreq = "req"
+ case isRepeated(field):
+ optrepreq = "rep"
+ }
+ var defaultValue string
+ if dv := field.DefaultValue; dv != nil { // set means an explicit default
+ defaultValue = *dv
+ // Some types need tweaking.
+ switch *field.Type {
+ case descriptor.FieldDescriptorProto_TYPE_BOOL:
+ if defaultValue == "true" {
+ defaultValue = "1"
+ } else {
+ defaultValue = "0"
+ }
+ case descriptor.FieldDescriptorProto_TYPE_STRING,
+ descriptor.FieldDescriptorProto_TYPE_BYTES:
+ // Nothing to do. Quoting is done for the whole tag.
+ case descriptor.FieldDescriptorProto_TYPE_ENUM:
+ // For enums we need to provide the integer constant.
+ obj := g.ObjectNamed(field.GetTypeName())
+ if id, ok := obj.(*ImportedDescriptor); ok {
+ // It is an enum that was publicly imported.
+ // We need the underlying type.
+ obj = id.o
+ }
+ enum, ok := obj.(*EnumDescriptor)
+ if !ok {
+ log.Printf("obj is a %T", obj)
+ if id, ok := obj.(*ImportedDescriptor); ok {
+ log.Printf("id.o is a %T", id.o)
+ }
+ g.Fail("unknown enum type", CamelCaseSlice(obj.TypeName()))
+ }
+ defaultValue = enum.integerValueAsString(defaultValue)
+ case descriptor.FieldDescriptorProto_TYPE_FLOAT:
+ if def := defaultValue; def != "inf" && def != "-inf" && def != "nan" {
+ if f, err := strconv.ParseFloat(defaultValue, 32); err == nil {
+ defaultValue = fmt.Sprint(float32(f))
+ }
+ }
+ case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
+ if def := defaultValue; def != "inf" && def != "-inf" && def != "nan" {
+ if f, err := strconv.ParseFloat(defaultValue, 64); err == nil {
+ defaultValue = fmt.Sprint(f)
+ }
+ }
+ }
+ defaultValue = ",def=" + defaultValue
+ }
+ enum := ""
+ if *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM {
+ // We avoid using obj.GoPackageName(), because we want to use the
+ // original (proto-world) package name.
+ obj := g.ObjectNamed(field.GetTypeName())
+ if id, ok := obj.(*ImportedDescriptor); ok {
+ obj = id.o
+ }
+ enum = ",enum="
+ if pkg := obj.File().GetPackage(); pkg != "" {
+ enum += pkg + "."
+ }
+ enum += CamelCaseSlice(obj.TypeName())
+ }
+ packed := ""
+ if (field.Options != nil && field.Options.GetPacked()) ||
+ // Per https://developers.google.com/protocol-buffers/docs/proto3#simple:
+ // "In proto3, repeated fields of scalar numeric types use packed encoding by default."
+ (message.proto3() && (field.Options == nil || field.Options.Packed == nil) &&
+ isRepeated(field) && isScalar(field)) {
+ packed = ",packed"
+ }
+ fieldName := field.GetName()
+ name := fieldName
+ if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
+ // We must use the type name for groups instead of
+ // the field name to preserve capitalization.
+ // type_name in FieldDescriptorProto is fully-qualified,
+ // but we only want the local part.
+ name = *field.TypeName
+ if i := strings.LastIndex(name, "."); i >= 0 {
+ name = name[i+1:]
+ }
+ }
+ if json := field.GetJsonName(); field.Extendee == nil && json != "" && json != name {
+ // TODO: escaping might be needed, in which case
+ // perhaps this should be in its own "json" tag.
+ name += ",json=" + json
+ }
+ name = ",name=" + name
+ if message.proto3() {
+ name += ",proto3"
+ }
+ oneof := ""
+ if field.OneofIndex != nil {
+ oneof = ",oneof"
+ }
+ return strconv.Quote(fmt.Sprintf("%s,%d,%s%s%s%s%s%s",
+ wiretype,
+ field.GetNumber(),
+ optrepreq,
+ packed,
+ name,
+ enum,
+ oneof,
+ defaultValue))
+}
+
+func needsStar(typ descriptor.FieldDescriptorProto_Type) bool {
+ switch typ {
+ case descriptor.FieldDescriptorProto_TYPE_GROUP:
+ return false
+ case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
+ return false
+ case descriptor.FieldDescriptorProto_TYPE_BYTES:
+ return false
+ }
+ return true
+}
+
+// TypeName is the printed name appropriate for an item. If the object is in the current file,
+// TypeName drops the package name and underscores the rest.
+// Otherwise the object is from another package; and the result is the underscored
+// package name followed by the item name.
+// The result always has an initial capital.
+func (g *Generator) TypeName(obj Object) string {
+ return g.DefaultPackageName(obj) + CamelCaseSlice(obj.TypeName())
+}
+
+// GoType returns a string representing the type name, and the wire type
+func (g *Generator) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) {
+ // TODO: Options.
+ switch *field.Type {
+ case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
+ typ, wire = "float64", "fixed64"
+ case descriptor.FieldDescriptorProto_TYPE_FLOAT:
+ typ, wire = "float32", "fixed32"
+ case descriptor.FieldDescriptorProto_TYPE_INT64:
+ typ, wire = "int64", "varint"
+ case descriptor.FieldDescriptorProto_TYPE_UINT64:
+ typ, wire = "uint64", "varint"
+ case descriptor.FieldDescriptorProto_TYPE_INT32:
+ typ, wire = "int32", "varint"
+ case descriptor.FieldDescriptorProto_TYPE_UINT32:
+ typ, wire = "uint32", "varint"
+ case descriptor.FieldDescriptorProto_TYPE_FIXED64:
+ typ, wire = "uint64", "fixed64"
+ case descriptor.FieldDescriptorProto_TYPE_FIXED32:
+ typ, wire = "uint32", "fixed32"
+ case descriptor.FieldDescriptorProto_TYPE_BOOL:
+ typ, wire = "bool", "varint"
+ case descriptor.FieldDescriptorProto_TYPE_STRING:
+ typ, wire = "string", "bytes"
+ case descriptor.FieldDescriptorProto_TYPE_GROUP:
+ desc := g.ObjectNamed(field.GetTypeName())
+ typ, wire = "*"+g.TypeName(desc), "group"
+ case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
+ desc := g.ObjectNamed(field.GetTypeName())
+ typ, wire = "*"+g.TypeName(desc), "bytes"
+ case descriptor.FieldDescriptorProto_TYPE_BYTES:
+ typ, wire = "[]byte", "bytes"
+ case descriptor.FieldDescriptorProto_TYPE_ENUM:
+ desc := g.ObjectNamed(field.GetTypeName())
+ typ, wire = g.TypeName(desc), "varint"
+ case descriptor.FieldDescriptorProto_TYPE_SFIXED32:
+ typ, wire = "int32", "fixed32"
+ case descriptor.FieldDescriptorProto_TYPE_SFIXED64:
+ typ, wire = "int64", "fixed64"
+ case descriptor.FieldDescriptorProto_TYPE_SINT32:
+ typ, wire = "int32", "zigzag32"
+ case descriptor.FieldDescriptorProto_TYPE_SINT64:
+ typ, wire = "int64", "zigzag64"
+ default:
+ g.Fail("unknown type for", field.GetName())
+ }
+ if isRepeated(field) {
+ typ = "[]" + typ
+ } else if message != nil && message.proto3() {
+ return
+ } else if field.OneofIndex != nil && message != nil {
+ return
+ } else if needsStar(*field.Type) {
+ typ = "*" + typ
+ }
+ return
+}
+
+func (g *Generator) RecordTypeUse(t string) {
+ if _, ok := g.typeNameToObject[t]; !ok {
+ return
+ }
+ importPath := g.ObjectNamed(t).GoImportPath()
+ if importPath == g.outputImportPath {
+ // Don't record use of objects in our package.
+ return
+ }
+ g.AddImport(importPath)
+ g.usedPackages[importPath] = true
+}
+
+// Method names that may be generated. Fields with these names get an
+// underscore appended. Any change to this set is a potential incompatible
+// API change because it changes generated field names.
+var methodNames = [...]string{
+ "Reset",
+ "String",
+ "ProtoMessage",
+ "Marshal",
+ "Unmarshal",
+ "ExtensionRangeArray",
+ "ExtensionMap",
+ "Descriptor",
+}
+
+// Names of messages in the `google.protobuf` package for which
+// we will generate XXX_WellKnownType methods.
+var wellKnownTypes = map[string]bool{
+ "Any": true,
+ "Duration": true,
+ "Empty": true,
+ "Struct": true,
+ "Timestamp": true,
+
+ "Value": true,
+ "ListValue": true,
+ "DoubleValue": true,
+ "FloatValue": true,
+ "Int64Value": true,
+ "UInt64Value": true,
+ "Int32Value": true,
+ "UInt32Value": true,
+ "BoolValue": true,
+ "StringValue": true,
+ "BytesValue": true,
+}
+
+// getterDefault finds the default value for the field to return from a getter,
+// regardless of if it's a built in default or explicit from the source. Returns e.g. "nil", `""`, "Default_MessageType_FieldName"
+func (g *Generator) getterDefault(field *descriptor.FieldDescriptorProto, goMessageType string) string {
+ if isRepeated(field) {
+ return "nil"
+ }
+ if def := field.GetDefaultValue(); def != "" {
+ defaultConstant := g.defaultConstantName(goMessageType, field.GetName())
+ if *field.Type != descriptor.FieldDescriptorProto_TYPE_BYTES {
+ return defaultConstant
+ }
+ return "append([]byte(nil), " + defaultConstant + "...)"
+ }
+ switch *field.Type {
+ case descriptor.FieldDescriptorProto_TYPE_BOOL:
+ return "false"
+ case descriptor.FieldDescriptorProto_TYPE_STRING:
+ return `""`
+ case descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE, descriptor.FieldDescriptorProto_TYPE_BYTES:
+ return "nil"
+ case descriptor.FieldDescriptorProto_TYPE_ENUM:
+ obj := g.ObjectNamed(field.GetTypeName())
+ var enum *EnumDescriptor
+ if id, ok := obj.(*ImportedDescriptor); ok {
+ // The enum type has been publicly imported.
+ enum, _ = id.o.(*EnumDescriptor)
+ } else {
+ enum, _ = obj.(*EnumDescriptor)
+ }
+ if enum == nil {
+ log.Printf("don't know how to generate getter for %s", field.GetName())
+ return "nil"
+ }
+ if len(enum.Value) == 0 {
+ return "0 // empty enum"
+ }
+ first := enum.Value[0].GetName()
+ return g.DefaultPackageName(obj) + enum.prefix() + first
+ default:
+ return "0"
+ }
+}
+
+// defaultConstantName builds the name of the default constant from the message
+// type name and the untouched field name, e.g. "Default_MessageType_FieldName"
+func (g *Generator) defaultConstantName(goMessageType, protoFieldName string) string {
+ return "Default_" + goMessageType + "_" + CamelCase(protoFieldName)
+}
+
+// The different types of fields in a message and how to actually print them
+// Most of the logic for generateMessage is in the methods of these types.
+//
+// Note that the content of the field is irrelevant, a simpleField can contain
+// anything from a scalar to a group (which is just a message).
+//
+// Extension fields (and message sets) are however handled separately.
+//
+// simpleField - a field that is neiter weak nor oneof, possibly repeated
+// oneofField - field containing list of subfields:
+// - oneofSubField - a field within the oneof
+
+// msgCtx contains the context for the generator functions.
+type msgCtx struct {
+ goName string // Go struct name of the message, e.g. MessageName
+ message *Descriptor // The descriptor for the message
+}
+
+// fieldCommon contains data common to all types of fields.
+type fieldCommon struct {
+ goName string // Go name of field, e.g. "FieldName" or "Descriptor_"
+ protoName string // Name of field in proto language, e.g. "field_name" or "descriptor"
+ getterName string // Name of the getter, e.g. "GetFieldName" or "GetDescriptor_"
+ goType string // The Go type as a string, e.g. "*int32" or "*OtherMessage"
+ tags string // The tag string/annotation for the type, e.g. `protobuf:"varint,8,opt,name=region_id,json=regionId"`
+ fullPath string // The full path of the field as used by Annotate etc, e.g. "4,0,2,0"
+}
+
+// getProtoName gets the proto name of a field, e.g. "field_name" or "descriptor".
+func (f *fieldCommon) getProtoName() string {
+ return f.protoName
+}
+
+// getGoType returns the go type of the field as a string, e.g. "*int32".
+func (f *fieldCommon) getGoType() string {
+ return f.goType
+}
+
+// simpleField is not weak, not a oneof, not an extension. Can be required, optional or repeated.
+type simpleField struct {
+ fieldCommon
+ protoTypeName string // Proto type name, empty if primitive, e.g. ".google.protobuf.Duration"
+ protoType descriptor.FieldDescriptorProto_Type // Actual type enum value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
+ deprecated string // Deprecation comment, if any, e.g. "// Deprecated: Do not use."
+ getterDef string // Default for getters, e.g. "nil", `""` or "Default_MessageType_FieldName"
+ protoDef string // Default value as defined in the proto file, e.g "yoshi" or "5"
+ comment string // The full comment for the field, e.g. "// Useful information"
+}
+
+// decl prints the declaration of the field in the struct (if any).
+func (f *simpleField) decl(g *Generator, mc *msgCtx) {
+ g.P(f.comment, Annotate(mc.message.file, f.fullPath, f.goName), "\t", f.goType, "\t`", f.tags, "`", f.deprecated)
+}
+
+// getter prints the getter for the field.
+func (f *simpleField) getter(g *Generator, mc *msgCtx) {
+ star := ""
+ tname := f.goType
+ if needsStar(f.protoType) && tname[0] == '*' {
+ tname = tname[1:]
+ star = "*"
+ }
+ if f.deprecated != "" {
+ g.P(f.deprecated)
+ }
+ g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, f.fullPath, f.getterName), "() "+tname+" {")
+ if f.getterDef == "nil" { // Simpler getter
+ g.P("if m != nil {")
+ g.P("return m." + f.goName)
+ g.P("}")
+ g.P("return nil")
+ g.P("}")
+ g.P()
+ return
+ }
+ if mc.message.proto3() {
+ g.P("if m != nil {")
+ } else {
+ g.P("if m != nil && m." + f.goName + " != nil {")
+ }
+ g.P("return " + star + "m." + f.goName)
+ g.P("}")
+ g.P("return ", f.getterDef)
+ g.P("}")
+ g.P()
+}
+
+// setter prints the setter method of the field.
+func (f *simpleField) setter(g *Generator, mc *msgCtx) {
+ // No setter for regular fields yet
+}
+
+// getProtoDef returns the default value explicitly stated in the proto file, e.g "yoshi" or "5".
+func (f *simpleField) getProtoDef() string {
+ return f.protoDef
+}
+
+// getProtoTypeName returns the protobuf type name for the field as returned by field.GetTypeName(), e.g. ".google.protobuf.Duration".
+func (f *simpleField) getProtoTypeName() string {
+ return f.protoTypeName
+}
+
+// getProtoType returns the *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64.
+func (f *simpleField) getProtoType() descriptor.FieldDescriptorProto_Type {
+ return f.protoType
+}
+
+// oneofSubFields are kept slize held by each oneofField. They do not appear in the top level slize of fields for the message.
+type oneofSubField struct {
+ fieldCommon
+ protoTypeName string // Proto type name, empty if primitive, e.g. ".google.protobuf.Duration"
+ protoType descriptor.FieldDescriptorProto_Type // Actual type enum value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
+ oneofTypeName string // Type name of the enclosing struct, e.g. "MessageName_FieldName"
+ fieldNumber int // Actual field number, as defined in proto, e.g. 12
+ getterDef string // Default for getters, e.g. "nil", `""` or "Default_MessageType_FieldName"
+ protoDef string // Default value as defined in the proto file, e.g "yoshi" or "5"
+ deprecated string // Deprecation comment, if any.
+}
+
+// typedNil prints a nil casted to the pointer to this field.
+// - for XXX_OneofWrappers
+func (f *oneofSubField) typedNil(g *Generator) {
+ g.P("(*", f.oneofTypeName, ")(nil),")
+}
+
+// getProtoDef returns the default value explicitly stated in the proto file, e.g "yoshi" or "5".
+func (f *oneofSubField) getProtoDef() string {
+ return f.protoDef
+}
+
+// getProtoTypeName returns the protobuf type name for the field as returned by field.GetTypeName(), e.g. ".google.protobuf.Duration".
+func (f *oneofSubField) getProtoTypeName() string {
+ return f.protoTypeName
+}
+
+// getProtoType returns the *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64.
+func (f *oneofSubField) getProtoType() descriptor.FieldDescriptorProto_Type {
+ return f.protoType
+}
+
+// oneofField represents the oneof on top level.
+// The alternative fields within the oneof are represented by oneofSubField.
+type oneofField struct {
+ fieldCommon
+ subFields []*oneofSubField // All the possible oneof fields
+ comment string // The full comment for the field, e.g. "// Types that are valid to be assigned to MyOneof:\n\\"
+}
+
+// decl prints the declaration of the field in the struct (if any).
+func (f *oneofField) decl(g *Generator, mc *msgCtx) {
+ comment := f.comment
+ for _, sf := range f.subFields {
+ comment += "//\t*" + sf.oneofTypeName + "\n"
+ }
+ g.P(comment, Annotate(mc.message.file, f.fullPath, f.goName), " ", f.goType, " `", f.tags, "`")
+}
+
+// getter for a oneof field will print additional discriminators and interfaces for the oneof,
+// also it prints all the getters for the sub fields.
+func (f *oneofField) getter(g *Generator, mc *msgCtx) {
+ // The discriminator type
+ g.P("type ", f.goType, " interface {")
+ g.P(f.goType, "()")
+ g.P("}")
+ g.P()
+ // The subField types, fulfilling the discriminator type contract
+ for _, sf := range f.subFields {
+ g.P("type ", Annotate(mc.message.file, sf.fullPath, sf.oneofTypeName), " struct {")
+ g.P(Annotate(mc.message.file, sf.fullPath, sf.goName), " ", sf.goType, " `", sf.tags, "`")
+ g.P("}")
+ g.P()
+ }
+ for _, sf := range f.subFields {
+ g.P("func (*", sf.oneofTypeName, ") ", f.goType, "() {}")
+ g.P()
+ }
+ // Getter for the oneof field
+ g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, f.fullPath, f.getterName), "() ", f.goType, " {")
+ g.P("if m != nil { return m.", f.goName, " }")
+ g.P("return nil")
+ g.P("}")
+ g.P()
+ // Getters for each oneof
+ for _, sf := range f.subFields {
+ if sf.deprecated != "" {
+ g.P(sf.deprecated)
+ }
+ g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, sf.fullPath, sf.getterName), "() "+sf.goType+" {")
+ g.P("if x, ok := m.", f.getterName, "().(*", sf.oneofTypeName, "); ok {")
+ g.P("return x.", sf.goName)
+ g.P("}")
+ g.P("return ", sf.getterDef)
+ g.P("}")
+ g.P()
+ }
+}
+
+// setter prints the setter method of the field.
+func (f *oneofField) setter(g *Generator, mc *msgCtx) {
+ // No setters for oneof yet
+}
+
+// topLevelField interface implemented by all types of fields on the top level (not oneofSubField).
+type topLevelField interface {
+ decl(g *Generator, mc *msgCtx) // print declaration within the struct
+ getter(g *Generator, mc *msgCtx) // print getter
+ setter(g *Generator, mc *msgCtx) // print setter if applicable
+}
+
+// defField interface implemented by all types of fields that can have defaults (not oneofField, but instead oneofSubField).
+type defField interface {
+ getProtoDef() string // default value explicitly stated in the proto file, e.g "yoshi" or "5"
+ getProtoName() string // proto name of a field, e.g. "field_name" or "descriptor"
+ getGoType() string // go type of the field as a string, e.g. "*int32"
+ getProtoTypeName() string // protobuf type name for the field, e.g. ".google.protobuf.Duration"
+ getProtoType() descriptor.FieldDescriptorProto_Type // *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
+}
+
+// generateDefaultConstants adds constants for default values if needed, which is only if the default value is.
+// explicit in the proto.
+func (g *Generator) generateDefaultConstants(mc *msgCtx, topLevelFields []topLevelField) {
+ // Collect fields that can have defaults
+ dFields := []defField{}
+ for _, pf := range topLevelFields {
+ if f, ok := pf.(*oneofField); ok {
+ for _, osf := range f.subFields {
+ dFields = append(dFields, osf)
+ }
+ continue
+ }
+ dFields = append(dFields, pf.(defField))
+ }
+ for _, df := range dFields {
+ def := df.getProtoDef()
+ if def == "" {
+ continue
+ }
+ fieldname := g.defaultConstantName(mc.goName, df.getProtoName())
+ typename := df.getGoType()
+ if typename[0] == '*' {
+ typename = typename[1:]
+ }
+ kind := "const "
+ switch {
+ case typename == "bool":
+ case typename == "string":
+ def = strconv.Quote(def)
+ case typename == "[]byte":
+ def = "[]byte(" + strconv.Quote(unescape(def)) + ")"
+ kind = "var "
+ case def == "inf", def == "-inf", def == "nan":
+ // These names are known to, and defined by, the protocol language.
+ switch def {
+ case "inf":
+ def = "math.Inf(1)"
+ case "-inf":
+ def = "math.Inf(-1)"
+ case "nan":
+ def = "math.NaN()"
+ }
+ if df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_FLOAT {
+ def = "float32(" + def + ")"
+ }
+ kind = "var "
+ case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_FLOAT:
+ if f, err := strconv.ParseFloat(def, 32); err == nil {
+ def = fmt.Sprint(float32(f))
+ }
+ case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_DOUBLE:
+ if f, err := strconv.ParseFloat(def, 64); err == nil {
+ def = fmt.Sprint(f)
+ }
+ case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_ENUM:
+ // Must be an enum. Need to construct the prefixed name.
+ obj := g.ObjectNamed(df.getProtoTypeName())
+ var enum *EnumDescriptor
+ if id, ok := obj.(*ImportedDescriptor); ok {
+ // The enum type has been publicly imported.
+ enum, _ = id.o.(*EnumDescriptor)
+ } else {
+ enum, _ = obj.(*EnumDescriptor)
+ }
+ if enum == nil {
+ log.Printf("don't know how to generate constant for %s", fieldname)
+ continue
+ }
+ def = g.DefaultPackageName(obj) + enum.prefix() + def
+ }
+ g.P(kind, fieldname, " ", typename, " = ", def)
+ g.file.addExport(mc.message, constOrVarSymbol{fieldname, kind, ""})
+ }
+ g.P()
+}
+
+// generateInternalStructFields just adds the XXX_ fields to the message struct.
+func (g *Generator) generateInternalStructFields(mc *msgCtx, topLevelFields []topLevelField) {
+ g.P("XXX_NoUnkeyedLiteral\tstruct{} `json:\"-\"`") // prevent unkeyed struct literals
+ if len(mc.message.ExtensionRange) > 0 {
+ messageset := ""
+ if opts := mc.message.Options; opts != nil && opts.GetMessageSetWireFormat() {
+ messageset = "protobuf_messageset:\"1\" "
+ }
+ g.P(g.Pkg["proto"], ".XXX_InternalExtensions `", messageset, "json:\"-\"`")
+ }
+ g.P("XXX_unrecognized\t[]byte `json:\"-\"`")
+ g.P("XXX_sizecache\tint32 `json:\"-\"`")
+
+}
+
+// generateOneofFuncs adds all the utility functions for oneof, including marshalling, unmarshalling and sizer.
+func (g *Generator) generateOneofFuncs(mc *msgCtx, topLevelFields []topLevelField) {
+ ofields := []*oneofField{}
+ for _, f := range topLevelFields {
+ if o, ok := f.(*oneofField); ok {
+ ofields = append(ofields, o)
+ }
+ }
+ if len(ofields) == 0 {
+ return
+ }
+
+ // OneofFuncs
+ g.P("// XXX_OneofWrappers is for the internal use of the proto package.")
+ g.P("func (*", mc.goName, ") XXX_OneofWrappers() []interface{} {")
+ g.P("return []interface{}{")
+ for _, of := range ofields {
+ for _, sf := range of.subFields {
+ sf.typedNil(g)
+ }
+ }
+ g.P("}")
+ g.P("}")
+ g.P()
+}
+
+// generateMessageStruct adds the actual struct with it's members (but not methods) to the output.
+func (g *Generator) generateMessageStruct(mc *msgCtx, topLevelFields []topLevelField) {
+ comments := g.PrintComments(mc.message.path)
+
+ // Guarantee deprecation comments appear after user-provided comments.
+ if mc.message.GetOptions().GetDeprecated() {
+ if comments {
+ // Convention: Separate deprecation comments from original
+ // comments with an empty line.
+ g.P("//")
+ }
+ g.P(deprecationComment)
+ }
+
+ g.P("type ", Annotate(mc.message.file, mc.message.path, mc.goName), " struct {")
+ for _, pf := range topLevelFields {
+ pf.decl(g, mc)
+ }
+ g.generateInternalStructFields(mc, topLevelFields)
+ g.P("}")
+}
+
+// generateGetters adds getters for all fields, including oneofs and weak fields when applicable.
+func (g *Generator) generateGetters(mc *msgCtx, topLevelFields []topLevelField) {
+ for _, pf := range topLevelFields {
+ pf.getter(g, mc)
+ }
+}
+
+// generateSetters add setters for all fields, including oneofs and weak fields when applicable.
+func (g *Generator) generateSetters(mc *msgCtx, topLevelFields []topLevelField) {
+ for _, pf := range topLevelFields {
+ pf.setter(g, mc)
+ }
+}
+
+// generateCommonMethods adds methods to the message that are not on a per field basis.
+func (g *Generator) generateCommonMethods(mc *msgCtx) {
+ // Reset, String and ProtoMessage methods.
+ g.P("func (m *", mc.goName, ") Reset() { *m = ", mc.goName, "{} }")
+ g.P("func (m *", mc.goName, ") String() string { return ", g.Pkg["proto"], ".CompactTextString(m) }")
+ g.P("func (*", mc.goName, ") ProtoMessage() {}")
+ var indexes []string
+ for m := mc.message; m != nil; m = m.parent {
+ indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
+ }
+ g.P("func (*", mc.goName, ") Descriptor() ([]byte, []int) {")
+ g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
+ g.P("}")
+ g.P()
+ // TODO: Revisit the decision to use a XXX_WellKnownType method
+ // if we change proto.MessageName to work with multiple equivalents.
+ if mc.message.file.GetPackage() == "google.protobuf" && wellKnownTypes[mc.message.GetName()] {
+ g.P("func (*", mc.goName, `) XXX_WellKnownType() string { return "`, mc.message.GetName(), `" }`)
+ g.P()
+ }
+
+ // Extension support methods
+ if len(mc.message.ExtensionRange) > 0 {
+ g.P()
+ g.P("var extRange_", mc.goName, " = []", g.Pkg["proto"], ".ExtensionRange{")
+ for _, r := range mc.message.ExtensionRange {
+ end := fmt.Sprint(*r.End - 1) // make range inclusive on both ends
+ g.P("{Start: ", r.Start, ", End: ", end, "},")
+ }
+ g.P("}")
+ g.P("func (*", mc.goName, ") ExtensionRangeArray() []", g.Pkg["proto"], ".ExtensionRange {")
+ g.P("return extRange_", mc.goName)
+ g.P("}")
+ g.P()
+ }
+
+ // TODO: It does not scale to keep adding another method for every
+ // operation on protos that we want to switch over to using the
+ // table-driven approach. Instead, we should only add a single method
+ // that allows getting access to the *InternalMessageInfo struct and then
+ // calling Unmarshal, Marshal, Merge, Size, and Discard directly on that.
+
+ // Wrapper for table-driven marshaling and unmarshaling.
+ g.P("func (m *", mc.goName, ") XXX_Unmarshal(b []byte) error {")
+ g.P("return xxx_messageInfo_", mc.goName, ".Unmarshal(m, b)")
+ g.P("}")
+
+ g.P("func (m *", mc.goName, ") XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {")
+ g.P("return xxx_messageInfo_", mc.goName, ".Marshal(b, m, deterministic)")
+ g.P("}")
+
+ g.P("func (m *", mc.goName, ") XXX_Merge(src ", g.Pkg["proto"], ".Message) {")
+ g.P("xxx_messageInfo_", mc.goName, ".Merge(m, src)")
+ g.P("}")
+
+ g.P("func (m *", mc.goName, ") XXX_Size() int {") // avoid name clash with "Size" field in some message
+ g.P("return xxx_messageInfo_", mc.goName, ".Size(m)")
+ g.P("}")
+
+ g.P("func (m *", mc.goName, ") XXX_DiscardUnknown() {")
+ g.P("xxx_messageInfo_", mc.goName, ".DiscardUnknown(m)")
+ g.P("}")
+
+ g.P("var xxx_messageInfo_", mc.goName, " ", g.Pkg["proto"], ".InternalMessageInfo")
+ g.P()
+}
+
+// Generate the type, methods and default constant definitions for this Descriptor.
+func (g *Generator) generateMessage(message *Descriptor) {
+ topLevelFields := []topLevelField{}
+ oFields := make(map[int32]*oneofField)
+ // The full type name
+ typeName := message.TypeName()
+ // The full type name, CamelCased.
+ goTypeName := CamelCaseSlice(typeName)
+
+ usedNames := make(map[string]bool)
+ for _, n := range methodNames {
+ usedNames[n] = true
+ }
+
+ // allocNames finds a conflict-free variation of the given strings,
+ // consistently mutating their suffixes.
+ // It returns the same number of strings.
+ allocNames := func(ns ...string) []string {
+ Loop:
+ for {
+ for _, n := range ns {
+ if usedNames[n] {
+ for i := range ns {
+ ns[i] += "_"
+ }
+ continue Loop
+ }
+ }
+ for _, n := range ns {
+ usedNames[n] = true
+ }
+ return ns
+ }
+ }
+
+ mapFieldTypes := make(map[*descriptor.FieldDescriptorProto]string) // keep track of the map fields to be added later
+
+ // Build a structure more suitable for generating the text in one pass
+ for i, field := range message.Field {
+ // Allocate the getter and the field at the same time so name
+ // collisions create field/method consistent names.
+ // TODO: This allocation occurs based on the order of the fields
+ // in the proto file, meaning that a change in the field
+ // ordering can change generated Method/Field names.
+ base := CamelCase(*field.Name)
+ ns := allocNames(base, "Get"+base)
+ fieldName, fieldGetterName := ns[0], ns[1]
+ typename, wiretype := g.GoType(message, field)
+ jsonName := *field.Name
+ tag := fmt.Sprintf("protobuf:%s json:%q", g.goTag(message, field, wiretype), jsonName+",omitempty")
+
+ oneof := field.OneofIndex != nil
+ if oneof && oFields[*field.OneofIndex] == nil {
+ odp := message.OneofDecl[int(*field.OneofIndex)]
+ base := CamelCase(odp.GetName())
+ fname := allocNames(base)[0]
+
+ // This is the first field of a oneof we haven't seen before.
+ // Generate the union field.
+ oneofFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageOneofPath, *field.OneofIndex)
+ c, ok := g.makeComments(oneofFullPath)
+ if ok {
+ c += "\n//\n"
+ }
+ c += "// Types that are valid to be assigned to " + fname + ":\n"
+ // Generate the rest of this comment later,
+ // when we've computed any disambiguation.
+
+ dname := "is" + goTypeName + "_" + fname
+ tag := `protobuf_oneof:"` + odp.GetName() + `"`
+ of := oneofField{
+ fieldCommon: fieldCommon{
+ goName: fname,
+ getterName: "Get"+fname,
+ goType: dname,
+ tags: tag,
+ protoName: odp.GetName(),
+ fullPath: oneofFullPath,
+ },
+ comment: c,
+ }
+ topLevelFields = append(topLevelFields, &of)
+ oFields[*field.OneofIndex] = &of
+ }
+
+ if *field.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE {
+ desc := g.ObjectNamed(field.GetTypeName())
+ if d, ok := desc.(*Descriptor); ok && d.GetOptions().GetMapEntry() {
+ // Figure out the Go types and tags for the key and value types.
+ keyField, valField := d.Field[0], d.Field[1]
+ keyType, keyWire := g.GoType(d, keyField)
+ valType, valWire := g.GoType(d, valField)
+ keyTag, valTag := g.goTag(d, keyField, keyWire), g.goTag(d, valField, valWire)
+
+ // We don't use stars, except for message-typed values.
+ // Message and enum types are the only two possibly foreign types used in maps,
+ // so record their use. They are not permitted as map keys.
+ keyType = strings.TrimPrefix(keyType, "*")
+ switch *valField.Type {
+ case descriptor.FieldDescriptorProto_TYPE_ENUM:
+ valType = strings.TrimPrefix(valType, "*")
+ g.RecordTypeUse(valField.GetTypeName())
+ case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
+ g.RecordTypeUse(valField.GetTypeName())
+ default:
+ valType = strings.TrimPrefix(valType, "*")
+ }
+
+ typename = fmt.Sprintf("map[%s]%s", keyType, valType)
+ mapFieldTypes[field] = typename // record for the getter generation
+
+ tag += fmt.Sprintf(" protobuf_key:%s protobuf_val:%s", keyTag, valTag)
+ }
+ }
+
+ fieldDeprecated := ""
+ if field.GetOptions().GetDeprecated() {
+ fieldDeprecated = deprecationComment
+ }
+
+ dvalue := g.getterDefault(field, goTypeName)
+ if oneof {
+ tname := goTypeName + "_" + fieldName
+ // It is possible for this to collide with a message or enum
+ // nested in this message. Check for collisions.
+ for {
+ ok := true
+ for _, desc := range message.nested {
+ if CamelCaseSlice(desc.TypeName()) == tname {
+ ok = false
+ break
+ }
+ }
+ for _, enum := range message.enums {
+ if CamelCaseSlice(enum.TypeName()) == tname {
+ ok = false
+ break
+ }
+ }
+ if !ok {
+ tname += "_"
+ continue
+ }
+ break
+ }
+
+ oneofField := oFields[*field.OneofIndex]
+ tag := "protobuf:" + g.goTag(message, field, wiretype)
+ sf := oneofSubField{
+ fieldCommon: fieldCommon{
+ goName: fieldName,
+ getterName: fieldGetterName,
+ goType: typename,
+ tags: tag,
+ protoName: field.GetName(),
+ fullPath: fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i),
+ },
+ protoTypeName: field.GetTypeName(),
+ fieldNumber: int(*field.Number),
+ protoType: *field.Type,
+ getterDef: dvalue,
+ protoDef: field.GetDefaultValue(),
+ oneofTypeName: tname,
+ deprecated: fieldDeprecated,
+ }
+ oneofField.subFields = append(oneofField.subFields, &sf)
+ g.RecordTypeUse(field.GetTypeName())
+ continue
+ }
+
+ fieldFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)
+ c, ok := g.makeComments(fieldFullPath)
+ if ok {
+ c += "\n"
+ }
+ rf := simpleField{
+ fieldCommon: fieldCommon{
+ goName: fieldName,
+ getterName: fieldGetterName,
+ goType: typename,
+ tags: tag,
+ protoName: field.GetName(),
+ fullPath: fieldFullPath,
+ },
+ protoTypeName: field.GetTypeName(),
+ protoType: *field.Type,
+ deprecated: fieldDeprecated,
+ getterDef: dvalue,
+ protoDef: field.GetDefaultValue(),
+ comment: c,
+ }
+ var pf topLevelField = &rf
+
+ topLevelFields = append(topLevelFields, pf)
+ g.RecordTypeUse(field.GetTypeName())
+ }
+
+ mc := &msgCtx{
+ goName: goTypeName,
+ message: message,
+ }
+
+ g.generateMessageStruct(mc, topLevelFields)
+ g.P()
+ g.generateCommonMethods(mc)
+ g.P()
+ g.generateDefaultConstants(mc, topLevelFields)
+ g.P()
+ g.generateGetters(mc, topLevelFields)
+ g.P()
+ g.generateSetters(mc, topLevelFields)
+ g.P()
+ g.generateOneofFuncs(mc, topLevelFields)
+ g.P()
+
+ var oneofTypes []string
+ for _, f := range topLevelFields {
+ if of, ok := f.(*oneofField); ok {
+ for _, osf := range of.subFields {
+ oneofTypes = append(oneofTypes, osf.oneofTypeName)
+ }
+ }
+ }
+
+ opts := message.Options
+ ms := &messageSymbol{
+ sym: goTypeName,
+ hasExtensions: len(message.ExtensionRange) > 0,
+ isMessageSet: opts != nil && opts.GetMessageSetWireFormat(),
+ oneofTypes: oneofTypes,
+ }
+ g.file.addExport(message, ms)
+
+ for _, ext := range message.ext {
+ g.generateExtension(ext)
+ }
+
+ fullName := strings.Join(message.TypeName(), ".")
+ if g.file.Package != nil {
+ fullName = *g.file.Package + "." + fullName
+ }
+
+ g.addInitf("%s.RegisterType((*%s)(nil), %q)", g.Pkg["proto"], goTypeName, fullName)
+ // Register types for native map types.
+ for _, k := range mapFieldKeys(mapFieldTypes) {
+ fullName := strings.TrimPrefix(*k.TypeName, ".")
+ g.addInitf("%s.RegisterMapType((%s)(nil), %q)", g.Pkg["proto"], mapFieldTypes[k], fullName)
+ }
+
+}
+
+type byTypeName []*descriptor.FieldDescriptorProto
+
+func (a byTypeName) Len() int { return len(a) }
+func (a byTypeName) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a byTypeName) Less(i, j int) bool { return *a[i].TypeName < *a[j].TypeName }
+
+// mapFieldKeys returns the keys of m in a consistent order.
+func mapFieldKeys(m map[*descriptor.FieldDescriptorProto]string) []*descriptor.FieldDescriptorProto {
+ keys := make([]*descriptor.FieldDescriptorProto, 0, len(m))
+ for k := range m {
+ keys = append(keys, k)
+ }
+ sort.Sort(byTypeName(keys))
+ return keys
+}
+
+var escapeChars = [256]byte{
+ 'a': '\a', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', 'v': '\v', '\\': '\\', '"': '"', '\'': '\'', '?': '?',
+}
+
+// unescape reverses the "C" escaping that protoc does for default values of bytes fields.
+// It is best effort in that it effectively ignores malformed input. Seemingly invalid escape
+// sequences are conveyed, unmodified, into the decoded result.
+func unescape(s string) string {
+ // NB: Sadly, we can't use strconv.Unquote because protoc will escape both
+ // single and double quotes, but strconv.Unquote only allows one or the
+ // other (based on actual surrounding quotes of its input argument).
+
+ var out []byte
+ for len(s) > 0 {
+ // regular character, or too short to be valid escape
+ if s[0] != '\\' || len(s) < 2 {
+ out = append(out, s[0])
+ s = s[1:]
+ } else if c := escapeChars[s[1]]; c != 0 {
+ // escape sequence
+ out = append(out, c)
+ s = s[2:]
+ } else if s[1] == 'x' || s[1] == 'X' {
+ // hex escape, e.g. "\x80
+ if len(s) < 4 {
+ // too short to be valid
+ out = append(out, s[:2]...)
+ s = s[2:]
+ continue
+ }
+ v, err := strconv.ParseUint(s[2:4], 16, 8)
+ if err != nil {
+ out = append(out, s[:4]...)
+ } else {
+ out = append(out, byte(v))
+ }
+ s = s[4:]
+ } else if '0' <= s[1] && s[1] <= '7' {
+ // octal escape, can vary from 1 to 3 octal digits; e.g., "\0" "\40" or "\164"
+ // so consume up to 2 more bytes or up to end-of-string
+ n := len(s[1:]) - len(strings.TrimLeft(s[1:], "01234567"))
+ if n > 3 {
+ n = 3
+ }
+ v, err := strconv.ParseUint(s[1:1+n], 8, 8)
+ if err != nil {
+ out = append(out, s[:1+n]...)
+ } else {
+ out = append(out, byte(v))
+ }
+ s = s[1+n:]
+ } else {
+ // bad escape, just propagate the slash as-is
+ out = append(out, s[0])
+ s = s[1:]
+ }
+ }
+
+ return string(out)
+}
+
+func (g *Generator) generateExtension(ext *ExtensionDescriptor) {
+ ccTypeName := ext.DescName()
+
+ extObj := g.ObjectNamed(*ext.Extendee)
+ var extDesc *Descriptor
+ if id, ok := extObj.(*ImportedDescriptor); ok {
+ // This is extending a publicly imported message.
+ // We need the underlying type for goTag.
+ extDesc = id.o.(*Descriptor)
+ } else {
+ extDesc = extObj.(*Descriptor)
+ }
+ extendedType := "*" + g.TypeName(extObj) // always use the original
+ field := ext.FieldDescriptorProto
+ fieldType, wireType := g.GoType(ext.parent, field)
+ tag := g.goTag(extDesc, field, wireType)
+ g.RecordTypeUse(*ext.Extendee)
+ if n := ext.FieldDescriptorProto.TypeName; n != nil {
+ // foreign extension type
+ g.RecordTypeUse(*n)
+ }
+
+ typeName := ext.TypeName()
+
+ // Special case for proto2 message sets: If this extension is extending
+ // proto2.bridge.MessageSet, and its final name component is "message_set_extension",
+ // then drop that last component.
+ //
+ // TODO: This should be implemented in the text formatter rather than the generator.
+ // In addition, the situation for when to apply this special case is implemented
+ // differently in other languages:
+ // https://github.com/google/protobuf/blob/aff10976/src/google/protobuf/text_format.cc#L1560
+ if extDesc.GetOptions().GetMessageSetWireFormat() && typeName[len(typeName)-1] == "message_set_extension" {
+ typeName = typeName[:len(typeName)-1]
+ }
+
+ // For text formatting, the package must be exactly what the .proto file declares,
+ // ignoring overrides such as the go_package option, and with no dot/underscore mapping.
+ extName := strings.Join(typeName, ".")
+ if g.file.Package != nil {
+ extName = *g.file.Package + "." + extName
+ }
+
+ g.P("var ", ccTypeName, " = &", g.Pkg["proto"], ".ExtensionDesc{")
+ g.P("ExtendedType: (", extendedType, ")(nil),")
+ g.P("ExtensionType: (", fieldType, ")(nil),")
+ g.P("Field: ", field.Number, ",")
+ g.P(`Name: "`, extName, `",`)
+ g.P("Tag: ", tag, ",")
+ g.P(`Filename: "`, g.file.GetName(), `",`)
+
+ g.P("}")
+ g.P()
+
+ g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName())
+
+ g.file.addExport(ext, constOrVarSymbol{ccTypeName, "var", ""})
+}
+
+func (g *Generator) generateInitFunction() {
+ if len(g.init) == 0 {
+ return
+ }
+ g.P("func init() {")
+ for _, l := range g.init {
+ g.P(l)
+ }
+ g.P("}")
+ g.init = nil
+}
+
+func (g *Generator) generateFileDescriptor(file *FileDescriptor) {
+ // Make a copy and trim source_code_info data.
+ // TODO: Trim this more when we know exactly what we need.
+ pb := proto.Clone(file.FileDescriptorProto).(*descriptor.FileDescriptorProto)
+ pb.SourceCodeInfo = nil
+
+ b, err := proto.Marshal(pb)
+ if err != nil {
+ g.Fail(err.Error())
+ }
+
+ var buf bytes.Buffer
+ w, _ := gzip.NewWriterLevel(&buf, gzip.BestCompression)
+ w.Write(b)
+ w.Close()
+ b = buf.Bytes()
+
+ v := file.VarName()
+ g.P()
+ g.P("func init() { ", g.Pkg["proto"], ".RegisterFile(", strconv.Quote(*file.Name), ", ", v, ") }")
+ g.P("var ", v, " = []byte{")
+ g.P("// ", len(b), " bytes of a gzipped FileDescriptorProto")
+ for len(b) > 0 {
+ n := 16
+ if n > len(b) {
+ n = len(b)
+ }
+
+ s := ""
+ for _, c := range b[:n] {
+ s += fmt.Sprintf("0x%02x,", c)
+ }
+ g.P(s)
+
+ b = b[n:]
+ }
+ g.P("}")
+}
+
+func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {
+ // // We always print the full (proto-world) package name here.
+ pkg := enum.File().GetPackage()
+ if pkg != "" {
+ pkg += "."
+ }
+ // The full type name
+ typeName := enum.TypeName()
+ // The full type name, CamelCased.
+ ccTypeName := CamelCaseSlice(typeName)
+ g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName)
+}
+
+// And now lots of helper functions.
+
+// Is c an ASCII lower-case letter?
+func isASCIILower(c byte) bool {
+ return 'a' <= c && c <= 'z'
+}
+
+// Is c an ASCII digit?
+func isASCIIDigit(c byte) bool {
+ return '0' <= c && c <= '9'
+}
+
+// CamelCase returns the CamelCased name.
+// If there is an interior underscore followed by a lower case letter,
+// drop the underscore and convert the letter to upper case.
+// There is a remote possibility of this rewrite causing a name collision,
+// but it's so remote we're prepared to pretend it's nonexistent - since the
+// C++ generator lowercases names, it's extremely unlikely to have two fields
+// with different capitalizations.
+// In short, _my_field_name_2 becomes XMyFieldName_2.
+func CamelCase(s string) string {
+ if s == "" {
+ return ""
+ }
+ t := make([]byte, 0, 32)
+ i := 0
+ if s[0] == '_' {
+ // Need a capital letter; drop the '_'.
+ t = append(t, 'X')
+ i++
+ }
+ // Invariant: if the next letter is lower case, it must be converted
+ // to upper case.
+ // That is, we process a word at a time, where words are marked by _ or
+ // upper case letter. Digits are treated as words.
+ for ; i < len(s); i++ {
+ c := s[i]
+ if c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) {
+ continue // Skip the underscore in s.
+ }
+ if isASCIIDigit(c) {
+ t = append(t, c)
+ continue
+ }
+ // Assume we have a letter now - if not, it's a bogus identifier.
+ // The next word is a sequence of characters that must start upper case.
+ if isASCIILower(c) {
+ c ^= ' ' // Make it a capital letter.
+ }
+ t = append(t, c) // Guaranteed not lower case.
+ // Accept lower case sequence that follows.
+ for i+1 < len(s) && isASCIILower(s[i+1]) {
+ i++
+ t = append(t, s[i])
+ }
+ }
+ return string(t)
+}
+
+// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to
+// be joined with "_".
+func CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, "_")) }
+
+// dottedSlice turns a sliced name into a dotted name.
+func dottedSlice(elem []string) string { return strings.Join(elem, ".") }
+
+// Is this field optional?
+func isOptional(field *descriptor.FieldDescriptorProto) bool {
+ return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL
+}
+
+// Is this field required?
+func isRequired(field *descriptor.FieldDescriptorProto) bool {
+ return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REQUIRED
+}
+
+// Is this field repeated?
+func isRepeated(field *descriptor.FieldDescriptorProto) bool {
+ return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED
+}
+
+// Is this field a scalar numeric type?
+func isScalar(field *descriptor.FieldDescriptorProto) bool {
+ if field.Type == nil {
+ return false
+ }
+ switch *field.Type {
+ case descriptor.FieldDescriptorProto_TYPE_DOUBLE,
+ descriptor.FieldDescriptorProto_TYPE_FLOAT,
+ descriptor.FieldDescriptorProto_TYPE_INT64,
+ descriptor.FieldDescriptorProto_TYPE_UINT64,
+ descriptor.FieldDescriptorProto_TYPE_INT32,
+ descriptor.FieldDescriptorProto_TYPE_FIXED64,
+ descriptor.FieldDescriptorProto_TYPE_FIXED32,
+ descriptor.FieldDescriptorProto_TYPE_BOOL,
+ descriptor.FieldDescriptorProto_TYPE_UINT32,
+ descriptor.FieldDescriptorProto_TYPE_ENUM,
+ descriptor.FieldDescriptorProto_TYPE_SFIXED32,
+ descriptor.FieldDescriptorProto_TYPE_SFIXED64,
+ descriptor.FieldDescriptorProto_TYPE_SINT32,
+ descriptor.FieldDescriptorProto_TYPE_SINT64:
+ return true
+ default:
+ return false
+ }
+}
+
+// badToUnderscore is the mapping function used to generate Go names from package names,
+// which can be dotted in the input .proto file. It replaces non-identifier characters such as
+// dot or dash with underscore.
+func badToUnderscore(r rune) rune {
+ if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' {
+ return r
+ }
+ return '_'
+}
+
+// baseName returns the last path element of the name, with the last dotted suffix removed.
+func baseName(name string) string {
+ // First, find the last element
+ if i := strings.LastIndex(name, "/"); i >= 0 {
+ name = name[i+1:]
+ }
+ // Now drop the suffix
+ if i := strings.LastIndex(name, "."); i >= 0 {
+ name = name[0:i]
+ }
+ return name
+}
+
+// The SourceCodeInfo message describes the location of elements of a parsed
+// .proto file by way of a "path", which is a sequence of integers that
+// describe the route from a FileDescriptorProto to the relevant submessage.
+// The path alternates between a field number of a repeated field, and an index
+// into that repeated field. The constants below define the field numbers that
+// are used.
+//
+// See descriptor.proto for more information about this.
+const (
+ // tag numbers in FileDescriptorProto
+ packagePath = 2 // package
+ messagePath = 4 // message_type
+ enumPath = 5 // enum_type
+ // tag numbers in DescriptorProto
+ messageFieldPath = 2 // field
+ messageMessagePath = 3 // nested_type
+ messageEnumPath = 4 // enum_type
+ messageOneofPath = 8 // oneof_decl
+ // tag numbers in EnumDescriptorProto
+ enumValuePath = 2 // value
+)
+
+var supportTypeAliases bool
+
+func init() {
+ for _, tag := range build.Default.ReleaseTags {
+ if tag == "go1.9" {
+ supportTypeAliases = true
+ return
+ }
+ }
+}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
new file mode 100644
index 000000000..a9b61036c
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
@@ -0,0 +1,117 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2017 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// 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 remap handles tracking the locations of Go tokens in a source text
+across a rewrite by the Go formatter.
+*/
+package remap
+
+import (
+ "fmt"
+ "go/scanner"
+ "go/token"
+)
+
+// A Location represents a span of byte offsets in the source text.
+type Location struct {
+ Pos, End int // End is exclusive
+}
+
+// A Map represents a mapping between token locations in an input source text
+// and locations in the correspnding output text.
+type Map map[Location]Location
+
+// Find reports whether the specified span is recorded by m, and if so returns
+// the new location it was mapped to. If the input span was not found, the
+// returned location is the same as the input.
+func (m Map) Find(pos, end int) (Location, bool) {
+ key := Location{
+ Pos: pos,
+ End: end,
+ }
+ if loc, ok := m[key]; ok {
+ return loc, true
+ }
+ return key, false
+}
+
+func (m Map) add(opos, oend, npos, nend int) {
+ m[Location{Pos: opos, End: oend}] = Location{Pos: npos, End: nend}
+}
+
+// Compute constructs a location mapping from input to output. An error is
+// reported if any of the tokens of output cannot be mapped.
+func Compute(input, output []byte) (Map, error) {
+ itok := tokenize(input)
+ otok := tokenize(output)
+ if len(itok) != len(otok) {
+ return nil, fmt.Errorf("wrong number of tokens, %d ≠ %d", len(itok), len(otok))
+ }
+ m := make(Map)
+ for i, ti := range itok {
+ to := otok[i]
+ if ti.Token != to.Token {
+ return nil, fmt.Errorf("token %d type mismatch: %s ≠ %s", i+1, ti, to)
+ }
+ m.add(ti.pos, ti.end, to.pos, to.end)
+ }
+ return m, nil
+}
+
+// tokinfo records the span and type of a source token.
+type tokinfo struct {
+ pos, end int
+ token.Token
+}
+
+func tokenize(src []byte) []tokinfo {
+ fs := token.NewFileSet()
+ var s scanner.Scanner
+ s.Init(fs.AddFile("src", fs.Base(), len(src)), src, nil, scanner.ScanComments)
+ var info []tokinfo
+ for {
+ pos, next, lit := s.Scan()
+ switch next {
+ case token.SEMICOLON:
+ continue
+ }
+ info = append(info, tokinfo{
+ pos: int(pos - 1),
+ end: int(pos + token.Pos(len(lit)) - 1),
+ Token: next,
+ })
+ if next == token.EOF {
+ break
+ }
+ }
+ return info
+}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
new file mode 100644
index 000000000..61bfc10e0
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
@@ -0,0 +1,369 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/protobuf/compiler/plugin.proto
+
+/*
+Package plugin_go is a generated protocol buffer package.
+
+It is generated from these files:
+ google/protobuf/compiler/plugin.proto
+
+It has these top-level messages:
+ Version
+ CodeGeneratorRequest
+ CodeGeneratorResponse
+*/
+package plugin_go
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+
+// The version number of protocol compiler.
+type Version struct {
+ Major *int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
+ Minor *int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"`
+ Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"`
+ // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
+ // be empty for mainline stable releases.
+ Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Version) Reset() { *m = Version{} }
+func (m *Version) String() string { return proto.CompactTextString(m) }
+func (*Version) ProtoMessage() {}
+func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+func (m *Version) Unmarshal(b []byte) error {
+ return xxx_messageInfo_Version.Unmarshal(m, b)
+}
+func (m *Version) Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Version.Marshal(b, m, deterministic)
+}
+func (dst *Version) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Version.Merge(dst, src)
+}
+func (m *Version) XXX_Size() int {
+ return xxx_messageInfo_Version.Size(m)
+}
+func (m *Version) XXX_DiscardUnknown() {
+ xxx_messageInfo_Version.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Version proto.InternalMessageInfo
+
+func (m *Version) GetMajor() int32 {
+ if m != nil && m.Major != nil {
+ return *m.Major
+ }
+ return 0
+}
+
+func (m *Version) GetMinor() int32 {
+ if m != nil && m.Minor != nil {
+ return *m.Minor
+ }
+ return 0
+}
+
+func (m *Version) GetPatch() int32 {
+ if m != nil && m.Patch != nil {
+ return *m.Patch
+ }
+ return 0
+}
+
+func (m *Version) GetSuffix() string {
+ if m != nil && m.Suffix != nil {
+ return *m.Suffix
+ }
+ return ""
+}
+
+// An encoded CodeGeneratorRequest is written to the plugin's stdin.
+type CodeGeneratorRequest struct {
+ // The .proto files that were explicitly listed on the command-line. The
+ // code generator should generate code only for these files. Each file's
+ // descriptor will be included in proto_file, below.
+ FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate,json=fileToGenerate" json:"file_to_generate,omitempty"`
+ // The generator parameter passed on the command-line.
+ Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
+ // FileDescriptorProtos for all files in files_to_generate and everything
+ // they import. The files will appear in topological order, so each file
+ // appears before any file that imports it.
+ //
+ // protoc guarantees that all proto_files will be written after
+ // the fields above, even though this is not technically guaranteed by the
+ // protobuf wire format. This theoretically could allow a plugin to stream
+ // in the FileDescriptorProtos and handle them one by one rather than read
+ // the entire set into memory at once. However, as of this writing, this
+ // is not similarly optimized on protoc's end -- it will store all fields in
+ // memory at once before sending them to the plugin.
+ //
+ // Type names of fields and extensions in the FileDescriptorProto are always
+ // fully qualified.
+ ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
+ // The version number of protocol compiler.
+ CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *CodeGeneratorRequest) Reset() { *m = CodeGeneratorRequest{} }
+func (m *CodeGeneratorRequest) String() string { return proto.CompactTextString(m) }
+func (*CodeGeneratorRequest) ProtoMessage() {}
+func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
+func (m *CodeGeneratorRequest) Unmarshal(b []byte) error {
+ return xxx_messageInfo_CodeGeneratorRequest.Unmarshal(m, b)
+}
+func (m *CodeGeneratorRequest) Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_CodeGeneratorRequest.Marshal(b, m, deterministic)
+}
+func (dst *CodeGeneratorRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_CodeGeneratorRequest.Merge(dst, src)
+}
+func (m *CodeGeneratorRequest) XXX_Size() int {
+ return xxx_messageInfo_CodeGeneratorRequest.Size(m)
+}
+func (m *CodeGeneratorRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_CodeGeneratorRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_CodeGeneratorRequest proto.InternalMessageInfo
+
+func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
+ if m != nil {
+ return m.FileToGenerate
+ }
+ return nil
+}
+
+func (m *CodeGeneratorRequest) GetParameter() string {
+ if m != nil && m.Parameter != nil {
+ return *m.Parameter
+ }
+ return ""
+}
+
+func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
+ if m != nil {
+ return m.ProtoFile
+ }
+ return nil
+}
+
+func (m *CodeGeneratorRequest) GetCompilerVersion() *Version {
+ if m != nil {
+ return m.CompilerVersion
+ }
+ return nil
+}
+
+// The plugin writes an encoded CodeGeneratorResponse to stdout.
+type CodeGeneratorResponse struct {
+ // Error message. If non-empty, code generation failed. The plugin process
+ // should exit with status code zero even if it reports an error in this way.
+ //
+ // This should be used to indicate errors in .proto files which prevent the
+ // code generator from generating correct code. Errors which indicate a
+ // problem in protoc itself -- such as the input CodeGeneratorRequest being
+ // unparseable -- should be reported by writing a message to stderr and
+ // exiting with a non-zero status code.
+ Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
+ File []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *CodeGeneratorResponse) Reset() { *m = CodeGeneratorResponse{} }
+func (m *CodeGeneratorResponse) String() string { return proto.CompactTextString(m) }
+func (*CodeGeneratorResponse) ProtoMessage() {}
+func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
+func (m *CodeGeneratorResponse) Unmarshal(b []byte) error {
+ return xxx_messageInfo_CodeGeneratorResponse.Unmarshal(m, b)
+}
+func (m *CodeGeneratorResponse) Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_CodeGeneratorResponse.Marshal(b, m, deterministic)
+}
+func (dst *CodeGeneratorResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_CodeGeneratorResponse.Merge(dst, src)
+}
+func (m *CodeGeneratorResponse) XXX_Size() int {
+ return xxx_messageInfo_CodeGeneratorResponse.Size(m)
+}
+func (m *CodeGeneratorResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_CodeGeneratorResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_CodeGeneratorResponse proto.InternalMessageInfo
+
+func (m *CodeGeneratorResponse) GetError() string {
+ if m != nil && m.Error != nil {
+ return *m.Error
+ }
+ return ""
+}
+
+func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
+ if m != nil {
+ return m.File
+ }
+ return nil
+}
+
+// Represents a single generated file.
+type CodeGeneratorResponse_File struct {
+ // The file name, relative to the output directory. The name must not
+ // contain "." or ".." components and must be relative, not be absolute (so,
+ // the file cannot lie outside the output directory). "/" must be used as
+ // the path separator, not "\".
+ //
+ // If the name is omitted, the content will be appended to the previous
+ // file. This allows the generator to break large files into small chunks,
+ // and allows the generated text to be streamed back to protoc so that large
+ // files need not reside completely in memory at one time. Note that as of
+ // this writing protoc does not optimize for this -- it will read the entire
+ // CodeGeneratorResponse before writing files to disk.
+ Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
+ // If non-empty, indicates that the named file should already exist, and the
+ // content here is to be inserted into that file at a defined insertion
+ // point. This feature allows a code generator to extend the output
+ // produced by another code generator. The original generator may provide
+ // insertion points by placing special annotations in the file that look
+ // like:
+ // @@protoc_insertion_point(NAME)
+ // The annotation can have arbitrary text before and after it on the line,
+ // which allows it to be placed in a comment. NAME should be replaced with
+ // an identifier naming the point -- this is what other generators will use
+ // as the insertion_point. Code inserted at this point will be placed
+ // immediately above the line containing the insertion point (thus multiple
+ // insertions to the same point will come out in the order they were added).
+ // The double-@ is intended to make it unlikely that the generated code
+ // could contain things that look like insertion points by accident.
+ //
+ // For example, the C++ code generator places the following line in the
+ // .pb.h files that it generates:
+ // // @@protoc_insertion_point(namespace_scope)
+ // This line appears within the scope of the file's package namespace, but
+ // outside of any particular class. Another plugin can then specify the
+ // insertion_point "namespace_scope" to generate additional classes or
+ // other declarations that should be placed in this scope.
+ //
+ // Note that if the line containing the insertion point begins with
+ // whitespace, the same whitespace will be added to every line of the
+ // inserted text. This is useful for languages like Python, where
+ // indentation matters. In these languages, the insertion point comment
+ // should be indented the same amount as any inserted code will need to be
+ // in order to work correctly in that context.
+ //
+ // The code generator that generates the initial file and the one which
+ // inserts into it must both run as part of a single invocation of protoc.
+ // Code generators are executed in the order in which they appear on the
+ // command line.
+ //
+ // If |insertion_point| is present, |name| must also be present.
+ InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"`
+ // The file contents.
+ Content *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *CodeGeneratorResponse_File) Reset() { *m = CodeGeneratorResponse_File{} }
+func (m *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(m) }
+func (*CodeGeneratorResponse_File) ProtoMessage() {}
+func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
+func (m *CodeGeneratorResponse_File) Unmarshal(b []byte) error {
+ return xxx_messageInfo_CodeGeneratorResponse_File.Unmarshal(m, b)
+}
+func (m *CodeGeneratorResponse_File) Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_CodeGeneratorResponse_File.Marshal(b, m, deterministic)
+}
+func (dst *CodeGeneratorResponse_File) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_CodeGeneratorResponse_File.Merge(dst, src)
+}
+func (m *CodeGeneratorResponse_File) XXX_Size() int {
+ return xxx_messageInfo_CodeGeneratorResponse_File.Size(m)
+}
+func (m *CodeGeneratorResponse_File) XXX_DiscardUnknown() {
+ xxx_messageInfo_CodeGeneratorResponse_File.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_CodeGeneratorResponse_File proto.InternalMessageInfo
+
+func (m *CodeGeneratorResponse_File) GetName() string {
+ if m != nil && m.Name != nil {
+ return *m.Name
+ }
+ return ""
+}
+
+func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
+ if m != nil && m.InsertionPoint != nil {
+ return *m.InsertionPoint
+ }
+ return ""
+}
+
+func (m *CodeGeneratorResponse_File) GetContent() string {
+ if m != nil && m.Content != nil {
+ return *m.Content
+ }
+ return ""
+}
+
+func init() {
+ proto.RegisterType((*Version)(nil), "google.protobuf.compiler.Version")
+ proto.RegisterType((*CodeGeneratorRequest)(nil), "google.protobuf.compiler.CodeGeneratorRequest")
+ proto.RegisterType((*CodeGeneratorResponse)(nil), "google.protobuf.compiler.CodeGeneratorResponse")
+ proto.RegisterType((*CodeGeneratorResponse_File)(nil), "google.protobuf.compiler.CodeGeneratorResponse.File")
+}
+
+func init() { proto.RegisterFile("google/protobuf/compiler/plugin.proto", fileDescriptor0) }
+
+var fileDescriptor0 = []byte{
+ // 417 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6a, 0x14, 0x41,
+ 0x10, 0xc6, 0x19, 0x77, 0x63, 0x98, 0x8a, 0x64, 0x43, 0x13, 0xa5, 0x09, 0x39, 0x8c, 0x8b, 0xe2,
+ 0x5c, 0x32, 0x0b, 0xc1, 0x8b, 0x78, 0x4b, 0x44, 0x3d, 0x78, 0x58, 0x1a, 0xf1, 0x20, 0xc8, 0x30,
+ 0x99, 0xd4, 0x74, 0x5a, 0x66, 0xba, 0xc6, 0xee, 0x1e, 0xf1, 0x49, 0x7d, 0x0f, 0xdf, 0x40, 0xfa,
+ 0xcf, 0x24, 0xb2, 0xb8, 0xa7, 0xee, 0xef, 0x57, 0xd5, 0xd5, 0x55, 0x1f, 0x05, 0x2f, 0x25, 0x91,
+ 0xec, 0x71, 0x33, 0x1a, 0x72, 0x74, 0x33, 0x75, 0x9b, 0x96, 0x86, 0x51, 0xf5, 0x68, 0x36, 0x63,
+ 0x3f, 0x49, 0xa5, 0xab, 0x10, 0x60, 0x3c, 0xa6, 0x55, 0x73, 0x5a, 0x35, 0xa7, 0x9d, 0x15, 0xbb,
+ 0x05, 0x6e, 0xd1, 0xb6, 0x46, 0x8d, 0x8e, 0x4c, 0xcc, 0x5e, 0xb7, 0x70, 0xf8, 0x05, 0x8d, 0x55,
+ 0xa4, 0xd9, 0x29, 0x1c, 0x0c, 0xcd, 0x77, 0x32, 0x3c, 0x2b, 0xb2, 0xf2, 0x40, 0x44, 0x11, 0xa8,
+ 0xd2, 0x64, 0xf8, 0xa3, 0x44, 0xbd, 0xf0, 0x74, 0x6c, 0x5c, 0x7b, 0xc7, 0x17, 0x91, 0x06, 0xc1,
+ 0x9e, 0xc1, 0x63, 0x3b, 0x75, 0x9d, 0xfa, 0xc5, 0x97, 0x45, 0x56, 0xe6, 0x22, 0xa9, 0xf5, 0x9f,
+ 0x0c, 0x4e, 0xaf, 0xe9, 0x16, 0x3f, 0xa0, 0x46, 0xd3, 0x38, 0x32, 0x02, 0x7f, 0x4c, 0x68, 0x1d,
+ 0x2b, 0xe1, 0xa4, 0x53, 0x3d, 0xd6, 0x8e, 0x6a, 0x19, 0x63, 0xc8, 0xb3, 0x62, 0x51, 0xe6, 0xe2,
+ 0xd8, 0xf3, 0xcf, 0x94, 0x5e, 0x20, 0x3b, 0x87, 0x7c, 0x6c, 0x4c, 0x33, 0xa0, 0xc3, 0xd8, 0x4a,
+ 0x2e, 0x1e, 0x00, 0xbb, 0x06, 0x08, 0xe3, 0xd4, 0xfe, 0x15, 0x5f, 0x15, 0x8b, 0xf2, 0xe8, 0xf2,
+ 0x45, 0xb5, 0x6b, 0xcb, 0x7b, 0xd5, 0xe3, 0xbb, 0x7b, 0x03, 0xb6, 0x1e, 0x8b, 0x3c, 0x44, 0x7d,
+ 0x84, 0x7d, 0x82, 0x93, 0xd9, 0xb8, 0xfa, 0x67, 0xf4, 0x24, 0x8c, 0x77, 0x74, 0xf9, 0xbc, 0xda,
+ 0xe7, 0x70, 0x95, 0xcc, 0x13, 0xab, 0x99, 0x24, 0xb0, 0xfe, 0x9d, 0xc1, 0xd3, 0x9d, 0x99, 0xed,
+ 0x48, 0xda, 0xa2, 0xf7, 0x0e, 0x8d, 0x49, 0x3e, 0xe7, 0x22, 0x0a, 0xf6, 0x11, 0x96, 0xff, 0x34,
+ 0xff, 0x7a, 0xff, 0x8f, 0xff, 0x2d, 0x1a, 0x66, 0x13, 0xa1, 0xc2, 0xd9, 0x37, 0x58, 0x86, 0x79,
+ 0x18, 0x2c, 0x75, 0x33, 0x60, 0xfa, 0x26, 0xdc, 0xd9, 0x2b, 0x58, 0x29, 0x6d, 0xd1, 0x38, 0x45,
+ 0xba, 0x1e, 0x49, 0x69, 0x97, 0xcc, 0x3c, 0xbe, 0xc7, 0x5b, 0x4f, 0x19, 0x87, 0xc3, 0x96, 0xb4,
+ 0x43, 0xed, 0xf8, 0x2a, 0x24, 0xcc, 0xf2, 0x4a, 0xc2, 0x79, 0x4b, 0xc3, 0xde, 0xfe, 0xae, 0x9e,
+ 0x6c, 0xc3, 0x6e, 0x06, 0x7b, 0xed, 0xd7, 0x37, 0x52, 0xb9, 0xbb, 0xe9, 0xc6, 0x87, 0x37, 0x92,
+ 0xfa, 0x46, 0xcb, 0x87, 0x65, 0x0c, 0x97, 0xf6, 0x42, 0xa2, 0xbe, 0x90, 0x94, 0x56, 0xfa, 0x6d,
+ 0x3c, 0x6a, 0x49, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x15, 0x40, 0xc5, 0xfe, 0x02, 0x00,
+ 0x00,
+}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any.go b/vendor/github.com/golang/protobuf/ptypes/any.go
index b2af97f4a..70276e8f5 100644
--- a/vendor/github.com/golang/protobuf/ptypes/any.go
+++ b/vendor/github.com/golang/protobuf/ptypes/any.go
@@ -130,10 +130,12 @@ func UnmarshalAny(any *any.Any, pb proto.Message) error {
// Is returns true if any value contains a given message type.
func Is(any *any.Any, pb proto.Message) bool {
- aname, err := AnyMessageName(any)
- if err != nil {
+ // The following is equivalent to AnyMessageName(any) == proto.MessageName(pb),
+ // but it avoids scanning TypeUrl for the slash.
+ if any == nil {
return false
}
-
- return aname == proto.MessageName(pb)
+ name := proto.MessageName(pb)
+ prefix := len(any.TypeUrl) - len(name)
+ return prefix >= 1 && any.TypeUrl[prefix-1] == '/' && any.TypeUrl[prefix:] == name
}
diff --git a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
index f67edc7dc..78ee52334 100644
--- a/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
+++ b/vendor/github.com/golang/protobuf/ptypes/any/any.pb.go
@@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/any.proto
-package any // import "github.com/golang/protobuf/ptypes/any"
+package any
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -16,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// `Any` contains an arbitrary serialized protocol buffer message along with a
// URL that describes the type of the serialized message.
@@ -99,17 +101,18 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// }
//
type Any struct {
- // A URL/resource name whose content describes the type of the
- // serialized protocol buffer message.
+ // A URL/resource name that uniquely identifies the type of the serialized
+ // protocol buffer message. The last segment of the URL's path must represent
+ // the fully qualified name of the type (as in
+ // `path/google.protobuf.Duration`). The name should be in a canonical form
+ // (e.g., leading "." is not accepted).
//
- // For URLs which use the scheme `http`, `https`, or no scheme, the
- // following restrictions and interpretations apply:
+ // In practice, teams usually precompile into the binary all types that they
+ // expect it to use in the context of Any. However, for URLs which use the
+ // scheme `http`, `https`, or no scheme, one can optionally set up a type
+ // server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
- // * The last segment of the URL's path must represent the fully
- // qualified name of the type (as in `path/google.protobuf.Duration`).
- // The name should be in a canonical form (e.g., leading "." is
- // not accepted).
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
@@ -118,10 +121,14 @@ type Any struct {
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
+ // Note: this functionality is not currently available in the official
+ // protobuf release, and it is not used for type URLs beginning with
+ // type.googleapis.com.
+ //
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
//
- TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl" json:"type_url,omitempty"`
+ TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
// Must be a valid serialized protocol buffer of the above specified type.
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
@@ -133,17 +140,19 @@ func (m *Any) Reset() { *m = Any{} }
func (m *Any) String() string { return proto.CompactTextString(m) }
func (*Any) ProtoMessage() {}
func (*Any) Descriptor() ([]byte, []int) {
- return fileDescriptor_any_744b9ca530f228db, []int{0}
+ return fileDescriptor_b53526c13ae22eb4, []int{0}
}
+
func (*Any) XXX_WellKnownType() string { return "Any" }
+
func (m *Any) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Any.Unmarshal(m, b)
}
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
}
-func (dst *Any) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Any.Merge(dst, src)
+func (m *Any) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Any.Merge(m, src)
}
func (m *Any) XXX_Size() int {
return xxx_messageInfo_Any.Size(m)
@@ -172,9 +181,9 @@ func init() {
proto.RegisterType((*Any)(nil), "google.protobuf.Any")
}
-func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_any_744b9ca530f228db) }
+func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) }
-var fileDescriptor_any_744b9ca530f228db = []byte{
+var fileDescriptor_b53526c13ae22eb4 = []byte{
// 185 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration.go b/vendor/github.com/golang/protobuf/ptypes/duration.go
index 65cb0f8eb..26d1ca2fb 100644
--- a/vendor/github.com/golang/protobuf/ptypes/duration.go
+++ b/vendor/github.com/golang/protobuf/ptypes/duration.go
@@ -82,7 +82,7 @@ func Duration(p *durpb.Duration) (time.Duration, error) {
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
}
if p.Nanos != 0 {
- d += time.Duration(p.Nanos)
+ d += time.Duration(p.Nanos) * time.Nanosecond
if (d < 0) != (p.Nanos < 0) {
return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p)
}
diff --git a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
index 4d75473b8..0d681ee21 100644
--- a/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
+++ b/vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go
@@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/duration.proto
-package duration // import "github.com/golang/protobuf/ptypes/duration"
+package duration
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -16,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// A Duration represents a signed, fixed-length span of time represented
// as a count of seconds and fractions of seconds at nanosecond
@@ -82,14 +84,14 @@ type Duration struct {
// Signed seconds of the span of time. Must be from -315,576,000,000
// 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
- Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
+ Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
// Signed fractions of a second at nanosecond resolution of the span
// of time. Durations less than one second are represented with a 0
// `seconds` field and a positive or negative `nanos` field. For durations
// of one second or more, a non-zero value for the `nanos` field must be
// of the same sign as the `seconds` field. Must be from -999,999,999
// to +999,999,999 inclusive.
- Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
+ Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -99,17 +101,19 @@ func (m *Duration) Reset() { *m = Duration{} }
func (m *Duration) String() string { return proto.CompactTextString(m) }
func (*Duration) ProtoMessage() {}
func (*Duration) Descriptor() ([]byte, []int) {
- return fileDescriptor_duration_e7d612259e3f0613, []int{0}
+ return fileDescriptor_23597b2ebd7ac6c5, []int{0}
}
+
func (*Duration) XXX_WellKnownType() string { return "Duration" }
+
func (m *Duration) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Duration.Unmarshal(m, b)
}
func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Duration.Marshal(b, m, deterministic)
}
-func (dst *Duration) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Duration.Merge(dst, src)
+func (m *Duration) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Duration.Merge(m, src)
}
func (m *Duration) XXX_Size() int {
return xxx_messageInfo_Duration.Size(m)
@@ -138,11 +142,9 @@ func init() {
proto.RegisterType((*Duration)(nil), "google.protobuf.Duration")
}
-func init() {
- proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_duration_e7d612259e3f0613)
-}
+func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) }
-var fileDescriptor_duration_e7d612259e3f0613 = []byte{
+var fileDescriptor_23597b2ebd7ac6c5 = []byte{
// 190 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a,
diff --git a/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go b/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
new file mode 100644
index 000000000..33daa73dd
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go
@@ -0,0 +1,336 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/protobuf/struct.proto
+
+package structpb
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// `NullValue` is a singleton enumeration to represent the null value for the
+// `Value` type union.
+//
+// The JSON representation for `NullValue` is JSON `null`.
+type NullValue int32
+
+const (
+ // Null value.
+ NullValue_NULL_VALUE NullValue = 0
+)
+
+var NullValue_name = map[int32]string{
+ 0: "NULL_VALUE",
+}
+
+var NullValue_value = map[string]int32{
+ "NULL_VALUE": 0,
+}
+
+func (x NullValue) String() string {
+ return proto.EnumName(NullValue_name, int32(x))
+}
+
+func (NullValue) EnumDescriptor() ([]byte, []int) {
+ return fileDescriptor_df322afd6c9fb402, []int{0}
+}
+
+func (NullValue) XXX_WellKnownType() string { return "NullValue" }
+
+// `Struct` represents a structured data value, consisting of fields
+// which map to dynamically typed values. In some languages, `Struct`
+// might be supported by a native representation. For example, in
+// scripting languages like JS a struct is represented as an
+// object. The details of that representation are described together
+// with the proto support for the language.
+//
+// The JSON representation for `Struct` is JSON object.
+type Struct struct {
+ // Unordered map of dynamically typed values.
+ Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Struct) Reset() { *m = Struct{} }
+func (m *Struct) String() string { return proto.CompactTextString(m) }
+func (*Struct) ProtoMessage() {}
+func (*Struct) Descriptor() ([]byte, []int) {
+ return fileDescriptor_df322afd6c9fb402, []int{0}
+}
+
+func (*Struct) XXX_WellKnownType() string { return "Struct" }
+
+func (m *Struct) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Struct.Unmarshal(m, b)
+}
+func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Struct.Marshal(b, m, deterministic)
+}
+func (m *Struct) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Struct.Merge(m, src)
+}
+func (m *Struct) XXX_Size() int {
+ return xxx_messageInfo_Struct.Size(m)
+}
+func (m *Struct) XXX_DiscardUnknown() {
+ xxx_messageInfo_Struct.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Struct proto.InternalMessageInfo
+
+func (m *Struct) GetFields() map[string]*Value {
+ if m != nil {
+ return m.Fields
+ }
+ return nil
+}
+
+// `Value` represents a dynamically typed value which can be either
+// null, a number, a string, a boolean, a recursive struct value, or a
+// list of values. A producer of value is expected to set one of that
+// variants, absence of any variant indicates an error.
+//
+// The JSON representation for `Value` is JSON value.
+type Value struct {
+ // The kind of value.
+ //
+ // Types that are valid to be assigned to Kind:
+ // *Value_NullValue
+ // *Value_NumberValue
+ // *Value_StringValue
+ // *Value_BoolValue
+ // *Value_StructValue
+ // *Value_ListValue
+ Kind isValue_Kind `protobuf_oneof:"kind"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Value) Reset() { *m = Value{} }
+func (m *Value) String() string { return proto.CompactTextString(m) }
+func (*Value) ProtoMessage() {}
+func (*Value) Descriptor() ([]byte, []int) {
+ return fileDescriptor_df322afd6c9fb402, []int{1}
+}
+
+func (*Value) XXX_WellKnownType() string { return "Value" }
+
+func (m *Value) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Value.Unmarshal(m, b)
+}
+func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Value.Marshal(b, m, deterministic)
+}
+func (m *Value) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Value.Merge(m, src)
+}
+func (m *Value) XXX_Size() int {
+ return xxx_messageInfo_Value.Size(m)
+}
+func (m *Value) XXX_DiscardUnknown() {
+ xxx_messageInfo_Value.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Value proto.InternalMessageInfo
+
+type isValue_Kind interface {
+ isValue_Kind()
+}
+
+type Value_NullValue struct {
+ NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
+}
+
+type Value_NumberValue struct {
+ NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,proto3,oneof"`
+}
+
+type Value_StringValue struct {
+ StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,proto3,oneof"`
+}
+
+type Value_BoolValue struct {
+ BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,proto3,oneof"`
+}
+
+type Value_StructValue struct {
+ StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,proto3,oneof"`
+}
+
+type Value_ListValue struct {
+ ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,proto3,oneof"`
+}
+
+func (*Value_NullValue) isValue_Kind() {}
+
+func (*Value_NumberValue) isValue_Kind() {}
+
+func (*Value_StringValue) isValue_Kind() {}
+
+func (*Value_BoolValue) isValue_Kind() {}
+
+func (*Value_StructValue) isValue_Kind() {}
+
+func (*Value_ListValue) isValue_Kind() {}
+
+func (m *Value) GetKind() isValue_Kind {
+ if m != nil {
+ return m.Kind
+ }
+ return nil
+}
+
+func (m *Value) GetNullValue() NullValue {
+ if x, ok := m.GetKind().(*Value_NullValue); ok {
+ return x.NullValue
+ }
+ return NullValue_NULL_VALUE
+}
+
+func (m *Value) GetNumberValue() float64 {
+ if x, ok := m.GetKind().(*Value_NumberValue); ok {
+ return x.NumberValue
+ }
+ return 0
+}
+
+func (m *Value) GetStringValue() string {
+ if x, ok := m.GetKind().(*Value_StringValue); ok {
+ return x.StringValue
+ }
+ return ""
+}
+
+func (m *Value) GetBoolValue() bool {
+ if x, ok := m.GetKind().(*Value_BoolValue); ok {
+ return x.BoolValue
+ }
+ return false
+}
+
+func (m *Value) GetStructValue() *Struct {
+ if x, ok := m.GetKind().(*Value_StructValue); ok {
+ return x.StructValue
+ }
+ return nil
+}
+
+func (m *Value) GetListValue() *ListValue {
+ if x, ok := m.GetKind().(*Value_ListValue); ok {
+ return x.ListValue
+ }
+ return nil
+}
+
+// XXX_OneofWrappers is for the internal use of the proto package.
+func (*Value) XXX_OneofWrappers() []interface{} {
+ return []interface{}{
+ (*Value_NullValue)(nil),
+ (*Value_NumberValue)(nil),
+ (*Value_StringValue)(nil),
+ (*Value_BoolValue)(nil),
+ (*Value_StructValue)(nil),
+ (*Value_ListValue)(nil),
+ }
+}
+
+// `ListValue` is a wrapper around a repeated field of values.
+//
+// The JSON representation for `ListValue` is JSON array.
+type ListValue struct {
+ // Repeated field of dynamically typed values.
+ Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *ListValue) Reset() { *m = ListValue{} }
+func (m *ListValue) String() string { return proto.CompactTextString(m) }
+func (*ListValue) ProtoMessage() {}
+func (*ListValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_df322afd6c9fb402, []int{2}
+}
+
+func (*ListValue) XXX_WellKnownType() string { return "ListValue" }
+
+func (m *ListValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_ListValue.Unmarshal(m, b)
+}
+func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_ListValue.Marshal(b, m, deterministic)
+}
+func (m *ListValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListValue.Merge(m, src)
+}
+func (m *ListValue) XXX_Size() int {
+ return xxx_messageInfo_ListValue.Size(m)
+}
+func (m *ListValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListValue proto.InternalMessageInfo
+
+func (m *ListValue) GetValues() []*Value {
+ if m != nil {
+ return m.Values
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value)
+ proto.RegisterType((*Struct)(nil), "google.protobuf.Struct")
+ proto.RegisterMapType((map[string]*Value)(nil), "google.protobuf.Struct.FieldsEntry")
+ proto.RegisterType((*Value)(nil), "google.protobuf.Value")
+ proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue")
+}
+
+func init() { proto.RegisterFile("google/protobuf/struct.proto", fileDescriptor_df322afd6c9fb402) }
+
+var fileDescriptor_df322afd6c9fb402 = []byte{
+ // 417 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x8b, 0xd3, 0x40,
+ 0x14, 0xc7, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa2, 0xa1, 0x7b, 0x09,
+ 0x22, 0x29, 0xd6, 0x8b, 0x18, 0x2f, 0x06, 0xd6, 0x5d, 0x30, 0x2c, 0x31, 0xba, 0x15, 0xbc, 0x94,
+ 0x26, 0x4d, 0x63, 0xe8, 0x74, 0x26, 0x24, 0x33, 0x4a, 0x8f, 0x7e, 0x0b, 0xcf, 0x1e, 0x3d, 0xfa,
+ 0xe9, 0x3c, 0xca, 0xcc, 0x24, 0xa9, 0xb4, 0xf4, 0x94, 0xbc, 0xf7, 0x7e, 0xef, 0x3f, 0xef, 0xff,
+ 0x66, 0xe0, 0x71, 0xc1, 0x58, 0x41, 0xf2, 0x49, 0x55, 0x33, 0xce, 0x52, 0xb1, 0x9a, 0x34, 0xbc,
+ 0x16, 0x19, 0xf7, 0x55, 0x8c, 0xef, 0xe9, 0xaa, 0xdf, 0x55, 0xc7, 0x3f, 0x11, 0x58, 0x1f, 0x15,
+ 0x81, 0x03, 0xb0, 0x56, 0x65, 0x4e, 0x96, 0xcd, 0x08, 0xb9, 0xa6, 0xe7, 0x4c, 0x2f, 0xfc, 0x3d,
+ 0xd8, 0xd7, 0xa0, 0xff, 0x4e, 0x51, 0x97, 0x94, 0xd7, 0xdb, 0xa4, 0x6d, 0x39, 0xff, 0x00, 0xce,
+ 0x7f, 0x69, 0x7c, 0x06, 0xe6, 0x3a, 0xdf, 0x8e, 0x90, 0x8b, 0x3c, 0x3b, 0x91, 0xbf, 0xf8, 0x39,
+ 0x0c, 0xbf, 0x2d, 0x88, 0xc8, 0x47, 0x86, 0x8b, 0x3c, 0x67, 0xfa, 0xe0, 0x40, 0x7c, 0x26, 0xab,
+ 0x89, 0x86, 0x5e, 0x1b, 0xaf, 0xd0, 0xf8, 0x8f, 0x01, 0x43, 0x95, 0xc4, 0x01, 0x00, 0x15, 0x84,
+ 0xcc, 0xb5, 0x80, 0x14, 0x3d, 0x9d, 0x9e, 0x1f, 0x08, 0xdc, 0x08, 0x42, 0x14, 0x7f, 0x3d, 0x48,
+ 0x6c, 0xda, 0x05, 0xf8, 0x02, 0xee, 0x52, 0xb1, 0x49, 0xf3, 0x7a, 0xbe, 0x3b, 0x1f, 0x5d, 0x0f,
+ 0x12, 0x47, 0x67, 0x7b, 0xa8, 0xe1, 0x75, 0x49, 0x8b, 0x16, 0x32, 0xe5, 0xe0, 0x12, 0xd2, 0x59,
+ 0x0d, 0x3d, 0x05, 0x48, 0x19, 0xeb, 0xc6, 0x38, 0x71, 0x91, 0x77, 0x47, 0x1e, 0x25, 0x73, 0x1a,
+ 0x78, 0xa3, 0x54, 0x44, 0xc6, 0x5b, 0x64, 0xa8, 0xac, 0x3e, 0x3c, 0xb2, 0xc7, 0x56, 0x5e, 0x64,
+ 0xbc, 0x77, 0x49, 0xca, 0xa6, 0xeb, 0xb5, 0x54, 0xef, 0xa1, 0xcb, 0xa8, 0x6c, 0x78, 0xef, 0x92,
+ 0x74, 0x41, 0x68, 0xc1, 0xc9, 0xba, 0xa4, 0xcb, 0x71, 0x00, 0x76, 0x4f, 0x60, 0x1f, 0x2c, 0x25,
+ 0xd6, 0xdd, 0xe8, 0xb1, 0xa5, 0xb7, 0xd4, 0xb3, 0x47, 0x60, 0xf7, 0x4b, 0xc4, 0xa7, 0x00, 0x37,
+ 0xb7, 0x51, 0x34, 0x9f, 0xbd, 0x8d, 0x6e, 0x2f, 0xcf, 0x06, 0xe1, 0x0f, 0x04, 0xf7, 0x33, 0xb6,
+ 0xd9, 0x97, 0x08, 0x1d, 0xed, 0x26, 0x96, 0x71, 0x8c, 0xbe, 0xbc, 0x28, 0x4a, 0xfe, 0x55, 0xa4,
+ 0x7e, 0xc6, 0x36, 0x93, 0x82, 0x91, 0x05, 0x2d, 0x76, 0x4f, 0xb1, 0xe2, 0xdb, 0x2a, 0x6f, 0xda,
+ 0x17, 0x19, 0xe8, 0x4f, 0x95, 0xfe, 0x45, 0xe8, 0x97, 0x61, 0x5e, 0xc5, 0xe1, 0x6f, 0xe3, 0xc9,
+ 0x95, 0x16, 0x8f, 0xbb, 0xf9, 0x3e, 0xe7, 0x84, 0xbc, 0xa7, 0xec, 0x3b, 0xfd, 0x24, 0x3b, 0x53,
+ 0x4b, 0x49, 0xbd, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x1b, 0x59, 0xf8, 0xe5, 0x02, 0x00,
+ 0x00,
+}
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp.go b/vendor/github.com/golang/protobuf/ptypes/timestamp.go
index 47f10dbc2..8da0df01a 100644
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp.go
+++ b/vendor/github.com/golang/protobuf/ptypes/timestamp.go
@@ -111,11 +111,9 @@ func TimestampNow() *tspb.Timestamp {
// TimestampProto converts the time.Time to a google.protobuf.Timestamp proto.
// It returns an error if the resulting Timestamp is invalid.
func TimestampProto(t time.Time) (*tspb.Timestamp, error) {
- seconds := t.Unix()
- nanos := int32(t.Sub(time.Unix(seconds, 0)))
ts := &tspb.Timestamp{
- Seconds: seconds,
- Nanos: nanos,
+ Seconds: t.Unix(),
+ Nanos: int32(t.Nanosecond()),
}
if err := validateTimestamp(ts); err != nil {
return nil, err
diff --git a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
index e9c222282..31cd846de 100644
--- a/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
+++ b/vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go
@@ -1,11 +1,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/protobuf/timestamp.proto
-package timestamp // import "github.com/golang/protobuf/ptypes/timestamp"
+package timestamp
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -16,7 +18,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// A Timestamp represents a point in time independent of any time zone
// or calendar, represented as seconds and fractions of seconds at
@@ -81,7 +83,9 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
-// is required, though only UTC (as indicated by "Z") is presently supported.
+// is required. A proto3 JSON serializer should always use UTC (as indicated by
+// "Z") when printing the Timestamp type and a proto3 JSON parser should be
+// able to accept both UTC and other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
// 01:30 UTC on January 15, 2017.
@@ -92,20 +96,20 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
// with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
// can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
-// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--)
-// to obtain a formatter capable of generating timestamps in this format.
+// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
+// ) to obtain a formatter capable of generating timestamps in this format.
//
//
type Timestamp struct {
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
- Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
+ Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive.
- Nanos int32 `protobuf:"varint,2,opt,name=nanos" json:"nanos,omitempty"`
+ Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -115,17 +119,19 @@ func (m *Timestamp) Reset() { *m = Timestamp{} }
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
func (*Timestamp) ProtoMessage() {}
func (*Timestamp) Descriptor() ([]byte, []int) {
- return fileDescriptor_timestamp_b826e8e5fba671a8, []int{0}
+ return fileDescriptor_292007bbfe81227e, []int{0}
}
+
func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" }
+
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Timestamp.Unmarshal(m, b)
}
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
}
-func (dst *Timestamp) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Timestamp.Merge(dst, src)
+func (m *Timestamp) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Timestamp.Merge(m, src)
}
func (m *Timestamp) XXX_Size() int {
return xxx_messageInfo_Timestamp.Size(m)
@@ -154,11 +160,9 @@ func init() {
proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp")
}
-func init() {
- proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_timestamp_b826e8e5fba671a8)
-}
+func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) }
-var fileDescriptor_timestamp_b826e8e5fba671a8 = []byte{
+var fileDescriptor_292007bbfe81227e = []byte{
// 191 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f,
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d,
diff --git a/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go b/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
new file mode 100644
index 000000000..add19a1ad
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
@@ -0,0 +1,461 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/protobuf/wrappers.proto
+
+package wrappers
+
+import (
+ fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// Wrapper message for `double`.
+//
+// The JSON representation for `DoubleValue` is JSON number.
+type DoubleValue struct {
+ // The double value.
+ Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *DoubleValue) Reset() { *m = DoubleValue{} }
+func (m *DoubleValue) String() string { return proto.CompactTextString(m) }
+func (*DoubleValue) ProtoMessage() {}
+func (*DoubleValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{0}
+}
+
+func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" }
+
+func (m *DoubleValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_DoubleValue.Unmarshal(m, b)
+}
+func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic)
+}
+func (m *DoubleValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DoubleValue.Merge(m, src)
+}
+func (m *DoubleValue) XXX_Size() int {
+ return xxx_messageInfo_DoubleValue.Size(m)
+}
+func (m *DoubleValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_DoubleValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DoubleValue proto.InternalMessageInfo
+
+func (m *DoubleValue) GetValue() float64 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `float`.
+//
+// The JSON representation for `FloatValue` is JSON number.
+type FloatValue struct {
+ // The float value.
+ Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *FloatValue) Reset() { *m = FloatValue{} }
+func (m *FloatValue) String() string { return proto.CompactTextString(m) }
+func (*FloatValue) ProtoMessage() {}
+func (*FloatValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{1}
+}
+
+func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" }
+
+func (m *FloatValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_FloatValue.Unmarshal(m, b)
+}
+func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic)
+}
+func (m *FloatValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_FloatValue.Merge(m, src)
+}
+func (m *FloatValue) XXX_Size() int {
+ return xxx_messageInfo_FloatValue.Size(m)
+}
+func (m *FloatValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_FloatValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_FloatValue proto.InternalMessageInfo
+
+func (m *FloatValue) GetValue() float32 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `int64`.
+//
+// The JSON representation for `Int64Value` is JSON string.
+type Int64Value struct {
+ // The int64 value.
+ Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Int64Value) Reset() { *m = Int64Value{} }
+func (m *Int64Value) String() string { return proto.CompactTextString(m) }
+func (*Int64Value) ProtoMessage() {}
+func (*Int64Value) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{2}
+}
+
+func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" }
+
+func (m *Int64Value) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Int64Value.Unmarshal(m, b)
+}
+func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic)
+}
+func (m *Int64Value) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Int64Value.Merge(m, src)
+}
+func (m *Int64Value) XXX_Size() int {
+ return xxx_messageInfo_Int64Value.Size(m)
+}
+func (m *Int64Value) XXX_DiscardUnknown() {
+ xxx_messageInfo_Int64Value.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Int64Value proto.InternalMessageInfo
+
+func (m *Int64Value) GetValue() int64 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `uint64`.
+//
+// The JSON representation for `UInt64Value` is JSON string.
+type UInt64Value struct {
+ // The uint64 value.
+ Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *UInt64Value) Reset() { *m = UInt64Value{} }
+func (m *UInt64Value) String() string { return proto.CompactTextString(m) }
+func (*UInt64Value) ProtoMessage() {}
+func (*UInt64Value) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{3}
+}
+
+func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" }
+
+func (m *UInt64Value) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_UInt64Value.Unmarshal(m, b)
+}
+func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic)
+}
+func (m *UInt64Value) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_UInt64Value.Merge(m, src)
+}
+func (m *UInt64Value) XXX_Size() int {
+ return xxx_messageInfo_UInt64Value.Size(m)
+}
+func (m *UInt64Value) XXX_DiscardUnknown() {
+ xxx_messageInfo_UInt64Value.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UInt64Value proto.InternalMessageInfo
+
+func (m *UInt64Value) GetValue() uint64 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `int32`.
+//
+// The JSON representation for `Int32Value` is JSON number.
+type Int32Value struct {
+ // The int32 value.
+ Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *Int32Value) Reset() { *m = Int32Value{} }
+func (m *Int32Value) String() string { return proto.CompactTextString(m) }
+func (*Int32Value) ProtoMessage() {}
+func (*Int32Value) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{4}
+}
+
+func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" }
+
+func (m *Int32Value) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_Int32Value.Unmarshal(m, b)
+}
+func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic)
+}
+func (m *Int32Value) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Int32Value.Merge(m, src)
+}
+func (m *Int32Value) XXX_Size() int {
+ return xxx_messageInfo_Int32Value.Size(m)
+}
+func (m *Int32Value) XXX_DiscardUnknown() {
+ xxx_messageInfo_Int32Value.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Int32Value proto.InternalMessageInfo
+
+func (m *Int32Value) GetValue() int32 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `uint32`.
+//
+// The JSON representation for `UInt32Value` is JSON number.
+type UInt32Value struct {
+ // The uint32 value.
+ Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *UInt32Value) Reset() { *m = UInt32Value{} }
+func (m *UInt32Value) String() string { return proto.CompactTextString(m) }
+func (*UInt32Value) ProtoMessage() {}
+func (*UInt32Value) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{5}
+}
+
+func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" }
+
+func (m *UInt32Value) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_UInt32Value.Unmarshal(m, b)
+}
+func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic)
+}
+func (m *UInt32Value) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_UInt32Value.Merge(m, src)
+}
+func (m *UInt32Value) XXX_Size() int {
+ return xxx_messageInfo_UInt32Value.Size(m)
+}
+func (m *UInt32Value) XXX_DiscardUnknown() {
+ xxx_messageInfo_UInt32Value.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_UInt32Value proto.InternalMessageInfo
+
+func (m *UInt32Value) GetValue() uint32 {
+ if m != nil {
+ return m.Value
+ }
+ return 0
+}
+
+// Wrapper message for `bool`.
+//
+// The JSON representation for `BoolValue` is JSON `true` and `false`.
+type BoolValue struct {
+ // The bool value.
+ Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *BoolValue) Reset() { *m = BoolValue{} }
+func (m *BoolValue) String() string { return proto.CompactTextString(m) }
+func (*BoolValue) ProtoMessage() {}
+func (*BoolValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{6}
+}
+
+func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" }
+
+func (m *BoolValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_BoolValue.Unmarshal(m, b)
+}
+func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic)
+}
+func (m *BoolValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BoolValue.Merge(m, src)
+}
+func (m *BoolValue) XXX_Size() int {
+ return xxx_messageInfo_BoolValue.Size(m)
+}
+func (m *BoolValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_BoolValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_BoolValue proto.InternalMessageInfo
+
+func (m *BoolValue) GetValue() bool {
+ if m != nil {
+ return m.Value
+ }
+ return false
+}
+
+// Wrapper message for `string`.
+//
+// The JSON representation for `StringValue` is JSON string.
+type StringValue struct {
+ // The string value.
+ Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *StringValue) Reset() { *m = StringValue{} }
+func (m *StringValue) String() string { return proto.CompactTextString(m) }
+func (*StringValue) ProtoMessage() {}
+func (*StringValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{7}
+}
+
+func (*StringValue) XXX_WellKnownType() string { return "StringValue" }
+
+func (m *StringValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_StringValue.Unmarshal(m, b)
+}
+func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_StringValue.Marshal(b, m, deterministic)
+}
+func (m *StringValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StringValue.Merge(m, src)
+}
+func (m *StringValue) XXX_Size() int {
+ return xxx_messageInfo_StringValue.Size(m)
+}
+func (m *StringValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_StringValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StringValue proto.InternalMessageInfo
+
+func (m *StringValue) GetValue() string {
+ if m != nil {
+ return m.Value
+ }
+ return ""
+}
+
+// Wrapper message for `bytes`.
+//
+// The JSON representation for `BytesValue` is JSON string.
+type BytesValue struct {
+ // The bytes value.
+ Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *BytesValue) Reset() { *m = BytesValue{} }
+func (m *BytesValue) String() string { return proto.CompactTextString(m) }
+func (*BytesValue) ProtoMessage() {}
+func (*BytesValue) Descriptor() ([]byte, []int) {
+ return fileDescriptor_5377b62bda767935, []int{8}
+}
+
+func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" }
+
+func (m *BytesValue) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_BytesValue.Unmarshal(m, b)
+}
+func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic)
+}
+func (m *BytesValue) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_BytesValue.Merge(m, src)
+}
+func (m *BytesValue) XXX_Size() int {
+ return xxx_messageInfo_BytesValue.Size(m)
+}
+func (m *BytesValue) XXX_DiscardUnknown() {
+ xxx_messageInfo_BytesValue.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_BytesValue proto.InternalMessageInfo
+
+func (m *BytesValue) GetValue() []byte {
+ if m != nil {
+ return m.Value
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*DoubleValue)(nil), "google.protobuf.DoubleValue")
+ proto.RegisterType((*FloatValue)(nil), "google.protobuf.FloatValue")
+ proto.RegisterType((*Int64Value)(nil), "google.protobuf.Int64Value")
+ proto.RegisterType((*UInt64Value)(nil), "google.protobuf.UInt64Value")
+ proto.RegisterType((*Int32Value)(nil), "google.protobuf.Int32Value")
+ proto.RegisterType((*UInt32Value)(nil), "google.protobuf.UInt32Value")
+ proto.RegisterType((*BoolValue)(nil), "google.protobuf.BoolValue")
+ proto.RegisterType((*StringValue)(nil), "google.protobuf.StringValue")
+ proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue")
+}
+
+func init() { proto.RegisterFile("google/protobuf/wrappers.proto", fileDescriptor_5377b62bda767935) }
+
+var fileDescriptor_5377b62bda767935 = []byte{
+ // 259 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f,
+ 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x2f, 0x4a, 0x2c,
+ 0x28, 0x48, 0x2d, 0x2a, 0xd6, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0xca,
+ 0x5c, 0xdc, 0x2e, 0xf9, 0xa5, 0x49, 0x39, 0xa9, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x42, 0x22, 0x5c,
+ 0xac, 0x65, 0x20, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x63, 0x10, 0x84, 0xa3, 0xa4, 0xc4, 0xc5,
+ 0xe5, 0x96, 0x93, 0x9f, 0x58, 0x82, 0x45, 0x0d, 0x13, 0x92, 0x1a, 0xcf, 0xbc, 0x12, 0x33, 0x13,
+ 0x2c, 0x6a, 0x98, 0x61, 0x6a, 0x94, 0xb9, 0xb8, 0x43, 0x71, 0x29, 0x62, 0x41, 0x35, 0xc8, 0xd8,
+ 0x08, 0x8b, 0x1a, 0x56, 0x34, 0x83, 0xb0, 0x2a, 0xe2, 0x85, 0x29, 0x52, 0xe4, 0xe2, 0x74, 0xca,
+ 0xcf, 0xcf, 0xc1, 0xa2, 0x84, 0x03, 0xc9, 0x9c, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0x74, 0x2c, 0x8a,
+ 0x38, 0x91, 0x1c, 0xe4, 0x54, 0x59, 0x92, 0x5a, 0x8c, 0x45, 0x0d, 0x0f, 0x54, 0x8d, 0x53, 0x0d,
+ 0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x5a, 0xe8, 0x3a, 0xf1, 0x86, 0x43, 0x83, 0x3f, 0x00, 0x24,
+ 0x12, 0xc0, 0x18, 0xa5, 0x95, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f,
+ 0x9e, 0x9f, 0x93, 0x98, 0x97, 0x8e, 0x88, 0xaa, 0x82, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x78, 0x8c,
+ 0xfd, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e,
+ 0x00, 0x54, 0xa9, 0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b,
+ 0x12, 0x1b, 0xd8, 0x0c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x19, 0x6c, 0xb9, 0xb8, 0xfe,
+ 0x01, 0x00, 0x00,
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt b/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt
new file mode 100644
index 000000000..364516251
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/LICENSE.txt
@@ -0,0 +1,27 @@
+Copyright (c) 2015, Gengo, 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 Gengo, 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/grpc-ecosystem/grpc-gateway/internal/stream_chunk.pb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/stream_chunk.pb.go
new file mode 100644
index 000000000..8858f0690
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/internal/stream_chunk.pb.go
@@ -0,0 +1,118 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: internal/stream_chunk.proto
+
+package internal
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+import any "github.com/golang/protobuf/ptypes/any"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+
+// StreamError is a response type which is returned when
+// streaming rpc returns an error.
+type StreamError struct {
+ GrpcCode int32 `protobuf:"varint,1,opt,name=grpc_code,json=grpcCode,proto3" json:"grpc_code,omitempty"`
+ HttpCode int32 `protobuf:"varint,2,opt,name=http_code,json=httpCode,proto3" json:"http_code,omitempty"`
+ Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
+ HttpStatus string `protobuf:"bytes,4,opt,name=http_status,json=httpStatus,proto3" json:"http_status,omitempty"`
+ Details []*any.Any `protobuf:"bytes,5,rep,name=details,proto3" json:"details,omitempty"`
+ XXX_NoUnkeyedLiteral struct{} `json:"-"`
+ XXX_unrecognized []byte `json:"-"`
+ XXX_sizecache int32 `json:"-"`
+}
+
+func (m *StreamError) Reset() { *m = StreamError{} }
+func (m *StreamError) String() string { return proto.CompactTextString(m) }
+func (*StreamError) ProtoMessage() {}
+func (*StreamError) Descriptor() ([]byte, []int) {
+ return fileDescriptor_stream_chunk_a2afb657504565d7, []int{0}
+}
+func (m *StreamError) XXX_Unmarshal(b []byte) error {
+ return xxx_messageInfo_StreamError.Unmarshal(m, b)
+}
+func (m *StreamError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ return xxx_messageInfo_StreamError.Marshal(b, m, deterministic)
+}
+func (dst *StreamError) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_StreamError.Merge(dst, src)
+}
+func (m *StreamError) XXX_Size() int {
+ return xxx_messageInfo_StreamError.Size(m)
+}
+func (m *StreamError) XXX_DiscardUnknown() {
+ xxx_messageInfo_StreamError.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_StreamError proto.InternalMessageInfo
+
+func (m *StreamError) GetGrpcCode() int32 {
+ if m != nil {
+ return m.GrpcCode
+ }
+ return 0
+}
+
+func (m *StreamError) GetHttpCode() int32 {
+ if m != nil {
+ return m.HttpCode
+ }
+ return 0
+}
+
+func (m *StreamError) GetMessage() string {
+ if m != nil {
+ return m.Message
+ }
+ return ""
+}
+
+func (m *StreamError) GetHttpStatus() string {
+ if m != nil {
+ return m.HttpStatus
+ }
+ return ""
+}
+
+func (m *StreamError) GetDetails() []*any.Any {
+ if m != nil {
+ return m.Details
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*StreamError)(nil), "grpc.gateway.runtime.StreamError")
+}
+
+func init() {
+ proto.RegisterFile("internal/stream_chunk.proto", fileDescriptor_stream_chunk_a2afb657504565d7)
+}
+
+var fileDescriptor_stream_chunk_a2afb657504565d7 = []byte{
+ // 223 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x90, 0x41, 0x4e, 0xc3, 0x30,
+ 0x10, 0x45, 0x15, 0x4a, 0x69, 0x3b, 0xd9, 0x45, 0x5d, 0x18, 0xba, 0x20, 0x62, 0x95, 0x95, 0x23,
+ 0xc1, 0x09, 0x00, 0x71, 0x81, 0x74, 0xc7, 0xa6, 0x9a, 0x26, 0x83, 0x13, 0x91, 0xd8, 0xd1, 0x78,
+ 0x22, 0x94, 0x6b, 0x71, 0xc2, 0xca, 0x8e, 0xb2, 0xf4, 0x7b, 0x7f, 0xbe, 0xbe, 0x0c, 0xa7, 0xce,
+ 0x0a, 0xb1, 0xc5, 0xbe, 0xf4, 0xc2, 0x84, 0xc3, 0xa5, 0x6e, 0x27, 0xfb, 0xab, 0x47, 0x76, 0xe2,
+ 0xb2, 0xa3, 0xe1, 0xb1, 0xd6, 0x06, 0x85, 0xfe, 0x70, 0xd6, 0x3c, 0x59, 0xe9, 0x06, 0x7a, 0x7a,
+ 0x34, 0xce, 0x99, 0x9e, 0xca, 0x98, 0xb9, 0x4e, 0x3f, 0x25, 0xda, 0x79, 0x39, 0x78, 0xf9, 0x4f,
+ 0x20, 0x3d, 0xc7, 0x9e, 0x2f, 0x66, 0xc7, 0xd9, 0x09, 0x0e, 0xa1, 0xe2, 0x52, 0xbb, 0x86, 0x54,
+ 0x92, 0x27, 0xc5, 0xb6, 0xda, 0x07, 0xf0, 0xe9, 0x1a, 0x0a, 0xb2, 0x15, 0x19, 0x17, 0x79, 0xb7,
+ 0xc8, 0x00, 0xa2, 0x54, 0xb0, 0x1b, 0xc8, 0x7b, 0x34, 0xa4, 0x36, 0x79, 0x52, 0x1c, 0xaa, 0xf5,
+ 0x99, 0x3d, 0x43, 0x1a, 0xcf, 0xbc, 0xa0, 0x4c, 0x5e, 0xdd, 0x47, 0x0b, 0x01, 0x9d, 0x23, 0xc9,
+ 0x34, 0xec, 0x1a, 0x12, 0xec, 0x7a, 0xaf, 0xb6, 0xf9, 0xa6, 0x48, 0x5f, 0x8f, 0x7a, 0x59, 0xac,
+ 0xd7, 0xc5, 0xfa, 0xdd, 0xce, 0xd5, 0x1a, 0xfa, 0x80, 0xef, 0xfd, 0xfa, 0x09, 0xd7, 0x87, 0x18,
+ 0x79, 0xbb, 0x05, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x7d, 0xa5, 0x18, 0x17, 0x01, 0x00, 0x00,
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go
new file mode 100644
index 000000000..896057e1e
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go
@@ -0,0 +1,210 @@
+package runtime
+
+import (
+ "context"
+ "encoding/base64"
+ "fmt"
+ "net"
+ "net/http"
+ "net/textproto"
+ "strconv"
+ "strings"
+ "time"
+
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+)
+
+// MetadataHeaderPrefix is the http prefix that represents custom metadata
+// parameters to or from a gRPC call.
+const MetadataHeaderPrefix = "Grpc-Metadata-"
+
+// MetadataPrefix is prepended to permanent HTTP header keys (as specified
+// by the IANA) when added to the gRPC context.
+const MetadataPrefix = "grpcgateway-"
+
+// MetadataTrailerPrefix is prepended to gRPC metadata as it is converted to
+// HTTP headers in a response handled by grpc-gateway
+const MetadataTrailerPrefix = "Grpc-Trailer-"
+
+const metadataGrpcTimeout = "Grpc-Timeout"
+const metadataHeaderBinarySuffix = "-Bin"
+
+const xForwardedFor = "X-Forwarded-For"
+const xForwardedHost = "X-Forwarded-Host"
+
+var (
+ // DefaultContextTimeout is used for gRPC call context.WithTimeout whenever a Grpc-Timeout inbound
+ // header isn't present. If the value is 0 the sent `context` will not have a timeout.
+ DefaultContextTimeout = 0 * time.Second
+)
+
+func decodeBinHeader(v string) ([]byte, error) {
+ if len(v)%4 == 0 {
+ // Input was padded, or padding was not necessary.
+ return base64.StdEncoding.DecodeString(v)
+ }
+ return base64.RawStdEncoding.DecodeString(v)
+}
+
+/*
+AnnotateContext adds context information such as metadata from the request.
+
+At a minimum, the RemoteAddr is included in the fashion of "X-Forwarded-For",
+except that the forwarded destination is not another HTTP service but rather
+a gRPC service.
+*/
+func AnnotateContext(ctx context.Context, mux *ServeMux, req *http.Request) (context.Context, error) {
+ var pairs []string
+ timeout := DefaultContextTimeout
+ if tm := req.Header.Get(metadataGrpcTimeout); tm != "" {
+ var err error
+ timeout, err = timeoutDecode(tm)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid grpc-timeout: %s", tm)
+ }
+ }
+
+ for key, vals := range req.Header {
+ for _, val := range vals {
+ key = textproto.CanonicalMIMEHeaderKey(key)
+ // For backwards-compatibility, pass through 'authorization' header with no prefix.
+ if key == "Authorization" {
+ pairs = append(pairs, "authorization", val)
+ }
+ if h, ok := mux.incomingHeaderMatcher(key); ok {
+ // Handles "-bin" metadata in grpc, since grpc will do another base64
+ // encode before sending to server, we need to decode it first.
+ if strings.HasSuffix(key, metadataHeaderBinarySuffix) {
+ b, err := decodeBinHeader(val)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid binary header %s: %s", key, err)
+ }
+
+ val = string(b)
+ }
+ pairs = append(pairs, h, val)
+ }
+ }
+ }
+ if host := req.Header.Get(xForwardedHost); host != "" {
+ pairs = append(pairs, strings.ToLower(xForwardedHost), host)
+ } else if req.Host != "" {
+ pairs = append(pairs, strings.ToLower(xForwardedHost), req.Host)
+ }
+
+ if addr := req.RemoteAddr; addr != "" {
+ if remoteIP, _, err := net.SplitHostPort(addr); err == nil {
+ if fwd := req.Header.Get(xForwardedFor); fwd == "" {
+ pairs = append(pairs, strings.ToLower(xForwardedFor), remoteIP)
+ } else {
+ pairs = append(pairs, strings.ToLower(xForwardedFor), fmt.Sprintf("%s, %s", fwd, remoteIP))
+ }
+ } else {
+ grpclog.Infof("invalid remote addr: %s", addr)
+ }
+ }
+
+ if timeout != 0 {
+ ctx, _ = context.WithTimeout(ctx, timeout)
+ }
+ if len(pairs) == 0 {
+ return ctx, nil
+ }
+ md := metadata.Pairs(pairs...)
+ for _, mda := range mux.metadataAnnotators {
+ md = metadata.Join(md, mda(ctx, req))
+ }
+ return metadata.NewOutgoingContext(ctx, md), nil
+}
+
+// ServerMetadata consists of metadata sent from gRPC server.
+type ServerMetadata struct {
+ HeaderMD metadata.MD
+ TrailerMD metadata.MD
+}
+
+type serverMetadataKey struct{}
+
+// NewServerMetadataContext creates a new context with ServerMetadata
+func NewServerMetadataContext(ctx context.Context, md ServerMetadata) context.Context {
+ return context.WithValue(ctx, serverMetadataKey{}, md)
+}
+
+// ServerMetadataFromContext returns the ServerMetadata in ctx
+func ServerMetadataFromContext(ctx context.Context) (md ServerMetadata, ok bool) {
+ md, ok = ctx.Value(serverMetadataKey{}).(ServerMetadata)
+ return
+}
+
+func timeoutDecode(s string) (time.Duration, error) {
+ size := len(s)
+ if size < 2 {
+ return 0, fmt.Errorf("timeout string is too short: %q", s)
+ }
+ d, ok := timeoutUnitToDuration(s[size-1])
+ if !ok {
+ return 0, fmt.Errorf("timeout unit is not recognized: %q", s)
+ }
+ t, err := strconv.ParseInt(s[:size-1], 10, 64)
+ if err != nil {
+ return 0, err
+ }
+ return d * time.Duration(t), nil
+}
+
+func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) {
+ switch u {
+ case 'H':
+ return time.Hour, true
+ case 'M':
+ return time.Minute, true
+ case 'S':
+ return time.Second, true
+ case 'm':
+ return time.Millisecond, true
+ case 'u':
+ return time.Microsecond, true
+ case 'n':
+ return time.Nanosecond, true
+ default:
+ }
+ return
+}
+
+// isPermanentHTTPHeader checks whether hdr belongs to the list of
+// permenant request headers maintained by IANA.
+// http://www.iana.org/assignments/message-headers/message-headers.xml
+func isPermanentHTTPHeader(hdr string) bool {
+ switch hdr {
+ case
+ "Accept",
+ "Accept-Charset",
+ "Accept-Language",
+ "Accept-Ranges",
+ "Authorization",
+ "Cache-Control",
+ "Content-Type",
+ "Cookie",
+ "Date",
+ "Expect",
+ "From",
+ "Host",
+ "If-Match",
+ "If-Modified-Since",
+ "If-None-Match",
+ "If-Schedule-Tag-Match",
+ "If-Unmodified-Since",
+ "Max-Forwards",
+ "Origin",
+ "Pragma",
+ "Referer",
+ "User-Agent",
+ "Via",
+ "Warning":
+ return true
+ }
+ return false
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go
new file mode 100644
index 000000000..a5b3bd6a7
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/convert.go
@@ -0,0 +1,312 @@
+package runtime
+
+import (
+ "encoding/base64"
+ "fmt"
+ "strconv"
+ "strings"
+
+ "github.com/golang/protobuf/jsonpb"
+ "github.com/golang/protobuf/ptypes/duration"
+ "github.com/golang/protobuf/ptypes/timestamp"
+ "github.com/golang/protobuf/ptypes/wrappers"
+)
+
+// String just returns the given string.
+// It is just for compatibility to other types.
+func String(val string) (string, error) {
+ return val, nil
+}
+
+// StringSlice converts 'val' where individual strings are separated by
+// 'sep' into a string slice.
+func StringSlice(val, sep string) ([]string, error) {
+ return strings.Split(val, sep), nil
+}
+
+// Bool converts the given string representation of a boolean value into bool.
+func Bool(val string) (bool, error) {
+ return strconv.ParseBool(val)
+}
+
+// BoolSlice converts 'val' where individual booleans are separated by
+// 'sep' into a bool slice.
+func BoolSlice(val, sep string) ([]bool, error) {
+ s := strings.Split(val, sep)
+ values := make([]bool, len(s))
+ for i, v := range s {
+ value, err := Bool(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Float64 converts the given string representation into representation of a floating point number into float64.
+func Float64(val string) (float64, error) {
+ return strconv.ParseFloat(val, 64)
+}
+
+// Float64Slice converts 'val' where individual floating point numbers are separated by
+// 'sep' into a float64 slice.
+func Float64Slice(val, sep string) ([]float64, error) {
+ s := strings.Split(val, sep)
+ values := make([]float64, len(s))
+ for i, v := range s {
+ value, err := Float64(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Float32 converts the given string representation of a floating point number into float32.
+func Float32(val string) (float32, error) {
+ f, err := strconv.ParseFloat(val, 32)
+ if err != nil {
+ return 0, err
+ }
+ return float32(f), nil
+}
+
+// Float32Slice converts 'val' where individual floating point numbers are separated by
+// 'sep' into a float32 slice.
+func Float32Slice(val, sep string) ([]float32, error) {
+ s := strings.Split(val, sep)
+ values := make([]float32, len(s))
+ for i, v := range s {
+ value, err := Float32(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Int64 converts the given string representation of an integer into int64.
+func Int64(val string) (int64, error) {
+ return strconv.ParseInt(val, 0, 64)
+}
+
+// Int64Slice converts 'val' where individual integers are separated by
+// 'sep' into a int64 slice.
+func Int64Slice(val, sep string) ([]int64, error) {
+ s := strings.Split(val, sep)
+ values := make([]int64, len(s))
+ for i, v := range s {
+ value, err := Int64(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Int32 converts the given string representation of an integer into int32.
+func Int32(val string) (int32, error) {
+ i, err := strconv.ParseInt(val, 0, 32)
+ if err != nil {
+ return 0, err
+ }
+ return int32(i), nil
+}
+
+// Int32Slice converts 'val' where individual integers are separated by
+// 'sep' into a int32 slice.
+func Int32Slice(val, sep string) ([]int32, error) {
+ s := strings.Split(val, sep)
+ values := make([]int32, len(s))
+ for i, v := range s {
+ value, err := Int32(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Uint64 converts the given string representation of an integer into uint64.
+func Uint64(val string) (uint64, error) {
+ return strconv.ParseUint(val, 0, 64)
+}
+
+// Uint64Slice converts 'val' where individual integers are separated by
+// 'sep' into a uint64 slice.
+func Uint64Slice(val, sep string) ([]uint64, error) {
+ s := strings.Split(val, sep)
+ values := make([]uint64, len(s))
+ for i, v := range s {
+ value, err := Uint64(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Uint32 converts the given string representation of an integer into uint32.
+func Uint32(val string) (uint32, error) {
+ i, err := strconv.ParseUint(val, 0, 32)
+ if err != nil {
+ return 0, err
+ }
+ return uint32(i), nil
+}
+
+// Uint32Slice converts 'val' where individual integers are separated by
+// 'sep' into a uint32 slice.
+func Uint32Slice(val, sep string) ([]uint32, error) {
+ s := strings.Split(val, sep)
+ values := make([]uint32, len(s))
+ for i, v := range s {
+ value, err := Uint32(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Bytes converts the given string representation of a byte sequence into a slice of bytes
+// A bytes sequence is encoded in URL-safe base64 without padding
+func Bytes(val string) ([]byte, error) {
+ b, err := base64.StdEncoding.DecodeString(val)
+ if err != nil {
+ b, err = base64.URLEncoding.DecodeString(val)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return b, nil
+}
+
+// BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe
+// base64 without padding, are separated by 'sep' into a slice of bytes slices slice.
+func BytesSlice(val, sep string) ([][]byte, error) {
+ s := strings.Split(val, sep)
+ values := make([][]byte, len(s))
+ for i, v := range s {
+ value, err := Bytes(v)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+// Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp.
+func Timestamp(val string) (*timestamp.Timestamp, error) {
+ var r *timestamp.Timestamp
+ err := jsonpb.UnmarshalString(val, r)
+ return r, err
+}
+
+// Duration converts the given string into a timestamp.Duration.
+func Duration(val string) (*duration.Duration, error) {
+ var r *duration.Duration
+ err := jsonpb.UnmarshalString(val, r)
+ return r, err
+}
+
+// Enum converts the given string into an int32 that should be type casted into the
+// correct enum proto type.
+func Enum(val string, enumValMap map[string]int32) (int32, error) {
+ e, ok := enumValMap[val]
+ if ok {
+ return e, nil
+ }
+
+ i, err := Int32(val)
+ if err != nil {
+ return 0, fmt.Errorf("%s is not valid", val)
+ }
+ for _, v := range enumValMap {
+ if v == i {
+ return i, nil
+ }
+ }
+ return 0, fmt.Errorf("%s is not valid", val)
+}
+
+// EnumSlice converts 'val' where individual enums are separated by 'sep'
+// into a int32 slice. Each individual int32 should be type casted into the
+// correct enum proto type.
+func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error) {
+ s := strings.Split(val, sep)
+ values := make([]int32, len(s))
+ for i, v := range s {
+ value, err := Enum(v, enumValMap)
+ if err != nil {
+ return values, err
+ }
+ values[i] = value
+ }
+ return values, nil
+}
+
+/*
+ Support fot google.protobuf.wrappers on top of primitive types
+*/
+
+// StringValue well-known type support as wrapper around string type
+func StringValue(val string) (*wrappers.StringValue, error) {
+ return &wrappers.StringValue{Value: val}, nil
+}
+
+// FloatValue well-known type support as wrapper around float32 type
+func FloatValue(val string) (*wrappers.FloatValue, error) {
+ parsedVal, err := Float32(val)
+ return &wrappers.FloatValue{Value: parsedVal}, err
+}
+
+// DoubleValue well-known type support as wrapper around float64 type
+func DoubleValue(val string) (*wrappers.DoubleValue, error) {
+ parsedVal, err := Float64(val)
+ return &wrappers.DoubleValue{Value: parsedVal}, err
+}
+
+// BoolValue well-known type support as wrapper around bool type
+func BoolValue(val string) (*wrappers.BoolValue, error) {
+ parsedVal, err := Bool(val)
+ return &wrappers.BoolValue{Value: parsedVal}, err
+}
+
+// Int32Value well-known type support as wrapper around int32 type
+func Int32Value(val string) (*wrappers.Int32Value, error) {
+ parsedVal, err := Int32(val)
+ return &wrappers.Int32Value{Value: parsedVal}, err
+}
+
+// UInt32Value well-known type support as wrapper around uint32 type
+func UInt32Value(val string) (*wrappers.UInt32Value, error) {
+ parsedVal, err := Uint32(val)
+ return &wrappers.UInt32Value{Value: parsedVal}, err
+}
+
+// Int64Value well-known type support as wrapper around int64 type
+func Int64Value(val string) (*wrappers.Int64Value, error) {
+ parsedVal, err := Int64(val)
+ return &wrappers.Int64Value{Value: parsedVal}, err
+}
+
+// UInt64Value well-known type support as wrapper around uint64 type
+func UInt64Value(val string) (*wrappers.UInt64Value, error) {
+ parsedVal, err := Uint64(val)
+ return &wrappers.UInt64Value{Value: parsedVal}, err
+}
+
+// BytesValue well-known type support as wrapper around bytes[] type
+func BytesValue(val string) (*wrappers.BytesValue, error) {
+ parsedVal, err := Bytes(val)
+ return &wrappers.BytesValue{Value: parsedVal}, err
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go
new file mode 100644
index 000000000..b6e5ddf7a
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go
@@ -0,0 +1,5 @@
+/*
+Package runtime contains runtime helper functions used by
+servers which protoc-gen-grpc-gateway generates.
+*/
+package runtime
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go
new file mode 100644
index 000000000..ad945788d
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go
@@ -0,0 +1,146 @@
+package runtime
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/golang/protobuf/proto"
+ "github.com/golang/protobuf/ptypes/any"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/status"
+)
+
+// HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status.
+// See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
+func HTTPStatusFromCode(code codes.Code) int {
+ switch code {
+ case codes.OK:
+ return http.StatusOK
+ case codes.Canceled:
+ return http.StatusRequestTimeout
+ case codes.Unknown:
+ return http.StatusInternalServerError
+ case codes.InvalidArgument:
+ return http.StatusBadRequest
+ case codes.DeadlineExceeded:
+ return http.StatusGatewayTimeout
+ case codes.NotFound:
+ return http.StatusNotFound
+ case codes.AlreadyExists:
+ return http.StatusConflict
+ case codes.PermissionDenied:
+ return http.StatusForbidden
+ case codes.Unauthenticated:
+ return http.StatusUnauthorized
+ case codes.ResourceExhausted:
+ return http.StatusTooManyRequests
+ case codes.FailedPrecondition:
+ // Note, this deliberately doesn't translate to the similarly named '412 Precondition Failed' HTTP response status.
+ return http.StatusBadRequest
+ case codes.Aborted:
+ return http.StatusConflict
+ case codes.OutOfRange:
+ return http.StatusBadRequest
+ case codes.Unimplemented:
+ return http.StatusNotImplemented
+ case codes.Internal:
+ return http.StatusInternalServerError
+ case codes.Unavailable:
+ return http.StatusServiceUnavailable
+ case codes.DataLoss:
+ return http.StatusInternalServerError
+ }
+
+ grpclog.Infof("Unknown gRPC error code: %v", code)
+ return http.StatusInternalServerError
+}
+
+var (
+ // HTTPError replies to the request with the error.
+ // You can set a custom function to this variable to customize error format.
+ HTTPError = DefaultHTTPError
+ // OtherErrorHandler handles the following error used by the gateway: StatusMethodNotAllowed StatusNotFound and StatusBadRequest
+ OtherErrorHandler = DefaultOtherErrorHandler
+)
+
+type errorBody struct {
+ Error string `protobuf:"bytes,1,name=error" json:"error"`
+ // This is to make the error more compatible with users that expect errors to be Status objects:
+ // https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto
+ // It should be the exact same message as the Error field.
+ Message string `protobuf:"bytes,1,name=message" json:"message"`
+ Code int32 `protobuf:"varint,2,name=code" json:"code"`
+ Details []*any.Any `protobuf:"bytes,3,rep,name=details" json:"details,omitempty"`
+}
+
+// Make this also conform to proto.Message for builtin JSONPb Marshaler
+func (e *errorBody) Reset() { *e = errorBody{} }
+func (e *errorBody) String() string { return proto.CompactTextString(e) }
+func (*errorBody) ProtoMessage() {}
+
+// DefaultHTTPError is the default implementation of HTTPError.
+// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode.
+// If otherwise, it replies with http.StatusInternalServerError.
+//
+// The response body returned by this function is a JSON object,
+// which contains a member whose key is "error" and whose value is err.Error().
+func DefaultHTTPError(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, _ *http.Request, err error) {
+ const fallback = `{"error": "failed to marshal error message"}`
+
+ s, ok := status.FromError(err)
+ if !ok {
+ s = status.New(codes.Unknown, err.Error())
+ }
+
+ w.Header().Del("Trailer")
+
+ contentType := marshaler.ContentType()
+ // Check marshaler on run time in order to keep backwards compatability
+ // An interface param needs to be added to the ContentType() function on
+ // the Marshal interface to be able to remove this check
+ if httpBodyMarshaler, ok := marshaler.(*HTTPBodyMarshaler); ok {
+ pb := s.Proto()
+ contentType = httpBodyMarshaler.ContentTypeFromMessage(pb)
+ }
+ w.Header().Set("Content-Type", contentType)
+
+ body := &errorBody{
+ Error: s.Message(),
+ Message: s.Message(),
+ Code: int32(s.Code()),
+ Details: s.Proto().GetDetails(),
+ }
+
+ buf, merr := marshaler.Marshal(body)
+ if merr != nil {
+ grpclog.Infof("Failed to marshal error message %q: %v", body, merr)
+ w.WriteHeader(http.StatusInternalServerError)
+ if _, err := io.WriteString(w, fallback); err != nil {
+ grpclog.Infof("Failed to write response: %v", err)
+ }
+ return
+ }
+
+ md, ok := ServerMetadataFromContext(ctx)
+ if !ok {
+ grpclog.Infof("Failed to extract ServerMetadata from context")
+ }
+
+ handleForwardResponseServerMetadata(w, mux, md)
+ handleForwardResponseTrailerHeader(w, md)
+ st := HTTPStatusFromCode(s.Code())
+ w.WriteHeader(st)
+ if _, err := w.Write(buf); err != nil {
+ grpclog.Infof("Failed to write response: %v", err)
+ }
+
+ handleForwardResponseTrailer(w, md)
+}
+
+// DefaultOtherErrorHandler is the default implementation of OtherErrorHandler.
+// It simply writes a string representation of the given error into "w".
+func DefaultOtherErrorHandler(w http.ResponseWriter, _ *http.Request, msg string, code int) {
+ http.Error(w, msg, code)
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go
new file mode 100644
index 000000000..e1cf7a914
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go
@@ -0,0 +1,70 @@
+package runtime
+
+import (
+ "encoding/json"
+ "io"
+ "strings"
+
+ "github.com/golang/protobuf/protoc-gen-go/generator"
+ "google.golang.org/genproto/protobuf/field_mask"
+)
+
+// FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body.
+func FieldMaskFromRequestBody(r io.Reader) (*field_mask.FieldMask, error) {
+ fm := &field_mask.FieldMask{}
+ var root interface{}
+ if err := json.NewDecoder(r).Decode(&root); err != nil {
+ if err == io.EOF {
+ return fm, nil
+ }
+ return nil, err
+ }
+
+ queue := []fieldMaskPathItem{{node: root}}
+ for len(queue) > 0 {
+ // dequeue an item
+ item := queue[0]
+ queue = queue[1:]
+
+ if m, ok := item.node.(map[string]interface{}); ok {
+ // if the item is an object, then enqueue all of its children
+ for k, v := range m {
+ queue = append(queue, fieldMaskPathItem{path: append(item.path, generator.CamelCase(k)), node: v})
+ }
+ } else if len(item.path) > 0 {
+ // otherwise, it's a leaf node so print its path
+ fm.Paths = append(fm.Paths, strings.Join(item.path, "."))
+ }
+ }
+
+ return fm, nil
+}
+
+// fieldMaskPathItem stores a in-progress deconstruction of a path for a fieldmask
+type fieldMaskPathItem struct {
+ // the list of prior fields leading up to node
+ path []string
+
+ // a generic decoded json object the current item to inspect for further path extraction
+ node interface{}
+}
+
+// CamelCaseFieldMask updates the given FieldMask by converting all of its paths to CamelCase, using the same heuristic
+// that's used for naming protobuf fields in Go.
+func CamelCaseFieldMask(mask *field_mask.FieldMask) {
+ if mask == nil || mask.Paths == nil {
+ return
+ }
+
+ var newPaths []string
+ for _, path := range mask.Paths {
+ lowerCasedParts := strings.Split(path, ".")
+ var camelCasedParts []string
+ for _, part := range lowerCasedParts {
+ camelCasedParts = append(camelCasedParts, generator.CamelCase(part))
+ }
+ newPaths = append(newPaths, strings.Join(camelCasedParts, "."))
+ }
+
+ mask.Paths = newPaths
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go
new file mode 100644
index 000000000..2af900650
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/handler.go
@@ -0,0 +1,209 @@
+package runtime
+
+import (
+ "errors"
+ "fmt"
+ "io"
+ "net/http"
+ "net/textproto"
+
+ "context"
+ "github.com/golang/protobuf/proto"
+ "github.com/grpc-ecosystem/grpc-gateway/internal"
+ "google.golang.org/grpc/grpclog"
+)
+
+var errEmptyResponse = errors.New("empty response")
+
+// ForwardResponseStream forwards the stream from gRPC server to REST client.
+func ForwardResponseStream(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, recv func() (proto.Message, error), opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
+ f, ok := w.(http.Flusher)
+ if !ok {
+ grpclog.Infof("Flush not supported in %T", w)
+ http.Error(w, "unexpected type of web server", http.StatusInternalServerError)
+ return
+ }
+
+ md, ok := ServerMetadataFromContext(ctx)
+ if !ok {
+ grpclog.Infof("Failed to extract ServerMetadata from context")
+ http.Error(w, "unexpected error", http.StatusInternalServerError)
+ return
+ }
+ handleForwardResponseServerMetadata(w, mux, md)
+
+ w.Header().Set("Transfer-Encoding", "chunked")
+ w.Header().Set("Content-Type", marshaler.ContentType())
+ if err := handleForwardResponseOptions(ctx, w, nil, opts); err != nil {
+ HTTPError(ctx, mux, marshaler, w, req, err)
+ return
+ }
+
+ var delimiter []byte
+ if d, ok := marshaler.(Delimited); ok {
+ delimiter = d.Delimiter()
+ } else {
+ delimiter = []byte("\n")
+ }
+
+ var wroteHeader bool
+ for {
+ resp, err := recv()
+ if err == io.EOF {
+ return
+ }
+ if err != nil {
+ handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err)
+ return
+ }
+ if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil {
+ handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err)
+ return
+ }
+
+ buf, err := marshaler.Marshal(streamChunk(ctx, resp, mux.streamErrorHandler))
+ if err != nil {
+ grpclog.Infof("Failed to marshal response chunk: %v", err)
+ handleForwardResponseStreamError(ctx, wroteHeader, marshaler, w, req, mux, err)
+ return
+ }
+ if _, err = w.Write(buf); err != nil {
+ grpclog.Infof("Failed to send response chunk: %v", err)
+ return
+ }
+ wroteHeader = true
+ if _, err = w.Write(delimiter); err != nil {
+ grpclog.Infof("Failed to send delimiter chunk: %v", err)
+ return
+ }
+ f.Flush()
+ }
+}
+
+func handleForwardResponseServerMetadata(w http.ResponseWriter, mux *ServeMux, md ServerMetadata) {
+ for k, vs := range md.HeaderMD {
+ if h, ok := mux.outgoingHeaderMatcher(k); ok {
+ for _, v := range vs {
+ w.Header().Add(h, v)
+ }
+ }
+ }
+}
+
+func handleForwardResponseTrailerHeader(w http.ResponseWriter, md ServerMetadata) {
+ for k := range md.TrailerMD {
+ tKey := textproto.CanonicalMIMEHeaderKey(fmt.Sprintf("%s%s", MetadataTrailerPrefix, k))
+ w.Header().Add("Trailer", tKey)
+ }
+}
+
+func handleForwardResponseTrailer(w http.ResponseWriter, md ServerMetadata) {
+ for k, vs := range md.TrailerMD {
+ tKey := fmt.Sprintf("%s%s", MetadataTrailerPrefix, k)
+ for _, v := range vs {
+ w.Header().Add(tKey, v)
+ }
+ }
+}
+
+// responseBody interface contains method for getting field for marshaling to the response body
+// this method is generated for response struct from the value of `response_body` in the `google.api.HttpRule`
+type responseBody interface {
+ XXX_ResponseBody() interface{}
+}
+
+// ForwardResponseMessage forwards the message "resp" from gRPC server to REST client.
+func ForwardResponseMessage(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, req *http.Request, resp proto.Message, opts ...func(context.Context, http.ResponseWriter, proto.Message) error) {
+ md, ok := ServerMetadataFromContext(ctx)
+ if !ok {
+ grpclog.Infof("Failed to extract ServerMetadata from context")
+ }
+
+ handleForwardResponseServerMetadata(w, mux, md)
+ handleForwardResponseTrailerHeader(w, md)
+
+ contentType := marshaler.ContentType()
+ // Check marshaler on run time in order to keep backwards compatability
+ // An interface param needs to be added to the ContentType() function on
+ // the Marshal interface to be able to remove this check
+ if httpBodyMarshaler, ok := marshaler.(*HTTPBodyMarshaler); ok {
+ contentType = httpBodyMarshaler.ContentTypeFromMessage(resp)
+ }
+ w.Header().Set("Content-Type", contentType)
+
+ if err := handleForwardResponseOptions(ctx, w, resp, opts); err != nil {
+ HTTPError(ctx, mux, marshaler, w, req, err)
+ return
+ }
+ var buf []byte
+ var err error
+ if rb, ok := resp.(responseBody); ok {
+ buf, err = marshaler.Marshal(rb.XXX_ResponseBody())
+ } else {
+ buf, err = marshaler.Marshal(resp)
+ }
+ if err != nil {
+ grpclog.Infof("Marshal error: %v", err)
+ HTTPError(ctx, mux, marshaler, w, req, err)
+ return
+ }
+
+ if _, err = w.Write(buf); err != nil {
+ grpclog.Infof("Failed to write response: %v", err)
+ }
+
+ handleForwardResponseTrailer(w, md)
+}
+
+func handleForwardResponseOptions(ctx context.Context, w http.ResponseWriter, resp proto.Message, opts []func(context.Context, http.ResponseWriter, proto.Message) error) error {
+ if len(opts) == 0 {
+ return nil
+ }
+ for _, opt := range opts {
+ if err := opt(ctx, w, resp); err != nil {
+ grpclog.Infof("Error handling ForwardResponseOptions: %v", err)
+ return err
+ }
+ }
+ return nil
+}
+
+func handleForwardResponseStreamError(ctx context.Context, wroteHeader bool, marshaler Marshaler, w http.ResponseWriter, req *http.Request, mux *ServeMux, err error) {
+ serr := streamError(ctx, mux.streamErrorHandler, err)
+ if !wroteHeader {
+ w.WriteHeader(int(serr.HttpCode))
+ }
+ buf, merr := marshaler.Marshal(errorChunk(serr))
+ if merr != nil {
+ grpclog.Infof("Failed to marshal an error: %v", merr)
+ return
+ }
+ if _, werr := w.Write(buf); werr != nil {
+ grpclog.Infof("Failed to notify error to client: %v", werr)
+ return
+ }
+}
+
+// streamChunk returns a chunk in a response stream for the given result. The
+// given errHandler is used to render an error chunk if result is nil.
+func streamChunk(ctx context.Context, result proto.Message, errHandler StreamErrorHandlerFunc) map[string]proto.Message {
+ if result == nil {
+ return errorChunk(streamError(ctx, errHandler, errEmptyResponse))
+ }
+ return map[string]proto.Message{"result": result}
+}
+
+// streamError returns the payload for the final message in a response stream
+// that represents the given err.
+func streamError(ctx context.Context, errHandler StreamErrorHandlerFunc, err error) *StreamError {
+ serr := errHandler(ctx, err)
+ if serr != nil {
+ return serr
+ }
+ // TODO: log about misbehaving stream error handler?
+ return DefaultHTTPStreamErrorHandler(ctx, err)
+}
+
+func errorChunk(err *StreamError) map[string]proto.Message {
+ return map[string]proto.Message{"error": (*internal.StreamError)(err)}
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go
new file mode 100644
index 000000000..f55285b5d
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_httpbodyproto.go
@@ -0,0 +1,43 @@
+package runtime
+
+import (
+ "google.golang.org/genproto/googleapis/api/httpbody"
+)
+
+// SetHTTPBodyMarshaler overwrite the default marshaler with the HTTPBodyMarshaler
+func SetHTTPBodyMarshaler(serveMux *ServeMux) {
+ serveMux.marshalers.mimeMap[MIMEWildcard] = &HTTPBodyMarshaler{
+ Marshaler: &JSONPb{OrigName: true},
+ }
+}
+
+// HTTPBodyMarshaler is a Marshaler which supports marshaling of a
+// google.api.HttpBody message as the full response body if it is
+// the actual message used as the response. If not, then this will
+// simply fallback to the Marshaler specified as its default Marshaler.
+type HTTPBodyMarshaler struct {
+ Marshaler
+}
+
+// ContentType implementation to keep backwards compatability with marshal interface
+func (h *HTTPBodyMarshaler) ContentType() string {
+ return h.ContentTypeFromMessage(nil)
+}
+
+// ContentTypeFromMessage in case v is a google.api.HttpBody message it returns
+// its specified content type otherwise fall back to the default Marshaler.
+func (h *HTTPBodyMarshaler) ContentTypeFromMessage(v interface{}) string {
+ if httpBody, ok := v.(*httpbody.HttpBody); ok {
+ return httpBody.GetContentType()
+ }
+ return h.Marshaler.ContentType()
+}
+
+// Marshal marshals "v" by returning the body bytes if v is a
+// google.api.HttpBody message, otherwise it falls back to the default Marshaler.
+func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error) {
+ if httpBody, ok := v.(*httpbody.HttpBody); ok {
+ return httpBody.Data, nil
+ }
+ return h.Marshaler.Marshal(v)
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go
new file mode 100644
index 000000000..f9d3a585a
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go
@@ -0,0 +1,45 @@
+package runtime
+
+import (
+ "encoding/json"
+ "io"
+)
+
+// JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON
+// with the standard "encoding/json" package of Golang.
+// Although it is generally faster for simple proto messages than JSONPb,
+// it does not support advanced features of protobuf, e.g. map, oneof, ....
+//
+// The NewEncoder and NewDecoder types return *json.Encoder and
+// *json.Decoder respectively.
+type JSONBuiltin struct{}
+
+// ContentType always Returns "application/json".
+func (*JSONBuiltin) ContentType() string {
+ return "application/json"
+}
+
+// Marshal marshals "v" into JSON
+func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) {
+ return json.Marshal(v)
+}
+
+// Unmarshal unmarshals JSON data into "v".
+func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error {
+ return json.Unmarshal(data, v)
+}
+
+// NewDecoder returns a Decoder which reads JSON stream from "r".
+func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder {
+ return json.NewDecoder(r)
+}
+
+// NewEncoder returns an Encoder which writes JSON stream into "w".
+func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder {
+ return json.NewEncoder(w)
+}
+
+// Delimiter for newline encoded JSON streams.
+func (j *JSONBuiltin) Delimiter() []byte {
+ return []byte("\n")
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go
new file mode 100644
index 000000000..f0de351b2
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_jsonpb.go
@@ -0,0 +1,262 @@
+package runtime
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "io"
+ "reflect"
+
+ "github.com/golang/protobuf/jsonpb"
+ "github.com/golang/protobuf/proto"
+)
+
+// JSONPb is a Marshaler which marshals/unmarshals into/from JSON
+// with the "github.com/golang/protobuf/jsonpb".
+// It supports fully functionality of protobuf unlike JSONBuiltin.
+//
+// The NewDecoder method returns a DecoderWrapper, so the underlying
+// *json.Decoder methods can be used.
+type JSONPb jsonpb.Marshaler
+
+// ContentType always returns "application/json".
+func (*JSONPb) ContentType() string {
+ return "application/json"
+}
+
+// Marshal marshals "v" into JSON.
+func (j *JSONPb) Marshal(v interface{}) ([]byte, error) {
+ if _, ok := v.(proto.Message); !ok {
+ return j.marshalNonProtoField(v)
+ }
+
+ var buf bytes.Buffer
+ if err := j.marshalTo(&buf, v); err != nil {
+ return nil, err
+ }
+ return buf.Bytes(), nil
+}
+
+func (j *JSONPb) marshalTo(w io.Writer, v interface{}) error {
+ p, ok := v.(proto.Message)
+ if !ok {
+ buf, err := j.marshalNonProtoField(v)
+ if err != nil {
+ return err
+ }
+ _, err = w.Write(buf)
+ return err
+ }
+ return (*jsonpb.Marshaler)(j).Marshal(w, p)
+}
+
+var (
+ // protoMessageType is stored to prevent constant lookup of the same type at runtime.
+ protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
+)
+
+// marshalNonProto marshals a non-message field of a protobuf message.
+// This function does not correctly marshals arbitrary data structure into JSON,
+// but it is only capable of marshaling non-message field values of protobuf,
+// i.e. primitive types, enums; pointers to primitives or enums; maps from
+// integer/string types to primitives/enums/pointers to messages.
+func (j *JSONPb) marshalNonProtoField(v interface{}) ([]byte, error) {
+ if v == nil {
+ return []byte("null"), nil
+ }
+ rv := reflect.ValueOf(v)
+ for rv.Kind() == reflect.Ptr {
+ if rv.IsNil() {
+ return []byte("null"), nil
+ }
+ rv = rv.Elem()
+ }
+
+ if rv.Kind() == reflect.Slice {
+ if rv.IsNil() {
+ if j.EmitDefaults {
+ return []byte("[]"), nil
+ }
+ return []byte("null"), nil
+ }
+
+ if rv.Type().Elem().Implements(protoMessageType) {
+ var buf bytes.Buffer
+ err := buf.WriteByte('[')
+ if err != nil {
+ return nil, err
+ }
+ for i := 0; i < rv.Len(); i++ {
+ if i != 0 {
+ err = buf.WriteByte(',')
+ if err != nil {
+ return nil, err
+ }
+ }
+ if err = (*jsonpb.Marshaler)(j).Marshal(&buf, rv.Index(i).Interface().(proto.Message)); err != nil {
+ return nil, err
+ }
+ }
+ err = buf.WriteByte(']')
+ if err != nil {
+ return nil, err
+ }
+
+ return buf.Bytes(), nil
+ }
+ }
+
+ if rv.Kind() == reflect.Map {
+ m := make(map[string]*json.RawMessage)
+ for _, k := range rv.MapKeys() {
+ buf, err := j.Marshal(rv.MapIndex(k).Interface())
+ if err != nil {
+ return nil, err
+ }
+ m[fmt.Sprintf("%v", k.Interface())] = (*json.RawMessage)(&buf)
+ }
+ if j.Indent != "" {
+ return json.MarshalIndent(m, "", j.Indent)
+ }
+ return json.Marshal(m)
+ }
+ if enum, ok := rv.Interface().(protoEnum); ok && !j.EnumsAsInts {
+ return json.Marshal(enum.String())
+ }
+ return json.Marshal(rv.Interface())
+}
+
+// Unmarshal unmarshals JSON "data" into "v"
+func (j *JSONPb) Unmarshal(data []byte, v interface{}) error {
+ return unmarshalJSONPb(data, v)
+}
+
+// NewDecoder returns a Decoder which reads JSON stream from "r".
+func (j *JSONPb) NewDecoder(r io.Reader) Decoder {
+ d := json.NewDecoder(r)
+ return DecoderWrapper{Decoder: d}
+}
+
+// DecoderWrapper is a wrapper around a *json.Decoder that adds
+// support for protos to the Decode method.
+type DecoderWrapper struct {
+ *json.Decoder
+}
+
+// Decode wraps the embedded decoder's Decode method to support
+// protos using a jsonpb.Unmarshaler.
+func (d DecoderWrapper) Decode(v interface{}) error {
+ return decodeJSONPb(d.Decoder, v)
+}
+
+// NewEncoder returns an Encoder which writes JSON stream into "w".
+func (j *JSONPb) NewEncoder(w io.Writer) Encoder {
+ return EncoderFunc(func(v interface{}) error {
+ if err := j.marshalTo(w, v); err != nil {
+ return err
+ }
+ // mimic json.Encoder by adding a newline (makes output
+ // easier to read when it contains multiple encoded items)
+ _, err := w.Write(j.Delimiter())
+ return err
+ })
+}
+
+func unmarshalJSONPb(data []byte, v interface{}) error {
+ d := json.NewDecoder(bytes.NewReader(data))
+ return decodeJSONPb(d, v)
+}
+
+func decodeJSONPb(d *json.Decoder, v interface{}) error {
+ p, ok := v.(proto.Message)
+ if !ok {
+ return decodeNonProtoField(d, v)
+ }
+ unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields}
+ return unmarshaler.UnmarshalNext(d, p)
+}
+
+func decodeNonProtoField(d *json.Decoder, v interface{}) error {
+ rv := reflect.ValueOf(v)
+ if rv.Kind() != reflect.Ptr {
+ return fmt.Errorf("%T is not a pointer", v)
+ }
+ for rv.Kind() == reflect.Ptr {
+ if rv.IsNil() {
+ rv.Set(reflect.New(rv.Type().Elem()))
+ }
+ if rv.Type().ConvertibleTo(typeProtoMessage) {
+ unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: allowUnknownFields}
+ return unmarshaler.UnmarshalNext(d, rv.Interface().(proto.Message))
+ }
+ rv = rv.Elem()
+ }
+ if rv.Kind() == reflect.Map {
+ if rv.IsNil() {
+ rv.Set(reflect.MakeMap(rv.Type()))
+ }
+ conv, ok := convFromType[rv.Type().Key().Kind()]
+ if !ok {
+ return fmt.Errorf("unsupported type of map field key: %v", rv.Type().Key())
+ }
+
+ m := make(map[string]*json.RawMessage)
+ if err := d.Decode(&m); err != nil {
+ return err
+ }
+ for k, v := range m {
+ result := conv.Call([]reflect.Value{reflect.ValueOf(k)})
+ if err := result[1].Interface(); err != nil {
+ return err.(error)
+ }
+ bk := result[0]
+ bv := reflect.New(rv.Type().Elem())
+ if err := unmarshalJSONPb([]byte(*v), bv.Interface()); err != nil {
+ return err
+ }
+ rv.SetMapIndex(bk, bv.Elem())
+ }
+ return nil
+ }
+ if _, ok := rv.Interface().(protoEnum); ok {
+ var repr interface{}
+ if err := d.Decode(&repr); err != nil {
+ return err
+ }
+ switch repr.(type) {
+ case string:
+ // TODO(yugui) Should use proto.StructProperties?
+ return fmt.Errorf("unmarshaling of symbolic enum %q not supported: %T", repr, rv.Interface())
+ case float64:
+ rv.Set(reflect.ValueOf(int32(repr.(float64))).Convert(rv.Type()))
+ return nil
+ default:
+ return fmt.Errorf("cannot assign %#v into Go type %T", repr, rv.Interface())
+ }
+ }
+ return d.Decode(v)
+}
+
+type protoEnum interface {
+ fmt.Stringer
+ EnumDescriptor() ([]byte, []int)
+}
+
+var typeProtoMessage = reflect.TypeOf((*proto.Message)(nil)).Elem()
+
+// Delimiter for newline encoded JSON streams.
+func (j *JSONPb) Delimiter() []byte {
+ return []byte("\n")
+}
+
+// allowUnknownFields helps not to return an error when the destination
+// is a struct and the input contains object keys which do not match any
+// non-ignored, exported fields in the destination.
+var allowUnknownFields = true
+
+// DisallowUnknownFields enables option in decoder (unmarshaller) to
+// return an error when it finds an unknown field. This function must be
+// called before using the JSON marshaller.
+func DisallowUnknownFields() {
+ allowUnknownFields = false
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go
new file mode 100644
index 000000000..f65d1a267
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go
@@ -0,0 +1,62 @@
+package runtime
+
+import (
+ "io"
+
+ "errors"
+ "github.com/golang/protobuf/proto"
+ "io/ioutil"
+)
+
+// ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes
+type ProtoMarshaller struct{}
+
+// ContentType always returns "application/octet-stream".
+func (*ProtoMarshaller) ContentType() string {
+ return "application/octet-stream"
+}
+
+// Marshal marshals "value" into Proto
+func (*ProtoMarshaller) Marshal(value interface{}) ([]byte, error) {
+ message, ok := value.(proto.Message)
+ if !ok {
+ return nil, errors.New("unable to marshal non proto field")
+ }
+ return proto.Marshal(message)
+}
+
+// Unmarshal unmarshals proto "data" into "value"
+func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error {
+ message, ok := value.(proto.Message)
+ if !ok {
+ return errors.New("unable to unmarshal non proto field")
+ }
+ return proto.Unmarshal(data, message)
+}
+
+// NewDecoder returns a Decoder which reads proto stream from "reader".
+func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder {
+ return DecoderFunc(func(value interface{}) error {
+ buffer, err := ioutil.ReadAll(reader)
+ if err != nil {
+ return err
+ }
+ return marshaller.Unmarshal(buffer, value)
+ })
+}
+
+// NewEncoder returns an Encoder which writes proto stream into "writer".
+func (marshaller *ProtoMarshaller) NewEncoder(writer io.Writer) Encoder {
+ return EncoderFunc(func(value interface{}) error {
+ buffer, err := marshaller.Marshal(value)
+ if err != nil {
+ return err
+ }
+ _, err = writer.Write(buffer)
+ if err != nil {
+ return err
+ }
+
+ return nil
+ })
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go
new file mode 100644
index 000000000..98fe6e88a
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler.go
@@ -0,0 +1,48 @@
+package runtime
+
+import (
+ "io"
+)
+
+// Marshaler defines a conversion between byte sequence and gRPC payloads / fields.
+type Marshaler interface {
+ // Marshal marshals "v" into byte sequence.
+ Marshal(v interface{}) ([]byte, error)
+ // Unmarshal unmarshals "data" into "v".
+ // "v" must be a pointer value.
+ Unmarshal(data []byte, v interface{}) error
+ // NewDecoder returns a Decoder which reads byte sequence from "r".
+ NewDecoder(r io.Reader) Decoder
+ // NewEncoder returns an Encoder which writes bytes sequence into "w".
+ NewEncoder(w io.Writer) Encoder
+ // ContentType returns the Content-Type which this marshaler is responsible for.
+ ContentType() string
+}
+
+// Decoder decodes a byte sequence
+type Decoder interface {
+ Decode(v interface{}) error
+}
+
+// Encoder encodes gRPC payloads / fields into byte sequence.
+type Encoder interface {
+ Encode(v interface{}) error
+}
+
+// DecoderFunc adapts an decoder function into Decoder.
+type DecoderFunc func(v interface{}) error
+
+// Decode delegates invocations to the underlying function itself.
+func (f DecoderFunc) Decode(v interface{}) error { return f(v) }
+
+// EncoderFunc adapts an encoder function into Encoder
+type EncoderFunc func(v interface{}) error
+
+// Encode delegates invocations to the underlying function itself.
+func (f EncoderFunc) Encode(v interface{}) error { return f(v) }
+
+// Delimited defines the streaming delimiter.
+type Delimited interface {
+ // Delimiter returns the record seperator for the stream.
+ Delimiter() []byte
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go
new file mode 100644
index 000000000..5cc53ae4f
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go
@@ -0,0 +1,91 @@
+package runtime
+
+import (
+ "errors"
+ "net/http"
+)
+
+// MIMEWildcard is the fallback MIME type used for requests which do not match
+// a registered MIME type.
+const MIMEWildcard = "*"
+
+var (
+ acceptHeader = http.CanonicalHeaderKey("Accept")
+ contentTypeHeader = http.CanonicalHeaderKey("Content-Type")
+
+ defaultMarshaler = &JSONPb{OrigName: true}
+)
+
+// MarshalerForRequest returns the inbound/outbound marshalers for this request.
+// It checks the registry on the ServeMux for the MIME type set by the Content-Type header.
+// If it isn't set (or the request Content-Type is empty), checks for "*".
+// If there are multiple Content-Type headers set, choose the first one that it can
+// exactly match in the registry.
+// Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler.
+func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) {
+ for _, acceptVal := range r.Header[acceptHeader] {
+ if m, ok := mux.marshalers.mimeMap[acceptVal]; ok {
+ outbound = m
+ break
+ }
+ }
+
+ for _, contentTypeVal := range r.Header[contentTypeHeader] {
+ if m, ok := mux.marshalers.mimeMap[contentTypeVal]; ok {
+ inbound = m
+ break
+ }
+ }
+
+ if inbound == nil {
+ inbound = mux.marshalers.mimeMap[MIMEWildcard]
+ }
+ if outbound == nil {
+ outbound = inbound
+ }
+
+ return inbound, outbound
+}
+
+// marshalerRegistry is a mapping from MIME types to Marshalers.
+type marshalerRegistry struct {
+ mimeMap map[string]Marshaler
+}
+
+// add adds a marshaler for a case-sensitive MIME type string ("*" to match any
+// MIME type).
+func (m marshalerRegistry) add(mime string, marshaler Marshaler) error {
+ if len(mime) == 0 {
+ return errors.New("empty MIME type")
+ }
+
+ m.mimeMap[mime] = marshaler
+
+ return nil
+}
+
+// makeMarshalerMIMERegistry returns a new registry of marshalers.
+// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces.
+//
+// For example, you could allow the client to specify the use of the runtime.JSONPb marshaler
+// with a "application/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler
+// with a "application/json" Content-Type.
+// "*" can be used to match any Content-Type.
+// This can be attached to a ServerMux with the marshaler option.
+func makeMarshalerMIMERegistry() marshalerRegistry {
+ return marshalerRegistry{
+ mimeMap: map[string]Marshaler{
+ MIMEWildcard: defaultMarshaler,
+ },
+ }
+}
+
+// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound
+// Marshalers to a MIME type in mux.
+func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption {
+ return func(mux *ServeMux) {
+ if err := mux.marshalers.add(mime, marshaler); err != nil {
+ panic(err)
+ }
+ }
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go
new file mode 100644
index 000000000..1da3a5885
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/mux.go
@@ -0,0 +1,303 @@
+package runtime
+
+import (
+ "context"
+ "fmt"
+ "net/http"
+ "net/textproto"
+ "strings"
+
+ "github.com/golang/protobuf/proto"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+)
+
+// A HandlerFunc handles a specific pair of path pattern and HTTP method.
+type HandlerFunc func(w http.ResponseWriter, r *http.Request, pathParams map[string]string)
+
+// ErrUnknownURI is the error supplied to a custom ProtoErrorHandlerFunc when
+// a request is received with a URI path that does not match any registered
+// service method.
+//
+// Since gRPC servers return an "Unimplemented" code for requests with an
+// unrecognized URI path, this error also has a gRPC "Unimplemented" code.
+var ErrUnknownURI = status.Error(codes.Unimplemented, http.StatusText(http.StatusNotImplemented))
+
+// ServeMux is a request multiplexer for grpc-gateway.
+// It matches http requests to patterns and invokes the corresponding handler.
+type ServeMux struct {
+ // handlers maps HTTP method to a list of handlers.
+ handlers map[string][]handler
+ forwardResponseOptions []func(context.Context, http.ResponseWriter, proto.Message) error
+ marshalers marshalerRegistry
+ incomingHeaderMatcher HeaderMatcherFunc
+ outgoingHeaderMatcher HeaderMatcherFunc
+ metadataAnnotators []func(context.Context, *http.Request) metadata.MD
+ streamErrorHandler StreamErrorHandlerFunc
+ protoErrorHandler ProtoErrorHandlerFunc
+ disablePathLengthFallback bool
+ lastMatchWins bool
+}
+
+// ServeMuxOption is an option that can be given to a ServeMux on construction.
+type ServeMuxOption func(*ServeMux)
+
+// WithForwardResponseOption returns a ServeMuxOption representing the forwardResponseOption.
+//
+// forwardResponseOption is an option that will be called on the relevant context.Context,
+// http.ResponseWriter, and proto.Message before every forwarded response.
+//
+// The message may be nil in the case where just a header is being sent.
+func WithForwardResponseOption(forwardResponseOption func(context.Context, http.ResponseWriter, proto.Message) error) ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.forwardResponseOptions = append(serveMux.forwardResponseOptions, forwardResponseOption)
+ }
+}
+
+// HeaderMatcherFunc checks whether a header key should be forwarded to/from gRPC context.
+type HeaderMatcherFunc func(string) (string, bool)
+
+// DefaultHeaderMatcher is used to pass http request headers to/from gRPC context. This adds permanent HTTP header
+// keys (as specified by the IANA) to gRPC context with grpcgateway- prefix. HTTP headers that start with
+// 'Grpc-Metadata-' are mapped to gRPC metadata after removing prefix 'Grpc-Metadata-'.
+func DefaultHeaderMatcher(key string) (string, bool) {
+ key = textproto.CanonicalMIMEHeaderKey(key)
+ if isPermanentHTTPHeader(key) {
+ return MetadataPrefix + key, true
+ } else if strings.HasPrefix(key, MetadataHeaderPrefix) {
+ return key[len(MetadataHeaderPrefix):], true
+ }
+ return "", false
+}
+
+// WithIncomingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for incoming request to gateway.
+//
+// This matcher will be called with each header in http.Request. If matcher returns true, that header will be
+// passed to gRPC context. To transform the header before passing to gRPC context, matcher should return modified header.
+func WithIncomingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption {
+ return func(mux *ServeMux) {
+ mux.incomingHeaderMatcher = fn
+ }
+}
+
+// WithOutgoingHeaderMatcher returns a ServeMuxOption representing a headerMatcher for outgoing response from gateway.
+//
+// This matcher will be called with each header in response header metadata. If matcher returns true, that header will be
+// passed to http response returned from gateway. To transform the header before passing to response,
+// matcher should return modified header.
+func WithOutgoingHeaderMatcher(fn HeaderMatcherFunc) ServeMuxOption {
+ return func(mux *ServeMux) {
+ mux.outgoingHeaderMatcher = fn
+ }
+}
+
+// WithMetadata returns a ServeMuxOption for passing metadata to a gRPC context.
+//
+// This can be used by services that need to read from http.Request and modify gRPC context. A common use case
+// is reading token from cookie and adding it in gRPC context.
+func WithMetadata(annotator func(context.Context, *http.Request) metadata.MD) ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.metadataAnnotators = append(serveMux.metadataAnnotators, annotator)
+ }
+}
+
+// WithProtoErrorHandler returns a ServeMuxOption for passing metadata to a gRPC context.
+//
+// This can be used to handle an error as general proto message defined by gRPC.
+// The response including body and status is not backward compatible with the default error handler.
+// When this option is used, HTTPError and OtherErrorHandler are overwritten on initialization.
+func WithProtoErrorHandler(fn ProtoErrorHandlerFunc) ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.protoErrorHandler = fn
+ }
+}
+
+// WithDisablePathLengthFallback returns a ServeMuxOption for disable path length fallback.
+func WithDisablePathLengthFallback() ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.disablePathLengthFallback = true
+ }
+}
+
+// WithStreamErrorHandler returns a ServeMuxOption that will use the given custom stream
+// error handler, which allows for customizing the error trailer for server-streaming
+// calls.
+//
+// For stream errors that occur before any response has been written, the mux's
+// ProtoErrorHandler will be invoked. However, once data has been written, the errors must
+// be handled differently: they must be included in the response body. The response body's
+// final message will include the error details returned by the stream error handler.
+func WithStreamErrorHandler(fn StreamErrorHandlerFunc) ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.streamErrorHandler = fn
+ }
+}
+
+// WithLastMatchWins returns a ServeMuxOption that will enable "last
+// match wins" behavior, where if multiple path patterns match a
+// request path, the last one defined in the .proto file will be used.
+func WithLastMatchWins() ServeMuxOption {
+ return func(serveMux *ServeMux) {
+ serveMux.lastMatchWins = true
+ }
+}
+
+// NewServeMux returns a new ServeMux whose internal mapping is empty.
+func NewServeMux(opts ...ServeMuxOption) *ServeMux {
+ serveMux := &ServeMux{
+ handlers: make(map[string][]handler),
+ forwardResponseOptions: make([]func(context.Context, http.ResponseWriter, proto.Message) error, 0),
+ marshalers: makeMarshalerMIMERegistry(),
+ streamErrorHandler: DefaultHTTPStreamErrorHandler,
+ }
+
+ for _, opt := range opts {
+ opt(serveMux)
+ }
+
+ if serveMux.protoErrorHandler != nil {
+ HTTPError = serveMux.protoErrorHandler
+ // OtherErrorHandler is no longer used when protoErrorHandler is set.
+ // Overwritten by a special error handler to return Unknown.
+ OtherErrorHandler = func(w http.ResponseWriter, r *http.Request, _ string, _ int) {
+ ctx := context.Background()
+ _, outboundMarshaler := MarshalerForRequest(serveMux, r)
+ sterr := status.Error(codes.Unknown, "unexpected use of OtherErrorHandler")
+ serveMux.protoErrorHandler(ctx, serveMux, outboundMarshaler, w, r, sterr)
+ }
+ }
+
+ if serveMux.incomingHeaderMatcher == nil {
+ serveMux.incomingHeaderMatcher = DefaultHeaderMatcher
+ }
+
+ if serveMux.outgoingHeaderMatcher == nil {
+ serveMux.outgoingHeaderMatcher = func(key string) (string, bool) {
+ return fmt.Sprintf("%s%s", MetadataHeaderPrefix, key), true
+ }
+ }
+
+ return serveMux
+}
+
+// Handle associates "h" to the pair of HTTP method and path pattern.
+func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) {
+ if s.lastMatchWins {
+ s.handlers[meth] = append([]handler{handler{pat: pat, h: h}}, s.handlers[meth]...)
+ } else {
+ s.handlers[meth] = append(s.handlers[meth], handler{pat: pat, h: h})
+ }
+}
+
+// ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path.
+func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ ctx := r.Context()
+
+ path := r.URL.Path
+ if !strings.HasPrefix(path, "/") {
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ sterr := status.Error(codes.InvalidArgument, http.StatusText(http.StatusBadRequest))
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr)
+ } else {
+ OtherErrorHandler(w, r, http.StatusText(http.StatusBadRequest), http.StatusBadRequest)
+ }
+ return
+ }
+
+ components := strings.Split(path[1:], "/")
+ l := len(components)
+ var verb string
+ if idx := strings.LastIndex(components[l-1], ":"); idx == 0 {
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI)
+ } else {
+ OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound)
+ }
+ return
+ } else if idx > 0 {
+ c := components[l-1]
+ components[l-1], verb = c[:idx], c[idx+1:]
+ }
+
+ if override := r.Header.Get("X-HTTP-Method-Override"); override != "" && s.isPathLengthFallback(r) {
+ r.Method = strings.ToUpper(override)
+ if err := r.ParseForm(); err != nil {
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ sterr := status.Error(codes.InvalidArgument, err.Error())
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr)
+ } else {
+ OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest)
+ }
+ return
+ }
+ }
+ for _, h := range s.handlers[r.Method] {
+ pathParams, err := h.pat.Match(components, verb)
+ if err != nil {
+ continue
+ }
+ h.h(w, r, pathParams)
+ return
+ }
+
+ // lookup other methods to handle fallback from GET to POST and
+ // to determine if it is MethodNotAllowed or NotFound.
+ for m, handlers := range s.handlers {
+ if m == r.Method {
+ continue
+ }
+ for _, h := range handlers {
+ pathParams, err := h.pat.Match(components, verb)
+ if err != nil {
+ continue
+ }
+ // X-HTTP-Method-Override is optional. Always allow fallback to POST.
+ if s.isPathLengthFallback(r) {
+ if err := r.ParseForm(); err != nil {
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ sterr := status.Error(codes.InvalidArgument, err.Error())
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, sterr)
+ } else {
+ OtherErrorHandler(w, r, err.Error(), http.StatusBadRequest)
+ }
+ return
+ }
+ h.h(w, r, pathParams)
+ return
+ }
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI)
+ } else {
+ OtherErrorHandler(w, r, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
+ }
+ return
+ }
+ }
+
+ if s.protoErrorHandler != nil {
+ _, outboundMarshaler := MarshalerForRequest(s, r)
+ s.protoErrorHandler(ctx, s, outboundMarshaler, w, r, ErrUnknownURI)
+ } else {
+ OtherErrorHandler(w, r, http.StatusText(http.StatusNotFound), http.StatusNotFound)
+ }
+}
+
+// GetForwardResponseOptions returns the ForwardResponseOptions associated with this ServeMux.
+func (s *ServeMux) GetForwardResponseOptions() []func(context.Context, http.ResponseWriter, proto.Message) error {
+ return s.forwardResponseOptions
+}
+
+func (s *ServeMux) isPathLengthFallback(r *http.Request) bool {
+ return !s.disablePathLengthFallback && r.Method == "POST" && r.Header.Get("Content-Type") == "application/x-www-form-urlencoded"
+}
+
+type handler struct {
+ pat Pattern
+ h HandlerFunc
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go
new file mode 100644
index 000000000..09053695d
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/pattern.go
@@ -0,0 +1,262 @@
+package runtime
+
+import (
+ "errors"
+ "fmt"
+ "strings"
+
+ "github.com/grpc-ecosystem/grpc-gateway/utilities"
+ "google.golang.org/grpc/grpclog"
+)
+
+var (
+ // ErrNotMatch indicates that the given HTTP request path does not match to the pattern.
+ ErrNotMatch = errors.New("not match to the path pattern")
+ // ErrInvalidPattern indicates that the given definition of Pattern is not valid.
+ ErrInvalidPattern = errors.New("invalid pattern")
+)
+
+type op struct {
+ code utilities.OpCode
+ operand int
+}
+
+// Pattern is a template pattern of http request paths defined in github.com/googleapis/googleapis/google/api/http.proto.
+type Pattern struct {
+ // ops is a list of operations
+ ops []op
+ // pool is a constant pool indexed by the operands or vars.
+ pool []string
+ // vars is a list of variables names to be bound by this pattern
+ vars []string
+ // stacksize is the max depth of the stack
+ stacksize int
+ // tailLen is the length of the fixed-size segments after a deep wildcard
+ tailLen int
+ // verb is the VERB part of the path pattern. It is empty if the pattern does not have VERB part.
+ verb string
+ // assumeColonVerb indicates whether a path suffix after a final
+ // colon may only be interpreted as a verb.
+ assumeColonVerb bool
+}
+
+type patternOptions struct {
+ assumeColonVerb bool
+}
+
+// PatternOpt is an option for creating Patterns.
+type PatternOpt func(*patternOptions)
+
+// NewPattern returns a new Pattern from the given definition values.
+// "ops" is a sequence of op codes. "pool" is a constant pool.
+// "verb" is the verb part of the pattern. It is empty if the pattern does not have the part.
+// "version" must be 1 for now.
+// It returns an error if the given definition is invalid.
+func NewPattern(version int, ops []int, pool []string, verb string, opts ...PatternOpt) (Pattern, error) {
+ options := patternOptions{
+ assumeColonVerb: true,
+ }
+ for _, o := range opts {
+ o(&options)
+ }
+
+ if version != 1 {
+ grpclog.Infof("unsupported version: %d", version)
+ return Pattern{}, ErrInvalidPattern
+ }
+
+ l := len(ops)
+ if l%2 != 0 {
+ grpclog.Infof("odd number of ops codes: %d", l)
+ return Pattern{}, ErrInvalidPattern
+ }
+
+ var (
+ typedOps []op
+ stack, maxstack int
+ tailLen int
+ pushMSeen bool
+ vars []string
+ )
+ for i := 0; i < l; i += 2 {
+ op := op{code: utilities.OpCode(ops[i]), operand: ops[i+1]}
+ switch op.code {
+ case utilities.OpNop:
+ continue
+ case utilities.OpPush:
+ if pushMSeen {
+ tailLen++
+ }
+ stack++
+ case utilities.OpPushM:
+ if pushMSeen {
+ grpclog.Infof("pushM appears twice")
+ return Pattern{}, ErrInvalidPattern
+ }
+ pushMSeen = true
+ stack++
+ case utilities.OpLitPush:
+ if op.operand < 0 || len(pool) <= op.operand {
+ grpclog.Infof("negative literal index: %d", op.operand)
+ return Pattern{}, ErrInvalidPattern
+ }
+ if pushMSeen {
+ tailLen++
+ }
+ stack++
+ case utilities.OpConcatN:
+ if op.operand <= 0 {
+ grpclog.Infof("negative concat size: %d", op.operand)
+ return Pattern{}, ErrInvalidPattern
+ }
+ stack -= op.operand
+ if stack < 0 {
+ grpclog.Print("stack underflow")
+ return Pattern{}, ErrInvalidPattern
+ }
+ stack++
+ case utilities.OpCapture:
+ if op.operand < 0 || len(pool) <= op.operand {
+ grpclog.Infof("variable name index out of bound: %d", op.operand)
+ return Pattern{}, ErrInvalidPattern
+ }
+ v := pool[op.operand]
+ op.operand = len(vars)
+ vars = append(vars, v)
+ stack--
+ if stack < 0 {
+ grpclog.Infof("stack underflow")
+ return Pattern{}, ErrInvalidPattern
+ }
+ default:
+ grpclog.Infof("invalid opcode: %d", op.code)
+ return Pattern{}, ErrInvalidPattern
+ }
+
+ if maxstack < stack {
+ maxstack = stack
+ }
+ typedOps = append(typedOps, op)
+ }
+ return Pattern{
+ ops: typedOps,
+ pool: pool,
+ vars: vars,
+ stacksize: maxstack,
+ tailLen: tailLen,
+ verb: verb,
+ assumeColonVerb: options.assumeColonVerb,
+ }, nil
+}
+
+// MustPattern is a helper function which makes it easier to call NewPattern in variable initialization.
+func MustPattern(p Pattern, err error) Pattern {
+ if err != nil {
+ grpclog.Fatalf("Pattern initialization failed: %v", err)
+ }
+ return p
+}
+
+// Match examines components if it matches to the Pattern.
+// If it matches, the function returns a mapping from field paths to their captured values.
+// If otherwise, the function returns an error.
+func (p Pattern) Match(components []string, verb string) (map[string]string, error) {
+ if p.verb != verb {
+ if p.assumeColonVerb || p.verb != "" {
+ return nil, ErrNotMatch
+ }
+ if len(components) == 0 {
+ components = []string{":" + verb}
+ } else {
+ components = append([]string{}, components...)
+ components[len(components)-1] += ":" + verb
+ }
+ verb = ""
+ }
+
+ var pos int
+ stack := make([]string, 0, p.stacksize)
+ captured := make([]string, len(p.vars))
+ l := len(components)
+ for _, op := range p.ops {
+ switch op.code {
+ case utilities.OpNop:
+ continue
+ case utilities.OpPush, utilities.OpLitPush:
+ if pos >= l {
+ return nil, ErrNotMatch
+ }
+ c := components[pos]
+ if op.code == utilities.OpLitPush {
+ if lit := p.pool[op.operand]; c != lit {
+ return nil, ErrNotMatch
+ }
+ }
+ stack = append(stack, c)
+ pos++
+ case utilities.OpPushM:
+ end := len(components)
+ if end < pos+p.tailLen {
+ return nil, ErrNotMatch
+ }
+ end -= p.tailLen
+ stack = append(stack, strings.Join(components[pos:end], "/"))
+ pos = end
+ case utilities.OpConcatN:
+ n := op.operand
+ l := len(stack) - n
+ stack = append(stack[:l], strings.Join(stack[l:], "/"))
+ case utilities.OpCapture:
+ n := len(stack) - 1
+ captured[op.operand] = stack[n]
+ stack = stack[:n]
+ }
+ }
+ if pos < l {
+ return nil, ErrNotMatch
+ }
+ bindings := make(map[string]string)
+ for i, val := range captured {
+ bindings[p.vars[i]] = val
+ }
+ return bindings, nil
+}
+
+// Verb returns the verb part of the Pattern.
+func (p Pattern) Verb() string { return p.verb }
+
+func (p Pattern) String() string {
+ var stack []string
+ for _, op := range p.ops {
+ switch op.code {
+ case utilities.OpNop:
+ continue
+ case utilities.OpPush:
+ stack = append(stack, "*")
+ case utilities.OpLitPush:
+ stack = append(stack, p.pool[op.operand])
+ case utilities.OpPushM:
+ stack = append(stack, "**")
+ case utilities.OpConcatN:
+ n := op.operand
+ l := len(stack) - n
+ stack = append(stack[:l], strings.Join(stack[l:], "/"))
+ case utilities.OpCapture:
+ n := len(stack) - 1
+ stack[n] = fmt.Sprintf("{%s=%s}", p.vars[op.operand], stack[n])
+ }
+ }
+ segs := strings.Join(stack, "/")
+ if p.verb != "" {
+ return fmt.Sprintf("/%s:%s", segs, p.verb)
+ }
+ return "/" + segs
+}
+
+// AssumeColonVerbOpt indicates whether a path suffix after a final
+// colon may only be interpreted as a verb.
+func AssumeColonVerbOpt(val bool) PatternOpt {
+ return PatternOpt(func(o *patternOptions) {
+ o.assumeColonVerb = val
+ })
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go
new file mode 100644
index 000000000..a3151e2a5
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto2_convert.go
@@ -0,0 +1,80 @@
+package runtime
+
+import (
+ "github.com/golang/protobuf/proto"
+)
+
+// StringP returns a pointer to a string whose pointee is same as the given string value.
+func StringP(val string) (*string, error) {
+ return proto.String(val), nil
+}
+
+// BoolP parses the given string representation of a boolean value,
+// and returns a pointer to a bool whose value is same as the parsed value.
+func BoolP(val string) (*bool, error) {
+ b, err := Bool(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Bool(b), nil
+}
+
+// Float64P parses the given string representation of a floating point number,
+// and returns a pointer to a float64 whose value is same as the parsed number.
+func Float64P(val string) (*float64, error) {
+ f, err := Float64(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Float64(f), nil
+}
+
+// Float32P parses the given string representation of a floating point number,
+// and returns a pointer to a float32 whose value is same as the parsed number.
+func Float32P(val string) (*float32, error) {
+ f, err := Float32(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Float32(f), nil
+}
+
+// Int64P parses the given string representation of an integer
+// and returns a pointer to a int64 whose value is same as the parsed integer.
+func Int64P(val string) (*int64, error) {
+ i, err := Int64(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Int64(i), nil
+}
+
+// Int32P parses the given string representation of an integer
+// and returns a pointer to a int32 whose value is same as the parsed integer.
+func Int32P(val string) (*int32, error) {
+ i, err := Int32(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Int32(i), err
+}
+
+// Uint64P parses the given string representation of an integer
+// and returns a pointer to a uint64 whose value is same as the parsed integer.
+func Uint64P(val string) (*uint64, error) {
+ i, err := Uint64(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Uint64(i), err
+}
+
+// Uint32P parses the given string representation of an integer
+// and returns a pointer to a uint32 whose value is same as the parsed integer.
+func Uint32P(val string) (*uint32, error) {
+ i, err := Uint32(val)
+ if err != nil {
+ return nil, err
+ }
+ return proto.Uint32(i), err
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go
new file mode 100644
index 000000000..ca76324ef
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go
@@ -0,0 +1,106 @@
+package runtime
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/golang/protobuf/ptypes/any"
+ "github.com/grpc-ecosystem/grpc-gateway/internal"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/status"
+)
+
+// StreamErrorHandlerFunc accepts an error as a gRPC error generated via status package and translates it into a
+// a proto struct used to represent error at the end of a stream.
+type StreamErrorHandlerFunc func(context.Context, error) *StreamError
+
+// StreamError is the payload for the final message in a server stream in the event that the server returns an
+// error after a response message has already been sent.
+type StreamError internal.StreamError
+
+// ProtoErrorHandlerFunc handles the error as a gRPC error generated via status package and replies to the request.
+type ProtoErrorHandlerFunc func(context.Context, *ServeMux, Marshaler, http.ResponseWriter, *http.Request, error)
+
+var _ ProtoErrorHandlerFunc = DefaultHTTPProtoErrorHandler
+
+// DefaultHTTPProtoErrorHandler is an implementation of HTTPError.
+// If "err" is an error from gRPC system, the function replies with the status code mapped by HTTPStatusFromCode.
+// If otherwise, it replies with http.StatusInternalServerError.
+//
+// The response body returned by this function is a Status message marshaled by a Marshaler.
+//
+// Do not set this function to HTTPError variable directly, use WithProtoErrorHandler option instead.
+func DefaultHTTPProtoErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, _ *http.Request, err error) {
+ // return Internal when Marshal failed
+ const fallback = `{"code": 13, "message": "failed to marshal error message"}`
+
+ s, ok := status.FromError(err)
+ if !ok {
+ s = status.New(codes.Unknown, err.Error())
+ }
+
+ w.Header().Del("Trailer")
+
+ contentType := marshaler.ContentType()
+ // Check marshaler on run time in order to keep backwards compatability
+ // An interface param needs to be added to the ContentType() function on
+ // the Marshal interface to be able to remove this check
+ if httpBodyMarshaler, ok := marshaler.(*HTTPBodyMarshaler); ok {
+ pb := s.Proto()
+ contentType = httpBodyMarshaler.ContentTypeFromMessage(pb)
+ }
+ w.Header().Set("Content-Type", contentType)
+
+ buf, merr := marshaler.Marshal(s.Proto())
+ if merr != nil {
+ grpclog.Infof("Failed to marshal error message %q: %v", s.Proto(), merr)
+ w.WriteHeader(http.StatusInternalServerError)
+ if _, err := io.WriteString(w, fallback); err != nil {
+ grpclog.Infof("Failed to write response: %v", err)
+ }
+ return
+ }
+
+ md, ok := ServerMetadataFromContext(ctx)
+ if !ok {
+ grpclog.Infof("Failed to extract ServerMetadata from context")
+ }
+
+ handleForwardResponseServerMetadata(w, mux, md)
+ handleForwardResponseTrailerHeader(w, md)
+ st := HTTPStatusFromCode(s.Code())
+ w.WriteHeader(st)
+ if _, err := w.Write(buf); err != nil {
+ grpclog.Infof("Failed to write response: %v", err)
+ }
+
+ handleForwardResponseTrailer(w, md)
+}
+
+// DefaultHTTPStreamErrorHandler converts the given err into a *StreamError via
+// default logic.
+//
+// It extracts the gRPC status from err if possible. The fields of the status are
+// used to populate the returned StreamError, and the HTTP status code is derived
+// from the gRPC code via HTTPStatusFromCode. If the given err does not contain a
+// gRPC status, an "Unknown" gRPC code is used and "Internal Server Error" HTTP code.
+func DefaultHTTPStreamErrorHandler(_ context.Context, err error) *StreamError {
+ grpcCode := codes.Unknown
+ grpcMessage := err.Error()
+ var grpcDetails []*any.Any
+ if s, ok := status.FromError(err); ok {
+ grpcCode = s.Code()
+ grpcMessage = s.Message()
+ grpcDetails = s.Proto().GetDetails()
+ }
+ httpCode := HTTPStatusFromCode(grpcCode)
+ return &StreamError{
+ GrpcCode: int32(grpcCode),
+ HttpCode: int32(httpCode),
+ Message: grpcMessage,
+ HttpStatus: http.StatusText(httpCode),
+ Details: grpcDetails,
+ }
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go
new file mode 100644
index 000000000..5fbba5e8e
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go
@@ -0,0 +1,391 @@
+package runtime
+
+import (
+ "encoding/base64"
+ "fmt"
+ "net/url"
+ "reflect"
+ "regexp"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/golang/protobuf/proto"
+ "github.com/grpc-ecosystem/grpc-gateway/utilities"
+ "google.golang.org/grpc/grpclog"
+)
+
+// PopulateQueryParameters populates "values" into "msg".
+// A value is ignored if its key starts with one of the elements in "filter".
+func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error {
+ for key, values := range values {
+ re, err := regexp.Compile("^(.*)\\[(.*)\\]$")
+ if err != nil {
+ return err
+ }
+ match := re.FindStringSubmatch(key)
+ if len(match) == 3 {
+ key = match[1]
+ values = append([]string{match[2]}, values...)
+ }
+ fieldPath := strings.Split(key, ".")
+ if filter.HasCommonPrefix(fieldPath) {
+ continue
+ }
+ if err := populateFieldValueFromPath(msg, fieldPath, values); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// PopulateFieldFromPath sets a value in a nested Protobuf structure.
+// It instantiates missing protobuf fields as it goes.
+func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error {
+ fieldPath := strings.Split(fieldPathString, ".")
+ return populateFieldValueFromPath(msg, fieldPath, []string{value})
+}
+
+func populateFieldValueFromPath(msg proto.Message, fieldPath []string, values []string) error {
+ m := reflect.ValueOf(msg)
+ if m.Kind() != reflect.Ptr {
+ return fmt.Errorf("unexpected type %T: %v", msg, msg)
+ }
+ var props *proto.Properties
+ m = m.Elem()
+ for i, fieldName := range fieldPath {
+ isLast := i == len(fieldPath)-1
+ if !isLast && m.Kind() != reflect.Struct {
+ return fmt.Errorf("non-aggregate type in the mid of path: %s", strings.Join(fieldPath, "."))
+ }
+ var f reflect.Value
+ var err error
+ f, props, err = fieldByProtoName(m, fieldName)
+ if err != nil {
+ return err
+ } else if !f.IsValid() {
+ grpclog.Infof("field not found in %T: %s", msg, strings.Join(fieldPath, "."))
+ return nil
+ }
+
+ switch f.Kind() {
+ case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64:
+ if !isLast {
+ return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], "."))
+ }
+ m = f
+ case reflect.Slice:
+ if !isLast {
+ return fmt.Errorf("unexpected repeated field in %s", strings.Join(fieldPath, "."))
+ }
+ // Handle []byte
+ if f.Type().Elem().Kind() == reflect.Uint8 {
+ m = f
+ break
+ }
+ return populateRepeatedField(f, values, props)
+ case reflect.Ptr:
+ if f.IsNil() {
+ m = reflect.New(f.Type().Elem())
+ f.Set(m.Convert(f.Type()))
+ }
+ m = f.Elem()
+ continue
+ case reflect.Struct:
+ m = f
+ continue
+ case reflect.Map:
+ if !isLast {
+ return fmt.Errorf("unexpected nested field %s in %s", fieldPath[i+1], strings.Join(fieldPath[:i+1], "."))
+ }
+ return populateMapField(f, values, props)
+ default:
+ return fmt.Errorf("unexpected type %s in %T", f.Type(), msg)
+ }
+ }
+ switch len(values) {
+ case 0:
+ return fmt.Errorf("no value of field: %s", strings.Join(fieldPath, "."))
+ case 1:
+ default:
+ grpclog.Infof("too many field values: %s", strings.Join(fieldPath, "."))
+ }
+ return populateField(m, values[0], props)
+}
+
+// fieldByProtoName looks up a field whose corresponding protobuf field name is "name".
+// "m" must be a struct value. It returns zero reflect.Value if no such field found.
+func fieldByProtoName(m reflect.Value, name string) (reflect.Value, *proto.Properties, error) {
+ props := proto.GetProperties(m.Type())
+
+ // look up field name in oneof map
+ if op, ok := props.OneofTypes[name]; ok {
+ v := reflect.New(op.Type.Elem())
+ field := m.Field(op.Field)
+ if !field.IsNil() {
+ return reflect.Value{}, nil, fmt.Errorf("field already set for %s oneof", props.Prop[op.Field].OrigName)
+ }
+ field.Set(v)
+ return v.Elem().Field(0), op.Prop, nil
+ }
+
+ for _, p := range props.Prop {
+ if p.OrigName == name {
+ return m.FieldByName(p.Name), p, nil
+ }
+ if p.JSONName == name {
+ return m.FieldByName(p.Name), p, nil
+ }
+ }
+ return reflect.Value{}, nil, nil
+}
+
+func populateMapField(f reflect.Value, values []string, props *proto.Properties) error {
+ if len(values) != 2 {
+ return fmt.Errorf("more than one value provided for key %s in map %s", values[0], props.Name)
+ }
+
+ key, value := values[0], values[1]
+ keyType := f.Type().Key()
+ valueType := f.Type().Elem()
+ if f.IsNil() {
+ f.Set(reflect.MakeMap(f.Type()))
+ }
+
+ keyConv, ok := convFromType[keyType.Kind()]
+ if !ok {
+ return fmt.Errorf("unsupported key type %s in map %s", keyType, props.Name)
+ }
+ valueConv, ok := convFromType[valueType.Kind()]
+ if !ok {
+ return fmt.Errorf("unsupported value type %s in map %s", valueType, props.Name)
+ }
+
+ keyV := keyConv.Call([]reflect.Value{reflect.ValueOf(key)})
+ if err := keyV[1].Interface(); err != nil {
+ return err.(error)
+ }
+ valueV := valueConv.Call([]reflect.Value{reflect.ValueOf(value)})
+ if err := valueV[1].Interface(); err != nil {
+ return err.(error)
+ }
+
+ f.SetMapIndex(keyV[0].Convert(keyType), valueV[0].Convert(valueType))
+
+ return nil
+}
+
+func populateRepeatedField(f reflect.Value, values []string, props *proto.Properties) error {
+ elemType := f.Type().Elem()
+
+ // is the destination field a slice of an enumeration type?
+ if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil {
+ return populateFieldEnumRepeated(f, values, enumValMap)
+ }
+
+ conv, ok := convFromType[elemType.Kind()]
+ if !ok {
+ return fmt.Errorf("unsupported field type %s", elemType)
+ }
+ f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type()))
+ for i, v := range values {
+ result := conv.Call([]reflect.Value{reflect.ValueOf(v)})
+ if err := result[1].Interface(); err != nil {
+ return err.(error)
+ }
+ f.Index(i).Set(result[0].Convert(f.Index(i).Type()))
+ }
+ return nil
+}
+
+func populateField(f reflect.Value, value string, props *proto.Properties) error {
+ i := f.Addr().Interface()
+
+ // Handle protobuf well known types
+ var name string
+ switch m := i.(type) {
+ case interface{ XXX_WellKnownType() string }:
+ name = m.XXX_WellKnownType()
+ case proto.Message:
+ const wktPrefix = "google.protobuf."
+ if fullName := proto.MessageName(m); strings.HasPrefix(fullName, wktPrefix) {
+ name = fullName[len(wktPrefix):]
+ }
+ }
+ switch name {
+ case "Timestamp":
+ if value == "null" {
+ f.FieldByName("Seconds").SetInt(0)
+ f.FieldByName("Nanos").SetInt(0)
+ return nil
+ }
+
+ t, err := time.Parse(time.RFC3339Nano, value)
+ if err != nil {
+ return fmt.Errorf("bad Timestamp: %v", err)
+ }
+ f.FieldByName("Seconds").SetInt(int64(t.Unix()))
+ f.FieldByName("Nanos").SetInt(int64(t.Nanosecond()))
+ return nil
+ case "Duration":
+ if value == "null" {
+ f.FieldByName("Seconds").SetInt(0)
+ f.FieldByName("Nanos").SetInt(0)
+ return nil
+ }
+ d, err := time.ParseDuration(value)
+ if err != nil {
+ return fmt.Errorf("bad Duration: %v", err)
+ }
+
+ ns := d.Nanoseconds()
+ s := ns / 1e9
+ ns %= 1e9
+ f.FieldByName("Seconds").SetInt(s)
+ f.FieldByName("Nanos").SetInt(ns)
+ return nil
+ case "DoubleValue":
+ fallthrough
+ case "FloatValue":
+ float64Val, err := strconv.ParseFloat(value, 64)
+ if err != nil {
+ return fmt.Errorf("bad DoubleValue: %s", value)
+ }
+ f.FieldByName("Value").SetFloat(float64Val)
+ return nil
+ case "Int64Value":
+ fallthrough
+ case "Int32Value":
+ int64Val, err := strconv.ParseInt(value, 10, 64)
+ if err != nil {
+ return fmt.Errorf("bad DoubleValue: %s", value)
+ }
+ f.FieldByName("Value").SetInt(int64Val)
+ return nil
+ case "UInt64Value":
+ fallthrough
+ case "UInt32Value":
+ uint64Val, err := strconv.ParseUint(value, 10, 64)
+ if err != nil {
+ return fmt.Errorf("bad DoubleValue: %s", value)
+ }
+ f.FieldByName("Value").SetUint(uint64Val)
+ return nil
+ case "BoolValue":
+ if value == "true" {
+ f.FieldByName("Value").SetBool(true)
+ } else if value == "false" {
+ f.FieldByName("Value").SetBool(false)
+ } else {
+ return fmt.Errorf("bad BoolValue: %s", value)
+ }
+ return nil
+ case "StringValue":
+ f.FieldByName("Value").SetString(value)
+ return nil
+ case "BytesValue":
+ bytesVal, err := base64.StdEncoding.DecodeString(value)
+ if err != nil {
+ return fmt.Errorf("bad BytesValue: %s", value)
+ }
+ f.FieldByName("Value").SetBytes(bytesVal)
+ return nil
+ case "FieldMask":
+ p := f.FieldByName("Paths")
+ for _, v := range strings.Split(value, ",") {
+ if v != "" {
+ p.Set(reflect.Append(p, reflect.ValueOf(v)))
+ }
+ }
+ return nil
+ }
+
+ // Handle Time and Duration stdlib types
+ switch t := i.(type) {
+ case *time.Time:
+ pt, err := time.Parse(time.RFC3339Nano, value)
+ if err != nil {
+ return fmt.Errorf("bad Timestamp: %v", err)
+ }
+ *t = pt
+ return nil
+ case *time.Duration:
+ d, err := time.ParseDuration(value)
+ if err != nil {
+ return fmt.Errorf("bad Duration: %v", err)
+ }
+ *t = d
+ return nil
+ }
+
+ // is the destination field an enumeration type?
+ if enumValMap := proto.EnumValueMap(props.Enum); enumValMap != nil {
+ return populateFieldEnum(f, value, enumValMap)
+ }
+
+ conv, ok := convFromType[f.Kind()]
+ if !ok {
+ return fmt.Errorf("field type %T is not supported in query parameters", i)
+ }
+ result := conv.Call([]reflect.Value{reflect.ValueOf(value)})
+ if err := result[1].Interface(); err != nil {
+ return err.(error)
+ }
+ f.Set(result[0].Convert(f.Type()))
+ return nil
+}
+
+func convertEnum(value string, t reflect.Type, enumValMap map[string]int32) (reflect.Value, error) {
+ // see if it's an enumeration string
+ if enumVal, ok := enumValMap[value]; ok {
+ return reflect.ValueOf(enumVal).Convert(t), nil
+ }
+
+ // check for an integer that matches an enumeration value
+ eVal, err := strconv.Atoi(value)
+ if err != nil {
+ return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t)
+ }
+ for _, v := range enumValMap {
+ if v == int32(eVal) {
+ return reflect.ValueOf(eVal).Convert(t), nil
+ }
+ }
+ return reflect.Value{}, fmt.Errorf("%s is not a valid %s", value, t)
+}
+
+func populateFieldEnum(f reflect.Value, value string, enumValMap map[string]int32) error {
+ cval, err := convertEnum(value, f.Type(), enumValMap)
+ if err != nil {
+ return err
+ }
+ f.Set(cval)
+ return nil
+}
+
+func populateFieldEnumRepeated(f reflect.Value, values []string, enumValMap map[string]int32) error {
+ elemType := f.Type().Elem()
+ f.Set(reflect.MakeSlice(f.Type(), len(values), len(values)).Convert(f.Type()))
+ for i, v := range values {
+ result, err := convertEnum(v, elemType, enumValMap)
+ if err != nil {
+ return err
+ }
+ f.Index(i).Set(result)
+ }
+ return nil
+}
+
+var (
+ convFromType = map[reflect.Kind]reflect.Value{
+ reflect.String: reflect.ValueOf(String),
+ reflect.Bool: reflect.ValueOf(Bool),
+ reflect.Float64: reflect.ValueOf(Float64),
+ reflect.Float32: reflect.ValueOf(Float32),
+ reflect.Int64: reflect.ValueOf(Int64),
+ reflect.Int32: reflect.ValueOf(Int32),
+ reflect.Uint64: reflect.ValueOf(Uint64),
+ reflect.Uint32: reflect.ValueOf(Uint32),
+ reflect.Slice: reflect.ValueOf(Bytes),
+ }
+)
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/LICENSE b/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/LICENSE
new file mode 100644
index 000000000..261eeb9e9
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/LICENSE
@@ -0,0 +1,201 @@
+ 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/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go
new file mode 100644
index 000000000..cf79a4d58
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go
@@ -0,0 +1,2 @@
+// Package utilities provides members for internal use in grpc-gateway.
+package utilities
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go
new file mode 100644
index 000000000..dfe7de486
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go
@@ -0,0 +1,22 @@
+package utilities
+
+// An OpCode is a opcode of compiled path patterns.
+type OpCode int
+
+// These constants are the valid values of OpCode.
+const (
+ // OpNop does nothing
+ OpNop = OpCode(iota)
+ // OpPush pushes a component to stack
+ OpPush
+ // OpLitPush pushes a component to stack if it matches to the literal
+ OpLitPush
+ // OpPushM concatenates the remaining components and pushes it to stack
+ OpPushM
+ // OpConcatN pops N items from stack, concatenates them and pushes it back to stack
+ OpConcatN
+ // OpCapture pops an item and binds it to the variable
+ OpCapture
+ // OpEnd is the least positive invalid opcode.
+ OpEnd
+)
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go
new file mode 100644
index 000000000..6dd385466
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go
@@ -0,0 +1,20 @@
+package utilities
+
+import (
+ "bytes"
+ "io"
+ "io/ioutil"
+)
+
+// IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins
+// at the start of the stream
+func IOReaderFactory(r io.Reader) (func() io.Reader, error) {
+ b, err := ioutil.ReadAll(r)
+ if err != nil {
+ return nil, err
+ }
+
+ return func() io.Reader {
+ return bytes.NewReader(b)
+ }, nil
+}
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go
new file mode 100644
index 000000000..c2b7b30dd
--- /dev/null
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/trie.go
@@ -0,0 +1,177 @@
+package utilities
+
+import (
+ "sort"
+)
+
+// DoubleArray is a Double Array implementation of trie on sequences of strings.
+type DoubleArray struct {
+ // Encoding keeps an encoding from string to int
+ Encoding map[string]int
+ // Base is the base array of Double Array
+ Base []int
+ // Check is the check array of Double Array
+ Check []int
+}
+
+// NewDoubleArray builds a DoubleArray from a set of sequences of strings.
+func NewDoubleArray(seqs [][]string) *DoubleArray {
+ da := &DoubleArray{Encoding: make(map[string]int)}
+ if len(seqs) == 0 {
+ return da
+ }
+
+ encoded := registerTokens(da, seqs)
+ sort.Sort(byLex(encoded))
+
+ root := node{row: -1, col: -1, left: 0, right: len(encoded)}
+ addSeqs(da, encoded, 0, root)
+
+ for i := len(da.Base); i > 0; i-- {
+ if da.Check[i-1] != 0 {
+ da.Base = da.Base[:i]
+ da.Check = da.Check[:i]
+ break
+ }
+ }
+ return da
+}
+
+func registerTokens(da *DoubleArray, seqs [][]string) [][]int {
+ var result [][]int
+ for _, seq := range seqs {
+ var encoded []int
+ for _, token := range seq {
+ if _, ok := da.Encoding[token]; !ok {
+ da.Encoding[token] = len(da.Encoding)
+ }
+ encoded = append(encoded, da.Encoding[token])
+ }
+ result = append(result, encoded)
+ }
+ for i := range result {
+ result[i] = append(result[i], len(da.Encoding))
+ }
+ return result
+}
+
+type node struct {
+ row, col int
+ left, right int
+}
+
+func (n node) value(seqs [][]int) int {
+ return seqs[n.row][n.col]
+}
+
+func (n node) children(seqs [][]int) []*node {
+ var result []*node
+ lastVal := int(-1)
+ last := new(node)
+ for i := n.left; i < n.right; i++ {
+ if lastVal == seqs[i][n.col+1] {
+ continue
+ }
+ last.right = i
+ last = &node{
+ row: i,
+ col: n.col + 1,
+ left: i,
+ }
+ result = append(result, last)
+ }
+ last.right = n.right
+ return result
+}
+
+func addSeqs(da *DoubleArray, seqs [][]int, pos int, n node) {
+ ensureSize(da, pos)
+
+ children := n.children(seqs)
+ var i int
+ for i = 1; ; i++ {
+ ok := func() bool {
+ for _, child := range children {
+ code := child.value(seqs)
+ j := i + code
+ ensureSize(da, j)
+ if da.Check[j] != 0 {
+ return false
+ }
+ }
+ return true
+ }()
+ if ok {
+ break
+ }
+ }
+ da.Base[pos] = i
+ for _, child := range children {
+ code := child.value(seqs)
+ j := i + code
+ da.Check[j] = pos + 1
+ }
+ terminator := len(da.Encoding)
+ for _, child := range children {
+ code := child.value(seqs)
+ if code == terminator {
+ continue
+ }
+ j := i + code
+ addSeqs(da, seqs, j, *child)
+ }
+}
+
+func ensureSize(da *DoubleArray, i int) {
+ for i >= len(da.Base) {
+ da.Base = append(da.Base, make([]int, len(da.Base)+1)...)
+ da.Check = append(da.Check, make([]int, len(da.Check)+1)...)
+ }
+}
+
+type byLex [][]int
+
+func (l byLex) Len() int { return len(l) }
+func (l byLex) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
+func (l byLex) Less(i, j int) bool {
+ si := l[i]
+ sj := l[j]
+ var k int
+ for k = 0; k < len(si) && k < len(sj); k++ {
+ if si[k] < sj[k] {
+ return true
+ }
+ if si[k] > sj[k] {
+ return false
+ }
+ }
+ if k < len(sj) {
+ return true
+ }
+ return false
+}
+
+// HasCommonPrefix determines if any sequence in the DoubleArray is a prefix of the given sequence.
+func (da *DoubleArray) HasCommonPrefix(seq []string) bool {
+ if len(da.Base) == 0 {
+ return false
+ }
+
+ var i int
+ for _, t := range seq {
+ code, ok := da.Encoding[t]
+ if !ok {
+ break
+ }
+ j := da.Base[i] + code
+ if len(da.Check) <= j || da.Check[j] != i+1 {
+ break
+ }
+ i = j
+ }
+ j := da.Base[i] + len(da.Encoding)
+ if len(da.Check) <= j || da.Check[j] != i+1 {
+ return false
+ }
+ return true
+}
diff --git a/vendor/github.com/jmespath/go-jmespath/api.go b/vendor/github.com/jmespath/go-jmespath/api.go
index 9cfa988bc..8e26ffeec 100644
--- a/vendor/github.com/jmespath/go-jmespath/api.go
+++ b/vendor/github.com/jmespath/go-jmespath/api.go
@@ -2,7 +2,7 @@ package jmespath
import "strconv"
-// JmesPath is the epresentation of a compiled JMES path query. A JmesPath is
+// JMESPath is the epresentation of a compiled JMES path query. A JMESPath is
// safe for concurrent use by multiple goroutines.
type JMESPath struct {
ast ASTNode
diff --git a/vendor/github.com/json-iterator/go/feature_adapter.go b/vendor/github.com/json-iterator/go/adapter.go
similarity index 74%
rename from vendor/github.com/json-iterator/go/feature_adapter.go
rename to vendor/github.com/json-iterator/go/adapter.go
index e0ab94807..92d2cc4a3 100644
--- a/vendor/github.com/json-iterator/go/feature_adapter.go
+++ b/vendor/github.com/json-iterator/go/adapter.go
@@ -16,16 +16,7 @@ func Unmarshal(data []byte, v interface{}) error {
return ConfigDefault.Unmarshal(data, v)
}
-func lastNotSpacePos(data []byte) int {
- for i := len(data) - 1; i >= 0; i-- {
- if data[i] != ' ' && data[i] != '\t' && data[i] != '\r' && data[i] != '\n' {
- return i + 1
- }
- }
- return 0
-}
-
-// UnmarshalFromString convenient method to read from string instead of []byte
+// UnmarshalFromString is a convenient method to read from string instead of []byte
func UnmarshalFromString(str string, v interface{}) error {
return ConfigDefault.UnmarshalFromString(str, v)
}
@@ -86,7 +77,16 @@ func (adapter *Decoder) Decode(obj interface{}) error {
// More is there more?
func (adapter *Decoder) More() bool {
- return adapter.iter.head != adapter.iter.tail
+ iter := adapter.iter
+ if iter.Error != nil {
+ return false
+ }
+ c := iter.nextToken()
+ if c == 0 {
+ return false
+ }
+ iter.unreadByte()
+ return c != ']' && c != '}'
}
// Buffered remaining buffer
@@ -95,11 +95,21 @@ func (adapter *Decoder) Buffered() io.Reader {
return bytes.NewReader(remaining)
}
-// UseNumber for number JSON element, use float64 or json.NumberValue (alias of string)
+// UseNumber causes the Decoder to unmarshal a number into an interface{} as a
+// Number instead of as a float64.
func (adapter *Decoder) UseNumber() {
- origCfg := adapter.iter.cfg.configBeforeFrozen
- origCfg.UseNumber = true
- adapter.iter.cfg = origCfg.Froze().(*frozenConfig)
+ cfg := adapter.iter.cfg.configBeforeFrozen
+ cfg.UseNumber = true
+ adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
+}
+
+// DisallowUnknownFields causes the Decoder to return an error when the destination
+// is a struct and the input contains object keys which do not match any
+// non-ignored, exported fields in the destination.
+func (adapter *Decoder) DisallowUnknownFields() {
+ cfg := adapter.iter.cfg.configBeforeFrozen
+ cfg.DisallowUnknownFields = true
+ adapter.iter.cfg = cfg.frozeWithCacheReuse(adapter.iter.cfg.extraExtensions)
}
// NewEncoder same as json.NewEncoder
@@ -122,14 +132,16 @@ func (adapter *Encoder) Encode(val interface{}) error {
// SetIndent set the indention. Prefix is not supported
func (adapter *Encoder) SetIndent(prefix, indent string) {
- adapter.stream.cfg.indentionStep = len(indent)
+ config := adapter.stream.cfg.configBeforeFrozen
+ config.IndentionStep = len(indent)
+ adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
}
// SetEscapeHTML escape html by default, set to false to disable
func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
config := adapter.stream.cfg.configBeforeFrozen
config.EscapeHTML = escapeHTML
- adapter.stream.cfg = config.Froze().(*frozenConfig)
+ adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
}
// Valid reports whether data is a valid JSON encoding.
diff --git a/vendor/github.com/json-iterator/go/feature_any.go b/vendor/github.com/json-iterator/go/any.go
similarity index 75%
rename from vendor/github.com/json-iterator/go/feature_any.go
rename to vendor/github.com/json-iterator/go/any.go
index 87716d1fc..f6b8aeab0 100644
--- a/vendor/github.com/json-iterator/go/feature_any.go
+++ b/vendor/github.com/json-iterator/go/any.go
@@ -3,8 +3,11 @@ package jsoniter
import (
"errors"
"fmt"
+ "github.com/modern-go/reflect2"
"io"
"reflect"
+ "strconv"
+ "unsafe"
)
// Any generic object representation.
@@ -25,7 +28,6 @@ type Any interface {
ToString() string
ToVal(val interface{})
Get(path ...interface{}) Any
- // TODO: add Set
Size() int
Keys() []string
GetInterface() interface{}
@@ -35,7 +37,7 @@ type Any interface {
type baseAny struct{}
func (any *baseAny) Get(path ...interface{}) Any {
- return &invalidAny{baseAny{}, fmt.Errorf("Get %v from simple value", path)}
+ return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)}
}
func (any *baseAny) Size() int {
@@ -89,7 +91,7 @@ func Wrap(val interface{}) Any {
if isAny {
return asAny
}
- typ := reflect.TypeOf(val)
+ typ := reflect2.TypeOf(val)
switch typ.Kind() {
case reflect.Slice:
return wrapArray(val)
@@ -100,6 +102,9 @@ func Wrap(val interface{}) Any {
case reflect.String:
return WrapString(val.(string))
case reflect.Int:
+ if strconv.IntSize == 32 {
+ return WrapInt32(int32(val.(int)))
+ }
return WrapInt64(int64(val.(int)))
case reflect.Int8:
return WrapInt32(int32(val.(int8)))
@@ -110,7 +115,15 @@ func Wrap(val interface{}) Any {
case reflect.Int64:
return WrapInt64(val.(int64))
case reflect.Uint:
+ if strconv.IntSize == 32 {
+ return WrapUint32(uint32(val.(uint)))
+ }
return WrapUint64(uint64(val.(uint)))
+ case reflect.Uintptr:
+ if ptrSize == 32 {
+ return WrapUint32(uint32(val.(uintptr)))
+ }
+ return WrapUint64(uint64(val.(uintptr)))
case reflect.Uint8:
return WrapUint32(uint32(val.(uint8)))
case reflect.Uint16:
@@ -243,3 +256,70 @@ func locatePath(iter *Iterator, path []interface{}) Any {
}
return iter.readAny()
}
+
+var anyType = reflect2.TypeOfPtr((*Any)(nil)).Elem()
+
+func createDecoderOfAny(ctx *ctx, typ reflect2.Type) ValDecoder {
+ if typ == anyType {
+ return &directAnyCodec{}
+ }
+ if typ.Implements(anyType) {
+ return &anyCodec{
+ valType: typ,
+ }
+ }
+ return nil
+}
+
+func createEncoderOfAny(ctx *ctx, typ reflect2.Type) ValEncoder {
+ if typ == anyType {
+ return &directAnyCodec{}
+ }
+ if typ.Implements(anyType) {
+ return &anyCodec{
+ valType: typ,
+ }
+ }
+ return nil
+}
+
+type anyCodec struct {
+ valType reflect2.Type
+}
+
+func (codec *anyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ panic("not implemented")
+}
+
+func (codec *anyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ obj := codec.valType.UnsafeIndirect(ptr)
+ any := obj.(Any)
+ any.WriteTo(stream)
+}
+
+func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ obj := codec.valType.UnsafeIndirect(ptr)
+ any := obj.(Any)
+ return any.Size() == 0
+}
+
+type directAnyCodec struct {
+}
+
+func (codec *directAnyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ *(*Any)(ptr) = iter.readAny()
+}
+
+func (codec *directAnyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ any := *(*Any)(ptr)
+ if any == nil {
+ stream.WriteNil()
+ return
+ }
+ any.WriteTo(stream)
+}
+
+func (codec *directAnyCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ any := *(*Any)(ptr)
+ return any.Size() == 0
+}
diff --git a/vendor/github.com/json-iterator/go/feature_any_array.go b/vendor/github.com/json-iterator/go/any_array.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_array.go
rename to vendor/github.com/json-iterator/go/any_array.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_bool.go b/vendor/github.com/json-iterator/go/any_bool.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_bool.go
rename to vendor/github.com/json-iterator/go/any_bool.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_float.go b/vendor/github.com/json-iterator/go/any_float.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_float.go
rename to vendor/github.com/json-iterator/go/any_float.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_int32.go b/vendor/github.com/json-iterator/go/any_int32.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_int32.go
rename to vendor/github.com/json-iterator/go/any_int32.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_int64.go b/vendor/github.com/json-iterator/go/any_int64.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_int64.go
rename to vendor/github.com/json-iterator/go/any_int64.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_invalid.go b/vendor/github.com/json-iterator/go/any_invalid.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_invalid.go
rename to vendor/github.com/json-iterator/go/any_invalid.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_nil.go b/vendor/github.com/json-iterator/go/any_nil.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_nil.go
rename to vendor/github.com/json-iterator/go/any_nil.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_number.go b/vendor/github.com/json-iterator/go/any_number.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_number.go
rename to vendor/github.com/json-iterator/go/any_number.go
index bf8d02462..9d1e901a6 100644
--- a/vendor/github.com/json-iterator/go/feature_any_number.go
+++ b/vendor/github.com/json-iterator/go/any_number.go
@@ -1,8 +1,8 @@
package jsoniter
import (
- "unsafe"
"io"
+ "unsafe"
)
type numberLazyAny struct {
diff --git a/vendor/github.com/json-iterator/go/feature_any_object.go b/vendor/github.com/json-iterator/go/any_object.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_object.go
rename to vendor/github.com/json-iterator/go/any_object.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_string.go b/vendor/github.com/json-iterator/go/any_str.go
similarity index 97%
rename from vendor/github.com/json-iterator/go/feature_any_string.go
rename to vendor/github.com/json-iterator/go/any_str.go
index abf060bd5..a4b93c78c 100644
--- a/vendor/github.com/json-iterator/go/feature_any_string.go
+++ b/vendor/github.com/json-iterator/go/any_str.go
@@ -14,7 +14,7 @@ func (any *stringAny) Get(path ...interface{}) Any {
if len(path) == 0 {
return any
}
- return &invalidAny{baseAny{}, fmt.Errorf("Get %v from simple value", path)}
+ return &invalidAny{baseAny{}, fmt.Errorf("GetIndex %v from simple value", path)}
}
func (any *stringAny) Parse() *Iterator {
diff --git a/vendor/github.com/json-iterator/go/feature_any_uint32.go b/vendor/github.com/json-iterator/go/any_uint32.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_uint32.go
rename to vendor/github.com/json-iterator/go/any_uint32.go
diff --git a/vendor/github.com/json-iterator/go/feature_any_uint64.go b/vendor/github.com/json-iterator/go/any_uint64.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_any_uint64.go
rename to vendor/github.com/json-iterator/go/any_uint64.go
diff --git a/vendor/github.com/json-iterator/go/feature_config.go b/vendor/github.com/json-iterator/go/config.go
similarity index 57%
rename from vendor/github.com/json-iterator/go/feature_config.go
rename to vendor/github.com/json-iterator/go/config.go
index 2d2fc8cd0..8c58fcba5 100644
--- a/vendor/github.com/json-iterator/go/feature_config.go
+++ b/vendor/github.com/json-iterator/go/config.go
@@ -2,10 +2,13 @@ package jsoniter
import (
"encoding/json"
- "errors"
"io"
"reflect"
+ "sync"
"unsafe"
+
+ "github.com/modern-go/concurrent"
+ "github.com/modern-go/reflect2"
)
// Config customize how the API should behave.
@@ -16,10 +19,12 @@ type Config struct {
EscapeHTML bool
SortMapKeys bool
UseNumber bool
+ DisallowUnknownFields bool
TagKey string
OnlyTaggedField bool
ValidateJsonRawMessage bool
ObjectFieldMustBeSimpleString bool
+ CaseSensitive bool
}
// API the public interface of this package.
@@ -37,6 +42,8 @@ type API interface {
NewDecoder(reader io.Reader) *Decoder
Valid(data []byte) bool
RegisterExtension(extension Extension)
+ DecoderOf(typ reflect2.Type) ValDecoder
+ EncoderOf(typ reflect2.Type) ValEncoder
}
// ConfigDefault the default API
@@ -58,35 +65,121 @@ var ConfigFastest = Config{
ObjectFieldMustBeSimpleString: true, // do not unescape object field
}.Froze()
+type frozenConfig struct {
+ configBeforeFrozen Config
+ sortMapKeys bool
+ indentionStep int
+ objectFieldMustBeSimpleString bool
+ onlyTaggedField bool
+ disallowUnknownFields bool
+ decoderCache *concurrent.Map
+ encoderCache *concurrent.Map
+ encoderExtension Extension
+ decoderExtension Extension
+ extraExtensions []Extension
+ streamPool *sync.Pool
+ iteratorPool *sync.Pool
+ caseSensitive bool
+}
+
+func (cfg *frozenConfig) initCache() {
+ cfg.decoderCache = concurrent.NewMap()
+ cfg.encoderCache = concurrent.NewMap()
+}
+
+func (cfg *frozenConfig) addDecoderToCache(cacheKey uintptr, decoder ValDecoder) {
+ cfg.decoderCache.Store(cacheKey, decoder)
+}
+
+func (cfg *frozenConfig) addEncoderToCache(cacheKey uintptr, encoder ValEncoder) {
+ cfg.encoderCache.Store(cacheKey, encoder)
+}
+
+func (cfg *frozenConfig) getDecoderFromCache(cacheKey uintptr) ValDecoder {
+ decoder, found := cfg.decoderCache.Load(cacheKey)
+ if found {
+ return decoder.(ValDecoder)
+ }
+ return nil
+}
+
+func (cfg *frozenConfig) getEncoderFromCache(cacheKey uintptr) ValEncoder {
+ encoder, found := cfg.encoderCache.Load(cacheKey)
+ if found {
+ return encoder.(ValEncoder)
+ }
+ return nil
+}
+
+var cfgCache = concurrent.NewMap()
+
+func getFrozenConfigFromCache(cfg Config) *frozenConfig {
+ obj, found := cfgCache.Load(cfg)
+ if found {
+ return obj.(*frozenConfig)
+ }
+ return nil
+}
+
+func addFrozenConfigToCache(cfg Config, frozenConfig *frozenConfig) {
+ cfgCache.Store(cfg, frozenConfig)
+}
+
// Froze forge API from config
func (cfg Config) Froze() API {
- // TODO: cache frozen config
- frozenConfig := &frozenConfig{
+ api := &frozenConfig{
sortMapKeys: cfg.SortMapKeys,
indentionStep: cfg.IndentionStep,
objectFieldMustBeSimpleString: cfg.ObjectFieldMustBeSimpleString,
onlyTaggedField: cfg.OnlyTaggedField,
- streamPool: make(chan *Stream, 16),
- iteratorPool: make(chan *Iterator, 16),
+ disallowUnknownFields: cfg.DisallowUnknownFields,
+ caseSensitive: cfg.CaseSensitive,
}
- frozenConfig.initCache()
+ api.streamPool = &sync.Pool{
+ New: func() interface{} {
+ return NewStream(api, nil, 512)
+ },
+ }
+ api.iteratorPool = &sync.Pool{
+ New: func() interface{} {
+ return NewIterator(api)
+ },
+ }
+ api.initCache()
+ encoderExtension := EncoderExtension{}
+ decoderExtension := DecoderExtension{}
if cfg.MarshalFloatWith6Digits {
- frozenConfig.marshalFloatWith6Digits()
+ api.marshalFloatWith6Digits(encoderExtension)
}
if cfg.EscapeHTML {
- frozenConfig.escapeHTML()
+ api.escapeHTML(encoderExtension)
}
if cfg.UseNumber {
- frozenConfig.useNumber()
+ api.useNumber(decoderExtension)
}
if cfg.ValidateJsonRawMessage {
- frozenConfig.validateJsonRawMessage()
+ api.validateJsonRawMessage(encoderExtension)
}
- frozenConfig.configBeforeFrozen = cfg
- return frozenConfig
+ api.encoderExtension = encoderExtension
+ api.decoderExtension = decoderExtension
+ api.configBeforeFrozen = cfg
+ return api
}
-func (cfg *frozenConfig) validateJsonRawMessage() {
+func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig {
+ api := getFrozenConfigFromCache(cfg)
+ if api != nil {
+ return api
+ }
+ api = cfg.Froze().(*frozenConfig)
+ for _, extension := range extraExtensions {
+ api.RegisterExtension(extension)
+ }
+ addFrozenConfigToCache(cfg, api)
+ return api
+}
+
+func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
rawMessage := *(*json.RawMessage)(ptr)
iter := cfg.BorrowIterator([]byte(rawMessage))
@@ -98,20 +191,25 @@ func (cfg *frozenConfig) validateJsonRawMessage() {
stream.WriteRaw(string(rawMessage))
}
}, func(ptr unsafe.Pointer) bool {
- return false
+ return len(*((*json.RawMessage)(ptr))) == 0
}}
- cfg.addEncoderToCache(reflect.TypeOf((*json.RawMessage)(nil)).Elem(), encoder)
- cfg.addEncoderToCache(reflect.TypeOf((*RawMessage)(nil)).Elem(), encoder)
+ extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder
+ extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder
}
-func (cfg *frozenConfig) useNumber() {
- cfg.addDecoderToCache(reflect.TypeOf((*interface{})(nil)).Elem(), &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) {
+func (cfg *frozenConfig) useNumber(extension DecoderExtension) {
+ extension[reflect2.TypeOfPtr((*interface{})(nil)).Elem()] = &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) {
+ exitingValue := *((*interface{})(ptr))
+ if exitingValue != nil && reflect.TypeOf(exitingValue).Kind() == reflect.Ptr {
+ iter.ReadVal(exitingValue)
+ return
+ }
if iter.WhatIsNext() == NumberValue {
*((*interface{})(ptr)) = json.Number(iter.readNumberAsString())
} else {
*((*interface{})(ptr)) = iter.Read()
}
- }})
+ }}
}
func (cfg *frozenConfig) getTagKey() string {
tagKey := cfg.configBeforeFrozen.TagKey
@@ -122,7 +220,9 @@ func (cfg *frozenConfig) getTagKey() string {
}
func (cfg *frozenConfig) RegisterExtension(extension Extension) {
- cfg.extensions = append(cfg.extensions, extension)
+ cfg.extraExtensions = append(cfg.extraExtensions, extension)
+ copied := cfg.configBeforeFrozen
+ cfg.configBeforeFrozen = copied
}
type lossyFloat32Encoder struct {
@@ -132,10 +232,6 @@ func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) {
stream.WriteFloat32Lossy(*((*float32)(ptr)))
}
-func (encoder *lossyFloat32Encoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool {
return *((*float32)(ptr)) == 0
}
@@ -147,20 +243,16 @@ func (encoder *lossyFloat64Encoder) Encode(ptr unsafe.Pointer, stream *Stream) {
stream.WriteFloat64Lossy(*((*float64)(ptr)))
}
-func (encoder *lossyFloat64Encoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *lossyFloat64Encoder) IsEmpty(ptr unsafe.Pointer) bool {
return *((*float64)(ptr)) == 0
}
// EnableLossyFloatMarshalling keeps 10**(-6) precision
// for float variables for better performance.
-func (cfg *frozenConfig) marshalFloatWith6Digits() {
+func (cfg *frozenConfig) marshalFloatWith6Digits(extension EncoderExtension) {
// for better performance
- cfg.addEncoderToCache(reflect.TypeOf((*float32)(nil)).Elem(), &lossyFloat32Encoder{})
- cfg.addEncoderToCache(reflect.TypeOf((*float64)(nil)).Elem(), &lossyFloat64Encoder{})
+ extension[reflect2.TypeOfPtr((*float32)(nil)).Elem()] = &lossyFloat32Encoder{}
+ extension[reflect2.TypeOfPtr((*float64)(nil)).Elem()] = &lossyFloat64Encoder{}
}
type htmlEscapedStringEncoder struct {
@@ -171,16 +263,12 @@ func (encoder *htmlEscapedStringEncoder) Encode(ptr unsafe.Pointer, stream *Stre
stream.WriteStringWithHTMLEscaped(str)
}
-func (encoder *htmlEscapedStringEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *htmlEscapedStringEncoder) IsEmpty(ptr unsafe.Pointer) bool {
return *((*string)(ptr)) == ""
}
-func (cfg *frozenConfig) escapeHTML() {
- cfg.addEncoderToCache(reflect.TypeOf((*string)(nil)).Elem(), &htmlEscapedStringEncoder{})
+func (cfg *frozenConfig) escapeHTML(encoderExtension EncoderExtension) {
+ encoderExtension[reflect2.TypeOfPtr((*string)(nil)).Elem()] = &htmlEscapedStringEncoder{}
}
func (cfg *frozenConfig) cleanDecoders() {
@@ -229,24 +317,22 @@ func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]
}
newCfg := cfg.configBeforeFrozen
newCfg.IndentionStep = len(indent)
- return newCfg.Froze().Marshal(v)
+ return newCfg.frozeWithCacheReuse(cfg.extraExtensions).Marshal(v)
}
func (cfg *frozenConfig) UnmarshalFromString(str string, v interface{}) error {
data := []byte(str)
- data = data[:lastNotSpacePos(data)]
iter := cfg.BorrowIterator(data)
defer cfg.ReturnIterator(iter)
iter.ReadVal(v)
- if iter.head == iter.tail {
- iter.loadMore()
- }
- if iter.Error == io.EOF {
- return nil
- }
- if iter.Error == nil {
- iter.ReportError("UnmarshalFromString", "there are bytes left after unmarshal")
+ c := iter.nextToken()
+ if c == 0 {
+ if iter.Error == io.EOF {
+ return nil
+ }
+ return iter.Error
}
+ iter.ReportError("Unmarshal", "there are bytes left after unmarshal")
return iter.Error
}
@@ -257,24 +343,17 @@ func (cfg *frozenConfig) Get(data []byte, path ...interface{}) Any {
}
func (cfg *frozenConfig) Unmarshal(data []byte, v interface{}) error {
- data = data[:lastNotSpacePos(data)]
iter := cfg.BorrowIterator(data)
defer cfg.ReturnIterator(iter)
- typ := reflect.TypeOf(v)
- if typ.Kind() != reflect.Ptr {
- // return non-pointer error
- return errors.New("the second param must be ptr type")
- }
iter.ReadVal(v)
- if iter.head == iter.tail {
- iter.loadMore()
- }
- if iter.Error == io.EOF {
- return nil
- }
- if iter.Error == nil {
- iter.ReportError("Unmarshal", "there are bytes left after unmarshal")
+ c := iter.nextToken()
+ if c == 0 {
+ if iter.Error == io.EOF {
+ return nil
+ }
+ return iter.Error
}
+ iter.ReportError("Unmarshal", "there are bytes left after unmarshal")
return iter.Error
}
diff --git a/vendor/github.com/json-iterator/go/feature_config_with_sync_map.go b/vendor/github.com/json-iterator/go/feature_config_with_sync_map.go
deleted file mode 100644
index e81e1b7f7..000000000
--- a/vendor/github.com/json-iterator/go/feature_config_with_sync_map.go
+++ /dev/null
@@ -1,51 +0,0 @@
-//+build go1.9
-
-package jsoniter
-
-import (
- "reflect"
- "sync"
-)
-
-type frozenConfig struct {
- configBeforeFrozen Config
- sortMapKeys bool
- indentionStep int
- objectFieldMustBeSimpleString bool
- onlyTaggedField bool
- decoderCache sync.Map
- encoderCache sync.Map
- extensions []Extension
- streamPool chan *Stream
- iteratorPool chan *Iterator
-}
-
-func (cfg *frozenConfig) initCache() {
- cfg.decoderCache = sync.Map{}
- cfg.encoderCache = sync.Map{}
-}
-
-
-func (cfg *frozenConfig) addDecoderToCache(cacheKey reflect.Type, decoder ValDecoder) {
- cfg.decoderCache.Store(cacheKey, decoder)
-}
-
-func (cfg *frozenConfig) addEncoderToCache(cacheKey reflect.Type, encoder ValEncoder) {
- cfg.encoderCache.Store(cacheKey, encoder)
-}
-
-func (cfg *frozenConfig) getDecoderFromCache(cacheKey reflect.Type) ValDecoder {
- decoder, found := cfg.decoderCache.Load(cacheKey)
- if found {
- return decoder.(ValDecoder)
- }
- return nil
-}
-
-func (cfg *frozenConfig) getEncoderFromCache(cacheKey reflect.Type) ValEncoder {
- encoder, found := cfg.encoderCache.Load(cacheKey)
- if found {
- return encoder.(ValEncoder)
- }
- return nil
-}
\ No newline at end of file
diff --git a/vendor/github.com/json-iterator/go/feature_config_without_sync_map.go b/vendor/github.com/json-iterator/go/feature_config_without_sync_map.go
deleted file mode 100644
index f01f971e0..000000000
--- a/vendor/github.com/json-iterator/go/feature_config_without_sync_map.go
+++ /dev/null
@@ -1,54 +0,0 @@
-//+build !go1.9
-
-package jsoniter
-
-import (
- "reflect"
- "sync"
-)
-
-type frozenConfig struct {
- configBeforeFrozen Config
- sortMapKeys bool
- indentionStep int
- objectFieldMustBeSimpleString bool
- onlyTaggedField bool
- cacheLock *sync.RWMutex
- decoderCache map[reflect.Type]ValDecoder
- encoderCache map[reflect.Type]ValEncoder
- extensions []Extension
- streamPool chan *Stream
- iteratorPool chan *Iterator
-}
-
-func (cfg *frozenConfig) initCache() {
- cfg.cacheLock = &sync.RWMutex{}
- cfg.decoderCache = map[reflect.Type]ValDecoder{}
- cfg.encoderCache = map[reflect.Type]ValEncoder{}
-}
-
-func (cfg *frozenConfig) addDecoderToCache(cacheKey reflect.Type, decoder ValDecoder) {
- cfg.cacheLock.Lock()
- cfg.decoderCache[cacheKey] = decoder
- cfg.cacheLock.Unlock()
-}
-
-func (cfg *frozenConfig) addEncoderToCache(cacheKey reflect.Type, encoder ValEncoder) {
- cfg.cacheLock.Lock()
- cfg.encoderCache[cacheKey] = encoder
- cfg.cacheLock.Unlock()
-}
-
-func (cfg *frozenConfig) getDecoderFromCache(cacheKey reflect.Type) ValDecoder {
- cfg.cacheLock.RLock()
- decoder, _ := cfg.decoderCache[cacheKey].(ValDecoder)
- cfg.cacheLock.RUnlock()
- return decoder
-}
-
-func (cfg *frozenConfig) getEncoderFromCache(cacheKey reflect.Type) ValEncoder {
- cfg.cacheLock.RLock()
- encoder, _ := cfg.encoderCache[cacheKey].(ValEncoder)
- cfg.cacheLock.RUnlock()
- return encoder
-}
diff --git a/vendor/github.com/json-iterator/go/feature_json_number.go b/vendor/github.com/json-iterator/go/feature_json_number.go
deleted file mode 100644
index e187b200a..000000000
--- a/vendor/github.com/json-iterator/go/feature_json_number.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package jsoniter
-
-import (
- "encoding/json"
- "strconv"
-)
-
-type Number string
-
-// String returns the literal text of the number.
-func (n Number) String() string { return string(n) }
-
-// Float64 returns the number as a float64.
-func (n Number) Float64() (float64, error) {
- return strconv.ParseFloat(string(n), 64)
-}
-
-// Int64 returns the number as an int64.
-func (n Number) Int64() (int64, error) {
- return strconv.ParseInt(string(n), 10, 64)
-}
-
-func CastJsonNumber(val interface{}) (string, bool) {
- switch typedVal := val.(type) {
- case json.Number:
- return string(typedVal), true
- case Number:
- return string(typedVal), true
- }
- return "", false
-}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect.go b/vendor/github.com/json-iterator/go/feature_reflect.go
deleted file mode 100644
index 75d533b07..000000000
--- a/vendor/github.com/json-iterator/go/feature_reflect.go
+++ /dev/null
@@ -1,607 +0,0 @@
-package jsoniter
-
-import (
- "encoding"
- "encoding/json"
- "fmt"
- "reflect"
- "time"
- "unsafe"
-)
-
-// ValDecoder is an internal type registered to cache as needed.
-// Don't confuse jsoniter.ValDecoder with json.Decoder.
-// For json.Decoder's adapter, refer to jsoniter.AdapterDecoder(todo link).
-//
-// Reflection on type to create decoders, which is then cached
-// Reflection on value is avoided as we can, as the reflect.Value itself will allocate, with following exceptions
-// 1. create instance of new value, for example *int will need a int to be allocated
-// 2. append to slice, if the existing cap is not enough, allocate will be done using Reflect.New
-// 3. assignment to map, both key and value will be reflect.Value
-// For a simple struct binding, it will be reflect.Value free and allocation free
-type ValDecoder interface {
- Decode(ptr unsafe.Pointer, iter *Iterator)
-}
-
-// ValEncoder is an internal type registered to cache as needed.
-// Don't confuse jsoniter.ValEncoder with json.Encoder.
-// For json.Encoder's adapter, refer to jsoniter.AdapterEncoder(todo godoc link).
-type ValEncoder interface {
- IsEmpty(ptr unsafe.Pointer) bool
- Encode(ptr unsafe.Pointer, stream *Stream)
- EncodeInterface(val interface{}, stream *Stream)
-}
-
-type checkIsEmpty interface {
- IsEmpty(ptr unsafe.Pointer) bool
-}
-
-// WriteToStream the default implementation for TypeEncoder method EncodeInterface
-func WriteToStream(val interface{}, stream *Stream, encoder ValEncoder) {
- e := (*emptyInterface)(unsafe.Pointer(&val))
- if e.word == nil {
- stream.WriteNil()
- return
- }
- if reflect.TypeOf(val).Kind() == reflect.Ptr {
- encoder.Encode(unsafe.Pointer(&e.word), stream)
- } else {
- encoder.Encode(e.word, stream)
- }
-}
-
-var jsonNumberType reflect.Type
-var jsoniterNumberType reflect.Type
-var jsonRawMessageType reflect.Type
-var jsoniterRawMessageType reflect.Type
-var anyType reflect.Type
-var marshalerType reflect.Type
-var unmarshalerType reflect.Type
-var textMarshalerType reflect.Type
-var textUnmarshalerType reflect.Type
-
-func init() {
- jsonNumberType = reflect.TypeOf((*json.Number)(nil)).Elem()
- jsoniterNumberType = reflect.TypeOf((*Number)(nil)).Elem()
- jsonRawMessageType = reflect.TypeOf((*json.RawMessage)(nil)).Elem()
- jsoniterRawMessageType = reflect.TypeOf((*RawMessage)(nil)).Elem()
- anyType = reflect.TypeOf((*Any)(nil)).Elem()
- marshalerType = reflect.TypeOf((*json.Marshaler)(nil)).Elem()
- unmarshalerType = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem()
- textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem()
- textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem()
-}
-
-// ReadVal copy the underlying JSON into go interface, same as json.Unmarshal
-func (iter *Iterator) ReadVal(obj interface{}) {
- typ := reflect.TypeOf(obj)
- cacheKey := typ.Elem()
- decoder := decoderOfType(iter.cfg, "", cacheKey)
- e := (*emptyInterface)(unsafe.Pointer(&obj))
- if e.word == nil {
- iter.ReportError("ReadVal", "can not read into nil pointer")
- return
- }
- decoder.Decode(e.word, iter)
-}
-
-// WriteVal copy the go interface into underlying JSON, same as json.Marshal
-func (stream *Stream) WriteVal(val interface{}) {
- if nil == val {
- stream.WriteNil()
- return
- }
- typ := reflect.TypeOf(val)
- cacheKey := typ
- encoder := encoderOfType(stream.cfg, "", cacheKey)
- encoder.EncodeInterface(val, stream)
-}
-
-func decoderOfType(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- cacheKey := typ
- decoder := cfg.getDecoderFromCache(cacheKey)
- if decoder != nil {
- return decoder
- }
- decoder = getTypeDecoderFromExtension(cfg, typ)
- if decoder != nil {
- cfg.addDecoderToCache(cacheKey, decoder)
- return decoder
- }
- decoder = &placeholderDecoder{cfg: cfg, cacheKey: cacheKey}
- cfg.addDecoderToCache(cacheKey, decoder)
- decoder = createDecoderOfType(cfg, prefix, typ)
- for _, extension := range extensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- for _, extension := range cfg.extensions {
- decoder = extension.DecorateDecoder(typ, decoder)
- }
- cfg.addDecoderToCache(cacheKey, decoder)
- return decoder
-}
-
-func createDecoderOfType(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- typeName := typ.String()
- if typ == jsonRawMessageType {
- return &jsonRawMessageCodec{}
- }
- if typ == jsoniterRawMessageType {
- return &jsoniterRawMessageCodec{}
- }
- if typ.AssignableTo(jsonNumberType) {
- return &jsonNumberCodec{}
- }
- if typ.AssignableTo(jsoniterNumberType) {
- return &jsoniterNumberCodec{}
- }
- if typ.Implements(unmarshalerType) {
- templateInterface := reflect.New(typ).Elem().Interface()
- var decoder ValDecoder = &unmarshalerDecoder{extractInterface(templateInterface)}
- if typ.Kind() == reflect.Ptr {
- decoder = &OptionalDecoder{typ.Elem(), decoder}
- }
- return decoder
- }
- if reflect.PtrTo(typ).Implements(unmarshalerType) {
- templateInterface := reflect.New(typ).Interface()
- var decoder ValDecoder = &unmarshalerDecoder{extractInterface(templateInterface)}
- return decoder
- }
- if typ.Implements(textUnmarshalerType) {
- templateInterface := reflect.New(typ).Elem().Interface()
- var decoder ValDecoder = &textUnmarshalerDecoder{extractInterface(templateInterface)}
- if typ.Kind() == reflect.Ptr {
- decoder = &OptionalDecoder{typ.Elem(), decoder}
- }
- return decoder
- }
- if reflect.PtrTo(typ).Implements(textUnmarshalerType) {
- templateInterface := reflect.New(typ).Interface()
- var decoder ValDecoder = &textUnmarshalerDecoder{extractInterface(templateInterface)}
- return decoder
- }
- if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Uint8 {
- sliceDecoder := decoderOfSlice(cfg, prefix, typ)
- return &base64Codec{sliceDecoder: sliceDecoder}
- }
- if typ.Implements(anyType) {
- return &anyCodec{}
- }
- switch typ.Kind() {
- case reflect.String:
- if typeName != "string" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*string)(nil)).Elem())
- }
- return &stringCodec{}
- case reflect.Int:
- if typeName != "int" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*int)(nil)).Elem())
- }
- return &intCodec{}
- case reflect.Int8:
- if typeName != "int8" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*int8)(nil)).Elem())
- }
- return &int8Codec{}
- case reflect.Int16:
- if typeName != "int16" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*int16)(nil)).Elem())
- }
- return &int16Codec{}
- case reflect.Int32:
- if typeName != "int32" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*int32)(nil)).Elem())
- }
- return &int32Codec{}
- case reflect.Int64:
- if typeName != "int64" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*int64)(nil)).Elem())
- }
- return &int64Codec{}
- case reflect.Uint:
- if typeName != "uint" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uint)(nil)).Elem())
- }
- return &uintCodec{}
- case reflect.Uint8:
- if typeName != "uint8" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uint8)(nil)).Elem())
- }
- return &uint8Codec{}
- case reflect.Uint16:
- if typeName != "uint16" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uint16)(nil)).Elem())
- }
- return &uint16Codec{}
- case reflect.Uint32:
- if typeName != "uint32" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uint32)(nil)).Elem())
- }
- return &uint32Codec{}
- case reflect.Uintptr:
- if typeName != "uintptr" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uintptr)(nil)).Elem())
- }
- return &uintptrCodec{}
- case reflect.Uint64:
- if typeName != "uint64" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*uint64)(nil)).Elem())
- }
- return &uint64Codec{}
- case reflect.Float32:
- if typeName != "float32" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*float32)(nil)).Elem())
- }
- return &float32Codec{}
- case reflect.Float64:
- if typeName != "float64" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*float64)(nil)).Elem())
- }
- return &float64Codec{}
- case reflect.Bool:
- if typeName != "bool" {
- return decoderOfType(cfg, prefix, reflect.TypeOf((*bool)(nil)).Elem())
- }
- return &boolCodec{}
- case reflect.Interface:
- if typ.NumMethod() == 0 {
- return &emptyInterfaceCodec{}
- }
- return &nonEmptyInterfaceCodec{}
- case reflect.Struct:
- return decoderOfStruct(cfg, prefix, typ)
- case reflect.Array:
- return decoderOfArray(cfg, prefix, typ)
- case reflect.Slice:
- return decoderOfSlice(cfg, prefix, typ)
- case reflect.Map:
- return decoderOfMap(cfg, prefix, typ)
- case reflect.Ptr:
- return decoderOfOptional(cfg, prefix, typ)
- default:
- return &lazyErrorDecoder{err: fmt.Errorf("%s%s is unsupported type", prefix, typ.String())}
- }
-}
-
-func encoderOfType(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- cacheKey := typ
- encoder := cfg.getEncoderFromCache(cacheKey)
- if encoder != nil {
- return encoder
- }
- encoder = getTypeEncoderFromExtension(cfg, typ)
- if encoder != nil {
- cfg.addEncoderToCache(cacheKey, encoder)
- return encoder
- }
- encoder = &placeholderEncoder{cfg: cfg, cacheKey: cacheKey}
- cfg.addEncoderToCache(cacheKey, encoder)
- encoder = createEncoderOfType(cfg, prefix, typ)
- for _, extension := range extensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- for _, extension := range cfg.extensions {
- encoder = extension.DecorateEncoder(typ, encoder)
- }
- cfg.addEncoderToCache(cacheKey, encoder)
- return encoder
-}
-
-func createEncoderOfType(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- if typ == jsonRawMessageType {
- return &jsonRawMessageCodec{}
- }
- if typ == jsoniterRawMessageType {
- return &jsoniterRawMessageCodec{}
- }
- if typ.AssignableTo(jsonNumberType) {
- return &jsonNumberCodec{}
- }
- if typ.AssignableTo(jsoniterNumberType) {
- return &jsoniterNumberCodec{}
- }
- if typ.Implements(marshalerType) {
- checkIsEmpty := createCheckIsEmpty(cfg, typ)
- templateInterface := reflect.New(typ).Elem().Interface()
- var encoder ValEncoder = &marshalerEncoder{
- templateInterface: extractInterface(templateInterface),
- checkIsEmpty: checkIsEmpty,
- }
- if typ.Kind() == reflect.Ptr {
- encoder = &OptionalEncoder{encoder}
- }
- return encoder
- }
- if reflect.PtrTo(typ).Implements(marshalerType) {
- checkIsEmpty := createCheckIsEmpty(cfg, reflect.PtrTo(typ))
- templateInterface := reflect.New(typ).Interface()
- var encoder ValEncoder = &marshalerEncoder{
- templateInterface: extractInterface(templateInterface),
- checkIsEmpty: checkIsEmpty,
- }
- return encoder
- }
- if typ.Implements(textMarshalerType) {
- checkIsEmpty := createCheckIsEmpty(cfg, typ)
- templateInterface := reflect.New(typ).Elem().Interface()
- var encoder ValEncoder = &textMarshalerEncoder{
- templateInterface: extractInterface(templateInterface),
- checkIsEmpty: checkIsEmpty,
- }
- if typ.Kind() == reflect.Ptr {
- encoder = &OptionalEncoder{encoder}
- }
- return encoder
- }
- if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Uint8 {
- return &base64Codec{}
- }
- if typ.Implements(anyType) {
- return &anyCodec{}
- }
- return createEncoderOfSimpleType(cfg, prefix, typ)
-}
-
-func createCheckIsEmpty(cfg *frozenConfig, typ reflect.Type) checkIsEmpty {
- kind := typ.Kind()
- switch kind {
- case reflect.String:
- return &stringCodec{}
- case reflect.Int:
- return &intCodec{}
- case reflect.Int8:
- return &int8Codec{}
- case reflect.Int16:
- return &int16Codec{}
- case reflect.Int32:
- return &int32Codec{}
- case reflect.Int64:
- return &int64Codec{}
- case reflect.Uint:
- return &uintCodec{}
- case reflect.Uint8:
- return &uint8Codec{}
- case reflect.Uint16:
- return &uint16Codec{}
- case reflect.Uint32:
- return &uint32Codec{}
- case reflect.Uintptr:
- return &uintptrCodec{}
- case reflect.Uint64:
- return &uint64Codec{}
- case reflect.Float32:
- return &float32Codec{}
- case reflect.Float64:
- return &float64Codec{}
- case reflect.Bool:
- return &boolCodec{}
- case reflect.Interface:
- if typ.NumMethod() == 0 {
- return &emptyInterfaceCodec{}
- }
- return &nonEmptyInterfaceCodec{}
- case reflect.Struct:
- return &structEncoder{typ: typ}
- case reflect.Array:
- return &arrayEncoder{}
- case reflect.Slice:
- return &sliceEncoder{}
- case reflect.Map:
- return encoderOfMap(cfg, "", typ)
- case reflect.Ptr:
- return &OptionalEncoder{}
- default:
- return &lazyErrorEncoder{err: fmt.Errorf("unsupported type: %v", typ)}
- }
-}
-
-func createEncoderOfSimpleType(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- typeName := typ.String()
- kind := typ.Kind()
- switch kind {
- case reflect.String:
- if typeName != "string" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*string)(nil)).Elem())
- }
- return &stringCodec{}
- case reflect.Int:
- if typeName != "int" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*int)(nil)).Elem())
- }
- return &intCodec{}
- case reflect.Int8:
- if typeName != "int8" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*int8)(nil)).Elem())
- }
- return &int8Codec{}
- case reflect.Int16:
- if typeName != "int16" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*int16)(nil)).Elem())
- }
- return &int16Codec{}
- case reflect.Int32:
- if typeName != "int32" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*int32)(nil)).Elem())
- }
- return &int32Codec{}
- case reflect.Int64:
- if typeName != "int64" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*int64)(nil)).Elem())
- }
- return &int64Codec{}
- case reflect.Uint:
- if typeName != "uint" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uint)(nil)).Elem())
- }
- return &uintCodec{}
- case reflect.Uint8:
- if typeName != "uint8" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uint8)(nil)).Elem())
- }
- return &uint8Codec{}
- case reflect.Uint16:
- if typeName != "uint16" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uint16)(nil)).Elem())
- }
- return &uint16Codec{}
- case reflect.Uint32:
- if typeName != "uint32" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uint32)(nil)).Elem())
- }
- return &uint32Codec{}
- case reflect.Uintptr:
- if typeName != "uintptr" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uintptr)(nil)).Elem())
- }
- return &uintptrCodec{}
- case reflect.Uint64:
- if typeName != "uint64" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*uint64)(nil)).Elem())
- }
- return &uint64Codec{}
- case reflect.Float32:
- if typeName != "float32" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*float32)(nil)).Elem())
- }
- return &float32Codec{}
- case reflect.Float64:
- if typeName != "float64" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*float64)(nil)).Elem())
- }
- return &float64Codec{}
- case reflect.Bool:
- if typeName != "bool" {
- return encoderOfType(cfg, prefix, reflect.TypeOf((*bool)(nil)).Elem())
- }
- return &boolCodec{}
- case reflect.Interface:
- if typ.NumMethod() == 0 {
- return &emptyInterfaceCodec{}
- }
- return &nonEmptyInterfaceCodec{}
- case reflect.Struct:
- return encoderOfStruct(cfg, prefix, typ)
- case reflect.Array:
- return encoderOfArray(cfg, prefix, typ)
- case reflect.Slice:
- return encoderOfSlice(cfg, prefix, typ)
- case reflect.Map:
- return encoderOfMap(cfg, prefix, typ)
- case reflect.Ptr:
- return encoderOfOptional(cfg, prefix, typ)
- default:
- return &lazyErrorEncoder{err: fmt.Errorf("%s%s is unsupported type", prefix, typ.String())}
- }
-}
-
-type placeholderEncoder struct {
- cfg *frozenConfig
- cacheKey reflect.Type
-}
-
-func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- encoder.getRealEncoder().Encode(ptr, stream)
-}
-
-func (encoder *placeholderEncoder) EncodeInterface(val interface{}, stream *Stream) {
- encoder.getRealEncoder().EncodeInterface(val, stream)
-}
-
-func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.getRealEncoder().IsEmpty(ptr)
-}
-
-func (encoder *placeholderEncoder) getRealEncoder() ValEncoder {
- for i := 0; i < 500; i++ {
- realDecoder := encoder.cfg.getEncoderFromCache(encoder.cacheKey)
- _, isPlaceholder := realDecoder.(*placeholderEncoder)
- if isPlaceholder {
- time.Sleep(10 * time.Millisecond)
- } else {
- return realDecoder
- }
- }
- panic(fmt.Sprintf("real encoder not found for cache key: %v", encoder.cacheKey))
-}
-
-type placeholderDecoder struct {
- cfg *frozenConfig
- cacheKey reflect.Type
-}
-
-func (decoder *placeholderDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- for i := 0; i < 500; i++ {
- realDecoder := decoder.cfg.getDecoderFromCache(decoder.cacheKey)
- _, isPlaceholder := realDecoder.(*placeholderDecoder)
- if isPlaceholder {
- time.Sleep(10 * time.Millisecond)
- } else {
- realDecoder.Decode(ptr, iter)
- return
- }
- }
- panic(fmt.Sprintf("real decoder not found for cache key: %v", decoder.cacheKey))
-}
-
-type lazyErrorDecoder struct {
- err error
-}
-
-func (decoder *lazyErrorDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.WhatIsNext() != NilValue {
- if iter.Error == nil {
- iter.Error = decoder.err
- }
- } else {
- iter.Skip()
- }
-}
-
-type lazyErrorEncoder struct {
- err error
-}
-
-func (encoder *lazyErrorEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if ptr == nil {
- stream.WriteNil()
- } else if stream.Error == nil {
- stream.Error = encoder.err
- }
-}
-
-func (encoder *lazyErrorEncoder) EncodeInterface(val interface{}, stream *Stream) {
- if val == nil {
- stream.WriteNil()
- } else if stream.Error == nil {
- stream.Error = encoder.err
- }
-}
-
-func (encoder *lazyErrorEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-func extractInterface(val interface{}) emptyInterface {
- return *((*emptyInterface)(unsafe.Pointer(&val)))
-}
-
-// emptyInterface is the header for an interface{} value.
-type emptyInterface struct {
- typ unsafe.Pointer
- word unsafe.Pointer
-}
-
-// emptyInterface is the header for an interface with method (not interface{})
-type nonEmptyInterface struct {
- // see ../runtime/iface.go:/Itab
- itab *struct {
- ityp unsafe.Pointer // static interface type
- typ unsafe.Pointer // dynamic concrete type
- link unsafe.Pointer
- bad int32
- unused int32
- fun [100000]unsafe.Pointer // method table
- }
- word unsafe.Pointer
-}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_array.go b/vendor/github.com/json-iterator/go/feature_reflect_array.go
deleted file mode 100644
index a6dd91cab..000000000
--- a/vendor/github.com/json-iterator/go/feature_reflect_array.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "io"
- "reflect"
- "unsafe"
-)
-
-func decoderOfArray(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- decoder := decoderOfType(cfg, prefix+"[array]->", typ.Elem())
- return &arrayDecoder{typ, typ.Elem(), decoder}
-}
-
-func encoderOfArray(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- if typ.Len() == 0 {
- return emptyArrayEncoder{}
- }
- encoder := encoderOfType(cfg, prefix+"[array]->", typ.Elem())
- if typ.Elem().Kind() == reflect.Map {
- encoder = &OptionalEncoder{encoder}
- }
- return &arrayEncoder{typ, typ.Elem(), encoder}
-}
-
-type emptyArrayEncoder struct{}
-
-func (encoder emptyArrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteEmptyArray()
-}
-
-func (encoder emptyArrayEncoder) EncodeInterface(val interface{}, stream *Stream) {
- stream.WriteEmptyArray()
-}
-
-func (encoder emptyArrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return true
-}
-
-type arrayEncoder struct {
- arrayType reflect.Type
- elemType reflect.Type
- elemEncoder ValEncoder
-}
-
-func (encoder *arrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteArrayStart()
- elemPtr := unsafe.Pointer(ptr)
- encoder.elemEncoder.Encode(elemPtr, stream)
- for i := 1; i < encoder.arrayType.Len(); i++ {
- stream.WriteMore()
- elemPtr = unsafe.Pointer(uintptr(elemPtr) + encoder.elemType.Size())
- encoder.elemEncoder.Encode(unsafe.Pointer(elemPtr), stream)
- }
- stream.WriteArrayEnd()
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%v: %s", encoder.arrayType, stream.Error.Error())
- }
-}
-
-func (encoder *arrayEncoder) EncodeInterface(val interface{}, stream *Stream) {
- // special optimization for interface{}
- e := (*emptyInterface)(unsafe.Pointer(&val))
- if e.word == nil {
- stream.WriteArrayStart()
- stream.WriteNil()
- stream.WriteArrayEnd()
- return
- }
- elemType := encoder.arrayType.Elem()
- if encoder.arrayType.Len() == 1 && (elemType.Kind() == reflect.Ptr || elemType.Kind() == reflect.Map) {
- ptr := uintptr(e.word)
- e.word = unsafe.Pointer(&ptr)
- }
- if reflect.TypeOf(val).Kind() == reflect.Ptr {
- encoder.Encode(unsafe.Pointer(&e.word), stream)
- } else {
- encoder.Encode(e.word, stream)
- }
-}
-
-func (encoder *arrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return false
-}
-
-type arrayDecoder struct {
- arrayType reflect.Type
- elemType reflect.Type
- elemDecoder ValDecoder
-}
-
-func (decoder *arrayDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.doDecode(ptr, iter)
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%v: %s", decoder.arrayType, iter.Error.Error())
- }
-}
-
-func (decoder *arrayDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
- offset := uintptr(0)
- iter.ReadArrayCB(func(iter *Iterator) bool {
- if offset < decoder.arrayType.Size() {
- decoder.elemDecoder.Decode(unsafe.Pointer(uintptr(ptr)+offset), iter)
- offset += decoder.elemType.Size()
- } else {
- iter.Skip()
- }
- return true
- })
-}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_map.go b/vendor/github.com/json-iterator/go/feature_reflect_map.go
deleted file mode 100644
index f537d026a..000000000
--- a/vendor/github.com/json-iterator/go/feature_reflect_map.go
+++ /dev/null
@@ -1,260 +0,0 @@
-package jsoniter
-
-import (
- "encoding"
- "encoding/json"
- "reflect"
- "sort"
- "strconv"
- "unsafe"
-)
-
-func decoderOfMap(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- decoder := decoderOfType(cfg, prefix+"[map]->", typ.Elem())
- mapInterface := reflect.New(typ).Interface()
- return &mapDecoder{typ, typ.Key(), typ.Elem(), decoder, extractInterface(mapInterface)}
-}
-
-func encoderOfMap(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- elemType := typ.Elem()
- encoder := encoderOfType(cfg, prefix+"[map]->", elemType)
- mapInterface := reflect.New(typ).Elem().Interface()
- if cfg.sortMapKeys {
- return &sortKeysMapEncoder{typ, elemType, encoder, *((*emptyInterface)(unsafe.Pointer(&mapInterface)))}
- }
- return &mapEncoder{typ, elemType, encoder, *((*emptyInterface)(unsafe.Pointer(&mapInterface)))}
-}
-
-type mapDecoder struct {
- mapType reflect.Type
- keyType reflect.Type
- elemType reflect.Type
- elemDecoder ValDecoder
- mapInterface emptyInterface
-}
-
-func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- // dark magic to cast unsafe.Pointer back to interface{} using reflect.Type
- mapInterface := decoder.mapInterface
- mapInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
- realVal := reflect.ValueOf(*realInterface).Elem()
- if iter.ReadNil() {
- realVal.Set(reflect.Zero(decoder.mapType))
- return
- }
- if realVal.IsNil() {
- realVal.Set(reflect.MakeMap(realVal.Type()))
- }
- iter.ReadMapCB(func(iter *Iterator, keyStr string) bool {
- elem := reflect.New(decoder.elemType)
- decoder.elemDecoder.Decode(extractInterface(elem.Interface()).word, iter)
- // to put into map, we have to use reflection
- keyType := decoder.keyType
- // TODO: remove this from loop
- switch {
- case keyType.Kind() == reflect.String:
- realVal.SetMapIndex(reflect.ValueOf(keyStr).Convert(keyType), elem.Elem())
- return true
- case keyType.Implements(textUnmarshalerType):
- textUnmarshaler := reflect.New(keyType.Elem()).Interface().(encoding.TextUnmarshaler)
- err := textUnmarshaler.UnmarshalText([]byte(keyStr))
- if err != nil {
- iter.ReportError("read map key as TextUnmarshaler", err.Error())
- return false
- }
- realVal.SetMapIndex(reflect.ValueOf(textUnmarshaler), elem.Elem())
- return true
- case reflect.PtrTo(keyType).Implements(textUnmarshalerType):
- textUnmarshaler := reflect.New(keyType).Interface().(encoding.TextUnmarshaler)
- err := textUnmarshaler.UnmarshalText([]byte(keyStr))
- if err != nil {
- iter.ReportError("read map key as TextUnmarshaler", err.Error())
- return false
- }
- realVal.SetMapIndex(reflect.ValueOf(textUnmarshaler).Elem(), elem.Elem())
- return true
- default:
- switch keyType.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- n, err := strconv.ParseInt(keyStr, 10, 64)
- if err != nil || reflect.Zero(keyType).OverflowInt(n) {
- iter.ReportError("read map key as int64", "read int64 failed")
- return false
- }
- realVal.SetMapIndex(reflect.ValueOf(n).Convert(keyType), elem.Elem())
- return true
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- n, err := strconv.ParseUint(keyStr, 10, 64)
- if err != nil || reflect.Zero(keyType).OverflowUint(n) {
- iter.ReportError("read map key as uint64", "read uint64 failed")
- return false
- }
- realVal.SetMapIndex(reflect.ValueOf(n).Convert(keyType), elem.Elem())
- return true
- }
- }
- iter.ReportError("read map key", "unexpected map key type "+keyType.String())
- return true
- })
-}
-
-type mapEncoder struct {
- mapType reflect.Type
- elemType reflect.Type
- elemEncoder ValEncoder
- mapInterface emptyInterface
-}
-
-func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- mapInterface := encoder.mapInterface
- mapInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
- realVal := reflect.ValueOf(*realInterface)
- stream.WriteObjectStart()
- for i, key := range realVal.MapKeys() {
- if i != 0 {
- stream.WriteMore()
- }
- encodeMapKey(key, stream)
- if stream.indention > 0 {
- stream.writeTwoBytes(byte(':'), byte(' '))
- } else {
- stream.writeByte(':')
- }
- val := realVal.MapIndex(key).Interface()
- encoder.elemEncoder.EncodeInterface(val, stream)
- }
- stream.WriteObjectEnd()
-}
-
-func encodeMapKey(key reflect.Value, stream *Stream) {
- if key.Kind() == reflect.String {
- stream.WriteString(key.String())
- return
- }
- if tm, ok := key.Interface().(encoding.TextMarshaler); ok {
- buf, err := tm.MarshalText()
- if err != nil {
- stream.Error = err
- return
- }
- stream.writeByte('"')
- stream.Write(buf)
- stream.writeByte('"')
- return
- }
- switch key.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- stream.writeByte('"')
- stream.WriteInt64(key.Int())
- stream.writeByte('"')
- return
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- stream.writeByte('"')
- stream.WriteUint64(key.Uint())
- stream.writeByte('"')
- return
- }
- stream.Error = &json.UnsupportedTypeError{Type: key.Type()}
-}
-
-func (encoder *mapEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- mapInterface := encoder.mapInterface
- mapInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
- realVal := reflect.ValueOf(*realInterface)
- return realVal.Len() == 0
-}
-
-type sortKeysMapEncoder struct {
- mapType reflect.Type
- elemType reflect.Type
- elemEncoder ValEncoder
- mapInterface emptyInterface
-}
-
-func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- mapInterface := encoder.mapInterface
- mapInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
- realVal := reflect.ValueOf(*realInterface)
-
- // Extract and sort the keys.
- keys := realVal.MapKeys()
- sv := stringValues(make([]reflectWithString, len(keys)))
- for i, v := range keys {
- sv[i].v = v
- if err := sv[i].resolve(); err != nil {
- stream.Error = err
- return
- }
- }
- sort.Sort(sv)
-
- stream.WriteObjectStart()
- for i, key := range sv {
- if i != 0 {
- stream.WriteMore()
- }
- stream.WriteVal(key.s) // might need html escape, so can not WriteString directly
- if stream.indention > 0 {
- stream.writeTwoBytes(byte(':'), byte(' '))
- } else {
- stream.writeByte(':')
- }
- val := realVal.MapIndex(key.v).Interface()
- encoder.elemEncoder.EncodeInterface(val, stream)
- }
- stream.WriteObjectEnd()
-}
-
-// stringValues is a slice of reflect.Value holding *reflect.StringValue.
-// It implements the methods to sort by string.
-type stringValues []reflectWithString
-
-type reflectWithString struct {
- v reflect.Value
- s string
-}
-
-func (w *reflectWithString) resolve() error {
- if w.v.Kind() == reflect.String {
- w.s = w.v.String()
- return nil
- }
- if tm, ok := w.v.Interface().(encoding.TextMarshaler); ok {
- buf, err := tm.MarshalText()
- w.s = string(buf)
- return err
- }
- switch w.v.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- w.s = strconv.FormatInt(w.v.Int(), 10)
- return nil
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- w.s = strconv.FormatUint(w.v.Uint(), 10)
- return nil
- }
- return &json.UnsupportedTypeError{Type: w.v.Type()}
-}
-
-func (sv stringValues) Len() int { return len(sv) }
-func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
-func (sv stringValues) Less(i, j int) bool { return sv[i].s < sv[j].s }
-
-func (encoder *sortKeysMapEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- mapInterface := encoder.mapInterface
- mapInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&mapInterface))
- realVal := reflect.ValueOf(*realInterface)
- return realVal.Len() == 0
-}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_native.go b/vendor/github.com/json-iterator/go/feature_reflect_native.go
deleted file mode 100644
index 464a8f7a6..000000000
--- a/vendor/github.com/json-iterator/go/feature_reflect_native.go
+++ /dev/null
@@ -1,789 +0,0 @@
-package jsoniter
-
-import (
- "encoding"
- "encoding/base64"
- "encoding/json"
- "reflect"
- "unsafe"
-)
-
-type stringCodec struct {
-}
-
-func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*string)(ptr)) = iter.ReadString()
-}
-
-func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- str := *((*string)(ptr))
- stream.WriteString(str)
-}
-
-func (codec *stringCodec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*string)(ptr)) == ""
-}
-
-type intCodec struct {
-}
-
-func (codec *intCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int)(ptr)) = iter.ReadInt()
- }
-}
-
-func (codec *intCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt(*((*int)(ptr)))
-}
-
-func (codec *intCodec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *intCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int)(ptr)) == 0
-}
-
-type uintptrCodec struct {
-}
-
-func (codec *uintptrCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uintptr)(ptr)) = uintptr(iter.ReadUint64())
- }
-}
-
-func (codec *uintptrCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint64(uint64(*((*uintptr)(ptr))))
-}
-
-func (codec *uintptrCodec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uintptrCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uintptr)(ptr)) == 0
-}
-
-type int8Codec struct {
-}
-
-func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int8)(ptr)) = iter.ReadInt8()
- }
-}
-
-func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt8(*((*int8)(ptr)))
-}
-
-func (codec *int8Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int8)(ptr)) == 0
-}
-
-type int16Codec struct {
-}
-
-func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int16)(ptr)) = iter.ReadInt16()
- }
-}
-
-func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt16(*((*int16)(ptr)))
-}
-
-func (codec *int16Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int16)(ptr)) == 0
-}
-
-type int32Codec struct {
-}
-
-func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int32)(ptr)) = iter.ReadInt32()
- }
-}
-
-func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt32(*((*int32)(ptr)))
-}
-
-func (codec *int32Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int32)(ptr)) == 0
-}
-
-type int64Codec struct {
-}
-
-func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*int64)(ptr)) = iter.ReadInt64()
- }
-}
-
-func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteInt64(*((*int64)(ptr)))
-}
-
-func (codec *int64Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*int64)(ptr)) == 0
-}
-
-type uintCodec struct {
-}
-
-func (codec *uintCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint)(ptr)) = iter.ReadUint()
- return
- }
-}
-
-func (codec *uintCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint(*((*uint)(ptr)))
-}
-
-func (codec *uintCodec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uintCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint)(ptr)) == 0
-}
-
-type uint8Codec struct {
-}
-
-func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint8)(ptr)) = iter.ReadUint8()
- }
-}
-
-func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint8(*((*uint8)(ptr)))
-}
-
-func (codec *uint8Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint8)(ptr)) == 0
-}
-
-type uint16Codec struct {
-}
-
-func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint16)(ptr)) = iter.ReadUint16()
- }
-}
-
-func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint16(*((*uint16)(ptr)))
-}
-
-func (codec *uint16Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint16)(ptr)) == 0
-}
-
-type uint32Codec struct {
-}
-
-func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint32)(ptr)) = iter.ReadUint32()
- }
-}
-
-func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint32(*((*uint32)(ptr)))
-}
-
-func (codec *uint32Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint32)(ptr)) == 0
-}
-
-type uint64Codec struct {
-}
-
-func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*uint64)(ptr)) = iter.ReadUint64()
- }
-}
-
-func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteUint64(*((*uint64)(ptr)))
-}
-
-func (codec *uint64Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*uint64)(ptr)) == 0
-}
-
-type float32Codec struct {
-}
-
-func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*float32)(ptr)) = iter.ReadFloat32()
- }
-}
-
-func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat32(*((*float32)(ptr)))
-}
-
-func (codec *float32Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float32)(ptr)) == 0
-}
-
-type float64Codec struct {
-}
-
-func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*float64)(ptr)) = iter.ReadFloat64()
- }
-}
-
-func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteFloat64(*((*float64)(ptr)))
-}
-
-func (codec *float64Codec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return *((*float64)(ptr)) == 0
-}
-
-type boolCodec struct {
-}
-
-func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if !iter.ReadNil() {
- *((*bool)(ptr)) = iter.ReadBool()
- }
-}
-
-func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteBool(*((*bool)(ptr)))
-}
-
-func (codec *boolCodec) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, codec)
-}
-
-func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return !(*((*bool)(ptr)))
-}
-
-type emptyInterfaceCodec struct {
-}
-
-func (codec *emptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- existing := *((*interface{})(ptr))
-
- // Checking for both typed and untyped nil pointers.
- if existing != nil &&
- reflect.TypeOf(existing).Kind() == reflect.Ptr &&
- !reflect.ValueOf(existing).IsNil() {
-
- var ptrToExisting interface{}
- for {
- elem := reflect.ValueOf(existing).Elem()
- if elem.Kind() != reflect.Ptr || elem.IsNil() {
- break
- }
- ptrToExisting = existing
- existing = elem.Interface()
- }
-
- if iter.ReadNil() {
- if ptrToExisting != nil {
- nilPtr := reflect.Zero(reflect.TypeOf(ptrToExisting).Elem())
- reflect.ValueOf(ptrToExisting).Elem().Set(nilPtr)
- } else {
- *((*interface{})(ptr)) = nil
- }
- } else {
- iter.ReadVal(existing)
- }
-
- return
- }
-
- if iter.ReadNil() {
- *((*interface{})(ptr)) = nil
- } else {
- *((*interface{})(ptr)) = iter.Read()
- }
-}
-
-func (codec *emptyInterfaceCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteVal(*((*interface{})(ptr)))
-}
-
-func (codec *emptyInterfaceCodec) EncodeInterface(val interface{}, stream *Stream) {
- stream.WriteVal(val)
-}
-
-func (codec *emptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
- emptyInterface := (*emptyInterface)(ptr)
- return emptyInterface.typ == nil
-}
-
-type nonEmptyInterfaceCodec struct {
-}
-
-func (codec *nonEmptyInterfaceCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.WhatIsNext() == NilValue {
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *((*interface{})(ptr)) = nil
- return
- }
- nonEmptyInterface := (*nonEmptyInterface)(ptr)
- if nonEmptyInterface.itab == nil {
- iter.ReportError("read non-empty interface", "do not know which concrete type to decode to")
- return
- }
- var i interface{}
- e := (*emptyInterface)(unsafe.Pointer(&i))
- e.typ = nonEmptyInterface.itab.typ
- e.word = nonEmptyInterface.word
- iter.ReadVal(&i)
- if e.word == nil {
- nonEmptyInterface.itab = nil
- }
- nonEmptyInterface.word = e.word
-}
-
-func (codec *nonEmptyInterfaceCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- nonEmptyInterface := (*nonEmptyInterface)(ptr)
- var i interface{}
- if nonEmptyInterface.itab != nil {
- e := (*emptyInterface)(unsafe.Pointer(&i))
- e.typ = nonEmptyInterface.itab.typ
- e.word = nonEmptyInterface.word
- }
- stream.WriteVal(i)
-}
-
-func (codec *nonEmptyInterfaceCodec) EncodeInterface(val interface{}, stream *Stream) {
- stream.WriteVal(val)
-}
-
-func (codec *nonEmptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
- nonEmptyInterface := (*nonEmptyInterface)(ptr)
- return nonEmptyInterface.word == nil
-}
-
-type anyCodec struct {
-}
-
-func (codec *anyCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*Any)(ptr)) = iter.ReadAny()
-}
-
-func (codec *anyCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- (*((*Any)(ptr))).WriteTo(stream)
-}
-
-func (codec *anyCodec) EncodeInterface(val interface{}, stream *Stream) {
- (val.(Any)).WriteTo(stream)
-}
-
-func (codec *anyCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return (*((*Any)(ptr))).Size() == 0
-}
-
-type jsonNumberCodec struct {
-}
-
-func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- switch iter.WhatIsNext() {
- case StringValue:
- *((*json.Number)(ptr)) = json.Number(iter.ReadString())
- case NilValue:
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *((*json.Number)(ptr)) = ""
- default:
- *((*json.Number)(ptr)) = json.Number([]byte(iter.readNumberAsString()))
- }
-}
-
-func (codec *jsonNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- number := *((*json.Number)(ptr))
- if len(number) == 0 {
- stream.WriteRaw("0")
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsonNumberCodec) EncodeInterface(val interface{}, stream *Stream) {
- number := val.(json.Number)
- if len(number) == 0 {
- stream.WriteRaw("0")
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*json.Number)(ptr))) == 0
-}
-
-type jsoniterNumberCodec struct {
-}
-
-func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- switch iter.WhatIsNext() {
- case StringValue:
- *((*Number)(ptr)) = Number(iter.ReadString())
- case NilValue:
- iter.skipFourBytes('n', 'u', 'l', 'l')
- *((*Number)(ptr)) = ""
- default:
- *((*Number)(ptr)) = Number([]byte(iter.readNumberAsString()))
- }
-}
-
-func (codec *jsoniterNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- number := *((*Number)(ptr))
- if len(number) == 0 {
- stream.WriteRaw("0")
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsoniterNumberCodec) EncodeInterface(val interface{}, stream *Stream) {
- number := val.(Number)
- if len(number) == 0 {
- stream.WriteRaw("0")
- } else {
- stream.WriteRaw(string(number))
- }
-}
-
-func (codec *jsoniterNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*Number)(ptr))) == 0
-}
-
-type jsonRawMessageCodec struct {
-}
-
-func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
-}
-
-func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
-}
-
-func (codec *jsonRawMessageCodec) EncodeInterface(val interface{}, stream *Stream) {
- stream.WriteRaw(string(val.(json.RawMessage)))
-}
-
-func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*json.RawMessage)(ptr))) == 0
-}
-
-type jsoniterRawMessageCodec struct {
-}
-
-func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
-}
-
-func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.WriteRaw(string(*((*RawMessage)(ptr))))
-}
-
-func (codec *jsoniterRawMessageCodec) EncodeInterface(val interface{}, stream *Stream) {
- stream.WriteRaw(string(val.(RawMessage)))
-}
-
-func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*RawMessage)(ptr))) == 0
-}
-
-type base64Codec struct {
- sliceDecoder ValDecoder
-}
-
-func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
- if iter.ReadNil() {
- ptrSlice := (*sliceHeader)(ptr)
- ptrSlice.Len = 0
- ptrSlice.Cap = 0
- ptrSlice.Data = nil
- return
- }
- switch iter.WhatIsNext() {
- case StringValue:
- encoding := base64.StdEncoding
- src := iter.SkipAndReturnBytes()
- src = src[1 : len(src)-1]
- decodedLen := encoding.DecodedLen(len(src))
- dst := make([]byte, decodedLen)
- len, err := encoding.Decode(dst, src)
- if err != nil {
- iter.ReportError("decode base64", err.Error())
- } else {
- dst = dst[:len]
- dstSlice := (*sliceHeader)(unsafe.Pointer(&dst))
- ptrSlice := (*sliceHeader)(ptr)
- ptrSlice.Data = dstSlice.Data
- ptrSlice.Cap = dstSlice.Cap
- ptrSlice.Len = dstSlice.Len
- }
- case ArrayValue:
- codec.sliceDecoder.Decode(ptr, iter)
- default:
- iter.ReportError("base64Codec", "invalid input")
- }
-}
-
-func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
- src := *((*[]byte)(ptr))
- if len(src) == 0 {
- stream.WriteNil()
- return
- }
- encoding := base64.StdEncoding
- stream.writeByte('"')
- toGrow := encoding.EncodedLen(len(src))
- stream.ensure(toGrow)
- encoding.Encode(stream.buf[stream.n:], src)
- stream.n += toGrow
- stream.writeByte('"')
-}
-
-func (codec *base64Codec) EncodeInterface(val interface{}, stream *Stream) {
- ptr := extractInterface(val).word
- src := *((*[]byte)(ptr))
- if len(src) == 0 {
- stream.WriteNil()
- return
- }
- encoding := base64.StdEncoding
- stream.writeByte('"')
- toGrow := encoding.EncodedLen(len(src))
- stream.ensure(toGrow)
- encoding.Encode(stream.buf[stream.n:], src)
- stream.n += toGrow
- stream.writeByte('"')
-}
-
-func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool {
- return len(*((*[]byte)(ptr))) == 0
-}
-
-type stringModeNumberDecoder struct {
- elemDecoder ValDecoder
-}
-
-func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- c := iter.nextToken()
- if c != '"' {
- iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
- return
- }
- decoder.elemDecoder.Decode(ptr, iter)
- if iter.Error != nil {
- return
- }
- c = iter.readByte()
- if c != '"' {
- iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
- return
- }
-}
-
-type stringModeStringDecoder struct {
- elemDecoder ValDecoder
- cfg *frozenConfig
-}
-
-func (decoder *stringModeStringDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.elemDecoder.Decode(ptr, iter)
- str := *((*string)(ptr))
- tempIter := decoder.cfg.BorrowIterator([]byte(str))
- defer decoder.cfg.ReturnIterator(tempIter)
- *((*string)(ptr)) = tempIter.ReadString()
-}
-
-type stringModeNumberEncoder struct {
- elemEncoder ValEncoder
-}
-
-func (encoder *stringModeNumberEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- stream.writeByte('"')
- encoder.elemEncoder.Encode(ptr, stream)
- stream.writeByte('"')
-}
-
-func (encoder *stringModeNumberEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *stringModeNumberEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.elemEncoder.IsEmpty(ptr)
-}
-
-type stringModeStringEncoder struct {
- elemEncoder ValEncoder
- cfg *frozenConfig
-}
-
-func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- tempStream := encoder.cfg.BorrowStream(nil)
- defer encoder.cfg.ReturnStream(tempStream)
- encoder.elemEncoder.Encode(ptr, tempStream)
- stream.WriteString(string(tempStream.Buffer()))
-}
-
-func (encoder *stringModeStringEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *stringModeStringEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.elemEncoder.IsEmpty(ptr)
-}
-
-type marshalerEncoder struct {
- templateInterface emptyInterface
- checkIsEmpty checkIsEmpty
-}
-
-func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- templateInterface := encoder.templateInterface
- templateInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&templateInterface))
- marshaler, ok := (*realInterface).(json.Marshaler)
- if !ok {
- stream.WriteVal(nil)
- return
- }
-
- bytes, err := marshaler.MarshalJSON()
- if err != nil {
- stream.Error = err
- } else {
- stream.Write(bytes)
- }
-}
-func (encoder *marshalerEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *marshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type textMarshalerEncoder struct {
- templateInterface emptyInterface
- checkIsEmpty checkIsEmpty
-}
-
-func (encoder *textMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- templateInterface := encoder.templateInterface
- templateInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&templateInterface))
- marshaler := (*realInterface).(encoding.TextMarshaler)
- bytes, err := marshaler.MarshalText()
- if err != nil {
- stream.Error = err
- } else {
- stream.WriteString(string(bytes))
- }
-}
-
-func (encoder *textMarshalerEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *textMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.checkIsEmpty.IsEmpty(ptr)
-}
-
-type unmarshalerDecoder struct {
- templateInterface emptyInterface
-}
-
-func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- templateInterface := decoder.templateInterface
- templateInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&templateInterface))
- unmarshaler := (*realInterface).(json.Unmarshaler)
- iter.nextToken()
- iter.unreadByte() // skip spaces
- bytes := iter.SkipAndReturnBytes()
- err := unmarshaler.UnmarshalJSON(bytes)
- if err != nil {
- iter.ReportError("unmarshalerDecoder", err.Error())
- }
-}
-
-type textUnmarshalerDecoder struct {
- templateInterface emptyInterface
-}
-
-func (decoder *textUnmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- templateInterface := decoder.templateInterface
- templateInterface.word = ptr
- realInterface := (*interface{})(unsafe.Pointer(&templateInterface))
- unmarshaler := (*realInterface).(encoding.TextUnmarshaler)
- str := iter.ReadString()
- err := unmarshaler.UnmarshalText([]byte(str))
- if err != nil {
- iter.ReportError("textUnmarshalerDecoder", err.Error())
- }
-}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_slice.go b/vendor/github.com/json-iterator/go/feature_reflect_slice.go
deleted file mode 100644
index 078b3bc07..000000000
--- a/vendor/github.com/json-iterator/go/feature_reflect_slice.go
+++ /dev/null
@@ -1,143 +0,0 @@
-package jsoniter
-
-import (
- "fmt"
- "io"
- "reflect"
- "unsafe"
-)
-
-func decoderOfSlice(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- decoder := decoderOfType(cfg, prefix+"[slice]->", typ.Elem())
- return &sliceDecoder{typ, typ.Elem(), decoder}
-}
-
-func encoderOfSlice(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- encoder := encoderOfType(cfg, prefix+"[slice]->", typ.Elem())
- if typ.Elem().Kind() == reflect.Map {
- encoder = &OptionalEncoder{encoder}
- }
- return &sliceEncoder{typ, typ.Elem(), encoder}
-}
-
-type sliceEncoder struct {
- sliceType reflect.Type
- elemType reflect.Type
- elemEncoder ValEncoder
-}
-
-func (encoder *sliceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- slice := (*sliceHeader)(ptr)
- if slice.Data == nil {
- stream.WriteNil()
- return
- }
- if slice.Len == 0 {
- stream.WriteEmptyArray()
- return
- }
- stream.WriteArrayStart()
- elemPtr := unsafe.Pointer(slice.Data)
- encoder.elemEncoder.Encode(unsafe.Pointer(elemPtr), stream)
- for i := 1; i < slice.Len; i++ {
- stream.WriteMore()
- elemPtr = unsafe.Pointer(uintptr(elemPtr) + encoder.elemType.Size())
- encoder.elemEncoder.Encode(unsafe.Pointer(elemPtr), stream)
- }
- stream.WriteArrayEnd()
- if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%v: %s", encoder.sliceType, stream.Error.Error())
- }
-}
-
-func (encoder *sliceEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
-func (encoder *sliceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- slice := (*sliceHeader)(ptr)
- return slice.Len == 0
-}
-
-type sliceDecoder struct {
- sliceType reflect.Type
- elemType reflect.Type
- elemDecoder ValDecoder
-}
-
-// sliceHeader is a safe version of SliceHeader used within this package.
-type sliceHeader struct {
- Data unsafe.Pointer
- Len int
- Cap int
-}
-
-func (decoder *sliceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- decoder.doDecode(ptr, iter)
- if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%v: %s", decoder.sliceType, iter.Error.Error())
- }
-}
-
-func (decoder *sliceDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
- slice := (*sliceHeader)(ptr)
- if iter.ReadNil() {
- slice.Len = 0
- slice.Cap = 0
- slice.Data = nil
- return
- }
- reuseSlice(slice, decoder.sliceType, 4)
- slice.Len = 0
- offset := uintptr(0)
- iter.ReadArrayCB(func(iter *Iterator) bool {
- growOne(slice, decoder.sliceType, decoder.elemType)
- decoder.elemDecoder.Decode(unsafe.Pointer(uintptr(slice.Data)+offset), iter)
- offset += decoder.elemType.Size()
- return true
- })
-}
-
-// grow grows the slice s so that it can hold extra more values, allocating
-// more capacity if needed. It also returns the old and new slice lengths.
-func growOne(slice *sliceHeader, sliceType reflect.Type, elementType reflect.Type) {
- newLen := slice.Len + 1
- if newLen <= slice.Cap {
- slice.Len = newLen
- return
- }
- newCap := slice.Cap
- if newCap == 0 {
- newCap = 1
- } else {
- for newCap < newLen {
- if slice.Len < 1024 {
- newCap += newCap
- } else {
- newCap += newCap / 4
- }
- }
- }
- newVal := reflect.MakeSlice(sliceType, newLen, newCap).Interface()
- newValPtr := extractInterface(newVal).word
- dst := (*sliceHeader)(newValPtr).Data
- // copy old array into new array
- originalBytesCount := slice.Len * int(elementType.Size())
- srcSliceHeader := (unsafe.Pointer)(&sliceHeader{slice.Data, originalBytesCount, originalBytesCount})
- dstSliceHeader := (unsafe.Pointer)(&sliceHeader{dst, originalBytesCount, originalBytesCount})
- copy(*(*[]byte)(dstSliceHeader), *(*[]byte)(srcSliceHeader))
- slice.Data = dst
- slice.Len = newLen
- slice.Cap = newCap
-}
-
-func reuseSlice(slice *sliceHeader, sliceType reflect.Type, expectedCap int) {
- if expectedCap <= slice.Cap {
- return
- }
- newVal := reflect.MakeSlice(sliceType, 0, expectedCap).Interface()
- newValPtr := extractInterface(newVal).word
- dst := (*sliceHeader)(newValPtr).Data
- slice.Data = dst
- slice.Cap = expectedCap
-}
diff --git a/vendor/github.com/json-iterator/go/feature_stream_int.go b/vendor/github.com/json-iterator/go/feature_stream_int.go
deleted file mode 100644
index 7cfd522c1..000000000
--- a/vendor/github.com/json-iterator/go/feature_stream_int.go
+++ /dev/null
@@ -1,320 +0,0 @@
-package jsoniter
-
-var digits []uint32
-
-func init() {
- digits = make([]uint32, 1000)
- for i := uint32(0); i < 1000; i++ {
- digits[i] = (((i / 100) + '0') << 16) + ((((i / 10) % 10) + '0') << 8) + i%10 + '0'
- if i < 10 {
- digits[i] += 2 << 24
- } else if i < 100 {
- digits[i] += 1 << 24
- }
- }
-}
-
-func writeFirstBuf(buf []byte, v uint32, n int) int {
- start := v >> 24
- if start == 0 {
- buf[n] = byte(v >> 16)
- n++
- buf[n] = byte(v >> 8)
- n++
- } else if start == 1 {
- buf[n] = byte(v >> 8)
- n++
- }
- buf[n] = byte(v)
- n++
- return n
-}
-
-func writeBuf(buf []byte, v uint32, n int) {
- buf[n] = byte(v >> 16)
- buf[n+1] = byte(v >> 8)
- buf[n+2] = byte(v)
-}
-
-// WriteUint8 write uint8 to stream
-func (stream *Stream) WriteUint8(val uint8) {
- stream.ensure(3)
- stream.n = writeFirstBuf(stream.buf, digits[val], stream.n)
-}
-
-// WriteInt8 write int8 to stream
-func (stream *Stream) WriteInt8(nval int8) {
- stream.ensure(4)
- n := stream.n
- var val uint8
- if nval < 0 {
- val = uint8(-nval)
- stream.buf[n] = '-'
- n++
- } else {
- val = uint8(nval)
- }
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
-}
-
-// WriteUint16 write uint16 to stream
-func (stream *Stream) WriteUint16(val uint16) {
- stream.ensure(5)
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], stream.n)
- return
- }
- r1 := val - q1*1000
- n := writeFirstBuf(stream.buf, digits[q1], stream.n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
-}
-
-// WriteInt16 write int16 to stream
-func (stream *Stream) WriteInt16(nval int16) {
- stream.ensure(6)
- n := stream.n
- var val uint16
- if nval < 0 {
- val = uint16(-nval)
- stream.buf[n] = '-'
- n++
- } else {
- val = uint16(nval)
- }
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
- return
- }
- r1 := val - q1*1000
- n = writeFirstBuf(stream.buf, digits[q1], n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
-}
-
-// WriteUint32 write uint32 to stream
-func (stream *Stream) WriteUint32(val uint32) {
- stream.ensure(10)
- n := stream.n
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- n := writeFirstBuf(stream.buf, digits[q1], n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- n = writeFirstBuf(stream.buf, digits[q2], n)
- } else {
- r3 := q2 - q3*1000
- stream.buf[n] = byte(q3 + '0')
- n++
- writeBuf(stream.buf, digits[r3], n)
- n += 3
- }
- writeBuf(stream.buf, digits[r2], n)
- writeBuf(stream.buf, digits[r1], n+3)
- stream.n = n + 6
-}
-
-// WriteInt32 write int32 to stream
-func (stream *Stream) WriteInt32(nval int32) {
- stream.ensure(11)
- n := stream.n
- var val uint32
- if nval < 0 {
- val = uint32(-nval)
- stream.buf[n] = '-'
- n++
- } else {
- val = uint32(nval)
- }
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- n := writeFirstBuf(stream.buf, digits[q1], n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- n = writeFirstBuf(stream.buf, digits[q2], n)
- } else {
- r3 := q2 - q3*1000
- stream.buf[n] = byte(q3 + '0')
- n++
- writeBuf(stream.buf, digits[r3], n)
- n += 3
- }
- writeBuf(stream.buf, digits[r2], n)
- writeBuf(stream.buf, digits[r1], n+3)
- stream.n = n + 6
-}
-
-// WriteUint64 write uint64 to stream
-func (stream *Stream) WriteUint64(val uint64) {
- stream.ensure(20)
- n := stream.n
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- n := writeFirstBuf(stream.buf, digits[q1], n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- n = writeFirstBuf(stream.buf, digits[q2], n)
- writeBuf(stream.buf, digits[r2], n)
- writeBuf(stream.buf, digits[r1], n+3)
- stream.n = n + 6
- return
- }
- r3 := q2 - q3*1000
- q4 := q3 / 1000
- if q4 == 0 {
- n = writeFirstBuf(stream.buf, digits[q3], n)
- writeBuf(stream.buf, digits[r3], n)
- writeBuf(stream.buf, digits[r2], n+3)
- writeBuf(stream.buf, digits[r1], n+6)
- stream.n = n + 9
- return
- }
- r4 := q3 - q4*1000
- q5 := q4 / 1000
- if q5 == 0 {
- n = writeFirstBuf(stream.buf, digits[q4], n)
- writeBuf(stream.buf, digits[r4], n)
- writeBuf(stream.buf, digits[r3], n+3)
- writeBuf(stream.buf, digits[r2], n+6)
- writeBuf(stream.buf, digits[r1], n+9)
- stream.n = n + 12
- return
- }
- r5 := q4 - q5*1000
- q6 := q5 / 1000
- if q6 == 0 {
- n = writeFirstBuf(stream.buf, digits[q5], n)
- } else {
- n = writeFirstBuf(stream.buf, digits[q6], n)
- r6 := q5 - q6*1000
- writeBuf(stream.buf, digits[r6], n)
- n += 3
- }
- writeBuf(stream.buf, digits[r5], n)
- writeBuf(stream.buf, digits[r4], n+3)
- writeBuf(stream.buf, digits[r3], n+6)
- writeBuf(stream.buf, digits[r2], n+9)
- writeBuf(stream.buf, digits[r1], n+12)
- stream.n = n + 15
-}
-
-// WriteInt64 write int64 to stream
-func (stream *Stream) WriteInt64(nval int64) {
- stream.ensure(20)
- n := stream.n
- var val uint64
- if nval < 0 {
- val = uint64(-nval)
- stream.buf[n] = '-'
- n++
- } else {
- val = uint64(nval)
- }
- q1 := val / 1000
- if q1 == 0 {
- stream.n = writeFirstBuf(stream.buf, digits[val], n)
- return
- }
- r1 := val - q1*1000
- q2 := q1 / 1000
- if q2 == 0 {
- n := writeFirstBuf(stream.buf, digits[q1], n)
- writeBuf(stream.buf, digits[r1], n)
- stream.n = n + 3
- return
- }
- r2 := q1 - q2*1000
- q3 := q2 / 1000
- if q3 == 0 {
- n = writeFirstBuf(stream.buf, digits[q2], n)
- writeBuf(stream.buf, digits[r2], n)
- writeBuf(stream.buf, digits[r1], n+3)
- stream.n = n + 6
- return
- }
- r3 := q2 - q3*1000
- q4 := q3 / 1000
- if q4 == 0 {
- n = writeFirstBuf(stream.buf, digits[q3], n)
- writeBuf(stream.buf, digits[r3], n)
- writeBuf(stream.buf, digits[r2], n+3)
- writeBuf(stream.buf, digits[r1], n+6)
- stream.n = n + 9
- return
- }
- r4 := q3 - q4*1000
- q5 := q4 / 1000
- if q5 == 0 {
- n = writeFirstBuf(stream.buf, digits[q4], n)
- writeBuf(stream.buf, digits[r4], n)
- writeBuf(stream.buf, digits[r3], n+3)
- writeBuf(stream.buf, digits[r2], n+6)
- writeBuf(stream.buf, digits[r1], n+9)
- stream.n = n + 12
- return
- }
- r5 := q4 - q5*1000
- q6 := q5 / 1000
- if q6 == 0 {
- n = writeFirstBuf(stream.buf, digits[q5], n)
- } else {
- stream.buf[n] = byte(q6 + '0')
- n++
- r6 := q5 - q6*1000
- writeBuf(stream.buf, digits[r6], n)
- n += 3
- }
- writeBuf(stream.buf, digits[r5], n)
- writeBuf(stream.buf, digits[r4], n+3)
- writeBuf(stream.buf, digits[r3], n+6)
- writeBuf(stream.buf, digits[r2], n+9)
- writeBuf(stream.buf, digits[r1], n+12)
- stream.n = n + 15
-}
-
-// WriteInt write int to stream
-func (stream *Stream) WriteInt(val int) {
- stream.WriteInt64(int64(val))
-}
-
-// WriteUint write uint to stream
-func (stream *Stream) WriteUint(val uint) {
- stream.WriteUint64(uint64(val))
-}
diff --git a/vendor/github.com/json-iterator/go/feature_iter.go b/vendor/github.com/json-iterator/go/iter.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_iter.go
rename to vendor/github.com/json-iterator/go/iter.go
diff --git a/vendor/github.com/json-iterator/go/feature_iter_array.go b/vendor/github.com/json-iterator/go/iter_array.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_iter_array.go
rename to vendor/github.com/json-iterator/go/iter_array.go
diff --git a/vendor/github.com/json-iterator/go/feature_iter_float.go b/vendor/github.com/json-iterator/go/iter_float.go
similarity index 96%
rename from vendor/github.com/json-iterator/go/feature_iter_float.go
rename to vendor/github.com/json-iterator/go/iter_float.go
index 4f883c095..b9754638e 100644
--- a/vendor/github.com/json-iterator/go/feature_iter_float.go
+++ b/vendor/github.com/json-iterator/go/iter_float.go
@@ -77,14 +77,12 @@ func (iter *Iterator) ReadFloat32() (ret float32) {
}
func (iter *Iterator) readPositiveFloat32() (ret float32) {
- value := uint64(0)
- c := byte(' ')
i := iter.head
// first char
if i == iter.tail {
return iter.readFloat32SlowPath()
}
- c = iter.buf[i]
+ c := iter.buf[i]
i++
ind := floatDigits[c]
switch ind {
@@ -107,7 +105,7 @@ func (iter *Iterator) readPositiveFloat32() (ret float32) {
return
}
}
- value = uint64(ind)
+ value := uint64(ind)
// chars before dot
non_decimal_loop:
for ; i < iter.tail; i++ {
@@ -145,9 +143,7 @@ non_decimal_loop:
}
// too many decimal places
return iter.readFloat32SlowPath()
- case invalidCharForNumber:
- fallthrough
- case dotInNumber:
+ case invalidCharForNumber, dotInNumber:
return iter.readFloat32SlowPath()
}
decimalPlaces++
@@ -218,14 +214,12 @@ func (iter *Iterator) ReadFloat64() (ret float64) {
}
func (iter *Iterator) readPositiveFloat64() (ret float64) {
- value := uint64(0)
- c := byte(' ')
i := iter.head
// first char
if i == iter.tail {
return iter.readFloat64SlowPath()
}
- c = iter.buf[i]
+ c := iter.buf[i]
i++
ind := floatDigits[c]
switch ind {
@@ -248,7 +242,7 @@ func (iter *Iterator) readPositiveFloat64() (ret float64) {
return
}
}
- value = uint64(ind)
+ value := uint64(ind)
// chars before dot
non_decimal_loop:
for ; i < iter.tail; i++ {
@@ -286,9 +280,7 @@ non_decimal_loop:
}
// too many decimal places
return iter.readFloat64SlowPath()
- case invalidCharForNumber:
- fallthrough
- case dotInNumber:
+ case invalidCharForNumber, dotInNumber:
return iter.readFloat64SlowPath()
}
decimalPlaces++
diff --git a/vendor/github.com/json-iterator/go/feature_iter_int.go b/vendor/github.com/json-iterator/go/iter_int.go
similarity index 98%
rename from vendor/github.com/json-iterator/go/feature_iter_int.go
rename to vendor/github.com/json-iterator/go/iter_int.go
index 4781c6393..214232035 100644
--- a/vendor/github.com/json-iterator/go/feature_iter_int.go
+++ b/vendor/github.com/json-iterator/go/iter_int.go
@@ -22,11 +22,17 @@ func init() {
// ReadUint read uint
func (iter *Iterator) ReadUint() uint {
+ if strconv.IntSize == 32 {
+ return uint(iter.ReadUint32())
+ }
return uint(iter.ReadUint64())
}
// ReadInt read int
func (iter *Iterator) ReadInt() int {
+ if strconv.IntSize == 32 {
+ return int(iter.ReadInt32())
+ }
return int(iter.ReadInt64())
}
diff --git a/vendor/github.com/json-iterator/go/feature_iter_object.go b/vendor/github.com/json-iterator/go/iter_object.go
similarity index 67%
rename from vendor/github.com/json-iterator/go/feature_iter_object.go
rename to vendor/github.com/json-iterator/go/iter_object.go
index dfd91fa60..1c5757671 100644
--- a/vendor/github.com/json-iterator/go/feature_iter_object.go
+++ b/vendor/github.com/json-iterator/go/iter_object.go
@@ -2,8 +2,7 @@ package jsoniter
import (
"fmt"
- "unicode"
- "unsafe"
+ "strings"
)
// ReadObject read one field from object.
@@ -19,26 +18,6 @@ func (iter *Iterator) ReadObject() (ret string) {
c = iter.nextToken()
if c == '"' {
iter.unreadByte()
- if iter.cfg.objectFieldMustBeSimpleString {
- return string(iter.readObjectFieldAsBytes())
- } else {
- field := iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- return field
- }
- }
- if c == '}' {
- return "" // end of object
- }
- iter.ReportError("ReadObject", `expect " after {, but found `+string([]byte{c}))
- return
- case ',':
- if iter.cfg.objectFieldMustBeSimpleString {
- return string(iter.readObjectFieldAsBytes())
- } else {
field := iter.ReadString()
c = iter.nextToken()
if c != ':' {
@@ -46,6 +25,18 @@ func (iter *Iterator) ReadObject() (ret string) {
}
return field
}
+ if c == '}' {
+ return "" // end of object
+ }
+ iter.ReportError("ReadObject", `expect " after {, but found `+string([]byte{c}))
+ return
+ case ',':
+ field := iter.ReadString()
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
+ }
+ return field
case '}':
return "" // end of object
default:
@@ -54,97 +45,90 @@ func (iter *Iterator) ReadObject() (ret string) {
}
}
-func (iter *Iterator) readFieldHash() int32 {
+// CaseInsensitive
+func (iter *Iterator) readFieldHash() int64 {
hash := int64(0x811c9dc5)
c := iter.nextToken()
- if c == '"' {
- for {
- for i := iter.head; i < iter.tail; i++ {
- // require ascii string and no escape
- b := iter.buf[i]
- if !iter.cfg.objectFieldMustBeSimpleString && b == '\\' {
- iter.head = i
- for _, b := range iter.readStringSlowPath() {
- if 'A' <= b && b <= 'Z' {
- b += 'a' - 'A'
- }
- hash ^= int64(b)
- hash *= 0x1000193
+ if c != '"' {
+ iter.ReportError("readFieldHash", `expect ", but found `+string([]byte{c}))
+ return 0
+ }
+ for {
+ for i := iter.head; i < iter.tail; i++ {
+ // require ascii string and no escape
+ b := iter.buf[i]
+ if b == '\\' {
+ iter.head = i
+ for _, b := range iter.readStringSlowPath() {
+ if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive {
+ b += 'a' - 'A'
}
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
- return 0
- }
- return int32(hash)
+ hash ^= int64(b)
+ hash *= 0x1000193
}
- if b == '"' {
- iter.head = i + 1
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
- return 0
- }
- return int32(hash)
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
+ return 0
}
- if 'A' <= b && b <= 'Z' {
- b += 'a' - 'A'
- }
- hash ^= int64(b)
- hash *= 0x1000193
+ return hash
}
- if !iter.loadMore() {
- iter.ReportError("readFieldHash", `incomplete field name`)
- return 0
+ if b == '"' {
+ iter.head = i + 1
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("readFieldHash", `expect :, but found `+string([]byte{c}))
+ return 0
+ }
+ return hash
}
+ if 'A' <= b && b <= 'Z' && !iter.cfg.caseSensitive {
+ b += 'a' - 'A'
+ }
+ hash ^= int64(b)
+ hash *= 0x1000193
+ }
+ if !iter.loadMore() {
+ iter.ReportError("readFieldHash", `incomplete field name`)
+ return 0
}
}
- iter.ReportError("readFieldHash", `expect ", but found `+string([]byte{c}))
- return 0
}
-func calcHash(str string) int32 {
+func calcHash(str string, caseSensitive bool) int64 {
+ if !caseSensitive {
+ str = strings.ToLower(str)
+ }
hash := int64(0x811c9dc5)
- for _, b := range str {
- hash ^= int64(unicode.ToLower(b))
+ for _, b := range []byte(str) {
+ hash ^= int64(b)
hash *= 0x1000193
}
- return int32(hash)
+ return int64(hash)
}
// ReadObjectCB read object with callback, the key is ascii only and field name not copied
func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool {
c := iter.nextToken()
- var fieldBytes []byte
var field string
if c == '{' {
c = iter.nextToken()
if c == '"' {
iter.unreadByte()
- if iter.cfg.objectFieldMustBeSimpleString {
- fieldBytes = iter.readObjectFieldAsBytes()
- field = *(*string)(unsafe.Pointer(&fieldBytes))
- } else {
- field = iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
+ field = iter.ReadString()
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
}
if !callback(iter, field) {
return false
}
c = iter.nextToken()
for c == ',' {
- if iter.cfg.objectFieldMustBeSimpleString {
- fieldBytes = iter.readObjectFieldAsBytes()
- field = *(*string)(unsafe.Pointer(&fieldBytes))
- } else {
- field = iter.ReadString()
- c = iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
+ field = iter.ReadString()
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
}
if !callback(iter, field) {
return false
diff --git a/vendor/github.com/json-iterator/go/feature_iter_skip.go b/vendor/github.com/json-iterator/go/iter_skip.go
similarity index 87%
rename from vendor/github.com/json-iterator/go/feature_iter_skip.go
rename to vendor/github.com/json-iterator/go/iter_skip.go
index f58beb913..e91eefb15 100644
--- a/vendor/github.com/json-iterator/go/feature_iter_skip.go
+++ b/vendor/github.com/json-iterator/go/iter_skip.go
@@ -37,17 +37,24 @@ func (iter *Iterator) SkipAndReturnBytes() []byte {
return iter.stopCapture()
}
-type captureBuffer struct {
- startedAt int
- captured []byte
+// SkipAndAppendBytes skips next JSON element and appends its content to
+// buffer, returning the result.
+func (iter *Iterator) SkipAndAppendBytes(buf []byte) []byte {
+ iter.startCaptureTo(buf, iter.head)
+ iter.Skip()
+ return iter.stopCapture()
}
-func (iter *Iterator) startCapture(captureStartedAt int) {
+func (iter *Iterator) startCaptureTo(buf []byte, captureStartedAt int) {
if iter.captured != nil {
panic("already in capture mode")
}
iter.captureStartedAt = captureStartedAt
- iter.captured = make([]byte, 0, 32)
+ iter.captured = buf
+}
+
+func (iter *Iterator) startCapture(captureStartedAt int) {
+ iter.startCaptureTo(make([]byte, 0, 32), captureStartedAt)
}
func (iter *Iterator) stopCapture() []byte {
@@ -58,13 +65,7 @@ func (iter *Iterator) stopCapture() []byte {
remaining := iter.buf[iter.captureStartedAt:iter.head]
iter.captureStartedAt = -1
iter.captured = nil
- if len(captured) == 0 {
- copied := make([]byte, len(remaining))
- copy(copied, remaining)
- return copied
- }
- captured = append(captured, remaining...)
- return captured
+ return append(captured, remaining...)
}
// Skip skips a json object and positions to relatively the next json object
diff --git a/vendor/github.com/json-iterator/go/feature_iter_skip_sloppy.go b/vendor/github.com/json-iterator/go/iter_skip_sloppy.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_iter_skip_sloppy.go
rename to vendor/github.com/json-iterator/go/iter_skip_sloppy.go
diff --git a/vendor/github.com/json-iterator/go/feature_iter_skip_strict.go b/vendor/github.com/json-iterator/go/iter_skip_strict.go
similarity index 89%
rename from vendor/github.com/json-iterator/go/feature_iter_skip_strict.go
rename to vendor/github.com/json-iterator/go/iter_skip_strict.go
index f67bc2e83..6cf66d043 100644
--- a/vendor/github.com/json-iterator/go/feature_iter_skip_strict.go
+++ b/vendor/github.com/json-iterator/go/iter_skip_strict.go
@@ -2,12 +2,22 @@
package jsoniter
-import "fmt"
+import (
+ "fmt"
+ "io"
+)
func (iter *Iterator) skipNumber() {
if !iter.trySkipNumber() {
iter.unreadByte()
- iter.ReadFloat32()
+ if iter.Error != nil && iter.Error != io.EOF {
+ return
+ }
+ iter.ReadFloat64()
+ if iter.Error != nil && iter.Error != io.EOF {
+ iter.Error = nil
+ iter.ReadBigFloat()
+ }
}
}
diff --git a/vendor/github.com/json-iterator/go/feature_iter_string.go b/vendor/github.com/json-iterator/go/iter_str.go
similarity index 100%
rename from vendor/github.com/json-iterator/go/feature_iter_string.go
rename to vendor/github.com/json-iterator/go/iter_str.go
diff --git a/vendor/github.com/json-iterator/go/feature_pool.go b/vendor/github.com/json-iterator/go/pool.go
similarity index 64%
rename from vendor/github.com/json-iterator/go/feature_pool.go
rename to vendor/github.com/json-iterator/go/pool.go
index 52d38e685..e2389b56c 100644
--- a/vendor/github.com/json-iterator/go/feature_pool.go
+++ b/vendor/github.com/json-iterator/go/pool.go
@@ -17,43 +17,26 @@ type StreamPool interface {
}
func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream {
- select {
- case stream := <-cfg.streamPool:
- stream.Reset(writer)
- return stream
- default:
- return NewStream(cfg, writer, 512)
- }
+ stream := cfg.streamPool.Get().(*Stream)
+ stream.Reset(writer)
+ return stream
}
func (cfg *frozenConfig) ReturnStream(stream *Stream) {
+ stream.out = nil
stream.Error = nil
stream.Attachment = nil
- select {
- case cfg.streamPool <- stream:
- return
- default:
- return
- }
+ cfg.streamPool.Put(stream)
}
func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator {
- select {
- case iter := <-cfg.iteratorPool:
- iter.ResetBytes(data)
- return iter
- default:
- return ParseBytes(cfg, data)
- }
+ iter := cfg.iteratorPool.Get().(*Iterator)
+ iter.ResetBytes(data)
+ return iter
}
func (cfg *frozenConfig) ReturnIterator(iter *Iterator) {
iter.Error = nil
iter.Attachment = nil
- select {
- case cfg.iteratorPool <- iter:
- return
- default:
- return
- }
+ cfg.iteratorPool.Put(iter)
}
diff --git a/vendor/github.com/json-iterator/go/reflect.go b/vendor/github.com/json-iterator/go/reflect.go
new file mode 100644
index 000000000..4459e203f
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect.go
@@ -0,0 +1,332 @@
+package jsoniter
+
+import (
+ "fmt"
+ "reflect"
+ "unsafe"
+
+ "github.com/modern-go/reflect2"
+)
+
+// ValDecoder is an internal type registered to cache as needed.
+// Don't confuse jsoniter.ValDecoder with json.Decoder.
+// For json.Decoder's adapter, refer to jsoniter.AdapterDecoder(todo link).
+//
+// Reflection on type to create decoders, which is then cached
+// Reflection on value is avoided as we can, as the reflect.Value itself will allocate, with following exceptions
+// 1. create instance of new value, for example *int will need a int to be allocated
+// 2. append to slice, if the existing cap is not enough, allocate will be done using Reflect.New
+// 3. assignment to map, both key and value will be reflect.Value
+// For a simple struct binding, it will be reflect.Value free and allocation free
+type ValDecoder interface {
+ Decode(ptr unsafe.Pointer, iter *Iterator)
+}
+
+// ValEncoder is an internal type registered to cache as needed.
+// Don't confuse jsoniter.ValEncoder with json.Encoder.
+// For json.Encoder's adapter, refer to jsoniter.AdapterEncoder(todo godoc link).
+type ValEncoder interface {
+ IsEmpty(ptr unsafe.Pointer) bool
+ Encode(ptr unsafe.Pointer, stream *Stream)
+}
+
+type checkIsEmpty interface {
+ IsEmpty(ptr unsafe.Pointer) bool
+}
+
+type ctx struct {
+ *frozenConfig
+ prefix string
+ encoders map[reflect2.Type]ValEncoder
+ decoders map[reflect2.Type]ValDecoder
+}
+
+func (b *ctx) caseSensitive() bool {
+ if b.frozenConfig == nil {
+ // default is case-insensitive
+ return false
+ }
+ return b.frozenConfig.caseSensitive
+}
+
+func (b *ctx) append(prefix string) *ctx {
+ return &ctx{
+ frozenConfig: b.frozenConfig,
+ prefix: b.prefix + " " + prefix,
+ encoders: b.encoders,
+ decoders: b.decoders,
+ }
+}
+
+// ReadVal copy the underlying JSON into go interface, same as json.Unmarshal
+func (iter *Iterator) ReadVal(obj interface{}) {
+ cacheKey := reflect2.RTypeOf(obj)
+ decoder := iter.cfg.getDecoderFromCache(cacheKey)
+ if decoder == nil {
+ typ := reflect2.TypeOf(obj)
+ if typ.Kind() != reflect.Ptr {
+ iter.ReportError("ReadVal", "can only unmarshal into pointer")
+ return
+ }
+ decoder = iter.cfg.DecoderOf(typ)
+ }
+ ptr := reflect2.PtrOf(obj)
+ if ptr == nil {
+ iter.ReportError("ReadVal", "can not read into nil pointer")
+ return
+ }
+ decoder.Decode(ptr, iter)
+}
+
+// WriteVal copy the go interface into underlying JSON, same as json.Marshal
+func (stream *Stream) WriteVal(val interface{}) {
+ if nil == val {
+ stream.WriteNil()
+ return
+ }
+ cacheKey := reflect2.RTypeOf(val)
+ encoder := stream.cfg.getEncoderFromCache(cacheKey)
+ if encoder == nil {
+ typ := reflect2.TypeOf(val)
+ encoder = stream.cfg.EncoderOf(typ)
+ }
+ encoder.Encode(reflect2.PtrOf(val), stream)
+}
+
+func (cfg *frozenConfig) DecoderOf(typ reflect2.Type) ValDecoder {
+ cacheKey := typ.RType()
+ decoder := cfg.getDecoderFromCache(cacheKey)
+ if decoder != nil {
+ return decoder
+ }
+ ctx := &ctx{
+ frozenConfig: cfg,
+ prefix: "",
+ decoders: map[reflect2.Type]ValDecoder{},
+ encoders: map[reflect2.Type]ValEncoder{},
+ }
+ ptrType := typ.(*reflect2.UnsafePtrType)
+ decoder = decoderOfType(ctx, ptrType.Elem())
+ cfg.addDecoderToCache(cacheKey, decoder)
+ return decoder
+}
+
+func decoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
+ decoder := getTypeDecoderFromExtension(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ decoder = createDecoderOfType(ctx, typ)
+ for _, extension := range extensions {
+ decoder = extension.DecorateDecoder(typ, decoder)
+ }
+ decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
+ for _, extension := range ctx.extraExtensions {
+ decoder = extension.DecorateDecoder(typ, decoder)
+ }
+ return decoder
+}
+
+func createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
+ decoder := ctx.decoders[typ]
+ if decoder != nil {
+ return decoder
+ }
+ placeholder := &placeholderDecoder{}
+ ctx.decoders[typ] = placeholder
+ decoder = _createDecoderOfType(ctx, typ)
+ placeholder.decoder = decoder
+ return decoder
+}
+
+func _createDecoderOfType(ctx *ctx, typ reflect2.Type) ValDecoder {
+ decoder := createDecoderOfJsonRawMessage(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ decoder = createDecoderOfJsonNumber(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ decoder = createDecoderOfMarshaler(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ decoder = createDecoderOfAny(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ decoder = createDecoderOfNative(ctx, typ)
+ if decoder != nil {
+ return decoder
+ }
+ switch typ.Kind() {
+ case reflect.Interface:
+ ifaceType, isIFace := typ.(*reflect2.UnsafeIFaceType)
+ if isIFace {
+ return &ifaceDecoder{valType: ifaceType}
+ }
+ return &efaceDecoder{}
+ case reflect.Struct:
+ return decoderOfStruct(ctx, typ)
+ case reflect.Array:
+ return decoderOfArray(ctx, typ)
+ case reflect.Slice:
+ return decoderOfSlice(ctx, typ)
+ case reflect.Map:
+ return decoderOfMap(ctx, typ)
+ case reflect.Ptr:
+ return decoderOfOptional(ctx, typ)
+ default:
+ return &lazyErrorDecoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())}
+ }
+}
+
+func (cfg *frozenConfig) EncoderOf(typ reflect2.Type) ValEncoder {
+ cacheKey := typ.RType()
+ encoder := cfg.getEncoderFromCache(cacheKey)
+ if encoder != nil {
+ return encoder
+ }
+ ctx := &ctx{
+ frozenConfig: cfg,
+ prefix: "",
+ decoders: map[reflect2.Type]ValDecoder{},
+ encoders: map[reflect2.Type]ValEncoder{},
+ }
+ encoder = encoderOfType(ctx, typ)
+ if typ.LikePtr() {
+ encoder = &onePtrEncoder{encoder}
+ }
+ cfg.addEncoderToCache(cacheKey, encoder)
+ return encoder
+}
+
+type onePtrEncoder struct {
+ encoder ValEncoder
+}
+
+func (encoder *onePtrEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr))
+}
+
+func (encoder *onePtrEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ encoder.encoder.Encode(unsafe.Pointer(&ptr), stream)
+}
+
+func encoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
+ encoder := getTypeEncoderFromExtension(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ encoder = createEncoderOfType(ctx, typ)
+ for _, extension := range extensions {
+ encoder = extension.DecorateEncoder(typ, encoder)
+ }
+ encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
+ for _, extension := range ctx.extraExtensions {
+ encoder = extension.DecorateEncoder(typ, encoder)
+ }
+ return encoder
+}
+
+func createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
+ encoder := ctx.encoders[typ]
+ if encoder != nil {
+ return encoder
+ }
+ placeholder := &placeholderEncoder{}
+ ctx.encoders[typ] = placeholder
+ encoder = _createEncoderOfType(ctx, typ)
+ placeholder.encoder = encoder
+ return encoder
+}
+func _createEncoderOfType(ctx *ctx, typ reflect2.Type) ValEncoder {
+ encoder := createEncoderOfJsonRawMessage(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ encoder = createEncoderOfJsonNumber(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ encoder = createEncoderOfMarshaler(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ encoder = createEncoderOfAny(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ encoder = createEncoderOfNative(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ kind := typ.Kind()
+ switch kind {
+ case reflect.Interface:
+ return &dynamicEncoder{typ}
+ case reflect.Struct:
+ return encoderOfStruct(ctx, typ)
+ case reflect.Array:
+ return encoderOfArray(ctx, typ)
+ case reflect.Slice:
+ return encoderOfSlice(ctx, typ)
+ case reflect.Map:
+ return encoderOfMap(ctx, typ)
+ case reflect.Ptr:
+ return encoderOfOptional(ctx, typ)
+ default:
+ return &lazyErrorEncoder{err: fmt.Errorf("%s%s is unsupported type", ctx.prefix, typ.String())}
+ }
+}
+
+type lazyErrorDecoder struct {
+ err error
+}
+
+func (decoder *lazyErrorDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if iter.WhatIsNext() != NilValue {
+ if iter.Error == nil {
+ iter.Error = decoder.err
+ }
+ } else {
+ iter.Skip()
+ }
+}
+
+type lazyErrorEncoder struct {
+ err error
+}
+
+func (encoder *lazyErrorEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ if ptr == nil {
+ stream.WriteNil()
+ } else if stream.Error == nil {
+ stream.Error = encoder.err
+ }
+}
+
+func (encoder *lazyErrorEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return false
+}
+
+type placeholderDecoder struct {
+ decoder ValDecoder
+}
+
+func (decoder *placeholderDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ decoder.decoder.Decode(ptr, iter)
+}
+
+type placeholderEncoder struct {
+ encoder ValEncoder
+}
+
+func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ encoder.encoder.Encode(ptr, stream)
+}
+
+func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.encoder.IsEmpty(ptr)
+}
diff --git a/vendor/github.com/json-iterator/go/reflect_array.go b/vendor/github.com/json-iterator/go/reflect_array.go
new file mode 100644
index 000000000..13a0b7b08
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_array.go
@@ -0,0 +1,104 @@
+package jsoniter
+
+import (
+ "fmt"
+ "github.com/modern-go/reflect2"
+ "io"
+ "unsafe"
+)
+
+func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder {
+ arrayType := typ.(*reflect2.UnsafeArrayType)
+ decoder := decoderOfType(ctx.append("[arrayElem]"), arrayType.Elem())
+ return &arrayDecoder{arrayType, decoder}
+}
+
+func encoderOfArray(ctx *ctx, typ reflect2.Type) ValEncoder {
+ arrayType := typ.(*reflect2.UnsafeArrayType)
+ if arrayType.Len() == 0 {
+ return emptyArrayEncoder{}
+ }
+ encoder := encoderOfType(ctx.append("[arrayElem]"), arrayType.Elem())
+ return &arrayEncoder{arrayType, encoder}
+}
+
+type emptyArrayEncoder struct{}
+
+func (encoder emptyArrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteEmptyArray()
+}
+
+func (encoder emptyArrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return true
+}
+
+type arrayEncoder struct {
+ arrayType *reflect2.UnsafeArrayType
+ elemEncoder ValEncoder
+}
+
+func (encoder *arrayEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteArrayStart()
+ elemPtr := unsafe.Pointer(ptr)
+ encoder.elemEncoder.Encode(elemPtr, stream)
+ for i := 1; i < encoder.arrayType.Len(); i++ {
+ stream.WriteMore()
+ elemPtr = encoder.arrayType.UnsafeGetIndex(ptr, i)
+ encoder.elemEncoder.Encode(elemPtr, stream)
+ }
+ stream.WriteArrayEnd()
+ if stream.Error != nil && stream.Error != io.EOF {
+ stream.Error = fmt.Errorf("%v: %s", encoder.arrayType, stream.Error.Error())
+ }
+}
+
+func (encoder *arrayEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return false
+}
+
+type arrayDecoder struct {
+ arrayType *reflect2.UnsafeArrayType
+ elemDecoder ValDecoder
+}
+
+func (decoder *arrayDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ decoder.doDecode(ptr, iter)
+ if iter.Error != nil && iter.Error != io.EOF {
+ iter.Error = fmt.Errorf("%v: %s", decoder.arrayType, iter.Error.Error())
+ }
+}
+
+func (decoder *arrayDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
+ c := iter.nextToken()
+ arrayType := decoder.arrayType
+ if c == 'n' {
+ iter.skipThreeBytes('u', 'l', 'l')
+ return
+ }
+ if c != '[' {
+ iter.ReportError("decode array", "expect [ or n, but found "+string([]byte{c}))
+ return
+ }
+ c = iter.nextToken()
+ if c == ']' {
+ return
+ }
+ iter.unreadByte()
+ elemPtr := arrayType.UnsafeGetIndex(ptr, 0)
+ decoder.elemDecoder.Decode(elemPtr, iter)
+ length := 1
+ for c = iter.nextToken(); c == ','; c = iter.nextToken() {
+ if length >= arrayType.Len() {
+ iter.Skip()
+ continue
+ }
+ idx := length
+ length += 1
+ elemPtr = arrayType.UnsafeGetIndex(ptr, idx)
+ decoder.elemDecoder.Decode(elemPtr, iter)
+ }
+ if c != ']' {
+ iter.ReportError("decode array", "expect ], but found "+string([]byte{c}))
+ return
+ }
+}
diff --git a/vendor/github.com/json-iterator/go/reflect_dynamic.go b/vendor/github.com/json-iterator/go/reflect_dynamic.go
new file mode 100644
index 000000000..8b6bc8b43
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_dynamic.go
@@ -0,0 +1,70 @@
+package jsoniter
+
+import (
+ "github.com/modern-go/reflect2"
+ "reflect"
+ "unsafe"
+)
+
+type dynamicEncoder struct {
+ valType reflect2.Type
+}
+
+func (encoder *dynamicEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ obj := encoder.valType.UnsafeIndirect(ptr)
+ stream.WriteVal(obj)
+}
+
+func (encoder *dynamicEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.valType.UnsafeIndirect(ptr) == nil
+}
+
+type efaceDecoder struct {
+}
+
+func (decoder *efaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ pObj := (*interface{})(ptr)
+ obj := *pObj
+ if obj == nil {
+ *pObj = iter.Read()
+ return
+ }
+ typ := reflect2.TypeOf(obj)
+ if typ.Kind() != reflect.Ptr {
+ *pObj = iter.Read()
+ return
+ }
+ ptrType := typ.(*reflect2.UnsafePtrType)
+ ptrElemType := ptrType.Elem()
+ if iter.WhatIsNext() == NilValue {
+ if ptrElemType.Kind() != reflect.Ptr {
+ iter.skipFourBytes('n', 'u', 'l', 'l')
+ *pObj = nil
+ return
+ }
+ }
+ if reflect2.IsNil(obj) {
+ obj := ptrElemType.New()
+ iter.ReadVal(obj)
+ *pObj = obj
+ return
+ }
+ iter.ReadVal(obj)
+}
+
+type ifaceDecoder struct {
+ valType *reflect2.UnsafeIFaceType
+}
+
+func (decoder *ifaceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if iter.ReadNil() {
+ decoder.valType.UnsafeSet(ptr, decoder.valType.UnsafeNew())
+ return
+ }
+ obj := decoder.valType.UnsafeIndirect(ptr)
+ if reflect2.IsNil(obj) {
+ iter.ReportError("decode non empty interface", "can not unmarshal into nil")
+ return
+ }
+ iter.ReadVal(obj)
+}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go
similarity index 55%
rename from vendor/github.com/json-iterator/go/feature_reflect_extension.go
rename to vendor/github.com/json-iterator/go/reflect_extension.go
index 66083a521..05e8fbf1f 100644
--- a/vendor/github.com/json-iterator/go/feature_reflect_extension.go
+++ b/vendor/github.com/json-iterator/go/reflect_extension.go
@@ -2,6 +2,7 @@ package jsoniter
import (
"fmt"
+ "github.com/modern-go/reflect2"
"reflect"
"sort"
"strings"
@@ -17,17 +18,15 @@ var extensions = []Extension{}
// StructDescriptor describe how should we encode/decode the struct
type StructDescriptor struct {
- onePtrEmbedded bool
- onePtrOptimization bool
- Type reflect.Type
- Fields []*Binding
+ Type reflect2.Type
+ Fields []*Binding
}
// GetField get one field from the descriptor by its name.
// Can not use map here to keep field orders.
func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding {
for _, binding := range structDescriptor.Fields {
- if binding.Field.Name == fieldName {
+ if binding.Field.Name() == fieldName {
return binding
}
}
@@ -37,7 +36,7 @@ func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding {
// Binding describe how should we encode/decode the struct field
type Binding struct {
levels []int
- Field *reflect.StructField
+ Field reflect2.StructField
FromNames []string
ToNames []string
Encoder ValEncoder
@@ -48,10 +47,12 @@ type Binding struct {
// Can also rename fields by UpdateStructDescriptor.
type Extension interface {
UpdateStructDescriptor(structDescriptor *StructDescriptor)
- CreateDecoder(typ reflect.Type) ValDecoder
- CreateEncoder(typ reflect.Type) ValEncoder
- DecorateDecoder(typ reflect.Type, decoder ValDecoder) ValDecoder
- DecorateEncoder(typ reflect.Type, encoder ValEncoder) ValEncoder
+ CreateMapKeyDecoder(typ reflect2.Type) ValDecoder
+ CreateMapKeyEncoder(typ reflect2.Type) ValEncoder
+ CreateDecoder(typ reflect2.Type) ValDecoder
+ CreateEncoder(typ reflect2.Type) ValEncoder
+ DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder
+ DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder
}
// DummyExtension embed this type get dummy implementation for all methods of Extension
@@ -62,23 +63,105 @@ type DummyExtension struct {
func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
}
+// CreateMapKeyDecoder No-op
+func (extension *DummyExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
+ return nil
+}
+
+// CreateMapKeyEncoder No-op
+func (extension *DummyExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
+ return nil
+}
+
// CreateDecoder No-op
-func (extension *DummyExtension) CreateDecoder(typ reflect.Type) ValDecoder {
+func (extension *DummyExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
return nil
}
// CreateEncoder No-op
-func (extension *DummyExtension) CreateEncoder(typ reflect.Type) ValEncoder {
+func (extension *DummyExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
return nil
}
// DecorateDecoder No-op
-func (extension *DummyExtension) DecorateDecoder(typ reflect.Type, decoder ValDecoder) ValDecoder {
+func (extension *DummyExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
return decoder
}
// DecorateEncoder No-op
-func (extension *DummyExtension) DecorateEncoder(typ reflect.Type, encoder ValEncoder) ValEncoder {
+func (extension *DummyExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
+ return encoder
+}
+
+type EncoderExtension map[reflect2.Type]ValEncoder
+
+// UpdateStructDescriptor No-op
+func (extension EncoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
+}
+
+// CreateDecoder No-op
+func (extension EncoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
+ return nil
+}
+
+// CreateEncoder get encoder from map
+func (extension EncoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
+ return extension[typ]
+}
+
+// CreateMapKeyDecoder No-op
+func (extension EncoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
+ return nil
+}
+
+// CreateMapKeyEncoder No-op
+func (extension EncoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
+ return nil
+}
+
+// DecorateDecoder No-op
+func (extension EncoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
+ return decoder
+}
+
+// DecorateEncoder No-op
+func (extension EncoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
+ return encoder
+}
+
+type DecoderExtension map[reflect2.Type]ValDecoder
+
+// UpdateStructDescriptor No-op
+func (extension DecoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) {
+}
+
+// CreateMapKeyDecoder No-op
+func (extension DecoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder {
+ return nil
+}
+
+// CreateMapKeyEncoder No-op
+func (extension DecoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder {
+ return nil
+}
+
+// CreateDecoder get decoder from map
+func (extension DecoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder {
+ return extension[typ]
+}
+
+// CreateEncoder No-op
+func (extension DecoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder {
+ return nil
+}
+
+// DecorateDecoder No-op
+func (extension DecoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder {
+ return decoder
+}
+
+// DecorateEncoder No-op
+func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder {
return encoder
}
@@ -99,10 +182,6 @@ func (encoder *funcEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
encoder.fun(ptr, stream)
}
-func (encoder *funcEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *funcEncoder) IsEmpty(ptr unsafe.Pointer) bool {
if encoder.isEmptyFunc == nil {
return false
@@ -161,78 +240,90 @@ func RegisterExtension(extension Extension) {
extensions = append(extensions, extension)
}
-func getTypeDecoderFromExtension(cfg *frozenConfig, typ reflect.Type) ValDecoder {
- decoder := _getTypeDecoderFromExtension(cfg, typ)
+func getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
+ decoder := _getTypeDecoderFromExtension(ctx, typ)
if decoder != nil {
for _, extension := range extensions {
decoder = extension.DecorateDecoder(typ, decoder)
}
- for _, extension := range cfg.extensions {
+ decoder = ctx.decoderExtension.DecorateDecoder(typ, decoder)
+ for _, extension := range ctx.extraExtensions {
decoder = extension.DecorateDecoder(typ, decoder)
}
}
return decoder
}
-func _getTypeDecoderFromExtension(cfg *frozenConfig, typ reflect.Type) ValDecoder {
+func _getTypeDecoderFromExtension(ctx *ctx, typ reflect2.Type) ValDecoder {
for _, extension := range extensions {
decoder := extension.CreateDecoder(typ)
if decoder != nil {
return decoder
}
}
- for _, extension := range cfg.extensions {
+ decoder := ctx.decoderExtension.CreateDecoder(typ)
+ if decoder != nil {
+ return decoder
+ }
+ for _, extension := range ctx.extraExtensions {
decoder := extension.CreateDecoder(typ)
if decoder != nil {
return decoder
}
}
typeName := typ.String()
- decoder := typeDecoders[typeName]
+ decoder = typeDecoders[typeName]
if decoder != nil {
return decoder
}
if typ.Kind() == reflect.Ptr {
- decoder := typeDecoders[typ.Elem().String()]
+ ptrType := typ.(*reflect2.UnsafePtrType)
+ decoder := typeDecoders[ptrType.Elem().String()]
if decoder != nil {
- return &OptionalDecoder{typ.Elem(), decoder}
+ return &OptionalDecoder{ptrType.Elem(), decoder}
}
}
return nil
}
-func getTypeEncoderFromExtension(cfg *frozenConfig, typ reflect.Type) ValEncoder {
- encoder := _getTypeEncoderFromExtension(cfg, typ)
+func getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
+ encoder := _getTypeEncoderFromExtension(ctx, typ)
if encoder != nil {
for _, extension := range extensions {
encoder = extension.DecorateEncoder(typ, encoder)
}
- for _, extension := range cfg.extensions {
+ encoder = ctx.encoderExtension.DecorateEncoder(typ, encoder)
+ for _, extension := range ctx.extraExtensions {
encoder = extension.DecorateEncoder(typ, encoder)
}
}
return encoder
}
-func _getTypeEncoderFromExtension(cfg *frozenConfig, typ reflect.Type) ValEncoder {
+func _getTypeEncoderFromExtension(ctx *ctx, typ reflect2.Type) ValEncoder {
for _, extension := range extensions {
encoder := extension.CreateEncoder(typ)
if encoder != nil {
return encoder
}
}
- for _, extension := range cfg.extensions {
+ encoder := ctx.encoderExtension.CreateEncoder(typ)
+ if encoder != nil {
+ return encoder
+ }
+ for _, extension := range ctx.extraExtensions {
encoder := extension.CreateEncoder(typ)
if encoder != nil {
return encoder
}
}
typeName := typ.String()
- encoder := typeEncoders[typeName]
+ encoder = typeEncoders[typeName]
if encoder != nil {
return encoder
}
if typ.Kind() == reflect.Ptr {
- encoder := typeEncoders[typ.Elem().String()]
+ typePtr := typ.(*reflect2.UnsafePtrType)
+ encoder := typeEncoders[typePtr.Elem().String()]
if encoder != nil {
return &OptionalEncoder{encoder}
}
@@ -240,61 +331,60 @@ func _getTypeEncoderFromExtension(cfg *frozenConfig, typ reflect.Type) ValEncode
return nil
}
-func describeStruct(cfg *frozenConfig, prefix string, typ reflect.Type) *StructDescriptor {
+func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
+ structType := typ.(*reflect2.UnsafeStructType)
embeddedBindings := []*Binding{}
bindings := []*Binding{}
- for i := 0; i < typ.NumField(); i++ {
- field := typ.Field(i)
- tag, hastag := field.Tag.Lookup(cfg.getTagKey())
- if cfg.onlyTaggedField && !hastag {
+ for i := 0; i < structType.NumField(); i++ {
+ field := structType.Field(i)
+ tag, hastag := field.Tag().Lookup(ctx.getTagKey())
+ if ctx.onlyTaggedField && !hastag && !field.Anonymous() {
continue
}
tagParts := strings.Split(tag, ",")
if tag == "-" {
continue
}
- if field.Anonymous && (tag == "" || tagParts[0] == "") {
- if field.Type.Kind() == reflect.Struct {
- structDescriptor := describeStruct(cfg, prefix, field.Type)
+ if field.Anonymous() && (tag == "" || tagParts[0] == "") {
+ if field.Type().Kind() == reflect.Struct {
+ structDescriptor := describeStruct(ctx, field.Type())
for _, binding := range structDescriptor.Fields {
binding.levels = append([]int{i}, binding.levels...)
omitempty := binding.Encoder.(*structFieldEncoder).omitempty
- binding.Encoder = &structFieldEncoder{&field, binding.Encoder, omitempty}
- binding.Decoder = &structFieldDecoder{&field, binding.Decoder}
+ binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty}
+ binding.Decoder = &structFieldDecoder{field, binding.Decoder}
embeddedBindings = append(embeddedBindings, binding)
}
continue
- } else if field.Type.Kind() == reflect.Ptr && field.Type.Elem().Kind() == reflect.Struct {
- structDescriptor := describeStruct(cfg, prefix, field.Type.Elem())
- for _, binding := range structDescriptor.Fields {
- binding.levels = append([]int{i}, binding.levels...)
- omitempty := binding.Encoder.(*structFieldEncoder).omitempty
- binding.Encoder = &dereferenceEncoder{binding.Encoder}
- binding.Encoder = &structFieldEncoder{&field, binding.Encoder, omitempty}
- binding.Decoder = &dereferenceDecoder{field.Type.Elem(), binding.Decoder}
- binding.Decoder = &structFieldDecoder{&field, binding.Decoder}
- embeddedBindings = append(embeddedBindings, binding)
+ } else if field.Type().Kind() == reflect.Ptr {
+ ptrType := field.Type().(*reflect2.UnsafePtrType)
+ if ptrType.Elem().Kind() == reflect.Struct {
+ structDescriptor := describeStruct(ctx, ptrType.Elem())
+ for _, binding := range structDescriptor.Fields {
+ binding.levels = append([]int{i}, binding.levels...)
+ omitempty := binding.Encoder.(*structFieldEncoder).omitempty
+ binding.Encoder = &dereferenceEncoder{binding.Encoder}
+ binding.Encoder = &structFieldEncoder{field, binding.Encoder, omitempty}
+ binding.Decoder = &dereferenceDecoder{ptrType.Elem(), binding.Decoder}
+ binding.Decoder = &structFieldDecoder{field, binding.Decoder}
+ embeddedBindings = append(embeddedBindings, binding)
+ }
+ continue
}
- continue
}
}
- fieldNames := calcFieldNames(field.Name, tagParts[0], tag)
- fieldCacheKey := fmt.Sprintf("%s/%s", typ.String(), field.Name)
+ fieldNames := calcFieldNames(field.Name(), tagParts[0], tag)
+ fieldCacheKey := fmt.Sprintf("%s/%s", typ.String(), field.Name())
decoder := fieldDecoders[fieldCacheKey]
if decoder == nil {
- decoder = decoderOfType(cfg, prefix+typ.String()+"."+field.Name+"->", field.Type)
+ decoder = decoderOfType(ctx.append(field.Name()), field.Type())
}
encoder := fieldEncoders[fieldCacheKey]
if encoder == nil {
- encoder = encoderOfType(cfg, prefix+typ.String()+"."+field.Name+"->", field.Type)
- // map is stored as pointer in the struct,
- // and treat nil or empty map as empty field
- if encoder != nil && field.Type.Kind() == reflect.Map {
- encoder = &optionalMapEncoder{encoder}
- }
+ encoder = encoderOfType(ctx.append(field.Name()), field.Type())
}
binding := &Binding{
- Field: &field,
+ Field: field,
FromNames: fieldNames,
ToNames: fieldNames,
Decoder: decoder,
@@ -303,38 +393,22 @@ func describeStruct(cfg *frozenConfig, prefix string, typ reflect.Type) *StructD
binding.levels = []int{i}
bindings = append(bindings, binding)
}
- return createStructDescriptor(cfg, typ, bindings, embeddedBindings)
+ return createStructDescriptor(ctx, typ, bindings, embeddedBindings)
}
-func createStructDescriptor(cfg *frozenConfig, typ reflect.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor {
- onePtrEmbedded := false
- onePtrOptimization := false
- if typ.NumField() == 1 {
- firstField := typ.Field(0)
- switch firstField.Type.Kind() {
- case reflect.Ptr:
- if firstField.Anonymous && firstField.Type.Elem().Kind() == reflect.Struct {
- onePtrEmbedded = true
- }
- fallthrough
- case reflect.Map:
- onePtrOptimization = true
- case reflect.Struct:
- onePtrOptimization = isStructOnePtr(firstField.Type)
- }
- }
+func createStructDescriptor(ctx *ctx, typ reflect2.Type, bindings []*Binding, embeddedBindings []*Binding) *StructDescriptor {
structDescriptor := &StructDescriptor{
- onePtrEmbedded: onePtrEmbedded,
- onePtrOptimization: onePtrOptimization,
- Type: typ,
- Fields: bindings,
+ Type: typ,
+ Fields: bindings,
}
for _, extension := range extensions {
extension.UpdateStructDescriptor(structDescriptor)
}
- for _, extension := range cfg.extensions {
+ ctx.encoderExtension.UpdateStructDescriptor(structDescriptor)
+ ctx.decoderExtension.UpdateStructDescriptor(structDescriptor)
+ for _, extension := range ctx.extraExtensions {
extension.UpdateStructDescriptor(structDescriptor)
}
- processTags(structDescriptor, cfg)
+ processTags(structDescriptor, ctx.frozenConfig)
// merge normal & embedded bindings & sort with original order
allBindings := sortableBindings(append(embeddedBindings, structDescriptor.Fields...))
sort.Sort(allBindings)
@@ -342,21 +416,6 @@ func createStructDescriptor(cfg *frozenConfig, typ reflect.Type, bindings []*Bin
return structDescriptor
}
-func isStructOnePtr(typ reflect.Type) bool {
- if typ.NumField() == 1 {
- firstField := typ.Field(0)
- switch firstField.Type.Kind() {
- case reflect.Ptr:
- return true
- case reflect.Map:
- return true
- case reflect.Struct:
- return isStructOnePtr(firstField.Type)
- }
- }
- return false
-}
-
type sortableBindings []*Binding
func (bindings sortableBindings) Len() int {
@@ -384,12 +443,12 @@ func (bindings sortableBindings) Swap(i, j int) {
func processTags(structDescriptor *StructDescriptor, cfg *frozenConfig) {
for _, binding := range structDescriptor.Fields {
shouldOmitEmpty := false
- tagParts := strings.Split(binding.Field.Tag.Get(cfg.getTagKey()), ",")
+ tagParts := strings.Split(binding.Field.Tag().Get(cfg.getTagKey()), ",")
for _, tagPart := range tagParts[1:] {
if tagPart == "omitempty" {
shouldOmitEmpty = true
} else if tagPart == "string" {
- if binding.Field.Type.Kind() == reflect.String {
+ if binding.Field.Type().Kind() == reflect.String {
binding.Decoder = &stringModeStringDecoder{binding.Decoder, cfg}
binding.Encoder = &stringModeStringEncoder{binding.Encoder, cfg}
} else {
diff --git a/vendor/github.com/json-iterator/go/reflect_json_number.go b/vendor/github.com/json-iterator/go/reflect_json_number.go
new file mode 100644
index 000000000..98d45c1ec
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_json_number.go
@@ -0,0 +1,112 @@
+package jsoniter
+
+import (
+ "encoding/json"
+ "github.com/modern-go/reflect2"
+ "strconv"
+ "unsafe"
+)
+
+type Number string
+
+// String returns the literal text of the number.
+func (n Number) String() string { return string(n) }
+
+// Float64 returns the number as a float64.
+func (n Number) Float64() (float64, error) {
+ return strconv.ParseFloat(string(n), 64)
+}
+
+// Int64 returns the number as an int64.
+func (n Number) Int64() (int64, error) {
+ return strconv.ParseInt(string(n), 10, 64)
+}
+
+func CastJsonNumber(val interface{}) (string, bool) {
+ switch typedVal := val.(type) {
+ case json.Number:
+ return string(typedVal), true
+ case Number:
+ return string(typedVal), true
+ }
+ return "", false
+}
+
+var jsonNumberType = reflect2.TypeOfPtr((*json.Number)(nil)).Elem()
+var jsoniterNumberType = reflect2.TypeOfPtr((*Number)(nil)).Elem()
+
+func createDecoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValDecoder {
+ if typ.AssignableTo(jsonNumberType) {
+ return &jsonNumberCodec{}
+ }
+ if typ.AssignableTo(jsoniterNumberType) {
+ return &jsoniterNumberCodec{}
+ }
+ return nil
+}
+
+func createEncoderOfJsonNumber(ctx *ctx, typ reflect2.Type) ValEncoder {
+ if typ.AssignableTo(jsonNumberType) {
+ return &jsonNumberCodec{}
+ }
+ if typ.AssignableTo(jsoniterNumberType) {
+ return &jsoniterNumberCodec{}
+ }
+ return nil
+}
+
+type jsonNumberCodec struct {
+}
+
+func (codec *jsonNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ switch iter.WhatIsNext() {
+ case StringValue:
+ *((*json.Number)(ptr)) = json.Number(iter.ReadString())
+ case NilValue:
+ iter.skipFourBytes('n', 'u', 'l', 'l')
+ *((*json.Number)(ptr)) = ""
+ default:
+ *((*json.Number)(ptr)) = json.Number([]byte(iter.readNumberAsString()))
+ }
+}
+
+func (codec *jsonNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ number := *((*json.Number)(ptr))
+ if len(number) == 0 {
+ stream.writeByte('0')
+ } else {
+ stream.WriteRaw(string(number))
+ }
+}
+
+func (codec *jsonNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return len(*((*json.Number)(ptr))) == 0
+}
+
+type jsoniterNumberCodec struct {
+}
+
+func (codec *jsoniterNumberCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ switch iter.WhatIsNext() {
+ case StringValue:
+ *((*Number)(ptr)) = Number(iter.ReadString())
+ case NilValue:
+ iter.skipFourBytes('n', 'u', 'l', 'l')
+ *((*Number)(ptr)) = ""
+ default:
+ *((*Number)(ptr)) = Number([]byte(iter.readNumberAsString()))
+ }
+}
+
+func (codec *jsoniterNumberCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ number := *((*Number)(ptr))
+ if len(number) == 0 {
+ stream.writeByte('0')
+ } else {
+ stream.WriteRaw(string(number))
+ }
+}
+
+func (codec *jsoniterNumberCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return len(*((*Number)(ptr))) == 0
+}
diff --git a/vendor/github.com/json-iterator/go/reflect_json_raw_message.go b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
new file mode 100644
index 000000000..f2619936c
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_json_raw_message.go
@@ -0,0 +1,60 @@
+package jsoniter
+
+import (
+ "encoding/json"
+ "github.com/modern-go/reflect2"
+ "unsafe"
+)
+
+var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()
+var jsoniterRawMessageType = reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()
+
+func createEncoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValEncoder {
+ if typ == jsonRawMessageType {
+ return &jsonRawMessageCodec{}
+ }
+ if typ == jsoniterRawMessageType {
+ return &jsoniterRawMessageCodec{}
+ }
+ return nil
+}
+
+func createDecoderOfJsonRawMessage(ctx *ctx, typ reflect2.Type) ValDecoder {
+ if typ == jsonRawMessageType {
+ return &jsonRawMessageCodec{}
+ }
+ if typ == jsoniterRawMessageType {
+ return &jsoniterRawMessageCodec{}
+ }
+ return nil
+}
+
+type jsonRawMessageCodec struct {
+}
+
+func (codec *jsonRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ *((*json.RawMessage)(ptr)) = json.RawMessage(iter.SkipAndReturnBytes())
+}
+
+func (codec *jsonRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteRaw(string(*((*json.RawMessage)(ptr))))
+}
+
+func (codec *jsonRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return len(*((*json.RawMessage)(ptr))) == 0
+}
+
+type jsoniterRawMessageCodec struct {
+}
+
+func (codec *jsoniterRawMessageCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ *((*RawMessage)(ptr)) = RawMessage(iter.SkipAndReturnBytes())
+}
+
+func (codec *jsoniterRawMessageCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteRaw(string(*((*RawMessage)(ptr))))
+}
+
+func (codec *jsoniterRawMessageCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return len(*((*RawMessage)(ptr))) == 0
+}
diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go
new file mode 100644
index 000000000..547b4421e
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_map.go
@@ -0,0 +1,338 @@
+package jsoniter
+
+import (
+ "fmt"
+ "github.com/modern-go/reflect2"
+ "io"
+ "reflect"
+ "sort"
+ "unsafe"
+)
+
+func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder {
+ mapType := typ.(*reflect2.UnsafeMapType)
+ keyDecoder := decoderOfMapKey(ctx.append("[mapKey]"), mapType.Key())
+ elemDecoder := decoderOfType(ctx.append("[mapElem]"), mapType.Elem())
+ return &mapDecoder{
+ mapType: mapType,
+ keyType: mapType.Key(),
+ elemType: mapType.Elem(),
+ keyDecoder: keyDecoder,
+ elemDecoder: elemDecoder,
+ }
+}
+
+func encoderOfMap(ctx *ctx, typ reflect2.Type) ValEncoder {
+ mapType := typ.(*reflect2.UnsafeMapType)
+ if ctx.sortMapKeys {
+ return &sortKeysMapEncoder{
+ mapType: mapType,
+ keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()),
+ elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()),
+ }
+ }
+ return &mapEncoder{
+ mapType: mapType,
+ keyEncoder: encoderOfMapKey(ctx.append("[mapKey]"), mapType.Key()),
+ elemEncoder: encoderOfType(ctx.append("[mapElem]"), mapType.Elem()),
+ }
+}
+
+func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder {
+ decoder := ctx.decoderExtension.CreateMapKeyDecoder(typ)
+ if decoder != nil {
+ return decoder
+ }
+ for _, extension := range ctx.extraExtensions {
+ decoder := extension.CreateMapKeyDecoder(typ)
+ if decoder != nil {
+ return decoder
+ }
+ }
+ switch typ.Kind() {
+ case reflect.String:
+ return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
+ case reflect.Bool,
+ reflect.Uint8, reflect.Int8,
+ reflect.Uint16, reflect.Int16,
+ reflect.Uint32, reflect.Int32,
+ reflect.Uint64, reflect.Int64,
+ reflect.Uint, reflect.Int,
+ reflect.Float32, reflect.Float64,
+ reflect.Uintptr:
+ typ = reflect2.DefaultTypeOfKind(typ.Kind())
+ return &numericMapKeyDecoder{decoderOfType(ctx, typ)}
+ default:
+ ptrType := reflect2.PtrTo(typ)
+ if ptrType.Implements(unmarshalerType) {
+ return &referenceDecoder{
+ &unmarshalerDecoder{
+ valType: ptrType,
+ },
+ }
+ }
+ if typ.Implements(unmarshalerType) {
+ return &unmarshalerDecoder{
+ valType: typ,
+ }
+ }
+ if ptrType.Implements(textUnmarshalerType) {
+ return &referenceDecoder{
+ &textUnmarshalerDecoder{
+ valType: ptrType,
+ },
+ }
+ }
+ if typ.Implements(textUnmarshalerType) {
+ return &textUnmarshalerDecoder{
+ valType: typ,
+ }
+ }
+ return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)}
+ }
+}
+
+func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder {
+ encoder := ctx.encoderExtension.CreateMapKeyEncoder(typ)
+ if encoder != nil {
+ return encoder
+ }
+ for _, extension := range ctx.extraExtensions {
+ encoder := extension.CreateMapKeyEncoder(typ)
+ if encoder != nil {
+ return encoder
+ }
+ }
+ switch typ.Kind() {
+ case reflect.String:
+ return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String))
+ case reflect.Bool,
+ reflect.Uint8, reflect.Int8,
+ reflect.Uint16, reflect.Int16,
+ reflect.Uint32, reflect.Int32,
+ reflect.Uint64, reflect.Int64,
+ reflect.Uint, reflect.Int,
+ reflect.Float32, reflect.Float64,
+ reflect.Uintptr:
+ typ = reflect2.DefaultTypeOfKind(typ.Kind())
+ return &numericMapKeyEncoder{encoderOfType(ctx, typ)}
+ default:
+ if typ == textMarshalerType {
+ return &directTextMarshalerEncoder{
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ }
+ }
+ if typ.Implements(textMarshalerType) {
+ return &textMarshalerEncoder{
+ valType: typ,
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ }
+ }
+ if typ.Kind() == reflect.Interface {
+ return &dynamicMapKeyEncoder{ctx, typ}
+ }
+ return &lazyErrorEncoder{err: fmt.Errorf("unsupported map key type: %v", typ)}
+ }
+}
+
+type mapDecoder struct {
+ mapType *reflect2.UnsafeMapType
+ keyType reflect2.Type
+ elemType reflect2.Type
+ keyDecoder ValDecoder
+ elemDecoder ValDecoder
+}
+
+func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ mapType := decoder.mapType
+ c := iter.nextToken()
+ if c == 'n' {
+ iter.skipThreeBytes('u', 'l', 'l')
+ *(*unsafe.Pointer)(ptr) = nil
+ mapType.UnsafeSet(ptr, mapType.UnsafeNew())
+ return
+ }
+ if mapType.UnsafeIsNil(ptr) {
+ mapType.UnsafeSet(ptr, mapType.UnsafeMakeMap(0))
+ }
+ if c != '{' {
+ iter.ReportError("ReadMapCB", `expect { or n, but found `+string([]byte{c}))
+ return
+ }
+ c = iter.nextToken()
+ if c == '}' {
+ return
+ }
+ if c != '"' {
+ iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c}))
+ return
+ }
+ iter.unreadByte()
+ key := decoder.keyType.UnsafeNew()
+ decoder.keyDecoder.Decode(key, iter)
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
+ return
+ }
+ elem := decoder.elemType.UnsafeNew()
+ decoder.elemDecoder.Decode(elem, iter)
+ decoder.mapType.UnsafeSetIndex(ptr, key, elem)
+ for c = iter.nextToken(); c == ','; c = iter.nextToken() {
+ key := decoder.keyType.UnsafeNew()
+ decoder.keyDecoder.Decode(key, iter)
+ c = iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadMapCB", "expect : after object field, but found "+string([]byte{c}))
+ return
+ }
+ elem := decoder.elemType.UnsafeNew()
+ decoder.elemDecoder.Decode(elem, iter)
+ decoder.mapType.UnsafeSetIndex(ptr, key, elem)
+ }
+ if c != '}' {
+ iter.ReportError("ReadMapCB", `expect }, but found `+string([]byte{c}))
+ }
+}
+
+type numericMapKeyDecoder struct {
+ decoder ValDecoder
+}
+
+func (decoder *numericMapKeyDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ c := iter.nextToken()
+ if c != '"' {
+ iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c}))
+ return
+ }
+ decoder.decoder.Decode(ptr, iter)
+ c = iter.nextToken()
+ if c != '"' {
+ iter.ReportError("ReadMapCB", `expect ", but found `+string([]byte{c}))
+ return
+ }
+}
+
+type numericMapKeyEncoder struct {
+ encoder ValEncoder
+}
+
+func (encoder *numericMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.writeByte('"')
+ encoder.encoder.Encode(ptr, stream)
+ stream.writeByte('"')
+}
+
+func (encoder *numericMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return false
+}
+
+type dynamicMapKeyEncoder struct {
+ ctx *ctx
+ valType reflect2.Type
+}
+
+func (encoder *dynamicMapKeyEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ obj := encoder.valType.UnsafeIndirect(ptr)
+ encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).Encode(reflect2.PtrOf(obj), stream)
+}
+
+func (encoder *dynamicMapKeyEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ obj := encoder.valType.UnsafeIndirect(ptr)
+ return encoderOfMapKey(encoder.ctx, reflect2.TypeOf(obj)).IsEmpty(reflect2.PtrOf(obj))
+}
+
+type mapEncoder struct {
+ mapType *reflect2.UnsafeMapType
+ keyEncoder ValEncoder
+ elemEncoder ValEncoder
+}
+
+func (encoder *mapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteObjectStart()
+ iter := encoder.mapType.UnsafeIterate(ptr)
+ for i := 0; iter.HasNext(); i++ {
+ if i != 0 {
+ stream.WriteMore()
+ }
+ key, elem := iter.UnsafeNext()
+ encoder.keyEncoder.Encode(key, stream)
+ if stream.indention > 0 {
+ stream.writeTwoBytes(byte(':'), byte(' '))
+ } else {
+ stream.writeByte(':')
+ }
+ encoder.elemEncoder.Encode(elem, stream)
+ }
+ stream.WriteObjectEnd()
+}
+
+func (encoder *mapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ iter := encoder.mapType.UnsafeIterate(ptr)
+ return !iter.HasNext()
+}
+
+type sortKeysMapEncoder struct {
+ mapType *reflect2.UnsafeMapType
+ keyEncoder ValEncoder
+ elemEncoder ValEncoder
+}
+
+func (encoder *sortKeysMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ if *(*unsafe.Pointer)(ptr) == nil {
+ stream.WriteNil()
+ return
+ }
+ stream.WriteObjectStart()
+ mapIter := encoder.mapType.UnsafeIterate(ptr)
+ subStream := stream.cfg.BorrowStream(nil)
+ subIter := stream.cfg.BorrowIterator(nil)
+ keyValues := encodedKeyValues{}
+ for mapIter.HasNext() {
+ subStream.buf = make([]byte, 0, 64)
+ key, elem := mapIter.UnsafeNext()
+ encoder.keyEncoder.Encode(key, subStream)
+ if subStream.Error != nil && subStream.Error != io.EOF && stream.Error == nil {
+ stream.Error = subStream.Error
+ }
+ encodedKey := subStream.Buffer()
+ subIter.ResetBytes(encodedKey)
+ decodedKey := subIter.ReadString()
+ if stream.indention > 0 {
+ subStream.writeTwoBytes(byte(':'), byte(' '))
+ } else {
+ subStream.writeByte(':')
+ }
+ encoder.elemEncoder.Encode(elem, subStream)
+ keyValues = append(keyValues, encodedKV{
+ key: decodedKey,
+ keyValue: subStream.Buffer(),
+ })
+ }
+ sort.Sort(keyValues)
+ for i, keyValue := range keyValues {
+ if i != 0 {
+ stream.WriteMore()
+ }
+ stream.Write(keyValue.keyValue)
+ }
+ stream.WriteObjectEnd()
+ stream.cfg.ReturnStream(subStream)
+ stream.cfg.ReturnIterator(subIter)
+}
+
+func (encoder *sortKeysMapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ iter := encoder.mapType.UnsafeIterate(ptr)
+ return !iter.HasNext()
+}
+
+type encodedKeyValues []encodedKV
+
+type encodedKV struct {
+ key string
+ keyValue []byte
+}
+
+func (sv encodedKeyValues) Len() int { return len(sv) }
+func (sv encodedKeyValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] }
+func (sv encodedKeyValues) Less(i, j int) bool { return sv[i].key < sv[j].key }
diff --git a/vendor/github.com/json-iterator/go/reflect_marshaler.go b/vendor/github.com/json-iterator/go/reflect_marshaler.go
new file mode 100644
index 000000000..fea50719d
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_marshaler.go
@@ -0,0 +1,217 @@
+package jsoniter
+
+import (
+ "encoding"
+ "encoding/json"
+ "github.com/modern-go/reflect2"
+ "unsafe"
+)
+
+var marshalerType = reflect2.TypeOfPtr((*json.Marshaler)(nil)).Elem()
+var unmarshalerType = reflect2.TypeOfPtr((*json.Unmarshaler)(nil)).Elem()
+var textMarshalerType = reflect2.TypeOfPtr((*encoding.TextMarshaler)(nil)).Elem()
+var textUnmarshalerType = reflect2.TypeOfPtr((*encoding.TextUnmarshaler)(nil)).Elem()
+
+func createDecoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValDecoder {
+ ptrType := reflect2.PtrTo(typ)
+ if ptrType.Implements(unmarshalerType) {
+ return &referenceDecoder{
+ &unmarshalerDecoder{ptrType},
+ }
+ }
+ if ptrType.Implements(textUnmarshalerType) {
+ return &referenceDecoder{
+ &textUnmarshalerDecoder{ptrType},
+ }
+ }
+ return nil
+}
+
+func createEncoderOfMarshaler(ctx *ctx, typ reflect2.Type) ValEncoder {
+ if typ == marshalerType {
+ checkIsEmpty := createCheckIsEmpty(ctx, typ)
+ var encoder ValEncoder = &directMarshalerEncoder{
+ checkIsEmpty: checkIsEmpty,
+ }
+ return encoder
+ }
+ if typ.Implements(marshalerType) {
+ checkIsEmpty := createCheckIsEmpty(ctx, typ)
+ var encoder ValEncoder = &marshalerEncoder{
+ valType: typ,
+ checkIsEmpty: checkIsEmpty,
+ }
+ return encoder
+ }
+ ptrType := reflect2.PtrTo(typ)
+ if ctx.prefix != "" && ptrType.Implements(marshalerType) {
+ checkIsEmpty := createCheckIsEmpty(ctx, ptrType)
+ var encoder ValEncoder = &marshalerEncoder{
+ valType: ptrType,
+ checkIsEmpty: checkIsEmpty,
+ }
+ return &referenceEncoder{encoder}
+ }
+ if typ == textMarshalerType {
+ checkIsEmpty := createCheckIsEmpty(ctx, typ)
+ var encoder ValEncoder = &directTextMarshalerEncoder{
+ checkIsEmpty: checkIsEmpty,
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ }
+ return encoder
+ }
+ if typ.Implements(textMarshalerType) {
+ checkIsEmpty := createCheckIsEmpty(ctx, typ)
+ var encoder ValEncoder = &textMarshalerEncoder{
+ valType: typ,
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ checkIsEmpty: checkIsEmpty,
+ }
+ return encoder
+ }
+ // if prefix is empty, the type is the root type
+ if ctx.prefix != "" && ptrType.Implements(textMarshalerType) {
+ checkIsEmpty := createCheckIsEmpty(ctx, ptrType)
+ var encoder ValEncoder = &textMarshalerEncoder{
+ valType: ptrType,
+ stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")),
+ checkIsEmpty: checkIsEmpty,
+ }
+ return &referenceEncoder{encoder}
+ }
+ return nil
+}
+
+type marshalerEncoder struct {
+ checkIsEmpty checkIsEmpty
+ valType reflect2.Type
+}
+
+func (encoder *marshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ obj := encoder.valType.UnsafeIndirect(ptr)
+ if encoder.valType.IsNullable() && reflect2.IsNil(obj) {
+ stream.WriteNil()
+ return
+ }
+ bytes, err := json.Marshal(obj)
+ if err != nil {
+ stream.Error = err
+ } else {
+ stream.Write(bytes)
+ }
+}
+
+func (encoder *marshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.checkIsEmpty.IsEmpty(ptr)
+}
+
+type directMarshalerEncoder struct {
+ checkIsEmpty checkIsEmpty
+}
+
+func (encoder *directMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ marshaler := *(*json.Marshaler)(ptr)
+ if marshaler == nil {
+ stream.WriteNil()
+ return
+ }
+ bytes, err := marshaler.MarshalJSON()
+ if err != nil {
+ stream.Error = err
+ } else {
+ stream.Write(bytes)
+ }
+}
+
+func (encoder *directMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.checkIsEmpty.IsEmpty(ptr)
+}
+
+type textMarshalerEncoder struct {
+ valType reflect2.Type
+ stringEncoder ValEncoder
+ checkIsEmpty checkIsEmpty
+}
+
+func (encoder *textMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ obj := encoder.valType.UnsafeIndirect(ptr)
+ if encoder.valType.IsNullable() && reflect2.IsNil(obj) {
+ stream.WriteNil()
+ return
+ }
+ marshaler := (obj).(encoding.TextMarshaler)
+ bytes, err := marshaler.MarshalText()
+ if err != nil {
+ stream.Error = err
+ } else {
+ str := string(bytes)
+ encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream)
+ }
+}
+
+func (encoder *textMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.checkIsEmpty.IsEmpty(ptr)
+}
+
+type directTextMarshalerEncoder struct {
+ stringEncoder ValEncoder
+ checkIsEmpty checkIsEmpty
+}
+
+func (encoder *directTextMarshalerEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ marshaler := *(*encoding.TextMarshaler)(ptr)
+ if marshaler == nil {
+ stream.WriteNil()
+ return
+ }
+ bytes, err := marshaler.MarshalText()
+ if err != nil {
+ stream.Error = err
+ } else {
+ str := string(bytes)
+ encoder.stringEncoder.Encode(unsafe.Pointer(&str), stream)
+ }
+}
+
+func (encoder *directTextMarshalerEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.checkIsEmpty.IsEmpty(ptr)
+}
+
+type unmarshalerDecoder struct {
+ valType reflect2.Type
+}
+
+func (decoder *unmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ valType := decoder.valType
+ obj := valType.UnsafeIndirect(ptr)
+ unmarshaler := obj.(json.Unmarshaler)
+ iter.nextToken()
+ iter.unreadByte() // skip spaces
+ bytes := iter.SkipAndReturnBytes()
+ err := unmarshaler.UnmarshalJSON(bytes)
+ if err != nil {
+ iter.ReportError("unmarshalerDecoder", err.Error())
+ }
+}
+
+type textUnmarshalerDecoder struct {
+ valType reflect2.Type
+}
+
+func (decoder *textUnmarshalerDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ valType := decoder.valType
+ obj := valType.UnsafeIndirect(ptr)
+ if reflect2.IsNil(obj) {
+ ptrType := valType.(*reflect2.UnsafePtrType)
+ elemType := ptrType.Elem()
+ elem := elemType.UnsafeNew()
+ ptrType.UnsafeSet(ptr, unsafe.Pointer(&elem))
+ obj = valType.UnsafeIndirect(ptr)
+ }
+ unmarshaler := (obj).(encoding.TextUnmarshaler)
+ str := iter.ReadString()
+ err := unmarshaler.UnmarshalText([]byte(str))
+ if err != nil {
+ iter.ReportError("textUnmarshalerDecoder", err.Error())
+ }
+}
diff --git a/vendor/github.com/json-iterator/go/reflect_native.go b/vendor/github.com/json-iterator/go/reflect_native.go
new file mode 100644
index 000000000..f88722d14
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_native.go
@@ -0,0 +1,453 @@
+package jsoniter
+
+import (
+ "encoding/base64"
+ "reflect"
+ "strconv"
+ "unsafe"
+
+ "github.com/modern-go/reflect2"
+)
+
+const ptrSize = 32 << uintptr(^uintptr(0)>>63)
+
+func createEncoderOfNative(ctx *ctx, typ reflect2.Type) ValEncoder {
+ if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 {
+ sliceDecoder := decoderOfSlice(ctx, typ)
+ return &base64Codec{sliceDecoder: sliceDecoder}
+ }
+ typeName := typ.String()
+ kind := typ.Kind()
+ switch kind {
+ case reflect.String:
+ if typeName != "string" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem())
+ }
+ return &stringCodec{}
+ case reflect.Int:
+ if typeName != "int" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem())
+ }
+ if strconv.IntSize == 32 {
+ return &int32Codec{}
+ }
+ return &int64Codec{}
+ case reflect.Int8:
+ if typeName != "int8" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem())
+ }
+ return &int8Codec{}
+ case reflect.Int16:
+ if typeName != "int16" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem())
+ }
+ return &int16Codec{}
+ case reflect.Int32:
+ if typeName != "int32" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem())
+ }
+ return &int32Codec{}
+ case reflect.Int64:
+ if typeName != "int64" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem())
+ }
+ return &int64Codec{}
+ case reflect.Uint:
+ if typeName != "uint" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem())
+ }
+ if strconv.IntSize == 32 {
+ return &uint32Codec{}
+ }
+ return &uint64Codec{}
+ case reflect.Uint8:
+ if typeName != "uint8" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem())
+ }
+ return &uint8Codec{}
+ case reflect.Uint16:
+ if typeName != "uint16" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem())
+ }
+ return &uint16Codec{}
+ case reflect.Uint32:
+ if typeName != "uint32" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem())
+ }
+ return &uint32Codec{}
+ case reflect.Uintptr:
+ if typeName != "uintptr" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem())
+ }
+ if ptrSize == 32 {
+ return &uint32Codec{}
+ }
+ return &uint64Codec{}
+ case reflect.Uint64:
+ if typeName != "uint64" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem())
+ }
+ return &uint64Codec{}
+ case reflect.Float32:
+ if typeName != "float32" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem())
+ }
+ return &float32Codec{}
+ case reflect.Float64:
+ if typeName != "float64" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem())
+ }
+ return &float64Codec{}
+ case reflect.Bool:
+ if typeName != "bool" {
+ return encoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem())
+ }
+ return &boolCodec{}
+ }
+ return nil
+}
+
+func createDecoderOfNative(ctx *ctx, typ reflect2.Type) ValDecoder {
+ if typ.Kind() == reflect.Slice && typ.(reflect2.SliceType).Elem().Kind() == reflect.Uint8 {
+ sliceDecoder := decoderOfSlice(ctx, typ)
+ return &base64Codec{sliceDecoder: sliceDecoder}
+ }
+ typeName := typ.String()
+ switch typ.Kind() {
+ case reflect.String:
+ if typeName != "string" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*string)(nil)).Elem())
+ }
+ return &stringCodec{}
+ case reflect.Int:
+ if typeName != "int" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*int)(nil)).Elem())
+ }
+ if strconv.IntSize == 32 {
+ return &int32Codec{}
+ }
+ return &int64Codec{}
+ case reflect.Int8:
+ if typeName != "int8" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*int8)(nil)).Elem())
+ }
+ return &int8Codec{}
+ case reflect.Int16:
+ if typeName != "int16" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*int16)(nil)).Elem())
+ }
+ return &int16Codec{}
+ case reflect.Int32:
+ if typeName != "int32" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*int32)(nil)).Elem())
+ }
+ return &int32Codec{}
+ case reflect.Int64:
+ if typeName != "int64" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*int64)(nil)).Elem())
+ }
+ return &int64Codec{}
+ case reflect.Uint:
+ if typeName != "uint" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uint)(nil)).Elem())
+ }
+ if strconv.IntSize == 32 {
+ return &uint32Codec{}
+ }
+ return &uint64Codec{}
+ case reflect.Uint8:
+ if typeName != "uint8" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uint8)(nil)).Elem())
+ }
+ return &uint8Codec{}
+ case reflect.Uint16:
+ if typeName != "uint16" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uint16)(nil)).Elem())
+ }
+ return &uint16Codec{}
+ case reflect.Uint32:
+ if typeName != "uint32" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uint32)(nil)).Elem())
+ }
+ return &uint32Codec{}
+ case reflect.Uintptr:
+ if typeName != "uintptr" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uintptr)(nil)).Elem())
+ }
+ if ptrSize == 32 {
+ return &uint32Codec{}
+ }
+ return &uint64Codec{}
+ case reflect.Uint64:
+ if typeName != "uint64" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*uint64)(nil)).Elem())
+ }
+ return &uint64Codec{}
+ case reflect.Float32:
+ if typeName != "float32" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*float32)(nil)).Elem())
+ }
+ return &float32Codec{}
+ case reflect.Float64:
+ if typeName != "float64" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*float64)(nil)).Elem())
+ }
+ return &float64Codec{}
+ case reflect.Bool:
+ if typeName != "bool" {
+ return decoderOfType(ctx, reflect2.TypeOfPtr((*bool)(nil)).Elem())
+ }
+ return &boolCodec{}
+ }
+ return nil
+}
+
+type stringCodec struct {
+}
+
+func (codec *stringCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ *((*string)(ptr)) = iter.ReadString()
+}
+
+func (codec *stringCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ str := *((*string)(ptr))
+ stream.WriteString(str)
+}
+
+func (codec *stringCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*string)(ptr)) == ""
+}
+
+type int8Codec struct {
+}
+
+func (codec *int8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*int8)(ptr)) = iter.ReadInt8()
+ }
+}
+
+func (codec *int8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteInt8(*((*int8)(ptr)))
+}
+
+func (codec *int8Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*int8)(ptr)) == 0
+}
+
+type int16Codec struct {
+}
+
+func (codec *int16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*int16)(ptr)) = iter.ReadInt16()
+ }
+}
+
+func (codec *int16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteInt16(*((*int16)(ptr)))
+}
+
+func (codec *int16Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*int16)(ptr)) == 0
+}
+
+type int32Codec struct {
+}
+
+func (codec *int32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*int32)(ptr)) = iter.ReadInt32()
+ }
+}
+
+func (codec *int32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteInt32(*((*int32)(ptr)))
+}
+
+func (codec *int32Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*int32)(ptr)) == 0
+}
+
+type int64Codec struct {
+}
+
+func (codec *int64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*int64)(ptr)) = iter.ReadInt64()
+ }
+}
+
+func (codec *int64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteInt64(*((*int64)(ptr)))
+}
+
+func (codec *int64Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*int64)(ptr)) == 0
+}
+
+type uint8Codec struct {
+}
+
+func (codec *uint8Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*uint8)(ptr)) = iter.ReadUint8()
+ }
+}
+
+func (codec *uint8Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteUint8(*((*uint8)(ptr)))
+}
+
+func (codec *uint8Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*uint8)(ptr)) == 0
+}
+
+type uint16Codec struct {
+}
+
+func (codec *uint16Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*uint16)(ptr)) = iter.ReadUint16()
+ }
+}
+
+func (codec *uint16Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteUint16(*((*uint16)(ptr)))
+}
+
+func (codec *uint16Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*uint16)(ptr)) == 0
+}
+
+type uint32Codec struct {
+}
+
+func (codec *uint32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*uint32)(ptr)) = iter.ReadUint32()
+ }
+}
+
+func (codec *uint32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteUint32(*((*uint32)(ptr)))
+}
+
+func (codec *uint32Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*uint32)(ptr)) == 0
+}
+
+type uint64Codec struct {
+}
+
+func (codec *uint64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*uint64)(ptr)) = iter.ReadUint64()
+ }
+}
+
+func (codec *uint64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteUint64(*((*uint64)(ptr)))
+}
+
+func (codec *uint64Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*uint64)(ptr)) == 0
+}
+
+type float32Codec struct {
+}
+
+func (codec *float32Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*float32)(ptr)) = iter.ReadFloat32()
+ }
+}
+
+func (codec *float32Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteFloat32(*((*float32)(ptr)))
+}
+
+func (codec *float32Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*float32)(ptr)) == 0
+}
+
+type float64Codec struct {
+}
+
+func (codec *float64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*float64)(ptr)) = iter.ReadFloat64()
+ }
+}
+
+func (codec *float64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteFloat64(*((*float64)(ptr)))
+}
+
+func (codec *float64Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return *((*float64)(ptr)) == 0
+}
+
+type boolCodec struct {
+}
+
+func (codec *boolCodec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if !iter.ReadNil() {
+ *((*bool)(ptr)) = iter.ReadBool()
+ }
+}
+
+func (codec *boolCodec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.WriteBool(*((*bool)(ptr)))
+}
+
+func (codec *boolCodec) IsEmpty(ptr unsafe.Pointer) bool {
+ return !(*((*bool)(ptr)))
+}
+
+type base64Codec struct {
+ sliceType *reflect2.UnsafeSliceType
+ sliceDecoder ValDecoder
+}
+
+func (codec *base64Codec) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ if iter.ReadNil() {
+ codec.sliceType.UnsafeSetNil(ptr)
+ return
+ }
+ switch iter.WhatIsNext() {
+ case StringValue:
+ src := iter.ReadString()
+ dst, err := base64.StdEncoding.DecodeString(src)
+ if err != nil {
+ iter.ReportError("decode base64", err.Error())
+ } else {
+ codec.sliceType.UnsafeSet(ptr, unsafe.Pointer(&dst))
+ }
+ case ArrayValue:
+ codec.sliceDecoder.Decode(ptr, iter)
+ default:
+ iter.ReportError("base64Codec", "invalid input")
+ }
+}
+
+func (codec *base64Codec) Encode(ptr unsafe.Pointer, stream *Stream) {
+ if codec.sliceType.UnsafeIsNil(ptr) {
+ stream.WriteNil()
+ return
+ }
+ src := *((*[]byte)(ptr))
+ encoding := base64.StdEncoding
+ stream.writeByte('"')
+ if len(src) != 0 {
+ size := encoding.EncodedLen(len(src))
+ buf := make([]byte, size)
+ encoding.Encode(buf, src)
+ stream.buf = append(stream.buf, buf...)
+ }
+ stream.writeByte('"')
+}
+
+func (codec *base64Codec) IsEmpty(ptr unsafe.Pointer) bool {
+ return len(*((*[]byte)(ptr))) == 0
+}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go
similarity index 52%
rename from vendor/github.com/json-iterator/go/feature_reflect_optional.go
rename to vendor/github.com/json-iterator/go/reflect_optional.go
index fe7055fcd..43ec71d6d 100644
--- a/vendor/github.com/json-iterator/go/feature_reflect_optional.go
+++ b/vendor/github.com/json-iterator/go/reflect_optional.go
@@ -1,28 +1,31 @@
package jsoniter
import (
+ "github.com/modern-go/reflect2"
"reflect"
"unsafe"
)
-func decoderOfOptional(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- elemType := typ.Elem()
- decoder := decoderOfType(cfg, prefix, elemType)
+func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder {
+ ptrType := typ.(*reflect2.UnsafePtrType)
+ elemType := ptrType.Elem()
+ decoder := decoderOfType(ctx, elemType)
+ if ctx.prefix == "" && elemType.Kind() == reflect.Ptr {
+ return &dereferenceDecoder{elemType, decoder}
+ }
return &OptionalDecoder{elemType, decoder}
}
-func encoderOfOptional(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
- elemType := typ.Elem()
- elemEncoder := encoderOfType(cfg, prefix, elemType)
+func encoderOfOptional(ctx *ctx, typ reflect2.Type) ValEncoder {
+ ptrType := typ.(*reflect2.UnsafePtrType)
+ elemType := ptrType.Elem()
+ elemEncoder := encoderOfType(ctx, elemType)
encoder := &OptionalEncoder{elemEncoder}
- if elemType.Kind() == reflect.Map {
- encoder = &OptionalEncoder{encoder}
- }
return encoder
}
type OptionalDecoder struct {
- ValueType reflect.Type
+ ValueType reflect2.Type
ValueDecoder ValDecoder
}
@@ -32,10 +35,9 @@ func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
} else {
if *((*unsafe.Pointer)(ptr)) == nil {
//pointer to null, we have to allocate memory to hold the value
- value := reflect.New(decoder.ValueType)
- newPtr := extractInterface(value.Interface()).word
+ newPtr := decoder.ValueType.UnsafeNew()
decoder.ValueDecoder.Decode(newPtr, iter)
- *((*uintptr)(ptr)) = uintptr(newPtr)
+ *((*unsafe.Pointer)(ptr)) = newPtr
} else {
//reuse existing instance
decoder.ValueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter)
@@ -45,17 +47,16 @@ func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
type dereferenceDecoder struct {
// only to deference a pointer
- valueType reflect.Type
+ valueType reflect2.Type
valueDecoder ValDecoder
}
func (decoder *dereferenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if *((*unsafe.Pointer)(ptr)) == nil {
//pointer to null, we have to allocate memory to hold the value
- value := reflect.New(decoder.valueType)
- newPtr := extractInterface(value.Interface()).word
+ newPtr := decoder.valueType.UnsafeNew()
decoder.valueDecoder.Decode(newPtr, iter)
- *((*uintptr)(ptr)) = uintptr(newPtr)
+ *((*unsafe.Pointer)(ptr)) = newPtr
} else {
//reuse existing instance
decoder.valueDecoder.Decode(*((*unsafe.Pointer)(ptr)), iter)
@@ -74,10 +75,6 @@ func (encoder *OptionalEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
}
}
-func (encoder *OptionalEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *OptionalEncoder) IsEmpty(ptr unsafe.Pointer) bool {
return *((*unsafe.Pointer)(ptr)) == nil
}
@@ -94,31 +91,43 @@ func (encoder *dereferenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
}
}
-func (encoder *dereferenceEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *dereferenceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- return encoder.ValueEncoder.IsEmpty(*((*unsafe.Pointer)(ptr)))
-}
-
-type optionalMapEncoder struct {
- valueEncoder ValEncoder
-}
-
-func (encoder *optionalMapEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- if *((*unsafe.Pointer)(ptr)) == nil {
- stream.WriteNil()
- } else {
- encoder.valueEncoder.Encode(*((*unsafe.Pointer)(ptr)), stream)
+ dePtr := *((*unsafe.Pointer)(ptr))
+ if dePtr == nil {
+ return true
}
+ return encoder.ValueEncoder.IsEmpty(dePtr)
}
-func (encoder *optionalMapEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
+func (encoder *dereferenceEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool {
+ deReferenced := *((*unsafe.Pointer)(ptr))
+ if deReferenced == nil {
+ return true
+ }
+ isEmbeddedPtrNil, converted := encoder.ValueEncoder.(IsEmbeddedPtrNil)
+ if !converted {
+ return false
+ }
+ fieldPtr := unsafe.Pointer(deReferenced)
+ return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr)
}
-func (encoder *optionalMapEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- p := *((*unsafe.Pointer)(ptr))
- return p == nil || encoder.valueEncoder.IsEmpty(p)
+type referenceEncoder struct {
+ encoder ValEncoder
+}
+
+func (encoder *referenceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ encoder.encoder.Encode(unsafe.Pointer(&ptr), stream)
+}
+
+func (encoder *referenceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.encoder.IsEmpty(unsafe.Pointer(&ptr))
+}
+
+type referenceDecoder struct {
+ decoder ValDecoder
+}
+
+func (decoder *referenceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ decoder.decoder.Decode(unsafe.Pointer(&ptr), iter)
}
diff --git a/vendor/github.com/json-iterator/go/reflect_slice.go b/vendor/github.com/json-iterator/go/reflect_slice.go
new file mode 100644
index 000000000..9441d79df
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/reflect_slice.go
@@ -0,0 +1,99 @@
+package jsoniter
+
+import (
+ "fmt"
+ "github.com/modern-go/reflect2"
+ "io"
+ "unsafe"
+)
+
+func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder {
+ sliceType := typ.(*reflect2.UnsafeSliceType)
+ decoder := decoderOfType(ctx.append("[sliceElem]"), sliceType.Elem())
+ return &sliceDecoder{sliceType, decoder}
+}
+
+func encoderOfSlice(ctx *ctx, typ reflect2.Type) ValEncoder {
+ sliceType := typ.(*reflect2.UnsafeSliceType)
+ encoder := encoderOfType(ctx.append("[sliceElem]"), sliceType.Elem())
+ return &sliceEncoder{sliceType, encoder}
+}
+
+type sliceEncoder struct {
+ sliceType *reflect2.UnsafeSliceType
+ elemEncoder ValEncoder
+}
+
+func (encoder *sliceEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ if encoder.sliceType.UnsafeIsNil(ptr) {
+ stream.WriteNil()
+ return
+ }
+ length := encoder.sliceType.UnsafeLengthOf(ptr)
+ if length == 0 {
+ stream.WriteEmptyArray()
+ return
+ }
+ stream.WriteArrayStart()
+ encoder.elemEncoder.Encode(encoder.sliceType.UnsafeGetIndex(ptr, 0), stream)
+ for i := 1; i < length; i++ {
+ stream.WriteMore()
+ elemPtr := encoder.sliceType.UnsafeGetIndex(ptr, i)
+ encoder.elemEncoder.Encode(elemPtr, stream)
+ }
+ stream.WriteArrayEnd()
+ if stream.Error != nil && stream.Error != io.EOF {
+ stream.Error = fmt.Errorf("%v: %s", encoder.sliceType, stream.Error.Error())
+ }
+}
+
+func (encoder *sliceEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.sliceType.UnsafeLengthOf(ptr) == 0
+}
+
+type sliceDecoder struct {
+ sliceType *reflect2.UnsafeSliceType
+ elemDecoder ValDecoder
+}
+
+func (decoder *sliceDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ decoder.doDecode(ptr, iter)
+ if iter.Error != nil && iter.Error != io.EOF {
+ iter.Error = fmt.Errorf("%v: %s", decoder.sliceType, iter.Error.Error())
+ }
+}
+
+func (decoder *sliceDecoder) doDecode(ptr unsafe.Pointer, iter *Iterator) {
+ c := iter.nextToken()
+ sliceType := decoder.sliceType
+ if c == 'n' {
+ iter.skipThreeBytes('u', 'l', 'l')
+ sliceType.UnsafeSetNil(ptr)
+ return
+ }
+ if c != '[' {
+ iter.ReportError("decode slice", "expect [ or n, but found "+string([]byte{c}))
+ return
+ }
+ c = iter.nextToken()
+ if c == ']' {
+ sliceType.UnsafeSet(ptr, sliceType.UnsafeMakeSlice(0, 0))
+ return
+ }
+ iter.unreadByte()
+ sliceType.UnsafeGrow(ptr, 1)
+ elemPtr := sliceType.UnsafeGetIndex(ptr, 0)
+ decoder.elemDecoder.Decode(elemPtr, iter)
+ length := 1
+ for c = iter.nextToken(); c == ','; c = iter.nextToken() {
+ idx := length
+ length += 1
+ sliceType.UnsafeGrow(ptr, length)
+ elemPtr = sliceType.UnsafeGetIndex(ptr, idx)
+ decoder.elemDecoder.Decode(elemPtr, iter)
+ }
+ if c != ']' {
+ iter.ReportError("decode slice", "expect ], but found "+string([]byte{c}))
+ return
+ }
+}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
similarity index 74%
rename from vendor/github.com/json-iterator/go/feature_reflect_struct_decoder.go
rename to vendor/github.com/json-iterator/go/reflect_struct_decoder.go
index d30804855..932641ac4 100644
--- a/vendor/github.com/json-iterator/go/feature_reflect_struct_decoder.go
+++ b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go
@@ -3,38 +3,78 @@ package jsoniter
import (
"fmt"
"io"
- "reflect"
"strings"
"unsafe"
+
+ "github.com/modern-go/reflect2"
)
-func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder) ValDecoder {
- knownHash := map[int32]struct{}{
+func decoderOfStruct(ctx *ctx, typ reflect2.Type) ValDecoder {
+ bindings := map[string]*Binding{}
+ structDescriptor := describeStruct(ctx, typ)
+ for _, binding := range structDescriptor.Fields {
+ for _, fromName := range binding.FromNames {
+ old := bindings[fromName]
+ if old == nil {
+ bindings[fromName] = binding
+ continue
+ }
+ ignoreOld, ignoreNew := resolveConflictBinding(ctx.frozenConfig, old, binding)
+ if ignoreOld {
+ delete(bindings, fromName)
+ }
+ if !ignoreNew {
+ bindings[fromName] = binding
+ }
+ }
+ }
+ fields := map[string]*structFieldDecoder{}
+ for k, binding := range bindings {
+ fields[k] = binding.Decoder.(*structFieldDecoder)
+ }
+
+ if !ctx.caseSensitive() {
+ for k, binding := range bindings {
+ if _, found := fields[strings.ToLower(k)]; !found {
+ fields[strings.ToLower(k)] = binding.Decoder.(*structFieldDecoder)
+ }
+ }
+ }
+
+ return createStructDecoder(ctx, typ, fields)
+}
+
+func createStructDecoder(ctx *ctx, typ reflect2.Type, fields map[string]*structFieldDecoder) ValDecoder {
+ if ctx.disallowUnknownFields {
+ return &generalStructDecoder{typ: typ, fields: fields, disallowUnknownFields: true}
+ }
+ knownHash := map[int64]struct{}{
0: {},
}
+
switch len(fields) {
case 0:
return &skipObjectDecoder{typ}
case 1:
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
return &oneFieldStructDecoder{typ, fieldHash, fieldDecoder}
}
case 2:
- var fieldHash1 int32
- var fieldHash2 int32
+ var fieldHash1 int64
+ var fieldHash2 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldHash1 == 0 {
@@ -47,17 +87,17 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
}
return &twoFieldsStructDecoder{typ, fieldHash1, fieldDecoder1, fieldHash2, fieldDecoder2}
case 3:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -76,19 +116,19 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName2, fieldDecoder2,
fieldName3, fieldDecoder3}
case 4:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
var fieldDecoder4 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -111,21 +151,21 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName3, fieldDecoder3,
fieldName4, fieldDecoder4}
case 5:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
var fieldDecoder4 *structFieldDecoder
var fieldDecoder5 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -152,12 +192,12 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName4, fieldDecoder4,
fieldName5, fieldDecoder5}
case 6:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
- var fieldName6 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
+ var fieldName6 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
@@ -165,10 +205,10 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
var fieldDecoder5 *structFieldDecoder
var fieldDecoder6 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -199,13 +239,13 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName5, fieldDecoder5,
fieldName6, fieldDecoder6}
case 7:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
- var fieldName6 int32
- var fieldName7 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
+ var fieldName6 int64
+ var fieldName7 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
@@ -214,10 +254,10 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
var fieldDecoder6 *structFieldDecoder
var fieldDecoder7 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -252,14 +292,14 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName6, fieldDecoder6,
fieldName7, fieldDecoder7}
case 8:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
- var fieldName6 int32
- var fieldName7 int32
- var fieldName8 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
+ var fieldName6 int64
+ var fieldName7 int64
+ var fieldName8 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
@@ -269,10 +309,10 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
var fieldDecoder7 *structFieldDecoder
var fieldDecoder8 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -311,15 +351,15 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName7, fieldDecoder7,
fieldName8, fieldDecoder8}
case 9:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
- var fieldName6 int32
- var fieldName7 int32
- var fieldName8 int32
- var fieldName9 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
+ var fieldName6 int64
+ var fieldName7 int64
+ var fieldName8 int64
+ var fieldName9 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
@@ -330,10 +370,10 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
var fieldDecoder8 *structFieldDecoder
var fieldDecoder9 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -376,16 +416,16 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName8, fieldDecoder8,
fieldName9, fieldDecoder9}
case 10:
- var fieldName1 int32
- var fieldName2 int32
- var fieldName3 int32
- var fieldName4 int32
- var fieldName5 int32
- var fieldName6 int32
- var fieldName7 int32
- var fieldName8 int32
- var fieldName9 int32
- var fieldName10 int32
+ var fieldName1 int64
+ var fieldName2 int64
+ var fieldName3 int64
+ var fieldName4 int64
+ var fieldName5 int64
+ var fieldName6 int64
+ var fieldName7 int64
+ var fieldName8 int64
+ var fieldName9 int64
+ var fieldName10 int64
var fieldDecoder1 *structFieldDecoder
var fieldDecoder2 *structFieldDecoder
var fieldDecoder3 *structFieldDecoder
@@ -397,10 +437,10 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
var fieldDecoder9 *structFieldDecoder
var fieldDecoder10 *structFieldDecoder
for fieldName, fieldDecoder := range fields {
- fieldHash := calcHash(fieldName)
+ fieldHash := calcHash(fieldName, ctx.caseSensitive())
_, known := knownHash[fieldHash]
if known {
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
knownHash[fieldHash] = struct{}{}
if fieldName1 == 0 {
@@ -447,61 +487,69 @@ func createStructDecoder(typ reflect.Type, fields map[string]*structFieldDecoder
fieldName9, fieldDecoder9,
fieldName10, fieldDecoder10}
}
- return &generalStructDecoder{typ, fields}
+ return &generalStructDecoder{typ, fields, false}
}
type generalStructDecoder struct {
- typ reflect.Type
- fields map[string]*structFieldDecoder
+ typ reflect2.Type
+ fields map[string]*structFieldDecoder
+ disallowUnknownFields bool
}
func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
if !iter.readObjectStart() {
return
}
- var fieldBytes []byte
- var field string
- if iter.cfg.objectFieldMustBeSimpleString {
- fieldBytes = iter.readObjectFieldAsBytes()
- field = *(*string)(unsafe.Pointer(&fieldBytes))
- } else {
- field = iter.ReadString()
- c := iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- }
- fieldDecoder := decoder.fields[strings.ToLower(field)]
- if fieldDecoder == nil {
- iter.Skip()
- } else {
- fieldDecoder.Decode(ptr, iter)
- }
- for iter.nextToken() == ',' {
- if iter.cfg.objectFieldMustBeSimpleString {
- fieldBytes := iter.readObjectFieldAsBytes()
- field = *(*string)(unsafe.Pointer(&fieldBytes))
- } else {
- field = iter.ReadString()
- c := iter.nextToken()
- if c != ':' {
- iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
- }
- }
- fieldDecoder = decoder.fields[strings.ToLower(field)]
- if fieldDecoder == nil {
- iter.Skip()
- } else {
- fieldDecoder.Decode(ptr, iter)
- }
+ var c byte
+ for c = ','; c == ','; c = iter.nextToken() {
+ decoder.decodeOneField(ptr, iter)
}
if iter.Error != nil && iter.Error != io.EOF {
iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error())
}
+ if c != '}' {
+ iter.ReportError("struct Decode", `expect }, but found `+string([]byte{c}))
+ }
+}
+
+func (decoder *generalStructDecoder) decodeOneField(ptr unsafe.Pointer, iter *Iterator) {
+ var field string
+ var fieldDecoder *structFieldDecoder
+ if iter.cfg.objectFieldMustBeSimpleString {
+ fieldBytes := iter.ReadStringAsSlice()
+ field = *(*string)(unsafe.Pointer(&fieldBytes))
+ fieldDecoder = decoder.fields[field]
+ if fieldDecoder == nil && !iter.cfg.caseSensitive {
+ fieldDecoder = decoder.fields[strings.ToLower(field)]
+ }
+ } else {
+ field = iter.ReadString()
+ fieldDecoder = decoder.fields[field]
+ if fieldDecoder == nil && !iter.cfg.caseSensitive {
+ fieldDecoder = decoder.fields[strings.ToLower(field)]
+ }
+ }
+ if fieldDecoder == nil {
+ if decoder.disallowUnknownFields {
+ msg := "found unknown field: " + field
+ iter.ReportError("ReadObject", msg)
+ }
+ c := iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
+ }
+ iter.Skip()
+ return
+ }
+ c := iter.nextToken()
+ if c != ':' {
+ iter.ReportError("ReadObject", "expect : after object field, but found "+string([]byte{c}))
+ }
+ fieldDecoder.Decode(ptr, iter)
}
type skipObjectDecoder struct {
- typ reflect.Type
+ typ reflect2.Type
}
func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
@@ -514,8 +562,8 @@ func (decoder *skipObjectDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
}
type oneFieldStructDecoder struct {
- typ reflect.Type
- fieldHash int32
+ typ reflect2.Type
+ fieldHash int64
fieldDecoder *structFieldDecoder
}
@@ -539,10 +587,10 @@ func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator)
}
type twoFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
}
@@ -569,12 +617,12 @@ func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
}
type threeFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
}
@@ -603,14 +651,14 @@ func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
}
type fourFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
}
@@ -641,16 +689,16 @@ func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
}
type fiveFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
}
@@ -683,18 +731,18 @@ func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
}
type sixFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
- fieldHash6 int32
+ fieldHash6 int64
fieldDecoder6 *structFieldDecoder
}
@@ -729,20 +777,20 @@ func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
}
type sevenFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
- fieldHash6 int32
+ fieldHash6 int64
fieldDecoder6 *structFieldDecoder
- fieldHash7 int32
+ fieldHash7 int64
fieldDecoder7 *structFieldDecoder
}
@@ -779,22 +827,22 @@ func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
}
type eightFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
- fieldHash6 int32
+ fieldHash6 int64
fieldDecoder6 *structFieldDecoder
- fieldHash7 int32
+ fieldHash7 int64
fieldDecoder7 *structFieldDecoder
- fieldHash8 int32
+ fieldHash8 int64
fieldDecoder8 *structFieldDecoder
}
@@ -833,24 +881,24 @@ func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat
}
type nineFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
- fieldHash6 int32
+ fieldHash6 int64
fieldDecoder6 *structFieldDecoder
- fieldHash7 int32
+ fieldHash7 int64
fieldDecoder7 *structFieldDecoder
- fieldHash8 int32
+ fieldHash8 int64
fieldDecoder8 *structFieldDecoder
- fieldHash9 int32
+ fieldHash9 int64
fieldDecoder9 *structFieldDecoder
}
@@ -891,26 +939,26 @@ func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato
}
type tenFieldsStructDecoder struct {
- typ reflect.Type
- fieldHash1 int32
+ typ reflect2.Type
+ fieldHash1 int64
fieldDecoder1 *structFieldDecoder
- fieldHash2 int32
+ fieldHash2 int64
fieldDecoder2 *structFieldDecoder
- fieldHash3 int32
+ fieldHash3 int64
fieldDecoder3 *structFieldDecoder
- fieldHash4 int32
+ fieldHash4 int64
fieldDecoder4 *structFieldDecoder
- fieldHash5 int32
+ fieldHash5 int64
fieldDecoder5 *structFieldDecoder
- fieldHash6 int32
+ fieldHash6 int64
fieldDecoder6 *structFieldDecoder
- fieldHash7 int32
+ fieldHash7 int64
fieldDecoder7 *structFieldDecoder
- fieldHash8 int32
+ fieldHash8 int64
fieldDecoder8 *structFieldDecoder
- fieldHash9 int32
+ fieldHash9 int64
fieldDecoder9 *structFieldDecoder
- fieldHash10 int32
+ fieldHash10 int64
fieldDecoder10 *structFieldDecoder
}
@@ -953,14 +1001,48 @@ func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator
}
type structFieldDecoder struct {
- field *reflect.StructField
+ field reflect2.StructField
fieldDecoder ValDecoder
}
func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
- fieldPtr := unsafe.Pointer(uintptr(ptr) + decoder.field.Offset)
+ fieldPtr := decoder.field.UnsafeGet(ptr)
decoder.fieldDecoder.Decode(fieldPtr, iter)
if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%s: %s", decoder.field.Name, iter.Error.Error())
+ iter.Error = fmt.Errorf("%s: %s", decoder.field.Name(), iter.Error.Error())
+ }
+}
+
+type stringModeStringDecoder struct {
+ elemDecoder ValDecoder
+ cfg *frozenConfig
+}
+
+func (decoder *stringModeStringDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ decoder.elemDecoder.Decode(ptr, iter)
+ str := *((*string)(ptr))
+ tempIter := decoder.cfg.BorrowIterator([]byte(str))
+ defer decoder.cfg.ReturnIterator(tempIter)
+ *((*string)(ptr)) = tempIter.ReadString()
+}
+
+type stringModeNumberDecoder struct {
+ elemDecoder ValDecoder
+}
+
+func (decoder *stringModeNumberDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
+ c := iter.nextToken()
+ if c != '"' {
+ iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
+ return
+ }
+ decoder.elemDecoder.Decode(ptr, iter)
+ if iter.Error != nil {
+ return
+ }
+ c = iter.readByte()
+ if c != '"' {
+ iter.ReportError("stringModeNumberDecoder", `expect ", but found `+string([]byte{c}))
+ return
}
}
diff --git a/vendor/github.com/json-iterator/go/feature_reflect_object.go b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go
similarity index 53%
rename from vendor/github.com/json-iterator/go/feature_reflect_object.go
rename to vendor/github.com/json-iterator/go/reflect_struct_encoder.go
index 036545cbe..d0759cf64 100644
--- a/vendor/github.com/json-iterator/go/feature_reflect_object.go
+++ b/vendor/github.com/json-iterator/go/reflect_struct_encoder.go
@@ -2,20 +2,20 @@ package jsoniter
import (
"fmt"
+ "github.com/modern-go/reflect2"
"io"
"reflect"
- "strings"
"unsafe"
)
-func encoderOfStruct(cfg *frozenConfig, prefix string, typ reflect.Type) ValEncoder {
+func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder {
type bindingTo struct {
binding *Binding
toName string
ignored bool
}
orderedBindings := []*bindingTo{}
- structDescriptor := describeStruct(cfg, prefix, typ)
+ structDescriptor := describeStruct(ctx, typ)
for _, binding := range structDescriptor.Fields {
for _, toName := range binding.ToNames {
new := &bindingTo{
@@ -26,7 +26,7 @@ func encoderOfStruct(cfg *frozenConfig, prefix string, typ reflect.Type) ValEnco
if old.toName != toName {
continue
}
- old.ignored, new.ignored = resolveConflictBinding(cfg, old.binding, new.binding)
+ old.ignored, new.ignored = resolveConflictBinding(ctx.frozenConfig, old.binding, new.binding)
}
orderedBindings = append(orderedBindings, new)
}
@@ -43,13 +43,36 @@ func encoderOfStruct(cfg *frozenConfig, prefix string, typ reflect.Type) ValEnco
})
}
}
- return &structEncoder{typ, structDescriptor.onePtrEmbedded,
- structDescriptor.onePtrOptimization, finalOrderedFields}
+ return &structEncoder{typ, finalOrderedFields}
+}
+
+func createCheckIsEmpty(ctx *ctx, typ reflect2.Type) checkIsEmpty {
+ encoder := createEncoderOfNative(ctx, typ)
+ if encoder != nil {
+ return encoder
+ }
+ kind := typ.Kind()
+ switch kind {
+ case reflect.Interface:
+ return &dynamicEncoder{typ}
+ case reflect.Struct:
+ return &structEncoder{typ: typ}
+ case reflect.Array:
+ return &arrayEncoder{}
+ case reflect.Slice:
+ return &sliceEncoder{}
+ case reflect.Map:
+ return encoderOfMap(ctx, typ)
+ case reflect.Ptr:
+ return &OptionalEncoder{}
+ default:
+ return &lazyErrorEncoder{err: fmt.Errorf("unsupported type: %v", typ)}
+ }
}
func resolveConflictBinding(cfg *frozenConfig, old, new *Binding) (ignoreOld, ignoreNew bool) {
- newTagged := new.Field.Tag.Get(cfg.getTagKey()) != ""
- oldTagged := old.Field.Tag.Get(cfg.getTagKey()) != ""
+ newTagged := new.Field.Tag().Get(cfg.getTagKey()) != ""
+ oldTagged := old.Field.Tag().Get(cfg.getTagKey()) != ""
if newTagged {
if oldTagged {
if len(old.levels) > len(new.levels) {
@@ -76,60 +99,41 @@ func resolveConflictBinding(cfg *frozenConfig, old, new *Binding) (ignoreOld, ig
}
}
-func decoderOfStruct(cfg *frozenConfig, prefix string, typ reflect.Type) ValDecoder {
- bindings := map[string]*Binding{}
- structDescriptor := describeStruct(cfg, prefix, typ)
- for _, binding := range structDescriptor.Fields {
- for _, fromName := range binding.FromNames {
- old := bindings[fromName]
- if old == nil {
- bindings[fromName] = binding
- continue
- }
- ignoreOld, ignoreNew := resolveConflictBinding(cfg, old, binding)
- if ignoreOld {
- delete(bindings, fromName)
- }
- if !ignoreNew {
- bindings[fromName] = binding
- }
- }
- }
- fields := map[string]*structFieldDecoder{}
- for k, binding := range bindings {
- fields[strings.ToLower(k)] = binding.Decoder.(*structFieldDecoder)
- }
- return createStructDecoder(typ, fields)
-}
-
type structFieldEncoder struct {
- field *reflect.StructField
+ field reflect2.StructField
fieldEncoder ValEncoder
omitempty bool
}
func (encoder *structFieldEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
- fieldPtr := unsafe.Pointer(uintptr(ptr) + encoder.field.Offset)
+ fieldPtr := encoder.field.UnsafeGet(ptr)
encoder.fieldEncoder.Encode(fieldPtr, stream)
if stream.Error != nil && stream.Error != io.EOF {
- stream.Error = fmt.Errorf("%s: %s", encoder.field.Name, stream.Error.Error())
+ stream.Error = fmt.Errorf("%s: %s", encoder.field.Name(), stream.Error.Error())
}
}
-func (encoder *structFieldEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *structFieldEncoder) IsEmpty(ptr unsafe.Pointer) bool {
- fieldPtr := unsafe.Pointer(uintptr(ptr) + encoder.field.Offset)
+ fieldPtr := encoder.field.UnsafeGet(ptr)
return encoder.fieldEncoder.IsEmpty(fieldPtr)
}
+func (encoder *structFieldEncoder) IsEmbeddedPtrNil(ptr unsafe.Pointer) bool {
+ isEmbeddedPtrNil, converted := encoder.fieldEncoder.(IsEmbeddedPtrNil)
+ if !converted {
+ return false
+ }
+ fieldPtr := encoder.field.UnsafeGet(ptr)
+ return isEmbeddedPtrNil.IsEmbeddedPtrNil(fieldPtr)
+}
+
+type IsEmbeddedPtrNil interface {
+ IsEmbeddedPtrNil(ptr unsafe.Pointer) bool
+}
+
type structEncoder struct {
- typ reflect.Type
- onePtrEmbedded bool
- onePtrOptimization bool
- fields []structFieldTo
+ typ reflect2.Type
+ fields []structFieldTo
}
type structFieldTo struct {
@@ -144,6 +148,9 @@ func (encoder *structEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
if field.encoder.omitempty && field.encoder.IsEmpty(ptr) {
continue
}
+ if field.encoder.IsEmbeddedPtrNil(ptr) {
+ continue
+ }
if isNotFirst {
stream.WriteMore()
}
@@ -157,24 +164,6 @@ func (encoder *structEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
}
}
-func (encoder *structEncoder) EncodeInterface(val interface{}, stream *Stream) {
- e := (*emptyInterface)(unsafe.Pointer(&val))
- if encoder.onePtrOptimization {
- if e.word == nil && encoder.onePtrEmbedded {
- stream.WriteObjectStart()
- stream.WriteObjectEnd()
- return
- }
- ptr := uintptr(e.word)
- e.word = unsafe.Pointer(&ptr)
- }
- if reflect.TypeOf(val).Kind() == reflect.Ptr {
- encoder.Encode(unsafe.Pointer(&e.word), stream)
- } else {
- encoder.Encode(e.word, stream)
- }
-}
-
func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool {
return false
}
@@ -186,10 +175,36 @@ func (encoder *emptyStructEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
stream.WriteEmptyObject()
}
-func (encoder *emptyStructEncoder) EncodeInterface(val interface{}, stream *Stream) {
- WriteToStream(val, stream, encoder)
-}
-
func (encoder *emptyStructEncoder) IsEmpty(ptr unsafe.Pointer) bool {
return false
}
+
+type stringModeNumberEncoder struct {
+ elemEncoder ValEncoder
+}
+
+func (encoder *stringModeNumberEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ stream.writeByte('"')
+ encoder.elemEncoder.Encode(ptr, stream)
+ stream.writeByte('"')
+}
+
+func (encoder *stringModeNumberEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.elemEncoder.IsEmpty(ptr)
+}
+
+type stringModeStringEncoder struct {
+ elemEncoder ValEncoder
+ cfg *frozenConfig
+}
+
+func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
+ tempStream := encoder.cfg.BorrowStream(nil)
+ defer encoder.cfg.ReturnStream(tempStream)
+ encoder.elemEncoder.Encode(ptr, tempStream)
+ stream.WriteString(string(tempStream.Buffer()))
+}
+
+func (encoder *stringModeStringEncoder) IsEmpty(ptr unsafe.Pointer) bool {
+ return encoder.elemEncoder.IsEmpty(ptr)
+}
diff --git a/vendor/github.com/json-iterator/go/feature_stream.go b/vendor/github.com/json-iterator/go/stream.go
similarity index 62%
rename from vendor/github.com/json-iterator/go/feature_stream.go
rename to vendor/github.com/json-iterator/go/stream.go
index 97355eb5b..17662fded 100644
--- a/vendor/github.com/json-iterator/go/feature_stream.go
+++ b/vendor/github.com/json-iterator/go/stream.go
@@ -10,7 +10,6 @@ type Stream struct {
cfg *frozenConfig
out io.Writer
buf []byte
- n int
Error error
indention int
Attachment interface{} // open for customized encoder
@@ -24,8 +23,7 @@ func NewStream(cfg API, out io.Writer, bufSize int) *Stream {
return &Stream{
cfg: cfg.(*frozenConfig),
out: out,
- buf: make([]byte, bufSize),
- n: 0,
+ buf: make([]byte, 0, bufSize),
Error: nil,
indention: 0,
}
@@ -39,22 +37,27 @@ func (stream *Stream) Pool() StreamPool {
// Reset reuse this stream instance by assign a new writer
func (stream *Stream) Reset(out io.Writer) {
stream.out = out
- stream.n = 0
+ stream.buf = stream.buf[:0]
}
// Available returns how many bytes are unused in the buffer.
func (stream *Stream) Available() int {
- return len(stream.buf) - stream.n
+ return cap(stream.buf) - len(stream.buf)
}
// Buffered returns the number of bytes that have been written into the current buffer.
func (stream *Stream) Buffered() int {
- return stream.n
+ return len(stream.buf)
}
// Buffer if writer is nil, use this method to take the result
func (stream *Stream) Buffer() []byte {
- return stream.buf[:stream.n]
+ return stream.buf
+}
+
+// SetBuffer allows to append to the internal buffer directly
+func (stream *Stream) SetBuffer(buf []byte) {
+ stream.buf = buf
}
// Write writes the contents of p into the buffer.
@@ -62,97 +65,34 @@ func (stream *Stream) Buffer() []byte {
// If nn < len(p), it also returns an error explaining
// why the write is short.
func (stream *Stream) Write(p []byte) (nn int, err error) {
- for len(p) > stream.Available() && stream.Error == nil {
- if stream.out == nil {
- stream.growAtLeast(len(p))
- } else {
- var n int
- if stream.Buffered() == 0 {
- // Large write, empty buffer.
- // Write directly from p to avoid copy.
- n, stream.Error = stream.out.Write(p)
- } else {
- n = copy(stream.buf[stream.n:], p)
- stream.n += n
- stream.Flush()
- }
- nn += n
- p = p[n:]
- }
+ stream.buf = append(stream.buf, p...)
+ if stream.out != nil {
+ nn, err = stream.out.Write(stream.buf)
+ stream.buf = stream.buf[nn:]
+ return
}
- if stream.Error != nil {
- return nn, stream.Error
- }
- n := copy(stream.buf[stream.n:], p)
- stream.n += n
- nn += n
- return nn, nil
+ return len(p), nil
}
// WriteByte writes a single byte.
func (stream *Stream) writeByte(c byte) {
- if stream.Error != nil {
- return
- }
- if stream.Available() < 1 {
- stream.growAtLeast(1)
- }
- stream.buf[stream.n] = c
- stream.n++
+ stream.buf = append(stream.buf, c)
}
func (stream *Stream) writeTwoBytes(c1 byte, c2 byte) {
- if stream.Error != nil {
- return
- }
- if stream.Available() < 2 {
- stream.growAtLeast(2)
- }
- stream.buf[stream.n] = c1
- stream.buf[stream.n+1] = c2
- stream.n += 2
+ stream.buf = append(stream.buf, c1, c2)
}
func (stream *Stream) writeThreeBytes(c1 byte, c2 byte, c3 byte) {
- if stream.Error != nil {
- return
- }
- if stream.Available() < 3 {
- stream.growAtLeast(3)
- }
- stream.buf[stream.n] = c1
- stream.buf[stream.n+1] = c2
- stream.buf[stream.n+2] = c3
- stream.n += 3
+ stream.buf = append(stream.buf, c1, c2, c3)
}
func (stream *Stream) writeFourBytes(c1 byte, c2 byte, c3 byte, c4 byte) {
- if stream.Error != nil {
- return
- }
- if stream.Available() < 4 {
- stream.growAtLeast(4)
- }
- stream.buf[stream.n] = c1
- stream.buf[stream.n+1] = c2
- stream.buf[stream.n+2] = c3
- stream.buf[stream.n+3] = c4
- stream.n += 4
+ stream.buf = append(stream.buf, c1, c2, c3, c4)
}
func (stream *Stream) writeFiveBytes(c1 byte, c2 byte, c3 byte, c4 byte, c5 byte) {
- if stream.Error != nil {
- return
- }
- if stream.Available() < 5 {
- stream.growAtLeast(5)
- }
- stream.buf[stream.n] = c1
- stream.buf[stream.n+1] = c2
- stream.buf[stream.n+2] = c3
- stream.buf[stream.n+3] = c4
- stream.buf[stream.n+4] = c5
- stream.n += 5
+ stream.buf = append(stream.buf, c1, c2, c3, c4, c5)
}
// Flush writes any buffered data to the underlying io.Writer.
@@ -163,56 +103,20 @@ func (stream *Stream) Flush() error {
if stream.Error != nil {
return stream.Error
}
- if stream.n == 0 {
- return nil
- }
- n, err := stream.out.Write(stream.buf[0:stream.n])
- if n < stream.n && err == nil {
- err = io.ErrShortWrite
- }
+ n, err := stream.out.Write(stream.buf)
if err != nil {
- if n > 0 && n < stream.n {
- copy(stream.buf[0:stream.n-n], stream.buf[n:stream.n])
+ if stream.Error == nil {
+ stream.Error = err
}
- stream.n -= n
- stream.Error = err
return err
}
- stream.n = 0
+ stream.buf = stream.buf[n:]
return nil
}
-func (stream *Stream) ensure(minimal int) {
- available := stream.Available()
- if available < minimal {
- stream.growAtLeast(minimal)
- }
-}
-
-func (stream *Stream) growAtLeast(minimal int) {
- if stream.out != nil {
- stream.Flush()
- if stream.Available() >= minimal {
- return
- }
- }
- toGrow := len(stream.buf)
- if toGrow < minimal {
- toGrow = minimal
- }
- newBuf := make([]byte, len(stream.buf)+toGrow)
- copy(newBuf, stream.Buffer())
- stream.buf = newBuf
-}
-
// WriteRaw write string out without quotes, just like []byte
func (stream *Stream) WriteRaw(s string) {
- stream.ensure(len(s))
- if stream.Error != nil {
- return
- }
- n := copy(stream.buf[stream.n:], s)
- stream.n += n
+ stream.buf = append(stream.buf, s...)
}
// WriteNil write null to stream
@@ -273,6 +177,7 @@ func (stream *Stream) WriteEmptyObject() {
func (stream *Stream) WriteMore() {
stream.writeByte(',')
stream.writeIndention(0)
+ stream.Flush()
}
// WriteArrayStart write [ with possible indention
@@ -300,9 +205,7 @@ func (stream *Stream) writeIndention(delta int) {
}
stream.writeByte('\n')
toWrite := stream.indention - delta
- stream.ensure(toWrite)
- for i := 0; i < toWrite && stream.n < len(stream.buf); i++ {
- stream.buf[stream.n] = ' '
- stream.n++
+ for i := 0; i < toWrite; i++ {
+ stream.buf = append(stream.buf, ' ')
}
}
diff --git a/vendor/github.com/json-iterator/go/feature_stream_float.go b/vendor/github.com/json-iterator/go/stream_float.go
similarity index 70%
rename from vendor/github.com/json-iterator/go/feature_stream_float.go
rename to vendor/github.com/json-iterator/go/stream_float.go
index 9a404e11d..826aa594a 100644
--- a/vendor/github.com/json-iterator/go/feature_stream_float.go
+++ b/vendor/github.com/json-iterator/go/stream_float.go
@@ -1,6 +1,7 @@
package jsoniter
import (
+ "fmt"
"math"
"strconv"
)
@@ -13,6 +14,10 @@ func init() {
// WriteFloat32 write float32 to stream
func (stream *Stream) WriteFloat32(val float32) {
+ if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) {
+ stream.Error = fmt.Errorf("unsupported value: %f", val)
+ return
+ }
abs := math.Abs(float64(val))
fmt := byte('f')
// Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right.
@@ -21,11 +26,15 @@ func (stream *Stream) WriteFloat32(val float32) {
fmt = 'e'
}
}
- stream.WriteRaw(strconv.FormatFloat(float64(val), fmt, -1, 32))
+ stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 32)
}
// WriteFloat32Lossy write float32 to stream with ONLY 6 digits precision although much much faster
func (stream *Stream) WriteFloat32Lossy(val float32) {
+ if math.IsInf(float64(val), 0) || math.IsNaN(float64(val)) {
+ stream.Error = fmt.Errorf("unsupported value: %f", val)
+ return
+ }
if val < 0 {
stream.writeByte('-')
val = -val
@@ -43,18 +52,21 @@ func (stream *Stream) WriteFloat32Lossy(val float32) {
return
}
stream.writeByte('.')
- stream.ensure(10)
for p := precision - 1; p > 0 && fval < pow10[p]; p-- {
stream.writeByte('0')
}
stream.WriteUint64(fval)
- for stream.buf[stream.n-1] == '0' {
- stream.n--
+ for stream.buf[len(stream.buf)-1] == '0' {
+ stream.buf = stream.buf[:len(stream.buf)-1]
}
}
// WriteFloat64 write float64 to stream
func (stream *Stream) WriteFloat64(val float64) {
+ if math.IsInf(val, 0) || math.IsNaN(val) {
+ stream.Error = fmt.Errorf("unsupported value: %f", val)
+ return
+ }
abs := math.Abs(val)
fmt := byte('f')
// Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right.
@@ -63,11 +75,15 @@ func (stream *Stream) WriteFloat64(val float64) {
fmt = 'e'
}
}
- stream.WriteRaw(strconv.FormatFloat(float64(val), fmt, -1, 64))
+ stream.buf = strconv.AppendFloat(stream.buf, float64(val), fmt, -1, 64)
}
// WriteFloat64Lossy write float64 to stream with ONLY 6 digits precision although much much faster
func (stream *Stream) WriteFloat64Lossy(val float64) {
+ if math.IsInf(val, 0) || math.IsNaN(val) {
+ stream.Error = fmt.Errorf("unsupported value: %f", val)
+ return
+ }
if val < 0 {
stream.writeByte('-')
val = -val
@@ -85,12 +101,11 @@ func (stream *Stream) WriteFloat64Lossy(val float64) {
return
}
stream.writeByte('.')
- stream.ensure(10)
for p := precision - 1; p > 0 && fval < pow10[p]; p-- {
stream.writeByte('0')
}
stream.WriteUint64(fval)
- for stream.buf[stream.n-1] == '0' {
- stream.n--
+ for stream.buf[len(stream.buf)-1] == '0' {
+ stream.buf = stream.buf[:len(stream.buf)-1]
}
}
diff --git a/vendor/github.com/json-iterator/go/stream_int.go b/vendor/github.com/json-iterator/go/stream_int.go
new file mode 100644
index 000000000..d1059ee4c
--- /dev/null
+++ b/vendor/github.com/json-iterator/go/stream_int.go
@@ -0,0 +1,190 @@
+package jsoniter
+
+var digits []uint32
+
+func init() {
+ digits = make([]uint32, 1000)
+ for i := uint32(0); i < 1000; i++ {
+ digits[i] = (((i / 100) + '0') << 16) + ((((i / 10) % 10) + '0') << 8) + i%10 + '0'
+ if i < 10 {
+ digits[i] += 2 << 24
+ } else if i < 100 {
+ digits[i] += 1 << 24
+ }
+ }
+}
+
+func writeFirstBuf(space []byte, v uint32) []byte {
+ start := v >> 24
+ if start == 0 {
+ space = append(space, byte(v>>16), byte(v>>8))
+ } else if start == 1 {
+ space = append(space, byte(v>>8))
+ }
+ space = append(space, byte(v))
+ return space
+}
+
+func writeBuf(buf []byte, v uint32) []byte {
+ return append(buf, byte(v>>16), byte(v>>8), byte(v))
+}
+
+// WriteUint8 write uint8 to stream
+func (stream *Stream) WriteUint8(val uint8) {
+ stream.buf = writeFirstBuf(stream.buf, digits[val])
+}
+
+// WriteInt8 write int8 to stream
+func (stream *Stream) WriteInt8(nval int8) {
+ var val uint8
+ if nval < 0 {
+ val = uint8(-nval)
+ stream.buf = append(stream.buf, '-')
+ } else {
+ val = uint8(nval)
+ }
+ stream.buf = writeFirstBuf(stream.buf, digits[val])
+}
+
+// WriteUint16 write uint16 to stream
+func (stream *Stream) WriteUint16(val uint16) {
+ q1 := val / 1000
+ if q1 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[val])
+ return
+ }
+ r1 := val - q1*1000
+ stream.buf = writeFirstBuf(stream.buf, digits[q1])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+}
+
+// WriteInt16 write int16 to stream
+func (stream *Stream) WriteInt16(nval int16) {
+ var val uint16
+ if nval < 0 {
+ val = uint16(-nval)
+ stream.buf = append(stream.buf, '-')
+ } else {
+ val = uint16(nval)
+ }
+ stream.WriteUint16(val)
+}
+
+// WriteUint32 write uint32 to stream
+func (stream *Stream) WriteUint32(val uint32) {
+ q1 := val / 1000
+ if q1 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[val])
+ return
+ }
+ r1 := val - q1*1000
+ q2 := q1 / 1000
+ if q2 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q1])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+ }
+ r2 := q1 - q2*1000
+ q3 := q2 / 1000
+ if q3 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q2])
+ } else {
+ r3 := q2 - q3*1000
+ stream.buf = append(stream.buf, byte(q3+'0'))
+ stream.buf = writeBuf(stream.buf, digits[r3])
+ }
+ stream.buf = writeBuf(stream.buf, digits[r2])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+}
+
+// WriteInt32 write int32 to stream
+func (stream *Stream) WriteInt32(nval int32) {
+ var val uint32
+ if nval < 0 {
+ val = uint32(-nval)
+ stream.buf = append(stream.buf, '-')
+ } else {
+ val = uint32(nval)
+ }
+ stream.WriteUint32(val)
+}
+
+// WriteUint64 write uint64 to stream
+func (stream *Stream) WriteUint64(val uint64) {
+ q1 := val / 1000
+ if q1 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[val])
+ return
+ }
+ r1 := val - q1*1000
+ q2 := q1 / 1000
+ if q2 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q1])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+ }
+ r2 := q1 - q2*1000
+ q3 := q2 / 1000
+ if q3 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q2])
+ stream.buf = writeBuf(stream.buf, digits[r2])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+ }
+ r3 := q2 - q3*1000
+ q4 := q3 / 1000
+ if q4 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q3])
+ stream.buf = writeBuf(stream.buf, digits[r3])
+ stream.buf = writeBuf(stream.buf, digits[r2])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+ }
+ r4 := q3 - q4*1000
+ q5 := q4 / 1000
+ if q5 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q4])
+ stream.buf = writeBuf(stream.buf, digits[r4])
+ stream.buf = writeBuf(stream.buf, digits[r3])
+ stream.buf = writeBuf(stream.buf, digits[r2])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+ return
+ }
+ r5 := q4 - q5*1000
+ q6 := q5 / 1000
+ if q6 == 0 {
+ stream.buf = writeFirstBuf(stream.buf, digits[q5])
+ } else {
+ stream.buf = writeFirstBuf(stream.buf, digits[q6])
+ r6 := q5 - q6*1000
+ stream.buf = writeBuf(stream.buf, digits[r6])
+ }
+ stream.buf = writeBuf(stream.buf, digits[r5])
+ stream.buf = writeBuf(stream.buf, digits[r4])
+ stream.buf = writeBuf(stream.buf, digits[r3])
+ stream.buf = writeBuf(stream.buf, digits[r2])
+ stream.buf = writeBuf(stream.buf, digits[r1])
+}
+
+// WriteInt64 write int64 to stream
+func (stream *Stream) WriteInt64(nval int64) {
+ var val uint64
+ if nval < 0 {
+ val = uint64(-nval)
+ stream.buf = append(stream.buf, '-')
+ } else {
+ val = uint64(nval)
+ }
+ stream.WriteUint64(val)
+}
+
+// WriteInt write int to stream
+func (stream *Stream) WriteInt(val int) {
+ stream.WriteInt64(int64(val))
+}
+
+// WriteUint write uint to stream
+func (stream *Stream) WriteUint(val uint) {
+ stream.WriteUint64(uint64(val))
+}
diff --git a/vendor/github.com/json-iterator/go/feature_stream_string.go b/vendor/github.com/json-iterator/go/stream_str.go
similarity index 91%
rename from vendor/github.com/json-iterator/go/feature_stream_string.go
rename to vendor/github.com/json-iterator/go/stream_str.go
index 334282f05..54c2ba0b3 100644
--- a/vendor/github.com/json-iterator/go/feature_stream_string.go
+++ b/vendor/github.com/json-iterator/go/stream_str.go
@@ -219,34 +219,22 @@ var hex = "0123456789abcdef"
// WriteStringWithHTMLEscaped write string to stream with html special characters escaped
func (stream *Stream) WriteStringWithHTMLEscaped(s string) {
- stream.ensure(32)
valLen := len(s)
- toWriteLen := valLen
- bufLengthMinusTwo := len(stream.buf) - 2 // make room for the quotes
- if stream.n+toWriteLen > bufLengthMinusTwo {
- toWriteLen = bufLengthMinusTwo - stream.n
- }
- n := stream.n
- stream.buf[n] = '"'
- n++
+ stream.buf = append(stream.buf, '"')
// write string, the fast path, without utf8 and escape support
i := 0
- for ; i < toWriteLen; i++ {
+ for ; i < valLen; i++ {
c := s[i]
if c < utf8.RuneSelf && htmlSafeSet[c] {
- stream.buf[n] = c
- n++
+ stream.buf = append(stream.buf, c)
} else {
break
}
}
if i == valLen {
- stream.buf[n] = '"'
- n++
- stream.n = n
+ stream.buf = append(stream.buf, '"')
return
}
- stream.n = n
writeStringSlowPathWithHTMLEscaped(stream, i, s, valLen)
}
@@ -321,34 +309,22 @@ func writeStringSlowPathWithHTMLEscaped(stream *Stream, i int, s string, valLen
// WriteString write string to stream without html escape
func (stream *Stream) WriteString(s string) {
- stream.ensure(32)
valLen := len(s)
- toWriteLen := valLen
- bufLengthMinusTwo := len(stream.buf) - 2 // make room for the quotes
- if stream.n+toWriteLen > bufLengthMinusTwo {
- toWriteLen = bufLengthMinusTwo - stream.n
- }
- n := stream.n
- stream.buf[n] = '"'
- n++
+ stream.buf = append(stream.buf, '"')
// write string, the fast path, without utf8 and escape support
i := 0
- for ; i < toWriteLen; i++ {
+ for ; i < valLen; i++ {
c := s[i]
if c > 31 && c != '"' && c != '\\' {
- stream.buf[n] = c
- n++
+ stream.buf = append(stream.buf, c)
} else {
break
}
}
if i == valLen {
- stream.buf[n] = '"'
- n++
- stream.n = n
+ stream.buf = append(stream.buf, '"')
return
}
- stream.n = n
writeStringSlowPath(stream, i, s, valLen)
}
diff --git a/vendor/github.com/linode/linodego/account.go b/vendor/github.com/linode/linodego/account.go
index 5d6774caa..d6092f07d 100644
--- a/vendor/github.com/linode/linodego/account.go
+++ b/vendor/github.com/linode/linodego/account.go
@@ -8,14 +8,15 @@ type Account struct {
LastName string `json:"last_name"`
Email string `json:"email"`
Company string `json:"company"`
- Address1 string `json:"address1"`
- Address2 string `json:"address2"`
+ Address1 string `json:"address_1"`
+ Address2 string `json:"address_2"`
Balance float32 `json:"balance"`
City string `json:"city"`
State string `json:"state"`
Zip string `json:"zip"`
Country string `json:"country"`
TaxID string `json:"tax_id"`
+ Phone string `json:"phone"`
CreditCard *CreditCard `json:"credit_card"`
}
diff --git a/vendor/github.com/linode/linodego/account_events.go b/vendor/github.com/linode/linodego/account_events.go
index e2365c35b..8820966b1 100644
--- a/vendor/github.com/linode/linodego/account_events.go
+++ b/vendor/github.com/linode/linodego/account_events.go
@@ -54,59 +54,80 @@ type EventAction string
// EventAction constants represent the actions that cause an Event. New actions may be added in the future.
const (
+ ActionAccountUpdate EventAction = "account_update"
+ ActionAccountSettingsUpdate EventAction = "account_settings_update"
ActionBackupsEnable EventAction = "backups_enable"
ActionBackupsCancel EventAction = "backups_cancel"
ActionBackupsRestore EventAction = "backups_restore"
ActionCommunityQuestionReply EventAction = "community_question_reply"
+ ActionCommunityLike EventAction = "community_like"
ActionCreateCardUpdated EventAction = "credit_card_updated"
ActionDiskCreate EventAction = "disk_create"
ActionDiskDelete EventAction = "disk_delete"
+ ActionDiskUpdate EventAction = "disk_update"
ActionDiskDuplicate EventAction = "disk_duplicate"
ActionDiskImagize EventAction = "disk_imagize"
ActionDiskResize EventAction = "disk_resize"
ActionDNSRecordCreate EventAction = "dns_record_create"
ActionDNSRecordDelete EventAction = "dns_record_delete"
+ ActionDNSRecordUpdate EventAction = "dns_record_update"
ActionDNSZoneCreate EventAction = "dns_zone_create"
ActionDNSZoneDelete EventAction = "dns_zone_delete"
+ ActionDNSZoneUpdate EventAction = "dns_zone_update"
+ ActionHostReboot EventAction = "host_reboot"
ActionImageDelete EventAction = "image_delete"
+ ActionImageUpdate EventAction = "image_update"
+ ActionLassieReboot EventAction = "lassie_reboot"
ActionLinodeAddIP EventAction = "linode_addip"
ActionLinodeBoot EventAction = "linode_boot"
ActionLinodeClone EventAction = "linode_clone"
ActionLinodeCreate EventAction = "linode_create"
ActionLinodeDelete EventAction = "linode_delete"
+ ActionLinodeUpdate EventAction = "linode_update"
ActionLinodeDeleteIP EventAction = "linode_deleteip"
ActionLinodeMigrate EventAction = "linode_migrate"
ActionLinodeMutate EventAction = "linode_mutate"
+ ActionLinodeMutateCreate EventAction = "linode_mutate_create"
ActionLinodeReboot EventAction = "linode_reboot"
ActionLinodeRebuild EventAction = "linode_rebuild"
ActionLinodeResize EventAction = "linode_resize"
+ ActionLinodeResizeCreate EventAction = "linode_resize_create"
ActionLinodeShutdown EventAction = "linode_shutdown"
ActionLinodeSnapshot EventAction = "linode_snapshot"
+ ActionLinodeConfigCreate EventAction = "linode_config_create"
+ ActionLinodeConfigDelete EventAction = "linode_config_delete"
+ ActionLinodeConfigUpdate EventAction = "linode_config_update"
+ ActionLishBoot EventAction = "lish_boot"
ActionLongviewClientCreate EventAction = "longviewclient_create"
ActionLongviewClientDelete EventAction = "longviewclient_delete"
+ ActionLongviewClientUpdate EventAction = "longviewclient_update"
ActionManagedDisabled EventAction = "managed_disabled"
ActionManagedEnabled EventAction = "managed_enabled"
ActionManagedServiceCreate EventAction = "managed_service_create"
ActionManagedServiceDelete EventAction = "managed_service_delete"
ActionNodebalancerCreate EventAction = "nodebalancer_create"
ActionNodebalancerDelete EventAction = "nodebalancer_delete"
+ ActionNodebalancerUpdate EventAction = "nodebalancer_update"
ActionNodebalancerConfigCreate EventAction = "nodebalancer_config_create"
ActionNodebalancerConfigDelete EventAction = "nodebalancer_config_delete"
+ ActionNodebalancerConfigUpdate EventAction = "nodebalancer_config_update"
ActionPasswordReset EventAction = "password_reset"
ActionPaymentSubmitted EventAction = "payment_submitted"
ActionStackScriptCreate EventAction = "stackscript_create"
ActionStackScriptDelete EventAction = "stackscript_delete"
+ ActionStackScriptUpdate EventAction = "stackscript_update"
ActionStackScriptPublicize EventAction = "stackscript_publicize"
ActionStackScriptRevise EventAction = "stackscript_revise"
ActionTFADisabled EventAction = "tfa_disabled"
ActionTFAEnabled EventAction = "tfa_enabled"
ActionTicketAttachmentUpload EventAction = "ticket_attachment_upload"
ActionTicketCreate EventAction = "ticket_create"
- ActionTicketReply EventAction = "ticket_reply"
+ ActionTicketUpdate EventAction = "ticket_update"
ActionVolumeAttach EventAction = "volume_attach"
ActionVolumeClone EventAction = "volume_clone"
ActionVolumeCreate EventAction = "volume_create"
ActionVolumeDelte EventAction = "volume_delete"
+ ActionVolumeUpdate EventAction = "volume_update"
ActionVolumeDetach EventAction = "volume_detach"
ActionVolumeResize EventAction = "volume_resize"
)
@@ -114,10 +135,12 @@ const (
// EntityType constants start with Entity and include Linode API Event Entity Types
type EntityType string
-// EntityType contants are the entities an Event can be related to
+// EntityType contants are the entities an Event can be related to.
const (
- EntityLinode EntityType = "linode"
- EntityDisk EntityType = "disk"
+ EntityLinode EntityType = "linode"
+ EntityDisk EntityType = "disk"
+ EntityDomain EntityType = "domain"
+ EntityNodebalancer EntityType = "nodebalancer"
)
// EventStatus constants start with Event and include Linode API Event Status values
diff --git a/vendor/github.com/linode/linodego/account_notifications.go b/vendor/github.com/linode/linodego/account_notifications.go
index 6b63e3850..1d2de2e62 100644
--- a/vendor/github.com/linode/linodego/account_notifications.go
+++ b/vendor/github.com/linode/linodego/account_notifications.go
@@ -10,13 +10,14 @@ type Notification struct {
UntilStr string `json:"until"`
WhenStr string `json:"when"`
- Label string `json:"label"`
- Message string `json:"message"`
- Type string `json:"type"`
- Severity string `json:"severity"`
- Entity *NotificationEntity `json:"entity"`
- Until *time.Time `json:"-"`
- When *time.Time `json:"-"`
+ Label string `json:"label"`
+ Body *string `json:"body"`
+ Message string `json:"message"`
+ Type NotificationType `json:"type"`
+ Severity NotificationSeverity `json:"severity"`
+ Entity *NotificationEntity `json:"entity"`
+ Until *time.Time `json:"-"`
+ When *time.Time `json:"-"`
}
// NotificationEntity adds detailed information about the Notification.
@@ -28,6 +29,33 @@ type NotificationEntity struct {
URL string `json:"url"`
}
+// NotificationSeverity constants start with Notification and include all known Linode API Notification Severities.
+type NotificationSeverity string
+
+// NotificationSeverity constants represent the actions that cause a Notification. New severities may be added in the future.
+const (
+ NotificationMinor NotificationSeverity = "minor"
+ NotificationMajor NotificationSeverity = "major"
+ NotificationCritical NotificationSeverity = "critical"
+)
+
+// NotificationType constants start with Notification and include all known Linode API Notification Types.
+type NotificationType string
+
+// NotificationType constants represent the actions that cause a Notification. New types may be added in the future.
+const (
+ NotificationMigrationScheduled NotificationType = "migration_scheduled"
+ NotificationMigrationImminent NotificationType = "migration_imminent"
+ NotificationMigrationPending NotificationType = "migration_pending"
+ NotificationRebootScheduled NotificationType = "reboot_scheduled"
+ NotificationOutage NotificationType = "outage"
+ NotificationPaymentDue NotificationType = "payment_due"
+ NotificationTicketImportant NotificationType = "ticket_important"
+ NotificationTicketAbuse NotificationType = "ticket_abuse"
+ NotificationNotice NotificationType = "notice"
+ NotificationMaintenance NotificationType = "maintenance"
+)
+
// NotificationsPagedResponse represents a paginated Notifications API response
type NotificationsPagedResponse struct {
*PageOptions
diff --git a/vendor/github.com/linode/linodego/account_oauth_client.go b/vendor/github.com/linode/linodego/account_oauth_client.go
new file mode 100644
index 000000000..a351ce933
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_oauth_client.go
@@ -0,0 +1,190 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+)
+
+// OAuthClientStatus constants start with OAuthClient and include Linode API Instance Status values
+type OAuthClientStatus string
+
+// OAuthClientStatus constants reflect the current status of an OAuth Client
+const (
+ OAuthClientActive OAuthClientStatus = "active"
+ OAuthClientDisabled OAuthClientStatus = "disabled"
+ OAuthClientSuspended OAuthClientStatus = "suspended"
+)
+
+// OAuthClient represents a OAuthClient object
+type OAuthClient struct {
+ // The unique ID of this OAuth Client.
+ ID string `json:"id"`
+
+ // The location a successful log in from https://login.linode.com should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange.
+ RedirectURI string `json:"redirect_uri"`
+
+ // The name of this application. This will be presented to users when they are asked to grant it access to their Account.
+ Label string `json:"label"`
+
+ // Current status of the OAuth Client, Enum: "active" "disabled" "suspended"
+ Status OAuthClientStatus `json:"status"`
+
+ // The OAuth Client secret, used in the OAuth exchange. This is returned as except when an OAuth Client is created or its secret is reset. This is a secret, and should not be shared or disclosed publicly.
+ Secret string `json:"secret"`
+
+ // If this OAuth Client is public or private.
+ Public bool `json:"public"`
+
+ // The URL where this client's thumbnail may be viewed, or nil if this client does not have a thumbnail set.
+ ThumbnailURL *string `json:"thumbnail_url"`
+}
+
+// OAuthClientCreateOptions fields are those accepted by CreateOAuthClient
+type OAuthClientCreateOptions struct {
+ // The location a successful log in from https://login.linode.com should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange.
+ RedirectURI string `json:"redirect_uri"`
+
+ // The name of this application. This will be presented to users when they are asked to grant it access to their Account.
+ Label string `json:"label"`
+
+ // If this OAuth Client is public or private.
+ Public bool `json:"public"`
+}
+
+// OAuthClientUpdateOptions fields are those accepted by UpdateOAuthClient
+type OAuthClientUpdateOptions struct {
+ // The location a successful log in from https://login.linode.com should be redirected to for this client. The receiver of this redirect should be ready to accept an OAuth exchange code and finish the OAuth exchange.
+ RedirectURI string `json:"redirect_uri"`
+
+ // The name of this application. This will be presented to users when they are asked to grant it access to their Account.
+ Label string `json:"label"`
+
+ // If this OAuth Client is public or private.
+ Public bool `json:"public"`
+}
+
+// GetCreateOptions converts a OAuthClient to OAuthClientCreateOptions for use in CreateOAuthClient
+func (i OAuthClient) GetCreateOptions() (o OAuthClientCreateOptions) {
+ o.RedirectURI = i.RedirectURI
+ o.Label = i.Label
+ o.Public = i.Public
+ return
+}
+
+// GetUpdateOptions converts a OAuthClient to OAuthClientUpdateOptions for use in UpdateOAuthClient
+func (i OAuthClient) GetUpdateOptions() (o OAuthClientUpdateOptions) {
+ o.RedirectURI = i.RedirectURI
+ o.Label = i.Label
+ o.Public = i.Public
+ 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(c *Client) string {
+ endpoint, err := c.OAuthClients.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ return endpoint
+}
+
+// appendData appends OAuthClients when processing paginated OAuthClient responses
+func (resp *OAuthClientsPagedResponse) appendData(r *OAuthClientsPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// ListOAuthClients lists OAuthClients
+func (c *Client) ListOAuthClients(ctx context.Context, opts *ListOptions) ([]OAuthClient, error) {
+ response := OAuthClientsPagedResponse{}
+ err := c.listHelper(ctx, &response, opts)
+ if err != nil {
+ return nil, err
+ }
+ return response.Data, nil
+}
+
+// GetOAuthClient gets the OAuthClient with the provided ID
+func (c *Client) GetOAuthClient(ctx context.Context, id string) (*OAuthClient, error) {
+ e, err := c.OAuthClients.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&OAuthClient{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*OAuthClient), nil
+}
+
+// CreateOAuthClient creates an OAuthClient
+func (c *Client) CreateOAuthClient(ctx context.Context, createOpts OAuthClientCreateOptions) (*OAuthClient, error) {
+ var body string
+ e, err := c.OAuthClients.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&OAuthClient{})
+
+ if bodyData, err := json.Marshal(createOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*OAuthClient), nil
+}
+
+// UpdateOAuthClient updates the OAuthClient with the specified id
+func (c *Client) UpdateOAuthClient(ctx context.Context, id string, updateOpts OAuthClientUpdateOptions) (*OAuthClient, error) {
+ var body string
+ e, err := c.OAuthClients.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+
+ req := c.R(ctx).SetResult(&OAuthClient{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*OAuthClient), nil
+}
+
+// DeleteOAuthClient deletes the OAuthClient with the specified id
+func (c *Client) DeleteOAuthClient(ctx context.Context, id string) error {
+ e, err := c.OAuthClients.Endpoint()
+ if err != nil {
+ return err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+
+ _, err = coupleAPIErrors(c.R(ctx).Delete(e))
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/account_payments.go b/vendor/github.com/linode/linodego/account_payments.go
new file mode 100644
index 000000000..bf00862e2
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_payments.go
@@ -0,0 +1,115 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "time"
+)
+
+// Payment represents a Payment object
+type Payment struct {
+ // The unique ID of the Payment
+ ID int `json:"id"`
+
+ // The amount, in US dollars, of the Payment.
+ USD json.Number `json:"usd,Number"`
+
+ // When the Payment was made.
+ DateStr string `json:"date"`
+ Date *time.Time `json:"-"`
+}
+
+// PaymentCreateOptions fields are those accepted by CreatePayment
+type PaymentCreateOptions struct {
+ // CVV (Card Verification Value) of the credit card to be used for the Payment
+ CVV string `json:"cvv,omitempty"`
+
+ // The amount, in US dollars, of the Payment
+ USD json.Number `json:"usd,Number"`
+}
+
+// GetCreateOptions converts a Payment to PaymentCreateOptions for use in CreatePayment
+func (i Payment) GetCreateOptions() (o PaymentCreateOptions) {
+ o.USD = i.USD
+ 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(c *Client) string {
+ endpoint, err := c.Payments.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ return endpoint
+}
+
+// appendData appends Payments when processing paginated Payment responses
+func (resp *PaymentsPagedResponse) appendData(r *PaymentsPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// ListPayments lists Payments
+func (c *Client) ListPayments(ctx context.Context, opts *ListOptions) ([]Payment, error) {
+ response := PaymentsPagedResponse{}
+ err := c.listHelper(ctx, &response, opts)
+ for i := range response.Data {
+ response.Data[i].fixDates()
+ }
+ if err != nil {
+ return nil, err
+ }
+ return response.Data, nil
+}
+
+// fixDates converts JSON timestamps to Go time.Time values
+func (i *Payment) fixDates() *Payment {
+ i.Date, _ = parseDates(i.DateStr)
+ return i
+}
+
+// GetPayment gets the payment with the provided ID
+func (c *Client) GetPayment(ctx context.Context, id int) (*Payment, error) {
+ e, err := c.Payments.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%d", e, id)
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&Payment{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Payment).fixDates(), nil
+}
+
+// CreatePayment creates a Payment
+func (c *Client) CreatePayment(ctx context.Context, createOpts PaymentCreateOptions) (*Payment, error) {
+ var body string
+ e, err := c.Payments.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&Payment{})
+
+ if bodyData, err := json.Marshal(createOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Payment).fixDates(), nil
+}
diff --git a/vendor/github.com/linode/linodego/account_settings.go b/vendor/github.com/linode/linodego/account_settings.go
new file mode 100644
index 000000000..7a4946598
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_settings.go
@@ -0,0 +1,72 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+)
+
+// AccountSettings are the account wide flags or plans that effect new resources
+type AccountSettings struct {
+ // The default backups enrollment status for all new Linodes for all users on the account. When enabled, backups are mandatory per instance.
+ BackupsEnabled bool `json:"backups_enabled"`
+
+ // Wether or not Linode Managed service is enabled for the account.
+ Managed bool `json:"managed"`
+
+ // Wether or not the Network Helper is enabled for all new Linode Instance Configs on the account.
+ NetworkHelper bool `json:"network_helper"`
+
+ // A plan name like "longview-3"..."longview-100", or a nil value for to cancel any existing subscription plan.
+ LongviewSubscription *string `json:"longview_subscription"`
+}
+
+// AccountSettingsUpdateOptions are the updateable account wide flags or plans that effect new resources.
+type AccountSettingsUpdateOptions struct {
+ // The default backups enrollment status for all new Linodes for all users on the account. When enabled, backups are mandatory per instance.
+ BackupsEnabled *bool `json:"backups_enabled,omitempty"`
+
+ // A plan name like "longview-3"..."longview-100", or a nil value for to cancel any existing subscription plan.
+ LongviewSubscription *string `json:"longview_subscription,omitempty"`
+
+ // The default network helper setting for all new Linodes and Linode Configs for all users on the account.
+ NetworkHelper *bool `json:"network_helper,omitempty"`
+}
+
+// GetAccountSettings gets the account wide flags or plans that effect new resources
+func (c *Client) GetAccountSettings(ctx context.Context) (*AccountSettings, error) {
+ e, err := c.AccountSettings.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&AccountSettings{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*AccountSettings), nil
+}
+
+// UpdateAccountSettings updates the settings associated with the account
+func (c *Client) UpdateAccountSettings(ctx context.Context, settings AccountSettingsUpdateOptions) (*AccountSettings, error) {
+ var body string
+ e, err := c.AccountSettings.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&AccountSettings{})
+
+ if bodyData, err := json.Marshal(settings); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*AccountSettings), nil
+}
diff --git a/vendor/github.com/linode/linodego/account_users.go b/vendor/github.com/linode/linodego/account_users.go
new file mode 100644
index 000000000..a51fbe7f1
--- /dev/null
+++ b/vendor/github.com/linode/linodego/account_users.go
@@ -0,0 +1,164 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+)
+
+// User represents a User object
+type User struct {
+ Username string `json:"username"`
+ Email string `json:"email"`
+ Restricted bool `json:"restricted"`
+ SSHKeys []string `json:"ssh_keys"`
+}
+
+// UserCreateOptions fields are those accepted by CreateUser
+type UserCreateOptions struct {
+ Username string `json:"username"`
+ Email string `json:"email"`
+ Restricted bool `json:"restricted,omitempty"`
+}
+
+// UserUpdateOptions fields are those accepted by UpdateUser
+type UserUpdateOptions struct {
+ Username string `json:"username,omitempty"`
+ Email string `json:"email,omitempty"`
+ Restricted *bool `json:"restricted,omitempty"`
+ SSHKeys *[]string `json:"ssh_keys,omitempty"`
+}
+
+// GetCreateOptions converts a User to UserCreateOptions for use in CreateUser
+func (i User) GetCreateOptions() (o UserCreateOptions) {
+ o.Username = i.Username
+ o.Email = i.Email
+ o.Restricted = i.Restricted
+ return
+}
+
+// GetUpdateOptions converts a User to UserUpdateOptions for use in UpdateUser
+func (i User) GetUpdateOptions() (o UserUpdateOptions) {
+ o.Username = i.Username
+ o.Email = i.Email
+ o.Restricted = copyBool(&i.Restricted)
+ 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(c *Client) string {
+ endpoint, err := c.Users.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ return endpoint
+}
+
+// appendData appends Users when processing paginated User responses
+func (resp *UsersPagedResponse) appendData(r *UsersPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// 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)
+ for i := range response.Data {
+ response.Data[i].fixDates()
+ }
+ if err != nil {
+ return nil, err
+ }
+ return response.Data, nil
+}
+
+// fixDates converts JSON timestamps to Go time.Time values
+func (i *User) fixDates() *User {
+ return i
+}
+
+// GetUser gets the user with the provided ID
+func (c *Client) GetUser(ctx context.Context, id string) (*User, error) {
+ e, err := c.Users.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&User{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*User).fixDates(), 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, createOpts UserCreateOptions) (*User, error) {
+ var body string
+ e, err := c.Users.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&User{})
+
+ if bodyData, err := json.Marshal(createOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*User).fixDates(), nil
+}
+
+// UpdateUser updates the User with the specified id
+func (c *Client) UpdateUser(ctx context.Context, id string, updateOpts UserUpdateOptions) (*User, error) {
+ var body string
+ e, err := c.Users.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+
+ req := c.R(ctx).SetResult(&User{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*User).fixDates(), nil
+}
+
+// DeleteUser deletes the User with the specified id
+func (c *Client) DeleteUser(ctx context.Context, id string) error {
+ e, err := c.Users.Endpoint()
+ if err != nil {
+ return err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+
+ _, err = coupleAPIErrors(c.R(ctx).Delete(e))
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/client.go b/vendor/github.com/linode/linodego/client.go
index 81c51f692..7d87dc763 100644
--- a/vendor/github.com/linode/linodego/client.go
+++ b/vendor/github.com/linode/linodego/client.go
@@ -3,33 +3,40 @@ package linodego
import (
"context"
"fmt"
+ "io/ioutil"
"log"
"net/http"
"os"
"strconv"
+ "time"
- "github.com/go-resty/resty"
+ "gopkg.in/resty.v1"
)
const (
// APIHost Linode API hostname
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 = "LINODE_CA"
// APIVersion Linode API version
APIVersion = "v4"
// APIProto connect to API with http(s)
APIProto = "https"
// Version of linodego
- Version = "0.5.1"
+ Version = "0.10.0"
// APIEnvVar environment var to check for API token
APIEnvVar = "LINODE_TOKEN"
- // APISecondsPerPoll how frequently to poll for new Events
- APISecondsPerPoll = 10
+ // APISecondsPerPoll how frequently to poll for new Events or Status in WaitFor functions
+ APISecondsPerPoll = 3
+ // DefaultUserAgent is the default User-Agent sent in HTTP request headers
+ DefaultUserAgent = "linodego " + Version + " https://github.com/linode/linodego"
)
-// DefaultUserAgent is the default User-Agent sent in HTTP request headers
-const DefaultUserAgent = "linodego " + Version + " https://github.com/linode/linodego"
-
-var envDebug = false
+var (
+ envDebug = false
+)
// Client is a wrapper around the Resty client
type Client struct {
@@ -38,12 +45,15 @@ type Client struct {
resources map[string]*Resource
debug bool
+ millisecondsPerPoll time.Duration
+
Images *Resource
InstanceDisks *Resource
InstanceConfigs *Resource
InstanceSnapshots *Resource
InstanceIPs *Resource
InstanceVolumes *Resource
+ InstanceStats *Resource
Instances *Resource
IPAddresses *Resource
IPv6Pools *Resource
@@ -63,13 +73,20 @@ type Client struct {
NodeBalancerNodes *Resource
SSHKeys *Resource
Tickets *Resource
+ Tokens *Resource
+ Token *Resource
Account *Resource
+ AccountSettings *Resource
Invoices *Resource
InvoiceItems *Resource
Events *Resource
Notifications *Resource
+ OAuthClients *Resource
Profile *Resource
Managed *Resource
+ Tags *Resource
+ Users *Resource
+ Payments *Resource
}
func init() {
@@ -115,6 +132,25 @@ func (c *Client) SetBaseURL(url string) *Client {
return c
}
+func (c *Client) SetRootCertificate(path string) *Client {
+ c.resty.SetRootCertificate(path)
+ return c
+}
+
+// SetToken sets the API token for all requests from this client
+// Only necessary if you haven't already provided an http client to NewClient() configured with the token.
+func (c *Client) SetToken(token string) *Client {
+ c.resty.SetHeader("Authorization", fmt.Sprintf("Bearer %s", token))
+ return c
+}
+
+// SetPollDelay sets the number of milliseconds to wait between events or status polls.
+// Affects all WaitFor* functions.
+func (c *Client) SetPollDelay(delay time.Duration) *Client {
+ c.millisecondsPerPoll = delay
+ return c
+}
+
// Resource looks up a resource by name
func (c Client) Resource(resourceName string) *Resource {
selectedResource, ok := c.resources[resourceName]
@@ -126,10 +162,30 @@ func (c Client) Resource(resourceName string) *Resource {
// NewClient factory to create new Client struct
func NewClient(hc *http.Client) (client Client) {
- restyClient := resty.NewWithClient(hc)
- client.resty = restyClient
+ if hc != nil {
+ client.resty = resty.NewWithClient(hc)
+ } else {
+ client.resty = resty.New()
+ }
client.SetUserAgent(DefaultUserAgent)
- client.SetBaseURL(fmt.Sprintf("%s://%s/%s", APIProto, APIHost, APIVersion))
+ baseURL, baseURLExists := os.LookupEnv(APIHostVar)
+ if baseURLExists {
+ client.SetBaseURL(baseURL)
+ } else {
+ client.SetBaseURL(fmt.Sprintf("%s://%s/%s", APIProto, APIHost, APIVersion))
+ }
+ certPath, certPathExists := os.LookupEnv(APIHostCert)
+ if certPathExists {
+ cert, err := ioutil.ReadFile(certPath)
+ if err != nil {
+ log.Fatalf("[ERROR] Error when reading cert at %s: %s\n", certPath, err.Error())
+ }
+ client.SetRootCertificate(certPath)
+ if envDebug {
+ log.Printf("[DEBUG] Set API root certificate to %s with contents %s\n", certPath, cert)
+ }
+ }
+ client.SetPollDelay(1000 * APISecondsPerPoll)
resources := map[string]*Resource{
stackscriptsName: NewResource(&client, stackscriptsName, stackscriptsEndpoint, false, Stackscript{}, StackscriptsPagedResponse{}),
@@ -140,8 +196,9 @@ func NewClient(hc *http.Client) (client Client) {
instanceSnapshotsName: NewResource(&client, instanceSnapshotsName, instanceSnapshotsEndpoint, true, InstanceSnapshot{}, nil),
instanceIPsName: NewResource(&client, instanceIPsName, instanceIPsEndpoint, true, InstanceIP{}, nil), // really?
instanceVolumesName: NewResource(&client, instanceVolumesName, instanceVolumesEndpoint, true, nil, InstanceVolumesPagedResponse{}), // really?
- ipaddressesName: NewResource(&client, ipaddressesName, ipaddressesEndpoint, false, nil, IPAddressesPagedResponse{}), // really?
- ipv6poolsName: NewResource(&client, ipv6poolsName, ipv6poolsEndpoint, false, nil, IPv6PoolsPagedResponse{}), // really?
+ instanceStatsName: NewResource(&client, instanceStatsName, instanceStatsEndpoint, true, InstanceStats{}, nil),
+ ipaddressesName: NewResource(&client, ipaddressesName, ipaddressesEndpoint, false, nil, IPAddressesPagedResponse{}), // really?
+ ipv6poolsName: NewResource(&client, ipv6poolsName, ipv6poolsEndpoint, false, nil, IPv6PoolsPagedResponse{}), // really?
ipv6rangesName: NewResource(&client, ipv6rangesName, ipv6rangesEndpoint, false, IPv6Range{}, IPv6RangesPagedResponse{}),
regionsName: NewResource(&client, regionsName, regionsEndpoint, false, Region{}, RegionsPagedResponse{}),
volumesName: NewResource(&client, volumesName, volumesEndpoint, false, Volume{}, VolumesPagedResponse{}),
@@ -155,14 +212,21 @@ func NewClient(hc *http.Client) (client Client) {
nodebalancersName: NewResource(&client, nodebalancersName, nodebalancersEndpoint, false, NodeBalancer{}, NodeBalancerConfigsPagedResponse{}),
nodebalancerconfigsName: NewResource(&client, nodebalancerconfigsName, nodebalancerconfigsEndpoint, true, NodeBalancerConfig{}, NodeBalancerConfigsPagedResponse{}),
nodebalancernodesName: NewResource(&client, nodebalancernodesName, nodebalancernodesEndpoint, true, NodeBalancerNode{}, NodeBalancerNodesPagedResponse{}),
+ notificationsName: NewResource(&client, notificationsName, notificationsEndpoint, false, Notification{}, NotificationsPagedResponse{}),
+ oauthClientsName: NewResource(&client, oauthClientsName, oauthClientsEndpoint, false, OAuthClient{}, OAuthClientsPagedResponse{}),
sshkeysName: NewResource(&client, sshkeysName, sshkeysEndpoint, false, SSHKey{}, SSHKeysPagedResponse{}),
ticketsName: NewResource(&client, ticketsName, ticketsEndpoint, false, Ticket{}, TicketsPagedResponse{}),
- accountName: NewResource(&client, accountName, accountEndpoint, false, Account{}, nil), // really?
+ tokensName: NewResource(&client, tokensName, tokensEndpoint, false, Token{}, TokensPagedResponse{}),
+ accountName: NewResource(&client, accountName, accountEndpoint, false, Account{}, nil), // really?
+ accountSettingsName: NewResource(&client, accountSettingsName, accountSettingsEndpoint, false, AccountSettings{}, nil), // really?
eventsName: NewResource(&client, eventsName, eventsEndpoint, false, Event{}, EventsPagedResponse{}),
invoicesName: NewResource(&client, invoicesName, invoicesEndpoint, false, Invoice{}, InvoicesPagedResponse{}),
invoiceItemsName: NewResource(&client, invoiceItemsName, invoiceItemsEndpoint, true, InvoiceItem{}, InvoiceItemsPagedResponse{}),
profileName: NewResource(&client, profileName, profileEndpoint, false, nil, nil), // really?
managedName: NewResource(&client, managedName, managedEndpoint, false, nil, nil), // really?
+ tagsName: NewResource(&client, tagsName, tagsEndpoint, false, Tag{}, TagsPagedResponse{}),
+ usersName: NewResource(&client, usersName, usersEndpoint, false, User{}, UsersPagedResponse{}),
+ paymentsName: NewResource(&client, paymentsName, paymentsEndpoint, false, Payment{}, PaymentsPagedResponse{}),
}
client.resources = resources
@@ -177,6 +241,7 @@ func NewClient(hc *http.Client) (client Client) {
client.InstanceSnapshots = resources[instanceSnapshotsName]
client.InstanceIPs = resources[instanceIPsName]
client.InstanceVolumes = resources[instanceVolumesName]
+ client.InstanceStats = resources[instanceStatsName]
client.IPAddresses = resources[ipaddressesName]
client.IPv6Pools = resources[ipv6poolsName]
client.IPv6Ranges = resources[ipv6rangesName]
@@ -190,12 +255,50 @@ func NewClient(hc *http.Client) (client Client) {
client.NodeBalancers = resources[nodebalancersName]
client.NodeBalancerConfigs = resources[nodebalancerconfigsName]
client.NodeBalancerNodes = resources[nodebalancernodesName]
+ client.Notifications = resources[notificationsName]
+ client.OAuthClients = resources[oauthClientsName]
client.SSHKeys = resources[sshkeysName]
client.Tickets = resources[ticketsName]
+ client.Tokens = resources[tokensName]
client.Account = resources[accountName]
client.Events = resources[eventsName]
client.Invoices = resources[invoicesName]
client.Profile = resources[profileName]
client.Managed = resources[managedName]
+ client.Tags = resources[tagsName]
+ client.Users = resources[usersName]
+ client.Payments = resources[paymentsName]
return
}
+
+func copyBool(bPtr *bool) *bool {
+ if bPtr == nil {
+ return nil
+ }
+ var t = *bPtr
+ return &t
+}
+
+func copyInt(iPtr *int) *int {
+ if iPtr == nil {
+ return nil
+ }
+ var t = *iPtr
+ return &t
+}
+
+func copyString(sPtr *string) *string {
+ if sPtr == nil {
+ return nil
+ }
+ var t = *sPtr
+ return &t
+}
+
+func copyTime(tPtr *time.Time) *time.Time {
+ if tPtr == nil {
+ return nil
+ }
+ var t = *tPtr
+ return &t
+}
diff --git a/vendor/github.com/linode/linodego/domain_records.go b/vendor/github.com/linode/linodego/domain_records.go
index 2ebbff5b7..215ac8004 100644
--- a/vendor/github.com/linode/linodego/domain_records.go
+++ b/vendor/github.com/linode/linodego/domain_records.go
@@ -80,22 +80,6 @@ func (d DomainRecord) GetUpdateOptions() (du DomainRecordUpdateOptions) {
return
}
-func copyInt(iPtr *int) *int {
- if iPtr == nil {
- return nil
- }
- var t = *iPtr
- return &t
-}
-
-func copyString(sPtr *string) *string {
- if sPtr == nil {
- return nil
- }
- var t = *sPtr
- return &t
-}
-
// DomainRecordsPagedResponse represents a paginated DomainRecord API response
type DomainRecordsPagedResponse struct {
*PageOptions
diff --git a/vendor/github.com/linode/linodego/domains.go b/vendor/github.com/linode/linodego/domains.go
index 4ae7167fa..43e4a65f5 100644
--- a/vendor/github.com/linode/linodego/domains.go
+++ b/vendor/github.com/linode/linodego/domains.go
@@ -39,6 +39,9 @@ type Domain struct {
// The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it.
AXfrIPs []string `json:"axfr_ips"`
+ // An array of tags applied to this object. Tags are for organizational purposes only.
+ Tags []string `json:"tags"`
+
// The amount of time in seconds that may pass before this Domain is no longer authoritative. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.
ExpireSec int `json:"expire_sec"`
@@ -81,6 +84,9 @@ type DomainCreateOptions struct {
// The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it.
AXfrIPs []string `json:"axfr_ips,omitempty"`
+ // An array of tags applied to this object. Tags are for organizational purposes only.
+ Tags []string `json:"tags"`
+
// The amount of time in seconds that may pass before this Domain is no longer authoritative. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.
ExpireSec int `json:"expire_sec,omitempty"`
@@ -123,6 +129,9 @@ type DomainUpdateOptions struct {
// The list of IPs that may perform a zone transfer for this Domain. This is potentially dangerous, and should be set to an empty list unless you intend to use it.
AXfrIPs []string `json:"axfr_ips,omitempty"`
+ // An array of tags applied to this object. Tags are for organizational purposes only.
+ Tags []string `json:"tags"`
+
// The amount of time in seconds that may pass before this Domain is no longer authoritative. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.
ExpireSec int `json:"expire_sec,omitempty"`
@@ -164,6 +173,7 @@ func (d Domain) GetUpdateOptions() (du DomainUpdateOptions) {
du.RetrySec = d.RetrySec
du.MasterIPs = d.MasterIPs
du.AXfrIPs = d.AXfrIPs
+ du.Tags = d.Tags
du.ExpireSec = d.ExpireSec
du.RefreshSec = d.RefreshSec
du.TTLSec = d.TTLSec
diff --git a/vendor/github.com/linode/linodego/errors.go b/vendor/github.com/linode/linodego/errors.go
index 7ca69c2ba..feacc2cb0 100644
--- a/vendor/github.com/linode/linodego/errors.go
+++ b/vendor/github.com/linode/linodego/errors.go
@@ -6,7 +6,7 @@ import (
"net/http"
"strings"
- "github.com/go-resty/resty"
+ "gopkg.in/resty.v1"
)
const (
@@ -60,7 +60,7 @@ func coupleAPIErrors(r *resty.Response, err error) (*resty.Response, error) {
}
func (e APIError) Error() string {
- var x []string
+ x := []string{}
for _, msg := range e.Errors {
x = append(x, msg.Error())
}
diff --git a/vendor/github.com/linode/linodego/images.go b/vendor/github.com/linode/linodego/images.go
index 91ab57bb9..979ce2ed1 100644
--- a/vendor/github.com/linode/linodego/images.go
+++ b/vendor/github.com/linode/linodego/images.go
@@ -10,7 +10,7 @@ import (
// Image represents a deployable Image object for use with Linode Instances
type Image struct {
CreatedStr string `json:"created"`
- UpdatedStr string `json:"updated"`
+ ExpiryStr string `json:"expiry"`
ID string `json:"id"`
CreatedBy string `json:"created_by"`
Label string `json:"label"`
@@ -22,7 +22,7 @@ type Image struct {
Deprecated bool `json:"deprecated"`
Created *time.Time `json:"-"`
- Updated *time.Time `json:"-"`
+ Expiry *time.Time `json:"-"`
}
// ImageCreateOptions fields are those accepted by CreateImage
@@ -40,7 +40,12 @@ type ImageUpdateOptions struct {
func (i *Image) fixDates() *Image {
i.Created, _ = parseDates(i.CreatedStr)
- i.Updated, _ = parseDates(i.UpdatedStr)
+
+ if len(i.ExpiryStr) > 0 {
+ i.Expiry, _ = parseDates(i.ExpiryStr)
+ } else {
+ i.Expiry = nil
+ }
return i
}
@@ -94,7 +99,7 @@ func (c *Client) GetImage(ctx context.Context, id string) (*Image, error) {
if err != nil {
return nil, err
}
- return r.Result().(*Image), nil
+ return r.Result().(*Image).fixDates(), nil
}
// CreateImage creates a Image
diff --git a/vendor/github.com/linode/linodego/instance_disks.go b/vendor/github.com/linode/linodego/instance_disks.go
index 8c31491a2..9b43d6b8d 100644
--- a/vendor/github.com/linode/linodego/instance_disks.go
+++ b/vendor/github.com/linode/linodego/instance_disks.go
@@ -14,7 +14,7 @@ type InstanceDisk struct {
ID int `json:"id"`
Label string `json:"label"`
- Status string `json:"status"`
+ Status DiskStatus `json:"status"`
Size int `json:"size"`
Filesystem DiskFilesystem `json:"filesystem"`
Created time.Time `json:"-"`
@@ -33,6 +33,16 @@ const (
FilesystemInitrd DiskFilesystem = "initrd"
)
+// DiskStatus constants have the prefix "Disk" and include Linode API Instance Disk Status
+type DiskStatus string
+
+// DiskStatus constants represent the status values an Instance Disk may have
+const (
+ DiskReady DiskStatus = "ready"
+ DiskNotReady DiskStatus = "not ready"
+ DiskDeleting DiskStatus = "deleting"
+)
+
// InstanceDisksPagedResponse represents a paginated InstanceDisk API response
type InstanceDisksPagedResponse struct {
*PageOptions
@@ -175,13 +185,13 @@ func (c *Client) RenameInstanceDisk(ctx context.Context, linodeID int, diskID in
}
// ResizeInstanceDisk resizes the size of the Instance disk
-func (c *Client) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID int, size int) (*InstanceDisk, error) {
+func (c *Client) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID int, size int) error {
var body string
e, err := c.InstanceDisks.endpointWithID(linodeID)
if err != nil {
- return nil, err
+ return err
}
- e = fmt.Sprintf("%s/%d", e, diskID)
+ e = fmt.Sprintf("%s/%d/resize", e, diskID)
req := c.R(ctx).SetResult(&InstanceDisk{})
updateOpts := map[string]interface{}{
@@ -191,17 +201,41 @@ func (c *Client) ResizeInstanceDisk(ctx context.Context, linodeID int, diskID in
if bodyData, err := json.Marshal(updateOpts); err == nil {
body = string(bodyData)
} else {
- return nil, NewError(err)
+ return NewError(err)
}
- r, err := coupleAPIErrors(req.
+ _, err = coupleAPIErrors(req.
SetBody(body).
Post(e))
+ return err
+}
+
+// PasswordResetInstanceDisk resets the "root" account password on the Instance disk
+func (c *Client) PasswordResetInstanceDisk(ctx context.Context, linodeID int, diskID int, password string) error {
+ var body string
+ e, err := c.InstanceDisks.endpointWithID(linodeID)
if err != nil {
- return nil, err
+ return err
}
- return r.Result().(*InstanceDisk).fixDates(), nil
+ e = fmt.Sprintf("%s/%d/password", e, diskID)
+
+ req := c.R(ctx).SetResult(&InstanceDisk{})
+ updateOpts := map[string]interface{}{
+ "password": password,
+ }
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return NewError(err)
+ }
+
+ _, err = coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ return err
}
// DeleteInstanceDisk deletes a Linode Instance Disk
diff --git a/vendor/github.com/linode/linodego/instance_ips.go b/vendor/github.com/linode/linodego/instance_ips.go
index a30d04f16..6df206048 100644
--- a/vendor/github.com/linode/linodego/instance_ips.go
+++ b/vendor/github.com/linode/linodego/instance_ips.go
@@ -14,22 +14,23 @@ type InstanceIPAddressResponse struct {
// InstanceIPv4Response contains the details of all IPv4 addresses associated with an Instance
type InstanceIPv4Response struct {
- Public []*InstanceIP `json:"public"`
- Private []*InstanceIP `json:"private"`
- Shared []*InstanceIP `json:"shared"`
+ Public []*InstanceIP `json:"public"`
+ Private []*InstanceIP `json:"private"`
+ Shared []*InstanceIP `json:"shared"`
+ Reserved []*InstanceIP `json:"reserved"`
}
// InstanceIP represents an Instance IP with additional DNS and networking details
type InstanceIP struct {
- Address string `json:"address"`
- Gateway string `json:"gateway"`
- SubnetMask string `json:"subnet_mask"`
- Prefix int `json:"prefix"`
- Type string `json:"type"`
- Public bool `json:"public"`
- RDNS string `json:"rdns"`
- LinodeID int `json:"linode_id"`
- Region string `json:"region"`
+ Address string `json:"address"`
+ Gateway string `json:"gateway"`
+ SubnetMask string `json:"subnet_mask"`
+ Prefix int `json:"prefix"`
+ Type InstanceIPType `json:"type"`
+ Public bool `json:"public"`
+ RDNS string `json:"rdns"`
+ LinodeID int `json:"linode_id"`
+ Region string `json:"region"`
}
// InstanceIPv6Response contains the IPv6 addresses and ranges for an Instance
@@ -43,8 +44,20 @@ type InstanceIPv6Response struct {
type IPv6Range struct {
Range string `json:"range"`
Region string `json:"region"`
+ Prefix int `json:"prefix"`
}
+// InstanceIPType constants start with IPType and include Linode Instance IP Types
+type InstanceIPType string
+
+// InstanceIPType constants represent the IP types an Instance IP may be
+const (
+ IPTypeIPv4 InstanceIPType = "ipv4"
+ IPTypeIPv6 InstanceIPType = "ipv6"
+ IPTypeIPv6Pool InstanceIPType = "ipv6/pool"
+ IPTypeIPv6Range InstanceIPType = "ipv6/range"
+)
+
// GetInstanceIPAddresses gets the IPAddresses for a Linode instance
func (c *Client) GetInstanceIPAddresses(ctx context.Context, linodeID int) (*InstanceIPAddressResponse, error) {
e, err := c.InstanceIPs.endpointWithID(linodeID)
@@ -104,3 +117,30 @@ func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public
return r.Result().(*InstanceIP), nil
}
+
+// UpdateInstanceIPAddress updates the IPAddress with the specified instance id and IP address
+func (c *Client) UpdateInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string, updateOpts IPAddressUpdateOptions) (*InstanceIP, error) {
+ var body string
+ e, err := c.InstanceIPs.endpointWithID(linodeID)
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, ipAddress)
+
+ req := c.R(ctx).SetResult(&InstanceIP{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*InstanceIP), nil
+}
diff --git a/vendor/github.com/linode/linodego/instance_stats.go b/vendor/github.com/linode/linodego/instance_stats.go
new file mode 100644
index 000000000..609b95183
--- /dev/null
+++ b/vendor/github.com/linode/linodego/instance_stats.go
@@ -0,0 +1,68 @@
+package linodego
+
+import (
+ "context"
+ "fmt"
+)
+
+// StatsNet represents a network stats object
+type StatsNet struct {
+ In [][]float64 `json:"in"`
+ Out [][]float64 `json:"out"`
+ PrivateIn [][]float64 `json:"private_in"`
+ PrivateOut [][]float64 `json:"private_out"`
+}
+
+// StatsIO represents an IO stats object
+type StatsIO struct {
+ IO [][]float64 `json:"io"`
+ Swap [][]float64 `json:"swap"`
+}
+
+// InstanceStatsData represents an instance stats data object
+type InstanceStatsData struct {
+ CPU [][]float64 `json:"cpu"`
+ IO StatsIO `json:"io"`
+ NetV4 StatsNet `json:"netv4"`
+ NetV6 StatsNet `json:"netv6"`
+}
+
+// InstanceStats represents an instance stats object
+type InstanceStats struct {
+ Title string `json:"title"`
+ Data InstanceStatsData `json:"data"`
+}
+
+// endpointWithIDAndDate gets the endpoint URL for InstanceStats of a given Instance and Year/Month
+func endpointWithIDAndDate(c *Client, id int, year int, month int) string {
+ endpoint, err := c.InstanceStats.endpointWithID(id)
+ if err != nil {
+ panic(err)
+ }
+
+ endpoint = fmt.Sprintf("%s/%d/%d", endpoint, year, month)
+ return endpoint
+}
+
+// GetInstanceStats gets the template with the provided ID
+func (c *Client) GetInstanceStats(ctx context.Context, linodeID int) (*InstanceStats, error) {
+ e, err := c.InstanceStats.endpointWithID(linodeID)
+ if err != nil {
+ return nil, err
+ }
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&InstanceStats{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*InstanceStats), 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 := endpointWithIDAndDate(c, linodeID, year, month)
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&InstanceStats{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*InstanceStats), nil
+}
diff --git a/vendor/github.com/linode/linodego/instances.go b/vendor/github.com/linode/linodego/instances.go
index efb2bf814..d990ed076 100644
--- a/vendor/github.com/linode/linodego/instances.go
+++ b/vendor/github.com/linode/linodego/instances.go
@@ -36,21 +36,23 @@ type Instance struct {
CreatedStr string `json:"created"`
UpdatedStr string `json:"updated"`
- ID int `json:"id"`
- Created *time.Time `json:"-"`
- Updated *time.Time `json:"-"`
- Region string `json:"region"`
- Alerts *InstanceAlert `json:"alerts"`
- Backups *InstanceBackup `json:"backups"`
- Image string `json:"image"`
- Group string `json:"group"`
- IPv4 []*net.IP `json:"ipv4"`
- IPv6 string `json:"ipv6"`
- Label string `json:"label"`
- Type string `json:"type"`
- Status InstanceStatus `json:"status"`
- Hypervisor string `json:"hypervisor"`
- Specs *InstanceSpec `json:"specs"`
+ ID int `json:"id"`
+ Created *time.Time `json:"-"`
+ Updated *time.Time `json:"-"`
+ Region string `json:"region"`
+ Alerts *InstanceAlert `json:"alerts"`
+ Backups *InstanceBackup `json:"backups"`
+ Image string `json:"image"`
+ Group string `json:"group"`
+ IPv4 []*net.IP `json:"ipv4"`
+ IPv6 string `json:"ipv6"`
+ Label string `json:"label"`
+ Type string `json:"type"`
+ Status InstanceStatus `json:"status"`
+ Hypervisor string `json:"hypervisor"`
+ Specs *InstanceSpec `json:"specs"`
+ WatchdogEnabled bool `json:"watchdog_enabled"`
+ Tags []string `json:"tags"`
}
// InstanceSpec represents a linode spec
@@ -79,6 +81,18 @@ type InstanceBackup struct {
}
}
+// InstanceTransfer pool stats for a Linode Instance during the current billing month
+type InstanceTransfer struct {
+ // Bytes of transfer this instance has consumed
+ Used int `json:"used"`
+
+ // GB of billable transfer this instance has consumed
+ Billable int `json:"billable"`
+
+ // GB of transfer this instance adds to the Transfer pool
+ Quota int `json:"quota"`
+}
+
// InstanceCreateOptions require only Region and Type
type InstanceCreateOptions struct {
Region string `json:"region"`
@@ -94,6 +108,7 @@ type InstanceCreateOptions struct {
Image string `json:"image,omitempty"`
BackupsEnabled bool `json:"backups_enabled,omitempty"`
PrivateIP bool `json:"private_ip,omitempty"`
+ Tags []string `json:"tags,omitempty"`
// Creation fields that need to be set explicitly false, "", or 0 use pointers
SwapSize *int `json:"swap_size,omitempty"`
@@ -107,6 +122,19 @@ type InstanceUpdateOptions struct {
Backups *InstanceBackup `json:"backups,omitempty"`
Alerts *InstanceAlert `json:"alerts,omitempty"`
WatchdogEnabled *bool `json:"watchdog_enabled,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
+}
+
+// GetUpdateOptions converts an Instance to InstanceUpdateOptions for use in UpdateInstance
+func (l *Instance) GetUpdateOptions() InstanceUpdateOptions {
+ return InstanceUpdateOptions{
+ Label: l.Label,
+ Group: l.Group,
+ Backups: l.Backups,
+ Alerts: l.Alerts,
+ WatchdogEnabled: &l.WatchdogEnabled,
+ Tags: &l.Tags,
+ }
}
// InstanceCloneOptions is an options struct sent when Cloning an Instance
@@ -123,6 +151,14 @@ type InstanceCloneOptions struct {
Configs []int `json:"configs,omitempty"`
}
+// InstanceResizeOptions
+type InstanceResizeOptions struct {
+ Type string `json:"type"`
+
+ // When enabled, an instance resize will also resize a data disk if the instance has no more than one data disk and one swap disk
+ AllowAutoDiskResize *bool `json:"allow_auto_disk_resize,omitempty"`
+}
+
func (l *Instance) fixDates() *Instance {
l.Created, _ = parseDates(l.CreatedStr)
l.Updated, _ = parseDates(l.UpdatedStr)
@@ -178,6 +214,22 @@ func (c *Client) GetInstance(ctx context.Context, linodeID int) (*Instance, erro
return r.Result().(*Instance).fixDates(), nil
}
+// GetInstance gets the instance with the provided ID
+func (c *Client) GetInstanceTransfer(ctx context.Context, linodeID int) (*InstanceTransfer, error) {
+ e, err := c.Instances.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%d/transfer", e, linodeID)
+ r, err := coupleAPIErrors(c.R(ctx).
+ SetResult(InstanceTransfer{}).
+ Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*InstanceTransfer), nil
+}
+
// CreateInstance creates a Linode instance
func (c *Client) CreateInstance(ctx context.Context, instance InstanceCreateOptions) (*Instance, error) {
var body string
@@ -331,8 +383,8 @@ func (c *Client) RebootInstance(ctx context.Context, id int, configID int) error
return err
}
-// RebuildInstanceOptions is a struct representing the options to send to the rebuild linode endpoint
-type RebuildInstanceOptions struct {
+// InstanceRebuildOptions is a struct representing the options to send to the rebuild linode endpoint
+type InstanceRebuildOptions struct {
Image string `json:"image"`
RootPass string `json:"root_pass"`
AuthorizedKeys []string `json:"authorized_keys"`
@@ -344,7 +396,7 @@ type RebuildInstanceOptions struct {
// 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, id int, opts RebuildInstanceOptions) (*Instance, error) {
+func (c *Client) RebuildInstance(ctx context.Context, id int, opts InstanceRebuildOptions) (*Instance, error) {
o, err := json.Marshal(opts)
if err != nil {
return nil, NewError(err)
@@ -365,8 +417,8 @@ func (c *Client) RebuildInstance(ctx context.Context, id int, opts RebuildInstan
return r.Result().(*Instance).fixDates(), nil
}
-// RescueInstanceOptions fields are those accepted by RescueInstance
-type RescueInstanceOptions struct {
+// InstanceRescueOptions fields are those accepted by RescueInstance
+type InstanceRescueOptions struct {
Devices InstanceConfigDeviceMap `json:"devices"`
}
@@ -374,7 +426,7 @@ type RescueInstanceOptions struct {
// Rescue Mode is based on the Finnix recovery distribution, a self-contained and bootable Linux distribution.
// 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, id int, opts RescueInstanceOptions) error {
+func (c *Client) RescueInstance(ctx context.Context, id int, opts InstanceRescueOptions) error {
o, err := json.Marshal(opts)
if err != nil {
return NewError(err)
@@ -394,9 +446,12 @@ func (c *Client) RescueInstance(ctx context.Context, id int, opts RescueInstance
}
// ResizeInstance resizes an instance to new Linode type
-func (c *Client) ResizeInstance(ctx context.Context, id int, linodeType string) error {
- body := fmt.Sprintf("{\"type\":\"%s\"}", linodeType)
-
+func (c *Client) ResizeInstance(ctx context.Context, id int, opts InstanceResizeOptions) error {
+ o, err := json.Marshal(opts)
+ if err != nil {
+ return NewError(err)
+ }
+ body := string(o)
e, err := c.Instances.Endpoint()
if err != nil {
return err
diff --git a/vendor/github.com/linode/linodego/network_ips.go b/vendor/github.com/linode/linodego/network_ips.go
index 29b6f6b8e..01dd5c1d3 100644
--- a/vendor/github.com/linode/linodego/network_ips.go
+++ b/vendor/github.com/linode/linodego/network_ips.go
@@ -2,6 +2,7 @@ package linodego
import (
"context"
+ "encoding/json"
"fmt"
)
@@ -11,6 +12,18 @@ type IPAddressesPagedResponse struct {
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.
+ RDNS *string `json:"rdns"`
+}
+
+// GetUpdateOptions converts a IPAddress to IPAddressUpdateOptions for use in UpdateIPAddress
+func (i InstanceIP) GetUpdateOptions() (o IPAddressUpdateOptions) {
+ o.RDNS = copyString(&i.RDNS)
+ return
+}
+
// endpoint gets the endpoint URL for IPAddress
func (IPAddressesPagedResponse) endpoint(c *Client) string {
endpoint, err := c.IPAddresses.Endpoint()
@@ -48,3 +61,30 @@ func (c *Client) GetIPAddress(ctx context.Context, id string) (*InstanceIP, erro
}
return r.Result().(*InstanceIP), nil
}
+
+// UpdateIPAddress updates the IPAddress with the specified id
+func (c *Client) UpdateIPAddress(ctx context.Context, id string, updateOpts IPAddressUpdateOptions) (*InstanceIP, error) {
+ var body string
+ e, err := c.IPAddresses.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%s", e, id)
+
+ req := c.R(ctx).SetResult(&InstanceIP{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*InstanceIP), nil
+}
diff --git a/vendor/github.com/linode/linodego/nodebalancer.go b/vendor/github.com/linode/linodego/nodebalancer.go
index af4dacc47..a8d797d24 100644
--- a/vendor/github.com/linode/linodego/nodebalancer.go
+++ b/vendor/github.com/linode/linodego/nodebalancer.go
@@ -28,6 +28,9 @@ type NodeBalancer struct {
// Information about the amount of transfer this NodeBalancer has had so far this month.
Transfer NodeBalancerTransfer `json:"transfer"`
+ // An array of tags applied to this object. Tags are for organizational purposes only.
+ Tags []string `json:"tags"`
+
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
}
@@ -48,12 +51,14 @@ type NodeBalancerCreateOptions struct {
Region string `json:"region,omitempty"`
ClientConnThrottle *int `json:"client_conn_throttle,omitempty"`
Configs []*NodeBalancerConfigCreateOptions `json:"configs,omitempty"`
+ Tags []string `json:"tags"`
}
// NodeBalancerUpdateOptions are the options permitted for UpdateNodeBalancer
type NodeBalancerUpdateOptions struct {
- Label *string `json:"label,omitempty"`
- ClientConnThrottle *int `json:"client_conn_throttle,omitempty"`
+ Label *string `json:"label,omitempty"`
+ ClientConnThrottle *int `json:"client_conn_throttle,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
}
// GetCreateOptions converts a NodeBalancer to NodeBalancerCreateOptions for use in CreateNodeBalancer
@@ -62,6 +67,7 @@ func (i NodeBalancer) GetCreateOptions() NodeBalancerCreateOptions {
Label: i.Label,
Region: i.Region,
ClientConnThrottle: &i.ClientConnThrottle,
+ Tags: i.Tags,
}
}
@@ -70,6 +76,7 @@ func (i NodeBalancer) GetUpdateOptions() NodeBalancerUpdateOptions {
return NodeBalancerUpdateOptions{
Label: i.Label,
ClientConnThrottle: &i.ClientConnThrottle,
+ Tags: &i.Tags,
}
}
diff --git a/vendor/github.com/linode/linodego/nodebalancer_configs.go b/vendor/github.com/linode/linodego/nodebalancer_configs.go
index 574ec97d2..aa87019c5 100644
--- a/vendor/github.com/linode/linodego/nodebalancer_configs.go
+++ b/vendor/github.com/linode/linodego/nodebalancer_configs.go
@@ -139,7 +139,7 @@ func (i NodeBalancerConfig) GetCreateOptions() NodeBalancerConfigCreateOptions {
CheckTimeout: i.CheckTimeout,
CheckPath: i.CheckPath,
CheckBody: i.CheckBody,
- CheckPassive: &i.CheckPassive,
+ CheckPassive: copyBool(&i.CheckPassive),
CipherSuite: i.CipherSuite,
SSLCert: i.SSLCert,
SSLKey: i.SSLKey,
@@ -158,7 +158,7 @@ func (i NodeBalancerConfig) GetUpdateOptions() NodeBalancerConfigUpdateOptions {
CheckAttempts: i.CheckAttempts,
CheckPath: i.CheckPath,
CheckBody: i.CheckBody,
- CheckPassive: &i.CheckPassive,
+ CheckPassive: copyBool(&i.CheckPassive),
CheckTimeout: i.CheckTimeout,
CipherSuite: i.CipherSuite,
SSLCert: i.SSLCert,
@@ -179,7 +179,7 @@ func (i NodeBalancerConfig) GetRebuildOptions() NodeBalancerConfigRebuildOptions
CheckTimeout: i.CheckTimeout,
CheckPath: i.CheckPath,
CheckBody: i.CheckBody,
- CheckPassive: &i.CheckPassive,
+ CheckPassive: copyBool(&i.CheckPassive),
CipherSuite: i.CipherSuite,
SSLCert: i.SSLCert,
SSLKey: i.SSLKey,
diff --git a/vendor/github.com/linode/linodego/pagination.go b/vendor/github.com/linode/linodego/pagination.go
index a9b73d196..7ca52e2f0 100644
--- a/vendor/github.com/linode/linodego/pagination.go
+++ b/vendor/github.com/linode/linodego/pagination.go
@@ -10,7 +10,7 @@ import (
"log"
"strconv"
- "github.com/go-resty/resty"
+ "gopkg.in/resty.v1"
)
// PageOptions are the pagination parameters for List endpoints
@@ -28,8 +28,8 @@ type ListOptions struct {
// NewListOptions simplified construction of ListOptions using only
// the two writable properties, Page and Filter
-func NewListOptions(Page int, Filter string) *ListOptions {
- return &ListOptions{PageOptions: &PageOptions{Page: Page}, Filter: Filter}
+func NewListOptions(page int, filter string) *ListOptions {
+ return &ListOptions{PageOptions: &PageOptions{Page: page}, Filter: filter}
}
@@ -102,7 +102,7 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
if r, err = coupleAPIErrors(req.SetResult(DomainsPagedResponse{}).Get(v.endpoint(c))); err == nil {
response, ok := r.Result().(*DomainsPagedResponse)
if !ok {
- return fmt.Errorf("Response is not a *DomainsPagedResponse")
+ return fmt.Errorf("response is not a *DomainsPagedResponse")
}
pages = response.Pages
results = response.Results
@@ -149,7 +149,7 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
if r, err = coupleAPIErrors(req.SetResult(SSHKeysPagedResponse{}).Get(v.endpoint(c))); err == nil {
response, ok := r.Result().(*SSHKeysPagedResponse)
if !ok {
- return fmt.Errorf("Response is not a *SSHKeysPagedResponse")
+ return fmt.Errorf("response is not a *SSHKeysPagedResponse")
}
pages = response.Pages
results = response.Results
@@ -173,101 +173,50 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
results = r.Result().(*NotificationsPagedResponse).Results
v.appendData(r.Result().(*NotificationsPagedResponse))
}
+ case *OAuthClientsPagedResponse:
+ if r, err = coupleAPIErrors(req.SetResult(OAuthClientsPagedResponse{}).Get(v.endpoint(c))); err == nil {
+ pages = r.Result().(*OAuthClientsPagedResponse).Pages
+ results = r.Result().(*OAuthClientsPagedResponse).Results
+ v.appendData(r.Result().(*OAuthClientsPagedResponse))
+ }
+ case *PaymentsPagedResponse:
+ if r, err = coupleAPIErrors(req.SetResult(PaymentsPagedResponse{}).Get(v.endpoint(c))); err == nil {
+ pages = r.Result().(*PaymentsPagedResponse).Pages
+ results = r.Result().(*PaymentsPagedResponse).Results
+ v.appendData(r.Result().(*PaymentsPagedResponse))
+ }
case *NodeBalancersPagedResponse:
if r, err = coupleAPIErrors(req.SetResult(NodeBalancersPagedResponse{}).Get(v.endpoint(c))); err == nil {
pages = r.Result().(*NodeBalancersPagedResponse).Pages
results = r.Result().(*NodeBalancersPagedResponse).Results
v.appendData(r.Result().(*NodeBalancersPagedResponse))
}
+ case *TagsPagedResponse:
+ if r, err = coupleAPIErrors(req.SetResult(TagsPagedResponse{}).Get(v.endpoint(c))); err == nil {
+ pages = r.Result().(*TagsPagedResponse).Pages
+ results = r.Result().(*TagsPagedResponse).Results
+ v.appendData(r.Result().(*TagsPagedResponse))
+ }
+ case *TokensPagedResponse:
+ if r, err = coupleAPIErrors(req.SetResult(TokensPagedResponse{}).Get(v.endpoint(c))); err == nil {
+ pages = r.Result().(*TokensPagedResponse).Pages
+ results = r.Result().(*TokensPagedResponse).Results
+ v.appendData(r.Result().(*TokensPagedResponse))
+ }
+ case *UsersPagedResponse:
+ if r, err = coupleAPIErrors(req.SetResult(UsersPagedResponse{}).Get(v.endpoint(c))); err == nil {
+ pages = r.Result().(*UsersPagedResponse).Pages
+ results = r.Result().(*UsersPagedResponse).Results
+ v.appendData(r.Result().(*UsersPagedResponse))
+ }
/**
- case AccountOauthClientsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*AccountOauthClientsPagedResponse).Pages
- results = r.Result().(*AccountOauthClientsPagedResponse).Results
- v.appendData(r.Result().(*AccountOauthClientsPagedResponse))
- }
- case AccountPaymentsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*AccountPaymentsPagedResponse).Pages
- results = r.Result().(*AccountPaymentsPagedResponse).Results
- v.appendData(r.Result().(*AccountPaymentsPagedResponse))
- }
- case AccountUsersPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*AccountUsersPagedResponse).Pages
- results = r.Result().(*AccountUsersPagedResponse).Results
- v.appendData(r.Result().(*AccountUsersPagedResponse))
- }
case ProfileAppsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ProfileAppsPagedResponse).Pages
- results = r.Result().(*ProfileAppsPagedResponse).Results
- v.appendData(r.Result().(*ProfileAppsPagedResponse))
- }
- case ProfileTokensPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ProfileTokensPagedResponse).Pages
- results = r.Result().(*ProfileTokensPagedResponse).Results
- v.appendData(r.Result().(*ProfileTokensPagedResponse))
- }
case ProfileWhitelistPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ProfileWhitelistPagedResponse).Pages
- results = r.Result().(*ProfileWhitelistPagedResponse).Results
- v.appendData(r.Result().(*ProfileWhitelistPagedResponse))
- }
case ManagedContactsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ManagedContactsPagedResponse).Pages
- results = r.Result().(*ManagedContactsPagedResponse).Results
- v.appendData(r.Result().(*ManagedContactsPagedResponse))
- }
case ManagedCredentialsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ManagedCredentialsPagedResponse).Pages
- results = r.Result().(*ManagedCredentialsPagedResponse).Results
- v.appendData(r.Result().(*ManagedCredentialsPagedResponse))
- }
case ManagedIssuesPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ManagedIssuesPagedResponse).Pages
- results = r.Result().(*ManagedIssuesPagedResponse).Results
- v.appendData(r.Result().(*ManagedIssuesPagedResponse))
- }
case ManagedLinodeSettingsPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ManagedLinodeSettingsPagedResponse).Pages
- results = r.Result().(*ManagedLinodeSettingsPagedResponse).Results
- v.appendData(r.Result().(*ManagedLinodeSettingsPagedResponse))
- }
case ManagedServicesPagedResponse:
- if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
- return NewError(r)
- } else if err == nil {
- pages = r.Result().(*ManagedServicesPagedResponse).Pages
- results = r.Result().(*ManagedServicesPagedResponse).Results
- v.appendData(r.Result().(*ManagedServicesPagedResponse))
- }
**/
default:
log.Fatalf("listHelper interface{} %+v used", i)
@@ -278,7 +227,7 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
}
if opts == nil {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
if err := c.listHelper(ctx, i, &ListOptions{PageOptions: &PageOptions{Page: page}}); err != nil {
return err
}
@@ -289,7 +238,7 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
}
if opts.Page == 0 {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
opts.Page = page
if err := c.listHelper(ctx, i, opts); err != nil {
return err
@@ -308,7 +257,7 @@ func (c *Client) listHelper(ctx context.Context, i interface{}, opts *ListOption
// 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) listHelperWithID(ctx context.Context, i interface{}, id int, opts *ListOptions) error {
+func (c *Client) listHelperWithID(ctx context.Context, i interface{}, idRaw interface{}, opts *ListOptions) error {
req := c.R(ctx)
if opts != nil && opts.Page > 0 {
req.SetQueryParam("page", strconv.Itoa(opts.Page))
@@ -321,6 +270,8 @@ func (c *Client) listHelperWithID(ctx context.Context, i interface{}, id int, op
r *resty.Response
)
+ id, _ := idRaw.(int)
+
if opts != nil && len(opts.Filter) > 0 {
req.SetHeader("X-Filter", opts.Filter)
}
@@ -336,7 +287,7 @@ func (c *Client) listHelperWithID(ctx context.Context, i interface{}, id int, op
if r, err = coupleAPIErrors(req.SetResult(DomainRecordsPagedResponse{}).Get(v.endpointWithID(c, id))); err == nil {
response, ok := r.Result().(*DomainRecordsPagedResponse)
if !ok {
- return fmt.Errorf("Response is not a *DomainRecordsPagedResponse")
+ return fmt.Errorf("response is not a *DomainRecordsPagedResponse")
}
pages = response.Pages
results = response.Results
@@ -366,6 +317,14 @@ func (c *Client) listHelperWithID(ctx context.Context, i interface{}, id int, op
results = r.Result().(*InstanceVolumesPagedResponse).Results
v.appendData(r.Result().(*InstanceVolumesPagedResponse))
}
+ case *TaggedObjectsPagedResponse:
+ idStr := idRaw.(string)
+
+ if r, err = coupleAPIErrors(req.SetResult(TaggedObjectsPagedResponse{}).Get(v.endpointWithID(c, idStr))); err == nil {
+ pages = r.Result().(*TaggedObjectsPagedResponse).Pages
+ results = r.Result().(*TaggedObjectsPagedResponse).Results
+ v.appendData(r.Result().(*TaggedObjectsPagedResponse))
+ }
/**
case TicketAttachmentsPagedResponse:
if r, err = req.SetResult(v).Get(v.endpoint(c)); r.Error() != nil {
@@ -393,7 +352,7 @@ func (c *Client) listHelperWithID(ctx context.Context, i interface{}, id int, op
}
if opts == nil {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
if err := c.listHelperWithID(ctx, i, id, &ListOptions{PageOptions: &PageOptions{Page: page}}); err != nil {
return err
}
@@ -403,7 +362,7 @@ func (c *Client) listHelperWithID(ctx context.Context, i interface{}, id int, op
opts.PageOptions = &PageOptions{}
}
if opts.Page == 0 {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
opts.Page = page
if err := c.listHelperWithID(ctx, i, id, opts); err != nil {
return err
@@ -456,7 +415,7 @@ func (c *Client) listHelperWithTwoIDs(ctx context.Context, i interface{}, firstI
}
if opts == nil {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
if err := c.listHelper(ctx, i, &ListOptions{PageOptions: &PageOptions{Page: page}}); err != nil {
return err
}
@@ -466,7 +425,7 @@ func (c *Client) listHelperWithTwoIDs(ctx context.Context, i interface{}, firstI
opts.PageOptions = &PageOptions{}
}
if opts.Page == 0 {
- for page := 2; page <= pages; page = page + 1 {
+ for page := 2; page <= pages; page++ {
opts.Page = page
if err := c.listHelperWithTwoIDs(ctx, i, firstID, secondID, opts); err != nil {
return err
diff --git a/vendor/github.com/linode/linodego/profile.go b/vendor/github.com/linode/linodego/profile.go
index 152361292..36c50b0e2 100644
--- a/vendor/github.com/linode/linodego/profile.go
+++ b/vendor/github.com/linode/linodego/profile.go
@@ -1 +1,117 @@
package linodego
+
+/*
+ - copy profile_test.go and do the same
+ - When updating Profile structs,
+ - use pointers where ever null'able would have a different meaning if the wrapper
+ supplied "" or 0 instead
+ - Add "NameOfResource" to client.go, resources.go, pagination.go
+*/
+
+import (
+ "context"
+ "encoding/json"
+)
+
+// LishAuthMethod constants start with AuthMethod and include Linode API Lish Authentication Methods
+type LishAuthMethod string
+
+// LishAuthMethod constants are the methods of authentication allowed when connecting via Lish
+const (
+ AuthMethodPasswordKeys LishAuthMethod = "password_keys"
+ AuthMethodKeysOnly LishAuthMethod = "keys_only"
+ AuthMethodDisabled LishAuthMethod = "disabled"
+)
+
+// ProfileReferrals represent a User's status in the Referral Program
+type ProfileReferrals struct {
+ Total int `json:"total"`
+ Completed int `json:"completed"`
+ Pending int `json:"pending"`
+ Credit float64 `json:"credit"`
+ Code string `json:"code"`
+ URL string `json:"url"`
+}
+
+// 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"`
+}
+
+// ProfileUpdateOptions fields are those accepted by UpdateProfile
+type ProfileUpdateOptions struct {
+ Email string `json:"email,omitempty"`
+ Timezone string `json:"timezone,omitempty"`
+ EmailNotifications *bool `json:"email_notifications,omitempty"`
+ IPWhitelistEnabled *bool `json:"ip_whitelist_enabled,omitempty"`
+ LishAuthMethod LishAuthMethod `json:"lish_auth_method,omitempty"`
+ AuthorizedKeys *[]string `json:"authorized_keys,omitempty"`
+ TwoFactorAuth *bool `json:"two_factor_auth,omitempty"`
+ Restricted *bool `json:"restricted,omitempty"`
+}
+
+// GetUpdateOptions converts a Profile to ProfileUpdateOptions for use in UpdateProfile
+func (i Profile) GetUpdateOptions() (o ProfileUpdateOptions) {
+ o.Email = i.Email
+ o.Timezone = i.Timezone
+ o.EmailNotifications = copyBool(&i.EmailNotifications)
+ o.IPWhitelistEnabled = copyBool(&i.IPWhitelistEnabled)
+ o.LishAuthMethod = i.LishAuthMethod
+ authorizedKeys := make([]string, len(i.AuthorizedKeys))
+ copy(authorizedKeys, i.AuthorizedKeys)
+ o.AuthorizedKeys = &authorizedKeys
+ o.TwoFactorAuth = copyBool(&i.TwoFactorAuth)
+ o.Restricted = copyBool(&i.Restricted)
+
+ return
+}
+
+// GetProfile returns the Profile of the authenticated user
+func (c *Client) GetProfile(ctx context.Context) (*Profile, error) {
+ e, err := c.Profile.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&Profile{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Profile), nil
+}
+
+// UpdateProfile updates the Profile with the specified id
+func (c *Client) UpdateProfile(ctx context.Context, updateOpts ProfileUpdateOptions) (*Profile, error) {
+ var body string
+ e, err := c.Profile.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&Profile{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Profile), nil
+}
diff --git a/vendor/github.com/linode/linodego/profile_tokens.go b/vendor/github.com/linode/linodego/profile_tokens.go
new file mode 100644
index 000000000..bd95dfe05
--- /dev/null
+++ b/vendor/github.com/linode/linodego/profile_tokens.go
@@ -0,0 +1,195 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "time"
+)
+
+// Token represents a Token object
+type Token struct {
+ // This token's unique ID, which can be used to revoke it.
+ 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.
+ 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)
+ Label string `json:"label"`
+
+ // The token used to access the API. When the token is created, the full token is returned here. Otherwise, only the first 16 characters are returned.
+ Token string `json:"token"`
+
+ // The date and time this token was created.
+ Created *time.Time `json:"-"`
+ CreatedStr string `json:"created"`
+
+ // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked.
+ Expiry *time.Time `json:"-"`
+ ExpiryStr string `json:"expiry"`
+}
+
+// TokenCreateOptions fields are those accepted by CreateToken
+type TokenCreateOptions struct {
+ // 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.
+ 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)
+ Label string `json:"label"`
+
+ // When this token will expire. Personal Access Tokens cannot be renewed, so after this time the token will be completely unusable and a new token will need to be generated. Tokens may be created with "null" as their expiry and will never expire unless revoked.
+ Expiry *time.Time `json:"expiry"`
+}
+
+// TokenUpdateOptions fields are those accepted by UpdateToken
+type TokenUpdateOptions struct {
+ // 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)
+ Label string `json:"label"`
+}
+
+// GetCreateOptions converts a Token to TokenCreateOptions for use in CreateToken
+func (i Token) GetCreateOptions() (o TokenCreateOptions) {
+ o.Label = i.Label
+ o.Expiry = copyTime(i.Expiry)
+ o.Scopes = i.Scopes
+ return
+}
+
+// GetUpdateOptions converts a Token to TokenUpdateOptions for use in UpdateToken
+func (i Token) GetUpdateOptions() (o TokenUpdateOptions) {
+ o.Label = i.Label
+ 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(c *Client) string {
+ endpoint, err := c.Tokens.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ return endpoint
+}
+
+// appendData appends Tokens when processing paginated Token responses
+func (resp *TokensPagedResponse) appendData(r *TokensPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// ListTokens lists Tokens
+func (c *Client) ListTokens(ctx context.Context, opts *ListOptions) ([]Token, error) {
+ response := TokensPagedResponse{}
+ err := c.listHelper(ctx, &response, opts)
+ for i := range response.Data {
+ response.Data[i].fixDates()
+ }
+ if err != nil {
+ return nil, err
+ }
+ return response.Data, nil
+}
+
+// fixDates converts JSON timestamps to Go time.Time values
+func (i *Token) fixDates() *Token {
+ i.Created, _ = parseDates(i.CreatedStr)
+ i.Expiry, _ = parseDates(i.ExpiryStr)
+ return i
+}
+
+// GetToken gets the token with the provided ID
+func (c *Client) GetToken(ctx context.Context, id int) (*Token, error) {
+ e, err := c.Tokens.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%d", e, id)
+ r, err := coupleAPIErrors(c.R(ctx).SetResult(&Token{}).Get(e))
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Token).fixDates(), nil
+}
+
+// CreateToken creates a Token
+func (c *Client) CreateToken(ctx context.Context, createOpts TokenCreateOptions) (*Token, error) {
+ var body string
+ e, err := c.Tokens.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&Token{})
+
+ // Format the Time as a string to meet the ISO8601 requirement
+ createOptsFixed := struct {
+ Label string `json:"label"`
+ Scopes string `json:"scopes"`
+ Expiry *string `json:"expiry"`
+ }{}
+ createOptsFixed.Label = createOpts.Label
+ createOptsFixed.Scopes = createOpts.Scopes
+ if createOpts.Expiry != nil {
+ iso8601Expiry := createOpts.Expiry.UTC().Format("2006-01-02T15:04:05")
+ createOptsFixed.Expiry = &iso8601Expiry
+ }
+
+ if bodyData, err := json.Marshal(createOptsFixed); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Token).fixDates(), nil
+}
+
+// UpdateToken updates the Token with the specified id
+func (c *Client) UpdateToken(ctx context.Context, id int, updateOpts TokenUpdateOptions) (*Token, error) {
+ var body string
+ e, err := c.Tokens.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+ e = fmt.Sprintf("%s/%d", e, id)
+
+ req := c.R(ctx).SetResult(&Token{})
+
+ if bodyData, err := json.Marshal(updateOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Put(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Token).fixDates(), nil
+}
+
+// DeleteToken deletes the Token with the specified id
+func (c *Client) DeleteToken(ctx context.Context, id int) error {
+ e, err := c.Tokens.Endpoint()
+ if err != nil {
+ return err
+ }
+ e = fmt.Sprintf("%s/%d", e, id)
+
+ _, err = coupleAPIErrors(c.R(ctx).Delete(e))
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/resources.go b/vendor/github.com/linode/linodego/resources.go
index 1a2027841..705ec9ac3 100644
--- a/vendor/github.com/linode/linodego/resources.go
+++ b/vendor/github.com/linode/linodego/resources.go
@@ -6,7 +6,7 @@ import (
"fmt"
"text/template"
- "github.com/go-resty/resty"
+ "gopkg.in/resty.v1"
)
const (
@@ -18,6 +18,7 @@ const (
instanceIPsName = "ips"
instanceSnapshotsName = "snapshots"
instanceVolumesName = "instancevolumes"
+ instanceStatsName = "instancestats"
ipaddressesName = "ipaddresses"
ipv6poolsName = "ipv6pools"
ipv6rangesName = "ipv6ranges"
@@ -33,15 +34,21 @@ const (
nodebalancersName = "nodebalancers"
nodebalancerconfigsName = "nodebalancerconfigs"
nodebalancernodesName = "nodebalancernodes"
+ notificationsName = "notifications"
+ oauthClientsName = "oauthClients"
sshkeysName = "sshkeys"
ticketsName = "tickets"
+ tokensName = "tokens"
accountName = "account"
+ accountSettingsName = "accountsettings"
eventsName = "events"
invoicesName = "invoices"
invoiceItemsName = "invoiceitems"
profileName = "profile"
managedName = "managed"
- // notificationsName = "notifications"
+ tagsName = "tags"
+ usersName = "users"
+ paymentsName = "payments"
stackscriptsEndpoint = "linode/stackscripts"
imagesEndpoint = "images"
@@ -51,9 +58,10 @@ const (
instanceSnapshotsEndpoint = "linode/instances/{{ .ID }}/backups"
instanceIPsEndpoint = "linode/instances/{{ .ID }}/ips"
instanceVolumesEndpoint = "linode/instances/{{ .ID }}/volumes"
- ipaddressesEndpoint = "network/ips"
- ipv6poolsEndpoint = "network/ipv6/pools"
- ipv6rangesEndpoint = "network/ipv6/ranges"
+ instanceStatsEndpoint = "linode/instances/{{ .ID }}/stats"
+ ipaddressesEndpoint = "networking/ips"
+ ipv6poolsEndpoint = "networking/ipv6/pools"
+ ipv6rangesEndpoint = "networking/ipv6/ranges"
regionsEndpoint = "regions"
volumesEndpoint = "volumes"
kernelsEndpoint = "linode/kernels"
@@ -72,13 +80,19 @@ const (
nodebalancernodesEndpoint = "nodebalancers/{{ .ID }}/configs/{{ .SecondID }}/nodes"
sshkeysEndpoint = "profile/sshkeys"
ticketsEndpoint = "support/tickets"
+ tokensEndpoint = "profile/tokens"
accountEndpoint = "account"
+ accountSettingsEndpoint = "account/settings"
eventsEndpoint = "account/events"
invoicesEndpoint = "account/invoices"
invoiceItemsEndpoint = "account/invoices/{{ .ID }}/items"
profileEndpoint = "profile"
managedEndpoint = "managed"
- // notificationsEndpoint = "account/notifications"
+ tagsEndpoint = "tags"
+ usersEndpoint = "account/users"
+ notificationsEndpoint = "account/notifications"
+ oauthClientsEndpoint = "account/oauth-clients"
+ paymentsEndpoint = "account/payments"
)
// Resource represents a linode API resource
@@ -118,14 +132,15 @@ func (r Resource) render(data ...interface{}) (string, error) {
buf := bytes.NewBufferString(out)
var substitutions interface{}
- if len(data) == 1 {
+ switch len(data) {
+ case 1:
substitutions = struct{ ID interface{} }{data[0]}
- } else if len(data) == 2 {
+ case 2:
substitutions = struct {
ID interface{}
SecondID interface{}
}{data[0], data[1]}
- } else {
+ default:
return "", NewError("Too many arguments to render template (expected 1 or 2)")
}
if err := r.endpointTemplate.Execute(buf, substitutions); err != nil {
diff --git a/vendor/github.com/linode/linodego/stackscripts.go b/vendor/github.com/linode/linodego/stackscripts.go
index daf339b2f..e6c2d82fa 100644
--- a/vendor/github.com/linode/linodego/stackscripts.go
+++ b/vendor/github.com/linode/linodego/stackscripts.go
@@ -16,6 +16,8 @@ type Stackscript struct {
Username string `json:"username"`
Label string `json:"label"`
Description string `json:"description"`
+ Ordinal int `json:"ordinal"`
+ LogoURL string `json:"logo_url"`
Images []string `json:"images"`
DeploymentsTotal int `json:"deployments_total"`
DeploymentsActive int `json:"deployments_active"`
diff --git a/vendor/github.com/linode/linodego/tags.go b/vendor/github.com/linode/linodego/tags.go
new file mode 100644
index 000000000..be66774e8
--- /dev/null
+++ b/vendor/github.com/linode/linodego/tags.go
@@ -0,0 +1,219 @@
+package linodego
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+)
+
+// Tag represents a Tag object
+type Tag struct {
+ Label string `json:"label"`
+}
+
+// TaggedObject represents a Tagged Object object
+type TaggedObject struct {
+ Type string `json:"type"`
+ RawData json.RawMessage `json:"data"`
+ Data interface{} `json:"-"`
+}
+
+// SortedObjects currently only includes Instances
+type SortedObjects struct {
+ Instances []Instance
+ Domains []Domain
+ Volumes []Volume
+ NodeBalancers []NodeBalancer
+ /*
+ StackScripts []Stackscript
+ */
+}
+
+// TaggedObjectList are a list of TaggedObjects, as returning by ListTaggedObjects
+type TaggedObjectList []TaggedObject
+
+// TagCreateOptions fields are those accepted by CreateTag
+type TagCreateOptions struct {
+ Label string `json:"label"`
+ Linodes []int `json:"linodes,omitempty"`
+ Domains []int `json:"domains,omitempty"`
+ Volumes []int `json:"volumes,omitempty"`
+ NodeBalancers []int `json:"nodebalancers,omitempty"`
+}
+
+// GetCreateOptions converts a Tag to TagCreateOptions for use in CreateTag
+func (i Tag) GetCreateOptions() (o TagCreateOptions) {
+ o.Label = i.Label
+ return
+}
+
+// TaggedObjectsPagedResponse represents a paginated Tag API response
+type TaggedObjectsPagedResponse struct {
+ *PageOptions
+ Data []TaggedObject `json:"data"`
+}
+
+// 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(c *Client) string {
+ endpoint, err := c.Tags.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ return endpoint
+}
+
+// endpoint gets the endpoint URL for Tag
+func (TaggedObjectsPagedResponse) endpointWithID(c *Client, id string) string {
+ endpoint, err := c.Tags.Endpoint()
+ if err != nil {
+ panic(err)
+ }
+ endpoint = fmt.Sprintf("%s/%s", endpoint, id)
+ return endpoint
+}
+
+// appendData appends Tags when processing paginated Tag responses
+func (resp *TagsPagedResponse) appendData(r *TagsPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// appendData appends TaggedObjects when processing paginated TaggedObjects responses
+func (resp *TaggedObjectsPagedResponse) appendData(r *TaggedObjectsPagedResponse) {
+ resp.Data = append(resp.Data, r.Data...)
+}
+
+// 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
+}
+
+// fixData stores an object of the type defined by Type in Data using RawData
+func (i *TaggedObject) fixData() (*TaggedObject, error) {
+ switch i.Type {
+ case "linode":
+ obj := Instance{}
+ if err := json.Unmarshal(i.RawData, &obj); err != nil {
+ return nil, err
+ }
+ i.Data = obj
+ case "nodebalancer":
+ obj := NodeBalancer{}
+ if err := json.Unmarshal(i.RawData, &obj); err != nil {
+ return nil, err
+ }
+ i.Data = obj
+ case "domain":
+ obj := Domain{}
+ if err := json.Unmarshal(i.RawData, &obj); err != nil {
+ return nil, err
+ }
+ i.Data = obj
+ case "volume":
+ obj := Volume{}
+ if err := json.Unmarshal(i.RawData, &obj); err != nil {
+ return nil, err
+ }
+ i.Data = obj
+ }
+
+ return i, nil
+}
+
+// ListTaggedObjects lists Tagged Objects
+func (c *Client) ListTaggedObjects(ctx context.Context, label string, opts *ListOptions) (TaggedObjectList, error) {
+ response := TaggedObjectsPagedResponse{}
+ err := c.listHelperWithID(ctx, &response, label, opts)
+ if err != nil {
+ return nil, err
+ }
+ for i := range response.Data {
+ if _, err := response.Data[i].fixData(); err != nil {
+ return nil, err
+ }
+ }
+ return response.Data, nil
+}
+
+// SortedObjects converts a list of TaggedObjects into a Sorted Objects struct, for easier access
+func (t TaggedObjectList) SortedObjects() (SortedObjects, error) {
+ so := SortedObjects{}
+ for _, o := range t {
+ switch o.Type {
+ case "linode":
+ if instance, ok := o.Data.(Instance); ok {
+ so.Instances = append(so.Instances, instance)
+ } else {
+ return so, errors.New("expected an Instance when Type was \"linode\"")
+ }
+ case "domain":
+ if domain, ok := o.Data.(Domain); ok {
+ so.Domains = append(so.Domains, domain)
+ } else {
+ return so, errors.New("expected a Domain when Type was \"domain\"")
+ }
+ case "volume":
+ if volume, ok := o.Data.(Volume); ok {
+ so.Volumes = append(so.Volumes, volume)
+ } else {
+ return so, errors.New("expected an Volume when Type was \"volume\"")
+ }
+ case "nodebalancer":
+ if nodebalancer, ok := o.Data.(NodeBalancer); ok {
+ so.NodeBalancers = append(so.NodeBalancers, nodebalancer)
+ } else {
+ return so, errors.New("expected an NodeBalancer when Type was \"nodebalancer\"")
+ }
+ }
+ }
+ return so, nil
+}
+
+// CreateTag creates a Tag
+func (c *Client) CreateTag(ctx context.Context, createOpts TagCreateOptions) (*Tag, error) {
+ var body string
+ e, err := c.Tags.Endpoint()
+ if err != nil {
+ return nil, err
+ }
+
+ req := c.R(ctx).SetResult(&Tag{})
+
+ if bodyData, err := json.Marshal(createOpts); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
+ SetBody(body).
+ Post(e))
+
+ if err != nil {
+ return nil, err
+ }
+ return r.Result().(*Tag), nil
+}
+
+// DeleteTag deletes the Tag with the specified id
+func (c *Client) DeleteTag(ctx context.Context, label string) error {
+ e, err := c.Tags.Endpoint()
+ if err != nil {
+ return err
+ }
+ e = fmt.Sprintf("%s/%s", e, label)
+
+ _, err = coupleAPIErrors(c.R(ctx).Delete(e))
+ return err
+}
diff --git a/vendor/github.com/linode/linodego/template.go b/vendor/github.com/linode/linodego/template.go
index 6048dded3..ed0616837 100644
--- a/vendor/github.com/linode/linodego/template.go
+++ b/vendor/github.com/linode/linodego/template.go
@@ -36,14 +36,14 @@ type TemplateUpdateOptions struct {
// GetCreateOptions converts a Template to TemplateCreateOptions for use in CreateTemplate
func (i Template) GetCreateOptions() (o TemplateCreateOptions) {
// o.Label = i.Label
- // o.Description = copyString(o.Description)
+ // o.Description = copyString(i.Description)
return
}
// GetUpdateOptions converts a Template to TemplateUpdateOptions for use in UpdateTemplate
func (i Template) GetUpdateOptions() (o TemplateUpdateOptions) {
// o.Label = i.Label
- // o.Description = copyString(o.Description)
+ // o.Description = copyString(i.Description)
return
}
diff --git a/vendor/github.com/linode/linodego/types.go b/vendor/github.com/linode/linodego/types.go
index edeada84a..d1ffbafef 100644
--- a/vendor/github.com/linode/linodego/types.go
+++ b/vendor/github.com/linode/linodego/types.go
@@ -9,7 +9,7 @@ import (
type LinodeType struct {
ID string `json:"id"`
Disk int `json:"disk"`
- Class LinodeTypeClass `json:"class"` // enum: nanode, standard, highmem
+ Class LinodeTypeClass `json:"class"` // enum: nanode, standard, highmem, dedicated
Price *LinodePrice `json:"price"`
Label string `json:"label"`
Addons *LinodeAddons `json:"addons"`
@@ -40,9 +40,10 @@ type LinodeTypeClass string
// LinodeTypeClass contants are the Instance Type Classes that an Instance Type can be assigned
const (
- ClassNanode LinodeTypeClass = "nanode"
- ClassStandard LinodeTypeClass = "standard"
- ClassHighmem LinodeTypeClass = "highmem"
+ ClassNanode LinodeTypeClass = "nanode"
+ ClassStandard LinodeTypeClass = "standard"
+ ClassHighmem LinodeTypeClass = "highmem"
+ ClassDedicated LinodeTypeClass = "dedicated"
)
// LinodeTypesPagedResponse represents a linode types API response for listing
diff --git a/vendor/github.com/linode/linodego/volumes.go b/vendor/github.com/linode/linodego/volumes.go
index eef492d83..603f3d2fc 100644
--- a/vendor/github.com/linode/linodego/volumes.go
+++ b/vendor/github.com/linode/linodego/volumes.go
@@ -36,6 +36,7 @@ type Volume struct {
Size int `json:"size"`
LinodeID *int `json:"linode_id"`
FilesystemPath string `json:"filesystem_path"`
+ Tags []string `json:"tags"`
Created time.Time `json:"-"`
Updated time.Time `json:"-"`
}
@@ -48,12 +49,22 @@ type VolumeCreateOptions struct {
ConfigID int `json:"config_id,omitempty"`
// The Volume's size, in GiB. Minimum size is 10GiB, maximum size is 10240GiB. A "0" value will result in the default size.
Size int `json:"size,omitempty"`
+ // 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"`
+}
+
+// VolumeUpdateOptions fields are those accepted by UpdateVolume
+type VolumeUpdateOptions struct {
+ Label string `json:"label,omitempty"`
+ Tags *[]string `json:"tags,omitempty"`
}
// VolumeAttachOptions fields are those accepted by AttachVolume
type VolumeAttachOptions struct {
- LinodeID int `json:"linode_id"`
- ConfigID int `json:"config_id,omitempty"`
+ LinodeID int `json:"linode_id"`
+ ConfigID int `json:"config_id,omitempty"`
+ PersistAcrossBoots *bool `json:"persist_across_boots,omitempty"`
}
// VolumesPagedResponse represents a linode API response for listing of volumes
@@ -62,6 +73,25 @@ type VolumesPagedResponse struct {
Data []Volume `json:"data"`
}
+// GetUpdateOptions converts a Volume to VolumeUpdateOptions for use in UpdateVolume
+func (v Volume) GetUpdateOptions() (updateOpts VolumeUpdateOptions) {
+ updateOpts.Label = v.Label
+ updateOpts.Tags = &v.Tags
+ return
+}
+
+// GetCreateOptions converts a Volume to VolumeCreateOptions for use in CreateVolume
+func (v Volume) GetCreateOptions() (createOpts VolumeCreateOptions) {
+ createOpts.Label = v.Label
+ createOpts.Tags = v.Tags
+ createOpts.Region = v.Region
+ createOpts.Size = v.Size
+ if v.LinodeID != nil && *v.LinodeID > 0 {
+ createOpts.LinodeID = *v.LinodeID
+ }
+ return
+}
+
// endpoint gets the endpoint URL for Volume
func (VolumesPagedResponse) endpoint(c *Client) string {
endpoint, err := c.Volumes.Endpoint()
@@ -168,26 +198,37 @@ func (c *Client) CreateVolume(ctx context.Context, createOpts VolumeCreateOption
}
// RenameVolume renames the label of a Linode volume
-// There is no UpdateVolume because the label is the only alterable field.
+// DEPRECATED: use UpdateVolume
func (c *Client) RenameVolume(ctx context.Context, id int, label string) (*Volume, error) {
- body, _ := json.Marshal(map[string]string{"label": label})
+ updateOpts := VolumeUpdateOptions{Label: label}
+ return c.UpdateVolume(ctx, id, updateOpts)
+}
+// UpdateVolume updates the Volume with the specified id
+func (c *Client) UpdateVolume(ctx context.Context, id int, volume VolumeUpdateOptions) (*Volume, error) {
+ var body string
e, err := c.Volumes.Endpoint()
if err != nil {
- return nil, NewError(err)
+ return nil, err
}
e = fmt.Sprintf("%s/%d", e, id)
- resp, err := coupleAPIErrors(c.R(ctx).
- SetResult(&Volume{}).
+ req := c.R(ctx).SetResult(&Volume{})
+
+ if bodyData, err := json.Marshal(volume); err == nil {
+ body = string(bodyData)
+ } else {
+ return nil, NewError(err)
+ }
+
+ r, err := coupleAPIErrors(req.
SetBody(body).
Put(e))
if err != nil {
return nil, err
}
-
- return resp.Result().(*Volume).fixDates(), nil
+ return r.Result().(*Volume).fixDates(), nil
}
// CloneVolume clones a Linode volume
diff --git a/vendor/github.com/linode/linodego/waitfor.go b/vendor/github.com/linode/linodego/waitfor.go
index aaf387c46..b34ea3d72 100644
--- a/vendor/github.com/linode/linodego/waitfor.go
+++ b/vendor/github.com/linode/linodego/waitfor.go
@@ -16,7 +16,7 @@ func (client Client) WaitForInstanceStatus(ctx context.Context, instanceID int,
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
defer cancel()
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
defer ticker.Stop()
for {
select {
@@ -36,13 +36,47 @@ func (client Client) WaitForInstanceStatus(ctx context.Context, instanceID int,
}
}
+// WaitForInstanceDiskStatus waits for the Linode instance disk to reach the desired state
+// before returning. It will timeout with an error after timeoutSeconds.
+func (client Client) WaitForInstanceDiskStatus(ctx context.Context, instanceID int, diskID int, status DiskStatus, timeoutSeconds int) (*InstanceDisk, error) {
+ ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
+ defer cancel()
+
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
+ defer ticker.Stop()
+ for {
+ select {
+ case <-ticker.C:
+ // GetInstanceDisk will 404 on newly created disks. use List instead.
+ // disk, err := client.GetInstanceDisk(ctx, instanceID, diskID)
+ disks, err := client.ListInstanceDisks(ctx, instanceID, nil)
+ if err != nil {
+ return nil, err
+ }
+ for _, disk := range disks {
+ disk := disk
+ if disk.ID == diskID {
+ complete := (disk.Status == status)
+ if complete {
+ return &disk, nil
+ }
+ break
+ }
+ }
+
+ case <-ctx.Done():
+ return nil, fmt.Errorf("Error waiting for Instance %d Disk %d status %s: %s", instanceID, diskID, status, ctx.Err())
+ }
+ }
+}
+
// WaitForVolumeStatus waits for the Volume to reach the desired state
// before returning. It will timeout with an error after timeoutSeconds.
func (client Client) WaitForVolumeStatus(ctx context.Context, volumeID int, status VolumeStatus, timeoutSeconds int) (*Volume, error) {
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
defer cancel()
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
defer ticker.Stop()
for {
select {
@@ -68,7 +102,7 @@ func (client Client) WaitForSnapshotStatus(ctx context.Context, instanceID int,
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
defer cancel()
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
defer ticker.Stop()
for {
select {
@@ -96,7 +130,7 @@ func (client Client) WaitForVolumeLinodeID(ctx context.Context, volumeID int, li
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
defer cancel()
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
defer ticker.Stop()
for {
select {
@@ -106,11 +140,12 @@ func (client Client) WaitForVolumeLinodeID(ctx context.Context, volumeID int, li
return volume, err
}
- if linodeID == nil && volume.LinodeID == nil {
+ switch {
+ case linodeID == nil && volume.LinodeID == nil:
return volume, nil
- } else if linodeID == nil || volume.LinodeID == nil {
+ case linodeID == nil || volume.LinodeID == nil:
// continue waiting
- } else if *volume.LinodeID == *linodeID {
+ case *volume.LinodeID == *linodeID:
return volume, nil
}
@@ -125,15 +160,7 @@ func (client Client) WaitForVolumeLinodeID(ctx context.Context, volumeID int, li
// If the event indicates a failure both the failed event and the error will be returned.
func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, entityType EntityType, action EventAction, minStart time.Time, timeoutSeconds int) (*Event, error) {
titledEntityType := strings.Title(string(entityType))
- filter, _ := json.Marshal(map[string]interface{}{
- // Entity is not filtered by the API
- // Perhaps one day they will permit Entity ID/Type filtering.
- // We'll have to verify these values manually, for now.
- //"entity": map[string]interface{}{
- // "id": fmt.Sprintf("%v", id),
- // "type": entityType,
- //},
-
+ filterStruct := map[string]interface{}{
// Nor is action
//"action": action,
@@ -144,16 +171,33 @@ func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, e
//},
// With potentially 1000+ events coming back, we should filter on something
+ // Warning: This optimization has the potential to break if users are clearing
+ // events before we see them.
"seen": false,
// Float the latest events to page 1
"+order_by": "created",
"+order": "desc",
- })
+ }
// Optimistically restrict results to page 1. We should remove this when more
// precise filtering options exist.
- listOptions := NewListOptions(1, string(filter))
+ pages := 1
+
+ // The API has limitted filtering support for Event ID and Event Type
+ // Optimize the list, if possible
+ switch entityType {
+ case EntityDisk, EntityLinode, EntityDomain, EntityNodebalancer:
+ // All of the filter supported types have int ids
+ filterableEntityID, err := strconv.Atoi(fmt.Sprintf("%v", id))
+ if err != nil {
+ return nil, fmt.Errorf("Error parsing Entity ID %q for optimized WaitForEventFinished EventType %q: %s", id, entityType, err)
+ }
+ filterStruct["entity.id"] = filterableEntityID
+ filterStruct["entity.type"] = entityType
+
+ // TODO: are we conformatable with pages = 0 with the event type and id filter?
+ }
ctx, cancel := context.WithTimeout(ctx, time.Duration(timeoutSeconds)*time.Second)
defer cancel()
@@ -163,11 +207,28 @@ func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, e
log.Printf("[INFO] Waiting %d seconds for %s events since %v for %s %v", int(duration.Seconds()), action, minStart, titledEntityType, id)
}
- ticker := time.NewTicker(time.Second)
+ ticker := time.NewTicker(client.millisecondsPerPoll * time.Millisecond)
+
+ // avoid repeating log messages
+ nextLog := ""
+ lastLog := ""
+ lastEventID := 0
+
defer ticker.Stop()
for {
select {
case <-ticker.C:
+ if lastEventID > 0 {
+ filterStruct["id"] = map[string]interface{}{
+ "+gte": lastEventID,
+ }
+ }
+
+ filter, err := json.Marshal(filterStruct)
+ if err != nil {
+ return nil, err
+ }
+ listOptions := NewListOptions(pages, string(filter))
events, err := client.ListEvents(ctx, listOptions)
if err != nil {
@@ -176,32 +237,34 @@ func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, e
// If there are events for this instance + action, inspect them
for _, event := range events {
+ event := event
+
if event.Action != action {
// log.Println("action mismatch", event.Action, action)
continue
}
- if event.Entity.Type != entityType {
+ if event.Entity == nil || event.Entity.Type != entityType {
// log.Println("type mismatch", event.Entity.Type, entityType)
continue
}
var entID string
- switch event.Entity.ID.(type) {
+ switch id := event.Entity.ID.(type) {
case float64, float32:
- entID = fmt.Sprintf("%.f", event.Entity.ID)
+ entID = fmt.Sprintf("%.f", id)
case int:
- entID = strconv.Itoa(event.Entity.ID.(int))
+ entID = strconv.Itoa(id)
default:
- entID = fmt.Sprintf("%v", event.Entity.ID)
+ entID = fmt.Sprintf("%v", id)
}
var findID string
- switch id.(type) {
+ switch id := id.(type) {
case float64, float32:
findID = fmt.Sprintf("%.f", id)
case int:
- findID = strconv.Itoa(id.(int))
+ findID = strconv.Itoa(id)
default:
findID = fmt.Sprintf("%v", id)
}
@@ -219,19 +282,28 @@ func (client Client) WaitForEventFinished(ctx context.Context, id interface{}, e
// Not the event we were looking for
// log.Println(event.Created, "is not >=", minStart)
continue
-
}
- if event.Status == EventFailed {
+ // This is the event we are looking for. Save our place.
+ if lastEventID == 0 {
+ lastEventID = event.ID
+ }
+
+ switch event.Status {
+ case EventFailed:
return &event, fmt.Errorf("%s %v action %s failed", titledEntityType, id, action)
- } else if event.Status == EventScheduled {
- log.Printf("[INFO] %s %v action %s is scheduled", titledEntityType, id, action)
- } else if event.Status == EventFinished {
+ case EventFinished:
log.Printf("[INFO] %s %v action %s is finished", titledEntityType, id, action)
return &event, nil
}
// TODO(displague) can we bump the ticker to TimeRemaining/2 (>=1) when non-nil?
- log.Printf("[INFO] %s %v action %s is %s", titledEntityType, id, action, event.Status)
+ nextLog = fmt.Sprintf("[INFO] %s %v action %s is %s", titledEntityType, id, action, event.Status)
+ }
+
+ // de-dupe logging statements
+ if nextLog != lastLog {
+ log.Print(nextLog)
+ lastLog = nextLog
}
case <-ctx.Done():
return nil, fmt.Errorf("Error waiting for Event Status '%s' of %s %v action '%s': %s", EventFinished, titledEntityType, id, action, ctx.Err())
diff --git a/vendor/github.com/mitchellh/go-homedir/homedir.go b/vendor/github.com/mitchellh/go-homedir/homedir.go
index 47e1f9ef8..25378537e 100644
--- a/vendor/github.com/mitchellh/go-homedir/homedir.go
+++ b/vendor/github.com/mitchellh/go-homedir/homedir.go
@@ -76,34 +76,62 @@ func Expand(path string) (string, error) {
return filepath.Join(dir, path[1:]), nil
}
+// Reset clears the cache, forcing the next call to Dir to re-detect
+// the home directory. This generally never has to be called, but can be
+// useful in tests if you're modifying the home directory via the HOME
+// env var or something.
+func Reset() {
+ cacheLock.Lock()
+ defer cacheLock.Unlock()
+ homedirCache = ""
+}
+
func dirUnix() (string, error) {
+ homeEnv := "HOME"
+ if runtime.GOOS == "plan9" {
+ // On plan9, env vars are lowercase.
+ homeEnv = "home"
+ }
+
// First prefer the HOME environmental variable
- if home := os.Getenv("HOME"); home != "" {
+ if home := os.Getenv(homeEnv); home != "" {
return home, nil
}
- // If that fails, try getent
var stdout bytes.Buffer
- cmd := exec.Command("getent", "passwd", strconv.Itoa(os.Getuid()))
- cmd.Stdout = &stdout
- if err := cmd.Run(); err != nil {
- // If the error is ErrNotFound, we ignore it. Otherwise, return it.
- if err != exec.ErrNotFound {
- return "", err
+
+ // If that fails, try OS specific commands
+ if runtime.GOOS == "darwin" {
+ cmd := exec.Command("sh", "-c", `dscl -q . -read /Users/"$(whoami)" NFSHomeDirectory | sed 's/^[^ ]*: //'`)
+ cmd.Stdout = &stdout
+ if err := cmd.Run(); err == nil {
+ result := strings.TrimSpace(stdout.String())
+ if result != "" {
+ return result, nil
+ }
}
} else {
- if passwd := strings.TrimSpace(stdout.String()); passwd != "" {
- // username:password:uid:gid:gecos:home:shell
- passwdParts := strings.SplitN(passwd, ":", 7)
- if len(passwdParts) > 5 {
- return passwdParts[5], nil
+ cmd := exec.Command("getent", "passwd", strconv.Itoa(os.Getuid()))
+ cmd.Stdout = &stdout
+ if err := cmd.Run(); err != nil {
+ // If the error is ErrNotFound, we ignore it. Otherwise, return it.
+ if err != exec.ErrNotFound {
+ return "", err
+ }
+ } else {
+ if passwd := strings.TrimSpace(stdout.String()); passwd != "" {
+ // username:password:uid:gid:gecos:home:shell
+ passwdParts := strings.SplitN(passwd, ":", 7)
+ if len(passwdParts) > 5 {
+ return passwdParts[5], nil
+ }
}
}
}
// If all else fails, try the shell
stdout.Reset()
- cmd = exec.Command("sh", "-c", "cd && pwd")
+ cmd := exec.Command("sh", "-c", "cd && pwd")
cmd.Stdout = &stdout
if err := cmd.Run(); err != nil {
return "", err
@@ -123,14 +151,16 @@ func dirWindows() (string, error) {
return home, nil
}
+ // Prefer standard environment variable USERPROFILE
+ if home := os.Getenv("USERPROFILE"); home != "" {
+ return home, nil
+ }
+
drive := os.Getenv("HOMEDRIVE")
path := os.Getenv("HOMEPATH")
home := drive + path
if drive == "" || path == "" {
- home = os.Getenv("USERPROFILE")
- }
- if home == "" {
- return "", errors.New("HOMEDRIVE, HOMEPATH, and USERPROFILE are blank")
+ return "", errors.New("HOMEDRIVE, HOMEPATH, or USERPROFILE are blank")
}
return home, nil
diff --git a/vendor/github.com/modern-go/concurrent/LICENSE b/vendor/github.com/modern-go/concurrent/LICENSE
new file mode 100644
index 000000000..261eeb9e9
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/LICENSE
@@ -0,0 +1,201 @@
+ 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/github.com/modern-go/concurrent/executor.go b/vendor/github.com/modern-go/concurrent/executor.go
new file mode 100644
index 000000000..623dba1ac
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/executor.go
@@ -0,0 +1,14 @@
+package concurrent
+
+import "context"
+
+// Executor replace go keyword to start a new goroutine
+// the goroutine should cancel itself if the context passed in has been cancelled
+// the goroutine started by the executor, is owned by the executor
+// we can cancel all executors owned by the executor just by stop the executor itself
+// however Executor interface does not Stop method, the one starting and owning executor
+// should use the concrete type of executor, instead of this interface.
+type Executor interface {
+ // Go starts a new goroutine controlled by the context
+ Go(handler func(ctx context.Context))
+}
diff --git a/vendor/github.com/modern-go/concurrent/go_above_19.go b/vendor/github.com/modern-go/concurrent/go_above_19.go
new file mode 100644
index 000000000..aeabf8c4f
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/go_above_19.go
@@ -0,0 +1,15 @@
+//+build go1.9
+
+package concurrent
+
+import "sync"
+
+// Map is a wrapper for sync.Map introduced in go1.9
+type Map struct {
+ sync.Map
+}
+
+// NewMap creates a thread safe Map
+func NewMap() *Map {
+ return &Map{}
+}
diff --git a/vendor/github.com/modern-go/concurrent/go_below_19.go b/vendor/github.com/modern-go/concurrent/go_below_19.go
new file mode 100644
index 000000000..b9c8df7f4
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/go_below_19.go
@@ -0,0 +1,33 @@
+//+build !go1.9
+
+package concurrent
+
+import "sync"
+
+// Map implements a thread safe map for go version below 1.9 using mutex
+type Map struct {
+ lock sync.RWMutex
+ data map[interface{}]interface{}
+}
+
+// NewMap creates a thread safe map
+func NewMap() *Map {
+ return &Map{
+ data: make(map[interface{}]interface{}, 32),
+ }
+}
+
+// Load is same as sync.Map Load
+func (m *Map) Load(key interface{}) (elem interface{}, found bool) {
+ m.lock.RLock()
+ elem, found = m.data[key]
+ m.lock.RUnlock()
+ return
+}
+
+// Load is same as sync.Map Store
+func (m *Map) Store(key interface{}, elem interface{}) {
+ m.lock.Lock()
+ m.data[key] = elem
+ m.lock.Unlock()
+}
diff --git a/vendor/github.com/modern-go/concurrent/log.go b/vendor/github.com/modern-go/concurrent/log.go
new file mode 100644
index 000000000..9756fcc75
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/log.go
@@ -0,0 +1,13 @@
+package concurrent
+
+import (
+ "os"
+ "log"
+ "io/ioutil"
+)
+
+// ErrorLogger is used to print out error, can be set to writer other than stderr
+var ErrorLogger = log.New(os.Stderr, "", 0)
+
+// InfoLogger is used to print informational message, default to off
+var InfoLogger = log.New(ioutil.Discard, "", 0)
\ No newline at end of file
diff --git a/vendor/github.com/modern-go/concurrent/unbounded_executor.go b/vendor/github.com/modern-go/concurrent/unbounded_executor.go
new file mode 100644
index 000000000..05a77dceb
--- /dev/null
+++ b/vendor/github.com/modern-go/concurrent/unbounded_executor.go
@@ -0,0 +1,119 @@
+package concurrent
+
+import (
+ "context"
+ "fmt"
+ "runtime"
+ "runtime/debug"
+ "sync"
+ "time"
+ "reflect"
+)
+
+// HandlePanic logs goroutine panic by default
+var HandlePanic = func(recovered interface{}, funcName string) {
+ ErrorLogger.Println(fmt.Sprintf("%s panic: %v", funcName, recovered))
+ ErrorLogger.Println(string(debug.Stack()))
+}
+
+// UnboundedExecutor is a executor without limits on counts of alive goroutines
+// it tracks the goroutine started by it, and can cancel them when shutdown
+type UnboundedExecutor struct {
+ ctx context.Context
+ cancel context.CancelFunc
+ activeGoroutinesMutex *sync.Mutex
+ activeGoroutines map[string]int
+ HandlePanic func(recovered interface{}, funcName string)
+}
+
+// GlobalUnboundedExecutor has the life cycle of the program itself
+// any goroutine want to be shutdown before main exit can be started from this executor
+// GlobalUnboundedExecutor expects the main function to call stop
+// it does not magically knows the main function exits
+var GlobalUnboundedExecutor = NewUnboundedExecutor()
+
+// NewUnboundedExecutor creates a new UnboundedExecutor,
+// UnboundedExecutor can not be created by &UnboundedExecutor{}
+// HandlePanic can be set with a callback to override global HandlePanic
+func NewUnboundedExecutor() *UnboundedExecutor {
+ ctx, cancel := context.WithCancel(context.TODO())
+ return &UnboundedExecutor{
+ ctx: ctx,
+ cancel: cancel,
+ activeGoroutinesMutex: &sync.Mutex{},
+ activeGoroutines: map[string]int{},
+ }
+}
+
+// Go starts a new goroutine and tracks its lifecycle.
+// Panic will be recovered and logged automatically, except for StopSignal
+func (executor *UnboundedExecutor) Go(handler func(ctx context.Context)) {
+ pc := reflect.ValueOf(handler).Pointer()
+ f := runtime.FuncForPC(pc)
+ funcName := f.Name()
+ file, line := f.FileLine(pc)
+ executor.activeGoroutinesMutex.Lock()
+ defer executor.activeGoroutinesMutex.Unlock()
+ startFrom := fmt.Sprintf("%s:%d", file, line)
+ executor.activeGoroutines[startFrom] += 1
+ go func() {
+ defer func() {
+ recovered := recover()
+ // if you want to quit a goroutine without trigger HandlePanic
+ // use runtime.Goexit() to quit
+ if recovered != nil {
+ if executor.HandlePanic == nil {
+ HandlePanic(recovered, funcName)
+ } else {
+ executor.HandlePanic(recovered, funcName)
+ }
+ }
+ executor.activeGoroutinesMutex.Lock()
+ executor.activeGoroutines[startFrom] -= 1
+ executor.activeGoroutinesMutex.Unlock()
+ }()
+ handler(executor.ctx)
+ }()
+}
+
+// Stop cancel all goroutines started by this executor without wait
+func (executor *UnboundedExecutor) Stop() {
+ executor.cancel()
+}
+
+// StopAndWaitForever cancel all goroutines started by this executor and
+// wait until all goroutines exited
+func (executor *UnboundedExecutor) StopAndWaitForever() {
+ executor.StopAndWait(context.Background())
+}
+
+// StopAndWait cancel all goroutines started by this executor and wait.
+// Wait can be cancelled by the context passed in.
+func (executor *UnboundedExecutor) StopAndWait(ctx context.Context) {
+ executor.cancel()
+ for {
+ oneHundredMilliseconds := time.NewTimer(time.Millisecond * 100)
+ select {
+ case <-oneHundredMilliseconds.C:
+ if executor.checkNoActiveGoroutines() {
+ return
+ }
+ case <-ctx.Done():
+ return
+ }
+ }
+}
+
+func (executor *UnboundedExecutor) checkNoActiveGoroutines() bool {
+ executor.activeGoroutinesMutex.Lock()
+ defer executor.activeGoroutinesMutex.Unlock()
+ for startFrom, count := range executor.activeGoroutines {
+ if count > 0 {
+ InfoLogger.Println("UnboundedExecutor is still waiting goroutines to quit",
+ "startFrom", startFrom,
+ "count", count)
+ return false
+ }
+ }
+ return true
+}
diff --git a/vendor/github.com/modern-go/reflect2/LICENSE b/vendor/github.com/modern-go/reflect2/LICENSE
new file mode 100644
index 000000000..261eeb9e9
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/LICENSE
@@ -0,0 +1,201 @@
+ 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/github.com/modern-go/reflect2/go_above_17.go b/vendor/github.com/modern-go/reflect2/go_above_17.go
new file mode 100644
index 000000000..5c1cea868
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_above_17.go
@@ -0,0 +1,8 @@
+//+build go1.7
+
+package reflect2
+
+import "unsafe"
+
+//go:linkname resolveTypeOff reflect.resolveTypeOff
+func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer
diff --git a/vendor/github.com/modern-go/reflect2/go_above_19.go b/vendor/github.com/modern-go/reflect2/go_above_19.go
new file mode 100644
index 000000000..c7e3b7801
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_above_19.go
@@ -0,0 +1,14 @@
+//+build go1.9
+
+package reflect2
+
+import (
+ "unsafe"
+)
+
+//go:linkname makemap reflect.makemap
+func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer)
+
+func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
+ return makemap(rtype, cap)
+}
diff --git a/vendor/github.com/modern-go/reflect2/go_below_17.go b/vendor/github.com/modern-go/reflect2/go_below_17.go
new file mode 100644
index 000000000..65a93c889
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_below_17.go
@@ -0,0 +1,9 @@
+//+build !go1.7
+
+package reflect2
+
+import "unsafe"
+
+func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer {
+ return nil
+}
diff --git a/vendor/github.com/modern-go/reflect2/go_below_19.go b/vendor/github.com/modern-go/reflect2/go_below_19.go
new file mode 100644
index 000000000..b050ef70c
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/go_below_19.go
@@ -0,0 +1,14 @@
+//+build !go1.9
+
+package reflect2
+
+import (
+ "unsafe"
+)
+
+//go:linkname makemap reflect.makemap
+func makemap(rtype unsafe.Pointer) (m unsafe.Pointer)
+
+func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer {
+ return makemap(rtype)
+}
diff --git a/vendor/github.com/modern-go/reflect2/reflect2.go b/vendor/github.com/modern-go/reflect2/reflect2.go
new file mode 100644
index 000000000..63b49c799
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/reflect2.go
@@ -0,0 +1,298 @@
+package reflect2
+
+import (
+ "github.com/modern-go/concurrent"
+ "reflect"
+ "unsafe"
+)
+
+type Type interface {
+ Kind() reflect.Kind
+ // New return pointer to data of this type
+ New() interface{}
+ // UnsafeNew return the allocated space pointed by unsafe.Pointer
+ UnsafeNew() unsafe.Pointer
+ // PackEFace cast a unsafe pointer to object represented pointer
+ PackEFace(ptr unsafe.Pointer) interface{}
+ // Indirect dereference object represented pointer to this type
+ Indirect(obj interface{}) interface{}
+ // UnsafeIndirect dereference pointer to this type
+ UnsafeIndirect(ptr unsafe.Pointer) interface{}
+ // Type1 returns reflect.Type
+ Type1() reflect.Type
+ Implements(thatType Type) bool
+ String() string
+ RType() uintptr
+ // interface{} of this type has pointer like behavior
+ LikePtr() bool
+ IsNullable() bool
+ IsNil(obj interface{}) bool
+ UnsafeIsNil(ptr unsafe.Pointer) bool
+ Set(obj interface{}, val interface{})
+ UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
+ AssignableTo(anotherType Type) bool
+}
+
+type ListType interface {
+ Type
+ Elem() Type
+ SetIndex(obj interface{}, index int, elem interface{})
+ UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer)
+ GetIndex(obj interface{}, index int) interface{}
+ UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer
+}
+
+type ArrayType interface {
+ ListType
+ Len() int
+}
+
+type SliceType interface {
+ ListType
+ MakeSlice(length int, cap int) interface{}
+ UnsafeMakeSlice(length int, cap int) unsafe.Pointer
+ Grow(obj interface{}, newLength int)
+ UnsafeGrow(ptr unsafe.Pointer, newLength int)
+ Append(obj interface{}, elem interface{})
+ UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer)
+ LengthOf(obj interface{}) int
+ UnsafeLengthOf(ptr unsafe.Pointer) int
+ SetNil(obj interface{})
+ UnsafeSetNil(ptr unsafe.Pointer)
+ Cap(obj interface{}) int
+ UnsafeCap(ptr unsafe.Pointer) int
+}
+
+type StructType interface {
+ Type
+ NumField() int
+ Field(i int) StructField
+ FieldByName(name string) StructField
+ FieldByIndex(index []int) StructField
+ FieldByNameFunc(match func(string) bool) StructField
+}
+
+type StructField interface {
+ Offset() uintptr
+ Name() string
+ PkgPath() string
+ Type() Type
+ Tag() reflect.StructTag
+ Index() []int
+ Anonymous() bool
+ Set(obj interface{}, value interface{})
+ UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer)
+ Get(obj interface{}) interface{}
+ UnsafeGet(obj unsafe.Pointer) unsafe.Pointer
+}
+
+type MapType interface {
+ Type
+ Key() Type
+ Elem() Type
+ MakeMap(cap int) interface{}
+ UnsafeMakeMap(cap int) unsafe.Pointer
+ SetIndex(obj interface{}, key interface{}, elem interface{})
+ UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer)
+ TryGetIndex(obj interface{}, key interface{}) (interface{}, bool)
+ GetIndex(obj interface{}, key interface{}) interface{}
+ UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer
+ Iterate(obj interface{}) MapIterator
+ UnsafeIterate(obj unsafe.Pointer) MapIterator
+}
+
+type MapIterator interface {
+ HasNext() bool
+ Next() (key interface{}, elem interface{})
+ UnsafeNext() (key unsafe.Pointer, elem unsafe.Pointer)
+}
+
+type PtrType interface {
+ Type
+ Elem() Type
+}
+
+type InterfaceType interface {
+ NumMethod() int
+}
+
+type Config struct {
+ UseSafeImplementation bool
+}
+
+type API interface {
+ TypeOf(obj interface{}) Type
+ Type2(type1 reflect.Type) Type
+}
+
+var ConfigUnsafe = Config{UseSafeImplementation: false}.Froze()
+var ConfigSafe = Config{UseSafeImplementation: true}.Froze()
+
+type frozenConfig struct {
+ useSafeImplementation bool
+ cache *concurrent.Map
+}
+
+func (cfg Config) Froze() *frozenConfig {
+ return &frozenConfig{
+ useSafeImplementation: cfg.UseSafeImplementation,
+ cache: concurrent.NewMap(),
+ }
+}
+
+func (cfg *frozenConfig) TypeOf(obj interface{}) Type {
+ cacheKey := uintptr(unpackEFace(obj).rtype)
+ typeObj, found := cfg.cache.Load(cacheKey)
+ if found {
+ return typeObj.(Type)
+ }
+ return cfg.Type2(reflect.TypeOf(obj))
+}
+
+func (cfg *frozenConfig) Type2(type1 reflect.Type) Type {
+ if type1 == nil {
+ return nil
+ }
+ cacheKey := uintptr(unpackEFace(type1).data)
+ typeObj, found := cfg.cache.Load(cacheKey)
+ if found {
+ return typeObj.(Type)
+ }
+ type2 := cfg.wrapType(type1)
+ cfg.cache.Store(cacheKey, type2)
+ return type2
+}
+
+func (cfg *frozenConfig) wrapType(type1 reflect.Type) Type {
+ safeType := safeType{Type: type1, cfg: cfg}
+ switch type1.Kind() {
+ case reflect.Struct:
+ if cfg.useSafeImplementation {
+ return &safeStructType{safeType}
+ }
+ return newUnsafeStructType(cfg, type1)
+ case reflect.Array:
+ if cfg.useSafeImplementation {
+ return &safeSliceType{safeType}
+ }
+ return newUnsafeArrayType(cfg, type1)
+ case reflect.Slice:
+ if cfg.useSafeImplementation {
+ return &safeSliceType{safeType}
+ }
+ return newUnsafeSliceType(cfg, type1)
+ case reflect.Map:
+ if cfg.useSafeImplementation {
+ return &safeMapType{safeType}
+ }
+ return newUnsafeMapType(cfg, type1)
+ case reflect.Ptr, reflect.Chan, reflect.Func:
+ if cfg.useSafeImplementation {
+ return &safeMapType{safeType}
+ }
+ return newUnsafePtrType(cfg, type1)
+ case reflect.Interface:
+ if cfg.useSafeImplementation {
+ return &safeMapType{safeType}
+ }
+ if type1.NumMethod() == 0 {
+ return newUnsafeEFaceType(cfg, type1)
+ }
+ return newUnsafeIFaceType(cfg, type1)
+ default:
+ if cfg.useSafeImplementation {
+ return &safeType
+ }
+ return newUnsafeType(cfg, type1)
+ }
+}
+
+func TypeOf(obj interface{}) Type {
+ return ConfigUnsafe.TypeOf(obj)
+}
+
+func TypeOfPtr(obj interface{}) PtrType {
+ return TypeOf(obj).(PtrType)
+}
+
+func Type2(type1 reflect.Type) Type {
+ if type1 == nil {
+ return nil
+ }
+ return ConfigUnsafe.Type2(type1)
+}
+
+func PtrTo(typ Type) Type {
+ return Type2(reflect.PtrTo(typ.Type1()))
+}
+
+func PtrOf(obj interface{}) unsafe.Pointer {
+ return unpackEFace(obj).data
+}
+
+func RTypeOf(obj interface{}) uintptr {
+ return uintptr(unpackEFace(obj).rtype)
+}
+
+func IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ return unpackEFace(obj).data == nil
+}
+
+func IsNullable(kind reflect.Kind) bool {
+ switch kind {
+ case reflect.Ptr, reflect.Map, reflect.Chan, reflect.Func, reflect.Slice, reflect.Interface:
+ return true
+ }
+ return false
+}
+
+func likePtrKind(kind reflect.Kind) bool {
+ switch kind {
+ case reflect.Ptr, reflect.Map, reflect.Chan, reflect.Func:
+ return true
+ }
+ return false
+}
+
+func likePtrType(typ reflect.Type) bool {
+ if likePtrKind(typ.Kind()) {
+ return true
+ }
+ if typ.Kind() == reflect.Struct {
+ if typ.NumField() != 1 {
+ return false
+ }
+ return likePtrType(typ.Field(0).Type)
+ }
+ if typ.Kind() == reflect.Array {
+ if typ.Len() != 1 {
+ return false
+ }
+ return likePtrType(typ.Elem())
+ }
+ return false
+}
+
+// NoEscape hides a pointer from escape analysis. noescape is
+// the identity function but escape analysis doesn't think the
+// output depends on the input. noescape is inlined and currently
+// compiles down to zero instructions.
+// USE CAREFULLY!
+//go:nosplit
+func NoEscape(p unsafe.Pointer) unsafe.Pointer {
+ x := uintptr(p)
+ return unsafe.Pointer(x ^ 0)
+}
+
+func UnsafeCastString(str string) []byte {
+ stringHeader := (*reflect.StringHeader)(unsafe.Pointer(&str))
+ sliceHeader := &reflect.SliceHeader{
+ Data: stringHeader.Data,
+ Cap: stringHeader.Len,
+ Len: stringHeader.Len,
+ }
+ return *(*[]byte)(unsafe.Pointer(sliceHeader))
+}
diff --git a/vendor/github.com/modern-go/reflect2/reflect2_amd64.s b/vendor/github.com/modern-go/reflect2/reflect2_amd64.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/reflect2_kind.go b/vendor/github.com/modern-go/reflect2/reflect2_kind.go
new file mode 100644
index 000000000..62f299e40
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/reflect2_kind.go
@@ -0,0 +1,30 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+// DefaultTypeOfKind return the non aliased default type for the kind
+func DefaultTypeOfKind(kind reflect.Kind) Type {
+ return kindTypes[kind]
+}
+
+var kindTypes = map[reflect.Kind]Type{
+ reflect.Bool: TypeOf(true),
+ reflect.Uint8: TypeOf(uint8(0)),
+ reflect.Int8: TypeOf(int8(0)),
+ reflect.Uint16: TypeOf(uint16(0)),
+ reflect.Int16: TypeOf(int16(0)),
+ reflect.Uint32: TypeOf(uint32(0)),
+ reflect.Int32: TypeOf(int32(0)),
+ reflect.Uint64: TypeOf(uint64(0)),
+ reflect.Int64: TypeOf(int64(0)),
+ reflect.Uint: TypeOf(uint(0)),
+ reflect.Int: TypeOf(int(0)),
+ reflect.Float32: TypeOf(float32(0)),
+ reflect.Float64: TypeOf(float64(0)),
+ reflect.Uintptr: TypeOf(uintptr(0)),
+ reflect.String: TypeOf(""),
+ reflect.UnsafePointer: TypeOf(unsafe.Pointer(nil)),
+}
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_386.s b/vendor/github.com/modern-go/reflect2/relfect2_386.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s b/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_arm.s b/vendor/github.com/modern-go/reflect2/relfect2_arm.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_arm64.s b/vendor/github.com/modern-go/reflect2/relfect2_arm64.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s b/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s b/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s b/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/relfect2_s390x.s b/vendor/github.com/modern-go/reflect2/relfect2_s390x.s
new file mode 100644
index 000000000..e69de29bb
diff --git a/vendor/github.com/modern-go/reflect2/safe_field.go b/vendor/github.com/modern-go/reflect2/safe_field.go
new file mode 100644
index 000000000..d4ba1f4f8
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/safe_field.go
@@ -0,0 +1,58 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type safeField struct {
+ reflect.StructField
+}
+
+func (field *safeField) Offset() uintptr {
+ return field.StructField.Offset
+}
+
+func (field *safeField) Name() string {
+ return field.StructField.Name
+}
+
+func (field *safeField) PkgPath() string {
+ return field.StructField.PkgPath
+}
+
+func (field *safeField) Type() Type {
+ panic("not implemented")
+}
+
+func (field *safeField) Tag() reflect.StructTag {
+ return field.StructField.Tag
+}
+
+func (field *safeField) Index() []int {
+ return field.StructField.Index
+}
+
+func (field *safeField) Anonymous() bool {
+ return field.StructField.Anonymous
+}
+
+func (field *safeField) Set(obj interface{}, value interface{}) {
+ val := reflect.ValueOf(obj).Elem()
+ val.FieldByIndex(field.Index()).Set(reflect.ValueOf(value).Elem())
+}
+
+func (field *safeField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) {
+ panic("unsafe operation is not supported")
+}
+
+func (field *safeField) Get(obj interface{}) interface{} {
+ val := reflect.ValueOf(obj).Elem().FieldByIndex(field.Index())
+ ptr := reflect.New(val.Type())
+ ptr.Elem().Set(val)
+ return ptr.Interface()
+}
+
+func (field *safeField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
diff --git a/vendor/github.com/modern-go/reflect2/safe_map.go b/vendor/github.com/modern-go/reflect2/safe_map.go
new file mode 100644
index 000000000..88362205a
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/safe_map.go
@@ -0,0 +1,101 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type safeMapType struct {
+ safeType
+}
+
+func (type2 *safeMapType) Key() Type {
+ return type2.safeType.cfg.Type2(type2.Type.Key())
+}
+
+func (type2 *safeMapType) MakeMap(cap int) interface{} {
+ ptr := reflect.New(type2.Type)
+ ptr.Elem().Set(reflect.MakeMap(type2.Type))
+ return ptr.Interface()
+}
+
+func (type2 *safeMapType) UnsafeMakeMap(cap int) unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeMapType) SetIndex(obj interface{}, key interface{}, elem interface{}) {
+ keyVal := reflect.ValueOf(key)
+ elemVal := reflect.ValueOf(elem)
+ val := reflect.ValueOf(obj)
+ val.Elem().SetMapIndex(keyVal.Elem(), elemVal.Elem())
+}
+
+func (type2 *safeMapType) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeMapType) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) {
+ keyVal := reflect.ValueOf(key)
+ if key == nil {
+ keyVal = reflect.New(type2.Type.Key()).Elem()
+ }
+ val := reflect.ValueOf(obj).MapIndex(keyVal)
+ if !val.IsValid() {
+ return nil, false
+ }
+ return val.Interface(), true
+}
+
+func (type2 *safeMapType) GetIndex(obj interface{}, key interface{}) interface{} {
+ val := reflect.ValueOf(obj).Elem()
+ keyVal := reflect.ValueOf(key).Elem()
+ elemVal := val.MapIndex(keyVal)
+ if !elemVal.IsValid() {
+ ptr := reflect.New(reflect.PtrTo(val.Type().Elem()))
+ return ptr.Elem().Interface()
+ }
+ ptr := reflect.New(elemVal.Type())
+ ptr.Elem().Set(elemVal)
+ return ptr.Interface()
+}
+
+func (type2 *safeMapType) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeMapType) Iterate(obj interface{}) MapIterator {
+ m := reflect.ValueOf(obj).Elem()
+ return &safeMapIterator{
+ m: m,
+ keys: m.MapKeys(),
+ }
+}
+
+func (type2 *safeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
+ panic("does not support unsafe operation")
+}
+
+type safeMapIterator struct {
+ i int
+ m reflect.Value
+ keys []reflect.Value
+}
+
+func (iter *safeMapIterator) HasNext() bool {
+ return iter.i != len(iter.keys)
+}
+
+func (iter *safeMapIterator) Next() (interface{}, interface{}) {
+ key := iter.keys[iter.i]
+ elem := iter.m.MapIndex(key)
+ iter.i += 1
+ keyPtr := reflect.New(key.Type())
+ keyPtr.Elem().Set(key)
+ elemPtr := reflect.New(elem.Type())
+ elemPtr.Elem().Set(elem)
+ return keyPtr.Interface(), elemPtr.Interface()
+}
+
+func (iter *safeMapIterator) UnsafeNext() (unsafe.Pointer, unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
diff --git a/vendor/github.com/modern-go/reflect2/safe_slice.go b/vendor/github.com/modern-go/reflect2/safe_slice.go
new file mode 100644
index 000000000..bcce6fd20
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/safe_slice.go
@@ -0,0 +1,92 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type safeSliceType struct {
+ safeType
+}
+
+func (type2 *safeSliceType) SetIndex(obj interface{}, index int, value interface{}) {
+ val := reflect.ValueOf(obj).Elem()
+ elem := reflect.ValueOf(value).Elem()
+ val.Index(index).Set(elem)
+}
+
+func (type2 *safeSliceType) UnsafeSetIndex(obj unsafe.Pointer, index int, value unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) GetIndex(obj interface{}, index int) interface{} {
+ val := reflect.ValueOf(obj).Elem()
+ elem := val.Index(index)
+ ptr := reflect.New(elem.Type())
+ ptr.Elem().Set(elem)
+ return ptr.Interface()
+}
+
+func (type2 *safeSliceType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) MakeSlice(length int, cap int) interface{} {
+ val := reflect.MakeSlice(type2.Type, length, cap)
+ ptr := reflect.New(val.Type())
+ ptr.Elem().Set(val)
+ return ptr.Interface()
+}
+
+func (type2 *safeSliceType) UnsafeMakeSlice(length int, cap int) unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) Grow(obj interface{}, newLength int) {
+ oldCap := type2.Cap(obj)
+ oldSlice := reflect.ValueOf(obj).Elem()
+ delta := newLength - oldCap
+ deltaVals := make([]reflect.Value, delta)
+ newSlice := reflect.Append(oldSlice, deltaVals...)
+ oldSlice.Set(newSlice)
+}
+
+func (type2 *safeSliceType) UnsafeGrow(ptr unsafe.Pointer, newLength int) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) Append(obj interface{}, elem interface{}) {
+ val := reflect.ValueOf(obj).Elem()
+ elemVal := reflect.ValueOf(elem).Elem()
+ newVal := reflect.Append(val, elemVal)
+ val.Set(newVal)
+}
+
+func (type2 *safeSliceType) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) SetNil(obj interface{}) {
+ val := reflect.ValueOf(obj).Elem()
+ val.Set(reflect.Zero(val.Type()))
+}
+
+func (type2 *safeSliceType) UnsafeSetNil(ptr unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) LengthOf(obj interface{}) int {
+ return reflect.ValueOf(obj).Elem().Len()
+}
+
+func (type2 *safeSliceType) UnsafeLengthOf(ptr unsafe.Pointer) int {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeSliceType) Cap(obj interface{}) int {
+ return reflect.ValueOf(obj).Elem().Cap()
+}
+
+func (type2 *safeSliceType) UnsafeCap(ptr unsafe.Pointer) int {
+ panic("does not support unsafe operation")
+}
diff --git a/vendor/github.com/modern-go/reflect2/safe_struct.go b/vendor/github.com/modern-go/reflect2/safe_struct.go
new file mode 100644
index 000000000..e5fb9b313
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/safe_struct.go
@@ -0,0 +1,29 @@
+package reflect2
+
+type safeStructType struct {
+ safeType
+}
+
+func (type2 *safeStructType) FieldByName(name string) StructField {
+ field, found := type2.Type.FieldByName(name)
+ if !found {
+ panic("field " + name + " not found")
+ }
+ return &safeField{StructField: field}
+}
+
+func (type2 *safeStructType) Field(i int) StructField {
+ return &safeField{StructField: type2.Type.Field(i)}
+}
+
+func (type2 *safeStructType) FieldByIndex(index []int) StructField {
+ return &safeField{StructField: type2.Type.FieldByIndex(index)}
+}
+
+func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField {
+ field, found := type2.Type.FieldByNameFunc(match)
+ if !found {
+ panic("field match condition not found in " + type2.Type.String())
+ }
+ return &safeField{StructField: field}
+}
diff --git a/vendor/github.com/modern-go/reflect2/safe_type.go b/vendor/github.com/modern-go/reflect2/safe_type.go
new file mode 100644
index 000000000..ee4e7bb6e
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/safe_type.go
@@ -0,0 +1,78 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type safeType struct {
+ reflect.Type
+ cfg *frozenConfig
+}
+
+func (type2 *safeType) New() interface{} {
+ return reflect.New(type2.Type).Interface()
+}
+
+func (type2 *safeType) UnsafeNew() unsafe.Pointer {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) Elem() Type {
+ return type2.cfg.Type2(type2.Type.Elem())
+}
+
+func (type2 *safeType) Type1() reflect.Type {
+ return type2.Type
+}
+
+func (type2 *safeType) PackEFace(ptr unsafe.Pointer) interface{} {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) Implements(thatType Type) bool {
+ return type2.Type.Implements(thatType.Type1())
+}
+
+func (type2 *safeType) RType() uintptr {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) Indirect(obj interface{}) interface{} {
+ return reflect.Indirect(reflect.ValueOf(obj)).Interface()
+}
+
+func (type2 *safeType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) LikePtr() bool {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) IsNullable() bool {
+ return IsNullable(type2.Kind())
+}
+
+func (type2 *safeType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ return reflect.ValueOf(obj).Elem().IsNil()
+}
+
+func (type2 *safeType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) Set(obj interface{}, val interface{}) {
+ reflect.ValueOf(obj).Elem().Set(reflect.ValueOf(val).Elem())
+}
+
+func (type2 *safeType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) {
+ panic("does not support unsafe operation")
+}
+
+func (type2 *safeType) AssignableTo(anotherType Type) bool {
+ return type2.Type1().AssignableTo(anotherType.Type1())
+}
diff --git a/vendor/github.com/modern-go/reflect2/type_map.go b/vendor/github.com/modern-go/reflect2/type_map.go
new file mode 100644
index 000000000..6d489112f
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/type_map.go
@@ -0,0 +1,103 @@
+package reflect2
+
+import (
+ "reflect"
+ "runtime"
+ "strings"
+ "unsafe"
+)
+
+// typelinks1 for 1.5 ~ 1.6
+//go:linkname typelinks1 reflect.typelinks
+func typelinks1() [][]unsafe.Pointer
+
+// typelinks2 for 1.7 ~
+//go:linkname typelinks2 reflect.typelinks
+func typelinks2() (sections []unsafe.Pointer, offset [][]int32)
+
+var types = map[string]reflect.Type{}
+var packages = map[string]map[string]reflect.Type{}
+
+func init() {
+ ver := runtime.Version()
+ if ver == "go1.5" || strings.HasPrefix(ver, "go1.5.") {
+ loadGo15Types()
+ } else if ver == "go1.6" || strings.HasPrefix(ver, "go1.6.") {
+ loadGo15Types()
+ } else {
+ loadGo17Types()
+ }
+}
+
+func loadGo15Types() {
+ var obj interface{} = reflect.TypeOf(0)
+ typePtrss := typelinks1()
+ for _, typePtrs := range typePtrss {
+ for _, typePtr := range typePtrs {
+ (*emptyInterface)(unsafe.Pointer(&obj)).word = typePtr
+ typ := obj.(reflect.Type)
+ if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct {
+ loadedType := typ.Elem()
+ pkgTypes := packages[loadedType.PkgPath()]
+ if pkgTypes == nil {
+ pkgTypes = map[string]reflect.Type{}
+ packages[loadedType.PkgPath()] = pkgTypes
+ }
+ types[loadedType.String()] = loadedType
+ pkgTypes[loadedType.Name()] = loadedType
+ }
+ if typ.Kind() == reflect.Slice && typ.Elem().Kind() == reflect.Ptr &&
+ typ.Elem().Elem().Kind() == reflect.Struct {
+ loadedType := typ.Elem().Elem()
+ pkgTypes := packages[loadedType.PkgPath()]
+ if pkgTypes == nil {
+ pkgTypes = map[string]reflect.Type{}
+ packages[loadedType.PkgPath()] = pkgTypes
+ }
+ types[loadedType.String()] = loadedType
+ pkgTypes[loadedType.Name()] = loadedType
+ }
+ }
+ }
+}
+
+func loadGo17Types() {
+ var obj interface{} = reflect.TypeOf(0)
+ sections, offset := typelinks2()
+ for i, offs := range offset {
+ rodata := sections[i]
+ for _, off := range offs {
+ (*emptyInterface)(unsafe.Pointer(&obj)).word = resolveTypeOff(unsafe.Pointer(rodata), off)
+ typ := obj.(reflect.Type)
+ if typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct {
+ loadedType := typ.Elem()
+ pkgTypes := packages[loadedType.PkgPath()]
+ if pkgTypes == nil {
+ pkgTypes = map[string]reflect.Type{}
+ packages[loadedType.PkgPath()] = pkgTypes
+ }
+ types[loadedType.String()] = loadedType
+ pkgTypes[loadedType.Name()] = loadedType
+ }
+ }
+ }
+}
+
+type emptyInterface struct {
+ typ unsafe.Pointer
+ word unsafe.Pointer
+}
+
+// TypeByName return the type by its name, just like Class.forName in java
+func TypeByName(typeName string) Type {
+ return Type2(types[typeName])
+}
+
+// TypeByPackageName return the type by its package and name
+func TypeByPackageName(pkgPath string, name string) Type {
+ pkgTypes := packages[pkgPath]
+ if pkgTypes == nil {
+ return nil
+ }
+ return Type2(pkgTypes[name])
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_array.go b/vendor/github.com/modern-go/reflect2/unsafe_array.go
new file mode 100644
index 000000000..76cbdba6e
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_array.go
@@ -0,0 +1,65 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type UnsafeArrayType struct {
+ unsafeType
+ elemRType unsafe.Pointer
+ pElemRType unsafe.Pointer
+ elemSize uintptr
+ likePtr bool
+}
+
+func newUnsafeArrayType(cfg *frozenConfig, type1 reflect.Type) *UnsafeArrayType {
+ return &UnsafeArrayType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ elemRType: unpackEFace(type1.Elem()).data,
+ pElemRType: unpackEFace(reflect.PtrTo(type1.Elem())).data,
+ elemSize: type1.Elem().Size(),
+ likePtr: likePtrType(type1),
+ }
+}
+
+func (type2 *UnsafeArrayType) LikePtr() bool {
+ return type2.likePtr
+}
+
+func (type2 *UnsafeArrayType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafeArrayType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ if type2.likePtr {
+ return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
+ }
+ return packEFace(type2.rtype, ptr)
+}
+
+func (type2 *UnsafeArrayType) SetIndex(obj interface{}, index int, elem interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("ArrayType.SetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ elemEFace := unpackEFace(elem)
+ assertType("ArrayType.SetIndex argument 3", type2.pElemRType, elemEFace.rtype)
+ type2.UnsafeSetIndex(objEFace.data, index, elemEFace.data)
+}
+
+func (type2 *UnsafeArrayType) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) {
+ elemPtr := arrayAt(obj, index, type2.elemSize, "i < s.Len")
+ typedmemmove(type2.elemRType, elemPtr, elem)
+}
+
+func (type2 *UnsafeArrayType) GetIndex(obj interface{}, index int) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("ArrayType.GetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ elemPtr := type2.UnsafeGetIndex(objEFace.data, index)
+ return packEFace(type2.pElemRType, elemPtr)
+}
+
+func (type2 *UnsafeArrayType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer {
+ return arrayAt(obj, index, type2.elemSize, "i < s.Len")
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_eface.go b/vendor/github.com/modern-go/reflect2/unsafe_eface.go
new file mode 100644
index 000000000..805010f3a
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_eface.go
@@ -0,0 +1,59 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type eface struct {
+ rtype unsafe.Pointer
+ data unsafe.Pointer
+}
+
+func unpackEFace(obj interface{}) *eface {
+ return (*eface)(unsafe.Pointer(&obj))
+}
+
+func packEFace(rtype unsafe.Pointer, data unsafe.Pointer) interface{} {
+ var i interface{}
+ e := (*eface)(unsafe.Pointer(&i))
+ e.rtype = rtype
+ e.data = data
+ return i
+}
+
+type UnsafeEFaceType struct {
+ unsafeType
+}
+
+func newUnsafeEFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeEFaceType {
+ return &UnsafeEFaceType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ }
+}
+
+func (type2 *UnsafeEFaceType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *UnsafeEFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ if ptr == nil {
+ return true
+ }
+ return unpackEFace(*(*interface{})(ptr)).data == nil
+}
+
+func (type2 *UnsafeEFaceType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafeEFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ return *(*interface{})(ptr)
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_field.go b/vendor/github.com/modern-go/reflect2/unsafe_field.go
new file mode 100644
index 000000000..5eb53130a
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_field.go
@@ -0,0 +1,74 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type UnsafeStructField struct {
+ reflect.StructField
+ structType *UnsafeStructType
+ rtype unsafe.Pointer
+ ptrRType unsafe.Pointer
+}
+
+func newUnsafeStructField(structType *UnsafeStructType, structField reflect.StructField) *UnsafeStructField {
+ return &UnsafeStructField{
+ StructField: structField,
+ rtype: unpackEFace(structField.Type).data,
+ ptrRType: unpackEFace(reflect.PtrTo(structField.Type)).data,
+ structType: structType,
+ }
+}
+
+func (field *UnsafeStructField) Offset() uintptr {
+ return field.StructField.Offset
+}
+
+func (field *UnsafeStructField) Name() string {
+ return field.StructField.Name
+}
+
+func (field *UnsafeStructField) PkgPath() string {
+ return field.StructField.PkgPath
+}
+
+func (field *UnsafeStructField) Type() Type {
+ return field.structType.cfg.Type2(field.StructField.Type)
+}
+
+func (field *UnsafeStructField) Tag() reflect.StructTag {
+ return field.StructField.Tag
+}
+
+func (field *UnsafeStructField) Index() []int {
+ return field.StructField.Index
+}
+
+func (field *UnsafeStructField) Anonymous() bool {
+ return field.StructField.Anonymous
+}
+
+func (field *UnsafeStructField) Set(obj interface{}, value interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("StructField.SetIndex argument 1", field.structType.ptrRType, objEFace.rtype)
+ valueEFace := unpackEFace(value)
+ assertType("StructField.SetIndex argument 2", field.ptrRType, valueEFace.rtype)
+ field.UnsafeSet(objEFace.data, valueEFace.data)
+}
+
+func (field *UnsafeStructField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) {
+ fieldPtr := add(obj, field.StructField.Offset, "same as non-reflect &v.field")
+ typedmemmove(field.rtype, fieldPtr, value)
+}
+
+func (field *UnsafeStructField) Get(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("StructField.GetIndex argument 1", field.structType.ptrRType, objEFace.rtype)
+ value := field.UnsafeGet(objEFace.data)
+ return packEFace(field.ptrRType, value)
+}
+
+func (field *UnsafeStructField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer {
+ return add(obj, field.StructField.Offset, "same as non-reflect &v.field")
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_iface.go b/vendor/github.com/modern-go/reflect2/unsafe_iface.go
new file mode 100644
index 000000000..b60195533
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_iface.go
@@ -0,0 +1,64 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type iface struct {
+ itab *itab
+ data unsafe.Pointer
+}
+
+type itab struct {
+ ignore unsafe.Pointer
+ rtype unsafe.Pointer
+}
+
+func IFaceToEFace(ptr unsafe.Pointer) interface{} {
+ iface := (*iface)(ptr)
+ if iface.itab == nil {
+ return nil
+ }
+ return packEFace(iface.itab.rtype, iface.data)
+}
+
+type UnsafeIFaceType struct {
+ unsafeType
+}
+
+func newUnsafeIFaceType(cfg *frozenConfig, type1 reflect.Type) *UnsafeIFaceType {
+ return &UnsafeIFaceType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ }
+}
+
+func (type2 *UnsafeIFaceType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafeIFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ return IFaceToEFace(ptr)
+}
+
+func (type2 *UnsafeIFaceType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *UnsafeIFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ if ptr == nil {
+ return true
+ }
+ iface := (*iface)(ptr)
+ if iface.itab == nil {
+ return true
+ }
+ return false
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_link.go b/vendor/github.com/modern-go/reflect2/unsafe_link.go
new file mode 100644
index 000000000..57229c8db
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_link.go
@@ -0,0 +1,70 @@
+package reflect2
+
+import "unsafe"
+
+//go:linkname unsafe_New reflect.unsafe_New
+func unsafe_New(rtype unsafe.Pointer) unsafe.Pointer
+
+//go:linkname typedmemmove reflect.typedmemmove
+func typedmemmove(rtype unsafe.Pointer, dst, src unsafe.Pointer)
+
+//go:linkname unsafe_NewArray reflect.unsafe_NewArray
+func unsafe_NewArray(rtype unsafe.Pointer, length int) unsafe.Pointer
+
+// typedslicecopy copies a slice of elemType values from src to dst,
+// returning the number of elements copied.
+//go:linkname typedslicecopy reflect.typedslicecopy
+//go:noescape
+func typedslicecopy(elemType unsafe.Pointer, dst, src sliceHeader) int
+
+//go:linkname mapassign reflect.mapassign
+//go:noescape
+func mapassign(rtype unsafe.Pointer, m unsafe.Pointer, key, val unsafe.Pointer)
+
+//go:linkname mapaccess reflect.mapaccess
+//go:noescape
+func mapaccess(rtype unsafe.Pointer, m unsafe.Pointer, key unsafe.Pointer) (val unsafe.Pointer)
+
+// m escapes into the return value, but the caller of mapiterinit
+// doesn't let the return value escape.
+//go:noescape
+//go:linkname mapiterinit reflect.mapiterinit
+func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) *hiter
+
+//go:noescape
+//go:linkname mapiternext reflect.mapiternext
+func mapiternext(it *hiter)
+
+//go:linkname ifaceE2I reflect.ifaceE2I
+func ifaceE2I(rtype unsafe.Pointer, src interface{}, dst unsafe.Pointer)
+
+// A hash iteration structure.
+// If you modify hiter, also change cmd/internal/gc/reflect.go to indicate
+// the layout of this structure.
+type hiter struct {
+ key unsafe.Pointer // Must be in first position. Write nil to indicate iteration end (see cmd/internal/gc/range.go).
+ value unsafe.Pointer // Must be in second position (see cmd/internal/gc/range.go).
+ // rest fields are ignored
+}
+
+// add returns p+x.
+//
+// The whySafe string is ignored, so that the function still inlines
+// as efficiently as p+x, but all call sites should use the string to
+// record why the addition is safe, which is to say why the addition
+// does not cause x to advance to the very end of p's allocation
+// and therefore point incorrectly at the next block in memory.
+func add(p unsafe.Pointer, x uintptr, whySafe string) unsafe.Pointer {
+ return unsafe.Pointer(uintptr(p) + x)
+}
+
+// arrayAt returns the i-th element of p,
+// an array whose elements are eltSize bytes wide.
+// The array pointed at by p must have at least i+1 elements:
+// it is invalid (but impossible to check here) to pass i >= len,
+// because then the result will point outside the array.
+// whySafe must explain why i < len. (Passing "i < len" is fine;
+// the benefit is to surface this assumption at the call site.)
+func arrayAt(p unsafe.Pointer, i int, eltSize uintptr, whySafe string) unsafe.Pointer {
+ return add(p, uintptr(i)*eltSize, "i < len")
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_map.go b/vendor/github.com/modern-go/reflect2/unsafe_map.go
new file mode 100644
index 000000000..f2e76e6bb
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_map.go
@@ -0,0 +1,138 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type UnsafeMapType struct {
+ unsafeType
+ pKeyRType unsafe.Pointer
+ pElemRType unsafe.Pointer
+}
+
+func newUnsafeMapType(cfg *frozenConfig, type1 reflect.Type) MapType {
+ return &UnsafeMapType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ pKeyRType: unpackEFace(reflect.PtrTo(type1.Key())).data,
+ pElemRType: unpackEFace(reflect.PtrTo(type1.Elem())).data,
+ }
+}
+
+func (type2 *UnsafeMapType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *UnsafeMapType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ if ptr == nil {
+ return true
+ }
+ return *(*unsafe.Pointer)(ptr) == nil
+}
+
+func (type2 *UnsafeMapType) LikePtr() bool {
+ return true
+}
+
+func (type2 *UnsafeMapType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("MapType.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafeMapType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
+}
+
+func (type2 *UnsafeMapType) Key() Type {
+ return type2.cfg.Type2(type2.Type.Key())
+}
+
+func (type2 *UnsafeMapType) MakeMap(cap int) interface{} {
+ return packEFace(type2.ptrRType, type2.UnsafeMakeMap(cap))
+}
+
+func (type2 *UnsafeMapType) UnsafeMakeMap(cap int) unsafe.Pointer {
+ m := makeMapWithSize(type2.rtype, cap)
+ return unsafe.Pointer(&m)
+}
+
+func (type2 *UnsafeMapType) SetIndex(obj interface{}, key interface{}, elem interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("MapType.SetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ keyEFace := unpackEFace(key)
+ assertType("MapType.SetIndex argument 2", type2.pKeyRType, keyEFace.rtype)
+ elemEFace := unpackEFace(elem)
+ assertType("MapType.SetIndex argument 3", type2.pElemRType, elemEFace.rtype)
+ type2.UnsafeSetIndex(objEFace.data, keyEFace.data, elemEFace.data)
+}
+
+func (type2 *UnsafeMapType) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) {
+ mapassign(type2.rtype, *(*unsafe.Pointer)(obj), key, elem)
+}
+
+func (type2 *UnsafeMapType) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) {
+ objEFace := unpackEFace(obj)
+ assertType("MapType.TryGetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ keyEFace := unpackEFace(key)
+ assertType("MapType.TryGetIndex argument 2", type2.pKeyRType, keyEFace.rtype)
+ elemPtr := type2.UnsafeGetIndex(objEFace.data, keyEFace.data)
+ if elemPtr == nil {
+ return nil, false
+ }
+ return packEFace(type2.pElemRType, elemPtr), true
+}
+
+func (type2 *UnsafeMapType) GetIndex(obj interface{}, key interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("MapType.GetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ keyEFace := unpackEFace(key)
+ assertType("MapType.GetIndex argument 2", type2.pKeyRType, keyEFace.rtype)
+ elemPtr := type2.UnsafeGetIndex(objEFace.data, keyEFace.data)
+ return packEFace(type2.pElemRType, elemPtr)
+}
+
+func (type2 *UnsafeMapType) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer {
+ return mapaccess(type2.rtype, *(*unsafe.Pointer)(obj), key)
+}
+
+func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator {
+ objEFace := unpackEFace(obj)
+ assertType("MapType.Iterate argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIterate(objEFace.data)
+}
+
+func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator {
+ return &UnsafeMapIterator{
+ hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)),
+ pKeyRType: type2.pKeyRType,
+ pElemRType: type2.pElemRType,
+ }
+}
+
+type UnsafeMapIterator struct {
+ *hiter
+ pKeyRType unsafe.Pointer
+ pElemRType unsafe.Pointer
+}
+
+func (iter *UnsafeMapIterator) HasNext() bool {
+ return iter.key != nil
+}
+
+func (iter *UnsafeMapIterator) Next() (interface{}, interface{}) {
+ key, elem := iter.UnsafeNext()
+ return packEFace(iter.pKeyRType, key), packEFace(iter.pElemRType, elem)
+}
+
+func (iter *UnsafeMapIterator) UnsafeNext() (unsafe.Pointer, unsafe.Pointer) {
+ key := iter.key
+ elem := iter.value
+ mapiternext(iter.hiter)
+ return key, elem
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_ptr.go b/vendor/github.com/modern-go/reflect2/unsafe_ptr.go
new file mode 100644
index 000000000..8e5ec9cf4
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_ptr.go
@@ -0,0 +1,46 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type UnsafePtrType struct {
+ unsafeType
+}
+
+func newUnsafePtrType(cfg *frozenConfig, type1 reflect.Type) *UnsafePtrType {
+ return &UnsafePtrType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ }
+}
+
+func (type2 *UnsafePtrType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *UnsafePtrType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ if ptr == nil {
+ return true
+ }
+ return *(*unsafe.Pointer)(ptr) == nil
+}
+
+func (type2 *UnsafePtrType) LikePtr() bool {
+ return true
+}
+
+func (type2 *UnsafePtrType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafePtrType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_slice.go b/vendor/github.com/modern-go/reflect2/unsafe_slice.go
new file mode 100644
index 000000000..1c6d876c7
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_slice.go
@@ -0,0 +1,177 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+// sliceHeader is a safe version of SliceHeader used within this package.
+type sliceHeader struct {
+ Data unsafe.Pointer
+ Len int
+ Cap int
+}
+
+type UnsafeSliceType struct {
+ unsafeType
+ elemRType unsafe.Pointer
+ pElemRType unsafe.Pointer
+ elemSize uintptr
+}
+
+func newUnsafeSliceType(cfg *frozenConfig, type1 reflect.Type) SliceType {
+ elemType := type1.Elem()
+ return &UnsafeSliceType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ pElemRType: unpackEFace(reflect.PtrTo(elemType)).data,
+ elemRType: unpackEFace(elemType).data,
+ elemSize: elemType.Size(),
+ }
+}
+
+func (type2 *UnsafeSliceType) Set(obj interface{}, val interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Set argument 1", type2.ptrRType, objEFace.rtype)
+ valEFace := unpackEFace(val)
+ assertType("Type.Set argument 2", type2.ptrRType, valEFace.rtype)
+ type2.UnsafeSet(objEFace.data, valEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) {
+ *(*sliceHeader)(ptr) = *(*sliceHeader)(val)
+}
+
+func (type2 *UnsafeSliceType) IsNil(obj interface{}) bool {
+ if obj == nil {
+ return true
+ }
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ if ptr == nil {
+ return true
+ }
+ return (*sliceHeader)(ptr).Data == nil
+}
+
+func (type2 *UnsafeSliceType) SetNil(obj interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.SetNil argument 1", type2.ptrRType, objEFace.rtype)
+ type2.UnsafeSetNil(objEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeSetNil(ptr unsafe.Pointer) {
+ header := (*sliceHeader)(ptr)
+ header.Len = 0
+ header.Cap = 0
+ header.Data = nil
+}
+
+func (type2 *UnsafeSliceType) MakeSlice(length int, cap int) interface{} {
+ return packEFace(type2.ptrRType, type2.UnsafeMakeSlice(length, cap))
+}
+
+func (type2 *UnsafeSliceType) UnsafeMakeSlice(length int, cap int) unsafe.Pointer {
+ header := &sliceHeader{unsafe_NewArray(type2.elemRType, cap), length, cap}
+ return unsafe.Pointer(header)
+}
+
+func (type2 *UnsafeSliceType) LengthOf(obj interface{}) int {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.Len argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeLengthOf(objEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeLengthOf(obj unsafe.Pointer) int {
+ header := (*sliceHeader)(obj)
+ return header.Len
+}
+
+func (type2 *UnsafeSliceType) SetIndex(obj interface{}, index int, elem interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.SetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ elemEFace := unpackEFace(elem)
+ assertType("SliceType.SetIndex argument 3", type2.pElemRType, elemEFace.rtype)
+ type2.UnsafeSetIndex(objEFace.data, index, elemEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) {
+ header := (*sliceHeader)(obj)
+ elemPtr := arrayAt(header.Data, index, type2.elemSize, "i < s.Len")
+ typedmemmove(type2.elemRType, elemPtr, elem)
+}
+
+func (type2 *UnsafeSliceType) GetIndex(obj interface{}, index int) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.GetIndex argument 1", type2.ptrRType, objEFace.rtype)
+ elemPtr := type2.UnsafeGetIndex(objEFace.data, index)
+ return packEFace(type2.pElemRType, elemPtr)
+}
+
+func (type2 *UnsafeSliceType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer {
+ header := (*sliceHeader)(obj)
+ return arrayAt(header.Data, index, type2.elemSize, "i < s.Len")
+}
+
+func (type2 *UnsafeSliceType) Append(obj interface{}, elem interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.Append argument 1", type2.ptrRType, objEFace.rtype)
+ elemEFace := unpackEFace(elem)
+ assertType("SliceType.Append argument 2", type2.pElemRType, elemEFace.rtype)
+ type2.UnsafeAppend(objEFace.data, elemEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) {
+ header := (*sliceHeader)(obj)
+ oldLen := header.Len
+ type2.UnsafeGrow(obj, oldLen+1)
+ type2.UnsafeSetIndex(obj, oldLen, elem)
+}
+
+func (type2 *UnsafeSliceType) Cap(obj interface{}) int {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.Cap argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeCap(objEFace.data)
+}
+
+func (type2 *UnsafeSliceType) UnsafeCap(ptr unsafe.Pointer) int {
+ return (*sliceHeader)(ptr).Cap
+}
+
+func (type2 *UnsafeSliceType) Grow(obj interface{}, newLength int) {
+ objEFace := unpackEFace(obj)
+ assertType("SliceType.Grow argument 1", type2.ptrRType, objEFace.rtype)
+ type2.UnsafeGrow(objEFace.data, newLength)
+}
+
+func (type2 *UnsafeSliceType) UnsafeGrow(obj unsafe.Pointer, newLength int) {
+ header := (*sliceHeader)(obj)
+ if newLength <= header.Cap {
+ header.Len = newLength
+ return
+ }
+ newCap := calcNewCap(header.Cap, newLength)
+ newHeader := (*sliceHeader)(type2.UnsafeMakeSlice(header.Len, newCap))
+ typedslicecopy(type2.elemRType, *newHeader, *header)
+ header.Data = newHeader.Data
+ header.Cap = newHeader.Cap
+ header.Len = newLength
+}
+
+func calcNewCap(cap int, expectedCap int) int {
+ if cap == 0 {
+ cap = expectedCap
+ } else {
+ for cap < expectedCap {
+ if cap < 1024 {
+ cap += cap
+ } else {
+ cap += cap / 4
+ }
+ }
+ }
+ return cap
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_struct.go b/vendor/github.com/modern-go/reflect2/unsafe_struct.go
new file mode 100644
index 000000000..804d91663
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_struct.go
@@ -0,0 +1,59 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type UnsafeStructType struct {
+ unsafeType
+ likePtr bool
+}
+
+func newUnsafeStructType(cfg *frozenConfig, type1 reflect.Type) *UnsafeStructType {
+ return &UnsafeStructType{
+ unsafeType: *newUnsafeType(cfg, type1),
+ likePtr: likePtrType(type1),
+ }
+}
+
+func (type2 *UnsafeStructType) LikePtr() bool {
+ return type2.likePtr
+}
+
+func (type2 *UnsafeStructType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *UnsafeStructType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
+ if type2.likePtr {
+ return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
+ }
+ return packEFace(type2.rtype, ptr)
+}
+
+func (type2 *UnsafeStructType) FieldByName(name string) StructField {
+ structField, found := type2.Type.FieldByName(name)
+ if !found {
+ return nil
+ }
+ return newUnsafeStructField(type2, structField)
+}
+
+func (type2 *UnsafeStructType) Field(i int) StructField {
+ return newUnsafeStructField(type2, type2.Type.Field(i))
+}
+
+func (type2 *UnsafeStructType) FieldByIndex(index []int) StructField {
+ return newUnsafeStructField(type2, type2.Type.FieldByIndex(index))
+}
+
+func (type2 *UnsafeStructType) FieldByNameFunc(match func(string) bool) StructField {
+ structField, found := type2.Type.FieldByNameFunc(match)
+ if !found {
+ panic("field match condition not found in " + type2.Type.String())
+ }
+ return newUnsafeStructField(type2, structField)
+}
diff --git a/vendor/github.com/modern-go/reflect2/unsafe_type.go b/vendor/github.com/modern-go/reflect2/unsafe_type.go
new file mode 100644
index 000000000..13941716c
--- /dev/null
+++ b/vendor/github.com/modern-go/reflect2/unsafe_type.go
@@ -0,0 +1,85 @@
+package reflect2
+
+import (
+ "reflect"
+ "unsafe"
+)
+
+type unsafeType struct {
+ safeType
+ rtype unsafe.Pointer
+ ptrRType unsafe.Pointer
+}
+
+func newUnsafeType(cfg *frozenConfig, type1 reflect.Type) *unsafeType {
+ return &unsafeType{
+ safeType: safeType{
+ Type: type1,
+ cfg: cfg,
+ },
+ rtype: unpackEFace(type1).data,
+ ptrRType: unpackEFace(reflect.PtrTo(type1)).data,
+ }
+}
+
+func (type2 *unsafeType) Set(obj interface{}, val interface{}) {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Set argument 1", type2.ptrRType, objEFace.rtype)
+ valEFace := unpackEFace(val)
+ assertType("Type.Set argument 2", type2.ptrRType, valEFace.rtype)
+ type2.UnsafeSet(objEFace.data, valEFace.data)
+}
+
+func (type2 *unsafeType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) {
+ typedmemmove(type2.rtype, ptr, val)
+}
+
+func (type2 *unsafeType) IsNil(obj interface{}) bool {
+ objEFace := unpackEFace(obj)
+ assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIsNil(objEFace.data)
+}
+
+func (type2 *unsafeType) UnsafeIsNil(ptr unsafe.Pointer) bool {
+ return ptr == nil
+}
+
+func (type2 *unsafeType) UnsafeNew() unsafe.Pointer {
+ return unsafe_New(type2.rtype)
+}
+
+func (type2 *unsafeType) New() interface{} {
+ return packEFace(type2.ptrRType, type2.UnsafeNew())
+}
+
+func (type2 *unsafeType) PackEFace(ptr unsafe.Pointer) interface{} {
+ return packEFace(type2.ptrRType, ptr)
+}
+
+func (type2 *unsafeType) RType() uintptr {
+ return uintptr(type2.rtype)
+}
+
+func (type2 *unsafeType) Indirect(obj interface{}) interface{} {
+ objEFace := unpackEFace(obj)
+ assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
+ return type2.UnsafeIndirect(objEFace.data)
+}
+
+func (type2 *unsafeType) UnsafeIndirect(obj unsafe.Pointer) interface{} {
+ return packEFace(type2.rtype, obj)
+}
+
+func (type2 *unsafeType) LikePtr() bool {
+ return false
+}
+
+func assertType(where string, expectRType unsafe.Pointer, actualRType unsafe.Pointer) {
+ if expectRType != actualRType {
+ expectType := reflect.TypeOf(0)
+ (*iface)(unsafe.Pointer(&expectType)).data = expectRType
+ actualType := reflect.TypeOf(0)
+ (*iface)(unsafe.Pointer(&actualType)).data = actualRType
+ panic(where + ": expect " + expectType.String() + ", actual " + actualType.String())
+ }
+}
diff --git a/vendor/github.com/nrdcg/namesilo/LICENSE b/vendor/github.com/nrdcg/namesilo/LICENSE
new file mode 100644
index 000000000..a612ad981
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/LICENSE
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+ means each individual or legal entity that creates, contributes to
+ the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+ means the combination of the Contributions of others (if any) used
+ by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+ means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+ means Source Code Form to which the initial Contributor has attached
+ the notice in Exhibit A, the Executable Form of such Source Code
+ Form, and Modifications of such Source Code Form, in each case
+ including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+ means
+
+ (a) that the initial Contributor has attached the notice described
+ in Exhibit B to the Covered Software; or
+
+ (b) that the Covered Software was made available under the terms of
+ version 1.1 or earlier of the License, but not also under the
+ terms of a Secondary License.
+
+1.6. "Executable Form"
+ means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+ means a work that combines Covered Software with other material, in
+ a separate file or files, that is not Covered Software.
+
+1.8. "License"
+ means this document.
+
+1.9. "Licensable"
+ means having the right to grant, to the maximum extent possible,
+ whether at the time of the initial grant or subsequently, any and
+ all of the rights conveyed by this License.
+
+1.10. "Modifications"
+ means any of the following:
+
+ (a) any file in Source Code Form that results from an addition to,
+ deletion from, or modification of the contents of Covered
+ Software; or
+
+ (b) any new file in Source Code Form that contains any Covered
+ Software.
+
+1.11. "Patent Claims" of a Contributor
+ means any patent claim(s), including without limitation, method,
+ process, and apparatus claims, in any patent Licensable by such
+ Contributor that would be infringed, but for the grant of the
+ License, by the making, using, selling, offering for sale, having
+ made, import, or transfer of either its Contributions or its
+ Contributor Version.
+
+1.12. "Secondary License"
+ means either the GNU General Public License, Version 2.0, the GNU
+ Lesser General Public License, Version 2.1, the GNU Affero General
+ Public License, Version 3.0, or any later versions of those
+ licenses.
+
+1.13. "Source Code Form"
+ means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+ means an individual or a legal entity exercising rights under this
+ License. For legal entities, "You" includes any entity that
+ controls, is controlled by, or is under common control with You. For
+ purposes of this definition, "control" means (a) the power, direct
+ or indirect, to cause the direction or management of such entity,
+ whether by contract or otherwise, or (b) ownership of more than
+ fifty percent (50%) of the outstanding shares or beneficial
+ ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+ Licensable by such Contributor to use, reproduce, make available,
+ modify, display, perform, distribute, and otherwise exploit its
+ Contributions, either on an unmodified basis, with Modifications, or
+ as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+ for sale, have made, import, and otherwise transfer either its
+ Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+ or
+
+(b) for infringements caused by: (i) Your and any other third party's
+ modifications of Covered Software, or (ii) the combination of its
+ Contributions with other software (except as part of its Contributor
+ Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+ its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+ Form, as described in Section 3.1, and You must inform recipients of
+ the Executable Form how they can obtain a copy of such Source Code
+ Form by reasonable means in a timely manner, at a charge no more
+ than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+ License, or sublicense it under different terms, provided that the
+ license for the Executable Form does not attempt to limit or alter
+ the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+* *
+* 6. Disclaimer of Warranty *
+* ------------------------- *
+* *
+* Covered Software is provided under this License on an "as is" *
+* basis, without warranty of any kind, either expressed, implied, or *
+* statutory, including, without limitation, warranties that the *
+* Covered Software is free of defects, merchantable, fit for a *
+* particular purpose or non-infringing. The entire risk as to the *
+* quality and performance of the Covered Software is with You. *
+* Should any Covered Software prove defective in any respect, You *
+* (not any Contributor) assume the cost of any necessary servicing, *
+* repair, or correction. This disclaimer of warranty constitutes an *
+* essential part of this License. No use of any Covered Software is *
+* authorized under this License except under this disclaimer. *
+* *
+************************************************************************
+
+************************************************************************
+* *
+* 7. Limitation of Liability *
+* -------------------------- *
+* *
+* Under no circumstances and under no legal theory, whether tort *
+* (including negligence), contract, or otherwise, shall any *
+* Contributor, or anyone who distributes Covered Software as *
+* permitted above, be liable to You for any direct, indirect, *
+* special, incidental, or consequential damages of any character *
+* including, without limitation, damages for lost profits, loss of *
+* goodwill, work stoppage, computer failure or malfunction, or any *
+* and all other commercial damages or losses, even if such party *
+* shall have been informed of the possibility of such damages. This *
+* limitation of liability shall not apply to liability for death or *
+* personal injury resulting from such party's negligence to the *
+* extent applicable law prohibits such limitation. Some *
+* jurisdictions do not allow the exclusion or limitation of *
+* incidental or consequential damages, so this exclusion and *
+* limitation may not apply to You. *
+* *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+ This Source Code Form is subject to the terms of the Mozilla Public
+ License, v. 2.0. If a copy of the MPL was not distributed with this
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+ This Source Code Form is "Incompatible With Secondary Licenses", as
+ defined by the Mozilla Public License, v. 2.0.
diff --git a/vendor/github.com/nrdcg/namesilo/auth.go b/vendor/github.com/nrdcg/namesilo/auth.go
new file mode 100644
index 000000000..aac5ea09f
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/auth.go
@@ -0,0 +1,57 @@
+package namesilo
+
+import (
+ "fmt"
+ "net/http"
+)
+
+// TokenTransport HTTP transport for API authentication.
+type TokenTransport struct {
+ apiKey string
+
+ // Transport is the underlying HTTP transport to use when making requests.
+ // It will default to http.DefaultTransport if nil.
+ Transport http.RoundTripper
+}
+
+// NewTokenTransport Creates a HTTP transport for API authentication.
+func NewTokenTransport(apiKey string) (*TokenTransport, error) {
+ if apiKey == "" {
+ return nil, fmt.Errorf("credentials missing: API key")
+ }
+
+ return &TokenTransport{apiKey: apiKey}, nil
+}
+
+// RoundTrip executes a single HTTP transaction
+func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error) {
+ enrichedReq := &http.Request{}
+ *enrichedReq = *req
+
+ enrichedReq.Header = make(http.Header, len(req.Header))
+ for k, s := range req.Header {
+ enrichedReq.Header[k] = append([]string(nil), s...)
+ }
+
+ if t.apiKey != "" {
+ query := enrichedReq.URL.Query()
+ query.Set("version", "1")
+ query.Set("type", "xml")
+ query.Set("key", t.apiKey)
+ enrichedReq.URL.RawQuery = query.Encode()
+ }
+
+ return t.transport().RoundTrip(enrichedReq)
+}
+
+// Client Creates a new HTTP client
+func (t *TokenTransport) Client() *http.Client {
+ return &http.Client{Transport: t}
+}
+
+func (t *TokenTransport) transport() http.RoundTripper {
+ if t.Transport != nil {
+ return t.Transport
+ }
+ return http.DefaultTransport
+}
diff --git a/vendor/github.com/nrdcg/namesilo/model.go b/vendor/github.com/nrdcg/namesilo/model.go
new file mode 100644
index 000000000..155ac00d7
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/model.go
@@ -0,0 +1,768 @@
+package namesilo
+
+import "encoding/xml"
+
+// Request Base request representation.
+type Request struct {
+ Operation string `xml:"operation"`
+ IP string `xml:"ip"`
+}
+
+// Reply Base reply representation.
+type Reply struct {
+ Code string `xml:"code"`
+ Detail string `xml:"detail"`
+}
+
+// Operation was generated 2019-03-20 19:35:05.
+type Operation struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// AddAccountFunds was generated 2019-03-20 19:35:05.
+type AddAccountFunds struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply AddAccountFundsReply `xml:"reply"`
+}
+
+// AddAccountFundsReply A reply representation.
+type AddAccountFundsReply struct {
+ Reply
+ NewBalance string `xml:"new_balance"`
+}
+
+// AddAutoRenewal was generated 2019-03-20 19:35:05.
+type AddAutoRenewal struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// AddPrivacy was generated 2019-03-20 19:35:05.
+type AddPrivacy struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// AddRegisteredNameServer was generated 2019-03-20 19:35:05.
+type AddRegisteredNameServer struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// ChangeNameServers was generated 2019-03-20 19:35:05.
+type ChangeNameServers struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// CheckRegisterAvailability was generated 2019-03-20 19:35:05.
+type CheckRegisterAvailability struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply CheckRegisterAvailabilityReply `xml:"reply"`
+}
+
+// CheckRegisterAvailabilityReply A reply representation.
+type CheckRegisterAvailabilityReply struct {
+ Reply
+ Available struct {
+ Domain []string `xml:"domain"`
+ } `xml:"available"`
+ Unavailable struct {
+ Domain string `xml:"domain"`
+ } `xml:"unavailable"`
+ Invalid struct {
+ Domain string `xml:"domain"`
+ } `xml:"invalid"`
+}
+
+// CheckTransferAvailability was generated 2019-03-20 19:35:05.
+type CheckTransferAvailability struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply CheckTransferAvailabilityReply `xml:"reply"`
+}
+
+// CheckTransferAvailabilityReply A reply representation.
+type CheckTransferAvailabilityReply struct {
+ Reply
+ Available struct {
+ Domain []string `xml:"domain"`
+ } `xml:"available"`
+ Unavailable struct {
+ Domain []struct {
+ Name string `xml:",chardata"`
+ Reason string `xml:"reason,attr"`
+ } `xml:"domain"`
+ } `xml:"unavailable"`
+}
+
+// CheckTransferStatus was generated 2019-03-20 19:35:05.
+type CheckTransferStatus struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply CheckTransferStatusReply `xml:"reply"`
+}
+
+// CheckTransferStatusReply A reply representation.
+type CheckTransferStatusReply struct {
+ Reply
+ Date string `xml:"date"`
+ Status string `xml:"status"`
+ Message string `xml:"message"`
+}
+
+// ConfigureEmailForward was generated 2019-03-20 19:35:05.
+type ConfigureEmailForward struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ConfigureEmailForwardReply `xml:"reply"`
+}
+
+// ConfigureEmailForwardReply A reply representation.
+type ConfigureEmailForwardReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// ContactAdd was generated 2019-03-20 19:35:05.
+type ContactAdd struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ContactAddReply `xml:"reply"`
+}
+
+// ContactAddReply A reply representation.
+type ContactAddReply struct {
+ Reply
+ ContactID string `xml:"contact_id"`
+}
+
+// ContactDomainAssociate was generated 2019-03-20 19:35:05.
+type ContactDomainAssociate struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// ContactList was generated 2019-03-20 19:35:05.
+type ContactList struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ContactListReply `xml:"reply"`
+}
+
+// ContactListReply A reply representation.
+type ContactListReply struct {
+ Reply
+ Contact []Contact `xml:"contact"`
+}
+
+// Contact A contact representation.
+type Contact struct {
+ ContactID string `xml:"contact_id"`
+ DefaultProfile string `xml:"default_profile"`
+ Nickname string `xml:"nickname"`
+ Company string `xml:"company"`
+ FirstName string `xml:"first_name"`
+ LastName string `xml:"last_name"`
+ Address string `xml:"address"`
+ Address2 string `xml:"address2"`
+ City string `xml:"city"`
+ State string `xml:"state"`
+ Zip string `xml:"zip"`
+ Country string `xml:"country"`
+ Email string `xml:"email"`
+ Phone string `xml:"phone"`
+ Fax string `xml:"fax"`
+ Usnc string `xml:"usnc"`
+ Usap string `xml:"usap"`
+ Calf string `xml:"calf"`
+ Caln string `xml:"caln"`
+ Caag string `xml:"caag"`
+ Cawd string `xml:"cawd"`
+}
+
+// ContactUpdate was generated 2019-03-20 19:35:05.
+type ContactUpdate struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// ContactDelete was generated 2019-03-20 19:35:05.
+type ContactDelete struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DeleteEmailForward was generated 2019-03-20 19:35:05.
+type DeleteEmailForward struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DeleteEmailForwardReply `xml:"reply"`
+}
+
+// DeleteEmailForwardReply A reply representation.
+type DeleteEmailForwardReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// DeleteRegisteredNameServer was generated 2019-03-20 19:35:05.
+type DeleteRegisteredNameServer struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DnsAddRecord was generated 2019-03-20 19:35:05.
+type DnsAddRecord struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DnsAddRecordReply `xml:"reply"`
+}
+
+// DnsAddRecordReply A reply representation.
+type DnsAddRecordReply struct {
+ Reply
+ RecordID string `xml:"record_id"`
+}
+
+// DnsDeleteRecord was generated 2019-03-20 19:35:05.
+type DnsDeleteRecord struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DnsListRecords was generated 2019-03-20 19:35:05.
+type DnsListRecords struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DnsListRecordsReply `xml:"reply"`
+}
+
+// DnsListRecordsReply A reply representation.
+type DnsListRecordsReply struct {
+ Reply
+ ResourceRecord []ResourceRecord `xml:"resource_record"`
+}
+
+// ResourceRecord A Resource Record representation.
+type ResourceRecord struct {
+ RecordID string `xml:"record_id"`
+ Type string `xml:"type"`
+ Host string `xml:"host"`
+ Value string `xml:"value"`
+ TTL string `xml:"ttl"`
+ Distance string `xml:"distance"`
+}
+
+// DnsSecAddRecord was generated 2019-03-20 19:35:05.
+type DnsSecAddRecord struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DnsSecDeleteRecord was generated 2019-03-20 19:35:05.
+type DnsSecDeleteRecord struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DnsSecListRecords was generated 2019-03-20 19:35:05.
+type DnsSecListRecords struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DnsSecListRecordsReply `xml:"reply"`
+}
+
+// DnsSecListRecordsReply A reply representation.
+type DnsSecListRecordsReply struct {
+ Reply
+ DsRecord []DsRecord `xml:"ds_record"`
+}
+
+// DsRecord A DsRecord representation.
+type DsRecord struct {
+ Digest string `xml:"digest"`
+ DigestType string `xml:"digest_type"`
+ Algorithm string `xml:"algorithm"`
+ KeyTag string `xml:"key_tag"`
+}
+
+// DnsUpdateRecord was generated 2019-03-20 19:35:05.
+type DnsUpdateRecord struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DnsUpdateRecordReply `xml:"reply"`
+}
+
+// DnsUpdateRecordReply A reply representation.
+type DnsUpdateRecordReply struct {
+ Reply
+ RecordID string `xml:"record_id"`
+}
+
+// DomainForwardSubDomainDelete was generated 2019-03-20 19:35:05.
+type DomainForwardSubDomainDelete struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DomainForwardSubDomain was generated 2019-03-20 19:35:05.
+type DomainForwardSubDomain struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply DomainForwardSubDomainReply `xml:"reply"`
+}
+
+// DomainForwardSubDomainReply A reply representation.
+type DomainForwardSubDomainReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// DomainForward was generated 2019-03-20 19:35:05.
+type DomainForward struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DomainLock was generated 2019-03-20 19:35:05.
+type DomainLock struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// DomainUnlock was generated 2019-03-20 19:35:05.
+type DomainUnlock struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// EmailVerification was generated 2019-03-20 19:35:05.
+type EmailVerification struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply EmailVerificationReply `xml:"reply"`
+}
+
+// EmailVerificationReply A reply representation.
+type EmailVerificationReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// GetAccountBalance was generated 2019-03-20 19:35:05.
+type GetAccountBalance struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply GetAccountBalanceReply `xml:"reply"`
+}
+
+// GetAccountBalanceReply A reply representation.
+type GetAccountBalanceReply struct {
+ Reply
+ Balance string `xml:"balance"`
+}
+
+// GetDomainInfo was generated 2019-03-20 19:35:05.
+type GetDomainInfo struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply GetDomainInfoReply `xml:"reply"`
+}
+
+// GetDomainInfoReply A reply representation.
+type GetDomainInfoReply struct {
+ Reply
+ Created string `xml:"created"`
+ Expires string `xml:"expires"`
+ Status string `xml:"status"`
+ Locked string `xml:"locked"`
+ Private string `xml:"private"`
+ AutoRenew string `xml:"auto_renew"`
+ TrafficType string `xml:"traffic_type"`
+ EmailVerificationRequired string `xml:"email_verification_required"`
+ Portfolio string `xml:"portfolio"`
+ ForwardURL string `xml:"forward_url"`
+ ForwardType string `xml:"forward_type"`
+ Nameservers []Nameserver `xml:"nameservers>nameserver"`
+ ContactIDs ContactIDs `xml:"contact_ids"`
+}
+
+// Nameserver A Nameserver representation.
+type Nameserver struct {
+ Name string `xml:",chardata"`
+ Position string `xml:"position,attr"`
+}
+
+// ContactIDs A Contact IDs representation.
+type ContactIDs struct {
+ Registrant string `xml:"registrant"`
+ Administrative string `xml:"administrative"`
+ Technical string `xml:"technical"`
+ Billing string `xml:"billing"`
+}
+
+// GetPrices was generated 2019-03-20 19:35:05.
+type GetPrices struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply GetPricesReply `xml:"reply"`
+}
+
+// GetPricesReply A reply representation.
+type GetPricesReply struct {
+ Reply
+ Com ComNet `xml:"com"`
+ Net ComNet `xml:"net"`
+}
+
+// ComNet A Com/Net representation.
+type ComNet struct {
+ Registration string `xml:"registration"`
+ Transfer string `xml:"transfer"`
+ Renew string `xml:"renew"`
+}
+
+// ListDomains was generated 2019-03-20 19:35:05.
+type ListDomains struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ListDomainsReply `xml:"reply"`
+}
+
+// ListDomainsReply A reply representation.
+type ListDomainsReply struct {
+ Reply
+ Domains struct {
+ Domain []string `xml:"domain"`
+ } `xml:"domains"`
+}
+
+// ListEmailForwards was generated 2019-03-20 19:35:05.
+type ListEmailForwards struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ListEmailForwardsReply `xml:"reply"`
+}
+
+// ListEmailForwardsReply A reply representation.
+type ListEmailForwardsReply struct {
+ Reply
+ Addresses []Address `xml:"addresses"`
+}
+
+// Address An Address representation.
+type Address struct {
+ Email string `xml:"email"`
+ ForwardsTo []string `xml:"forwards_to"`
+}
+
+// ListOrders was generated 2019-03-20 19:35:05.
+type ListOrders struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ListOrdersReply `xml:"reply"`
+}
+
+// ListOrdersReply A reply representation.
+type ListOrdersReply struct {
+ Reply
+ Order []Order `xml:"order"`
+}
+
+// Order An Order representation.
+type Order struct {
+ OrderNumber string `xml:"order_number"`
+ OrderDate string `xml:"order_date"`
+ Method string `xml:"method"`
+ Total string `xml:"total"`
+}
+
+// ListRegisteredNameServers was generated 2019-03-20 19:35:05.
+type ListRegisteredNameServers struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply ListRegisteredNameServersReply `xml:"reply"`
+}
+
+// ListRegisteredNameServersReply A reply representation.
+type ListRegisteredNameServersReply struct {
+ Reply
+ Hosts []Host `xml:"hosts"`
+}
+
+// Host A Host representation.
+type Host struct {
+ Host string `xml:"host"`
+ IP []string `xml:"ip"`
+}
+
+// MarketplaceActiveSalesOverview was generated 2019-03-20 19:35:05.
+type MarketplaceActiveSalesOverview struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply MarketplaceActiveSalesOverviewReply `xml:"reply"`
+}
+
+// MarketplaceActiveSalesOverviewReply A reply representation.
+type MarketplaceActiveSalesOverviewReply struct {
+ Reply
+ SaleDetails []SaleDetail `xml:"sale_details"`
+}
+
+// SaleDetail A Sale Detail representation.
+type SaleDetail struct {
+ Domain string `xml:"domain"`
+ Status string `xml:"status"`
+ Reserve string `xml:"reserve"`
+ BuyNow string `xml:"buy_now"`
+ Portfolio string `xml:"portfolio"`
+ SaleType string `xml:"sale_type"`
+ PayPlanOffered string `xml:"pay_plan_offered"`
+ EndDate string `xml:"end_date"`
+ AutoExtendDays string `xml:"auto_extend_days"`
+ TimeRemaining string `xml:"time_remaining"`
+ Private string `xml:"private"`
+ ActiveBidOrOffer string `xml:"active_bid_or_offer"`
+}
+
+// MarketplaceAddOrModifySale was generated 2019-03-20 19:35:05.
+type MarketplaceAddOrModifySale struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply MarketplaceAddOrModifySaleReply `xml:"reply"`
+}
+
+// MarketplaceAddOrModifySaleReply A reply representation.
+type MarketplaceAddOrModifySaleReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// MarketplaceLandingPageUpdate was generated 2019-03-20 19:35:05.
+type MarketplaceLandingPageUpdate struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// ModifyRegisteredNameServer was generated 2019-03-20 19:35:05.
+type ModifyRegisteredNameServer struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// OrderDetails was generated 2019-03-20 19:35:05.
+type OrderDetails struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply OrderDetailsReply `xml:"reply"`
+}
+
+// OrderDetailsReply A reply representation.
+type OrderDetailsReply struct {
+ Reply
+ OrderDate string `xml:"order_date"`
+ Method string `xml:"method"`
+ Total string `xml:"total"`
+ OrderDetails []OrderDetail `xml:"order_details"`
+}
+
+// OrderDetail An Order Detail representation.
+type OrderDetail struct {
+ Description string `xml:"description"`
+ YearsQty string `xml:"years_qty"`
+ Price string `xml:"price"`
+ Subtotal string `xml:"subtotal"`
+ Status string `xml:"status"`
+ CreditedDate string `xml:"credited_date,omitempty"`
+ CreditedAmount string `xml:"credited_amount,omitempty"`
+}
+
+// PortfolioAdd was generated 2019-03-20 19:35:05.
+type PortfolioAdd struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// PortfolioDelete was generated 2019-03-20 19:35:05.
+type PortfolioDelete struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// PortfolioDomainAssociate was generated 2019-03-20 19:35:05.
+type PortfolioDomainAssociate struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply PortfolioDomainAssociateReply `xml:"reply"`
+}
+
+// PortfolioDomainAssociateReply A reply representation.
+type PortfolioDomainAssociateReply struct {
+ Reply
+ Message string `xml:"message"`
+}
+
+// PortfolioList was generated 2019-03-20 19:35:05.
+type PortfolioList struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply PortfolioListReply `xml:"reply"`
+}
+
+// PortfolioListReply A reply representation.
+type PortfolioListReply struct {
+ Reply
+ Portfolios Portfolios `xml:"portfolios"`
+}
+
+// Portfolios A Portfolios representation.
+type Portfolios struct {
+ Name string `xml:"name"`
+ Code string `xml:"code"`
+}
+
+// RegisterDomainDrop was generated 2019-03-20 19:35:05.
+type RegisterDomainDrop struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply RegisterDomainDropReply `xml:"reply"`
+}
+
+// RegisterDomainDropReply A reply representation.
+type RegisterDomainDropReply struct {
+ Reply
+ Message string `xml:"message"`
+ Domain string `xml:"domain"`
+ OrderAmount string `xml:"order_amount"`
+}
+
+// RegisterDomain was generated 2019-03-20 19:35:05.
+type RegisterDomain struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply RegisterDomainReply `xml:"reply"`
+}
+
+// RegisterDomainReply A reply representation.
+type RegisterDomainReply struct {
+ Reply
+ Message string `xml:"message"`
+ Domain string `xml:"domain"`
+ OrderAmount string `xml:"order_amount"`
+}
+
+// RegistrantVerificationStatus was generated 2019-03-20 19:35:05.
+type RegistrantVerificationStatus struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply RegistrantVerificationStatusReply `xml:"reply"`
+}
+
+// RegistrantVerificationStatusReply A reply representation.
+type RegistrantVerificationStatusReply struct {
+ Reply
+ Emails []RegistrantEmail `xml:"email"`
+}
+
+// RegistrantEmail A email representation.
+type RegistrantEmail struct {
+ EmailAddress string `xml:"email_address"`
+ Domains string `xml:"domains"`
+ Verified string `xml:"verified"`
+}
+
+// RemoveAutoRenewal was generated 2019-03-20 19:35:05.
+type RemoveAutoRenewal struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// RemovePrivacy was generated 2019-03-20 19:35:05.
+type RemovePrivacy struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// RenewDomain was generated 2019-03-20 19:35:05.
+type RenewDomain struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply RenewDomainReply `xml:"reply"`
+}
+
+// RenewDomainReply A reply representation.
+type RenewDomainReply struct {
+ Reply
+ Message string `xml:"message"`
+ Domain string `xml:"domain"`
+ OrderAmount string `xml:"order_amount"`
+}
+
+// RetrieveAuthCode was generated 2019-03-20 19:35:05.
+type RetrieveAuthCode struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// TransferDomain was generated 2019-03-20 19:35:05.
+type TransferDomain struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply TransferDomainReply `xml:"reply"`
+}
+
+// TransferDomainReply A reply representation.
+type TransferDomainReply struct {
+ Reply
+ Message string `xml:"message"`
+ Domain string `xml:"domain"`
+ OrderAmount string `xml:"order_amount"`
+}
+
+// TransferUpdateChangeEPPCode was generated 2019-03-20 19:35:05.
+type TransferUpdateChangeEPPCode struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// TransferUpdateResendAdminEmail was generated 2019-03-20 19:35:05.
+type TransferUpdateResendAdminEmail struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
+
+// TransferUpdateResubmitToRegistry was generated 2019-03-20 19:35:05.
+type TransferUpdateResubmitToRegistry struct {
+ XMLName xml.Name `xml:"namesilo"`
+ Request Request `xml:"request"`
+ Reply Reply `xml:"reply"`
+}
diff --git a/vendor/github.com/nrdcg/namesilo/namesilo.go b/vendor/github.com/nrdcg/namesilo/namesilo.go
new file mode 100644
index 000000000..47ea77697
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/namesilo.go
@@ -0,0 +1,60 @@
+// Package namesilo A Go client library for accessing the Namesilo API.
+package namesilo
+
+import (
+ "fmt"
+ "net/http"
+ "net/url"
+
+ querystring "github.com/google/go-querystring/query"
+)
+
+const (
+ // DefaultAPIEndpoint The default API endpoint.
+ DefaultAPIEndpoint = "https://www.namesilo.com/api"
+
+ // SandboxAPIEndpoint The sandbox API endpoint.
+ SandboxAPIEndpoint = "https://sandbox.namesilo.com/api"
+)
+
+// Response Codes
+const (
+ SuccessfulAPIOperation = "300"
+ SuccessfulRegistration = "301"
+ SuccessfulOrder = "302"
+)
+
+// Client the Namesilo client.
+type Client struct {
+ Endpoint string
+ HTTPClient *http.Client
+}
+
+// NewClient Creates a Namesilo client.
+func NewClient(httpClient *http.Client) *Client {
+ if httpClient == nil {
+ httpClient = http.DefaultClient
+ }
+
+ return &Client{
+ Endpoint: DefaultAPIEndpoint,
+ HTTPClient: httpClient,
+ }
+}
+
+func (c *Client) get(name string, params interface{}) (*http.Response, error) {
+ uri, err := url.Parse(fmt.Sprintf("%s/%s", c.Endpoint, name))
+ if err != nil {
+ return nil, err
+ }
+
+ if params != nil {
+ v, err := querystring.Values(params)
+ if err != nil {
+ return nil, err
+ }
+ uri.RawQuery = v.Encode()
+ }
+
+ return c.HTTPClient.Get(uri.String())
+}
diff --git a/vendor/github.com/nrdcg/namesilo/params.go b/vendor/github.com/nrdcg/namesilo/params.go
new file mode 100644
index 000000000..234ad7df9
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/params.go
@@ -0,0 +1,520 @@
+package namesilo
+
+// AddAccountFundsParams Parameters for operation addAccountFunds.
+type AddAccountFundsParams struct {
+ Amount string `url:"amount"`
+ PaymentID string `url:"payment_id"`
+}
+
+// AddAutoRenewalParams Parameters for operation addAutoRenewal.
+type AddAutoRenewalParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// AddPrivacyParams Parameters for operation addPrivacy.
+type AddPrivacyParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// AddRegisteredNameServerParams Parameters for operation addRegisteredNameServer.
+type AddRegisteredNameServerParams struct {
+ Domain string `url:"domain"` // required
+ NewHost string `url:"new_host"` // Required
+ IP1 string `url:"ip1"` // Required
+
+ IP2 string `url:"ip2"` // Optional
+ IP3 string `url:"ip3"` // Optional
+ IP4 string `url:"ip4"` // Optional
+ IP5 string `url:"ip5"` // Optional
+ IP6 string `url:"ip6"` // Optional
+ IP7 string `url:"ip7"` // Optional
+ IP8 string `url:"ip8"` // Optional
+ IP9 string `url:"ip9"` // Optional
+ IP10 string `url:"ip10"` // Optional
+ IP11 string `url:"ip11"` // Optional
+ IP12 string `url:"ip12"` // Optional
+ IP13 string `url:"ip13"` // Optional
+}
+
+// ChangeNameServersParams Parameters for operation changeNameServers.
+type ChangeNameServersParams struct {
+ Domains string `url:"domain"` // Required (A comma-delimited list of up to 200 domains)
+
+ NameServer1 string `url:"ns1"` // Required
+ NameServer2 string `url:"ns2"` // Required
+
+ NameServer3 string `url:"ns3"`
+ NameServer4 string `url:"ns4"`
+ NameServer5 string `url:"ns5"`
+ NameServer6 string `url:"ns6"`
+ NameServer7 string `url:"ns7"`
+ NameServer8 string `url:"ns8"`
+ NameServer9 string `url:"ns9"`
+ NameServer10 string `url:"ns10"`
+ NameServer11 string `url:"ns11"`
+ NameServer12 string `url:"ns12"`
+ NameServer13 string `url:"ns13"`
+}
+
+// CheckRegisterAvailabilityParams Parameters for operation checkRegisterAvailability.
+type CheckRegisterAvailabilityParams struct {
+ Domains string `url:"domains"` // Required (A comma-delimited list of domains to check)
+}
+
+// CheckTransferAvailabilityParams Parameters for operation checkTransferAvailability.
+type CheckTransferAvailabilityParams struct {
+ Domains string `url:"domains"` // Required (A comma-delimited list of domains to check)
+}
+
+// CheckTransferStatusParams Parameters for operation checkTransferStatus.
+type CheckTransferStatusParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// ConfigureEmailForwardParams Parameters for operation configureEmailForward.
+type ConfigureEmailForwardParams struct {
+ Domain string `url:"domain"` // Required
+ Email string `url:"email"` // Required
+ Forward1 string `url:"forward1"` // Required
+
+ Forward2 string `url:"forward12"` // Optional
+ Forward3 string `url:"forward13"` // Optional
+ Forward4 string `url:"forward14"` // Optional
+ Forward5 string `url:"forward15"` // Optional
+}
+
+// ContactAddParams Parameters for operation contactAdd.
+type ContactAddParams struct {
+ FirstName string `url:"fn"` // Contact Information
+ LastName string `url:"ln"` // Contact Information
+ MailingAddress string `url:"ad"` // Contact Information
+ MailingCity string `url:"cy"` // Contact Information
+ MailingStateProvinceTerritory string `url:"st"` // Contact Information
+ MailingZipPostalCode string `url:"zp"` // Contact Information
+ MailingCountry string `url:"ct"` // Contact Information
+ EmailAddress string `url:"em"` // Contact Information
+ PhoneNumber string `url:"ph"` // Contact Information
+
+ Company string `url:"cp"` // Contact Information
+ MailingAddress2 string `url:"ad2"` // Contact Information
+ Fax string `url:"fx"` // Contact Information
+
+ USNexusCategory string `url:"usnc"` // Contact Information
+ USApplicationPurpose string `url:"usap"` // Contact Information
+
+ CIRALegalForm string `url:"calf"` // CIRA
+ CIRALanguage string `url:"caln"` // CIRA
+ CIRAAgreementVersion string `url:"caag"` // CIRA
+ CIRAWHOISDisplay string `url:"cawd"` // CIRA
+}
+
+// ContactDeleteParams Parameters for operation contactDelete.
+type ContactDeleteParams struct {
+ ContactID string `url:"contact_id"`
+}
+
+// ContactDomainAssociateParams Parameters for operation contactDomainAssociate.
+type ContactDomainAssociateParams struct {
+ Domain string `url:"domain"` // Required
+
+ Registrant string `url:"registrant"` // Optional
+ Administrative string `url:"administrative"` // Optional
+ Billing string `url:"billing"` // Optional
+ Technical string `url:"technical"` // Optional
+
+ ContactID string `url:"contact_id"` // Contact ID
+}
+
+// ContactListParams Parameters for operation contactList.
+type ContactListParams struct {
+ ContactID string `url:"contact_id"` // Optional
+}
+
+// ContactUpdateParams Parameters for operation contactUpdate.
+type ContactUpdateParams struct {
+ FirstName string `url:"fn"` // Contact Information
+ LastName string `url:"ln"` // Contact Information
+ MailingAddress string `url:"ad"` // Contact Information
+ MailingCity string `url:"cy"` // Contact Information
+ MailingStateProvinceTerritory string `url:"st"` // Contact Information
+ MailingZipPostalCode string `url:"zp"` // Contact Information
+ MailingCountry string `url:"ct"` // Contact Information
+ EmailAddress string `url:"em"` // Contact Information
+ PhoneNumber string `url:"ph"` // Contact Information
+
+ Company string `url:"cp"` // Contact Information
+ MailingAddress2 string `url:"ad2"` // Contact Information
+ Fax string `url:"fx"` // Contact Information
+
+ USNexusCategory string `url:"usnc"` // Contact Information
+ USApplicationPurpose string `url:"usap"` // Contact Information
+
+ CIRALegalForm string `url:"calf"` // CIRA
+ CIRALanguage string `url:"caln"` // CIRA
+ CIRAAgreementVersion string `url:"caag"` // CIRA
+ CIRAWHOISDisplay string `url:"cawd"` // CIRA
+}
+
+// DeleteEmailForwardParams Parameters for operation deleteEmailForward.
+type DeleteEmailForwardParams struct {
+ Domain string `url:"domain"` // Required
+ Email string `url:"email"` // Required
+}
+
+// DeleteRegisteredNameServerParams Parameters for operation deleteRegisteredNameServer.
+type DeleteRegisteredNameServerParams struct {
+ Domain string `url:"domain"` // required
+ CurrentHost string `url:"current_host"` // Required
+}
+
+// DnsAddRecordParams Parameters for operation dnsAddRecord.
+type DnsAddRecordParams struct {
+ Domain string `url:"domain"` // Required
+
+ Type string `url:"rrtype"` // Possible values are "A", "AAAA", "CNAME", "MX" and "TXT"
+ Host string `url:"rrhost"`
+ Value string `url:"rrvalue"`
+ Distance int `url:"rrdistance"`
+ TTL int `url:"rrttl"`
+}
+
+// DnsDeleteRecordParams Parameters for operation dnsDeleteRecord.
+type DnsDeleteRecordParams struct {
+ Domain string `url:"domain"` // Required
+
+ ID string `url:"rrid"`
+}
+
+// DnsListRecordsParams Parameters for operation dnsListRecords.
+type DnsListRecordsParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// DnsSecAddRecordParams Parameters for operation dnsSecAddRecord.
+type DnsSecAddRecordParams struct {
+ Domain string `url:"domain"` // Required
+
+ Digest string `url:"digest"`
+ KeyTag string `url:"keyTag"`
+ DigestType string `url:"digestType"`
+ Alg string `url:"alg"`
+}
+
+// DnsSecDeleteRecordParams Parameters for operation dnsSecDeleteRecord.
+type DnsSecDeleteRecordParams struct {
+ Domain string `url:"domain"` // Required
+
+ Digest string `url:"digest"`
+ KeyTag string `url:"keyTag"`
+ DigestType string `url:"digestType"`
+ Alg string `url:"alg"`
+}
+
+// DnsSecListRecordsParams Parameters for operation dnsSecListRecords.
+type DnsSecListRecordsParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// DnsUpdateRecordParams Parameters for operation dnsUpdateRecord.
+type DnsUpdateRecordParams struct {
+ Domain string `url:"domain"` // Required
+
+ ID string `url:"rrid"`
+ Host string `url:"rrhost"`
+ Value string `url:"rrvalue"`
+ Distance int `url:"rrdistance"`
+ TTL int `url:"rrttl"`
+}
+
+// DomainForwardParams Parameters for operation domainForward.
+type DomainForwardParams struct {
+ Domain string `url:"domain"` // Required
+ Protocol string `url:"protocol"` // Required
+ Address string `url:"address"` // Required
+ Method string `url:"method"` // Required
+
+ MetaTitle string `url:"meta_title"` // Optional
+ MetaDescription string `url:"meta_description"` // Optional
+ MetaKeywords string `url:"meta_keywords"` // Optional
+
+}
+
+// DomainForwardSubDomainParams Parameters for operation domainForwardSubDomain.
+type DomainForwardSubDomainParams struct {
+ Domain string `url:"domain"` // Required
+ SubDomain string `url:"sub_domain"` // Required
+ Protocol string `url:"protocol"` // Required
+ Address string `url:"address"` // Required
+ Method string `url:"method"` // Required
+
+ MetaTitle string `url:"meta_title"` // Optional
+ MetaDescription string `url:"meta_description"` // Optional
+ MetaKeywords string `url:"meta_keywords"` // Optional
+}
+
+// DomainForwardSubDomainDeleteParams Parameters for operation domainForwardSubDomainDelete.
+type DomainForwardSubDomainDeleteParams struct {
+ Domain string `url:"domain"` // Required
+ SubDomain string `url:"sub_domain"` // Required
+}
+
+// DomainLockParams Parameters for operation domainLock.
+type DomainLockParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// DomainUnlockParams Parameters for operation domainUnlock.
+type DomainUnlockParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// EmailVerificationParams Parameters for operation emailVerification.
+type EmailVerificationParams struct {
+ Email string `url:"email"` // Required
+}
+
+// GetAccountBalanceParams Parameters for operation getAccountBalance.
+type GetAccountBalanceParams struct{}
+
+// GetDomainInfoParams Parameters for operation getDomainInfo.
+type GetDomainInfoParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// GetPricesParams Parameters for operation getPrices.
+type GetPricesParams struct {
+ RetailPrices string `url:"retail_prices"` // Required
+ RegistrationDomains string `url:"registration_domains"` // Required
+}
+
+// ListDomainsParams Parameters for operation listDomains.
+type ListDomainsParams struct {
+ Portfolio string `url:"portfolio"` // Optional
+}
+
+// ListEmailForwardsParams Parameters for operation listEmailForwards.
+type ListEmailForwardsParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// ListOrdersParams Parameters for operation listOrders.
+type ListOrdersParams struct{}
+
+// ListRegisteredNameServersParams Parameters for operation listRegisteredNameServers.
+type ListRegisteredNameServersParams struct {
+ Domain string `url:"domain"` // required
+}
+
+// MarketplaceActiveSalesOverviewParams Parameters for operation marketplaceActiveSalesOverview.
+type MarketplaceActiveSalesOverviewParams struct{}
+
+// MarketplaceAddOrModifySaleParams Parameters for operation marketplaceAddOrModifySale.
+type MarketplaceAddOrModifySaleParams struct {
+ Domain string `url:"domain"` // Required
+ Action string `url:"action"` // Required
+ SaleType string `url:"sale_type"` // Required
+
+ Reserve string `url:"reserve"` // Optional
+ ShowReserve int32 `url:"show_reserve"` // Optional
+ BuyNow string `url:"buy_now"` // Optional
+ PaymentPlanOffered int32 `url:"payment_plan_offered"` // Optional
+ PaymentPlanMonths int32 `url:"payment_plan_months"` // Optional
+ PaymentPlanDownPayment string `url:"payment_plan_down_payment"` // Optional
+ EndDate string `url:"end_date"` // Optional
+ EndDateUseMaximum int32 `url:"end_date_use_maximum"` // Optional
+ NotifyBuyers int32 `url:"notify_buyers"` // Optional
+ Category1 string `url:"category1"` // Optional
+ Description string `url:"description"` // Optional
+ UseForSaleLandingPage int32 `url:"use_for_sale_landing_page"` // Optional
+ MpUseOurNameservers int32 `url:"mp_use_our_nameservers"` // Optional
+ Password string `url:"password"` // Optional
+ CancelSale int32 `url:"cancel_sale"` // Optional
+}
+
+// MarketplaceLandingPageUpdateParams Parameters for operation marketplaceLandingPageUpdate.
+type MarketplaceLandingPageUpdateParams struct {
+ Domain string `url:"domain"` // Required
+
+ MpTemplate int32 `url:"mp_template"` // Optional
+ MpBgcolor string `url:"mp_bgcolor"` // Optional
+ MpTextcolor string `url:"mp_textcolor"` // Optional
+ MpShowBuyNow int32 `url:"mp_show_buy_now"` // Optional
+ MpShowMoreInfo int32 `url:"mp_show_more_info"` // Optional
+ MpShowRenewalPrice int32 `url:"mp_show_renewal_price"` // Optional
+ MpShowOtherForSale int32 `url:"mp_show_other_for_sale"` // Optional
+ MpOtherDomainLinks string `url:"mp_other_domain_links"` // Optional
+ MpMessage string `url:"mp_message"` // Optional
+}
+
+// ModifyRegisteredNameServerParams Parameters for operation modifyRegisteredNameServer.
+type ModifyRegisteredNameServerParams struct {
+ Domain string `url:"domain"` // required
+ CurrentHost string `url:"current_host"` // Required
+ NewHost string `url:"new_host"` // Required
+ IP1 string `url:"ip1"` // Required
+
+ IP2 string `url:"ip2"` // Optional
+ IP3 string `url:"ip3"` // Optional
+ IP4 string `url:"ip4"` // Optional
+ IP5 string `url:"ip5"` // Optional
+ IP6 string `url:"ip6"` // Optional
+ IP7 string `url:"ip7"` // Optional
+ IP8 string `url:"ip8"` // Optional
+ IP9 string `url:"ip9"` // Optional
+ IP10 string `url:"ip10"` // Optional
+ IP11 string `url:"ip11"` // Optional
+ IP12 string `url:"ip12"` // Optional
+ IP13 string `url:"ip13"` // Optional
+}
+
+// OrderDetailsParams Parameters for operation orderDetails.
+type OrderDetailsParams struct {
+ OrderNumber int `url:"order_number"`
+}
+
+// PortfolioAddParams Parameters for operation portfolioAdd.
+type PortfolioAddParams struct {
+ Portfolio string `url:"portfolio"` // Required
+}
+
+// PortfolioDeleteParams Parameters for operation portfolioDelete.
+type PortfolioDeleteParams struct {
+ Portfolio string `url:"portfolio"` // Required
+}
+
+// PortfolioDomainAssociateParams Parameters for operation portfolioDomainAssociate.
+type PortfolioDomainAssociateParams struct {
+ Portfolio string `url:"portfolio"` // Required
+ Domains string `url:"domains"` // Required (Comma-delimited list)
+}
+
+// PortfolioListParams Parameters for operation portfolioList.
+type PortfolioListParams struct{}
+
+// RegisterDomainParams Parameters for operation registerDomain.
+type RegisterDomainParams struct {
+ Domain string `url:"domain"` // Required
+ Years int32 `url:"years"` // Required
+
+ PaymentID string `url:"payment_id"` // Optional
+ Private int32 `url:"private"` // Optional
+ AutoRenew int32 `url:"auto_renew"` // Optional
+ Portfolio string `url:"portfolio"` // Optional
+ Coupon string `url:"coupon"` // Optional
+
+ NameServer1 string `url:"ns1"`
+ NameServer2 string `url:"ns2"`
+ NameServer3 string `url:"ns3"`
+ NameServer4 string `url:"ns4"`
+ NameServer5 string `url:"ns5"`
+ NameServer6 string `url:"ns6"`
+ NameServer7 string `url:"ns7"`
+ NameServer8 string `url:"ns8"`
+ NameServer9 string `url:"ns9"`
+ NameServer10 string `url:"ns10"`
+ NameServer11 string `url:"ns11"`
+ NameServer12 string `url:"ns12"`
+ NameServer13 string `url:"ns13"`
+
+ FirstName string `url:"fn"` // Contact Information
+ LastName string `url:"ln"` // Contact Information
+ MailingAddress string `url:"ad"` // Contact Information
+ MailingCity string `url:"cy"` // Contact Information
+ MailingStateProvinceTerritory string `url:"st"` // Contact Information
+ MailingZipPostalCode string `url:"zp"` // Contact Information
+ MailingCountry string `url:"ct"` // Contact Information
+ EmailAddress string `url:"em"` // Contact Information
+ PhoneNumber string `url:"ph"` // Contact Information
+
+ Company string `url:"cp"` // Contact Information
+ MailingAddress2 string `url:"ad2"` // Contact Information
+ Fax string `url:"fx"` // Contact Information
+
+ USNexusCategory string `url:"usnc"` // Contact Information
+ USApplicationPurpose string `url:"usap"` // Contact Information
+
+ ContactID string `url:"contact_id"` // Contact ID
+}
+
+// RegisterDomainDropParams Parameters for operation registerDomainDrop.
+type RegisterDomainDropParams struct {
+ Domain string `url:"domain"` // Required
+ Years int32 `url:"years"` // Required
+
+ Private int32 `url:"private"` // Optional
+ AutoRenew int32 `url:"auto_renew"` // Optional
+}
+
+// RegistrantVerificationStatusParams Parameters for operation registrantVerificationStatus.
+type RegistrantVerificationStatusParams struct{}
+
+// RemoveAutoRenewalParams Parameters for operation removeAutoRenewal.
+type RemoveAutoRenewalParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// RemovePrivacyParams Parameters for operation removePrivacy.
+type RemovePrivacyParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// RenewDomainParams Parameters for operation renewDomain.
+type RenewDomainParams struct {
+ Domain string `url:"domain"` // Required
+ Years int32 `url:"years"` // Required
+
+ PaymentID string `url:"payment_id"` // Optional
+ Coupon string `url:"coupon"` // Optional
+}
+
+// RetrieveAuthCodeParams Parameters for operation retrieveAuthCode.
+type RetrieveAuthCodeParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// TransferDomainParams Parameters for operation transferDomain.
+type TransferDomainParams struct {
+ Domain string `url:"domain"` // Required
+
+ PaymentID string `url:"payment_id"` // Optional
+ Auth string `url:"auth"` // Optional
+ Private int32 `url:"private"` // Optional
+ AutoRenew int32 `url:"auto_renew"` // Optional
+ Portfolio string `url:"portfolio"` // Optional
+ Coupon string `url:"coupon"` // Optional
+
+ FirstName string `url:"fn"` // Contact Information
+ LastName string `url:"ln"` // Contact Information
+ MailingAddress string `url:"ad"` // Contact Information
+ MailingCity string `url:"cy"` // Contact Information
+ MailingStateProvinceTerritory string `url:"st"` // Contact Information
+ MailingZipPostalCode string `url:"zp"` // Contact Information
+ MailingCountry string `url:"ct"` // Contact Information
+ EmailAddress string `url:"em"` // Contact Information
+ PhoneNumber string `url:"ph"` // Contact Information
+
+ Company string `url:"cp"` // Contact Information
+ MailingAddress2 string `url:"ad2"` // Contact Information
+ Fax string `url:"fx"` // Contact Information
+
+ USNexusCategory string `url:"usnc"` // Contact Information
+ USApplicationPurpose string `url:"usap"` // Contact Information
+
+ ContactID string `url:"contact_id"` // Contact ID
+}
+
+// TransferUpdateChangeEPPCodeParams Parameters for operation transferUpdateChangeEPPCode.
+type TransferUpdateChangeEPPCodeParams struct {
+ Domain string `url:"domain"` // Required
+ Auth string `url:"auth"` // Required
+}
+
+// TransferUpdateResendAdminEmailParams Parameters for operation transferUpdateResendAdminEmail.
+type TransferUpdateResendAdminEmailParams struct {
+ Domain string `url:"domain"` // Required
+}
+
+// TransferUpdateResubmitToRegistryParams Parameters for operation transferUpdateResubmitToRegistry.
+type TransferUpdateResubmitToRegistryParams struct {
+ Domain string `url:"domain"` // Required
+}
diff --git a/vendor/github.com/nrdcg/namesilo/zz_gen_client.go b/vendor/github.com/nrdcg/namesilo/zz_gen_client.go
new file mode 100644
index 000000000..efb77731d
--- /dev/null
+++ b/vendor/github.com/nrdcg/namesilo/zz_gen_client.go
@@ -0,0 +1,2192 @@
+package namesilo
+
+import (
+ "encoding/xml"
+ "fmt"
+ "io/ioutil"
+ "net/http"
+)
+
+// AddAccountFunds Execute operation addAccountFunds.
+func (c *Client) AddAccountFunds(params *AddAccountFundsParams) (*AddAccountFunds, error) {
+ resp, err := c.get("addAccountFunds", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &AddAccountFunds{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// AddAutoRenewal Execute operation addAutoRenewal.
+func (c *Client) AddAutoRenewal(params *AddAutoRenewalParams) (*AddAutoRenewal, error) {
+ resp, err := c.get("addAutoRenewal", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &AddAutoRenewal{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// AddPrivacy Execute operation addPrivacy.
+func (c *Client) AddPrivacy(params *AddPrivacyParams) (*AddPrivacy, error) {
+ resp, err := c.get("addPrivacy", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &AddPrivacy{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// AddRegisteredNameServer Execute operation addRegisteredNameServer.
+func (c *Client) AddRegisteredNameServer(params *AddRegisteredNameServerParams) (*AddRegisteredNameServer, error) {
+ resp, err := c.get("addRegisteredNameServer", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &AddRegisteredNameServer{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ChangeNameServers Execute operation changeNameServers.
+func (c *Client) ChangeNameServers(params *ChangeNameServersParams) (*ChangeNameServers, error) {
+ resp, err := c.get("changeNameServers", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ChangeNameServers{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// CheckRegisterAvailability Execute operation checkRegisterAvailability.
+func (c *Client) CheckRegisterAvailability(params *CheckRegisterAvailabilityParams) (*CheckRegisterAvailability, error) {
+ resp, err := c.get("checkRegisterAvailability", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &CheckRegisterAvailability{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// CheckTransferAvailability Execute operation checkTransferAvailability.
+func (c *Client) CheckTransferAvailability(params *CheckTransferAvailabilityParams) (*CheckTransferAvailability, error) {
+ resp, err := c.get("checkTransferAvailability", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &CheckTransferAvailability{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// CheckTransferStatus Execute operation checkTransferStatus.
+func (c *Client) CheckTransferStatus(params *CheckTransferStatusParams) (*CheckTransferStatus, error) {
+ resp, err := c.get("checkTransferStatus", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &CheckTransferStatus{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ConfigureEmailForward Execute operation configureEmailForward.
+func (c *Client) ConfigureEmailForward(params *ConfigureEmailForwardParams) (*ConfigureEmailForward, error) {
+ resp, err := c.get("configureEmailForward", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ConfigureEmailForward{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ContactAdd Execute operation contactAdd.
+func (c *Client) ContactAdd(params *ContactAddParams) (*ContactAdd, error) {
+ resp, err := c.get("contactAdd", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ContactAdd{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ContactDelete Execute operation contactDelete.
+func (c *Client) ContactDelete(params *ContactDeleteParams) (*ContactDelete, error) {
+ resp, err := c.get("contactDelete", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ContactDelete{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ContactDomainAssociate Execute operation contactDomainAssociate.
+func (c *Client) ContactDomainAssociate(params *ContactDomainAssociateParams) (*ContactDomainAssociate, error) {
+ resp, err := c.get("contactDomainAssociate", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ContactDomainAssociate{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ContactList Execute operation contactList.
+func (c *Client) ContactList(params *ContactListParams) (*ContactList, error) {
+ resp, err := c.get("contactList", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ContactList{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ContactUpdate Execute operation contactUpdate.
+func (c *Client) ContactUpdate(params *ContactUpdateParams) (*ContactUpdate, error) {
+ resp, err := c.get("contactUpdate", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ContactUpdate{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DeleteEmailForward Execute operation deleteEmailForward.
+func (c *Client) DeleteEmailForward(params *DeleteEmailForwardParams) (*DeleteEmailForward, error) {
+ resp, err := c.get("deleteEmailForward", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DeleteEmailForward{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DeleteRegisteredNameServer Execute operation deleteRegisteredNameServer.
+func (c *Client) DeleteRegisteredNameServer(params *DeleteRegisteredNameServerParams) (*DeleteRegisteredNameServer, error) {
+ resp, err := c.get("deleteRegisteredNameServer", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DeleteRegisteredNameServer{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsAddRecord Execute operation dnsAddRecord.
+func (c *Client) DnsAddRecord(params *DnsAddRecordParams) (*DnsAddRecord, error) {
+ resp, err := c.get("dnsAddRecord", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsAddRecord{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsDeleteRecord Execute operation dnsDeleteRecord.
+func (c *Client) DnsDeleteRecord(params *DnsDeleteRecordParams) (*DnsDeleteRecord, error) {
+ resp, err := c.get("dnsDeleteRecord", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsDeleteRecord{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsListRecords Execute operation dnsListRecords.
+func (c *Client) DnsListRecords(params *DnsListRecordsParams) (*DnsListRecords, error) {
+ resp, err := c.get("dnsListRecords", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsListRecords{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsSecAddRecord Execute operation dnsSecAddRecord.
+func (c *Client) DnsSecAddRecord(params *DnsSecAddRecordParams) (*DnsSecAddRecord, error) {
+ resp, err := c.get("dnsSecAddRecord", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsSecAddRecord{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsSecDeleteRecord Execute operation dnsSecDeleteRecord.
+func (c *Client) DnsSecDeleteRecord(params *DnsSecDeleteRecordParams) (*DnsSecDeleteRecord, error) {
+ resp, err := c.get("dnsSecDeleteRecord", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsSecDeleteRecord{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsSecListRecords Execute operation dnsSecListRecords.
+func (c *Client) DnsSecListRecords(params *DnsSecListRecordsParams) (*DnsSecListRecords, error) {
+ resp, err := c.get("dnsSecListRecords", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsSecListRecords{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DnsUpdateRecord Execute operation dnsUpdateRecord.
+func (c *Client) DnsUpdateRecord(params *DnsUpdateRecordParams) (*DnsUpdateRecord, error) {
+ resp, err := c.get("dnsUpdateRecord", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DnsUpdateRecord{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DomainForward Execute operation domainForward.
+func (c *Client) DomainForward(params *DomainForwardParams) (*DomainForward, error) {
+ resp, err := c.get("domainForward", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DomainForward{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DomainForwardSubDomain Execute operation domainForwardSubDomain.
+func (c *Client) DomainForwardSubDomain(params *DomainForwardSubDomainParams) (*DomainForwardSubDomain, error) {
+ resp, err := c.get("domainForwardSubDomain", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DomainForwardSubDomain{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DomainForwardSubDomainDelete Execute operation domainForwardSubDomainDelete.
+func (c *Client) DomainForwardSubDomainDelete(params *DomainForwardSubDomainDeleteParams) (*DomainForwardSubDomainDelete, error) {
+ resp, err := c.get("domainForwardSubDomainDelete", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DomainForwardSubDomainDelete{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DomainLock Execute operation domainLock.
+func (c *Client) DomainLock(params *DomainLockParams) (*DomainLock, error) {
+ resp, err := c.get("domainLock", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DomainLock{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// DomainUnlock Execute operation domainUnlock.
+func (c *Client) DomainUnlock(params *DomainUnlockParams) (*DomainUnlock, error) {
+ resp, err := c.get("domainUnlock", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &DomainUnlock{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// EmailVerification Execute operation emailVerification.
+func (c *Client) EmailVerification(params *EmailVerificationParams) (*EmailVerification, error) {
+ resp, err := c.get("emailVerification", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &EmailVerification{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// GetAccountBalance Execute operation getAccountBalance.
+func (c *Client) GetAccountBalance(params *GetAccountBalanceParams) (*GetAccountBalance, error) {
+ resp, err := c.get("getAccountBalance", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &GetAccountBalance{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// GetDomainInfo Execute operation getDomainInfo.
+func (c *Client) GetDomainInfo(params *GetDomainInfoParams) (*GetDomainInfo, error) {
+ resp, err := c.get("getDomainInfo", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &GetDomainInfo{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// GetPrices Execute operation getPrices.
+func (c *Client) GetPrices(params *GetPricesParams) (*GetPrices, error) {
+ resp, err := c.get("getPrices", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &GetPrices{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ListDomains Execute operation listDomains.
+func (c *Client) ListDomains(params *ListDomainsParams) (*ListDomains, error) {
+ resp, err := c.get("listDomains", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ListDomains{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ListEmailForwards Execute operation listEmailForwards.
+func (c *Client) ListEmailForwards(params *ListEmailForwardsParams) (*ListEmailForwards, error) {
+ resp, err := c.get("listEmailForwards", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ListEmailForwards{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ListOrders Execute operation listOrders.
+func (c *Client) ListOrders(params *ListOrdersParams) (*ListOrders, error) {
+ resp, err := c.get("listOrders", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ListOrders{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ListRegisteredNameServers Execute operation listRegisteredNameServers.
+func (c *Client) ListRegisteredNameServers(params *ListRegisteredNameServersParams) (*ListRegisteredNameServers, error) {
+ resp, err := c.get("listRegisteredNameServers", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ListRegisteredNameServers{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// MarketplaceActiveSalesOverview Execute operation marketplaceActiveSalesOverview.
+func (c *Client) MarketplaceActiveSalesOverview(params *MarketplaceActiveSalesOverviewParams) (*MarketplaceActiveSalesOverview, error) {
+ resp, err := c.get("marketplaceActiveSalesOverview", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &MarketplaceActiveSalesOverview{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// MarketplaceAddOrModifySale Execute operation marketplaceAddOrModifySale.
+func (c *Client) MarketplaceAddOrModifySale(params *MarketplaceAddOrModifySaleParams) (*MarketplaceAddOrModifySale, error) {
+ resp, err := c.get("marketplaceAddOrModifySale", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &MarketplaceAddOrModifySale{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// MarketplaceLandingPageUpdate Execute operation marketplaceLandingPageUpdate.
+func (c *Client) MarketplaceLandingPageUpdate(params *MarketplaceLandingPageUpdateParams) (*MarketplaceLandingPageUpdate, error) {
+ resp, err := c.get("marketplaceLandingPageUpdate", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &MarketplaceLandingPageUpdate{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// ModifyRegisteredNameServer Execute operation modifyRegisteredNameServer.
+func (c *Client) ModifyRegisteredNameServer(params *ModifyRegisteredNameServerParams) (*ModifyRegisteredNameServer, error) {
+ resp, err := c.get("modifyRegisteredNameServer", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &ModifyRegisteredNameServer{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// OrderDetails Execute operation orderDetails.
+func (c *Client) OrderDetails(params *OrderDetailsParams) (*OrderDetails, error) {
+ resp, err := c.get("orderDetails", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &OrderDetails{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// PortfolioAdd Execute operation portfolioAdd.
+func (c *Client) PortfolioAdd(params *PortfolioAddParams) (*PortfolioAdd, error) {
+ resp, err := c.get("portfolioAdd", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &PortfolioAdd{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// PortfolioDelete Execute operation portfolioDelete.
+func (c *Client) PortfolioDelete(params *PortfolioDeleteParams) (*PortfolioDelete, error) {
+ resp, err := c.get("portfolioDelete", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &PortfolioDelete{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// PortfolioDomainAssociate Execute operation portfolioDomainAssociate.
+func (c *Client) PortfolioDomainAssociate(params *PortfolioDomainAssociateParams) (*PortfolioDomainAssociate, error) {
+ resp, err := c.get("portfolioDomainAssociate", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &PortfolioDomainAssociate{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// PortfolioList Execute operation portfolioList.
+func (c *Client) PortfolioList(params *PortfolioListParams) (*PortfolioList, error) {
+ resp, err := c.get("portfolioList", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &PortfolioList{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RegisterDomain Execute operation registerDomain.
+func (c *Client) RegisterDomain(params *RegisterDomainParams) (*RegisterDomain, error) {
+ resp, err := c.get("registerDomain", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RegisterDomain{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RegisterDomainDrop Execute operation registerDomainDrop.
+func (c *Client) RegisterDomainDrop(params *RegisterDomainDropParams) (*RegisterDomainDrop, error) {
+ resp, err := c.get("registerDomainDrop", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RegisterDomainDrop{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RegistrantVerificationStatus Execute operation registrantVerificationStatus.
+func (c *Client) RegistrantVerificationStatus(params *RegistrantVerificationStatusParams) (*RegistrantVerificationStatus, error) {
+ resp, err := c.get("registrantVerificationStatus", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RegistrantVerificationStatus{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RemoveAutoRenewal Execute operation removeAutoRenewal.
+func (c *Client) RemoveAutoRenewal(params *RemoveAutoRenewalParams) (*RemoveAutoRenewal, error) {
+ resp, err := c.get("removeAutoRenewal", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RemoveAutoRenewal{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RemovePrivacy Execute operation removePrivacy.
+func (c *Client) RemovePrivacy(params *RemovePrivacyParams) (*RemovePrivacy, error) {
+ resp, err := c.get("removePrivacy", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RemovePrivacy{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RenewDomain Execute operation renewDomain.
+func (c *Client) RenewDomain(params *RenewDomainParams) (*RenewDomain, error) {
+ resp, err := c.get("renewDomain", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RenewDomain{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// RetrieveAuthCode Execute operation retrieveAuthCode.
+func (c *Client) RetrieveAuthCode(params *RetrieveAuthCodeParams) (*RetrieveAuthCode, error) {
+ resp, err := c.get("retrieveAuthCode", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &RetrieveAuthCode{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// TransferDomain Execute operation transferDomain.
+func (c *Client) TransferDomain(params *TransferDomainParams) (*TransferDomain, error) {
+ resp, err := c.get("transferDomain", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &TransferDomain{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// TransferUpdateChangeEPPCode Execute operation transferUpdateChangeEPPCode.
+func (c *Client) TransferUpdateChangeEPPCode(params *TransferUpdateChangeEPPCodeParams) (*TransferUpdateChangeEPPCode, error) {
+ resp, err := c.get("transferUpdateChangeEPPCode", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &TransferUpdateChangeEPPCode{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// TransferUpdateResendAdminEmail Execute operation transferUpdateResendAdminEmail.
+func (c *Client) TransferUpdateResendAdminEmail(params *TransferUpdateResendAdminEmailParams) (*TransferUpdateResendAdminEmail, error) {
+ resp, err := c.get("transferUpdateResendAdminEmail", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &TransferUpdateResendAdminEmail{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
+
+// TransferUpdateResubmitToRegistry Execute operation transferUpdateResubmitToRegistry.
+func (c *Client) TransferUpdateResubmitToRegistry(params *TransferUpdateResubmitToRegistryParams) (*TransferUpdateResubmitToRegistry, error) {
+ resp, err := c.get("transferUpdateResubmitToRegistry", params)
+ if err != nil {
+ return nil, err
+ }
+ defer func() { _ = resp.Body.Close() }()
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, fmt.Errorf("error: HTTP status code %v", resp.StatusCode)
+ }
+
+ bytes, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, err
+ }
+
+ op := &TransferUpdateResubmitToRegistry{}
+ err = xml.Unmarshal(bytes, op)
+ if err != nil {
+ return nil, fmt.Errorf("failed to decode: %v: %s", err, bytes)
+ }
+
+ switch op.Reply.Code {
+ case SuccessfulAPIOperation:
+ // Successful API operation
+ return op, nil
+ case SuccessfulRegistration:
+ // Successful registration, but not all provided hosts were valid resulting in our nameservers being used
+ return op, nil
+ case SuccessfulOrder:
+ // Successful order, but there was an error with the contact information provided so your account default contact profile was used
+ return op, nil
+ default:
+ // error
+ return op, fmt.Errorf("code: %s, details: %s", op.Reply.Code, op.Reply.Detail)
+ }
+}
diff --git a/vendor/github.com/oracle/oci-go-sdk/common/common.go b/vendor/github.com/oracle/oci-go-sdk/common/common.go
index 897c0d9fd..2f686b14b 100644
--- a/vendor/github.com/oracle/oci-go-sdk/common/common.go
+++ b/vendor/github.com/oracle/oci-go-sdk/common/common.go
@@ -24,6 +24,10 @@ const (
RegionFRA Region = "eu-frankfurt-1"
//RegionLHR region LHR
RegionLHR Region = "uk-london-1"
+ //RegionAPTokyo1 region for tokyo
+ RegionAPTokyo1 Region = "ap-tokyo-1"
+ //RegionAPSeoul1 region for seoul
+ RegionAPSeoul1 Region = "ap-seoul-1"
//RegionUSLangley1 region for langley
RegionUSLangley1 Region = "us-langley-1"
@@ -50,10 +54,11 @@ var regionRealm = map[Region]string{
RegionFRA: "oc1",
RegionLHR: "oc1",
RegionCAToronto1: "oc1",
+ RegionAPTokyo1: "oc1",
+ RegionAPSeoul1: "oc1",
- RegionUSLangley1: "oc2",
- RegionUSLuke1: "oc2",
-
+ RegionUSLangley1: "oc2",
+ RegionUSLuke1: "oc2",
RegionUSGovAshburn1: "oc3",
RegionUSGovChicago1: "oc3",
RegionUSGovPhoenix1: "oc3",
@@ -108,6 +113,10 @@ func StringToRegion(stringRegion string) (r Region) {
r = RegionFRA
case "lhr", "uk-london-1":
r = RegionLHR
+ case "ap-tokyo-1":
+ r = RegionAPTokyo1
+ case "ap-seoul-1":
+ r = RegionAPSeoul1
case "us-langley-1":
r = RegionUSLangley1
case "us-luke-1":
diff --git a/vendor/github.com/oracle/oci-go-sdk/common/configuration.go b/vendor/github.com/oracle/oci-go-sdk/common/configuration.go
index 8d0770857..58c6b33df 100644
--- a/vendor/github.com/oracle/oci-go-sdk/common/configuration.go
+++ b/vendor/github.com/oracle/oci-go-sdk/common/configuration.go
@@ -51,7 +51,7 @@ type rawConfigurationProvider struct {
privateKeyPassphrase *string
}
-// NewRawConfigurationProvider will create a rawConfigurationProvider
+// NewRawConfigurationProvider will create a ConfigurationProvider with the arguments of the function
func NewRawConfigurationProvider(tenancy, user, region, fingerprint, privateKey string, privateKeyPassphrase *string) ConfigurationProvider {
return rawConfigurationProvider{tenancy, user, region, fingerprint, privateKey, privateKeyPassphrase}
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/common/errors.go b/vendor/github.com/oracle/oci-go-sdk/common/errors.go
index f50766f08..d2f71d78c 100644
--- a/vendor/github.com/oracle/oci-go-sdk/common/errors.go
+++ b/vendor/github.com/oracle/oci-go-sdk/common/errors.go
@@ -18,7 +18,7 @@ type ServiceError interface {
GetMessage() string
// A short error code that defines the error, meant for programmatic parsing.
- // See https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm
+ // See https://docs.cloud.oracle.com/Content/API/References/apierrors.htm
GetCode() string
// Unique Oracle-assigned identifier for the request.
diff --git a/vendor/github.com/oracle/oci-go-sdk/common/http.go b/vendor/github.com/oracle/oci-go-sdk/common/http.go
index 29aab0c38..4087ce180 100644
--- a/vendor/github.com/oracle/oci-go-sdk/common/http.go
+++ b/vendor/github.com/oracle/oci-go-sdk/common/http.go
@@ -66,10 +66,15 @@ func toStringValue(v reflect.Value, field reflect.StructField) (string, error) {
}
}
-func addBinaryBody(request *http.Request, value reflect.Value) (e error) {
+func addBinaryBody(request *http.Request, value reflect.Value, field reflect.StructField) (e error) {
readCloser, ok := value.Interface().(io.ReadCloser)
- if !ok {
- e = fmt.Errorf("body of the request needs to be an io.ReadCloser interface. Can not marshal body of binary request")
+ isMandatory, err := strconv.ParseBool(field.Tag.Get("mandatory"))
+ if err != nil {
+ return fmt.Errorf("mandatory tag is not valid for field %s", field.Name)
+ }
+
+ if isMandatory && !ok {
+ e = fmt.Errorf("body of the request is mandatory and needs to be an io.ReadCloser interface. Can not marshal body of binary request")
return
}
@@ -252,7 +257,7 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF
encoding := tag.Get("encoding")
if encoding == "binary" {
- return addBinaryBody(request, value)
+ return addBinaryBody(request, value, field)
}
rawJSON, e := json.Marshal(value.Interface())
@@ -263,6 +268,11 @@ func addToBody(request *http.Request, value reflect.Value, field reflect.StructF
if e != nil {
return
}
+
+ if defaultLogger.LogLevel() == verboseLogging {
+ Debugf("Marshaled body is: %s\n", string(marshaled))
+ }
+
bodyBytes := bytes.NewReader(marshaled)
request.ContentLength = int64(bodyBytes.Len())
request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10))
diff --git a/vendor/github.com/oracle/oci-go-sdk/common/version.go b/vendor/github.com/oracle/oci-go-sdk/common/version.go
index dcc48683f..5c92ec83b 100644
--- a/vendor/github.com/oracle/oci-go-sdk/common/version.go
+++ b/vendor/github.com/oracle/oci-go-sdk/common/version.go
@@ -10,8 +10,8 @@ import (
)
const (
- major = "4"
- minor = "1"
+ major = "5"
+ minor = "15"
patch = "0"
tag = ""
)
@@ -26,7 +26,7 @@ func Version() string {
verBuilder := bytes.NewBufferString(ver)
if tag != "" && tag != "-" {
_, err := verBuilder.WriteString(tag)
- if err == nil {
+ if err != nil {
verBuilder = bytes.NewBufferString(ver)
}
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_details.go
new file mode 100644
index 000000000..0fb5486c4
--- /dev/null
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_details.go
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+// Code generated. DO NOT EDIT.
+
+// DNS API
+//
+// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+//
+
+package dns
+
+import (
+ "github.com/oracle/oci-go-sdk/common"
+)
+
+// ChangeSteeringPolicyCompartmentDetails The representation of ChangeSteeringPolicyCompartmentDetails
+type ChangeSteeringPolicyCompartmentDetails struct {
+
+ // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment
+ // into which the steering policy should be moved.
+ CompartmentId *string `mandatory:"true" json:"compartmentId"`
+}
+
+func (m ChangeSteeringPolicyCompartmentDetails) String() string {
+ return common.PointerString(m)
+}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_request_response.go
new file mode 100644
index 000000000..66e6fc876
--- /dev/null
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/change_steering_policy_compartment_request_response.go
@@ -0,0 +1,77 @@
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+// Code generated. DO NOT EDIT.
+
+package dns
+
+import (
+ "github.com/oracle/oci-go-sdk/common"
+ "net/http"
+)
+
+// ChangeSteeringPolicyCompartmentRequest wrapper for the ChangeSteeringPolicyCompartment operation
+type ChangeSteeringPolicyCompartmentRequest struct {
+
+ // The OCID of the target steering policy.
+ SteeringPolicyId *string `mandatory:"true" contributesTo:"path" name:"steeringPolicyId"`
+
+ // Details for moving a steering policy into a different compartment.
+ ChangeSteeringPolicyCompartmentDetails `contributesTo:"body"`
+
+ // The `If-Match` header field makes the request method conditional on the
+ // existence of at least one current representation of the target resource,
+ // when the field-value is `*`, or having a current representation of the
+ // target resource that has an entity-tag matching a member of the list of
+ // entity-tags provided in the field-value.
+ IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"`
+
+ // A token that uniquely identifies a request so it can be retried in case
+ // of a timeout or server error without risk of executing that same action
+ // again. Retry tokens expire after 24 hours, but can be invalidated before
+ // then due to conflicting operations (for example, if a resource has been
+ // deleted and purged from the system, then a retry of the original creation
+ // request may be rejected).
+ OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
+
+ // Unique Oracle-assigned identifier for the request.
+ // If you need to contact Oracle about a particular request, please provide the request ID.
+ OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
+
+ // Metadata about the request. This information will not be transmitted to the service, but
+ // represents information that the SDK will consume to drive retry behavior.
+ RequestMetadata common.RequestMetadata
+}
+
+func (request ChangeSteeringPolicyCompartmentRequest) String() string {
+ return common.PointerString(request)
+}
+
+// HTTPRequest implements the OCIRequest interface
+func (request ChangeSteeringPolicyCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) {
+ return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
+}
+
+// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
+func (request ChangeSteeringPolicyCompartmentRequest) RetryPolicy() *common.RetryPolicy {
+ return request.RequestMetadata.RetryPolicy
+}
+
+// ChangeSteeringPolicyCompartmentResponse wrapper for the ChangeSteeringPolicyCompartment operation
+type ChangeSteeringPolicyCompartmentResponse struct {
+
+ // The underlying http response
+ RawResponse *http.Response
+
+ // Unique Oracle-assigned identifier for the request. If you need
+ // to contact Oracle about a particular request, please provide
+ // the request ID.
+ OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
+}
+
+func (response ChangeSteeringPolicyCompartmentResponse) String() string {
+ return common.PointerString(response)
+}
+
+// HTTPResponse implements the OCIResponse interface
+func (response ChangeSteeringPolicyCompartmentResponse) HTTPResponse() *http.Response {
+ return response.RawResponse
+}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_details.go
new file mode 100644
index 000000000..be249b7e0
--- /dev/null
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_details.go
@@ -0,0 +1,26 @@
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+// Code generated. DO NOT EDIT.
+
+// DNS API
+//
+// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+//
+
+package dns
+
+import (
+ "github.com/oracle/oci-go-sdk/common"
+)
+
+// ChangeZoneCompartmentDetails The representation of ChangeZoneCompartmentDetails
+type ChangeZoneCompartmentDetails struct {
+
+ // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment
+ // into which the zone should be moved.
+ CompartmentId *string `mandatory:"true" json:"compartmentId"`
+}
+
+func (m ChangeZoneCompartmentDetails) String() string {
+ return common.PointerString(m)
+}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_request_response.go
new file mode 100644
index 000000000..e8b8767be
--- /dev/null
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/change_zone_compartment_request_response.go
@@ -0,0 +1,77 @@
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
+// Code generated. DO NOT EDIT.
+
+package dns
+
+import (
+ "github.com/oracle/oci-go-sdk/common"
+ "net/http"
+)
+
+// ChangeZoneCompartmentRequest wrapper for the ChangeZoneCompartment operation
+type ChangeZoneCompartmentRequest struct {
+
+ // The OCID of the target zone.
+ ZoneId *string `mandatory:"true" contributesTo:"path" name:"zoneId"`
+
+ // Details for moving a zone into a different compartment.
+ ChangeZoneCompartmentDetails `contributesTo:"body"`
+
+ // The `If-Match` header field makes the request method conditional on the
+ // existence of at least one current representation of the target resource,
+ // when the field-value is `*`, or having a current representation of the
+ // target resource that has an entity-tag matching a member of the list of
+ // entity-tags provided in the field-value.
+ IfMatch *string `mandatory:"false" contributesTo:"header" name:"If-Match"`
+
+ // A token that uniquely identifies a request so it can be retried in case
+ // of a timeout or server error without risk of executing that same action
+ // again. Retry tokens expire after 24 hours, but can be invalidated before
+ // then due to conflicting operations (for example, if a resource has been
+ // deleted and purged from the system, then a retry of the original creation
+ // request may be rejected).
+ OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"`
+
+ // Unique Oracle-assigned identifier for the request.
+ // If you need to contact Oracle about a particular request, please provide the request ID.
+ OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`
+
+ // Metadata about the request. This information will not be transmitted to the service, but
+ // represents information that the SDK will consume to drive retry behavior.
+ RequestMetadata common.RequestMetadata
+}
+
+func (request ChangeZoneCompartmentRequest) String() string {
+ return common.PointerString(request)
+}
+
+// HTTPRequest implements the OCIRequest interface
+func (request ChangeZoneCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) {
+ return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request)
+}
+
+// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
+func (request ChangeZoneCompartmentRequest) RetryPolicy() *common.RetryPolicy {
+ return request.RequestMetadata.RetryPolicy
+}
+
+// ChangeZoneCompartmentResponse wrapper for the ChangeZoneCompartment operation
+type ChangeZoneCompartmentResponse struct {
+
+ // The underlying http response
+ RawResponse *http.Response
+
+ // Unique Oracle-assigned identifier for the request. If you need
+ // to contact Oracle about a particular request, please provide
+ // the request ID.
+ OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
+}
+
+func (response ChangeZoneCompartmentResponse) String() string {
+ return common.PointerString(response)
+}
+
+// HTTPResponse implements the OCIResponse interface
+func (response ChangeZoneCompartmentResponse) HTTPResponse() *http.Response {
+ return response.RawResponse
+}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go
index a79c4316b..c600d9ab8 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,12 +14,8 @@ import (
)
// CreateSteeringPolicyAttachmentDetails The body for defining an attachment between a steering policy and a domain.
-// An attachment occludes all records at its domain that are of a covered rtype, constructing
-// DNS responses from its steering policy rather than from those domain records.
-// The attachment will cover every rtype that matches the rtype of an answer in its policy, and
-// will cover all address rtypes (e.g., A and AAAA) if the policy includes at least one CNAME
-// answer.
-// A domain can have at most one attachment covering any given rtype.
+//
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type CreateSteeringPolicyAttachmentDetails struct {
// The OCID of the attached steering policy.
@@ -32,7 +28,7 @@ type CreateSteeringPolicyAttachmentDetails struct {
DomainName *string `mandatory:"true" json:"domainName"`
// A user-friendly name for the steering policy attachment.
- // Does not have to be unique, and it's changeable.
+ // Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go
index 0a232d939..1c97aa912 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_attachment_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go
index 5da035ca6..f7d6ff8dc 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,82 +15,81 @@ import (
)
// CreateSteeringPolicyDetails The body for defining a new steering policy.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type CreateSteeringPolicyDetails struct {
// The OCID of the compartment containing the steering policy.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
- // A user-friendly name for the steering policy.
- // Does not have to be unique, and it's changeable.
+ // A user-friendly name for the steering policy. Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"true" json:"displayName"`
- // The common pattern (or lack thereof) to which the steering policy adheres. This
- // value restricts the possible configurations of rules, but thereby supports
- // specifically tailored interfaces. Values other than "CUSTOM" require the rules to
- // begin with an unconditional FILTER that keeps answers contingent upon
- // `answer.isDisabled != true`, followed
- // _if and only if the policy references a health check monitor_ by an unconditional
- // HEALTH rule, and require the last rule to be an unconditional LIMIT.
- // What must precede the LIMIT rule is determined by the template value:
- // - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
- // Each answer pool must have a unique priority value assigned to it. Answer data must
- // be defined in the `defaultAnswerData` property for the rule and the `cases` property
- // must not be defined.
- // - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
- // by name. Answer data must be defined in the `defaultAnswerData` property for the
- // rule and the `cases` property must not be defined.
- // - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
- // geographical location of the client as a condition. Within that rule you may only
- // use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
- // ASN of the client as a condition. Within that rule you may only use
- // `query.client.asn` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
- // IP subnet of the client as a condition. Within that rule you may only use
- // `query.client.address` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - CUSTOM allows an arbitrary configuration of rules.
- // For an existing steering policy, the template value may be changed to any of the
- // supported options but the resulting policy must conform to the requirements for the
- // new template type or else a Bad Request error will be returned.
+ // A set of predefined rules based on the desired purpose of the steering policy. Each
+ // template utilizes Traffic Management's rules in a different order to produce the desired
+ // results when answering DNS queries.
+ //
+ // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers
+ // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`,
+ // and `LIMIT`. This gives the domain dynamic failover capability.
+ //
+ // It is **strongly recommended** to use a template other than `CUSTOM` when creating
+ // a steering policy.
+ //
+ // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps
+ // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined
+ // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`.
+ // The last rule of a template must must be a `LIMIT` rule. For more information about templates
+ // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
+ // **Template Types**
+ // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers
+ // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed
+ // from the list of available answers until the endpoint is detected as healthy.
+ //
+ // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights.
+ //
+ // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic
+ // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm).
+ //
+ // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN.
+ //
+ // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address.
+ //
+ // * `CUSTOM` - Allows a customized configuration of rules.
Template CreateSteeringPolicyDetailsTemplateEnum `mandatory:"true" json:"template"`
- // The Time To Live for responses from the steering policy, in seconds.
+ // The Time To Live (TTL) for responses from the steering policy, in seconds.
// If not specified during creation, a value of 30 seconds will be used.
Ttl *int `mandatory:"false" json:"ttl"`
// The OCID of the health check monitor providing health data about the answers of the
- // steering policy.
- // A steering policy answer with `rdata` matching a monitored endpoint will use the health
- // data of that endpoint.
- // A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
- // healthy.
+ // steering policy. A steering policy answer with `rdata` matching a monitored endpoint
+ // will use the health data of that endpoint. A steering policy answer with `rdata` not
+ // matching any monitored endpoint will be assumed healthy.
+ //
+ // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor
+ // must be created using the Health Checks service first. For more information on how to
+ // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm).
HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The set of all answers that can potentially issue from the steering policy.
Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"`
- // The pipeline of rules that will be processed in sequence to reduce the pool of answers
+ // The series of rules that will be processed in sequence to reduce the pool of answers
// to a response for any given request.
+ //
// The first rule receives a shuffled list of all answers, and every other rule receives
// the list of answers emitted by the one preceding it. The last rule populates the
// response.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go
index 18a217d64..9f5cfc271 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_steering_policy_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go
index dc9c878c1..b0429eac8 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,7 +14,7 @@ import (
)
// CreateZoneDetails The body for defining a new zone.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type CreateZoneDetails struct {
// The name of the zone.
@@ -26,13 +26,16 @@ type CreateZoneDetails struct {
// The OCID of the compartment containing the zone.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// External master servers for the zone. `externalMasters` becomes a
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go
index 480f46e93..00a9f7f12 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/create_zone_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go
index 4f96cfc1c..341534951 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/delete_domain_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go
index 4f9a4f243..dd1668582 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/delete_r_r_set_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go
index 5b6befe4d..5ff2ca9cd 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_attachment_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go
index 67ce75ef5..9b61fd0eb 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/delete_steering_policy_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go
index 6583fcc9f..06ddf2797 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/delete_zone_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go b/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go
index 85a013bc9..25ba2c544 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/dns_client.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -38,7 +38,7 @@ func NewDnsClientWithConfigurationProvider(configProvider common.ConfigurationPr
// SetRegion overrides the region of this client.
func (client *DnsClient) SetRegion(region string) {
- client.Host = common.StringToRegion(region).Endpoint("dns")
+ client.Host = common.StringToRegion(region).EndpointForTemplate("dns", "https://dns.{region}.{secondLevelDomain}")
}
// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid
@@ -59,7 +59,103 @@ func (client *DnsClient) ConfigurationProvider() *common.ConfigurationProvider {
return client.config
}
-// CreateSteeringPolicy Creates a new steering policy in the specified compartment.
+// ChangeSteeringPolicyCompartment Moves a steering policy into a different compartment. When provided, If-Match is checked against ETag values of the resource.
+func (client DnsClient) ChangeSteeringPolicyCompartment(ctx context.Context, request ChangeSteeringPolicyCompartmentRequest) (response ChangeSteeringPolicyCompartmentResponse, err error) {
+ var ociResponse common.OCIResponse
+ policy := common.NoRetryPolicy()
+ if request.RetryPolicy() != nil {
+ policy = *request.RetryPolicy()
+ }
+
+ if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
+ request.OpcRetryToken = common.String(common.RetryToken())
+ }
+
+ ociResponse, err = common.Retry(ctx, request, client.changeSteeringPolicyCompartment, policy)
+ if err != nil {
+ if ociResponse != nil {
+ response = ChangeSteeringPolicyCompartmentResponse{RawResponse: ociResponse.HTTPResponse()}
+ }
+ return
+ }
+ if convertedResponse, ok := ociResponse.(ChangeSteeringPolicyCompartmentResponse); ok {
+ response = convertedResponse
+ } else {
+ err = fmt.Errorf("failed to convert OCIResponse into ChangeSteeringPolicyCompartmentResponse")
+ }
+ return
+}
+
+// changeSteeringPolicyCompartment implements the OCIOperation interface (enables retrying operations)
+func (client DnsClient) changeSteeringPolicyCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {
+ httpRequest, err := request.HTTPRequest(http.MethodPost, "/steeringPolicies/{steeringPolicyId}/actions/changeCompartment")
+ if err != nil {
+ return nil, err
+ }
+
+ var response ChangeSteeringPolicyCompartmentResponse
+ var httpResponse *http.Response
+ httpResponse, err = client.Call(ctx, &httpRequest)
+ defer common.CloseBodyIfValid(httpResponse)
+ response.RawResponse = httpResponse
+ if err != nil {
+ return response, err
+ }
+
+ err = common.UnmarshalResponse(httpResponse, &response)
+ return response, err
+}
+
+// ChangeZoneCompartment Moves a zone into a different compartment. When provided, If-Match is checked against ETag values of the resource.
+// **Note:** All SteeringPolicyAttachment objects associated with this zone will also be moved into the provided compartment.
+func (client DnsClient) ChangeZoneCompartment(ctx context.Context, request ChangeZoneCompartmentRequest) (response ChangeZoneCompartmentResponse, err error) {
+ var ociResponse common.OCIResponse
+ policy := common.NoRetryPolicy()
+ if request.RetryPolicy() != nil {
+ policy = *request.RetryPolicy()
+ }
+
+ if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") {
+ request.OpcRetryToken = common.String(common.RetryToken())
+ }
+
+ ociResponse, err = common.Retry(ctx, request, client.changeZoneCompartment, policy)
+ if err != nil {
+ if ociResponse != nil {
+ response = ChangeZoneCompartmentResponse{RawResponse: ociResponse.HTTPResponse()}
+ }
+ return
+ }
+ if convertedResponse, ok := ociResponse.(ChangeZoneCompartmentResponse); ok {
+ response = convertedResponse
+ } else {
+ err = fmt.Errorf("failed to convert OCIResponse into ChangeZoneCompartmentResponse")
+ }
+ return
+}
+
+// changeZoneCompartment implements the OCIOperation interface (enables retrying operations)
+func (client DnsClient) changeZoneCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) {
+ httpRequest, err := request.HTTPRequest(http.MethodPost, "/zones/{zoneId}/actions/changeCompartment")
+ if err != nil {
+ return nil, err
+ }
+
+ var response ChangeZoneCompartmentResponse
+ var httpResponse *http.Response
+ httpResponse, err = client.Call(ctx, &httpRequest)
+ defer common.CloseBodyIfValid(httpResponse)
+ response.RawResponse = httpResponse
+ if err != nil {
+ return response, err
+ }
+
+ err = common.UnmarshalResponse(httpResponse, &response)
+ return response, err
+}
+
+// CreateSteeringPolicy Creates a new steering policy in the specified compartment. For more information on
+// creating policies with templates, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
func (client DnsClient) CreateSteeringPolicy(ctx context.Context, request CreateSteeringPolicyRequest) (response CreateSteeringPolicyResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
@@ -106,9 +202,11 @@ func (client DnsClient) createSteeringPolicy(ctx context.Context, request common
return response, err
}
-// CreateSteeringPolicyAttachment Creates a new attachment between a steering policy and a domain.
+// CreateSteeringPolicyAttachment Creates a new attachment between a steering policy and a domain, giving the
+// policy permission to answer queries for the specified domain. A steering policy must
+// be attached to a domain for the policy to answer DNS queries for that domain.
// For the purposes of access control, the attachment is automatically placed
-// into the same compartment as the containing zone of the domain.
+// into the same compartment as the domain's zone.
func (client DnsClient) CreateSteeringPolicyAttachment(ctx context.Context, request CreateSteeringPolicyAttachmentRequest) (response CreateSteeringPolicyAttachmentResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
@@ -285,7 +383,8 @@ func (client DnsClient) deleteRRSet(ctx context.Context, request common.OCIReque
// DeleteSteeringPolicy Deletes the specified steering policy.
// A `204` response indicates that the delete has been successful.
-// Deletion will fail if the policy is attached to any zones.
+// Deletion will fail if the policy is attached to any zones. To detach a
+// policy from a zone, see `DeleteSteeringPolicyAttachment`.
func (client DnsClient) DeleteSteeringPolicy(ctx context.Context, request DeleteSteeringPolicyRequest) (response DeleteSteeringPolicyResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
@@ -798,7 +897,10 @@ func (client DnsClient) listZones(ctx context.Context, request common.OCIRequest
return response, err
}
-// PatchDomainRecords Updates records in the specified zone at a domain. You can update one record or all records for the specified zone depending on the changes provided in the request body. You can also add or remove records using this function.
+// PatchDomainRecords Updates records in the specified zone at a domain. You can update
+// one record or all records for the specified zone depending on the changes
+// provided in the request body. You can also add or remove records using this
+// function.
func (client DnsClient) PatchDomainRecords(ctx context.Context, request PatchDomainRecordsRequest) (response PatchDomainRecordsResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
@@ -1016,7 +1118,7 @@ func (client DnsClient) updateRRSet(ctx context.Context, request common.OCIReque
return response, err
}
-// UpdateSteeringPolicy Updates the specified steering policy with your new information.
+// UpdateSteeringPolicy Updates the configuration of the specified steering policy.
func (client DnsClient) UpdateSteeringPolicy(ctx context.Context, request UpdateSteeringPolicyRequest) (response UpdateSteeringPolicyResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
@@ -1102,7 +1204,7 @@ func (client DnsClient) updateSteeringPolicyAttachment(ctx context.Context, requ
// UpdateZone Updates the specified secondary zone with your new external master
// server information. For more information about secondary zone, see
-// Manage DNS Service Zone (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Tasks/managingdnszones.htm).
+// Manage DNS Service Zone (https://docs.cloud.oracle.com/iaas/Content/DNS/Tasks/managingdnszones.htm).
func (client DnsClient) UpdateZone(ctx context.Context, request UpdateZoneRequest) (response UpdateZoneResponse, err error) {
var ociResponse common.OCIResponse
policy := common.NoRetryPolicy()
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go b/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go
index d7e96aa5f..83cbfea88 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/external_master.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go
index 468f115da..6eb47d79c 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_domain_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -85,7 +85,7 @@ type GetDomainRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go
index ffb9d4b56..13c1a9847 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_r_r_set_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -78,7 +78,7 @@ type GetRRSetResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go
index 12b1c6f80..033dfe452 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_attachment_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go
index 4628e798a..826ef7e12 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_steering_policy_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go
index d0c7976ee..ff5e23a6f 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -90,7 +90,7 @@ type GetZoneRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go
index 2ba1b7c89..b9f3b3085 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/get_zone_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go
index 31770b3fc..0e54aa3c4 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policies_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -31,7 +31,7 @@ type ListSteeringPoliciesRequest struct {
DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"`
// Search by health check monitor OCID.
- // Will match any resource whose health check monitor id matches the provided value.
+ // Will match any resource whose health check monitor ID matches the provided value.
HealthCheckMonitorId *string `mandatory:"false" contributesTo:"query" name:"healthCheckMonitorId"`
// An RFC 3339 (https://www.ietf.org/rfc/rfc3339.txt) timestamp that states
@@ -42,14 +42,14 @@ type ListSteeringPoliciesRequest struct {
// all returned resources were created before the indicated time.
TimeCreatedLessThan *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeCreatedLessThan"`
- // Search by template type.
+ // Search by steering template type.
// Will match any resource whose template type matches the provided value.
Template *string `mandatory:"false" contributesTo:"query" name:"template"`
// The state of a resource.
LifecycleState SteeringPolicySummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"`
- // The field by which to sort steering policies.
+ // The field by which to sort steering policies. If unspecified, defaults to `timeCreated`.
SortBy ListSteeringPoliciesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"`
// The order to sort the resources.
@@ -89,7 +89,7 @@ type ListSteeringPoliciesResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go
index 85907db29..3cf44a7aa 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/list_steering_policy_attachments_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -27,11 +27,11 @@ type ListSteeringPolicyAttachmentsRequest struct {
DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"`
// Search by steering policy OCID.
- // Will match any resource whose steering policy id matches the provided value.
+ // Will match any resource whose steering policy ID matches the provided value.
SteeringPolicyId *string `mandatory:"false" contributesTo:"query" name:"steeringPolicyId"`
// Search by zone OCID.
- // Will match any resource whose zone id matches the provided value.
+ // Will match any resource whose zone ID matches the provided value.
ZoneId *string `mandatory:"false" contributesTo:"query" name:"zoneId"`
// Search by domain.
@@ -53,7 +53,7 @@ type ListSteeringPolicyAttachmentsRequest struct {
// The state of a resource.
LifecycleState SteeringPolicyAttachmentSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"`
- // The field by which to sort steering policy attachments.
+ // The field by which to sort steering policy attachments. If unspecified, defaults to `timeCreated`.
SortBy ListSteeringPolicyAttachmentsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"`
// The order to sort the resources.
@@ -93,7 +93,7 @@ type ListSteeringPolicyAttachmentsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go
index a9c04505e..629070eb4 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/list_zones_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -83,7 +83,7 @@ type ListZonesResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go b/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go
index d738bc55b..e23189481 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/nameserver.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go
index 51986ae48..6fbfa48d4 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go
index eabd124d3..5e93c006f 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_domain_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -71,7 +71,7 @@ type PatchDomainRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go
index e5a62a8e0..749b808f1 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_r_r_set_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -74,7 +74,7 @@ type PatchRRSetResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go
index dc9664b24..8753b37e2 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_rr_set_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go
index aef22e8e9..8d3424c9b 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go
index cd79e32e2..1d4e2ef41 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/patch_zone_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -68,7 +68,7 @@ type PatchZoneRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/record.go b/vendor/github.com/oracle/oci-go-sdk/dns/record.go
index 3d87faf16..ef70159b5 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/record.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/record.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -13,7 +13,8 @@ import (
"github.com/oracle/oci-go-sdk/common"
)
-// Record A DNS resource record. For more information about DNS records, see RFC 1034 (https://tools.ietf.org/html/rfc1034#section-3.6).
+// Record A DNS resource record. For more information, see
+// Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm).
type Record struct {
// The fully qualified domain name where the record can be located.
@@ -29,7 +30,7 @@ type Record struct {
// The record's data, as whitespace-delimited tokens in
// type-specific presentation format. All RDATA is normalized and the
// returned presentation of your RDATA may differ from its initial input.
- // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
+ // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
Rdata *string `mandatory:"false" json:"rdata"`
// The latest version of the record's zone in which its RRSet differs
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go b/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go
index eed71d33f..a1933adc2 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/record_collection.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go
index 50c095030..93c26cfed 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/record_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -22,7 +22,7 @@ type RecordDetails struct {
// The record's data, as whitespace-delimited tokens in
// type-specific presentation format. All RDATA is normalized and the
// returned presentation of your RDATA may differ from its initial input.
- // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
+ // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
Rdata *string `mandatory:"true" json:"rdata"`
// The canonical name for the record's type, such as A or CNAME. For more
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go b/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go
index 684437cc8..e851b8d53 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/record_operation.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -31,7 +31,7 @@ type RecordOperation struct {
// The record's data, as whitespace-delimited tokens in
// type-specific presentation format. All RDATA is normalized and the
// returned presentation of your RDATA may differ from its initial input.
- // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
+ // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm)
Rdata *string `mandatory:"false" json:"rdata"`
// The latest version of the record's zone in which its RRSet differs
@@ -46,15 +46,19 @@ type RecordOperation struct {
Ttl *int `mandatory:"false" json:"ttl"`
// A description of how a record relates to a PATCH operation.
+ //
// - `REQUIRE` indicates a precondition that record data **must** already exist.
// - `PROHIBIT` indicates a precondition that record data **must not** already exist.
// - `ADD` indicates that record data **must** exist after successful application.
// - `REMOVE` indicates that record data **must not** exist after successful application.
+ //
// **Note:** `ADD` and `REMOVE` operations can succeed even if
// they require no changes when applied, such as when the described
// records are already present or absent.
+ //
// **Note:** `ADD` and `REMOVE` operations can describe changes for
// more than one record.
+ //
// **Example:** `{ "domain": "www.example.com", "rtype": "AAAA", "ttl": 60 }`
// specifies a new TTL for every record in the www.example.com AAAA RRSet.
Operation RecordOperationOperationEnum `mandatory:"false" json:"operation,omitempty"`
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go b/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go
index 13e668c79..67c5f83b3 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/rr_set.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go
index f53f422bd..2e4798b44 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/sort_order.go
@@ -1,22 +1,33 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
-import (
- "github.com/oracle/oci-go-sdk/common"
+// SortOrderEnum Enum with underlying type: string
+type SortOrderEnum string
+
+// Set of constants representing the allowable values for SortOrderEnum
+const (
+ SortOrderAsc SortOrderEnum = "ASC"
+ SortOrderDesc SortOrderEnum = "DESC"
)
-// SortOrder The order to sort the resources.
-type SortOrder struct {
+var mappingSortOrder = map[string]SortOrderEnum{
+ "ASC": SortOrderAsc,
+ "DESC": SortOrderDesc,
}
-func (m SortOrder) String() string {
- return common.PointerString(m)
+// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum
+func GetSortOrderEnumValues() []SortOrderEnum {
+ values := make([]SortOrderEnum, 0)
+ for _, v := range mappingSortOrder {
+ values = append(values, v)
+ }
+ return values
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go
index 08341a81e..5bc21af96 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,82 +15,81 @@ import (
)
// SteeringPolicy A DNS steering policy.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type SteeringPolicy struct {
// The OCID of the compartment containing the steering policy.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
- // A user-friendly name for the steering policy.
- // Does not have to be unique, and it's changeable.
+ // A user-friendly name for the steering policy. Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
- // The Time To Live for responses from the steering policy, in seconds.
+ // The Time To Live (TTL) for responses from the steering policy, in seconds.
// If not specified during creation, a value of 30 seconds will be used.
Ttl *int `mandatory:"false" json:"ttl"`
// The OCID of the health check monitor providing health data about the answers of the
- // steering policy.
- // A steering policy answer with `rdata` matching a monitored endpoint will use the health
- // data of that endpoint.
- // A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
- // healthy.
+ // steering policy. A steering policy answer with `rdata` matching a monitored endpoint
+ // will use the health data of that endpoint. A steering policy answer with `rdata` not
+ // matching any monitored endpoint will be assumed healthy.
+ //
+ // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor
+ // must be created using the Health Checks service first. For more information on how to
+ // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm).
HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"`
- // The common pattern (or lack thereof) to which the steering policy adheres. This
- // value restricts the possible configurations of rules, but thereby supports
- // specifically tailored interfaces. Values other than "CUSTOM" require the rules to
- // begin with an unconditional FILTER that keeps answers contingent upon
- // `answer.isDisabled != true`, followed
- // _if and only if the policy references a health check monitor_ by an unconditional
- // HEALTH rule, and require the last rule to be an unconditional LIMIT.
- // What must precede the LIMIT rule is determined by the template value:
- // - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
- // Each answer pool must have a unique priority value assigned to it. Answer data must
- // be defined in the `defaultAnswerData` property for the rule and the `cases` property
- // must not be defined.
- // - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
- // by name. Answer data must be defined in the `defaultAnswerData` property for the
- // rule and the `cases` property must not be defined.
- // - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
- // geographical location of the client as a condition. Within that rule you may only
- // use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
- // ASN of the client as a condition. Within that rule you may only use
- // `query.client.asn` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
- // IP subnet of the client as a condition. Within that rule you may only use
- // `query.client.address` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - CUSTOM allows an arbitrary configuration of rules.
- // For an existing steering policy, the template value may be changed to any of the
- // supported options but the resulting policy must conform to the requirements for the
- // new template type or else a Bad Request error will be returned.
+ // A set of predefined rules based on the desired purpose of the steering policy. Each
+ // template utilizes Traffic Management's rules in a different order to produce the desired
+ // results when answering DNS queries.
+ //
+ // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers
+ // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`,
+ // and `LIMIT`. This gives the domain dynamic failover capability.
+ //
+ // It is **strongly recommended** to use a template other than `CUSTOM` when creating
+ // a steering policy.
+ //
+ // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps
+ // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined
+ // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`.
+ // The last rule of a template must must be a `LIMIT` rule. For more information about templates
+ // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
+ // **Template Types**
+ // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers
+ // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed
+ // from the list of available answers until the endpoint is detected as healthy.
+ //
+ // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights.
+ //
+ // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic
+ // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm).
+ //
+ // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN.
+ //
+ // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address.
+ //
+ // * `CUSTOM` - Allows a customized configuration of rules.
Template SteeringPolicyTemplateEnum `mandatory:"false" json:"template,omitempty"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The set of all answers that can potentially issue from the steering policy.
Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"`
- // The pipeline of rules that will be processed in sequence to reduce the pool of answers
+ // The series of rules that will be processed in sequence to reduce the pool of answers
// to a response for any given request.
+ //
// The first rule receives a shuffled list of all answers, and every other rule receives
// the list of answers emitted by the one preceding it. The last rule populates the
// response.
@@ -102,8 +101,7 @@ type SteeringPolicy struct {
// The OCID of the resource.
Id *string `mandatory:"false" json:"id"`
- // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format
- // with a Z offset, as defined by RFC 3339.
+ // The date and time the resource was created, expressed in RFC 3339 timestamp format.
// **Example:** `2016-07-22T17:23:59:60Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go
index 79f77c398..3cc1e1a9f 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_answer.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,27 +14,68 @@ import (
)
// SteeringPolicyAnswer DNS record data with metadata for processing in a steering policy.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+//
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type SteeringPolicyAnswer struct {
// A user-friendly name for the answer, unique within the steering policy.
+ // An answer's `name` property can be referenced in `answerCondition` properties
+ // of rules using `answer.name`.
+ // **Example:**
+ // "rules": [
+ // {
+ // "ruleType": "FILTER",
+ // "defaultAnswerData": [
+ // {
+ // "answerCondition": "answer.name == 'server 1'",
+ // "shouldKeep": true
+ // }
+ // ]
+ // }
+ // ]
Name *string `mandatory:"true" json:"name"`
// The canonical name for the record's type. Only A, AAAA, and CNAME are supported. For more
- // information, see Resource Record (RR) TYPEs (https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
+ // information, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm).
Rtype *string `mandatory:"true" json:"rtype"`
// The record's data, as whitespace-delimited tokens in
- // type-specific presentation format.
+ // type-specific presentation format. All RDATA is normalized and the
+ // returned presentation of your RDATA may differ from its initial input.
+ // For more information about RDATA, see Supported DNS Resource Record Types (https://docs.cloud.oracle.com/iaas/Content/DNS/Reference/supporteddnsresource.htm).
Rdata *string `mandatory:"true" json:"rdata"`
- // The freeform name of a group of one or more records (e.g., a data center or a geographic
- // region) in which this one is included.
+ // The freeform name of a group of one or more records in which this record is included,
+ // such as "LAX data center". An answer's `pool` property can be referenced in `answerCondition`
+ // properties of rules using `answer.pool`.
+ // **Example:**
+ // "rules": [
+ // {
+ // "ruleType": "FILTER",
+ // "defaultAnswerData": [
+ // {
+ // "answerCondition": "answer.pool == 'US East Servers'",
+ // "shouldKeep": true
+ // }
+ // ]
+ // }
+ // ]
Pool *string `mandatory:"false" json:"pool"`
- // Whether or not an answer should be excluded from responses, e.g. because the corresponding
- // server is down for maintenance. Note, however, that such filtering is not automatic and
- // will only take place if a rule implements it.
+ // Set this property to `true` to indicate that the answer is administratively disabled,
+ // such as when the corresponding server is down for maintenance. An answer's `isDisabled`
+ // property can be referenced in `answerCondition` properties in rules using `answer.isDisabled`.
+ // **Example:**
+ // "rules": [
+ // {
+ // "ruleType": "FILTER",
+ // "defaultAnswerData": [
+ // {
+ // "answerCondition": "answer.isDisabled != true",
+ // "shouldKeep": true
+ // }
+ // ]
+ // },
IsDisabled *bool `mandatory:"false" json:"isDisabled"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go
index e8e3484d6..a5d4a0c49 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -13,10 +13,11 @@ import (
"github.com/oracle/oci-go-sdk/common"
)
-// SteeringPolicyAttachment An attachment between a steering policy and a domain.
-// An attachment occludes all records at its domain that are of a covered rtype, constructing
-// DNS responses from its steering policy rather than from those domain records.
-// A domain can have at most one attachment covering any given rtype.
+// SteeringPolicyAttachment An attachment between a steering policy and a domain. An attachment constructs
+// DNS responses using its steering policy instead of the records at its defined domain.
+// Only records of the policy's covered rtype are blocked at the domain.
+// A domain can have a maximum of one attachment covering any given rtype.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type SteeringPolicyAttachment struct {
// The OCID of the attached steering policy.
@@ -29,7 +30,7 @@ type SteeringPolicyAttachment struct {
DomainName *string `mandatory:"false" json:"domainName"`
// A user-friendly name for the steering policy attachment.
- // Does not have to be unique, and it's changeable.
+ // Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
@@ -47,8 +48,7 @@ type SteeringPolicyAttachment struct {
// The OCID of the resource.
Id *string `mandatory:"false" json:"id"`
- // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format
- // with a Z offset, as defined by RFC 3339.
+ // The date and time the resource was created, expressed in RFC 3339 timestamp format.
// **Example:** `2016-07-22T17:23:59:60Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go
index 1ba3d201a..28191b836 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_attachment_summary.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -26,7 +26,7 @@ type SteeringPolicyAttachmentSummary struct {
DomainName *string `mandatory:"false" json:"domainName"`
// A user-friendly name for the steering policy attachment.
- // Does not have to be unique, and it's changeable.
+ // Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
@@ -44,8 +44,7 @@ type SteeringPolicyAttachmentSummary struct {
// The OCID of the resource.
Id *string `mandatory:"false" json:"id"`
- // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format
- // with a Z offset, as defined by RFC 3339.
+ // The date and time the resource was created, expressed in RFC 3339 timestamp format.
// **Example:** `2016-07-22T17:23:59:60Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go
index d6fb3e1d2..765e2db99 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_answer_data.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,9 +15,11 @@ import (
// SteeringPolicyFilterAnswerData The representation of SteeringPolicyFilterAnswerData
type SteeringPolicyFilterAnswerData struct {
+
+ // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties.
AnswerCondition *string `mandatory:"false" json:"answerCondition"`
- // Keep the answer if the value is `true`.
+ // Keeps the answer only if the value is `true`.
ShouldKeep *bool `mandatory:"false" json:"shouldKeep"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go
index 27912bfad..3a114c420 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -17,15 +17,23 @@ import (
// SteeringPolicyFilterRule The representation of SteeringPolicyFilterRule
type SteeringPolicyFilterRule struct {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
+ // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
+ // configurations for how it should behave during processing for any given DNS query. When a rule has
+ // no sequence of `cases`, it is always evaluated with the same configuration during processing. When
+ // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
+ // non-empty sequence of `cases`, its behavior during processing is configured by the first matching
+ // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
+ // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
+ // evaluates to true for the given query.
Cases []SteeringPolicyFilterRuleCase `mandatory:"false" json:"cases"`
// Defines a default set of answer conditions and values that are applied to an answer when
- // `cases` is not defined for the rule or a matching case does not have any matching
- // `answerCondition`s in its `answerData`. `defaultAnswerData` is **not** applied if `cases` is
- // defined and there are no matching cases.
+ // `cases` is not defined for the rule, or a matching case does not have any matching
+ // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is
+ // defined and there are no matching cases. In this scenario, the next rule will be processed.
DefaultAnswerData []SteeringPolicyFilterAnswerData `mandatory:"false" json:"defaultAnswerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go
index c7445ba91..feb8faf22 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_filter_rule_case.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,8 +15,16 @@ import (
// SteeringPolicyFilterRuleCase The representation of SteeringPolicyFilterRuleCase
type SteeringPolicyFilterRuleCase struct {
+
+ // An expression that uses conditions at the time of a DNS query to indicate
+ // whether a case matches. Conditions may include the geographical location, IP
+ // subnet, or ASN the DNS query originated. **Example:** If you have an
+ // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
+ // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that
+ // matches queries from that office.
CaseCondition *string `mandatory:"false" json:"caseCondition"`
+ // An array of `SteeringPolicyFilterAnswerData` objects.
AnswerData []SteeringPolicyFilterAnswerData `mandatory:"false" json:"answerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go
index 64cc4a0fa..4994fffcf 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -17,9 +17,17 @@ import (
// SteeringPolicyHealthRule The representation of SteeringPolicyHealthRule
type SteeringPolicyHealthRule struct {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
+ // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
+ // configurations for how it should behave during processing for any given DNS query. When a rule has
+ // no sequence of `cases`, it is always evaluated with the same configuration during processing. When
+ // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
+ // non-empty sequence of `cases`, its behavior during processing is configured by the first matching
+ // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
+ // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
+ // evaluates to true for the given query.
Cases []SteeringPolicyHealthRuleCase `mandatory:"false" json:"cases"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go
index 3732d48ef..a4cf30ab9 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_health_rule_case.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,6 +15,13 @@ import (
// SteeringPolicyHealthRuleCase The representation of SteeringPolicyHealthRuleCase
type SteeringPolicyHealthRuleCase struct {
+
+ // An expression that uses conditions at the time of a DNS query to indicate
+ // whether a case matches. Conditions may include the geographical location, IP
+ // subnet, or ASN the DNS query originated. **Example:** If you have an
+ // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
+ // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that
+ // matches queries from that office.
CaseCondition *string `mandatory:"false" json:"caseCondition"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go
index 40a98669c..22723f50e 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -17,14 +17,23 @@ import (
// SteeringPolicyLimitRule The representation of SteeringPolicyLimitRule
type SteeringPolicyLimitRule struct {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
+ // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
+ // configurations for how it should behave during processing for any given DNS query. When a rule has
+ // no sequence of `cases`, it is always evaluated with the same configuration during processing. When
+ // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
+ // non-empty sequence of `cases`, its behavior during processing is configured by the first matching
+ // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
+ // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
+ // evaluates to true for the given query.
Cases []SteeringPolicyLimitRuleCase `mandatory:"false" json:"cases"`
// Defines a default count if `cases` is not defined for the rule or a matching case does
// not define `count`. `defaultCount` is **not** applied if `cases` is defined and there
- // are no matching cases.
+ // are no matching cases. In this scenario, the next rule will be processed. If no rules
+ // remain to be processed, the answer will be chosen from the remaining list of answers.
DefaultCount *int `mandatory:"false" json:"defaultCount"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go
index e0bf60578..c890c8753 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_limit_rule_case.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,8 +15,19 @@ import (
// SteeringPolicyLimitRuleCase The representation of SteeringPolicyLimitRuleCase
type SteeringPolicyLimitRuleCase struct {
+
+ // The number of answers allowed to remain after the limit rule has been processed, keeping only the
+ // first of the remaining answers in the list. Example: If the `count` property is set to `2` and
+ // four answers remain before the limit rule is processed, only the first two answers in the list will
+ // remain after the limit rule has been processed.
Count *int `mandatory:"true" json:"count"`
+ // An expression that uses conditions at the time of a DNS query to indicate
+ // whether a case matches. Conditions may include the geographical location, IP
+ // subnet, or ASN the DNS query originated. **Example:** If you have an
+ // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
+ // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that
+ // matches queries from that office.
CaseCondition *string `mandatory:"false" json:"caseCondition"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go
index 661632851..5ff25e466 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_answer_data.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,9 +15,14 @@ import (
// SteeringPolicyPriorityAnswerData The representation of SteeringPolicyPriorityAnswerData
type SteeringPolicyPriorityAnswerData struct {
- AnswerCondition *string `mandatory:"false" json:"answerCondition"`
- Value *int `mandatory:"false" json:"value"`
+ // The rank assigned to the set of answers that match the expression in `answerCondition`.
+ // Answers with the lowest values move to the beginning of the list without changing the
+ // relative order of those with the same value. Answers can be given a value between `0` and `255`.
+ Value *int `mandatory:"true" json:"value"`
+
+ // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties.
+ AnswerCondition *string `mandatory:"false" json:"answerCondition"`
}
func (m SteeringPolicyPriorityAnswerData) String() string {
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go
index fb6ee7bc6..5396f2afb 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -17,15 +17,23 @@ import (
// SteeringPolicyPriorityRule The representation of SteeringPolicyPriorityRule
type SteeringPolicyPriorityRule struct {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
+ // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
+ // configurations for how it should behave during processing for any given DNS query. When a rule has
+ // no sequence of `cases`, it is always evaluated with the same configuration during processing. When
+ // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
+ // non-empty sequence of `cases`, its behavior during processing is configured by the first matching
+ // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
+ // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
+ // evaluates to true for the given query.
Cases []SteeringPolicyPriorityRuleCase `mandatory:"false" json:"cases"`
// Defines a default set of answer conditions and values that are applied to an answer when
// `cases` is not defined for the rule or a matching case does not have any matching
- // `answerCondition`s in its `answerData`. `defaultAnswerData` is **not** applied if `cases` is
- // defined and there are no matching cases.
+ // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is
+ // defined and there are no matching cases. In this scenario, the next rule will be processed.
DefaultAnswerData []SteeringPolicyPriorityAnswerData `mandatory:"false" json:"defaultAnswerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go
index c0b098603..3b496d2a8 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_priority_rule_case.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,8 +15,16 @@ import (
// SteeringPolicyPriorityRuleCase The representation of SteeringPolicyPriorityRuleCase
type SteeringPolicyPriorityRuleCase struct {
+
+ // An expression that uses conditions at the time of a DNS query to indicate
+ // whether a case matches. Conditions may include the geographical location, IP
+ // subnet, or ASN the DNS query originated. **Example:** If you have an
+ // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
+ // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that
+ // matches queries from that office.
CaseCondition *string `mandatory:"false" json:"caseCondition"`
+ // An array of `SteeringPolicyPriorityAnswerData` objects.
AnswerData []SteeringPolicyPriorityAnswerData `mandatory:"false" json:"answerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go
index b8d7160b6..78a5d7e8f 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,23 +14,18 @@ import (
"github.com/oracle/oci-go-sdk/common"
)
-// SteeringPolicyRule Configuration for sorting and/or filtering the list of remaining candidate answers, subject to
-// rule type and the values of type-specific parameters and/or data associated with answers.
+// SteeringPolicyRule The configuration of the sorting and filtering behaviors in a steering policy. Rules can
+// filter and sort answers based on weight, priority, endpoint health, and other data.
+//
// A rule may optionally include a sequence of cases, each with an optional `caseCondition`
-// expression. If it does, the first case with a matching `caseCondition` or with no
-// `caseCondition` at all is used to set rule parameter values and/or answer-associated data,
-// and the rule will be ignored during processing of any request that does not match any case.
-// Rules without a sequence of cases are processed unconditionally, and rules with an _empty_
-// sequence of cases are **ignored** unconditionally.
-// Data is associated with answers one-by-one in a similar fashion—for each answer, the first
-// answerData item with a matching `answerCondition` or with no `answerCondition` at all is used
-// to associate data with the answer, and the absence of any such item associates with the answer
-// a default value. Rule-level default answer data is always processed, but case-level answer
-// data will override it on a per-answer basis.
-// To prevent empty responses, any attempt to filter away all answers is suppressed at runtime.
+// expression. Cases allow a sequence of conditions to be defined that will apply different
+// parameters to the rule when the conditions are met. For more information about cases,
+// see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
+//
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type SteeringPolicyRule interface {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
GetDescription() *string
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go
index 16c2f26b6..3618ea571 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_summary.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,75 +14,73 @@ import (
)
// SteeringPolicySummary A DNS steering policy.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type SteeringPolicySummary struct {
// The OCID of the compartment containing the steering policy.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
- // A user-friendly name for the steering policy.
- // Does not have to be unique, and it's changeable.
+ // A user-friendly name for the steering policy. Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
- // The Time To Live for responses from the steering policy, in seconds.
+ // The Time To Live (TTL) for responses from the steering policy, in seconds.
// If not specified during creation, a value of 30 seconds will be used.
Ttl *int `mandatory:"false" json:"ttl"`
// The OCID of the health check monitor providing health data about the answers of the
- // steering policy.
- // A steering policy answer with `rdata` matching a monitored endpoint will use the health
- // data of that endpoint.
- // A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
- // healthy.
+ // steering policy. A steering policy answer with `rdata` matching a monitored endpoint
+ // will use the health data of that endpoint. A steering policy answer with `rdata` not
+ // matching any monitored endpoint will be assumed healthy.
+ //
+ // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor
+ // must be created using the Health Checks service first. For more information on how to
+ // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm).
HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"`
- // The common pattern (or lack thereof) to which the steering policy adheres. This
- // value restricts the possible configurations of rules, but thereby supports
- // specifically tailored interfaces. Values other than "CUSTOM" require the rules to
- // begin with an unconditional FILTER that keeps answers contingent upon
- // `answer.isDisabled != true`, followed
- // _if and only if the policy references a health check monitor_ by an unconditional
- // HEALTH rule, and require the last rule to be an unconditional LIMIT.
- // What must precede the LIMIT rule is determined by the template value:
- // - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
- // Each answer pool must have a unique priority value assigned to it. Answer data must
- // be defined in the `defaultAnswerData` property for the rule and the `cases` property
- // must not be defined.
- // - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
- // by name. Answer data must be defined in the `defaultAnswerData` property for the
- // rule and the `cases` property must not be defined.
- // - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
- // geographical location of the client as a condition. Within that rule you may only
- // use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
- // ASN of the client as a condition. Within that rule you may only use
- // `query.client.asn` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
- // IP subnet of the client as a condition. Within that rule you may only use
- // `query.client.address` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - CUSTOM allows an arbitrary configuration of rules.
- // For an existing steering policy, the template value may be changed to any of the
- // supported options but the resulting policy must conform to the requirements for the
- // new template type or else a Bad Request error will be returned.
+ // A set of predefined rules based on the desired purpose of the steering policy. Each
+ // template utilizes Traffic Management's rules in a different order to produce the desired
+ // results when answering DNS queries.
+ //
+ // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers
+ // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`,
+ // and `LIMIT`. This gives the domain dynamic failover capability.
+ //
+ // It is **strongly recommended** to use a template other than `CUSTOM` when creating
+ // a steering policy.
+ //
+ // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps
+ // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined
+ // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`.
+ // The last rule of a template must must be a `LIMIT` rule. For more information about templates
+ // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
+ // **Template Types**
+ // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers
+ // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed
+ // from the list of available answers until the endpoint is detected as healthy.
+ //
+ // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights.
+ //
+ // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic
+ // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm).
+ //
+ // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN.
+ //
+ // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address.
+ //
+ // * `CUSTOM` - Allows a customized configuration of rules.
Template SteeringPolicySummaryTemplateEnum `mandatory:"false" json:"template,omitempty"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The canonical absolute URL of the resource.
@@ -91,8 +89,7 @@ type SteeringPolicySummary struct {
// The OCID of the resource.
Id *string `mandatory:"false" json:"id"`
- // The date and time the resource was created in "YYYY-MM-ddThh:mmZ" format
- // with a Z offset, as defined by RFC 3339.
+ // The date and time the resource was created, expressed in RFC 3339 timestamp format.
// **Example:** `2016-07-22T17:23:59:60Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go
index 790289f03..2e72de961 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_answer_data.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,9 +15,13 @@ import (
// SteeringPolicyWeightedAnswerData The representation of SteeringPolicyWeightedAnswerData
type SteeringPolicyWeightedAnswerData struct {
- AnswerCondition *string `mandatory:"false" json:"answerCondition"`
- Value *int `mandatory:"false" json:"value"`
+ // The weight assigned to the set of selected answers. Answers with a higher weight will be served
+ // more frequently. Answers can be given a value between `0` and `255`.
+ Value *int `mandatory:"true" json:"value"`
+
+ // An expression that is used to select a set of answers that match a condition. For example, answers with matching pool properties.
+ AnswerCondition *string `mandatory:"false" json:"answerCondition"`
}
func (m SteeringPolicyWeightedAnswerData) String() string {
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go
index 0670cdb23..71bacfc48 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -17,15 +17,23 @@ import (
// SteeringPolicyWeightedRule The representation of SteeringPolicyWeightedRule
type SteeringPolicyWeightedRule struct {
- // Your description of the rule's purpose and/or behavior.
+ // A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
+ // An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
+ // configurations for how it should behave during processing for any given DNS query. When a rule has
+ // no sequence of `cases`, it is always evaluated with the same configuration during processing. When
+ // a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
+ // non-empty sequence of `cases`, its behavior during processing is configured by the first matching
+ // `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
+ // `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
+ // evaluates to true for the given query.
Cases []SteeringPolicyWeightedRuleCase `mandatory:"false" json:"cases"`
// Defines a default set of answer conditions and values that are applied to an answer when
// `cases` is not defined for the rule or a matching case does not have any matching
- // `answerCondition`s in its `answerData`. `defaultAnswerData` is **not** applied if `cases` is
- // defined and there are no matching cases.
+ // `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is
+ // defined and there are no matching cases. In this scenario, the next rule will be processed.
DefaultAnswerData []SteeringPolicyWeightedAnswerData `mandatory:"false" json:"defaultAnswerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go
index fcf1381b8..9f344f283 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/steering_policy_weighted_rule_case.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -15,8 +15,16 @@ import (
// SteeringPolicyWeightedRuleCase The representation of SteeringPolicyWeightedRuleCase
type SteeringPolicyWeightedRuleCase struct {
+
+ // An expression that uses conditions at the time of a DNS query to indicate
+ // whether a case matches. Conditions may include the geographical location, IP
+ // subnet, or ASN the DNS query originated. **Example:** If you have an
+ // office that uses the subnet `192.0.2.0/24` you could use a `caseCondition`
+ // expression `query.client.subnet in ('192.0.2.0/24')` to define a case that
+ // matches queries from that office.
CaseCondition *string `mandatory:"false" json:"caseCondition"`
+ // An array of `SteeringPolicyWeightedAnswerData` objects.
AnswerData []SteeringPolicyWeightedAnswerData `mandatory:"false" json:"answerData"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go b/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go
index 407743d32..42cfbb5ae 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/tsig.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go
index 4ed4dad87..873c84e3b 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go
index 70470f686..c406f04ef 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_domain_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -71,7 +71,7 @@ type UpdateDomainRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go
index 8198bbdc5..08fd5e425 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_r_r_set_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -74,7 +74,7 @@ type UpdateRRSetResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go
index c94c0689b..11b0a8512 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_rr_set_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go
index 002e2d735..e200d7c9b 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,10 +14,12 @@ import (
)
// UpdateSteeringPolicyAttachmentDetails The body for updating a steering policy attachment.
+//
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type UpdateSteeringPolicyAttachmentDetails struct {
// A user-friendly name for the steering policy attachment.
- // Does not have to be unique, and it's changeable.
+ // Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
}
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go
index e504e07df..e3b36d21a 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_attachment_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go
index 4fc39c398..6555898c9 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -16,79 +16,79 @@ import (
// UpdateSteeringPolicyDetails The body for updating a steering policy. New rules and answers provided in the request will
// replace the existing rules and answers in the policy.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+//
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type UpdateSteeringPolicyDetails struct {
- // A user-friendly name for the steering policy.
- // Does not have to be unique, and it's changeable.
+ // A user-friendly name for the steering policy. Does not have to be unique and can be changed.
// Avoid entering confidential information.
DisplayName *string `mandatory:"false" json:"displayName"`
- // The Time To Live for responses from the steering policy, in seconds.
+ // The Time To Live (TTL) for responses from the steering policy, in seconds.
// If not specified during creation, a value of 30 seconds will be used.
Ttl *int `mandatory:"false" json:"ttl"`
// The OCID of the health check monitor providing health data about the answers of the
- // steering policy.
- // A steering policy answer with `rdata` matching a monitored endpoint will use the health
- // data of that endpoint.
- // A steering policy answer with `rdata` not matching any monitored endpoint will be assumed
- // healthy.
+ // steering policy. A steering policy answer with `rdata` matching a monitored endpoint
+ // will use the health data of that endpoint. A steering policy answer with `rdata` not
+ // matching any monitored endpoint will be assumed healthy.
+ //
+ // **Note:** To use the Health Check monitoring feature in a steering policy, a monitor
+ // must be created using the Health Checks service first. For more information on how to
+ // create a monitor, please see Managing Health Checks (https://docs.cloud.oracle.com/iaas/Content/HealthChecks/Tasks/managinghealthchecks.htm).
HealthCheckMonitorId *string `mandatory:"false" json:"healthCheckMonitorId"`
- // The common pattern (or lack thereof) to which the steering policy adheres. This
- // value restricts the possible configurations of rules, but thereby supports
- // specifically tailored interfaces. Values other than "CUSTOM" require the rules to
- // begin with an unconditional FILTER that keeps answers contingent upon
- // `answer.isDisabled != true`, followed
- // _if and only if the policy references a health check monitor_ by an unconditional
- // HEALTH rule, and require the last rule to be an unconditional LIMIT.
- // What must precede the LIMIT rule is determined by the template value:
- // - FAILOVER requires exactly an unconditional PRIORITY rule that ranks answers by pool.
- // Each answer pool must have a unique priority value assigned to it. Answer data must
- // be defined in the `defaultAnswerData` property for the rule and the `cases` property
- // must not be defined.
- // - LOAD_BALANCE requires exactly an unconditional WEIGHTED rule that shuffles answers
- // by name. Answer data must be defined in the `defaultAnswerData` property for the
- // rule and the `cases` property must not be defined.
- // - ROUTE_BY_GEO requires exactly one PRIORITY rule that ranks answers by pool using the
- // geographical location of the client as a condition. Within that rule you may only
- // use `query.client.geoKey` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_ASN requires exactly one PRIORITY rule that ranks answers by pool using the
- // ASN of the client as a condition. Within that rule you may only use
- // `query.client.asn` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - ROUTE_BY_IP requires exactly one PRIORITY rule that ranks answers by pool using the
- // IP subnet of the client as a condition. Within that rule you may only use
- // `query.client.address` in the `caseCondition` expressions for defining the cases.
- // For each case in the PRIORITY rule each answer pool must have a unique priority
- // value assigned to it. Answer data can only be defined within cases and
- // `defaultAnswerData` cannot be used in the PRIORITY rule.
- // - CUSTOM allows an arbitrary configuration of rules.
- // For an existing steering policy, the template value may be changed to any of the
- // supported options but the resulting policy must conform to the requirements for the
- // new template type or else a Bad Request error will be returned.
+ // A set of predefined rules based on the desired purpose of the steering policy. Each
+ // template utilizes Traffic Management's rules in a different order to produce the desired
+ // results when answering DNS queries.
+ //
+ // **Example:** The `FAILOVER` template determines answers by filtering the policy's answers
+ // using the `FILTER` rule first, then the following rules in succession: `HEALTH`, `PRIORITY`,
+ // and `LIMIT`. This gives the domain dynamic failover capability.
+ //
+ // It is **strongly recommended** to use a template other than `CUSTOM` when creating
+ // a steering policy.
+ //
+ // All templates require the rule order to begin with an unconditional `FILTER` rule that keeps
+ // answers contingent upon `answer.isDisabled != true`, except for `CUSTOM`. A defined
+ // `HEALTH` rule must follow the `FILTER` rule if the policy references a `healthCheckMonitorId`.
+ // The last rule of a template must must be a `LIMIT` rule. For more information about templates
+ // and code examples, see Traffic Management API Guide (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Concepts/trafficmanagementapi.htm).
+ // **Template Types**
+ // * `FAILOVER` - Uses health check information on your endpoints to determine which DNS answers
+ // to serve. If an endpoint fails a health check, the answer for that endpoint will be removed
+ // from the list of available answers until the endpoint is detected as healthy.
+ //
+ // * `LOAD_BALANCE` - Distributes web traffic to specified endpoints based on defined weights.
+ //
+ // * `ROUTE_BY_GEO` - Answers DNS queries based on the query's geographic location. For a list of geographic
+ // locations to route by, see Traffic Management Geographic Locations (https://docs.cloud.oracle.com/iaas/Content/TrafficManagement/Reference/trafficmanagementgeo.htm).
+ //
+ // * `ROUTE_BY_ASN` - Answers DNS queries based on the query's originating ASN.
+ //
+ // * `ROUTE_BY_IP` - Answers DNS queries based on the query's IP address.
+ //
+ // * `CUSTOM` - Allows a customized configuration of rules.
Template UpdateSteeringPolicyDetailsTemplateEnum `mandatory:"false" json:"template,omitempty"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The set of all answers that can potentially issue from the steering policy.
Answers []SteeringPolicyAnswer `mandatory:"false" json:"answers"`
- // The pipeline of rules that will be processed in sequence to reduce the pool of answers
+ // The series of rules that will be processed in sequence to reduce the pool of answers
// to a response for any given request.
+ //
// The first rule receives a shuffled list of all answers, and every other rule receives
// the list of answers emitted by the one preceding it. The last rule populates the
// response.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go
index 67f838b2f..2f4e4048c 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_steering_policy_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go
index b57f99f47..0ca6d796c 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,16 +14,19 @@ import (
)
// UpdateZoneDetails The body for updating a zone.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type UpdateZoneDetails struct {
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// External master servers for the zone. `externalMasters` becomes a
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go
index 6ad9cd2ab..09409129a 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_details.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go
index 2e8d6e22f..90d548882 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_records_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
@@ -68,7 +68,7 @@ type UpdateZoneRecordsResponse struct {
// For list pagination. When this header appears in the response, additional pages
// of results remain. For important details about how pagination works,
- // see List Pagination (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/API/Concepts/usingapi.htm#nine).
+ // see List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
// The total number of items that match the query.
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go
index d691af0be..bc29323bd 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/update_zone_request_response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
package dns
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/zone.go b/vendor/github.com/oracle/oci-go-sdk/dns/zone.go
index e9cbd0d9a..78667b9f8 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/zone.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/zone.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,7 +14,7 @@ import (
)
// Zone A DNS zone.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type Zone struct {
// The name of the zone.
@@ -26,13 +26,16 @@ type Zone struct {
// The OCID of the compartment containing the zone.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// External master servers for the zone. `externalMasters` becomes a
diff --git a/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go b/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go
index ba2c3a173..e99ee9d4f 100644
--- a/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go
+++ b/vendor/github.com/oracle/oci-go-sdk/dns/zone_summary.go
@@ -1,10 +1,10 @@
-// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
-// For more information, see Overview of the DNS Service (https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
+// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
@@ -14,7 +14,7 @@ import (
)
// ZoneSummary A DNS zone.
-// *Warning:* Oracle recommends that you avoid using any confidential information when you supply string values using the API.
+// **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
type ZoneSummary struct {
// The name of the zone.
@@ -26,13 +26,16 @@ type ZoneSummary struct {
// The OCID of the compartment containing the zone.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
- // Simple key-value pair that is applied without any predefined name, type, or scope.
- // For more information, see Resource Tags (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
- // Example: `{"bar-key": "value"}`
+ // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
- // Usage of predefined tag keys. These predefined keys are scoped to a namespace.
- // Example: `{"foo-namespace": {"bar-key": "value"}}`
+ // Defined tags for this resource. Each key is predefined and scoped to a namespace.
+ // For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
+ //
+ // **Example:** `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The canonical absolute URL of the resource.
diff --git a/vendor/github.com/sacloud/libsacloud/api/archive.go b/vendor/github.com/sacloud/libsacloud/api/archive.go
index be13faa7e..6421936a0 100644
--- a/vendor/github.com/sacloud/libsacloud/api/archive.go
+++ b/vendor/github.com/sacloud/libsacloud/api/archive.go
@@ -20,17 +20,14 @@ var (
archiveLatestStableCentOS6Tags = []string{"distro-centos", "distro-ver-6.10"}
archiveLatestStableUbuntuTags = []string{"current-stable", "distro-ubuntu"}
archiveLatestStableDebianTags = []string{"current-stable", "distro-debian"}
- archiveLatestStableVyOSTags = []string{"current-stable", "distro-vyos"}
archiveLatestStableCoreOSTags = []string{"current-stable", "distro-coreos"}
archiveLatestStableRancherOSTags = []string{"current-stable", "distro-rancheros"}
+ archiveLatestStableK3OSTags = []string{"current-stable", "distro-k3os"}
archiveLatestStableKusanagiTags = []string{"current-stable", "pkg-kusanagi"}
archiveLatestStableSophosUTMTags = []string{"current-stable", "pkg-sophosutm"}
archiveLatestStableFreeBSDTags = []string{"current-stable", "distro-freebsd"}
archiveLatestStableNetwiserTags = []string{"current-stable", "pkg-netwiserve"}
archiveLatestStableOPNsenseTags = []string{"current-stable", "distro-opnsense"}
- archiveLatestStableWindows2012Tags = []string{"os-windows", "distro-ver-2012.2"}
- archiveLatestStableWindows2012RDSTags = []string{"os-windows", "distro-ver-2012.2", "windows-rds"}
- archiveLatestStableWindows2012RDSOfficeTags = []string{"os-windows", "distro-ver-2012.2", "windows-rds", "with-office"}
archiveLatestStableWindows2016Tags = []string{"os-windows", "distro-ver-2016"}
archiveLatestStableWindows2016RDSTags = []string{"os-windows", "distro-ver-2016", "windows-rds"}
archiveLatestStableWindows2016RDSOfficeTags = []string{"os-windows", "distro-ver-2016", "windows-rds", "with-office"}
@@ -58,17 +55,14 @@ func NewArchiveAPI(client *Client) *ArchiveAPI {
ostype.CentOS6: api.FindLatestStableCentOS6,
ostype.Ubuntu: api.FindLatestStableUbuntu,
ostype.Debian: api.FindLatestStableDebian,
- ostype.VyOS: api.FindLatestStableVyOS,
ostype.CoreOS: api.FindLatestStableCoreOS,
ostype.RancherOS: api.FindLatestStableRancherOS,
+ ostype.K3OS: api.FindLatestStableK3OS,
ostype.Kusanagi: api.FindLatestStableKusanagi,
ostype.SophosUTM: api.FindLatestStableSophosUTM,
ostype.FreeBSD: api.FindLatestStableFreeBSD,
ostype.Netwiser: api.FindLatestStableNetwiser,
ostype.OPNsense: api.FindLatestStableOPNsense,
- ostype.Windows2012: api.FindLatestStableWindows2012,
- ostype.Windows2012RDS: api.FindLatestStableWindows2012RDS,
- ostype.Windows2012RDSOffice: api.FindLatestStableWindows2012RDSOffice,
ostype.Windows2016: api.FindLatestStableWindows2016,
ostype.Windows2016RDS: api.FindLatestStableWindows2016RDS,
ostype.Windows2016RDSOffice: api.FindLatestStableWindows2016RDSOffice,
@@ -245,11 +239,6 @@ func (api *ArchiveAPI) FindLatestStableUbuntu() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableUbuntuTags)
}
-// FindLatestStableVyOS 安定版最新のVyOSパブリックアーカイブを取得
-func (api *ArchiveAPI) FindLatestStableVyOS() (*sacloud.Archive, error) {
- return api.findByOSTags(archiveLatestStableVyOSTags)
-}
-
// FindLatestStableCoreOS 安定版最新のCoreOSパブリックアーカイブを取得
func (api *ArchiveAPI) FindLatestStableCoreOS() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableCoreOSTags)
@@ -260,6 +249,11 @@ func (api *ArchiveAPI) FindLatestStableRancherOS() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableRancherOSTags)
}
+// FindLatestStableK3OS 安定版最新のk3OSパブリックアーカイブを取得
+func (api *ArchiveAPI) FindLatestStableK3OS() (*sacloud.Archive, error) {
+ return api.findByOSTags(archiveLatestStableK3OSTags)
+}
+
// FindLatestStableKusanagi 安定版最新のKusanagiパブリックアーカイブを取得
func (api *ArchiveAPI) FindLatestStableKusanagi() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableKusanagiTags)
@@ -285,27 +279,6 @@ func (api *ArchiveAPI) FindLatestStableOPNsense() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableOPNsenseTags)
}
-// FindLatestStableWindows2012 安定版最新のWindows2012パブリックアーカイブを取得
-func (api *ArchiveAPI) FindLatestStableWindows2012() (*sacloud.Archive, error) {
- return api.findByOSTags(archiveLatestStableWindows2012Tags, map[string]interface{}{
- "Name": "Windows Server 2012 R2 Datacenter Edition",
- })
-}
-
-// FindLatestStableWindows2012RDS 安定版最新のWindows2012RDSパブリックアーカイブを取得
-func (api *ArchiveAPI) FindLatestStableWindows2012RDS() (*sacloud.Archive, error) {
- return api.findByOSTags(archiveLatestStableWindows2012RDSTags, map[string]interface{}{
- "Name": "Windows Server 2012 R2 for RDS",
- })
-}
-
-// FindLatestStableWindows2012RDSOffice 安定版最新のWindows2012RDS(Office)パブリックアーカイブを取得
-func (api *ArchiveAPI) FindLatestStableWindows2012RDSOffice() (*sacloud.Archive, error) {
- return api.findByOSTags(archiveLatestStableWindows2012RDSOfficeTags, map[string]interface{}{
- "Name": "Windows Server 2012 R2 for RDS(MS Office付)",
- })
-}
-
// FindLatestStableWindows2016 安定版最新のWindows2016パブリックアーカイブを取得
func (api *ArchiveAPI) FindLatestStableWindows2016() (*sacloud.Archive, error) {
return api.findByOSTags(archiveLatestStableWindows2016Tags, map[string]interface{}{
diff --git a/vendor/github.com/sacloud/libsacloud/api/client.go b/vendor/github.com/sacloud/libsacloud/api/client.go
index 19977429c..7837161e0 100644
--- a/vendor/github.com/sacloud/libsacloud/api/client.go
+++ b/vendor/github.com/sacloud/libsacloud/api/client.go
@@ -108,6 +108,7 @@ func (c *Client) isOkStatus(code int) bool {
411: false,
413: false,
415: false,
+ 423: false,
500: false,
503: false,
}
@@ -257,7 +258,7 @@ func (c *retryableHTTPClient) Do(req *request) (*http.Response, error) {
}
res, err := c.Client.Do(req.Request)
- if res != nil && res.StatusCode != 503 {
+ if res != nil && res.StatusCode != 503 && res.StatusCode != 423 {
return res, err
}
if res != nil && res.Body != nil {
diff --git a/vendor/github.com/sacloud/libsacloud/api/product_server.go b/vendor/github.com/sacloud/libsacloud/api/product_server.go
index 63807eee8..586079128 100644
--- a/vendor/github.com/sacloud/libsacloud/api/product_server.go
+++ b/vendor/github.com/sacloud/libsacloud/api/product_server.go
@@ -25,15 +25,20 @@ func NewProductServerAPI(client *Client) *ProductServerAPI {
}
// GetBySpec 指定のコア数/メモリサイズ/世代のプランを取得
-func (api *ProductServerAPI) GetBySpec(core int, memGB int, gen sacloud.PlanGenerations) (*sacloud.ProductServer, error) {
- plans, err := api.Reset().Find()
+func (api *ProductServerAPI) GetBySpec(core, memGB int, gen sacloud.PlanGenerations) (*sacloud.ProductServer, error) {
+ return api.GetBySpecCommitment(core, memGB, gen, sacloud.ECommitmentStandard)
+}
+
+// GetBySpecCommitment 指定のコア数/メモリサイズ/世代のプランを取得
+func (api *ProductServerAPI) GetBySpecCommitment(core, memGB int, gen sacloud.PlanGenerations, commitment sacloud.ECommitment) (*sacloud.ProductServer, error) {
+ plans, err := api.Reset().Limit(1000).Find()
if err != nil {
return nil, err
}
var res sacloud.ProductServer
var found bool
for _, plan := range plans.ServerPlans {
- if plan.CPU == core && plan.GetMemoryGB() == memGB {
+ if plan.CPU == core && plan.GetMemoryGB() == memGB && plan.Commitment == commitment {
if gen == sacloud.PlanDefault || gen == plan.Generation {
// PlanDefaultの場合は複数ヒットしうる。
// この場合より新しい世代を優先する。
diff --git a/vendor/github.com/sacloud/libsacloud/api/proxylb.go b/vendor/github.com/sacloud/libsacloud/api/proxylb.go
index 9e45596f3..2c02017e0 100644
--- a/vendor/github.com/sacloud/libsacloud/api/proxylb.go
+++ b/vendor/github.com/sacloud/libsacloud/api/proxylb.go
@@ -196,6 +196,15 @@ func (api *ProxyLBAPI) DeleteCertificates(id int64) (bool, error) {
return api.baseAPI.modify(method, uri, nil)
}
+// RenewLetsEncryptCert 証明書更新
+func (api *ProxyLBAPI) RenewLetsEncryptCert(id int64) (bool, error) {
+ var (
+ method = "PUT"
+ uri = fmt.Sprintf("%s/%d/proxylb/letsencryptrenew", api.getResourceURL(), id)
+ )
+ return api.baseAPI.modify(method, uri, nil)
+}
+
type proxyLBHealthResponse struct {
*sacloud.ResultFlagValue
ProxyLB *sacloud.ProxyLBStatus `json:",omitempty"`
diff --git a/vendor/github.com/sacloud/libsacloud/api/server.go b/vendor/github.com/sacloud/libsacloud/api/server.go
index 4572c6bd9..8ad08bd99 100644
--- a/vendor/github.com/sacloud/libsacloud/api/server.go
+++ b/vendor/github.com/sacloud/libsacloud/api/server.go
@@ -160,6 +160,7 @@ func (api *ServerAPI) ChangePlan(serverID int64, plan *sacloud.ProductServer) (*
body.CPU = plan.CPU
body.MemoryMB = plan.MemoryMB
body.Generation = plan.Generation
+ body.Commitment = plan.Commitment
return api.request(func(res *sacloud.Response) error {
return api.baseAPI.request(method, uri, body, res)
diff --git a/vendor/github.com/sacloud/libsacloud/libsacloud.go b/vendor/github.com/sacloud/libsacloud/libsacloud.go
index ff67288d8..863c24b5f 100644
--- a/vendor/github.com/sacloud/libsacloud/libsacloud.go
+++ b/vendor/github.com/sacloud/libsacloud/libsacloud.go
@@ -2,4 +2,4 @@
package libsacloud
// Version バージョン
-const Version = "1.21.1"
+const Version = "1.26.1"
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/common_types.go b/vendor/github.com/sacloud/libsacloud/sacloud/common_types.go
index 042b861d7..a4c6446a4 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/common_types.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/common_types.go
@@ -168,6 +168,16 @@ var (
}
)
+// ECommitment サーバプランCPUコミットメント
+type ECommitment string
+
+var (
+ // ECommitmentStandard 通常
+ ECommitmentStandard = ECommitment("standard")
+ // ECommitmentDedicatedCPU コア専有
+ ECommitmentDedicatedCPU = ECommitment("dedicatedcpu")
+)
+
// SakuraCloudResources さくらのクラウド上のリソース種別一覧
type SakuraCloudResources struct {
Server *Server `json:",omitempty"` // サーバー
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/database.go b/vendor/github.com/sacloud/libsacloud/sacloud/database.go
index 4d1b3ad60..68e2efdf3 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/database.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/database.go
@@ -260,7 +260,7 @@ type SlaveDatabaseValue struct {
func NewCreatePostgreSQLDatabaseValue() *CreateDatabaseValue {
return &CreateDatabaseValue{
DatabaseName: "postgres",
- DatabaseVersion: "10",
+ DatabaseVersion: "11",
}
}
@@ -268,7 +268,7 @@ func NewCreatePostgreSQLDatabaseValue() *CreateDatabaseValue {
func NewCreateMariaDBDatabaseValue() *CreateDatabaseValue {
return &CreateDatabaseValue{
DatabaseName: "MariaDB",
- DatabaseVersion: "10.2",
+ DatabaseVersion: "10.3",
}
}
@@ -442,7 +442,7 @@ func NewSlaveDatabaseValue(values *SlaveDatabaseValue) *Database {
},
},
// Plan
- propPlanID: propPlanID{Plan: &Resource{ID: int64(values.Plan)}},
+ propPlanID: propPlanID{Plan: &Resource{ID: int64(values.Plan) + 1}},
},
// Settings
Settings: &DatabaseSettings{
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/dns.go b/vendor/github.com/sacloud/libsacloud/sacloud/dns.go
index 35182573c..b1d0fb8f5 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/dns.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/dns.go
@@ -59,7 +59,7 @@ func CreateNewDNS(zoneName string) *DNS {
// AllowDNSTypes DNSレコード種別リスト
func AllowDNSTypes() []string {
- return []string{"A", "AAAA", "CNAME", "NS", "MX", "TXT", "SRV"}
+ return []string{"A", "AAAA", "CNAME", "NS", "MX", "TXT", "SRV", "CAA"}
}
// SetZone DNSゾーン名 設定
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archive_ostype.go b/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archive_ostype.go
index 29d754857..f7654e547 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archive_ostype.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archive_ostype.go
@@ -15,12 +15,12 @@ const (
Ubuntu
// Debian OS種別:Debian
Debian
- // VyOS OS種別:VyOS
- VyOS
// CoreOS OS種別:CoreOS
CoreOS
// RancherOS OS種別:RancherOS
RancherOS
+ // K3OS OS種別: k3OS
+ K3OS
// Kusanagi OS種別:Kusanagi(CentOS)
Kusanagi
// SophosUTM OS種別:Sophos UTM
@@ -31,12 +31,6 @@ const (
Netwiser
// OPNsense OS種別: OPNsense
OPNsense
- // Windows2012 OS種別:Windows Server 2012 R2 Datacenter Edition
- Windows2012
- // Windows2012RDS OS種別:Windows Server 2012 R2 for RDS
- Windows2012RDS
- // Windows2012RDSOffice OS種別:Windows Server 2012 R2 for RDS(Office)
- Windows2012RDSOffice
// Windows2016 OS種別:Windows Server 2016 Datacenter Edition
Windows2016
// Windows2016RDS OS種別:Windows Server 2016 RDS
@@ -61,10 +55,9 @@ const (
// OSTypeShortNames OSTypeとして利用できる文字列のリスト
var OSTypeShortNames = []string{
- "centos", "centos6", "ubuntu", "debian", "vyos", "coreos",
- "rancheros", "kusanagi", "sophos-utm", "freebsd",
+ "centos", "centos6", "ubuntu", "debian", "coreos",
+ "rancheros", "k3os", "kusanagi", "sophos-utm", "freebsd",
"netwiser", "opnsense",
- "windows2012", "windows2012-rds", "windows2012-rds-office",
"windows2016", "windows2016-rds", "windows2016-rds-office",
"windows2016-sql-web", "windows2016-sql-standard", "windows2016-sql-standard-all",
"windows2016-sql2017-standard", "windows2016-sql2017-standard-all",
@@ -74,8 +67,7 @@ var OSTypeShortNames = []string{
// IsWindows Windowsか
func (o ArchiveOSTypes) IsWindows() bool {
switch o {
- case Windows2012, Windows2012RDS, Windows2012RDSOffice,
- Windows2016, Windows2016RDS, Windows2016RDSOffice,
+ case Windows2016, Windows2016RDS, Windows2016RDSOffice,
Windows2016SQLServerWeb, Windows2016SQLServerStandard, Windows2016SQLServerStandardAll,
Windows2016SQLServer2017Standard, Windows2016SQLServer2017StandardAll,
Windows2019:
@@ -88,7 +80,7 @@ func (o ArchiveOSTypes) IsWindows() bool {
// IsSupportDiskEdit ディスクの修正機能をフルサポートしているか(Windowsは一部サポートのためfalseを返す)
func (o ArchiveOSTypes) IsSupportDiskEdit() bool {
switch o {
- case CentOS, CentOS6, Ubuntu, Debian, VyOS, CoreOS, RancherOS, Kusanagi, FreeBSD:
+ case CentOS, CentOS6, Ubuntu, Debian, CoreOS, RancherOS, K3OS, Kusanagi, FreeBSD:
return true
default:
return false
@@ -106,12 +98,12 @@ func StrToOSType(osType string) ArchiveOSTypes {
return Ubuntu
case "debian":
return Debian
- case "vyos":
- return VyOS
case "coreos":
return CoreOS
case "rancheros":
return RancherOS
+ case "k3os":
+ return K3OS
case "kusanagi":
return Kusanagi
case "sophos-utm":
@@ -122,12 +114,6 @@ func StrToOSType(osType string) ArchiveOSTypes {
return Netwiser
case "opnsense":
return OPNsense
- case "windows2012":
- return Windows2012
- case "windows2012-rds":
- return Windows2012RDS
- case "windows2012-rds-office":
- return Windows2012RDSOffice
case "windows2016":
return Windows2016
case "windows2016-rds":
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archiveostypes_string.go b/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archiveostypes_string.go
index 77d31e273..042352240 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archiveostypes_string.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/ostype/archiveostypes_string.go
@@ -4,9 +4,37 @@ package ostype
import "strconv"
-const _ArchiveOSTypes_name = "CentOSCentOS6UbuntuDebianVyOSCoreOSRancherOSKusanagiSophosUTMFreeBSDNetwiserOPNsenseWindows2012Windows2012RDSWindows2012RDSOfficeWindows2016Windows2016RDSWindows2016RDSOfficeWindows2016SQLServerWebWindows2016SQLServerStandardWindows2016SQLServer2017StandardWindows2016SQLServerStandardAllWindows2016SQLServer2017StandardAllWindows2019Custom"
+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[CentOS-0]
+ _ = x[CentOS6-1]
+ _ = x[Ubuntu-2]
+ _ = x[Debian-3]
+ _ = x[CoreOS-4]
+ _ = x[RancherOS-5]
+ _ = x[K3OS-6]
+ _ = x[Kusanagi-7]
+ _ = x[SophosUTM-8]
+ _ = x[FreeBSD-9]
+ _ = x[Netwiser-10]
+ _ = x[OPNsense-11]
+ _ = x[Windows2016-12]
+ _ = x[Windows2016RDS-13]
+ _ = x[Windows2016RDSOffice-14]
+ _ = x[Windows2016SQLServerWeb-15]
+ _ = x[Windows2016SQLServerStandard-16]
+ _ = x[Windows2016SQLServer2017Standard-17]
+ _ = x[Windows2016SQLServerStandardAll-18]
+ _ = x[Windows2016SQLServer2017StandardAll-19]
+ _ = x[Windows2019-20]
+ _ = x[Custom-21]
+}
-var _ArchiveOSTypes_index = [...]uint16{0, 6, 13, 19, 25, 29, 35, 44, 52, 61, 68, 76, 84, 95, 109, 129, 140, 154, 174, 197, 225, 257, 288, 323, 334, 340}
+const _ArchiveOSTypes_name = "CentOSCentOS6UbuntuDebianCoreOSRancherOSK3OSKusanagiSophosUTMFreeBSDNetwiserOPNsenseWindows2016Windows2016RDSWindows2016RDSOfficeWindows2016SQLServerWebWindows2016SQLServerStandardWindows2016SQLServer2017StandardWindows2016SQLServerStandardAllWindows2016SQLServer2017StandardAllWindows2019Custom"
+
+var _ArchiveOSTypes_index = [...]uint16{0, 6, 13, 19, 25, 31, 40, 44, 52, 61, 68, 76, 84, 95, 109, 129, 152, 180, 212, 243, 278, 289, 295}
func (i ArchiveOSTypes) String() string {
if i < 0 || i >= ArchiveOSTypes(len(_ArchiveOSTypes_index)-1) {
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/product_server.go b/vendor/github.com/sacloud/libsacloud/sacloud/product_server.go
index 593c342f2..db2dc8268 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/product_server.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/product_server.go
@@ -10,4 +10,5 @@ type ProductServer struct {
propMemoryMB // メモリサイズ(MB単位)
propServiceClass // サービスクラス
Generation PlanGenerations `json:",omitempty"` // 世代
+ Commitment ECommitment `json:",omitempty"`
}
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/proxylb.go b/vendor/github.com/sacloud/libsacloud/sacloud/proxylb.go
index 64523e6a8..716e935e1 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/proxylb.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/proxylb.go
@@ -56,9 +56,11 @@ func CreateNewProxyLB(name string) *ProxyLB {
},
Settings: ProxyLBSettings{
ProxyLB: ProxyLBSetting{
- HealthCheck: defaultProxyLBHealthCheck,
- SorryServer: ProxyLBSorryServer{},
- Servers: []ProxyLBServer{},
+ HealthCheck: defaultProxyLBHealthCheck,
+ SorryServer: ProxyLBSorryServer{},
+ Servers: []ProxyLBServer{},
+ LetsEncrypt: ProxyLBACMESetting{},
+ StickySession: ProxyLBSessionSetting{},
},
},
}
@@ -68,6 +70,10 @@ func CreateNewProxyLB(name string) *ProxyLB {
type ProxyLBPlan int
var (
+ // ProxyLBPlan100 100cpsプラン
+ ProxyLBPlan100 = ProxyLBPlan(100)
+ // ProxyLBPlan500 500cpsプラン
+ ProxyLBPlan500 = ProxyLBPlan(500)
// ProxyLBPlan1000 1,000cpsプラン
ProxyLBPlan1000 = ProxyLBPlan(1000)
// ProxyLBPlan5000 5,000cpsプラン
@@ -82,6 +88,8 @@ var (
// AllowProxyLBPlans 有効なプランIDリスト
var AllowProxyLBPlans = []int{
+ int(ProxyLBPlan100),
+ int(ProxyLBPlan500),
int(ProxyLBPlan1000),
int(ProxyLBPlan5000),
int(ProxyLBPlan10000),
@@ -156,8 +164,8 @@ func (p *ProxyLB) ClearProxyLBServer() {
}
// AddBindPort バインドポート追加
-func (p *ProxyLB) AddBindPort(mode string, port int) {
- p.Settings.ProxyLB.AddBindPort(mode, port)
+func (p *ProxyLB) AddBindPort(mode string, port int, redirectToHTTPS, supportHTTP2 bool, addResponseHeader []*ProxyLBResponseHeader) {
+ p.Settings.ProxyLB.AddBindPort(mode, port, redirectToHTTPS, supportHTTP2, addResponseHeader)
}
// DeleteBindPort バインドポート削除
@@ -182,10 +190,12 @@ func (p *ProxyLB) DeleteServer(ip string, port int) {
// ProxyLBSetting ProxyLBセッティング
type ProxyLBSetting struct {
- HealthCheck ProxyLBHealthCheck `json:",omitempty"` // ヘルスチェック
- SorryServer ProxyLBSorryServer `json:",omitempty"` // ソーリーサーバー
- BindPorts []*ProxyLBBindPorts `json:",omitempty"` // プロキシ方式(プロトコル&ポート)
- Servers []ProxyLBServer `json:",omitempty"` // サーバー
+ HealthCheck ProxyLBHealthCheck `json:",omitempty"` // ヘルスチェック
+ SorryServer ProxyLBSorryServer `json:",omitempty"` // ソーリーサーバー
+ BindPorts []*ProxyLBBindPorts `json:",omitempty"` // プロキシ方式(プロトコル&ポート)
+ Servers []ProxyLBServer `json:",omitempty"` // サーバー
+ LetsEncrypt ProxyLBACMESetting `json:",omitempty"` // Let's encryptでの証明書取得設定
+ StickySession ProxyLBSessionSetting `json:",omitempty"`
}
// ProxyLBSorryServer ソーリーサーバ
@@ -195,7 +205,7 @@ type ProxyLBSorryServer struct {
}
// AddBindPort バインドポート追加
-func (s *ProxyLBSetting) AddBindPort(mode string, port int) {
+func (s *ProxyLBSetting) AddBindPort(mode string, port int, redirectToHTTPS, supportHTTP2 bool, addResponseHeader []*ProxyLBResponseHeader) {
var isExist bool
for i := range s.BindPorts {
if s.BindPorts[i].ProxyMode == mode && s.BindPorts[i].Port == port {
@@ -205,8 +215,11 @@ func (s *ProxyLBSetting) AddBindPort(mode string, port int) {
if !isExist {
s.BindPorts = append(s.BindPorts, &ProxyLBBindPorts{
- ProxyMode: mode,
- Port: port,
+ ProxyMode: mode,
+ Port: port,
+ RedirectToHTTPS: redirectToHTTPS,
+ SupportHTTP2: supportHTTP2,
+ AddResponseHeader: addResponseHeader,
})
}
}
@@ -260,15 +273,24 @@ var AllowProxyLBBindModes = []string{"http", "https"}
// ProxyLBBindPorts プロキシ方式
type ProxyLBBindPorts struct {
- ProxyMode string `json:",omitempty"` // モード(プロトコル)
- Port int `json:",omitempty"` // ポート
+ ProxyMode string `json:",omitempty"` // モード(プロトコル)
+ Port int `json:",omitempty"` // ポート
+ RedirectToHTTPS bool `json:"RedirectToHttps"` // HTTPSへのリダイレクト(モードがhttpの場合のみ)
+ SupportHTTP2 bool `json:"SupportHttp2"` // HTTP/2のサポート(モードがhttpsの場合のみ)
+ AddResponseHeader []*ProxyLBResponseHeader // レスポンスヘッダ
+}
+
+// ProxyLBResponseHeader ポートごとの追加レスポンスヘッダ
+type ProxyLBResponseHeader struct {
+ Header string // ヘッダ名称(英字, 数字, ハイフン)
+ Value string // 値(英字, 数字, 半角スペース, 一部記号(!#$%&'()*+,-./:;<=>?@[]^_`{|}~))
}
// ProxyLBServer ProxyLB配下のサーバー
type ProxyLBServer struct {
IPAddress string `json:",omitempty"` // IPアドレス
Port int `json:",omitempty"` // ポート
- Enabled bool `json:",omitempty"` // 有効/無効
+ Enabled bool // 有効/無効
}
// NewProxyLBServer ProxyLB配下のサーバ作成
@@ -280,6 +302,21 @@ func NewProxyLBServer(ipaddress string, port int) *ProxyLBServer {
}
}
+// ProxyLBACMESetting Let's Encryptでの証明書取得設定
+type ProxyLBACMESetting struct {
+ Enabled bool
+ CommonName string `json:",omitempty"`
+}
+
+// ProxyLBSessionSetting セッション維持機能設定
+type ProxyLBSessionSetting struct {
+ Enabled bool
+ Method string `json:",omitempty"`
+}
+
+// ProxyLBStickySessionDefaultMethod セッション維持のデフォルトメソッド(クッキー)
+const ProxyLBStickySessionDefaultMethod = "cookie"
+
// AllowProxyLBHealthCheckProtocols プロキシLBで利用できるヘルスチェックプロトコル
var AllowProxyLBHealthCheckProtocols = []string{"http", "tcp"}
diff --git a/vendor/github.com/sacloud/libsacloud/sacloud/sim.go b/vendor/github.com/sacloud/libsacloud/sacloud/sim.go
index a663b1509..165009e39 100644
--- a/vendor/github.com/sacloud/libsacloud/sacloud/sim.go
+++ b/vendor/github.com/sacloud/libsacloud/sacloud/sim.go
@@ -52,7 +52,7 @@ type SIMInfo struct {
RegisteredDate *time.Time `json:"registered_date,omitempty"`
ActivatedDate *time.Time `json:"activated_date,omitempty"`
DeactivatedDate *time.Time `json:"deactivated_date,omitempty"`
- SIMGroupID string `json:"simgroiup_id,omitempty"`
+ SIMGroupID string `json:"simgroup_id,omitempty"`
TrafficBytesOfCurrentMonth *SIMTrafficBytes `json:"traffic_bytes_of_current_month,omitempty"`
ConnectedIMEI string `json:"connected_imei,omitempty"`
}
diff --git a/vendor/github.com/satori/go.uuid/generator.go b/vendor/github.com/satori/go.uuid/generator.go
deleted file mode 100644
index 3f2f1da2d..000000000
--- a/vendor/github.com/satori/go.uuid/generator.go
+++ /dev/null
@@ -1,239 +0,0 @@
-// Copyright (C) 2013-2018 by Maxim Bublis
-//
-// 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.
-
-package uuid
-
-import (
- "crypto/md5"
- "crypto/rand"
- "crypto/sha1"
- "encoding/binary"
- "hash"
- "net"
- "os"
- "sync"
- "time"
-)
-
-// Difference in 100-nanosecond intervals between
-// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970).
-const epochStart = 122192928000000000
-
-var (
- global = newDefaultGenerator()
-
- epochFunc = unixTimeFunc
- posixUID = uint32(os.Getuid())
- posixGID = uint32(os.Getgid())
-)
-
-// NewV1 returns UUID based on current timestamp and MAC address.
-func NewV1() UUID {
- return global.NewV1()
-}
-
-// NewV2 returns DCE Security UUID based on POSIX UID/GID.
-func NewV2(domain byte) UUID {
- return global.NewV2(domain)
-}
-
-// NewV3 returns UUID based on MD5 hash of namespace UUID and name.
-func NewV3(ns UUID, name string) UUID {
- return global.NewV3(ns, name)
-}
-
-// NewV4 returns random generated UUID.
-func NewV4() UUID {
- return global.NewV4()
-}
-
-// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.
-func NewV5(ns UUID, name string) UUID {
- return global.NewV5(ns, name)
-}
-
-// Generator provides interface for generating UUIDs.
-type Generator interface {
- NewV1() UUID
- NewV2(domain byte) UUID
- NewV3(ns UUID, name string) UUID
- NewV4() UUID
- NewV5(ns UUID, name string) UUID
-}
-
-// Default generator implementation.
-type generator struct {
- storageOnce sync.Once
- storageMutex sync.Mutex
-
- lastTime uint64
- clockSequence uint16
- hardwareAddr [6]byte
-}
-
-func newDefaultGenerator() Generator {
- return &generator{}
-}
-
-// NewV1 returns UUID based on current timestamp and MAC address.
-func (g *generator) NewV1() UUID {
- u := UUID{}
-
- timeNow, clockSeq, hardwareAddr := g.getStorage()
-
- binary.BigEndian.PutUint32(u[0:], uint32(timeNow))
- binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32))
- binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48))
- binary.BigEndian.PutUint16(u[8:], clockSeq)
-
- copy(u[10:], hardwareAddr)
-
- u.SetVersion(V1)
- u.SetVariant(VariantRFC4122)
-
- return u
-}
-
-// NewV2 returns DCE Security UUID based on POSIX UID/GID.
-func (g *generator) NewV2(domain byte) UUID {
- u := UUID{}
-
- timeNow, clockSeq, hardwareAddr := g.getStorage()
-
- switch domain {
- case DomainPerson:
- binary.BigEndian.PutUint32(u[0:], posixUID)
- case DomainGroup:
- binary.BigEndian.PutUint32(u[0:], posixGID)
- }
-
- binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32))
- binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48))
- binary.BigEndian.PutUint16(u[8:], clockSeq)
- u[9] = domain
-
- copy(u[10:], hardwareAddr)
-
- u.SetVersion(V2)
- u.SetVariant(VariantRFC4122)
-
- return u
-}
-
-// NewV3 returns UUID based on MD5 hash of namespace UUID and name.
-func (g *generator) NewV3(ns UUID, name string) UUID {
- u := newFromHash(md5.New(), ns, name)
- u.SetVersion(V3)
- u.SetVariant(VariantRFC4122)
-
- return u
-}
-
-// NewV4 returns random generated UUID.
-func (g *generator) NewV4() UUID {
- u := UUID{}
- g.safeRandom(u[:])
- u.SetVersion(V4)
- u.SetVariant(VariantRFC4122)
-
- return u
-}
-
-// NewV5 returns UUID based on SHA-1 hash of namespace UUID and name.
-func (g *generator) NewV5(ns UUID, name string) UUID {
- u := newFromHash(sha1.New(), ns, name)
- u.SetVersion(V5)
- u.SetVariant(VariantRFC4122)
-
- return u
-}
-
-func (g *generator) initStorage() {
- g.initClockSequence()
- g.initHardwareAddr()
-}
-
-func (g *generator) initClockSequence() {
- buf := make([]byte, 2)
- g.safeRandom(buf)
- g.clockSequence = binary.BigEndian.Uint16(buf)
-}
-
-func (g *generator) initHardwareAddr() {
- interfaces, err := net.Interfaces()
- if err == nil {
- for _, iface := range interfaces {
- if len(iface.HardwareAddr) >= 6 {
- copy(g.hardwareAddr[:], iface.HardwareAddr)
- return
- }
- }
- }
-
- // Initialize hardwareAddr randomly in case
- // of real network interfaces absence
- g.safeRandom(g.hardwareAddr[:])
-
- // Set multicast bit as recommended in RFC 4122
- g.hardwareAddr[0] |= 0x01
-}
-
-func (g *generator) safeRandom(dest []byte) {
- if _, err := rand.Read(dest); err != nil {
- panic(err)
- }
-}
-
-// Returns UUID v1/v2 storage state.
-// Returns epoch timestamp, clock sequence, and hardware address.
-func (g *generator) getStorage() (uint64, uint16, []byte) {
- g.storageOnce.Do(g.initStorage)
-
- g.storageMutex.Lock()
- defer g.storageMutex.Unlock()
-
- timeNow := epochFunc()
- // Clock changed backwards since last UUID generation.
- // Should increase clock sequence.
- if timeNow <= g.lastTime {
- g.clockSequence++
- }
- g.lastTime = timeNow
-
- return timeNow, g.clockSequence, g.hardwareAddr[:]
-}
-
-// Returns difference in 100-nanosecond intervals between
-// UUID epoch (October 15, 1582) and current time.
-// This is default epoch calculation function.
-func unixTimeFunc() uint64 {
- return epochStart + uint64(time.Now().UnixNano()/100)
-}
-
-// Returns UUID based on hashing of namespace UUID and name.
-func newFromHash(h hash.Hash, ns UUID, name string) UUID {
- u := UUID{}
- h.Write(ns[:])
- h.Write([]byte(name))
- copy(u[:], h.Sum(nil))
-
- return u
-}
diff --git a/vendor/github.com/transip/gotransip/domain/api.go b/vendor/github.com/transip/gotransip/domain/api.go
index df68db3eb..830da8522 100644
--- a/vendor/github.com/transip/gotransip/domain/api.go
+++ b/vendor/github.com/transip/gotransip/domain/api.go
@@ -117,15 +117,19 @@ func GetIsLocked(c gotransip.Client, domainName string) (bool, error) {
return v, err
}
-// Register registers a domain name and will automatically create and sign a proposition for it
-func Register(c gotransip.Client, domain Domain) error {
+// Register registers a domain name and will automatically create and sign a
+// proposition for it. It returns the TransIP proposition number or an error
+// when registering the domain fails
+func Register(c gotransip.Client, domain Domain) (string, error) {
sr := gotransip.SoapRequest{
Service: serviceName,
Method: "register",
}
sr.AddArgument("domain", domain)
- return c.Call(sr, nil)
+ var v string
+ err := c.Call(sr, &v)
+ return v, err
}
// Cancel cancels a domain name, will automatically create and sign a cancellation document
@@ -140,8 +144,9 @@ func Cancel(c gotransip.Client, domainName string, endTime gotransip.Cancellatio
return c.Call(sr, nil)
}
-// TransferWithOwnerChange transfers a domain with changing the owner
-func TransferWithOwnerChange(c gotransip.Client, domain, authCode string) error {
+// TransferWithOwnerChange transfers a domain with changing the owner. It returns
+// the TransIP proposition number or an error when transferring the domain fails
+func TransferWithOwnerChange(c gotransip.Client, domain, authCode string) (string, error) {
sr := gotransip.SoapRequest{
Service: serviceName,
Method: "transferWithOwnerChange",
@@ -149,11 +154,15 @@ func TransferWithOwnerChange(c gotransip.Client, domain, authCode string) error
sr.AddArgument("domain", domain)
sr.AddArgument("authCode", authCode)
- return c.Call(sr, nil)
+ var v string
+ err := c.Call(sr, &v)
+ return v, err
}
-// TransferWithoutOwnerChange transfers a domain without changing the owner
-func TransferWithoutOwnerChange(c gotransip.Client, domain, authCode string) error {
+// TransferWithoutOwnerChange transfers a domain without changing the owner. It
+// returns the TransIP proposition number or an error when transferring the domain
+// fails
+func TransferWithoutOwnerChange(c gotransip.Client, domain, authCode string) (string, error) {
sr := gotransip.SoapRequest{
Service: serviceName,
Method: "transferWithoutOwnerChange",
@@ -161,7 +170,9 @@ func TransferWithoutOwnerChange(c gotransip.Client, domain, authCode string) err
sr.AddArgument("domain", domain)
sr.AddArgument("authCode", authCode)
- return c.Call(sr, nil)
+ var v string
+ err := c.Call(sr, &v)
+ return v, err
}
// SetNameservers starts a nameserver change for this domain, will replace all
@@ -203,7 +214,7 @@ func UnsetLock(c gotransip.Client, domainName string) error {
// dns entries with the new entries
func SetDNSEntries(c gotransip.Client, domainName string, dnsEntries DNSEntries) error {
sr := gotransip.SoapRequest{
- Service: serviceName,
+ Service: dnsServiceName,
Method: "setDnsEntries",
}
sr.AddArgument("domainName", domainName)
@@ -312,3 +323,81 @@ func CancelDomainAction(c gotransip.Client, domain string) error {
return c.Call(sr, nil)
}
+
+// RequestAuthCode requests the authcode at the registry
+func RequestAuthCode(c gotransip.Client, domainName string) (string, error) {
+ sr := gotransip.SoapRequest{
+ Service: serviceName,
+ Method: "requestAuthCode",
+ }
+ sr.AddArgument("domain", domainName)
+
+ var v string
+ err := c.Call(sr, &v)
+ return v, err
+}
+
+// Handover a Domain to another TransIP User. Please be aware that this will NOT
+// change the owner contact information at the registry. If you want to change
+// the domain owner at the registry, then you should execute a 'SetOwner'.
+func Handover(c gotransip.Client, domainName, targetAccountName string) error {
+ sr := gotransip.SoapRequest{
+ Service: serviceName,
+ Method: "handover",
+ }
+ sr.AddArgument("domainName", domainName)
+ sr.AddArgument("targetAccountname", targetAccountName)
+
+ return c.Call(sr, nil)
+}
+
+// CanEditDNSSec checks if the DNSSec entries of a domain can be updated.
+func CanEditDNSSec(c gotransip.Client, domainName string) (bool, error) {
+ sr := gotransip.SoapRequest{
+ Service: dnsServiceName,
+ Method: "canEditDnsSec",
+ }
+ sr.AddArgument("domainName", domainName)
+
+ var v bool
+ err := c.Call(sr, &v)
+ return v, err
+}
+
+// GetDNSSecEntries returns DNSSec entries for given domain name
+func GetDNSSecEntries(c gotransip.Client, domainName string) (DNSSecEntries, error) {
+ sr := gotransip.SoapRequest{
+ Service: dnsServiceName,
+ Method: "getDnsSecEntries",
+ }
+ sr.AddArgument("domainName", domainName)
+
+ var v struct {
+ V DNSSecEntries `xml:"item"`
+ }
+ err := c.Call(sr, &v)
+ return v.V, err
+}
+
+// SetDNSSecEntries sets new DNSSec entries for a domain, replacing the current ones.
+func SetDNSSecEntries(c gotransip.Client, domainName string, dnssecKeyEntrySet DNSSecEntries) error {
+ sr := gotransip.SoapRequest{
+ Service: dnsServiceName,
+ Method: "setDnsSecEntries",
+ }
+ sr.AddArgument("domainName", domainName)
+ sr.AddArgument("dnssecKeyEntrySet", dnssecKeyEntrySet)
+
+ return c.Call(sr, nil)
+}
+
+// RemoveAllDNSSecEntries removes all the DNSSec entries from a domain.
+func RemoveAllDNSSecEntries(c gotransip.Client, domainName string) error {
+ sr := gotransip.SoapRequest{
+ Service: dnsServiceName,
+ Method: "removeAllDnsSecEntries",
+ }
+ sr.AddArgument("domainName", domainName)
+
+ return c.Call(sr, nil)
+}
diff --git a/vendor/github.com/transip/gotransip/domain/domain.go b/vendor/github.com/transip/gotransip/domain/domain.go
index a3b5e4b82..ca6a0741b 100644
--- a/vendor/github.com/transip/gotransip/domain/domain.go
+++ b/vendor/github.com/transip/gotransip/domain/domain.go
@@ -9,7 +9,8 @@ import (
)
const (
- serviceName string = "DomainService"
+ serviceName string = "DomainService"
+ dnsServiceName string = "DnsService"
)
// Domain represents a Transip_Domain object
@@ -240,6 +241,98 @@ func (d DNSEntries) EncodeArgs(key string) string {
return fmt.Sprintf("%s%s>", output, key)
}
+// DNSSecAlgorithm represents the possible types of DNSSec algorithms
+type DNSSecAlgorithm int
+
+const (
+ // DNSSecAlgorithmDSA represents DSA
+ DNSSecAlgorithmDSA DNSSecAlgorithm = iota + 3
+ _
+ // DNSSecAlgorithmRSASHA1 represents RSASHA1
+ DNSSecAlgorithmRSASHA1
+ // DNSSecAlgorithmDSANSEC3SHA1 represents DSANSEC3SHA1
+ DNSSecAlgorithmDSANSEC3SHA1
+ // DNSSecAlgorithmRSASHA1NSEC3SHA1 represents RSASHA1NSEC3SHA1
+ DNSSecAlgorithmRSASHA1NSEC3SHA1
+ // DNSSecAlgorithmRSASHA256 represents RSASHA256
+ DNSSecAlgorithmRSASHA256
+ // DNSSecAlgorithmRSASHA512 represents RSASHA512
+ DNSSecAlgorithmRSASHA512 DNSSecAlgorithm = iota + 4
+ _
+ // DNSSecAlgorithmECCGOST represents ECCGOST
+ DNSSecAlgorithmECCGOST
+ // DNSSecAlgorithmECDSAP256SHA256 represents ECDSAP256SHA256
+ DNSSecAlgorithmECDSAP256SHA256
+ // DNSSecAlgorithmECDSAP384SHA384 represents ECDSAP384SHA384
+ DNSSecAlgorithmECDSAP384SHA384
+ // DNSSecAlgorithmED25519 represents ED25519
+ DNSSecAlgorithmED25519
+ // DNSSecAlgorithmED448 represents ED448
+ DNSSecAlgorithmED448
+)
+
+// DNSSecFlag represents the possible types of DNSSec flags
+type DNSSecFlag int
+
+const (
+ // DNSSecFlagNone means no flag is set
+ DNSSecFlagNone DNSSecFlag = 0
+ // DNSSecFlagZSK means this is a Zone Signing Key
+ DNSSecFlagZSK DNSSecFlag = 256
+ // DNSSecFlagKSK means this is a Key Signing Key
+ DNSSecFlagKSK DNSSecFlag = 257
+)
+
+// DNSSecEntry represents a Transip_DnsSecEntry object as described at
+// https://api.transip.nl/docs/transip.nl/class-Transip_DnsSecEntry.html
+type DNSSecEntry struct {
+ KeyTag int `xml:"keyTag"`
+ Flags DNSSecFlag `xml:"flags"`
+ Algorithm DNSSecAlgorithm `xml:"algorithm"`
+ PublicKey string `xml:"publicKey"`
+}
+
+// DNSSecEntries is just an array of DNSSecEntry
+// basically only here so it can implement paramsEncoder
+type DNSSecEntries []DNSSecEntry
+
+// EncodeParams returns DNSSecEntries parameters ready to be used for constructing
+// a signature
+// the order of parameters added here has to match the order in the WSDL as
+// described at http://api.transip.nl/wsdl/?service=DnsService
+func (d DNSSecEntries) EncodeParams(prm gotransip.ParamsContainer, prefix string) {
+ if len(d) == 0 {
+ prm.Add("anything", nil)
+ return
+ }
+
+ if len(prefix) == 0 {
+ prefix = fmt.Sprintf("%d", prm.Len())
+ }
+
+ for i, e := range d {
+ prm.Add(fmt.Sprintf("%s[%d][keyTag]", prefix, i), fmt.Sprintf("%d", e.KeyTag))
+ prm.Add(fmt.Sprintf("%s[%d][flags]", prefix, i), fmt.Sprintf("%d", e.Flags))
+ prm.Add(fmt.Sprintf("%s[%d][algorithm]", prefix, i), fmt.Sprintf("%d", e.Algorithm))
+ prm.Add(fmt.Sprintf("%s[%d][publicKey]", prefix, i), e.PublicKey)
+ }
+}
+
+// EncodeArgs returns Entries XML body ready to be passed in the SOAP call
+func (d DNSSecEntries) EncodeArgs(key string) string {
+ output := fmt.Sprintf(`<%s SOAP-ENC:arrayType="ns1:DnsSecEntry[%d]" xsi:type="ns1:ArrayOfDnsSecEntry">`, key, len(d)) + "\n"
+ for _, e := range d {
+ output += fmt.Sprintf(` -
+ %d
+ %d
+ %d
+ %s
+
`, e.KeyTag, e.Flags, e.Algorithm, e.PublicKey) + "\n"
+ }
+
+ return fmt.Sprintf("%s%s>", output, key)
+}
+
// Status reflects the current status of a domain in a check result
type Status string
@@ -298,14 +391,14 @@ func (b Branding) EncodeParams(prm gotransip.ParamsContainer, prefix string) {
// EncodeArgs returns Branding XML body ready to be passed in the SOAP call
func (b Branding) EncodeArgs(key string) string {
return fmt.Sprintf(`
- %s
- %s
- %s
- %s
- %s
- %s
- %s
- `, b.CompanyName, b.SupportEmail, b.CompanyURL, b.TermsOfUsageURL, b.BannerLine1, b.BannerLine2, b.BannerLine3)
+ %s
+ %s
+ %s
+ %s
+ %s
+ %s
+ %s
+`, b.CompanyName, b.SupportEmail, b.CompanyURL, b.TermsOfUsageURL, b.BannerLine1, b.BannerLine2, b.BannerLine3)
}
// Action reflects the available actions to perform on a domain
diff --git a/vendor/github.com/JamesClonk/vultr/LICENSE b/vendor/github.com/vultr/govultr/LICENSE
similarity index 94%
rename from vendor/github.com/JamesClonk/vultr/LICENSE
rename to vendor/github.com/vultr/govultr/LICENSE
index be20a1280..2ea4faa68 100644
--- a/vendor/github.com/JamesClonk/vultr/LICENSE
+++ b/vendor/github.com/vultr/govultr/LICENSE
@@ -1,6 +1,6 @@
-The MIT License (MIT)
+MIT License
-Copyright (c) 2015 Fabio Berchtold
+Copyright (c) 2019 Vultr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ 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/vultr/govultr/account.go b/vendor/github.com/vultr/govultr/account.go
new file mode 100644
index 000000000..33a16dfd5
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/account.go
@@ -0,0 +1,45 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+)
+
+// AccountService is the interface to interact with Accounts endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#account
+type AccountService interface {
+ GetInfo(ctx context.Context) (*Account, error)
+}
+
+// AccountServiceHandler handles interaction with the account methods for the Vultr API
+type AccountServiceHandler struct {
+ client *Client
+}
+
+// Account represents a Vultr account
+type Account struct {
+ Balance string `json:"balance"`
+ PendingCharges string `json:"pending_charges"`
+ LastPaymentDate string `json:"last_payment_date"`
+ LastPaymentAmount string `json:"last_payment_amount"`
+}
+
+// GetInfo Vultr account info
+func (a *AccountServiceHandler) GetInfo(ctx context.Context) (*Account, error) {
+
+ uri := "/v1/account/info"
+ req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ account := new(Account)
+ err = a.client.DoWithContext(ctx, req, account)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return account, nil
+}
diff --git a/vendor/github.com/vultr/govultr/api.go b/vendor/github.com/vultr/govultr/api.go
new file mode 100644
index 000000000..2ebfb99ab
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/api.go
@@ -0,0 +1,44 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+)
+
+// APIService is the interface to interact with the API endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#auth
+type APIService interface {
+ GetInfo(ctx context.Context) (*API, error)
+}
+
+// APIServiceHandler handles interaction with the API methods for the Vultr API
+type APIServiceHandler struct {
+ client *Client
+}
+
+// API represents Vultr API information
+type API struct {
+ ACL []string `json:"acls"`
+ Email string `json:"email"`
+ Name string `json:"name"`
+}
+
+// GetInfo Vultr API auth information
+func (a *APIServiceHandler) GetInfo(ctx context.Context) (*API, error) {
+ uri := "/v1/auth/info"
+
+ req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ api := new(API)
+ err = a.client.DoWithContext(ctx, req, api)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return api, nil
+}
diff --git a/vendor/github.com/vultr/govultr/application.go b/vendor/github.com/vultr/govultr/application.go
new file mode 100644
index 000000000..9199bd95b
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/application.go
@@ -0,0 +1,51 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+)
+
+// ApplicationService is the interface to interact with the Application endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#app
+type ApplicationService interface {
+ List(ctx context.Context) ([]Application, error)
+}
+
+// ApplicationServiceHandler handles interaction with the application methods for the Vultr API
+type ApplicationServiceHandler struct {
+ client *Client
+}
+
+// Application represents a Vultr application
+type Application struct {
+ AppID string `json:"APPID"`
+ Name string `json:"name"`
+ ShortName string `json:"short_name"`
+ DeployName string `json:"deploy_name"`
+ Surcharge float64 `json:"surcharge"`
+}
+
+// List retrieves a list of available applications that can be launched when creating a Vultr VPS
+func (a *ApplicationServiceHandler) List(ctx context.Context) ([]Application, error) {
+
+ uri := "/v1/app/list"
+ req, err := a.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ appsMap := make(map[string]Application)
+
+ err = a.client.DoWithContext(ctx, req, &appsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var apps []Application
+ for _, app := range appsMap {
+ apps = append(apps, app)
+ }
+
+ return apps, nil
+}
diff --git a/vendor/github.com/vultr/govultr/backup.go b/vendor/github.com/vultr/govultr/backup.go
new file mode 100644
index 000000000..0a87c6408
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/backup.go
@@ -0,0 +1,105 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+)
+
+// BackupService is the interface to interact with the backup endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#backup
+type BackupService interface {
+ List(ctx context.Context) ([]Backup, error)
+ Get(ctx context.Context, backupID string) (*Backup, error)
+ ListBySub(ctx context.Context, subID string) ([]Backup, error)
+}
+
+// BackupServiceHandler handles interaction with the backup methods for the Vultr API
+type BackupServiceHandler struct {
+ client *Client
+}
+
+// Backup represents a Vultr backup
+type Backup struct {
+ BackupID string `json:"BACKUPID"`
+ DateCreated string `json:"date_created"`
+ Description string `json:"description"`
+ Size string `json:"size"`
+ Status string `json:"status"`
+}
+
+// List retrieves a list of all backups on the current account
+func (b *BackupServiceHandler) List(ctx context.Context) ([]Backup, error) {
+ uri := "/v1/backup/list"
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ backupsMap := make(map[string]Backup)
+ err = b.client.DoWithContext(ctx, req, &backupsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var backups []Backup
+ for _, backup := range backupsMap {
+ backups = append(backups, backup)
+ }
+
+ return backups, nil
+}
+
+// Get retrieves a backup that matches the given backupID
+func (b *BackupServiceHandler) Get(ctx context.Context, backupID string) (*Backup, error) {
+ uri := "/v1/backup/list"
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("BACKUPID", backupID)
+ req.URL.RawQuery = q.Encode()
+
+ backupsMap := make(map[string]Backup)
+ err = b.client.DoWithContext(ctx, req, &backupsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ backup := new(Backup)
+ for _, bk := range backupsMap {
+ backup = &bk
+ }
+
+ return backup, nil
+}
+
+// ListBySub retrieves a list of all backups on the current account that match the given subID
+func (b *BackupServiceHandler) ListBySub(ctx context.Context, subID string) ([]Backup, error) {
+ uri := "/v1/backup/list"
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", subID)
+ req.URL.RawQuery = q.Encode()
+
+ backupsMap := make(map[string]Backup)
+ err = b.client.DoWithContext(ctx, req, &backupsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var backups []Backup
+ for _, backup := range backupsMap {
+ backups = append(backups, backup)
+ }
+
+ return backups, nil
+}
diff --git a/vendor/github.com/vultr/govultr/bare_metal_server.go b/vendor/github.com/vultr/govultr/bare_metal_server.go
new file mode 100644
index 000000000..22ce4368c
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/bare_metal_server.go
@@ -0,0 +1,790 @@
+package govultr
+
+import (
+ "context"
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// BareMetalServerService is the interface to interact with the bare metal endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#baremetal
+type BareMetalServerService interface {
+ AppInfo(ctx context.Context, serverID string) (*AppInfo, error)
+ Bandwidth(ctx context.Context, serverID string) ([]map[string]string, error)
+ ChangeApp(ctx context.Context, serverID, appID string) error
+ ChangeOS(ctx context.Context, serverID, osID string) error
+ Create(ctx context.Context, regionID, planID, osID string, options *BareMetalServerOptions) (*BareMetalServer, error)
+ Delete(ctx context.Context, serverID string) error
+ EnableIPV6(ctx context.Context, serverID string) error
+ List(ctx context.Context) ([]BareMetalServer, error)
+ ListByLabel(ctx context.Context, label string) ([]BareMetalServer, error)
+ ListByMainIP(ctx context.Context, mainIP string) ([]BareMetalServer, error)
+ ListByTag(ctx context.Context, tag string) ([]BareMetalServer, error)
+ GetServer(ctx context.Context, serverID string) (*BareMetalServer, error)
+ GetUserData(ctx context.Context, serverID string) (*UserData, error)
+ Halt(ctx context.Context, serverID string) error
+ IPV4Info(ctx context.Context, serverID string) ([]BareMetalServerIPV4, error)
+ IPV6Info(ctx context.Context, serverID string) ([]BareMetalServerIPV6, error)
+ ListApps(ctx context.Context, serverID string) ([]Application, error)
+ ListOS(ctx context.Context, serverID string) ([]OS, error)
+ Reboot(ctx context.Context, serverID string) error
+ Reinstall(ctx context.Context, serverID string) error
+ SetLabel(ctx context.Context, serverID, label string) error
+ SetTag(ctx context.Context, serverID, tag string) error
+ SetUserData(ctx context.Context, serverID, userData string) error
+}
+
+// BareMetalServerServiceHandler handles interaction with the bare metal methods for the Vultr API
+type BareMetalServerServiceHandler struct {
+ client *Client
+}
+
+// BareMetalServer represents a bare metal server on Vultr
+type BareMetalServer struct {
+ BareMetalServerID string `json:"SUBID"`
+ Os string `json:"os"`
+ RAM string `json:"ram"`
+ Disk string `json:"disk"`
+ MainIP string `json:"main_ip"`
+ CPUs int `json:"cpu_count"`
+ Location string `json:"location"`
+ RegionID int `json:"DCID"`
+ DefaultPassword string `json:"default_password"`
+ DateCreated string `json:"date_created"`
+ Status string `json:"status"`
+ NetmaskV4 string `json:"netmask_v4"`
+ GatewayV4 string `json:"gateway_v4"`
+ BareMetalPlanID int `json:"METALPLANID"`
+ V6Networks []V6Network `json:"v6_networks"`
+ Label string `json:"label"`
+ Tag string `json:"tag"`
+ OsID string `json:"OSID"`
+ AppID string `json:"APPID"`
+}
+
+// BareMetalServerOptions represents the optional parameters that can be set when creating a bare metal server
+type BareMetalServerOptions struct {
+ StartupScriptID string
+ SnapshotID string
+ EnableIPV6 string
+ Label string
+ SSHKeyIDs []string
+ AppID string
+ UserData string
+ NotifyActivate string
+ Hostname string
+ Tag string
+ ReservedIPV4 string
+}
+
+// BareMetalServerIPV4 represents IPV4 information for a bare metal server
+type BareMetalServerIPV4 struct {
+ IP string `json:"ip"`
+ Netmask string `json:"netmask"`
+ Gateway string `json:"gateway"`
+ Type string `json:"type"`
+}
+
+// BareMetalServerIPV6 represents IPV6 information for a bare metal server
+type BareMetalServerIPV6 struct {
+ IP string `json:"ip"`
+ Network string `json:"network"`
+ NetworkSize int `json:"network_size"`
+ Type string `json:"type"`
+}
+
+// UnmarshalJSON implements a custom unmarshaler on BareMetalServer
+// This is done to help reduce data inconsistency with V1 of the Vultr API
+func (b *BareMetalServer) UnmarshalJSON(data []byte) error {
+ if b == nil {
+ *b = BareMetalServer{}
+ }
+
+ var v map[string]interface{}
+ if err := json.Unmarshal(data, &v); err != nil {
+ return err
+ }
+
+ cpu, err := b.unmarshalInt(fmt.Sprintf("%v", v["cpu_count"]))
+ if err != nil {
+ return err
+ }
+ b.CPUs = cpu
+
+ region, err := b.unmarshalInt(fmt.Sprintf("%v", v["DCID"]))
+ if err != nil {
+ return err
+ }
+ b.RegionID = region
+
+ plan, err := b.unmarshalInt(fmt.Sprintf("%v", v["METALPLANID"]))
+ if err != nil {
+ return err
+ }
+ b.BareMetalPlanID = plan
+
+ b.BareMetalServerID = b.unmarshalStr(fmt.Sprintf("%v", v["SUBID"]))
+ b.Os = b.unmarshalStr(fmt.Sprintf("%v", v["os"]))
+ b.RAM = b.unmarshalStr(fmt.Sprintf("%v", v["ram"]))
+ b.Label = b.unmarshalStr(fmt.Sprintf("%v", v["label"]))
+ b.Disk = b.unmarshalStr(fmt.Sprintf("%v", v["disk"]))
+ b.MainIP = b.unmarshalStr(fmt.Sprintf("%v", v["main_ip"]))
+ b.Location = b.unmarshalStr(fmt.Sprintf("%v", v["location"]))
+ b.DefaultPassword = b.unmarshalStr(fmt.Sprintf("%v", v["default_password"]))
+ b.DateCreated = b.unmarshalStr(fmt.Sprintf("%v", v["date_created"]))
+ b.Status = b.unmarshalStr(fmt.Sprintf("%v", v["status"]))
+ b.NetmaskV4 = b.unmarshalStr(fmt.Sprintf("%v", v["netmask_v4"]))
+ b.GatewayV4 = b.unmarshalStr(fmt.Sprintf("%v", v["gateway_v4"]))
+ b.Tag = b.unmarshalStr(fmt.Sprintf("%v", v["tag"]))
+ b.OsID = b.unmarshalStr(fmt.Sprintf("%v", v["OSID"]))
+ b.AppID = b.unmarshalStr(fmt.Sprintf("%v", v["APPID"]))
+
+ v6networks := make([]V6Network, 0)
+ if networks, ok := v["v6_networks"].([]interface{}); ok {
+ for _, network := range networks {
+ if network, ok := network.(map[string]interface{}); ok {
+ v6network := V6Network{
+ Network: fmt.Sprintf("%v", network["v6_network"]),
+ MainIP: fmt.Sprintf("%v", network["v6_main_ip"]),
+ NetworkSize: fmt.Sprintf("%v", network["v6_network_size"]),
+ }
+ v6networks = append(v6networks, v6network)
+ }
+ }
+ b.V6Networks = v6networks
+ }
+
+ return nil
+}
+
+func (b *BareMetalServer) unmarshalInt(value string) (int, error) {
+ if len(value) == 0 || value == "" {
+ value = "0"
+ }
+
+ v, err := strconv.Atoi(value)
+ if err != nil {
+ return 0, err
+ }
+
+ return v, nil
+}
+
+func (b *BareMetalServer) unmarshalStr(value string) string {
+ if value == "" {
+ value = ""
+ }
+
+ return value
+}
+
+// AppInfo retrieves the application information for a given server ID
+func (b *BareMetalServerServiceHandler) AppInfo(ctx context.Context, serverID string) (*AppInfo, error) {
+ uri := "/v1/baremetal/get_app_info"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ appInfo := new(AppInfo)
+
+ err = b.client.DoWithContext(ctx, req, appInfo)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return appInfo, nil
+}
+
+// Bandwidth will get the bandwidth used by a bare metal server
+func (b *BareMetalServerServiceHandler) Bandwidth(ctx context.Context, serverID string) ([]map[string]string, error) {
+ uri := "/v1/baremetal/bandwidth"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ var bandwidthMap map[string][][]interface{}
+ err = b.client.DoWithContext(ctx, req, &bandwidthMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var bandwidth []map[string]string
+
+ for _, b := range bandwidthMap["incoming_bytes"] {
+ inMap := make(map[string]string)
+ inMap["date"] = fmt.Sprintf("%v", b[0])
+ var bytes int64
+ switch b[1].(type) {
+ case float64:
+ bytes = int64(b[1].(float64))
+ case int64:
+ bytes = b[1].(int64)
+ }
+ inMap["incoming"] = fmt.Sprintf("%v", bytes)
+ bandwidth = append(bandwidth, inMap)
+ }
+
+ for _, b := range bandwidthMap["outgoing_bytes"] {
+ for i := range bandwidth {
+ if bandwidth[i]["date"] == b[0] {
+ var bytes int64
+ switch b[1].(type) {
+ case float64:
+ bytes = int64(b[1].(float64))
+ case int64:
+ bytes = b[1].(int64)
+ }
+ bandwidth[i]["outgoing"] = fmt.Sprintf("%v", bytes)
+ break
+ }
+ }
+ }
+
+ return bandwidth, nil
+}
+
+// ChangeApp changes the bare metal server to a different application.
+func (b *BareMetalServerServiceHandler) ChangeApp(ctx context.Context, serverID, appID string) error {
+ uri := "/v1/baremetal/app_change"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ "APPID": {appID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ChangeOS changes the bare metal server to a different operating system. All data will be permanently lost.
+func (b *BareMetalServerServiceHandler) ChangeOS(ctx context.Context, serverID, osID string) error {
+ uri := "/v1/baremetal/os_change"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ "OSID": {osID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Create a new bare metal server.
+func (b *BareMetalServerServiceHandler) Create(ctx context.Context, regionID, planID, osID string, options *BareMetalServerOptions) (*BareMetalServer, error) {
+ uri := "/v1/baremetal/create"
+
+ values := url.Values{
+ "DCID": {regionID},
+ "METALPLANID": {planID},
+ "OSID": {osID},
+ }
+
+ if options != nil {
+ if options.StartupScriptID != "" {
+ values.Add("SCRIPTID", options.StartupScriptID)
+ }
+ if options.SnapshotID != "" {
+ values.Add("SNAPSHOTID", options.SnapshotID)
+ }
+ if options.EnableIPV6 != "" {
+ values.Add("enable_ipv6", options.EnableIPV6)
+ }
+ if options.Label != "" {
+ values.Add("label", options.Label)
+ }
+ if options.SSHKeyIDs != nil && len(options.SSHKeyIDs) != 0 {
+ values.Add("SSHKEYID", strings.Join(options.SSHKeyIDs, ","))
+ }
+ if options.AppID != "" {
+ values.Add("APPID", options.AppID)
+ }
+ if options.UserData != "" {
+ values.Add("userdata", base64.StdEncoding.EncodeToString([]byte(options.UserData)))
+ }
+ if options.NotifyActivate != "" {
+ values.Add("notify_activate", options.NotifyActivate)
+ }
+ if options.Hostname != "" {
+ values.Add("hostname", options.Hostname)
+ }
+ if options.Tag != "" {
+ values.Add("tag", options.Tag)
+ }
+ if options.ReservedIPV4 != "" {
+ values.Add("reserved_ip_v4", options.ReservedIPV4)
+ }
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ bm := new(BareMetalServer)
+
+ err = b.client.DoWithContext(ctx, req, bm)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return bm, nil
+}
+
+// Delete a bare metal server.
+// All data will be permanently lost, and the IP address will be released. There is no going back from this call.
+func (b *BareMetalServerServiceHandler) Delete(ctx context.Context, serverID string) error {
+ uri := "/v1/baremetal/destroy"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// EnableIPV6 enables IPv6 networking on a bare metal server by assigning an IPv6 subnet to it.
+// The server will not be rebooted when the subnet is assigned.
+func (b *BareMetalServerServiceHandler) EnableIPV6(ctx context.Context, serverID string) error {
+ uri := "/v1/baremetal/ipv6_enable"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List lists all bare metal servers on the current account. This includes both pending and active servers.
+func (b *BareMetalServerServiceHandler) List(ctx context.Context) ([]BareMetalServer, error) {
+ return b.list(ctx, "", "")
+}
+
+// ListByLabel lists all bare metal servers that match the given label on the current account. This includes both pending and active servers.
+func (b *BareMetalServerServiceHandler) ListByLabel(ctx context.Context, label string) ([]BareMetalServer, error) {
+ return b.list(ctx, "label", label)
+}
+
+// ListByMainIP lists all bare metal servers that match the given IP address on the current account. This includes both pending and active servers.
+func (b *BareMetalServerServiceHandler) ListByMainIP(ctx context.Context, mainIP string) ([]BareMetalServer, error) {
+ return b.list(ctx, "main_ip", mainIP)
+}
+
+// ListByTag lists all bare metal servers that match the given tag on the current account. This includes both pending and active servers.
+func (b *BareMetalServerServiceHandler) ListByTag(ctx context.Context, tag string) ([]BareMetalServer, error) {
+ return b.list(ctx, "tag", tag)
+}
+
+func (b *BareMetalServerServiceHandler) list(ctx context.Context, key, value string) ([]BareMetalServer, error) {
+ uri := "/v1/baremetal/list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ if key != "" {
+ q := req.URL.Query()
+ q.Add(key, value)
+ req.URL.RawQuery = q.Encode()
+ }
+
+ bmsMap := make(map[string]BareMetalServer)
+ err = b.client.DoWithContext(ctx, req, &bmsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var bms []BareMetalServer
+ for _, bm := range bmsMap {
+ bms = append(bms, bm)
+ }
+
+ return bms, nil
+}
+
+// GetServer gets the server with the given ID
+func (b *BareMetalServerServiceHandler) GetServer(ctx context.Context, serverID string) (*BareMetalServer, error) {
+ uri := "/v1/baremetal/list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ bms := new(BareMetalServer)
+ err = b.client.DoWithContext(ctx, req, bms)
+ if err != nil {
+ return nil, err
+ }
+
+ return bms, nil
+}
+
+// GetUserData retrieves the (base64 encoded) user-data for this bare metal server
+func (b *BareMetalServerServiceHandler) GetUserData(ctx context.Context, serverID string) (*UserData, error) {
+ uri := "/v1/baremetal/get_user_data"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ userData := new(UserData)
+ err = b.client.DoWithContext(ctx, req, userData)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return userData, nil
+}
+
+// Halt a bare metal server.
+// This is a hard power off, meaning that the power to the machine is severed.
+// The data on the machine will not be modified, and you will still be billed for the machine.
+func (b *BareMetalServerServiceHandler) Halt(ctx context.Context, serverID string) error {
+ uri := "/v1/baremetal/halt"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// IPV4Info will List the IPv4 information of a bare metal server.
+// IP information is only available for bare metal servers in the "active" state.
+func (b *BareMetalServerServiceHandler) IPV4Info(ctx context.Context, serverID string) ([]BareMetalServerIPV4, error) {
+ uri := "/v1/baremetal/list_ipv4"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+
+ req.URL.RawQuery = q.Encode()
+
+ var ipMap map[string][]BareMetalServerIPV4
+ err = b.client.DoWithContext(ctx, req, &ipMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ipv4 []BareMetalServerIPV4
+ for _, i := range ipMap {
+ ipv4 = i
+ }
+
+ return ipv4, nil
+}
+
+// IPV6Info ists the IPv6 information of a bare metal server.
+// IP information is only available for bare metal servers in the "active" state.
+// If the bare metal server does not have IPv6 enabled, then an empty array is returned.
+func (b *BareMetalServerServiceHandler) IPV6Info(ctx context.Context, serverID string) ([]BareMetalServerIPV6, error) {
+ uri := "/v1/baremetal/list_ipv6"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ var ipMap map[string][]BareMetalServerIPV6
+ err = b.client.DoWithContext(ctx, req, &ipMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ipv6 []BareMetalServerIPV6
+ for _, i := range ipMap {
+ ipv6 = i
+ }
+
+ return ipv6, nil
+}
+
+// ListApps retrieves a list of Vultr one-click applications to which a bare metal server can be changed.
+// Always check against this list before trying to switch applications because it is not possible to switch between every application combination.
+func (b *BareMetalServerServiceHandler) ListApps(ctx context.Context, serverID string) ([]Application, error) {
+ uri := "/v1/baremetal/app_change_list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ var appMap map[string]Application
+ err = b.client.DoWithContext(ctx, req, &appMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var appList []Application
+ for _, a := range appMap {
+ appList = append(appList, a)
+ }
+
+ return appList, nil
+}
+
+// ListOS retrieves a list of operating systems to which a bare metal server can be changed.
+// Always check against this list before trying to switch operating systems because it is not possible to switch between every operating system combination.
+func (b *BareMetalServerServiceHandler) ListOS(ctx context.Context, serverID string) ([]OS, error) {
+ uri := "/v1/baremetal/os_change_list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", serverID)
+ req.URL.RawQuery = q.Encode()
+
+ var osMap map[string]OS
+ err = b.client.DoWithContext(ctx, req, &osMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var os []OS
+ for _, o := range osMap {
+ os = append(os, o)
+ }
+
+ return os, nil
+}
+
+// Reboot a bare metal server. This is a hard reboot, which means that the server is powered off, then back on.
+func (b *BareMetalServerServiceHandler) Reboot(ctx context.Context, serverID string) error {
+ uri := "/v1/baremetal/reboot"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Reinstall the operating system on a bare metal server.
+// All data will be permanently lost, but the IP address will remain the same. There is no going back from this call.
+func (b *BareMetalServerServiceHandler) Reinstall(ctx context.Context, serverID string) error {
+ uri := "/v1/baremetal/reinstall"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetLabel sets the label of a bare metal server.
+func (b *BareMetalServerServiceHandler) SetLabel(ctx context.Context, serverID, label string) error {
+ uri := "/v1/baremetal/label_set"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ "label": {label},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetTag sets the tag of a bare metal server.
+func (b *BareMetalServerServiceHandler) SetTag(ctx context.Context, serverID, tag string) error {
+ uri := "/v1/baremetal/tag_set"
+
+ values := url.Values{
+ "SUBID": {serverID},
+ "tag": {tag},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetUserData sets the user-data for this server.
+// User-data is a generic data store, which some provisioning tools and cloud operating systems use as a configuration file.
+// It is generally consumed only once after an instance has been launched, but individual needs may vary.
+func (b *BareMetalServerServiceHandler) SetUserData(ctx context.Context, serverID, userData string) error {
+ uri := "/v1/baremetal/set_user_data"
+
+ encodedUserData := base64.StdEncoding.EncodeToString([]byte(userData))
+
+ values := url.Values{
+ "SUBID": {serverID},
+ "userdata": {encodedUserData},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/block_storage.go b/vendor/github.com/vultr/govultr/block_storage.go
new file mode 100644
index 000000000..c62f926d7
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/block_storage.go
@@ -0,0 +1,319 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// BlockStorageService is the interface to interact with Block-Storage endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#block
+type BlockStorageService interface {
+ Attach(ctx context.Context, blockID, InstanceID string) error
+ Create(ctx context.Context, regionID, size int, label string) (*BlockStorage, error)
+ Delete(ctx context.Context, blockID string) error
+ Detach(ctx context.Context, blockID string) error
+ SetLabel(ctx context.Context, blockID, label string) error
+ List(ctx context.Context) ([]BlockStorage, error)
+ Get(ctx context.Context, blockID string) (*BlockStorage, error)
+ Resize(ctx context.Context, blockID string, size int) error
+}
+
+// BlockStorageServiceHandler handles interaction with the block-storage methods for the Vultr API
+type BlockStorageServiceHandler struct {
+ client *Client
+}
+
+// BlockStorage represents Vultr Block-Storage
+type BlockStorage struct {
+ BlockStorageID string `json:"SUBID"`
+ DateCreated string `json:"date_created"`
+ CostPerMonth string `json:"cost_per_month"`
+ Status string `json:"status"`
+ SizeGB int `json:"size_gb"`
+ RegionID int `json:"DCID"`
+ InstanceID string `json:"attached_to_SUBID"`
+ Label string `json:"label"`
+}
+
+// UnmarshalJSON implements json.Unmarshaller on BlockStorage to handle the inconsistent types returned from the Vultr v1 API.
+func (b *BlockStorage) UnmarshalJSON(data []byte) (err error) {
+ if b == nil {
+ *b = BlockStorage{}
+ }
+
+ var v map[string]interface{}
+ if err := json.Unmarshal(data, &v); err != nil {
+ return err
+ }
+
+ b.BlockStorageID, err = b.unmarshalStr(fmt.Sprintf("%v", v["SUBID"]))
+ if err != nil {
+ return err
+ }
+
+ b.RegionID, err = b.unmarshalInt(fmt.Sprintf("%v", v["DCID"]))
+ if err != nil {
+ return err
+ }
+
+ b.SizeGB, err = b.unmarshalInt(fmt.Sprintf("%v", v["size_gb"]))
+ if err != nil {
+ return err
+ }
+
+ b.InstanceID, err = b.unmarshalStr(fmt.Sprintf("%v", v["attached_to_SUBID"]))
+ if err != nil {
+ return err
+ }
+
+ b.CostPerMonth, err = b.unmarshalStr(fmt.Sprintf("%v", v["cost_per_month"]))
+ if err != nil {
+ return err
+ }
+
+ date := fmt.Sprintf("%v", v["date_created"])
+ if date == "" {
+ date = ""
+ }
+ b.DateCreated = date
+
+ status := fmt.Sprintf("%v", v["status"])
+ if status == "" {
+ status = ""
+ }
+ b.Status = status
+
+ b.Label = fmt.Sprintf("%v", v["label"])
+
+ return nil
+}
+
+func (b *BlockStorage) unmarshalInt(value string) (int, error) {
+ if len(value) == 0 || value == "" {
+ value = "0"
+ }
+
+ i, err := strconv.ParseInt(value, 10, 64)
+ if err != nil {
+ return 0, err
+ }
+
+ return int(i), nil
+}
+
+func (b *BlockStorage) unmarshalStr(value string) (string, error) {
+ if len(value) == 0 || value == "" || value == "0" || value == "false" {
+ return "", nil
+ }
+
+ f, err := strconv.ParseFloat(value, 64)
+ if err != nil {
+ return "", err
+ }
+
+ return strconv.FormatFloat(f, 'f', -1, 64), nil
+}
+
+// Attach will link a given block storage to a given Vultr vps
+func (b *BlockStorageServiceHandler) Attach(ctx context.Context, blockID, InstanceID string) error {
+
+ uri := "/v1/block/attach"
+
+ values := url.Values{
+ "SUBID": {blockID},
+ "attach_to_SUBID": {InstanceID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Create builds out a block storage
+func (b *BlockStorageServiceHandler) Create(ctx context.Context, regionID, sizeGB int, label string) (*BlockStorage, error) {
+
+ uri := "/v1/block/create"
+
+ values := url.Values{
+ "DCID": {strconv.Itoa(regionID)},
+ "size_gb": {strconv.Itoa(sizeGB)},
+ "label": {label},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ blockStorage := new(BlockStorage)
+
+ err = b.client.DoWithContext(ctx, req, blockStorage)
+
+ if err != nil {
+ return nil, err
+ }
+
+ blockStorage.RegionID = regionID
+ blockStorage.Label = label
+ blockStorage.SizeGB = sizeGB
+
+ return blockStorage, nil
+}
+
+// Delete will remove block storage instance from your Vultr account
+func (b *BlockStorageServiceHandler) Delete(ctx context.Context, blockID string) error {
+
+ uri := "/v1/block/delete"
+
+ values := url.Values{
+ "SUBID": {blockID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Detach will de-link a given block storage to the Vultr vps it is attached to
+func (b *BlockStorageServiceHandler) Detach(ctx context.Context, blockID string) error {
+
+ uri := "/v1/block/detach"
+
+ values := url.Values{
+ "SUBID": {blockID},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetLabel allows you to set/update the label on your Vultr Block storage
+func (b *BlockStorageServiceHandler) SetLabel(ctx context.Context, blockID, label string) error {
+ uri := "/v1/block/label_set"
+
+ values := url.Values{
+ "SUBID": {blockID},
+ "label": {label},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List returns a list of all block storage instances on your Vultr Account
+func (b *BlockStorageServiceHandler) List(ctx context.Context) ([]BlockStorage, error) {
+
+ uri := "/v1/block/list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var blockStorage []BlockStorage
+ err = b.client.DoWithContext(ctx, req, &blockStorage)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return blockStorage, nil
+}
+
+// Get returns a single block storage instance based ony our blockID you provide from your Vultr Account
+func (b *BlockStorageServiceHandler) Get(ctx context.Context, blockID string) (*BlockStorage, error) {
+
+ uri := "/v1/block/list"
+
+ req, err := b.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", blockID)
+ req.URL.RawQuery = q.Encode()
+
+ blockStorage := new(BlockStorage)
+ err = b.client.DoWithContext(ctx, req, blockStorage)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return blockStorage, nil
+}
+
+// Resize allows you to resize your Vultr block storage instance
+func (b *BlockStorageServiceHandler) Resize(ctx context.Context, blockID string, sizeGB int) error {
+
+ uri := "/v1/block/resize"
+
+ values := url.Values{
+ "SUBID": {blockID},
+ "size_gb": {strconv.Itoa(sizeGB)},
+ }
+
+ req, err := b.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = b.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/dns_domains.go b/vendor/github.com/vultr/govultr/dns_domains.go
new file mode 100644
index 000000000..dbd9913b7
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/dns_domains.go
@@ -0,0 +1,209 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+)
+
+// DNSDomainService is the interface to interact with the DNS endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#dns
+type DNSDomainService interface {
+ Create(ctx context.Context, domain, InstanceIP string) error
+ Delete(ctx context.Context, domain string) error
+ ToggleDNSSec(ctx context.Context, domain string, enabled bool) error
+ DNSSecInfo(ctx context.Context, domain string) ([]string, error)
+ List(ctx context.Context) ([]DNSDomain, error)
+ GetSoa(ctx context.Context, domain string) (*Soa, error)
+ UpdateSoa(ctx context.Context, domain, nsPrimary, email string) error
+}
+
+// DNSDomainServiceHandler handles interaction with the DNS methods for the Vultr API
+type DNSDomainServiceHandler struct {
+ client *Client
+}
+
+// DNSDomain represents a DNS Domain entry on Vultr
+type DNSDomain struct {
+ Domain string `json:"domain"`
+ DateCreated string `json:"date_created"`
+}
+
+// Soa represents record information for a domain on Vultr
+type Soa struct {
+ NsPrimary string `json:"nsprimary"`
+ Email string `json:"email"`
+}
+
+// Create will create a DNS Domain entry on Vultr
+func (d *DNSDomainServiceHandler) Create(ctx context.Context, domain, InstanceIP string) error {
+
+ uri := "/v1/dns/create_domain"
+
+ values := url.Values{
+ "domain": {domain},
+ "serverip": {InstanceIP},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+//Delete will delete a domain name and all associated records
+func (d *DNSDomainServiceHandler) Delete(ctx context.Context, domain string) error {
+ uri := "/v1/dns/delete_domain"
+
+ values := url.Values{
+ "domain": {domain},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ToggleDNSSec will enable or disable DNSSEC for a domain on Vultr
+func (d *DNSDomainServiceHandler) ToggleDNSSec(ctx context.Context, domain string, enabled bool) error {
+
+ uri := "/v1/dns/dnssec_enable"
+
+ enable := "no"
+ if enabled == true {
+ enable = "yes"
+ }
+
+ values := url.Values{
+ "domain": {domain},
+ "enable": {enable},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// DNSSecInfo gets the DNSSec keys for a domain (if enabled)
+func (d *DNSDomainServiceHandler) DNSSecInfo(ctx context.Context, domain string) ([]string, error) {
+
+ uri := "/v1/dns/dnssec_info"
+
+ req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("domain", domain)
+ req.URL.RawQuery = q.Encode()
+
+ var DNSSec []string
+ err = d.client.DoWithContext(ctx, req, &DNSSec)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return DNSSec, nil
+}
+
+// List gets all domains associated with the current Vultr account.
+func (d *DNSDomainServiceHandler) List(ctx context.Context) ([]DNSDomain, error) {
+ uri := "/v1/dns/list"
+
+ req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var dnsDomains []DNSDomain
+ err = d.client.DoWithContext(ctx, req, &dnsDomains)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return dnsDomains, nil
+}
+
+// GetSoa gets the SOA record information for a domain
+func (d *DNSDomainServiceHandler) GetSoa(ctx context.Context, domain string) (*Soa, error) {
+ uri := "/v1/dns/soa_info"
+
+ req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("domain", domain)
+ req.URL.RawQuery = q.Encode()
+
+ soa := new(Soa)
+ err = d.client.DoWithContext(ctx, req, soa)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return soa, nil
+}
+
+// UpdateSoa will update the SOA record information for a domain.
+func (d *DNSDomainServiceHandler) UpdateSoa(ctx context.Context, domain, nsPrimary, email string) error {
+
+ uri := "/v1/dns/soa_update"
+
+ values := url.Values{
+ "domain": {domain},
+ "nsprimary": {nsPrimary},
+ "email": {email},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/dns_records.go b/vendor/github.com/vultr/govultr/dns_records.go
new file mode 100644
index 000000000..29260a5b5
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/dns_records.go
@@ -0,0 +1,150 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// DNSRecordService is the interface to interact with the DNS Records endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#dns
+type DNSRecordService interface {
+ Create(ctx context.Context, domain, recordType, name, data string, ttl, priority int) error
+ Delete(ctx context.Context, domain, recordID string) error
+ List(ctx context.Context, domain string) ([]DNSRecord, error)
+ Update(ctx context.Context, domain string, dnsRecord *DNSRecord) error
+}
+
+// DNSRecordsServiceHandler handles interaction with the DNS Records methods for the Vultr API
+type DNSRecordsServiceHandler struct {
+ client *Client
+}
+
+// DNSRecord represents a DNS record on Vultr
+type DNSRecord struct {
+ RecordID int `json:"RECORDID"`
+ Type string `json:"type"`
+ Name string `json:"name"`
+ Data string `json:"data"`
+ Priority int `json:"priority"`
+ TTL int `json:"ttl"`
+}
+
+// Create will add a DNS record.
+func (d *DNSRecordsServiceHandler) Create(ctx context.Context, domain, recordType, name, data string, ttl, priority int) error {
+
+ uri := "/v1/dns/create_record"
+
+ values := url.Values{
+ "domain": {domain},
+ "name": {name},
+ "type": {recordType},
+ "data": {data},
+ "ttl": {strconv.Itoa(ttl)},
+ "priority": {strconv.Itoa(priority)},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Delete will delete a domain name and all associated records.
+func (d *DNSRecordsServiceHandler) Delete(ctx context.Context, domain, recordID string) error {
+
+ uri := "/v1/dns/delete_record"
+
+ values := url.Values{
+ "domain": {domain},
+ "RECORDID": {recordID},
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list all the records associated with a particular domain on Vultr
+func (d *DNSRecordsServiceHandler) List(ctx context.Context, domain string) ([]DNSRecord, error) {
+
+ uri := "/v1/dns/records"
+
+ req, err := d.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("domain", domain)
+ req.URL.RawQuery = q.Encode()
+
+ var dnsRecord []DNSRecord
+ err = d.client.DoWithContext(ctx, req, &dnsRecord)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return dnsRecord, nil
+}
+
+// Update will update a DNS record
+func (d *DNSRecordsServiceHandler) Update(ctx context.Context, domain string, dnsRecord *DNSRecord) error {
+
+ uri := "/v1/dns/update_record"
+
+ values := url.Values{
+ "domain": {domain},
+ "RECORDID": {strconv.Itoa(dnsRecord.RecordID)},
+ }
+
+ // Optional
+ if dnsRecord.Name != "" {
+ values.Add("name", dnsRecord.Name)
+ }
+ if dnsRecord.Data != "" {
+ values.Add("data", dnsRecord.Data)
+ }
+ if dnsRecord.TTL != 0 {
+ values.Add("ttl", strconv.Itoa(dnsRecord.TTL))
+ }
+ if dnsRecord.Priority != 0 {
+ values.Add("priority", strconv.Itoa(dnsRecord.Priority))
+ }
+
+ req, err := d.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = d.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/firewall_group.go b/vendor/github.com/vultr/govultr/firewall_group.go
new file mode 100644
index 000000000..ee874d10b
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/firewall_group.go
@@ -0,0 +1,163 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+)
+
+// FirewallGroupService is the interface to interact with the firewall group endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#firewall
+type FirewallGroupService interface {
+ Create(ctx context.Context, description string) (*FirewallGroup, error)
+ Delete(ctx context.Context, groupID string) error
+ List(ctx context.Context) ([]FirewallGroup, error)
+ Get(ctx context.Context, groupID string) (*FirewallGroup, error)
+ ChangeDescription(ctx context.Context, groupID, description string) error
+}
+
+// FireWallGroupServiceHandler handles interaction with the firewall group methods for the Vultr API
+type FireWallGroupServiceHandler struct {
+ client *Client
+}
+
+// FirewallGroup represents a Vultr firewall group
+type FirewallGroup struct {
+ FirewallGroupID string `json:"FIREWALLGROUPID"`
+ Description string `json:"description"`
+ DateCreated string `json:"date_created"`
+ DateModified string `json:"date_modified"`
+ InstanceCount int `json:"instance_count"`
+ RuleCount int `json:"rule_count"`
+ MaxRuleCount int `json:"max_rule_count"`
+}
+
+// Create will create a new firewall group on your Vultr account
+func (f *FireWallGroupServiceHandler) Create(ctx context.Context, description string) (*FirewallGroup, error) {
+
+ uri := "/v1/firewall/group_create"
+
+ values := url.Values{
+ "description": {description},
+ }
+
+ req, err := f.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ firewall := new(FirewallGroup)
+ err = f.client.DoWithContext(ctx, req, firewall)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return firewall, nil
+}
+
+// Delete will delete a firewall group from your Vultr account
+func (f *FireWallGroupServiceHandler) Delete(ctx context.Context, groupID string) error {
+
+ uri := "/v1/firewall/group_delete"
+
+ values := url.Values{
+ "FIREWALLGROUPID": {groupID},
+ }
+
+ req, err := f.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = f.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will return a list of all firewall groups on your Vultr account
+func (f *FireWallGroupServiceHandler) List(ctx context.Context) ([]FirewallGroup, error) {
+
+ uri := "/v1/firewall/group_list"
+
+ req, err := f.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var firewallGroupMap map[string]FirewallGroup
+ err = f.client.DoWithContext(ctx, req, &firewallGroupMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var firewallGroup []FirewallGroup
+ for _, f := range firewallGroupMap {
+ firewallGroup = append(firewallGroup, f)
+ }
+
+ return firewallGroup, nil
+}
+
+// Get will return a firewall group based on provided groupID from your Vultr account
+func (f *FireWallGroupServiceHandler) Get(ctx context.Context, groupID string) (*FirewallGroup, error) {
+
+ uri := "/v1/firewall/group_list"
+
+ req, err := f.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("FIREWALLGROUPID", groupID)
+ req.URL.RawQuery = q.Encode()
+
+ var firewallGroupMap map[string]FirewallGroup
+ err = f.client.DoWithContext(ctx, req, &firewallGroupMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ firewallGroup := new(FirewallGroup)
+ for _, f := range firewallGroupMap {
+ firewallGroup = &f
+ }
+
+ return firewallGroup, nil
+}
+
+// ChangeDescription will change the description of a firewall group
+func (f *FireWallGroupServiceHandler) ChangeDescription(ctx context.Context, groupID, description string) error {
+
+ uri := "/v1/firewall/group_set_description"
+
+ values := url.Values{
+ "FIREWALLGROUPID": {groupID},
+ "description": {description},
+ }
+
+ req, err := f.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = f.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/firewall_rule.go b/vendor/github.com/vultr/govultr/firewall_rule.go
new file mode 100644
index 000000000..ab99c1ab7
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/firewall_rule.go
@@ -0,0 +1,265 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "net"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// FireWallRuleService is the interface to interact with the firewall rule endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#firewall
+type FireWallRuleService interface {
+ Create(ctx context.Context, groupID, protocol, port, network, notes string) (*FirewallRule, error)
+ Delete(ctx context.Context, groupID, ruleID string) error
+ ListByIPType(ctx context.Context, groupID, ipType string) ([]FirewallRule, error)
+ List(ctx context.Context, groupID string) ([]FirewallRule, error)
+}
+
+// FireWallRuleServiceHandler handles interaction with the firewall rule methods for the Vultr API
+type FireWallRuleServiceHandler struct {
+ client *Client
+}
+
+// FirewallRule represents a Vultr firewall rule
+type FirewallRule struct {
+ RuleNumber int `json:"rulenumber"`
+ Action string `json:"action"`
+ Protocol string `json:"protocol"`
+ Port string `json:"port"`
+ Network *net.IPNet `json:"network"`
+ Notes string `json:"notes"`
+}
+
+// UnmarshalJSON implements a custom unmarshaler on FirewallRule
+// This is done to help reduce data inconsistency with V1 of the Vultr API
+// It also merges the subnet & subnet_mask into a single type of *net.IPNet
+func (f *FirewallRule) UnmarshalJSON(data []byte) (err error) {
+ if f == nil {
+ *f = FirewallRule{}
+ }
+
+ // Pull out all of the data that was given to us and put it into a map
+ var fields map[string]interface{}
+ err = json.Unmarshal(data, &fields)
+
+ if err != nil {
+ return err
+ }
+
+ // Unmarshal RuleNumber
+ value := fmt.Sprintf("%v", fields["rulenumber"])
+ number, _ := strconv.Atoi(value)
+ f.RuleNumber = number
+
+ // Unmarshal all other strings
+
+ action := fmt.Sprintf("%v", fields["action"])
+ if action == "" {
+ action = ""
+ }
+ f.Action = action
+
+ protocol := fmt.Sprintf("%v", fields["protocol"])
+ if protocol == "" {
+ protocol = ""
+ }
+ f.Protocol = protocol
+
+ port := fmt.Sprintf("%v", fields["port"])
+ if port == "" {
+ port = ""
+ }
+ f.Port = port
+
+ notes := fmt.Sprintf("%v", fields["notes"])
+ if notes == "" {
+ notes = ""
+ }
+ f.Notes = notes
+
+ // Unmarshal subnet_size & subnet and convert to *net.IP
+ value = fmt.Sprintf("%v", fields["subnet_size"])
+ if len(value) == 0 || value == "" {
+ value = "0"
+ }
+ subnetSize, _ := strconv.Atoi(value)
+
+ subnet := fmt.Sprintf("%v", fields["subnet"])
+ if subnet == "" {
+ subnet = ""
+ }
+
+ if len(subnet) > 0 {
+ _, ipNet, err := net.ParseCIDR(fmt.Sprintf("%s/%d", subnet, subnetSize))
+
+ if err != nil {
+ return errors.New("an issue has occurred while parsing subnet")
+ }
+
+ f.Network = ipNet
+ }
+
+ return
+}
+
+// Create will create a rule in a firewall group.
+func (f *FireWallRuleServiceHandler) Create(ctx context.Context, groupID, protocol, port, cdirBlock, notes string) (*FirewallRule, error) {
+
+ uri := "/v1/firewall/rule_create"
+
+ ip, ipNet, err := net.ParseCIDR(cdirBlock)
+
+ if err != nil {
+ return nil, err
+ }
+
+ values := url.Values{
+ "FIREWALLGROUPID": {groupID},
+ "direction": {"in"},
+ "protocol": {protocol},
+ "subnet": {ip.String()},
+ }
+
+ // mask
+ mask, _ := ipNet.Mask.Size()
+ values.Add("subnet_size", strconv.Itoa(mask))
+
+ // ip Type
+ if ipNet.IP.To4() != nil {
+ values.Add("ip_type", "v4")
+ } else {
+ values.Add("ip_type", "v6")
+ }
+
+ // Optional params
+ if port != "" {
+ values.Add("port", port)
+ }
+
+ if notes != "" {
+ values.Add("notes", notes)
+ }
+
+ req, err := f.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ firewallRule := new(FirewallRule)
+ err = f.client.DoWithContext(ctx, req, firewallRule)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return firewallRule, nil
+}
+
+// Delete will delete a firewall rule on your Vultr account
+func (f *FireWallRuleServiceHandler) Delete(ctx context.Context, groupID, ruleID string) error {
+
+ uri := "/v1/firewall/rule_delete"
+
+ values := url.Values{
+ "FIREWALLGROUPID": {groupID},
+ "rulenumber": {ruleID},
+ }
+
+ req, err := f.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = f.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list the current firewall rules in a firewall group.
+// ipType values that can be passed in are "v4", "v6"
+func (f *FireWallRuleServiceHandler) ListByIPType(ctx context.Context, groupID, ipType string) ([]FirewallRule, error) {
+
+ uri := "/v1/firewall/rule_list"
+
+ req, err := f.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("FIREWALLGROUPID", groupID)
+ q.Add("direction", "in")
+ q.Add("ip_type", ipType)
+ req.URL.RawQuery = q.Encode()
+ var firewallRuleMap map[string]FirewallRule
+
+ err = f.client.DoWithContext(ctx, req, &firewallRuleMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var firewallRule []FirewallRule
+ for _, f := range firewallRuleMap {
+ firewallRule = append(firewallRule, f)
+ }
+
+ return firewallRule, nil
+}
+
+// List will return both ipv4 an ipv6 firewall rules that are defined within a firewall group
+func (f *FireWallRuleServiceHandler) List(ctx context.Context, groupID string) ([]FirewallRule, error) {
+ uri := "/v1/firewall/rule_list"
+
+ req, err := f.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("FIREWALLGROUPID", groupID)
+ q.Add("direction", "in")
+ q.Add("ip_type", "v4")
+
+ req.URL.RawQuery = q.Encode()
+
+ var firewallRuleMap map[string]FirewallRule
+
+ // V4 call
+ err = f.client.DoWithContext(ctx, req, &firewallRuleMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ // V6 call
+ q.Del("ip_type")
+ q.Add("ip_type", "v6")
+ req.URL.RawQuery = q.Encode()
+
+ err = f.client.DoWithContext(ctx, req, &firewallRuleMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var firewallRule []FirewallRule
+ for _, f := range firewallRuleMap {
+ firewallRule = append(firewallRule, f)
+ }
+
+ return firewallRule, nil
+}
diff --git a/vendor/github.com/vultr/govultr/govultr.go b/vendor/github.com/vultr/govultr/govultr.go
new file mode 100644
index 000000000..b05208938
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/govultr.go
@@ -0,0 +1,222 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "errors"
+ "io"
+ "io/ioutil"
+ "net/http"
+ "net/url"
+ "strings"
+ "time"
+)
+
+const (
+ version = "0.1.4"
+ defaultBase = "https://api.vultr.com"
+ userAgent = "govultr/" + version
+ rateLimit = 600 * time.Millisecond
+)
+
+// APIKey contains a users API Key for interacting with the API
+type APIKey struct {
+ // API Key
+ key string
+}
+
+// Client manages interaction with the Vultr V1 API
+type Client struct {
+ // Http Client used to interact with the Vultr V1 API
+ client *http.Client
+
+ // BASE URL for APIs
+ BaseURL *url.URL
+
+ // User Agent for the client
+ UserAgent string
+
+ // API Key
+ APIKey APIKey
+
+ // API Rate Limit - Vultr rate limits based on time
+ RateLimit time.Duration
+
+ // Services used to interact with the API
+ Account AccountService
+ API APIService
+ Application ApplicationService
+ Backup BackupService
+ BareMetalServer BareMetalServerService
+ BlockStorage BlockStorageService
+ DNSDomain DNSDomainService
+ DNSRecord DNSRecordService
+ FirewallGroup FirewallGroupService
+ FirewallRule FireWallRuleService
+ ISO ISOService
+ Network NetworkService
+ OS OSService
+ Plan PlanService
+ Region RegionService
+ ReservedIP ReservedIPService
+ Server ServerService
+ Snapshot SnapshotService
+ SSHKey SSHKeyService
+ StartupScript StartupScriptService
+ User UserService
+
+ // Optional function called after every successful request made to the Vultr API
+ onRequestCompleted RequestCompletionCallback
+}
+
+// RequestCompletionCallback defines the type of the request callback function
+type RequestCompletionCallback func(*http.Request, *http.Response)
+
+// NewClient returns a Vultr API Client
+func NewClient(httpClient *http.Client, key string) *Client {
+
+ if httpClient == nil {
+ httpClient = http.DefaultClient
+ }
+
+ baseURL, _ := url.Parse(defaultBase)
+
+ client := &Client{
+ client: httpClient,
+ BaseURL: baseURL,
+ UserAgent: userAgent,
+ RateLimit: rateLimit,
+ }
+
+ client.Account = &AccountServiceHandler{client}
+ client.API = &APIServiceHandler{client}
+ client.Application = &ApplicationServiceHandler{client}
+ client.Backup = &BackupServiceHandler{client}
+ client.BareMetalServer = &BareMetalServerServiceHandler{client}
+ client.BlockStorage = &BlockStorageServiceHandler{client}
+ client.DNSDomain = &DNSDomainServiceHandler{client}
+ client.DNSRecord = &DNSRecordsServiceHandler{client}
+ client.FirewallGroup = &FireWallGroupServiceHandler{client}
+ client.FirewallRule = &FireWallRuleServiceHandler{client}
+ client.ISO = &ISOServiceHandler{client}
+ client.Network = &NetworkServiceHandler{client}
+ client.OS = &OSServiceHandler{client}
+ client.Plan = &PlanServiceHandler{client}
+ client.Region = &RegionServiceHandler{client}
+ client.Server = &ServerServiceHandler{client}
+ client.ReservedIP = &ReservedIPServiceHandler{client}
+ client.Snapshot = &SnapshotServiceHandler{client}
+ client.SSHKey = &SSHKeyServiceHandler{client}
+ client.StartupScript = &StartupScriptServiceHandler{client}
+ client.User = &UserServiceHandler{client}
+
+ apiKey := APIKey{key: key}
+ client.APIKey = apiKey
+
+ return client
+}
+
+// NewRequest creates an API Request
+func (c *Client) NewRequest(ctx context.Context, method, uri string, body url.Values) (*http.Request, error) {
+
+ path, err := url.Parse(uri)
+ resolvedURL := c.BaseURL.ResolveReference(path)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var reqBody io.Reader
+
+ if body != nil {
+ reqBody = strings.NewReader(body.Encode())
+ } else {
+ reqBody = nil
+ }
+
+ req, err := http.NewRequest(method, resolvedURL.String(), reqBody)
+
+ if err != nil {
+ return nil, err
+ }
+
+ req.Header.Add("API-key", c.APIKey.key)
+ req.Header.Add("User-Agent", c.UserAgent)
+ req.Header.Add("Accept", "application/json")
+
+ if req.Method == "POST" {
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ }
+
+ return req, nil
+}
+
+// DoWithContext sends an API Request and returns back the response. The API response is checked to see if it was
+// a successful call. A successful call is then checked to see if we need to unmarshal since some resources
+// have their own implements of unmarshal.
+func (c *Client) DoWithContext(ctx context.Context, r *http.Request, data interface{}) error {
+
+ // Sleep this call
+ time.Sleep(c.RateLimit)
+
+ req := r.WithContext(ctx)
+ res, err := c.client.Do(req)
+
+ if c.onRequestCompleted != nil {
+ c.onRequestCompleted(req, res)
+ }
+
+ if err != nil {
+ return err
+ }
+
+ defer res.Body.Close()
+
+ body, err := ioutil.ReadAll(res.Body)
+
+ if err != nil {
+ return err
+ }
+
+ if res.StatusCode == http.StatusOK {
+ if data != nil {
+ if string(body) == "[]" {
+ data = nil
+ } else {
+ if err := json.Unmarshal(body, data); err != nil {
+ return err
+ }
+ }
+ }
+ return nil
+ }
+
+ return errors.New(string(body))
+}
+
+// SetBaseURL Overrides the default BaseUrl
+func (c *Client) SetBaseURL(baseURL string) error {
+ updatedURL, err := url.Parse(baseURL)
+
+ if err != nil {
+ return err
+ }
+
+ c.BaseURL = updatedURL
+ return nil
+}
+
+// SetRateLimit Overrides the default rateLimit
+func (c *Client) SetRateLimit(time time.Duration) {
+ c.RateLimit = time
+}
+
+// SetUserAgent Overrides the default UserAgent
+func (c *Client) SetUserAgent(ua string) {
+ c.UserAgent = ua
+}
+
+// OnRequestCompleted sets the API request completion callback
+func (c *Client) OnRequestCompleted(rc RequestCompletionCallback) {
+ c.onRequestCompleted = rc
+}
diff --git a/vendor/github.com/vultr/govultr/iso.go b/vendor/github.com/vultr/govultr/iso.go
new file mode 100644
index 000000000..8cedd34cd
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/iso.go
@@ -0,0 +1,142 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// ISOService is the interface to interact with the ISO endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#ISO
+type ISOService interface {
+ CreateFromURL(ctx context.Context, ISOURL string) (*ISO, error)
+ Delete(ctx context.Context, ISOID int) error
+ List(ctx context.Context) ([]ISO, error)
+ GetPublicList(ctx context.Context) ([]PublicISO, error)
+}
+
+// ISOServiceHandler handles interaction with the ISO methods for the Vultr API
+type ISOServiceHandler struct {
+ Client *Client
+}
+
+// ISO represents ISOs currently available on this account.
+type ISO struct {
+ ISOID int `json:"ISOID"`
+ DateCreated string `json:"date_created"`
+ FileName string `json:"filename"`
+ Size int `json:"size"`
+ MD5Sum string `json:"md5sum"`
+ SHA512Sum string `json:"sha512sum"`
+ Status string `json:"status"`
+}
+
+// PublicISO represents public ISOs offered in the Vultr ISO library.
+type PublicISO struct {
+ ISOID int `json:"ISOID"`
+ Name string `json:"name"`
+ Description string `json:"description"`
+}
+
+// CreateFromURL will create a new ISO image on your account
+func (i *ISOServiceHandler) CreateFromURL(ctx context.Context, ISOURL string) (*ISO, error) {
+
+ uri := "/v1/iso/create_from_url"
+
+ values := url.Values{
+ "url": {ISOURL},
+ }
+
+ req, err := i.Client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ iso := new(ISO)
+ err = i.Client.DoWithContext(ctx, req, iso)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return iso, nil
+}
+
+// Delete will delete an ISO image from your account
+func (i *ISOServiceHandler) Delete(ctx context.Context, isoID int) error {
+
+ uri := "/v1/iso/destroy"
+
+ values := url.Values{
+ "ISOID": {strconv.Itoa(isoID)},
+ }
+
+ req, err := i.Client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = i.Client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list all ISOs currently available on your account
+func (i *ISOServiceHandler) List(ctx context.Context) ([]ISO, error) {
+
+ uri := "/v1/iso/list"
+
+ req, err := i.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ISOMap map[string]ISO
+ err = i.Client.DoWithContext(ctx, req, &ISOMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var iso []ISO
+ for _, i := range ISOMap {
+ iso = append(iso, i)
+ }
+
+ return iso, nil
+}
+
+// GetPublicList will list public ISOs offered in the Vultr ISO library.
+func (i *ISOServiceHandler) GetPublicList(ctx context.Context) ([]PublicISO, error) {
+
+ uri := "/v1/iso/list_public"
+
+ req, err := i.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ISOMap map[string]PublicISO
+ err = i.Client.DoWithContext(ctx, req, &ISOMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var publicISO []PublicISO
+
+ for _, p := range ISOMap {
+ publicISO = append(publicISO, p)
+ }
+
+ return publicISO, nil
+}
diff --git a/vendor/github.com/vultr/govultr/network.go b/vendor/github.com/vultr/govultr/network.go
new file mode 100644
index 000000000..d6c32ea2a
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/network.go
@@ -0,0 +1,120 @@
+package govultr
+
+import (
+ "context"
+ "net"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// NetworkService is the interface to interact with the network endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#network
+type NetworkService interface {
+ Create(ctx context.Context, regionID, description, cidrBlock string) (*Network, error)
+ Delete(ctx context.Context, networkID string) error
+ List(ctx context.Context) ([]Network, error)
+}
+
+// NetworkServiceHandler handles interaction with the network methods for the Vultr API
+type NetworkServiceHandler struct {
+ client *Client
+}
+
+// Network represents a Vultr private network
+type Network struct {
+ NetworkID string `json:"NETWORKID"`
+ RegionID string `json:"DCID"`
+ Description string `json:"description"`
+ V4Subnet string `json:"v4_subnet"`
+ V4SubnetMask int `json:"v4_subnet_mask"`
+ DateCreated string `json:"date_created"`
+}
+
+// Create a new private network. A private network can only be used at the location for which it was created.
+func (n *NetworkServiceHandler) Create(ctx context.Context, regionID, description, cidrBlock string) (*Network, error) {
+
+ uri := "/v1/network/create"
+
+ values := url.Values{
+ "DCID": {regionID},
+ }
+
+ // Optional
+ if cidrBlock != "" {
+ _, ipNet, err := net.ParseCIDR(cidrBlock)
+ if err != nil {
+ return nil, err
+ }
+ if v4Subnet := ipNet.IP.To4(); v4Subnet != nil {
+ values.Add("v4_subnet", v4Subnet.String())
+ }
+ mask, _ := ipNet.Mask.Size()
+ values.Add("v4_subnet_mask", strconv.Itoa(mask))
+ }
+
+ if description != "" {
+ values.Add("description", description)
+ }
+
+ req, err := n.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ network := new(Network)
+ err = n.client.DoWithContext(ctx, req, network)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return network, nil
+}
+
+// Delete a private network. Before deleting, a network must be disabled from all instances. See https://www.vultr.com/api/#server_private_network_disable
+func (n *NetworkServiceHandler) Delete(ctx context.Context, networkID string) error {
+ uri := "/v1/network/destroy"
+
+ values := url.Values{
+ "NETWORKID": {networkID},
+ }
+
+ req, err := n.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = n.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List lists all private networks on the current account
+func (n *NetworkServiceHandler) List(ctx context.Context) ([]Network, error) {
+ uri := "/v1/network/list"
+
+ req, err := n.client.NewRequest(ctx, http.MethodGet, uri, nil)
+ if err != nil {
+ return nil, err
+ }
+
+ var networkMap map[string]Network
+ err = n.client.DoWithContext(ctx, req, &networkMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var networks []Network
+ for _, network := range networkMap {
+ networks = append(networks, network)
+ }
+
+ return networks, nil
+}
diff --git a/vendor/github.com/vultr/govultr/os.go b/vendor/github.com/vultr/govultr/os.go
new file mode 100644
index 000000000..933ddaff3
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/os.go
@@ -0,0 +1,84 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "strconv"
+)
+
+// OSService is the interface to interact with the operating system endpoint on the Vultr API
+// Link: https://www.vultr.com/api/#os
+type OSService interface {
+ List(ctx context.Context) ([]OS, error)
+}
+
+// OSServiceHandler handles interaction with the operating system methods for the Vultr API
+type OSServiceHandler struct {
+ client *Client
+}
+
+// OS represents a Vultr operating system
+type OS struct {
+ OsID int `json:"OSID"`
+ Name string `json:"name"`
+ Arch string `json:"arch"`
+ Family string `json:"family"`
+ Windows bool `json:"windows"`
+}
+
+// UnmarshalJSON implements json.Unmarshaller on OS to handle the inconsistent types returned from the Vultr API.
+func (o *OS) UnmarshalJSON(data []byte) (err error) {
+ if o == nil {
+ *o = OS{}
+ }
+
+ var v map[string]interface{}
+ if err := json.Unmarshal(data, &v); err != nil {
+ return err
+ }
+
+ i, err := strconv.Atoi(fmt.Sprintf("%v", v["OSID"]))
+ if err != nil {
+ return err
+ }
+ o.OsID = i
+
+ value := fmt.Sprintf("%v", v["windows"])
+ o.Windows = false
+ if value == "true" {
+ o.Windows = true
+ }
+
+ o.Name = fmt.Sprintf("%v", v["name"])
+ o.Arch = fmt.Sprintf("%v", v["arch"])
+ o.Family = fmt.Sprintf("%v", v["family"])
+
+ return nil
+}
+
+// List retrieves a list of available operating systems.
+// If the Windows flag is true, a Windows license will be included with the instance, which will increase the cost.
+func (o *OSServiceHandler) List(ctx context.Context) ([]OS, error) {
+ uri := "/v1/os/list"
+ req, err := o.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ osMap := make(map[string]OS)
+
+ err = o.client.DoWithContext(ctx, req, &osMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var oses []OS
+ for _, os := range osMap {
+ oses = append(oses, os)
+ }
+
+ return oses, nil
+}
diff --git a/vendor/github.com/vultr/govultr/plans.go b/vendor/github.com/vultr/govultr/plans.go
new file mode 100644
index 000000000..75287d5ad
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/plans.go
@@ -0,0 +1,199 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+)
+
+// PlanService is the interface to interact with the Plans endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#plans
+type PlanService interface {
+ List(ctx context.Context, planType string) ([]Plan, error)
+ GetBareMetalList(ctx context.Context) ([]BareMetalPlan, error)
+ GetVc2List(ctx context.Context) ([]VCPlan, error)
+ GetVdc2List(ctx context.Context) ([]VCPlan, error)
+ GetVc2zList(ctx context.Context) ([]VCPlan, error)
+}
+
+// PlanServiceHandler handles interaction with the Plans methods for the Vultr API
+type PlanServiceHandler struct {
+ Client *Client
+}
+
+// Plan represents available Plans that Vultr offers
+type Plan struct {
+ PlanID int `json:"VPSPLANID,string"`
+ Name string `json:"name"`
+ VCPUs int `json:"vcpu_count,string"`
+ RAM string `json:"ram"`
+ Disk string `json:"disk"`
+ Bandwidth string `json:"bandwidth"`
+ BandwidthGB string `json:"bandwidth_gb"`
+ Price string `json:"price_per_month"`
+ Windows bool `json:"windows"`
+ PlanType string `json:"plan_type"`
+ Regions []int `json:"available_locations"`
+ Deprecated bool `json:"deprecated"`
+}
+
+// BareMetalPlan represents bare metal plans
+type BareMetalPlan struct {
+ PlanID string `json:"METALPLANID"`
+ Name string `json:"name"`
+ CPUs int `json:"cpu_count"`
+ CPUModel string `json:"cpu_model"`
+ RAM int `json:"ram"`
+ Disk string `json:"disk"`
+ BandwidthTB int `json:"bandwidth_tb"`
+ Price int `json:"price_per_month"`
+ PlanType string `json:"plan_type"`
+ Deprecated bool `json:"deprecated"`
+ Regions []int `json:"available_locations"`
+}
+
+// VCPlan represents either a vdc2 or a vc2 plan
+type VCPlan struct {
+ PlanID string `json:"VPSPLANID"`
+ Name string `json:"name"`
+ VCPUs string `json:"vcpu_count"`
+ RAM string `json:"ram"`
+ Disk string `json:"disk"`
+ Bandwidth string `json:"bandwidth"`
+ BandwidthGB string `json:"bandwidth_gb"`
+ Price string `json:"price_per_month"`
+ PlanType string `json:"plan_type"`
+}
+
+// List retrieves a list of all active plans.
+// planType is optional - pass an empty string to get all plans
+func (p *PlanServiceHandler) List(ctx context.Context, planType string) ([]Plan, error) {
+
+ uri := "/v1/plans/list"
+
+ req, err := p.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ if planType != "" {
+ q := req.URL.Query()
+ q.Add("type", planType)
+ req.URL.RawQuery = q.Encode()
+ }
+
+ var planMap map[string]Plan
+ err = p.Client.DoWithContext(ctx, req, &planMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var plans []Plan
+ for _, p := range planMap {
+ plans = append(plans, p)
+ }
+
+ return plans, nil
+}
+
+// GetBareMetalList retrieves a list of all active bare metal plans.
+func (p *PlanServiceHandler) GetBareMetalList(ctx context.Context) ([]BareMetalPlan, error) {
+
+ uri := "/v1/plans/list_baremetal"
+
+ req, err := p.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var bareMetalMap map[string]BareMetalPlan
+ err = p.Client.DoWithContext(ctx, req, &bareMetalMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var bareMetalPlan []BareMetalPlan
+ for _, b := range bareMetalMap {
+ bareMetalPlan = append(bareMetalPlan, b)
+ }
+
+ return bareMetalPlan, nil
+}
+
+// GetVc2List retrieve a list of all active vc2 plans.
+func (p *PlanServiceHandler) GetVc2List(ctx context.Context) ([]VCPlan, error) {
+ uri := "/v1/plans/list_vc2"
+
+ req, err := p.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vc2Plan map[string]VCPlan
+ err = p.Client.DoWithContext(ctx, req, &vc2Plan)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vc2 []VCPlan
+ for _, p := range vc2Plan {
+ vc2 = append(vc2, p)
+ }
+
+ return vc2, nil
+}
+
+// GetVdc2List Retrieve a list of all active vdc2 plans
+func (p *PlanServiceHandler) GetVdc2List(ctx context.Context) ([]VCPlan, error) {
+ uri := "/v1/plans/list_vdc2"
+
+ req, err := p.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vdc2Map map[string]VCPlan
+ err = p.Client.DoWithContext(ctx, req, &vdc2Map)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vdc2 []VCPlan
+ for _, p := range vdc2Map {
+ vdc2 = append(vdc2, p)
+ }
+
+ return vdc2, nil
+}
+
+// GetVc2zList Retrieve a list of all active vc2z plans (high frequency)
+func (p *PlanServiceHandler) GetVc2zList(ctx context.Context) ([]VCPlan, error) {
+ uri := "/v1/plans/list_vc2z"
+
+ req, err := p.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vc2zMap map[string]VCPlan
+ err = p.Client.DoWithContext(ctx, req, &vc2zMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var vc2z []VCPlan
+ for _, p := range vc2zMap {
+ vc2z = append(vc2z, p)
+ }
+
+ return vc2z, nil
+}
diff --git a/vendor/github.com/vultr/govultr/regions.go b/vendor/github.com/vultr/govultr/regions.go
new file mode 100644
index 000000000..cfdbbebc8
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/regions.go
@@ -0,0 +1,154 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "strconv"
+)
+
+// RegionService is the interface to interact with Region endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#regions
+type RegionService interface {
+ Availability(ctx context.Context, regionID int, planType string) ([]int, error)
+ BareMetalAvailability(ctx context.Context, regionID int) ([]int, error)
+ Vc2Availability(ctx context.Context, regionID int) ([]int, error)
+ Vdc2Availability(ctx context.Context, regionID int) ([]int, error)
+ List(ctx context.Context) ([]Region, error)
+}
+
+// RegionServiceHandler handles interaction with the region methods for the Vultr API
+type RegionServiceHandler struct {
+ Client *Client
+}
+
+// Region represents a Vultr region
+type Region struct {
+ RegionID string `json:"DCID"`
+ Name string `json:"name"`
+ Country string `json:"country"`
+ Continent string `json:"continent"`
+ State string `json:"state"`
+ Ddos bool `json:"ddos_protection"`
+ BlockStorage bool `json:"block_storage"`
+ RegionCode string `json:"regioncode"`
+}
+
+// Availability retrieves a list of the VPSPLANIDs currently available for a given location.
+func (r *RegionServiceHandler) Availability(ctx context.Context, regionID int, planType string) ([]int, error) {
+
+ uri := "/v1/regions/availability"
+
+ req, err := r.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("DCID", strconv.Itoa(regionID))
+
+ // Optional planType filter
+ if planType != "" {
+ q.Add("type", planType)
+ }
+ req.URL.RawQuery = q.Encode()
+
+ var regions []int
+ err = r.Client.DoWithContext(ctx, req, ®ions)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return regions, nil
+}
+
+// BareMetalAvailability retrieve a list of the METALPLANIDs currently available for a given location.
+func (r *RegionServiceHandler) BareMetalAvailability(ctx context.Context, regionID int) ([]int, error) {
+
+ uri := "/v1/regions/availability_baremetal"
+
+ regions, err := r.instanceAvailability(ctx, uri, regionID)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return regions, nil
+}
+
+// Vc2Availability retrieve a list of the vc2 VPSPLANIDs currently available for a given location.
+func (r *RegionServiceHandler) Vc2Availability(ctx context.Context, regionID int) ([]int, error) {
+
+ uri := "/v1/regions/availability_vc2"
+
+ regions, err := r.instanceAvailability(ctx, uri, regionID)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return regions, nil
+}
+
+// Vdc2Availability retrieves a list of the vdc2 VPSPLANIDs currently available for a given location.
+func (r *RegionServiceHandler) Vdc2Availability(ctx context.Context, regionID int) ([]int, error) {
+
+ uri := "/v1/regions/availability_vdc2"
+
+ regions, err := r.instanceAvailability(ctx, uri, regionID)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return regions, nil
+}
+
+// List retrieves a list of all active regions
+func (r *RegionServiceHandler) List(ctx context.Context) ([]Region, error) {
+
+ uri := "/v1/regions/list"
+
+ req, err := r.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var regionsMap map[string]Region
+ err = r.Client.DoWithContext(ctx, req, ®ionsMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var region []Region
+ for _, r := range regionsMap {
+ region = append(region, r)
+ }
+
+ return region, nil
+}
+
+// instanceAvailability keeps the similar calls dry
+func (r *RegionServiceHandler) instanceAvailability(ctx context.Context, uri string, regionID int) ([]int, error) {
+ req, err := r.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("DCID", strconv.Itoa(regionID))
+ req.URL.RawQuery = q.Encode()
+
+ var regions []int
+ err = r.Client.DoWithContext(ctx, req, ®ions)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return regions, nil
+}
diff --git a/vendor/github.com/vultr/govultr/reserved_ip.go b/vendor/github.com/vultr/govultr/reserved_ip.go
new file mode 100644
index 000000000..ee9335c4a
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/reserved_ip.go
@@ -0,0 +1,273 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+ "strconv"
+)
+
+// ReservedIPService is the interface to interact with the reserved IP endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#reservedip
+type ReservedIPService interface {
+ Attach(ctx context.Context, ip, InstanceID string) error
+ Convert(ctx context.Context, ip, InstanceID, label string) (*ReservedIP, error)
+ Create(ctx context.Context, regionID int, ipType, label string) (*ReservedIP, error)
+ Delete(ctx context.Context, ip string) error
+ Detach(ctx context.Context, ip, InstanceID string) error
+ List(ctx context.Context) ([]ReservedIP, error)
+}
+
+// ReservedIPServiceHandler handles interaction with the reserved IP methods for the Vultr API
+type ReservedIPServiceHandler struct {
+ client *Client
+}
+
+// ReservedIP represents an reserved IP on Vultr
+type ReservedIP struct {
+ ReservedIPID string `json:"SUBID"`
+ RegionID int `json:"DCID"`
+ IPType string `json:"ip_type"`
+ Subnet string `json:"subnet"`
+ SubnetSize int `json:"subnet_size"`
+ Label string `json:"label"`
+ AttachedID string `json:"attached_SUBID"`
+}
+
+// UnmarshalJSON implements json.Unmarshaller on ReservedIP to handle the inconsistent types returned from the Vultr API.
+func (r *ReservedIP) UnmarshalJSON(data []byte) (err error) {
+ if r == nil {
+ *r = ReservedIP{}
+ }
+
+ var v map[string]interface{}
+ if err := json.Unmarshal(data, &v); err != nil {
+ return err
+ }
+
+ r.ReservedIPID, err = r.unmarshalStr(fmt.Sprintf("%v", v["SUBID"]))
+ if err != nil {
+ return err
+ }
+
+ r.AttachedID, err = r.unmarshalStr(fmt.Sprintf("%v", v["attached_SUBID"]))
+ if err != nil {
+ return err
+ }
+
+ r.RegionID, err = r.unmarshalInt(fmt.Sprintf("%v", v["DCID"]))
+ if err != nil {
+ return err
+ }
+
+ r.SubnetSize, err = r.unmarshalInt(fmt.Sprintf("%v", v["subnet_size"]))
+ if err != nil {
+ return err
+ }
+
+ if r.Subnet = fmt.Sprintf("%v", v["subnet"]); r.Subnet == "" {
+ r.Subnet = ""
+ }
+
+ if r.IPType = fmt.Sprintf("%v", v["ip_type"]); r.IPType == "" {
+ r.IPType = ""
+ }
+
+ if r.Label = fmt.Sprintf("%v", v["label"]); r.Label == "" {
+ r.Label = ""
+ }
+
+ return nil
+}
+
+func (r *ReservedIP) unmarshalInt(value string) (int, error) {
+ if len(value) == 0 || value == "" {
+ value = "0"
+ }
+
+ i, err := strconv.ParseInt(value, 10, 64)
+ if err != nil {
+ return 0, err
+ }
+
+ return int(i), nil
+}
+
+func (r *ReservedIP) unmarshalStr(value string) (string, error) {
+ if len(value) == 0 || value == "" || value == "0" || value == "false" {
+ return "", nil
+ }
+
+ f, err := strconv.ParseFloat(value, 64)
+ if err != nil {
+ return "", err
+ }
+
+ return strconv.FormatFloat(f, 'f', -1, 64), nil
+}
+
+// Attach a reserved IP to an existing subscription
+func (r *ReservedIPServiceHandler) Attach(ctx context.Context, ip, InstanceID string) error {
+ uri := "/v1/reservedip/attach"
+
+ values := url.Values{
+ "ip_address": {ip},
+ "attach_SUBID": {InstanceID},
+ }
+
+ req, err := r.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = r.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Convert an existing IP on a subscription to a reserved IP.
+func (r *ReservedIPServiceHandler) Convert(ctx context.Context, ip, InstanceID, label string) (*ReservedIP, error) {
+ uri := "/v1/reservedip/convert"
+
+ values := url.Values{
+ "SUBID": {InstanceID},
+ "ip_address": {ip},
+ }
+
+ if label != "" {
+ values.Add("label", label)
+ }
+
+ req, err := r.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ rip := new(ReservedIP)
+
+ err = r.client.DoWithContext(ctx, req, rip)
+
+ if err != nil {
+ return nil, err
+ }
+
+ rip.Label = label
+
+ return rip, nil
+}
+
+// Create adds the specified reserved IP to your Vultr account
+func (r *ReservedIPServiceHandler) Create(ctx context.Context, regionID int, ipType, label string) (*ReservedIP, error) {
+
+ uri := "/v1/reservedip/create"
+
+ values := url.Values{
+ "DCID": {strconv.Itoa(regionID)},
+ "ip_type": {ipType},
+ }
+
+ if label != "" {
+ values.Add("label", label)
+ }
+
+ req, err := r.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ rip := new(ReservedIP)
+
+ err = r.client.DoWithContext(ctx, req, rip)
+
+ if err != nil {
+ return nil, err
+ }
+
+ rip.RegionID = regionID
+ rip.IPType = ipType
+ rip.Label = label
+
+ return rip, nil
+}
+
+// Delete removes the specified reserved IP from your Vultr account
+func (r *ReservedIPServiceHandler) Delete(ctx context.Context, ip string) error {
+
+ uri := "/v1/reservedip/destroy"
+
+ values := url.Values{
+ "ip_address": {ip},
+ }
+
+ req, err := r.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = r.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Detach a reserved IP from an existing subscription.
+func (r *ReservedIPServiceHandler) Detach(ctx context.Context, ip, InstanceID string) error {
+ uri := "/v1/reservedip/detach"
+
+ values := url.Values{
+ "ip_address": {ip},
+ "detach_SUBID": {InstanceID},
+ }
+
+ req, err := r.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = r.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List lists all the reserved IPs associated with your Vultr account
+func (r *ReservedIPServiceHandler) List(ctx context.Context) ([]ReservedIP, error) {
+
+ uri := "/v1/reservedip/list"
+
+ req, err := r.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ ipMap := make(map[string]ReservedIP)
+ err = r.client.DoWithContext(ctx, req, &ipMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var ips []ReservedIP
+ for _, ip := range ipMap {
+ ips = append(ips, ip)
+ }
+
+ return ips, nil
+}
diff --git a/vendor/github.com/vultr/govultr/server.go b/vendor/github.com/vultr/govultr/server.go
new file mode 100644
index 000000000..787046627
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/server.go
@@ -0,0 +1,1469 @@
+package govultr
+
+import (
+ "context"
+ "encoding/base64"
+ "net/http"
+ "net/url"
+ "strconv"
+ "strings"
+)
+
+// ServerService is the interface to interact with the server endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#server
+type ServerService interface {
+ ChangeApp(ctx context.Context, instanceID, appID string) error
+ ListApps(ctx context.Context, instanceID string) ([]Application, error)
+ AppInfo(ctx context.Context, instanceID string) (*AppInfo, error)
+ EnableBackup(ctx context.Context, instanceID string) error
+ DisableBackup(ctx context.Context, instanceID string) error
+ GetBackupSchedule(ctx context.Context, instanceID string) (*BackupSchedule, error)
+ SetBackupSchedule(ctx context.Context, instanceID string, backup *BackupSchedule) error
+ RestoreBackup(ctx context.Context, instanceID, backupID string) error
+ RestoreSnapshot(ctx context.Context, instanceID, snapshotID string) error
+ SetLabel(ctx context.Context, instanceID, label string) error
+ SetTag(ctx context.Context, instanceID, tag string) error
+ Neighbors(ctx context.Context, instanceID string) ([]int, error)
+ EnablePrivateNetwork(ctx context.Context, instanceID, networkID string) error
+ DisablePrivateNetwork(ctx context.Context, instanceID, networkID string) error
+ ListPrivateNetworks(ctx context.Context, instanceID string) ([]PrivateNetwork, error)
+ ListUpgradePlan(ctx context.Context, instanceID string) ([]int, error)
+ UpgradePlan(ctx context.Context, instanceID, vpsPlanID string) error
+ ListOS(ctx context.Context, instanceID string) ([]OS, error)
+ ChangeOS(ctx context.Context, instanceID, osID string) error
+ IsoAttach(ctx context.Context, instanceID, isoID string) error
+ IsoDetach(ctx context.Context, instanceID string) error
+ IsoStatus(ctx context.Context, instanceID string) (*ServerIso, error)
+ SetFirewallGroup(ctx context.Context, instanceID, firewallGroupID string) error
+ GetUserData(ctx context.Context, instanceID string) (*UserData, error)
+ SetUserData(ctx context.Context, instanceID, userData string) error
+ IPV4Info(ctx context.Context, instanceID string, public bool) ([]IPV4, error)
+ IPV6Info(ctx context.Context, instanceID string) ([]IPV6, error)
+ AddIPV4(ctx context.Context, instanceID string) error
+ DestroyIPV4(ctx context.Context, instanceID, ip string) error
+ EnableIPV6(ctx context.Context, instanceID string) error
+ Bandwidth(ctx context.Context, instanceID string) ([]map[string]string, error)
+ ListReverseIPV6(ctx context.Context, instanceID string) ([]ReverseIPV6, error)
+ SetDefaultReverseIPV4(ctx context.Context, instanceID, ip string) error
+ DeleteReverseIPV6(ctx context.Context, instanceID, ip string) error
+ SetReverseIPV4(ctx context.Context, instanceID, ipv4, entry string) error
+ SetReverseIPV6(ctx context.Context, instanceID, ipv6, entry string) error
+ Start(ctx context.Context, instanceID string) error
+ Halt(ctx context.Context, instanceID string) error
+ Reboot(ctx context.Context, instanceID string) error
+ Reinstall(ctx context.Context, instanceID string) error
+ Delete(ctx context.Context, instanceID string) error
+ Create(ctx context.Context, regionID, vpsPlanID, osID int, options *ServerOptions) (*Server, error)
+ List(ctx context.Context) ([]Server, error)
+ ListByLabel(ctx context.Context, label string) ([]Server, error)
+ ListByMainIP(ctx context.Context, mainIP string) ([]Server, error)
+ ListByTag(ctx context.Context, tag string) ([]Server, error)
+ GetServer(ctx context.Context, instanceID string) (*Server, error)
+}
+
+// ServerServiceHandler handles interaction with the server methods for the Vultr API
+type ServerServiceHandler struct {
+ client *Client
+}
+
+// AppInfo represents information about the application on your VPS
+type AppInfo struct {
+ AppInfo string `json:"app_info"`
+}
+
+// BackupSchedule represents a schedule of a backup that runs on a VPS
+type BackupSchedule struct {
+ Enabled bool `json:"enabled"`
+ CronType string `json:"cron_type"`
+ NextRun string `json:"next_scheduled_time_utc"`
+ Hour int `json:"hour"`
+ Dow int `json:"dow"`
+ Dom int `json:"dom"`
+}
+
+// PrivateNetwork represents a private network attached to a VPS
+type PrivateNetwork struct {
+ NetworkID string `json:"NETWORKID"`
+ MacAddress string `json:"mac_address"`
+ IPAddress string `json:"ip_address"`
+}
+
+// ServerIso represents a iso attached to a VPS
+type ServerIso struct {
+ State string `json:"state"`
+ IsoID string `json:"ISOID"`
+}
+
+// UserData represents the user data you can give a VPS
+type UserData struct {
+ UserData string `json:"userdata"`
+}
+
+// IPV4 represents IPV4 information for a VPS
+type IPV4 struct {
+ IP string `json:"ip"`
+ Netmask string `json:"netmask"`
+ Gateway string `json:"gateway"`
+ Type string `json:"type"`
+ Reverse string `json:"reverse"`
+}
+
+// IPV6 represents IPV6 information for a VPS
+type IPV6 struct {
+ IP string `json:"ip"`
+ Network string `json:"network"`
+ NetworkSize string `json:"network_size"`
+ Type string `json:"type"`
+}
+
+// ReverseIPV6 represents IPV6 reverse DNS entries
+type ReverseIPV6 struct {
+ IP string `json:"ip"`
+ Reverse string `json:"reverse"`
+}
+
+// Server represents a VPS
+type Server struct {
+ InstanceID string `json:"SUBID"`
+ Os string `json:"os"`
+ RAM string `json:"ram"`
+ Disk string `json:"disk"`
+ MainIP string `json:"main_ip"`
+ VPSCpus string `json:"vcpu_count"`
+ Location string `json:"location"`
+ RegionID string `json:"DCID"`
+ DefaultPassword string `json:"default_password"`
+ Created string `json:"date_created"`
+ PendingCharges string `json:"pending_charges"`
+ Status string `json:"status"`
+ Cost string `json:"cost_per_month"`
+ CurrentBandwidth float64 `json:"current_bandwidth_gb"`
+ AllowedBandwidth string `json:"allowed_bandwidth_gb"`
+ NetmaskV4 string `json:"netmask_v4"`
+ GatewayV4 string `json:"gateway_v4"`
+ PowerStatus string `json:"power_status"`
+ ServerState string `json:"server_state"`
+ PlanID string `json:"VPSPLANID"`
+ V6Networks []V6Network `json:"v6_networks"`
+ Label string `json:"label"`
+ InternalIP string `json:"internal_ip"`
+ KVMUrl string `json:"kvm_url"`
+ AutoBackups string `json:"auto_backups"`
+ Tag string `json:"tag"`
+ OsID string `json:"OSID"`
+ AppID string `json:"APPID"`
+ FirewallGroupID string `json:"FIREWALLGROUPID"`
+}
+
+// V6Network represents an IPV6 network on a VPS
+type V6Network struct {
+ Network string `json:"v6_network"`
+ MainIP string `json:"v6_main_ip"`
+ NetworkSize string `json:"v6_network_size"`
+}
+
+// ServerOptions are all optional fields that can be used during vps creation
+type ServerOptions struct {
+ IPXEChain string
+ IsoID int
+ SnapshotID string
+ ScriptID string
+ EnableIPV6 bool
+ EnablePrivateNetwork bool
+ NetworkID []string
+ Label string
+ SSHKeyIDs []string
+ AutoBackups bool
+ AppID string
+ UserData string
+ NotifyActivate bool
+ DDOSProtection bool
+ ReservedIPV4 string
+ Hostname string
+ Tag string
+ FirewallGroupID string
+}
+
+// ChangeApp changes the VPS to a different application.
+func (s *ServerServiceHandler) ChangeApp(ctx context.Context, instanceID, appID string) error {
+
+ uri := "/v1/server/app_change"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "APPID": {appID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ListApps retrieves a list of applications to which a virtual machine can be changed.
+func (s *ServerServiceHandler) ListApps(ctx context.Context, instanceID string) ([]Application, error) {
+
+ uri := "/v1/server/app_change_list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var appMap map[string]Application
+ err = s.client.DoWithContext(ctx, req, &appMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var appList []Application
+ for _, a := range appMap {
+ appList = append(appList, a)
+ }
+
+ return appList, nil
+}
+
+// AppInfo retrieves the application information for a given VPS ID
+func (s *ServerServiceHandler) AppInfo(ctx context.Context, instanceID string) (*AppInfo, error) {
+
+ uri := "/v1/server/get_app_info"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ appInfo := new(AppInfo)
+
+ err = s.client.DoWithContext(ctx, req, appInfo)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return appInfo, nil
+}
+
+// EnableBackup enables automatic backups on a given VPS
+func (s *ServerServiceHandler) EnableBackup(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/backup_enable"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// DisableBackup disable automatic backups on a given VPS
+func (s *ServerServiceHandler) DisableBackup(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/backup_disable"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// GetBackupSchedule retrieves the backup schedule for a given vps - all time values are in UTC
+func (s *ServerServiceHandler) GetBackupSchedule(ctx context.Context, instanceID string) (*BackupSchedule, error) {
+
+ uri := "/v1/server/backup_get_schedule"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ backup := new(BackupSchedule)
+ err = s.client.DoWithContext(ctx, req, backup)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return backup, nil
+}
+
+// SetBackupSchedule sets the backup schedule for a given vps - all time values are in UTC
+func (s *ServerServiceHandler) SetBackupSchedule(ctx context.Context, instanceID string, backup *BackupSchedule) error {
+
+ uri := "/v1/server/backup_set_schedule"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "cron_type": {backup.CronType},
+ "hour": {strconv.Itoa(backup.Hour)},
+ "dow": {strconv.Itoa(backup.Dow)},
+ "dom": {strconv.Itoa(backup.Dom)},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// RestoreBackup will restore the specified backup to the given VPS
+func (s *ServerServiceHandler) RestoreBackup(ctx context.Context, instanceID, backupID string) error {
+
+ uri := "/v1/server/restore_backup"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "BACKUPID": {backupID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// RestoreSnapshot will restore the specified snapshot to the given VPS
+func (s *ServerServiceHandler) RestoreSnapshot(ctx context.Context, instanceID, snapshotID string) error {
+
+ uri := "/v1/server/restore_snapshot"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "SNAPSHOTID": {snapshotID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetLabel will set a label for a given VPS
+func (s *ServerServiceHandler) SetLabel(ctx context.Context, instanceID, label string) error {
+
+ uri := "/v1/server/label_set"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "label": {label},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetTag will set a tag for a given VPS
+func (s *ServerServiceHandler) SetTag(ctx context.Context, instanceID, tag string) error {
+
+ uri := "/v1/server/tag_set"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "tag": {tag},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Neighbors will determine what other vps are hosted on the same physical host as a given vps.
+func (s *ServerServiceHandler) Neighbors(ctx context.Context, instanceID string) ([]int, error) {
+
+ uri := "/v1/server/neighbors"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var neighbors []int
+ err = s.client.DoWithContext(ctx, req, &neighbors)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return neighbors, nil
+}
+
+// EnablePrivateNetwork enables private networking on a server.
+// The server will be automatically rebooted to complete the request.
+// No action occurs if private networking was already enabled
+func (s *ServerServiceHandler) EnablePrivateNetwork(ctx context.Context, instanceID, networkID string) error {
+
+ uri := "/v1/server/private_network_enable"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "NETWORKID": {networkID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// DisablePrivateNetwork removes a private network from a server.
+// The server will be automatically rebooted to complete the request.
+func (s *ServerServiceHandler) DisablePrivateNetwork(ctx context.Context, instanceID, networkID string) error {
+
+ uri := "/v1/server/private_network_disable"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "NETWORKID": {networkID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ListPrivateNetworks will list private networks attached to a vps
+func (s *ServerServiceHandler) ListPrivateNetworks(ctx context.Context, instanceID string) ([]PrivateNetwork, error) {
+
+ uri := "/v1/server/private_networks"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var networkMap map[string]PrivateNetwork
+ err = s.client.DoWithContext(ctx, req, &networkMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var privateNetworks []PrivateNetwork
+ for _, p := range networkMap {
+ privateNetworks = append(privateNetworks, p)
+ }
+
+ return privateNetworks, nil
+}
+
+// ListUpgradePlan Retrieve a list of the planIDs for which the vps can be upgraded.
+// An empty response array means that there are currently no upgrades available
+func (s *ServerServiceHandler) ListUpgradePlan(ctx context.Context, instanceID string) ([]int, error) {
+
+ uri := "/v1/server/upgrade_plan_list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var plans []int
+ err = s.client.DoWithContext(ctx, req, &plans)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return plans, nil
+}
+
+// UpgradePlan will upgrade the plan of a virtual machine.
+// The vps will be rebooted upon a successful upgrade.
+func (s *ServerServiceHandler) UpgradePlan(ctx context.Context, instanceID, vpsPlanID string) error {
+
+ uri := "/v1/server/upgrade_plan"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "VPSPLANID": {vpsPlanID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// ListOS retrieves a list of operating systems to which the VPS can be changed to.
+func (s *ServerServiceHandler) ListOS(ctx context.Context, instanceID string) ([]OS, error) {
+
+ uri := "/v1/server/os_change_list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var osMap map[string]OS
+ err = s.client.DoWithContext(ctx, req, &osMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var os []OS
+ for _, o := range osMap {
+ os = append(os, o)
+ }
+
+ return os, nil
+}
+
+// ChangeOS changes the VPS to a different operating system.
+// All data will be permanently lost.
+func (s *ServerServiceHandler) ChangeOS(ctx context.Context, instanceID, osID string) error {
+
+ uri := "/v1/server/os_change"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "OSID": {osID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// IsoAttach will attach an ISO to the given VPS and reboot it
+func (s *ServerServiceHandler) IsoAttach(ctx context.Context, instanceID, isoID string) error {
+
+ uri := "/v1/server/iso_attach"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ISOID": {isoID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// IsoDetach will detach the currently mounted ISO and reboot the server.
+func (s *ServerServiceHandler) IsoDetach(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/iso_detach"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// IsoStatus retrieves the current ISO state for a given VPS.
+// The returned state may be one of: ready | isomounting | isomounted.
+func (s *ServerServiceHandler) IsoStatus(ctx context.Context, instanceID string) (*ServerIso, error) {
+
+ uri := "/v1/server/iso_status"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ serverIso := new(ServerIso)
+ err = s.client.DoWithContext(ctx, req, serverIso)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return serverIso, nil
+}
+
+// SetFirewallGroup will set, change, or remove the firewall group currently applied to a vps.
+// A value of "0" means "no firewall group"
+func (s *ServerServiceHandler) SetFirewallGroup(ctx context.Context, instanceID, firewallGroupID string) error {
+
+ uri := "/v1/server/firewall_group_set"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "FIREWALLGROUPID": {firewallGroupID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetUserData sets the user-data for this subscription.
+// User-data is a generic data store, which some provisioning tools and cloud operating systems use as a configuration file.
+// It is generally consumed only once after an instance has been launched, but individual needs may vary.
+func (s *ServerServiceHandler) SetUserData(ctx context.Context, instanceID, userData string) error {
+
+ uri := "/v1/server/set_user_data"
+
+ encodedUserData := base64.StdEncoding.EncodeToString([]byte(userData))
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "userdata": {encodedUserData},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// GetUserData retrieves the (base64 encoded) user-data for this VPS
+func (s *ServerServiceHandler) GetUserData(ctx context.Context, instanceID string) (*UserData, error) {
+
+ uri := "/v1/server/get_user_data"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ userData := new(UserData)
+ err = s.client.DoWithContext(ctx, req, userData)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return userData, nil
+}
+
+// IPV4Info will list the IPv4 information of a virtual machine.
+// Public if set to 'true', includes information about the public network adapter (such as MAC address) with the "main_ip" entry.
+func (s *ServerServiceHandler) IPV4Info(ctx context.Context, instanceID string, public bool) ([]IPV4, error) {
+
+ uri := "/v1/server/list_ipv4"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+
+ if public == true {
+ q.Add("public_network", instanceID)
+ }
+
+ req.URL.RawQuery = q.Encode()
+
+ var ipMap map[string][]IPV4
+ err = s.client.DoWithContext(ctx, req, &ipMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ipv4 []IPV4
+ for _, i := range ipMap {
+ ipv4 = i
+ }
+
+ return ipv4, nil
+}
+
+// IPV6Info will list the IPv6 information of a virtual machine.
+// If the virtual machine does not have IPv6 enabled, then an empty array is returned.
+func (s *ServerServiceHandler) IPV6Info(ctx context.Context, instanceID string) ([]IPV6, error) {
+ uri := "/v1/server/list_ipv6"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var ipMap map[string][]IPV6
+ err = s.client.DoWithContext(ctx, req, &ipMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var ipv6 []IPV6
+ for _, i := range ipMap {
+ ipv6 = i
+ }
+
+ return ipv6, nil
+}
+
+// AddIPV4 will add a new IPv4 address to a server.
+func (s *ServerServiceHandler) AddIPV4(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/create_ipv4"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// DestroyIPV4 removes a secondary IPv4 address from a server.
+// Your server will be hard-restarted. We suggest halting the machine gracefully before removing IPs.
+func (s *ServerServiceHandler) DestroyIPV4(ctx context.Context, instanceID, ip string) error {
+
+ uri := "/v1/server/destroy_ipv4"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ip": {ip},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// EnableIPV6 enables IPv6 networking on a server by assigning an IPv6 subnet to it.
+func (s *ServerServiceHandler) EnableIPV6(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/ipv6_enable"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Bandwidth will get the bandwidth used by a VPS
+func (s *ServerServiceHandler) Bandwidth(ctx context.Context, instanceID string) ([]map[string]string, error) {
+
+ uri := "/v1/server/bandwidth"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var bandwidthMap map[string][][]string
+ err = s.client.DoWithContext(ctx, req, &bandwidthMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var bandwidth []map[string]string
+
+ for _, b := range bandwidthMap["incoming_bytes"] {
+ inMap := make(map[string]string)
+ inMap["date"] = b[0]
+ inMap["incoming"] = b[1]
+ bandwidth = append(bandwidth, inMap)
+ }
+
+ for _, b := range bandwidthMap["outgoing_bytes"] {
+ for i := range bandwidth {
+ if bandwidth[i]["date"] == b[0] {
+ bandwidth[i]["outgoing"] = b[1]
+ break
+ }
+ }
+ }
+
+ return bandwidth, nil
+}
+
+// ListReverseIPV6 List the IPv6 reverse DNS entries of a virtual machine.
+// Reverse DNS entries are only available for virtual machines in the "active" state.
+// If the virtual machine does not have IPv6 enabled, then an empty array is returned.
+func (s *ServerServiceHandler) ListReverseIPV6(ctx context.Context, instanceID string) ([]ReverseIPV6, error) {
+
+ uri := "/v1/server/reverse_list_ipv6"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ var reverseMap map[string][]ReverseIPV6
+ err = s.client.DoWithContext(ctx, req, &reverseMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var reverseIPV6 []ReverseIPV6
+ for _, r := range reverseMap {
+
+ if len(r) == 0 {
+ break
+ }
+
+ for _, i := range r {
+ reverseIPV6 = append(reverseIPV6, i)
+ }
+ }
+
+ return reverseIPV6, nil
+}
+
+// SetDefaultReverseIPV4 will set a reverse DNS entry for an IPv4 address of a virtual machine to the original setting.
+// Upon success, DNS changes may take 6-12 hours to become active.
+func (s *ServerServiceHandler) SetDefaultReverseIPV4(ctx context.Context, instanceID, ip string) error {
+
+ uri := "/v1/server/reverse_default_ipv4"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ip": {ip},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// DeleteReverseIPV6 Remove a reverse DNS entry for an IPv6 address of a VPS.
+// Upon success, DNS changes may take 6-12 hours to become active.
+func (s *ServerServiceHandler) DeleteReverseIPV6(ctx context.Context, instanceID, ip string) error {
+
+ uri := "/v1/server/reverse_delete_ipv6"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ip": {ip},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetReverseIPV4 will set a reverse DNS entry for an IPv4 address of a virtual machine.
+// Upon success, DNS changes may take 6-12 hours to become active.
+func (s *ServerServiceHandler) SetReverseIPV4(ctx context.Context, instanceID, ipv4, entry string) error {
+
+ uri := "/v1/server/reverse_set_ipv4"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ip": {ipv4},
+ "entry": {entry},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// SetReverseIPV6 will set a reverse DNS entry for an IPv4 address of a virtual machine.
+// Upon success, DNS changes may take 6-12 hours to become active.
+func (s *ServerServiceHandler) SetReverseIPV6(ctx context.Context, instanceID, ipv6, entry string) error {
+ uri := "/v1/server/reverse_set_ipv6"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ "ip": {ipv6},
+ "entry": {entry},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Start will start a vps. If the machine is already running, it will be restarted.
+func (s *ServerServiceHandler) Start(ctx context.Context, instanceID string) error {
+ uri := "/v1/server/start"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Halt will halt a virtual machine. This is a hard power off
+func (s *ServerServiceHandler) Halt(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/halt"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Reboot will reboot a VPS. This is a hard reboot
+func (s *ServerServiceHandler) Reboot(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/reboot"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Reinstall will reinstall the operating system on a VPS.
+func (s *ServerServiceHandler) Reinstall(ctx context.Context, instanceID string) error {
+ uri := "/v1/server/reinstall"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Delete a VPS. All data will be permanently lost, and the IP address will be released
+func (s *ServerServiceHandler) Delete(ctx context.Context, instanceID string) error {
+
+ uri := "/v1/server/destroy"
+
+ values := url.Values{
+ "SUBID": {instanceID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Create will create a new VPS
+// In order to create a server using a snapshot, use OSID 164 and specify a SNAPSHOTID.
+// Similarly, to create a server using an ISO use OSID 159 and specify an ISOID.
+func (s *ServerServiceHandler) Create(ctx context.Context, regionID, vpsPlanID, osID int, options *ServerOptions) (*Server, error) {
+
+ uri := "/v1/server/create"
+
+ values := url.Values{
+ "DCID": {strconv.Itoa(regionID)},
+ "VPSPLANID": {strconv.Itoa(vpsPlanID)},
+ "OSID": {strconv.Itoa(osID)},
+ }
+
+ if options != nil {
+ if options.IPXEChain != "" {
+ values.Add("ipxe_chain_url", options.IPXEChain)
+ }
+
+ if options.IsoID != 0 {
+ values.Add("ISOID", strconv.Itoa(options.IsoID))
+ }
+
+ if options.SnapshotID != "" {
+ values.Add("SNAPSHOTID", options.SnapshotID)
+ }
+
+ if options.ScriptID != "" {
+ values.Add("SCRIPTID", options.ScriptID)
+ }
+
+ if options.EnableIPV6 == true {
+ values.Add("enable_ipv6", "yes")
+ }
+
+ // Use either EnabledPrivateNetwork or NetworkIDs, not both
+ if options.EnablePrivateNetwork == true {
+ values.Add("enable_private_network", "yes")
+ } else {
+ if options.NetworkID != nil && len(options.NetworkID) != 0 {
+ for _, n := range options.NetworkID {
+ values.Add("NETWORKID[]", n)
+ }
+ }
+ }
+
+ if options.Label != "" {
+ values.Add("label", options.Label)
+ }
+
+ if options.SSHKeyIDs != nil && len(options.SSHKeyIDs) != 0 {
+ values.Add("SSHKEYID", strings.Join(options.SSHKeyIDs, ","))
+ }
+
+ if options.AutoBackups == true {
+ values.Add("auto_backups", "yes")
+ }
+
+ if options.AppID != "" {
+ values.Add("APPID", options.AppID)
+ }
+
+ if options.UserData != "" {
+ values.Add("userdata", base64.StdEncoding.EncodeToString([]byte(options.UserData)))
+ }
+
+ if options.NotifyActivate == true {
+ values.Add("notify_activate", "yes")
+ } else if options.NotifyActivate == false {
+ values.Add("notify_activate", "no")
+ }
+
+ if options.DDOSProtection == true {
+ values.Add("ddos_protection", "yes")
+ }
+
+ if options.ReservedIPV4 != "" {
+ values.Add("reserved_ip_v4", options.ReservedIPV4)
+ }
+
+ if options.Hostname != "" {
+ values.Add("hostname", options.Hostname)
+ }
+
+ if options.Tag != "" {
+ values.Add("tag", options.Tag)
+ }
+
+ if options.FirewallGroupID != "" {
+ values.Add("FIREWALLGROUPID", options.FirewallGroupID)
+ }
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ server := new(Server)
+ err = s.client.DoWithContext(ctx, req, server)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return server, nil
+}
+
+// List lists all VPS on the current account. This includes both pending and active servers.
+func (s *ServerServiceHandler) List(ctx context.Context) ([]Server, error) {
+ return s.list(ctx, "", "")
+}
+
+// ListByLabel lists all VPS that match the given label on the current account. This includes both pending and active servers.
+func (s *ServerServiceHandler) ListByLabel(ctx context.Context, label string) ([]Server, error) {
+ return s.list(ctx, "label", label)
+}
+
+// ListByMainIP lists all VPS that match the given IP address on the current account. This includes both pending and active servers.
+func (s *ServerServiceHandler) ListByMainIP(ctx context.Context, mainIP string) ([]Server, error) {
+ return s.list(ctx, "main_ip", mainIP)
+}
+
+// ListByTag lists all VPS that match the given tag on the current account. This includes both pending and active servers.
+func (s *ServerServiceHandler) ListByTag(ctx context.Context, tag string) ([]Server, error) {
+ return s.list(ctx, "tag", tag)
+}
+
+// list is used to consolidate the optional params to get a VPS
+func (s *ServerServiceHandler) list(ctx context.Context, key, value string) ([]Server, error) {
+
+ uri := "/v1/server/list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ if key != "" {
+ q := req.URL.Query()
+ q.Add(key, value)
+ req.URL.RawQuery = q.Encode()
+ }
+
+ var serverMap map[string]Server
+ err = s.client.DoWithContext(ctx, req, &serverMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var servers []Server
+ for _, s := range serverMap {
+ servers = append(servers, s)
+ }
+
+ return servers, nil
+}
+
+// GetServer will get the server with the given instanceID
+func (s *ServerServiceHandler) GetServer(ctx context.Context, instanceID string) (*Server, error) {
+
+ uri := "/v1/server/list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ q := req.URL.Query()
+ q.Add("SUBID", instanceID)
+ req.URL.RawQuery = q.Encode()
+
+ server := new(Server)
+ err = s.client.DoWithContext(ctx, req, server)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return server, nil
+
+}
diff --git a/vendor/github.com/vultr/govultr/snapshot.go b/vendor/github.com/vultr/govultr/snapshot.go
new file mode 100644
index 000000000..92e53d0c6
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/snapshot.go
@@ -0,0 +1,168 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+)
+
+// SnapshotService is the interface to interact with Snapshot endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#snapshot
+type SnapshotService interface {
+ Create(ctx context.Context, InstanceID, description string) (*Snapshot, error)
+ CreateFromURL(ctx context.Context, snapshotURL string) (*Snapshot, error)
+ Delete(ctx context.Context, snapshotID string) error
+ List(ctx context.Context) ([]Snapshot, error)
+ Get(ctx context.Context, snapshotID string) (*Snapshot, error)
+}
+
+// SnapshotServiceHandler handles interaction with the snapshot methods for the Vultr API
+type SnapshotServiceHandler struct {
+ Client *Client
+}
+
+// Snapshot represents a Vultr snapshot
+type Snapshot struct {
+ SnapshotID string `json:"SNAPSHOTID"`
+ DateCreated string `json:"date_created"`
+ Description string `json:"description"`
+ Size string `json:"size"`
+ Status string `json:"status"`
+ OsID string `json:"OSID"`
+ AppID string `json:"APPID"`
+}
+
+// Snapshots represent a collection of snapshots
+type Snapshots []Snapshot
+
+// Create makes a snapshot of a provided server
+func (s *SnapshotServiceHandler) Create(ctx context.Context, InstanceID, description string) (*Snapshot, error) {
+
+ uri := "/v1/snapshot/create"
+
+ values := url.Values{
+ "SUBID": {InstanceID},
+ "description": {description},
+ }
+
+ req, err := s.Client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ snapshot := new(Snapshot)
+ err = s.Client.DoWithContext(ctx, req, snapshot)
+
+ if err != nil {
+ return nil, err
+ }
+
+ snapshot.Description = description
+ return snapshot, nil
+}
+
+// CreateFromURL will create a snapshot based on an image iso from a URL you provide
+func (s *SnapshotServiceHandler) CreateFromURL(ctx context.Context, snapshotURL string) (*Snapshot, error) {
+ uri := "/v1/snapshot/create_from_url"
+
+ values := url.Values{
+ "url": {snapshotURL},
+ }
+
+ req, err := s.Client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ snapshot := new(Snapshot)
+ err = s.Client.DoWithContext(ctx, req, snapshot)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return snapshot, nil
+}
+
+// Delete a snapshot based on snapshotID
+func (s *SnapshotServiceHandler) Delete(ctx context.Context, snapshotID string) error {
+ uri := "/v1/snapshot/destroy"
+
+ values := url.Values{
+ "SNAPSHOTID": {snapshotID},
+ }
+
+ req, err := s.Client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.Client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List of snapshots details
+func (s *SnapshotServiceHandler) List(ctx context.Context) ([]Snapshot, error) {
+ uri := "/v1/snapshot/list"
+
+ req, err := s.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ snapshotMap := make(map[string]Snapshot)
+ err = s.Client.DoWithContext(ctx, req, &snapshotMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var snapshots []Snapshot
+
+ for _, s := range snapshotMap {
+ snapshots = append(snapshots, s)
+ }
+
+ return snapshots, nil
+}
+
+// Get individual details of a snapshot based on snapshotID
+func (s *SnapshotServiceHandler) Get(ctx context.Context, snapshotID string) (*Snapshot, error) {
+ uri := "/v1/snapshot/list"
+
+ req, err := s.Client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ if snapshotID != "" {
+ q := req.URL.Query()
+ q.Add("SNAPSHOTID", snapshotID)
+ req.URL.RawQuery = q.Encode()
+ }
+
+ snapshotMap := make(map[string]Snapshot)
+ err = s.Client.DoWithContext(ctx, req, &snapshotMap)
+
+ if err != nil {
+ return nil, err
+ }
+
+ snapshot := new(Snapshot)
+
+ for _, s := range snapshotMap {
+ snapshot = &s
+ }
+
+ return snapshot, nil
+}
diff --git a/vendor/github.com/vultr/govultr/ssh_key.go b/vendor/github.com/vultr/govultr/ssh_key.go
new file mode 100644
index 000000000..7f6b0a194
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/ssh_key.go
@@ -0,0 +1,140 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+)
+
+// SSHKeyService is the interface to interact with the SSH Key endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#sshkey
+type SSHKeyService interface {
+ Create(ctx context.Context, name, sshKey string) (*SSHKey, error)
+ Delete(ctx context.Context, sshKeyID string) error
+ List(ctx context.Context) ([]SSHKey, error)
+ Update(ctx context.Context, sshKey *SSHKey) error
+}
+
+// SSHKeyServiceHandler handles interaction with the SSH Key methods for the Vultr API
+type SSHKeyServiceHandler struct {
+ client *Client
+}
+
+// SSHKey represents an SSH Key on Vultr
+type SSHKey struct {
+ SSHKeyID string `json:"SSHKEYID"`
+ Name string `json:"name"`
+ Key string `json:"ssh_key"`
+ DateCreated string `json:"date_created"`
+}
+
+// Create will add the specified SSH Key to your Vultr account
+func (s *SSHKeyServiceHandler) Create(ctx context.Context, name, sshKey string) (*SSHKey, error) {
+
+ uri := "/v1/sshkey/create"
+
+ values := url.Values{
+ "name": {name},
+ "ssh_key": {sshKey},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ key := new(SSHKey)
+
+ err = s.client.DoWithContext(ctx, req, key)
+
+ if err != nil {
+ return nil, err
+ }
+
+ key.Name = name
+ key.Key = sshKey
+
+ return key, nil
+}
+
+// Delete will delete the specified SHH Key from your Vultr account
+func (s *SSHKeyServiceHandler) Delete(ctx context.Context, sshKeyID string) error {
+
+ uri := "/v1/sshkey/destroy"
+
+ values := url.Values{
+ "SSHKEYID": {sshKeyID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list all the SSH Keys associated with your Vultr account
+func (s *SSHKeyServiceHandler) List(ctx context.Context) ([]SSHKey, error) {
+
+ uri := "/v1/sshkey/list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ sshKeysMap := make(map[string]SSHKey)
+ err = s.client.DoWithContext(ctx, req, &sshKeysMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var sshKeys []SSHKey
+ for _, key := range sshKeysMap {
+ sshKeys = append(sshKeys, key)
+ }
+
+ return sshKeys, nil
+}
+
+// Update will update the given SSH Key. Empty strings will be ignored.
+func (s *SSHKeyServiceHandler) Update(ctx context.Context, sshKey *SSHKey) error {
+
+ uri := "/v1/sshkey/update"
+
+ values := url.Values{
+ "SSHKEYID": {sshKey.SSHKeyID},
+ }
+
+ // Optional
+ if sshKey.Name != "" {
+ values.Add("name", sshKey.Name)
+ }
+ if sshKey.Key != "" {
+ values.Add("ssh_key", sshKey.Key)
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/startup_script.go b/vendor/github.com/vultr/govultr/startup_script.go
new file mode 100644
index 000000000..cff944369
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/startup_script.go
@@ -0,0 +1,172 @@
+package govultr
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "net/url"
+)
+
+// StartupScriptService is the interface to interact with the startup script endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#startupscript
+type StartupScriptService interface {
+ Create(ctx context.Context, name, script, scriptType string) (*StartupScript, error)
+ Delete(ctx context.Context, scriptID string) error
+ List(ctx context.Context) ([]StartupScript, error)
+ Update(ctx context.Context, script *StartupScript) error
+}
+
+// StartupScriptServiceHandler handles interaction with the startup script methods for the Vultr API
+type StartupScriptServiceHandler struct {
+ client *Client
+}
+
+// StartupScript represents an startup script on Vultr
+type StartupScript struct {
+ ScriptID string `json:"SCRIPTID"`
+ DateCreated string `json:"date_created"`
+ DateModified string `json:"date_modified"`
+ Name string `json:"name"`
+ Type string `json:"type"`
+ Script string `json:"script"`
+}
+
+// UnmarshalJSON implements json.Unmarshaller on StartupScript to handle the inconsistent types returned from the Vultr API.
+func (s *StartupScript) UnmarshalJSON(data []byte) (err error) {
+ if s == nil {
+ *s = StartupScript{}
+ }
+
+ var v map[string]interface{}
+ if err := json.Unmarshal(data, &v); err != nil {
+ return err
+ }
+
+ s.ScriptID = fmt.Sprintf("%v", v["SCRIPTID"])
+ s.DateCreated = fmt.Sprintf("%v", v["date_created"])
+ s.DateModified = fmt.Sprintf("%v", v["date_modified"])
+ s.Name = fmt.Sprintf("%v", v["name"])
+ s.Type = fmt.Sprintf("%v", v["type"])
+ s.Script = fmt.Sprintf("%v", v["script"])
+
+ return nil
+}
+
+// Create will add the specified startup script to your Vultr account
+func (s *StartupScriptServiceHandler) Create(ctx context.Context, name, script, scriptType string) (*StartupScript, error) {
+
+ uri := "/v1/startupscript/create"
+
+ values := url.Values{
+ "name": {name},
+ "script": {script},
+ }
+
+ if scriptType != "" {
+ values.Add("type", scriptType)
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ ss := new(StartupScript)
+
+ err = s.client.DoWithContext(ctx, req, ss)
+
+ if err != nil {
+ return nil, err
+ }
+
+ ss.DateCreated = ""
+ ss.DateModified = ""
+ ss.Name = name
+ ss.Type = scriptType
+ ss.Script = script
+
+ return ss, nil
+}
+
+// Delete will delete the specified startup script from your Vultr account
+func (s *StartupScriptServiceHandler) Delete(ctx context.Context, scriptID string) error {
+
+ uri := "/v1/startupscript/destroy"
+
+ values := url.Values{
+ "SCRIPTID": {scriptID},
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list all the startup scripts associated with your Vultr account
+func (s *StartupScriptServiceHandler) List(ctx context.Context) ([]StartupScript, error) {
+
+ uri := "/v1/startupscript/list"
+
+ req, err := s.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ scriptsMap := make(map[string]StartupScript)
+ err = s.client.DoWithContext(ctx, req, &scriptsMap)
+ if err != nil {
+ return nil, err
+ }
+
+ var scripts []StartupScript
+ for _, key := range scriptsMap {
+ scripts = append(scripts, key)
+ }
+
+ return scripts, nil
+}
+
+// Update will update the given startup script. Empty strings will be ignored.
+func (s *StartupScriptServiceHandler) Update(ctx context.Context, script *StartupScript) error {
+
+ uri := "/v1/startupscript/update"
+
+ values := url.Values{
+ "SCRIPTID": {script.ScriptID},
+ }
+
+ // Optional
+ if script.Name != "" {
+ values.Add("name", script.Name)
+ }
+ if script.Script != "" {
+ values.Add("script", script.Script)
+ }
+
+ req, err := s.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = s.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/github.com/vultr/govultr/user.go b/vendor/github.com/vultr/govultr/user.go
new file mode 100644
index 000000000..40e4040f7
--- /dev/null
+++ b/vendor/github.com/vultr/govultr/user.go
@@ -0,0 +1,157 @@
+package govultr
+
+import (
+ "context"
+ "net/http"
+ "net/url"
+)
+
+// UserService is the interface to interact with the user management endpoints on the Vultr API
+// Link: https://www.vultr.com/api/#user
+type UserService interface {
+ Create(ctx context.Context, email, name, password, apiEnabled string, acls []string) (*User, error)
+ Delete(ctx context.Context, userID string) error
+ List(ctx context.Context) ([]User, error)
+ Update(ctx context.Context, user *User) error
+}
+
+// UserServiceHandler handles interaction with the user methods for the Vultr API
+type UserServiceHandler struct {
+ client *Client
+}
+
+// User represents an user on Vultr
+type User struct {
+ UserID string `json:"USERID"`
+ Name string `json:"name"`
+ Email string `json:"email"`
+ Password string `json:"password"`
+ APIEnabled string `json:"api_enabled"`
+ ACL []string `json:"acls"`
+ APIKey string `json:"api_key"`
+}
+
+// Create will add the specified user to your Vultr account
+func (u *UserServiceHandler) Create(ctx context.Context, email, name, password, apiEnabled string, acls []string) (*User, error) {
+
+ uri := "/v1/user/create"
+
+ values := url.Values{
+ "email": {email},
+ "name": {name},
+ "password": {password},
+ "acls[]": acls,
+ }
+
+ if apiEnabled != "" {
+ values.Add("api_enabled", apiEnabled)
+ }
+
+ req, err := u.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return nil, err
+ }
+
+ user := new(User)
+
+ err = u.client.DoWithContext(ctx, req, user)
+
+ if err != nil {
+ return nil, err
+ }
+
+ user.Name = name
+ user.Email = email
+ user.APIEnabled = apiEnabled
+ user.ACL = acls
+
+ return user, nil
+}
+
+// Delete will remove the specified user from your Vultr account
+func (u *UserServiceHandler) Delete(ctx context.Context, userID string) error {
+
+ uri := "/v1/user/delete"
+
+ values := url.Values{
+ "USERID": {userID},
+ }
+
+ req, err := u.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = u.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// List will list all the users associated with your Vultr account
+func (u *UserServiceHandler) List(ctx context.Context) ([]User, error) {
+
+ uri := "/v1/user/list"
+
+ req, err := u.client.NewRequest(ctx, http.MethodGet, uri, nil)
+
+ if err != nil {
+ return nil, err
+ }
+
+ var users []User
+ err = u.client.DoWithContext(ctx, req, &users)
+ if err != nil {
+ return nil, err
+ }
+
+ return users, nil
+}
+
+// Update will update the given user. Empty strings will be ignored.
+func (u *UserServiceHandler) Update(ctx context.Context, user *User) error {
+
+ uri := "/v1/user/update"
+
+ values := url.Values{
+ "USERID": {user.UserID},
+ }
+
+ // Optional
+ if user.Email != "" {
+ values.Add("email", user.Email)
+ }
+ if user.Name != "" {
+ values.Add("name", user.Name)
+ }
+ if user.Password != "" {
+ values.Add("password", user.Password)
+ }
+ if user.APIEnabled != "" {
+ values.Add("api_enabled", user.APIEnabled)
+ }
+ if len(user.ACL) > 0 {
+ for _, acl := range user.ACL {
+ values.Add("acls[]", acl)
+ }
+ }
+
+ req, err := u.client.NewRequest(ctx, http.MethodPost, uri, values)
+
+ if err != nil {
+ return err
+ }
+
+ err = u.client.DoWithContext(ctx, req, nil)
+
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/go.opencensus.io/metric/metricdata/exemplar.go b/vendor/go.opencensus.io/metric/metricdata/exemplar.go
index cdbeef058..12695ce2d 100644
--- a/vendor/go.opencensus.io/metric/metricdata/exemplar.go
+++ b/vendor/go.opencensus.io/metric/metricdata/exemplar.go
@@ -18,6 +18,11 @@ import (
"time"
)
+// Exemplars keys.
+const (
+ AttachmentKeySpanContext = "SpanContext"
+)
+
// Exemplar is an example data point associated with each bucket of a
// distribution type aggregation.
//
diff --git a/vendor/go.opencensus.io/metric/metricdata/label.go b/vendor/go.opencensus.io/metric/metricdata/label.go
index 87c55b9c8..aadae41e6 100644
--- a/vendor/go.opencensus.io/metric/metricdata/label.go
+++ b/vendor/go.opencensus.io/metric/metricdata/label.go
@@ -14,6 +14,13 @@
package metricdata
+// LabelKey represents key of a label. It has optional
+// description attribute.
+type LabelKey struct {
+ Key string
+ Description string
+}
+
// LabelValue represents the value of a label.
// The zero value represents a missing label value, which may be treated
// differently to an empty string value by some back ends.
diff --git a/vendor/go.opencensus.io/metric/metricdata/metric.go b/vendor/go.opencensus.io/metric/metricdata/metric.go
index 6ccdec583..8293712c7 100644
--- a/vendor/go.opencensus.io/metric/metricdata/metric.go
+++ b/vendor/go.opencensus.io/metric/metricdata/metric.go
@@ -22,11 +22,11 @@ import (
// Descriptor holds metadata about a metric.
type Descriptor struct {
- Name string // full name of the metric
- Description string // human-readable description
- Unit Unit // units for the measure
- Type Type // type of measure
- LabelKeys []string // label keys
+ Name string // full name of the metric
+ Description string // human-readable description
+ Unit Unit // units for the measure
+ Type Type // type of measure
+ LabelKeys []LabelKey // label keys
}
// Metric represents a quantity measured against a resource with different
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client.go b/vendor/go.opencensus.io/plugin/ocgrpc/client.go
new file mode 100644
index 000000000..a6c466ae8
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/client.go
@@ -0,0 +1,56 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocgrpc
+
+import (
+ "go.opencensus.io/trace"
+ "golang.org/x/net/context"
+
+ "google.golang.org/grpc/stats"
+)
+
+// ClientHandler implements a gRPC stats.Handler for recording OpenCensus stats and
+// traces. Use with gRPC clients only.
+type ClientHandler struct {
+ // StartOptions allows configuring the StartOptions used to create new spans.
+ //
+ // StartOptions.SpanKind will always be set to trace.SpanKindClient
+ // for spans started by this handler.
+ StartOptions trace.StartOptions
+}
+
+// HandleConn exists to satisfy gRPC stats.Handler.
+func (c *ClientHandler) HandleConn(ctx context.Context, cs stats.ConnStats) {
+ // no-op
+}
+
+// TagConn exists to satisfy gRPC stats.Handler.
+func (c *ClientHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context {
+ // no-op
+ return ctx
+}
+
+// HandleRPC implements per-RPC tracing and stats instrumentation.
+func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
+ traceHandleRPC(ctx, rs)
+ statsHandleRPC(ctx, rs)
+}
+
+// TagRPC implements per-RPC context management.
+func (c *ClientHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context {
+ ctx = c.traceTagRPC(ctx, rti)
+ ctx = c.statsTagRPC(ctx, rti)
+ return ctx
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go b/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go
new file mode 100644
index 000000000..abe978b67
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go
@@ -0,0 +1,107 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package ocgrpc
+
+import (
+ "go.opencensus.io/stats"
+ "go.opencensus.io/stats/view"
+ "go.opencensus.io/tag"
+)
+
+// The following variables are measures are recorded by ClientHandler:
+var (
+ ClientSentMessagesPerRPC = stats.Int64("grpc.io/client/sent_messages_per_rpc", "Number of messages sent in the RPC (always 1 for non-streaming RPCs).", stats.UnitDimensionless)
+ ClientSentBytesPerRPC = stats.Int64("grpc.io/client/sent_bytes_per_rpc", "Total bytes sent across all request messages per RPC.", stats.UnitBytes)
+ ClientReceivedMessagesPerRPC = stats.Int64("grpc.io/client/received_messages_per_rpc", "Number of response messages received per RPC (always 1 for non-streaming RPCs).", stats.UnitDimensionless)
+ ClientReceivedBytesPerRPC = stats.Int64("grpc.io/client/received_bytes_per_rpc", "Total bytes received across all response messages per RPC.", stats.UnitBytes)
+ ClientRoundtripLatency = stats.Float64("grpc.io/client/roundtrip_latency", "Time between first byte of request sent to last byte of response received, or terminal error.", stats.UnitMilliseconds)
+ ClientServerLatency = stats.Float64("grpc.io/client/server_latency", `Propagated from the server and should have the same value as "grpc.io/server/latency".`, stats.UnitMilliseconds)
+)
+
+// Predefined views may be registered to collect data for the above measures.
+// As always, you may also define your own custom views over measures collected by this
+// package. These are declared as a convenience only; none are registered by
+// default.
+var (
+ ClientSentBytesPerRPCView = &view.View{
+ Measure: ClientSentBytesPerRPC,
+ Name: "grpc.io/client/sent_bytes_per_rpc",
+ Description: "Distribution of bytes sent per RPC, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultBytesDistribution,
+ }
+
+ ClientReceivedBytesPerRPCView = &view.View{
+ Measure: ClientReceivedBytesPerRPC,
+ Name: "grpc.io/client/received_bytes_per_rpc",
+ Description: "Distribution of bytes received per RPC, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultBytesDistribution,
+ }
+
+ ClientRoundtripLatencyView = &view.View{
+ Measure: ClientRoundtripLatency,
+ Name: "grpc.io/client/roundtrip_latency",
+ Description: "Distribution of round-trip latency, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultMillisecondsDistribution,
+ }
+
+ ClientCompletedRPCsView = &view.View{
+ Measure: ClientRoundtripLatency,
+ Name: "grpc.io/client/completed_rpcs",
+ Description: "Count of RPCs by method and status.",
+ TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus},
+ Aggregation: view.Count(),
+ }
+
+ ClientSentMessagesPerRPCView = &view.View{
+ Measure: ClientSentMessagesPerRPC,
+ Name: "grpc.io/client/sent_messages_per_rpc",
+ Description: "Distribution of sent messages count per RPC, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultMessageCountDistribution,
+ }
+
+ ClientReceivedMessagesPerRPCView = &view.View{
+ Measure: ClientReceivedMessagesPerRPC,
+ Name: "grpc.io/client/received_messages_per_rpc",
+ Description: "Distribution of received messages count per RPC, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultMessageCountDistribution,
+ }
+
+ ClientServerLatencyView = &view.View{
+ Measure: ClientServerLatency,
+ Name: "grpc.io/client/server_latency",
+ Description: "Distribution of server latency as viewed by client, by method.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: DefaultMillisecondsDistribution,
+ }
+)
+
+// DefaultClientViews are the default client views provided by this package.
+var DefaultClientViews = []*view.View{
+ ClientSentBytesPerRPCView,
+ ClientReceivedBytesPerRPCView,
+ ClientRoundtripLatencyView,
+ ClientCompletedRPCsView,
+}
+
+// TODO(jbd): Add roundtrip_latency, uncompressed_request_bytes, uncompressed_response_bytes, request_count, response_count.
+// TODO(acetechnologist): This is temporary and will need to be replaced by a
+// mechanism to load these defaults from a common repository/config shared by
+// all supported languages. Likely a serialized protobuf of these defaults.
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go
new file mode 100644
index 000000000..303c607f6
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go
@@ -0,0 +1,49 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package ocgrpc
+
+import (
+ "time"
+
+ "go.opencensus.io/tag"
+ "golang.org/x/net/context"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/stats"
+)
+
+// statsTagRPC gets the tag.Map populated by the application code, serializes
+// its tags into the GRPC metadata in order to be sent to the server.
+func (h *ClientHandler) statsTagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
+ startTime := time.Now()
+ if info == nil {
+ if grpclog.V(2) {
+ grpclog.Infof("clientHandler.TagRPC called with nil info.", info.FullMethodName)
+ }
+ return ctx
+ }
+
+ d := &rpcData{
+ startTime: startTime,
+ method: info.FullMethodName,
+ }
+ ts := tag.FromContext(ctx)
+ if ts != nil {
+ encoded := tag.Encode(ts)
+ ctx = stats.SetTags(ctx, encoded)
+ }
+
+ return context.WithValue(ctx, rpcDataKey, d)
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/doc.go b/vendor/go.opencensus.io/plugin/ocgrpc/doc.go
new file mode 100644
index 000000000..1370323fb
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/doc.go
@@ -0,0 +1,19 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package ocgrpc contains OpenCensus stats and trace
+// integrations for gRPC.
+//
+// Use ServerHandler for servers and ClientHandler for clients.
+package ocgrpc // import "go.opencensus.io/plugin/ocgrpc"
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server.go b/vendor/go.opencensus.io/plugin/ocgrpc/server.go
new file mode 100644
index 000000000..b67b3e2be
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/server.go
@@ -0,0 +1,80 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocgrpc
+
+import (
+ "go.opencensus.io/trace"
+ "golang.org/x/net/context"
+
+ "google.golang.org/grpc/stats"
+)
+
+// ServerHandler implements gRPC stats.Handler recording OpenCensus stats and
+// traces. Use with gRPC servers.
+//
+// When installed (see Example), tracing metadata is read from inbound RPCs
+// by default. If no tracing metadata is present, or if the tracing metadata is
+// present but the SpanContext isn't sampled, then a new trace may be started
+// (as determined by Sampler).
+type ServerHandler struct {
+ // IsPublicEndpoint may be set to true to always start a new trace around
+ // each RPC. Any SpanContext in the RPC metadata will be added as a linked
+ // span instead of making it the parent of the span created around the
+ // server RPC.
+ //
+ // Be aware that if you leave this false (the default) on a public-facing
+ // server, callers will be able to send tracing metadata in gRPC headers
+ // and trigger traces in your backend.
+ IsPublicEndpoint bool
+
+ // StartOptions to use for to spans started around RPCs handled by this server.
+ //
+ // These will apply even if there is tracing metadata already
+ // present on the inbound RPC but the SpanContext is not sampled. This
+ // ensures that each service has some opportunity to be traced. If you would
+ // like to not add any additional traces for this gRPC service, set:
+ //
+ // StartOptions.Sampler = trace.ProbabilitySampler(0.0)
+ //
+ // StartOptions.SpanKind will always be set to trace.SpanKindServer
+ // for spans started by this handler.
+ StartOptions trace.StartOptions
+}
+
+var _ stats.Handler = (*ServerHandler)(nil)
+
+// HandleConn exists to satisfy gRPC stats.Handler.
+func (s *ServerHandler) HandleConn(ctx context.Context, cs stats.ConnStats) {
+ // no-op
+}
+
+// TagConn exists to satisfy gRPC stats.Handler.
+func (s *ServerHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context {
+ // no-op
+ return ctx
+}
+
+// HandleRPC implements per-RPC tracing and stats instrumentation.
+func (s *ServerHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) {
+ traceHandleRPC(ctx, rs)
+ statsHandleRPC(ctx, rs)
+}
+
+// TagRPC implements per-RPC context management.
+func (s *ServerHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context {
+ ctx = s.traceTagRPC(ctx, rti)
+ ctx = s.statsTagRPC(ctx, rti)
+ return ctx
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go b/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go
new file mode 100644
index 000000000..609d9ed24
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go
@@ -0,0 +1,97 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package ocgrpc
+
+import (
+ "go.opencensus.io/stats"
+ "go.opencensus.io/stats/view"
+ "go.opencensus.io/tag"
+)
+
+// The following variables are measures are recorded by ServerHandler:
+var (
+ ServerReceivedMessagesPerRPC = stats.Int64("grpc.io/server/received_messages_per_rpc", "Number of messages received in each RPC. Has value 1 for non-streaming RPCs.", stats.UnitDimensionless)
+ ServerReceivedBytesPerRPC = stats.Int64("grpc.io/server/received_bytes_per_rpc", "Total bytes received across all messages per RPC.", stats.UnitBytes)
+ ServerSentMessagesPerRPC = stats.Int64("grpc.io/server/sent_messages_per_rpc", "Number of messages sent in each RPC. Has value 1 for non-streaming RPCs.", stats.UnitDimensionless)
+ ServerSentBytesPerRPC = stats.Int64("grpc.io/server/sent_bytes_per_rpc", "Total bytes sent in across all response messages per RPC.", stats.UnitBytes)
+ ServerLatency = stats.Float64("grpc.io/server/server_latency", "Time between first byte of request received to last byte of response sent, or terminal error.", stats.UnitMilliseconds)
+)
+
+// TODO(acetechnologist): This is temporary and will need to be replaced by a
+// mechanism to load these defaults from a common repository/config shared by
+// all supported languages. Likely a serialized protobuf of these defaults.
+
+// Predefined views may be registered to collect data for the above measures.
+// As always, you may also define your own custom views over measures collected by this
+// package. These are declared as a convenience only; none are registered by
+// default.
+var (
+ ServerReceivedBytesPerRPCView = &view.View{
+ Name: "grpc.io/server/received_bytes_per_rpc",
+ Description: "Distribution of received bytes per RPC, by method.",
+ Measure: ServerReceivedBytesPerRPC,
+ TagKeys: []tag.Key{KeyServerMethod},
+ Aggregation: DefaultBytesDistribution,
+ }
+
+ ServerSentBytesPerRPCView = &view.View{
+ Name: "grpc.io/server/sent_bytes_per_rpc",
+ Description: "Distribution of total sent bytes per RPC, by method.",
+ Measure: ServerSentBytesPerRPC,
+ TagKeys: []tag.Key{KeyServerMethod},
+ Aggregation: DefaultBytesDistribution,
+ }
+
+ ServerLatencyView = &view.View{
+ Name: "grpc.io/server/server_latency",
+ Description: "Distribution of server latency in milliseconds, by method.",
+ TagKeys: []tag.Key{KeyServerMethod},
+ Measure: ServerLatency,
+ Aggregation: DefaultMillisecondsDistribution,
+ }
+
+ ServerCompletedRPCsView = &view.View{
+ Name: "grpc.io/server/completed_rpcs",
+ Description: "Count of RPCs by method and status.",
+ TagKeys: []tag.Key{KeyServerMethod, KeyServerStatus},
+ Measure: ServerLatency,
+ Aggregation: view.Count(),
+ }
+
+ ServerReceivedMessagesPerRPCView = &view.View{
+ Name: "grpc.io/server/received_messages_per_rpc",
+ Description: "Distribution of messages received count per RPC, by method.",
+ TagKeys: []tag.Key{KeyServerMethod},
+ Measure: ServerReceivedMessagesPerRPC,
+ Aggregation: DefaultMessageCountDistribution,
+ }
+
+ ServerSentMessagesPerRPCView = &view.View{
+ Name: "grpc.io/server/sent_messages_per_rpc",
+ Description: "Distribution of messages sent count per RPC, by method.",
+ TagKeys: []tag.Key{KeyServerMethod},
+ Measure: ServerSentMessagesPerRPC,
+ Aggregation: DefaultMessageCountDistribution,
+ }
+)
+
+// DefaultServerViews are the default server views provided by this package.
+var DefaultServerViews = []*view.View{
+ ServerReceivedBytesPerRPCView,
+ ServerSentBytesPerRPCView,
+ ServerLatencyView,
+ ServerCompletedRPCsView,
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go
new file mode 100644
index 000000000..7847c1a91
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go
@@ -0,0 +1,63 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package ocgrpc
+
+import (
+ "time"
+
+ "golang.org/x/net/context"
+
+ "go.opencensus.io/tag"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/stats"
+)
+
+// statsTagRPC gets the metadata from gRPC context, extracts the encoded tags from
+// it and creates a new tag.Map and puts them into the returned context.
+func (h *ServerHandler) statsTagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
+ startTime := time.Now()
+ if info == nil {
+ if grpclog.V(2) {
+ grpclog.Infof("opencensus: TagRPC called with nil info.")
+ }
+ return ctx
+ }
+ d := &rpcData{
+ startTime: startTime,
+ method: info.FullMethodName,
+ }
+ propagated := h.extractPropagatedTags(ctx)
+ ctx = tag.NewContext(ctx, propagated)
+ ctx, _ = tag.New(ctx, tag.Upsert(KeyServerMethod, methodName(info.FullMethodName)))
+ return context.WithValue(ctx, rpcDataKey, d)
+}
+
+// extractPropagatedTags creates a new tag map containing the tags extracted from the
+// gRPC metadata.
+func (h *ServerHandler) extractPropagatedTags(ctx context.Context) *tag.Map {
+ buf := stats.Tags(ctx)
+ if buf == nil {
+ return nil
+ }
+ propagated, err := tag.Decode(buf)
+ if err != nil {
+ if grpclog.V(2) {
+ grpclog.Warningf("opencensus: Failed to decode tags from gRPC metadata failed to decode: %v", err)
+ }
+ return nil
+ }
+ return propagated
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
new file mode 100644
index 000000000..0ae569182
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go
@@ -0,0 +1,227 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package ocgrpc
+
+import (
+ "context"
+ "strconv"
+ "strings"
+ "sync/atomic"
+ "time"
+
+ "go.opencensus.io/metric/metricdata"
+ ocstats "go.opencensus.io/stats"
+ "go.opencensus.io/stats/view"
+ "go.opencensus.io/tag"
+ "go.opencensus.io/trace"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/stats"
+ "google.golang.org/grpc/status"
+)
+
+type grpcInstrumentationKey string
+
+// rpcData holds the instrumentation RPC data that is needed between the start
+// and end of an call. It holds the info that this package needs to keep track
+// of between the various GRPC events.
+type rpcData struct {
+ // reqCount and respCount has to be the first words
+ // in order to be 64-aligned on 32-bit architectures.
+ sentCount, sentBytes, recvCount, recvBytes int64 // access atomically
+
+ // startTime represents the time at which TagRPC was invoked at the
+ // beginning of an RPC. It is an appoximation of the time when the
+ // application code invoked GRPC code.
+ startTime time.Time
+ method string
+}
+
+// The following variables define the default hard-coded auxiliary data used by
+// both the default GRPC client and GRPC server metrics.
+var (
+ DefaultBytesDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296)
+ DefaultMillisecondsDistribution = view.Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000)
+ DefaultMessageCountDistribution = view.Distribution(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536)
+)
+
+// Server tags are applied to the context used to process each RPC, as well as
+// the measures at the end of each RPC.
+var (
+ KeyServerMethod, _ = tag.NewKey("grpc_server_method")
+ KeyServerStatus, _ = tag.NewKey("grpc_server_status")
+)
+
+// Client tags are applied to measures at the end of each RPC.
+var (
+ KeyClientMethod, _ = tag.NewKey("grpc_client_method")
+ KeyClientStatus, _ = tag.NewKey("grpc_client_status")
+)
+
+var (
+ rpcDataKey = grpcInstrumentationKey("opencensus-rpcData")
+)
+
+func methodName(fullname string) string {
+ return strings.TrimLeft(fullname, "/")
+}
+
+// statsHandleRPC processes the RPC events.
+func statsHandleRPC(ctx context.Context, s stats.RPCStats) {
+ switch st := s.(type) {
+ case *stats.Begin, *stats.OutHeader, *stats.InHeader, *stats.InTrailer, *stats.OutTrailer:
+ // do nothing for client
+ case *stats.OutPayload:
+ handleRPCOutPayload(ctx, st)
+ case *stats.InPayload:
+ handleRPCInPayload(ctx, st)
+ case *stats.End:
+ handleRPCEnd(ctx, st)
+ default:
+ grpclog.Infof("unexpected stats: %T", st)
+ }
+}
+
+func handleRPCOutPayload(ctx context.Context, s *stats.OutPayload) {
+ d, ok := ctx.Value(rpcDataKey).(*rpcData)
+ if !ok {
+ if grpclog.V(2) {
+ grpclog.Infoln("Failed to retrieve *rpcData from context.")
+ }
+ return
+ }
+
+ atomic.AddInt64(&d.sentBytes, int64(s.Length))
+ atomic.AddInt64(&d.sentCount, 1)
+}
+
+func handleRPCInPayload(ctx context.Context, s *stats.InPayload) {
+ d, ok := ctx.Value(rpcDataKey).(*rpcData)
+ if !ok {
+ if grpclog.V(2) {
+ grpclog.Infoln("Failed to retrieve *rpcData from context.")
+ }
+ return
+ }
+
+ atomic.AddInt64(&d.recvBytes, int64(s.Length))
+ atomic.AddInt64(&d.recvCount, 1)
+}
+
+func handleRPCEnd(ctx context.Context, s *stats.End) {
+ d, ok := ctx.Value(rpcDataKey).(*rpcData)
+ if !ok {
+ if grpclog.V(2) {
+ grpclog.Infoln("Failed to retrieve *rpcData from context.")
+ }
+ return
+ }
+
+ elapsedTime := time.Since(d.startTime)
+
+ var st string
+ if s.Error != nil {
+ s, ok := status.FromError(s.Error)
+ if ok {
+ st = statusCodeToString(s)
+ }
+ } else {
+ st = "OK"
+ }
+
+ latencyMillis := float64(elapsedTime) / float64(time.Millisecond)
+ attachments := getSpanCtxAttachment(ctx)
+ if s.Client {
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(
+ tag.Upsert(KeyClientMethod, methodName(d.method)),
+ tag.Upsert(KeyClientStatus, st)),
+ ocstats.WithAttachments(attachments),
+ ocstats.WithMeasurements(
+ ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
+ ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
+ ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
+ ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
+ ClientRoundtripLatency.M(latencyMillis)))
+ } else {
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(
+ tag.Upsert(KeyServerStatus, st),
+ ),
+ ocstats.WithAttachments(attachments),
+ ocstats.WithMeasurements(
+ ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)),
+ ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)),
+ ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)),
+ ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)),
+ ServerLatency.M(latencyMillis)))
+ }
+}
+
+func statusCodeToString(s *status.Status) string {
+ // see https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
+ switch c := s.Code(); c {
+ case codes.OK:
+ return "OK"
+ case codes.Canceled:
+ return "CANCELLED"
+ case codes.Unknown:
+ return "UNKNOWN"
+ case codes.InvalidArgument:
+ return "INVALID_ARGUMENT"
+ case codes.DeadlineExceeded:
+ return "DEADLINE_EXCEEDED"
+ case codes.NotFound:
+ return "NOT_FOUND"
+ case codes.AlreadyExists:
+ return "ALREADY_EXISTS"
+ case codes.PermissionDenied:
+ return "PERMISSION_DENIED"
+ case codes.ResourceExhausted:
+ return "RESOURCE_EXHAUSTED"
+ case codes.FailedPrecondition:
+ return "FAILED_PRECONDITION"
+ case codes.Aborted:
+ return "ABORTED"
+ case codes.OutOfRange:
+ return "OUT_OF_RANGE"
+ case codes.Unimplemented:
+ return "UNIMPLEMENTED"
+ case codes.Internal:
+ return "INTERNAL"
+ case codes.Unavailable:
+ return "UNAVAILABLE"
+ case codes.DataLoss:
+ return "DATA_LOSS"
+ case codes.Unauthenticated:
+ return "UNAUTHENTICATED"
+ default:
+ return "CODE_" + strconv.FormatInt(int64(c), 10)
+ }
+}
+
+func getSpanCtxAttachment(ctx context.Context) metricdata.Attachments {
+ attachments := map[string]interface{}{}
+ span := trace.FromContext(ctx)
+ if span == nil {
+ return attachments
+ }
+ spanCtx := span.SpanContext()
+ if spanCtx.IsSampled() {
+ attachments[metricdata.AttachmentKeySpanContext] = spanCtx
+ }
+ return attachments
+}
diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go
new file mode 100644
index 000000000..720f381c2
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go
@@ -0,0 +1,107 @@
+// Copyright 2017, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package ocgrpc
+
+import (
+ "strings"
+
+ "google.golang.org/grpc/codes"
+
+ "go.opencensus.io/trace"
+ "go.opencensus.io/trace/propagation"
+ "golang.org/x/net/context"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/stats"
+ "google.golang.org/grpc/status"
+)
+
+const traceContextKey = "grpc-trace-bin"
+
+// TagRPC creates a new trace span for the client side of the RPC.
+//
+// It returns ctx with the new trace span added and a serialization of the
+// SpanContext added to the outgoing gRPC metadata.
+func (c *ClientHandler) traceTagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context {
+ name := strings.TrimPrefix(rti.FullMethodName, "/")
+ name = strings.Replace(name, "/", ".", -1)
+ ctx, span := trace.StartSpan(ctx, name,
+ trace.WithSampler(c.StartOptions.Sampler),
+ trace.WithSpanKind(trace.SpanKindClient)) // span is ended by traceHandleRPC
+ traceContextBinary := propagation.Binary(span.SpanContext())
+ return metadata.AppendToOutgoingContext(ctx, traceContextKey, string(traceContextBinary))
+}
+
+// TagRPC creates a new trace span for the server side of the RPC.
+//
+// It checks the incoming gRPC metadata in ctx for a SpanContext, and if
+// it finds one, uses that SpanContext as the parent context of the new span.
+//
+// It returns ctx, with the new trace span added.
+func (s *ServerHandler) traceTagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context {
+ md, _ := metadata.FromIncomingContext(ctx)
+ name := strings.TrimPrefix(rti.FullMethodName, "/")
+ name = strings.Replace(name, "/", ".", -1)
+ traceContext := md[traceContextKey]
+ var (
+ parent trace.SpanContext
+ haveParent bool
+ )
+ if len(traceContext) > 0 {
+ // Metadata with keys ending in -bin are actually binary. They are base64
+ // encoded before being put on the wire, see:
+ // https://github.com/grpc/grpc-go/blob/08d6261/Documentation/grpc-metadata.md#storing-binary-data-in-metadata
+ traceContextBinary := []byte(traceContext[0])
+ parent, haveParent = propagation.FromBinary(traceContextBinary)
+ if haveParent && !s.IsPublicEndpoint {
+ ctx, _ := trace.StartSpanWithRemoteParent(ctx, name, parent,
+ trace.WithSpanKind(trace.SpanKindServer),
+ trace.WithSampler(s.StartOptions.Sampler),
+ )
+ return ctx
+ }
+ }
+ ctx, span := trace.StartSpan(ctx, name,
+ trace.WithSpanKind(trace.SpanKindServer),
+ trace.WithSampler(s.StartOptions.Sampler))
+ if haveParent {
+ span.AddLink(trace.Link{TraceID: parent.TraceID, SpanID: parent.SpanID, Type: trace.LinkTypeChild})
+ }
+ return ctx
+}
+
+func traceHandleRPC(ctx context.Context, rs stats.RPCStats) {
+ span := trace.FromContext(ctx)
+ // TODO: compressed and uncompressed sizes are not populated in every message.
+ switch rs := rs.(type) {
+ case *stats.Begin:
+ span.AddAttributes(
+ trace.BoolAttribute("Client", rs.Client),
+ trace.BoolAttribute("FailFast", rs.FailFast))
+ case *stats.InPayload:
+ span.AddMessageReceiveEvent(0 /* TODO: messageID */, int64(rs.Length), int64(rs.WireLength))
+ case *stats.OutPayload:
+ span.AddMessageSendEvent(0, int64(rs.Length), int64(rs.WireLength))
+ case *stats.End:
+ if rs.Error != nil {
+ s, ok := status.FromError(rs.Error)
+ if ok {
+ span.SetStatus(trace.Status{Code: int32(s.Code()), Message: s.Message()})
+ } else {
+ span.SetStatus(trace.Status{Code: int32(codes.Internal), Message: rs.Error.Error()})
+ }
+ }
+ span.End()
+ }
+}
diff --git a/vendor/go.opencensus.io/plugin/ochttp/propagation/tracecontext/propagation.go b/vendor/go.opencensus.io/plugin/ochttp/propagation/tracecontext/propagation.go
new file mode 100644
index 000000000..65ab1e996
--- /dev/null
+++ b/vendor/go.opencensus.io/plugin/ochttp/propagation/tracecontext/propagation.go
@@ -0,0 +1,187 @@
+// Copyright 2018, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package tracecontext contains HTTP propagator for TraceContext standard.
+// See https://github.com/w3c/distributed-tracing for more information.
+package tracecontext // import "go.opencensus.io/plugin/ochttp/propagation/tracecontext"
+
+import (
+ "encoding/hex"
+ "fmt"
+ "net/http"
+ "net/textproto"
+ "regexp"
+ "strings"
+
+ "go.opencensus.io/trace"
+ "go.opencensus.io/trace/propagation"
+ "go.opencensus.io/trace/tracestate"
+)
+
+const (
+ supportedVersion = 0
+ maxVersion = 254
+ maxTracestateLen = 512
+ traceparentHeader = "traceparent"
+ tracestateHeader = "tracestate"
+ trimOWSRegexFmt = `^[\x09\x20]*(.*[^\x20\x09])[\x09\x20]*$`
+)
+
+var trimOWSRegExp = regexp.MustCompile(trimOWSRegexFmt)
+
+var _ propagation.HTTPFormat = (*HTTPFormat)(nil)
+
+// HTTPFormat implements the TraceContext trace propagation format.
+type HTTPFormat struct{}
+
+// SpanContextFromRequest extracts a span context from incoming requests.
+func (f *HTTPFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) {
+ h, ok := getRequestHeader(req, traceparentHeader, false)
+ if !ok {
+ return trace.SpanContext{}, false
+ }
+ sections := strings.Split(h, "-")
+ if len(sections) < 4 {
+ return trace.SpanContext{}, false
+ }
+
+ if len(sections[0]) != 2 {
+ return trace.SpanContext{}, false
+ }
+ ver, err := hex.DecodeString(sections[0])
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ version := int(ver[0])
+ if version > maxVersion {
+ return trace.SpanContext{}, false
+ }
+
+ if version == 0 && len(sections) != 4 {
+ return trace.SpanContext{}, false
+ }
+
+ if len(sections[1]) != 32 {
+ return trace.SpanContext{}, false
+ }
+ tid, err := hex.DecodeString(sections[1])
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ copy(sc.TraceID[:], tid)
+
+ if len(sections[2]) != 16 {
+ return trace.SpanContext{}, false
+ }
+ sid, err := hex.DecodeString(sections[2])
+ if err != nil {
+ return trace.SpanContext{}, false
+ }
+ copy(sc.SpanID[:], sid)
+
+ opts, err := hex.DecodeString(sections[3])
+ if err != nil || len(opts) < 1 {
+ return trace.SpanContext{}, false
+ }
+ sc.TraceOptions = trace.TraceOptions(opts[0])
+
+ // Don't allow all zero trace or span ID.
+ if sc.TraceID == [16]byte{} || sc.SpanID == [8]byte{} {
+ return trace.SpanContext{}, false
+ }
+
+ sc.Tracestate = tracestateFromRequest(req)
+ return sc, true
+}
+
+// getRequestHeader returns a combined header field according to RFC7230 section 3.2.2.
+// If commaSeparated is true, multiple header fields with the same field name using be
+// combined using ",".
+// If no header was found using the given name, "ok" would be false.
+// If more than one headers was found using the given name, while commaSeparated is false,
+// "ok" would be false.
+func getRequestHeader(req *http.Request, name string, commaSeparated bool) (hdr string, ok bool) {
+ v := req.Header[textproto.CanonicalMIMEHeaderKey(name)]
+ switch len(v) {
+ case 0:
+ return "", false
+ case 1:
+ return v[0], true
+ default:
+ return strings.Join(v, ","), commaSeparated
+ }
+}
+
+// TODO(rghetia): return an empty Tracestate when parsing tracestate header encounters an error.
+// Revisit to return additional boolean value to indicate parsing error when following issues
+// are resolved.
+// https://github.com/w3c/distributed-tracing/issues/172
+// https://github.com/w3c/distributed-tracing/issues/175
+func tracestateFromRequest(req *http.Request) *tracestate.Tracestate {
+ h, _ := getRequestHeader(req, tracestateHeader, true)
+ if h == "" {
+ return nil
+ }
+
+ var entries []tracestate.Entry
+ pairs := strings.Split(h, ",")
+ hdrLenWithoutOWS := len(pairs) - 1 // Number of commas
+ for _, pair := range pairs {
+ matches := trimOWSRegExp.FindStringSubmatch(pair)
+ if matches == nil {
+ return nil
+ }
+ pair = matches[1]
+ hdrLenWithoutOWS += len(pair)
+ if hdrLenWithoutOWS > maxTracestateLen {
+ return nil
+ }
+ kv := strings.Split(pair, "=")
+ if len(kv) != 2 {
+ return nil
+ }
+ entries = append(entries, tracestate.Entry{Key: kv[0], Value: kv[1]})
+ }
+ ts, err := tracestate.New(nil, entries...)
+ if err != nil {
+ return nil
+ }
+
+ return ts
+}
+
+func tracestateToRequest(sc trace.SpanContext, req *http.Request) {
+ var pairs = make([]string, 0, len(sc.Tracestate.Entries()))
+ if sc.Tracestate != nil {
+ for _, entry := range sc.Tracestate.Entries() {
+ pairs = append(pairs, strings.Join([]string{entry.Key, entry.Value}, "="))
+ }
+ h := strings.Join(pairs, ",")
+
+ if h != "" && len(h) <= maxTracestateLen {
+ req.Header.Set(tracestateHeader, h)
+ }
+ }
+}
+
+// SpanContextToRequest modifies the given request to include traceparent and tracestate headers.
+func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) {
+ h := fmt.Sprintf("%x-%x-%x-%x",
+ []byte{supportedVersion},
+ sc.TraceID[:],
+ sc.SpanID[:],
+ []byte{byte(sc.TraceOptions)})
+ req.Header.Set(traceparentHeader, h)
+ tracestateToRequest(sc, req)
+}
diff --git a/vendor/go.opencensus.io/plugin/ochttp/server.go b/vendor/go.opencensus.io/plugin/ochttp/server.go
index 5fe15e89f..4f6404fa7 100644
--- a/vendor/go.opencensus.io/plugin/ochttp/server.go
+++ b/vendor/go.opencensus.io/plugin/ochttp/server.go
@@ -124,6 +124,12 @@ func (h *Handler) startTrace(w http.ResponseWriter, r *http.Request) (*http.Requ
}
}
span.AddAttributes(requestAttrs(r)...)
+ if r.Body == nil {
+ // TODO: Handle cases where ContentLength is not set.
+ } else if r.ContentLength > 0 {
+ span.AddMessageReceiveEvent(0, /* TODO: messageID */
+ int64(r.ContentLength), -1)
+ }
return r.WithContext(ctx), span.End
}
@@ -201,6 +207,9 @@ func (t *trackingResponseWriter) Header() http.Header {
func (t *trackingResponseWriter) Write(data []byte) (int, error) {
n, err := t.writer.Write(data)
t.respSize += int64(n)
+ // Add message event for request bytes sent.
+ span := trace.FromContext(t.ctx)
+ span.AddMessageSendEvent(0 /* TODO: messageID */, int64(n), -1)
return n, err
}
diff --git a/vendor/go.opencensus.io/stats/record.go b/vendor/go.opencensus.io/stats/record.go
index d2af0a60d..ad4691184 100644
--- a/vendor/go.opencensus.io/stats/record.go
+++ b/vendor/go.opencensus.io/stats/record.go
@@ -18,6 +18,7 @@ package stats
import (
"context"
+ "go.opencensus.io/metric/metricdata"
"go.opencensus.io/stats/internal"
"go.opencensus.io/tag"
)
@@ -30,28 +31,48 @@ func init() {
}
}
+type recordOptions struct {
+ attachments metricdata.Attachments
+ mutators []tag.Mutator
+ measurements []Measurement
+}
+
+// WithAttachments applies provided exemplar attachments.
+func WithAttachments(attachments metricdata.Attachments) Options {
+ return func(ro *recordOptions) {
+ ro.attachments = attachments
+ }
+}
+
+// WithTags applies provided tag mutators.
+func WithTags(mutators ...tag.Mutator) Options {
+ return func(ro *recordOptions) {
+ ro.mutators = mutators
+ }
+}
+
+// WithMeasurements applies provided measurements.
+func WithMeasurements(measurements ...Measurement) Options {
+ return func(ro *recordOptions) {
+ ro.measurements = measurements
+ }
+}
+
+// Options apply changes to recordOptions.
+type Options func(*recordOptions)
+
+func createRecordOption(ros ...Options) *recordOptions {
+ o := &recordOptions{}
+ for _, ro := range ros {
+ ro(o)
+ }
+ return o
+}
+
// Record records one or multiple measurements with the same context at once.
// If there are any tags in the context, measurements will be tagged with them.
func Record(ctx context.Context, ms ...Measurement) {
- recorder := internal.DefaultRecorder
- if recorder == nil {
- return
- }
- if len(ms) == 0 {
- return
- }
- record := false
- for _, m := range ms {
- if m.desc.subscribed() {
- record = true
- break
- }
- }
- if !record {
- return
- }
- // TODO(songy23): fix attachments.
- recorder(tag.FromContext(ctx), ms, map[string]interface{}{})
+ RecordWithOptions(ctx, WithMeasurements(ms...))
}
// RecordWithTags records one or multiple measurements at once.
@@ -60,10 +81,37 @@ func Record(ctx context.Context, ms ...Measurement) {
// RecordWithTags is useful if you want to record with tag mutations but don't want
// to propagate the mutations in the context.
func RecordWithTags(ctx context.Context, mutators []tag.Mutator, ms ...Measurement) error {
- ctx, err := tag.New(ctx, mutators...)
- if err != nil {
- return err
+ return RecordWithOptions(ctx, WithTags(mutators...), WithMeasurements(ms...))
+}
+
+// RecordWithOptions records measurements from the given options (if any) against context
+// and tags and attachments in the options (if any).
+// If there are any tags in the context, measurements will be tagged with them.
+func RecordWithOptions(ctx context.Context, ros ...Options) error {
+ o := createRecordOption(ros...)
+ if len(o.measurements) == 0 {
+ return nil
}
- Record(ctx, ms...)
+ recorder := internal.DefaultRecorder
+ if recorder == nil {
+ return nil
+ }
+ record := false
+ for _, m := range o.measurements {
+ if m.desc.subscribed() {
+ record = true
+ break
+ }
+ }
+ if !record {
+ return nil
+ }
+ if len(o.mutators) > 0 {
+ var err error
+ if ctx, err = tag.New(ctx, o.mutators...); err != nil {
+ return err
+ }
+ }
+ recorder(tag.FromContext(ctx), o.measurements, o.attachments)
return nil
}
diff --git a/vendor/go.opencensus.io/stats/view/view_to_metric.go b/vendor/go.opencensus.io/stats/view/view_to_metric.go
index 284299faf..010f81bab 100644
--- a/vendor/go.opencensus.io/stats/view/view_to_metric.go
+++ b/vendor/go.opencensus.io/stats/view/view_to_metric.go
@@ -73,10 +73,10 @@ func getType(v *View) metricdata.Type {
}
}
-func getLableKeys(v *View) []string {
- labelKeys := []string{}
+func getLableKeys(v *View) []metricdata.LabelKey {
+ labelKeys := []metricdata.LabelKey{}
for _, k := range v.TagKeys {
- labelKeys = append(labelKeys, k.Name())
+ labelKeys = append(labelKeys, metricdata.LabelKey{Key: k.Name()})
}
return labelKeys
}
@@ -91,10 +91,19 @@ func viewToMetricDescriptor(v *View) *metricdata.Descriptor {
}
}
-func toLabelValues(row *Row) []metricdata.LabelValue {
+func toLabelValues(row *Row, expectedKeys []metricdata.LabelKey) []metricdata.LabelValue {
labelValues := []metricdata.LabelValue{}
+ tagMap := make(map[string]string)
for _, tag := range row.Tags {
- labelValues = append(labelValues, metricdata.NewLabelValue(tag.Value))
+ tagMap[tag.Key.Name()] = tag.Value
+ }
+
+ for _, key := range expectedKeys {
+ if val, ok := tagMap[key.Key]; ok {
+ labelValues = append(labelValues, metricdata.NewLabelValue(val))
+ } else {
+ labelValues = append(labelValues, metricdata.LabelValue{})
+ }
}
return labelValues
}
@@ -102,7 +111,7 @@ func toLabelValues(row *Row) []metricdata.LabelValue {
func rowToTimeseries(v *viewInternal, row *Row, now time.Time, startTime time.Time) *metricdata.TimeSeries {
return &metricdata.TimeSeries{
Points: []metricdata.Point{row.Data.toPoint(v.metricDescriptor.Type, now)},
- LabelValues: toLabelValues(row),
+ LabelValues: toLabelValues(row, v.metricDescriptor.LabelKeys),
StartTime: startTime,
}
}
diff --git a/vendor/go.opencensus.io/stats/view/worker.go b/vendor/go.opencensus.io/stats/view/worker.go
index 37279b39e..2f3c018af 100644
--- a/vendor/go.opencensus.io/stats/view/worker.go
+++ b/vendor/go.opencensus.io/stats/view/worker.go
@@ -236,6 +236,8 @@ func (w *worker) reportView(v *viewInternal, now time.Time) {
}
func (w *worker) reportUsage(now time.Time) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
for _, v := range w.views {
w.reportView(v, now)
}
diff --git a/vendor/go.opencensus.io/stats/view/worker_commands.go b/vendor/go.opencensus.io/stats/view/worker_commands.go
index ba6203a50..0267e179a 100644
--- a/vendor/go.opencensus.io/stats/view/worker_commands.go
+++ b/vendor/go.opencensus.io/stats/view/worker_commands.go
@@ -121,6 +121,8 @@ type retrieveDataResp struct {
}
func (cmd *retrieveDataReq) handleCommand(w *worker) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
vi, ok := w.views[cmd.v]
if !ok {
cmd.c <- &retrieveDataResp{
@@ -153,6 +155,8 @@ type recordReq struct {
}
func (cmd *recordReq) handleCommand(w *worker) {
+ w.mu.Lock()
+ defer w.mu.Unlock()
for _, m := range cmd.ms {
if (m == stats.Measurement{}) { // not registered
continue
diff --git a/vendor/go.opencensus.io/tag/map.go b/vendor/go.opencensus.io/tag/map.go
index 5b72ba6ad..0272ef85a 100644
--- a/vendor/go.opencensus.io/tag/map.go
+++ b/vendor/go.opencensus.io/tag/map.go
@@ -28,10 +28,15 @@ type Tag struct {
Value string
}
+type tagContent struct {
+ value string
+ m metadatas
+}
+
// Map is a map of tags. Use New to create a context containing
// a new Map.
type Map struct {
- m map[Key]string
+ m map[Key]tagContent
}
// Value returns the value for the key if a value for the key exists.
@@ -40,7 +45,7 @@ func (m *Map) Value(k Key) (string, bool) {
return "", false
}
v, ok := m.m[k]
- return v, ok
+ return v.value, ok
}
func (m *Map) String() string {
@@ -62,21 +67,21 @@ func (m *Map) String() string {
return buffer.String()
}
-func (m *Map) insert(k Key, v string) {
+func (m *Map) insert(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
return
}
- m.m[k] = v
+ m.m[k] = tagContent{value: v, m: md}
}
-func (m *Map) update(k Key, v string) {
+func (m *Map) update(k Key, v string, md metadatas) {
if _, ok := m.m[k]; ok {
- m.m[k] = v
+ m.m[k] = tagContent{value: v, m: md}
}
}
-func (m *Map) upsert(k Key, v string) {
- m.m[k] = v
+func (m *Map) upsert(k Key, v string, md metadatas) {
+ m.m[k] = tagContent{value: v, m: md}
}
func (m *Map) delete(k Key) {
@@ -84,7 +89,7 @@ func (m *Map) delete(k Key) {
}
func newMap() *Map {
- return &Map{m: make(map[Key]string)}
+ return &Map{m: make(map[Key]tagContent)}
}
// Mutator modifies a tag map.
@@ -95,13 +100,17 @@ type Mutator interface {
// Insert returns a mutator that inserts a
// value associated with k. If k already exists in the tag map,
// mutator doesn't update the value.
-func Insert(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Insert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.insert(k, v)
+ m.insert(k, v, createMetadatas(mds...))
return m, nil
},
}
@@ -110,13 +119,17 @@ func Insert(k Key, v string) Mutator {
// Update returns a mutator that updates the
// value of the tag associated with k with v. If k doesn't
// exists in the tag map, the mutator doesn't insert the value.
-func Update(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Update(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.update(k, v)
+ m.update(k, v, createMetadatas(mds...))
return m, nil
},
}
@@ -126,18 +139,37 @@ func Update(k Key, v string) Mutator {
// value of the tag associated with k with v. It inserts the
// value if k doesn't exist already. It mutates the value
// if k already exists.
-func Upsert(k Key, v string) Mutator {
+// Metadata applies metadata to the tag. It is optional.
+// Metadatas are applied in the order in which it is provided.
+// If more than one metadata updates the same attribute then
+// the update from the last metadata prevails.
+func Upsert(k Key, v string, mds ...Metadata) Mutator {
return &mutator{
fn: func(m *Map) (*Map, error) {
if !checkValue(v) {
return nil, errInvalidValue
}
- m.upsert(k, v)
+ m.upsert(k, v, createMetadatas(mds...))
return m, nil
},
}
}
+func createMetadatas(mds ...Metadata) metadatas {
+ var metas metadatas
+ if len(mds) > 0 {
+ for _, md := range mds {
+ if md != nil {
+ md(&metas)
+ }
+ }
+ } else {
+ WithTTL(TTLUnlimitedPropagation)(&metas)
+ }
+ return metas
+
+}
+
// Delete returns a mutator that deletes
// the value associated with k.
func Delete(k Key) Mutator {
@@ -160,10 +192,10 @@ func New(ctx context.Context, mutator ...Mutator) (context.Context, error) {
if !checkKeyName(k.Name()) {
return ctx, fmt.Errorf("key:%q: %v", k, errInvalidKeyName)
}
- if !checkValue(v) {
+ if !checkValue(v.value) {
return ctx, fmt.Errorf("key:%q value:%q: %v", k.Name(), v, errInvalidValue)
}
- m.insert(k, v)
+ m.insert(k, v.value, v.m)
}
}
var err error
diff --git a/vendor/go.opencensus.io/tag/map_codec.go b/vendor/go.opencensus.io/tag/map_codec.go
index e88e72777..f8b582761 100644
--- a/vendor/go.opencensus.io/tag/map_codec.go
+++ b/vendor/go.opencensus.io/tag/map_codec.go
@@ -170,9 +170,11 @@ func Encode(m *Map) []byte {
}
eg.writeByte(byte(tagsVersionID))
for k, v := range m.m {
- eg.writeByte(byte(keyTypeString))
- eg.writeStringWithVarintLen(k.name)
- eg.writeBytesWithVarintLen([]byte(v))
+ if v.m.ttl.ttl == valueTTLUnlimitedPropagation {
+ eg.writeByte(byte(keyTypeString))
+ eg.writeStringWithVarintLen(k.name)
+ eg.writeBytesWithVarintLen([]byte(v.value))
+ }
}
return eg.bytes()
}
@@ -190,7 +192,7 @@ func Decode(bytes []byte) (*Map, error) {
// DecodeEach decodes the given serialized tag map, calling handler for each
// tag key and value decoded.
-func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
+func DecodeEach(bytes []byte, fn func(key Key, val string, md metadatas)) error {
eg := &encoderGRPC{
buf: bytes,
}
@@ -228,7 +230,7 @@ func DecodeEach(bytes []byte, fn func(key Key, val string)) error {
if !checkValue(val) {
return errInvalidValue
}
- fn(key, val)
+ fn(key, val, createMetadatas(WithTTL(TTLUnlimitedPropagation)))
if err != nil {
return err
}
diff --git a/vendor/go.opencensus.io/tag/metadata.go b/vendor/go.opencensus.io/tag/metadata.go
new file mode 100644
index 000000000..6571a583e
--- /dev/null
+++ b/vendor/go.opencensus.io/tag/metadata.go
@@ -0,0 +1,52 @@
+// Copyright 2019, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package tag
+
+const (
+ // valueTTLNoPropagation prevents tag from propagating.
+ valueTTLNoPropagation = 0
+
+ // valueTTLUnlimitedPropagation allows tag to propagate without any limits on number of hops.
+ valueTTLUnlimitedPropagation = -1
+)
+
+// TTL is metadata that specifies number of hops a tag can propagate.
+// Details about TTL metadata is specified at https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md#tagmetadata
+type TTL struct {
+ ttl int
+}
+
+var (
+ // TTLUnlimitedPropagation is TTL metadata that allows tag to propagate without any limits on number of hops.
+ TTLUnlimitedPropagation = TTL{ttl: valueTTLUnlimitedPropagation}
+
+ // TTLNoPropagation is TTL metadata that prevents tag from propagating.
+ TTLNoPropagation = TTL{ttl: valueTTLNoPropagation}
+)
+
+type metadatas struct {
+ ttl TTL
+}
+
+// Metadata applies metadatas specified by the function.
+type Metadata func(*metadatas)
+
+// WithTTL applies metadata with provided ttl.
+func WithTTL(ttl TTL) Metadata {
+ return func(m *metadatas) {
+ m.ttl = ttl
+ }
+}
diff --git a/vendor/go.opencensus.io/tag/profile_19.go b/vendor/go.opencensus.io/tag/profile_19.go
index f81cd0b4a..b34d95e34 100644
--- a/vendor/go.opencensus.io/tag/profile_19.go
+++ b/vendor/go.opencensus.io/tag/profile_19.go
@@ -25,7 +25,7 @@ func do(ctx context.Context, f func(ctx context.Context)) {
m := FromContext(ctx)
keyvals := make([]string, 0, 2*len(m.m))
for k, v := range m.m {
- keyvals = append(keyvals, k.Name(), v)
+ keyvals = append(keyvals, k.Name(), v.value)
}
pprof.Do(ctx, pprof.Labels(keyvals...), f)
}
diff --git a/vendor/golang.org/x/sync/LICENSE b/vendor/golang.org/x/sync/LICENSE
new file mode 100644
index 000000000..6a66aea5e
--- /dev/null
+++ b/vendor/golang.org/x/sync/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) 2009 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/golang.org/x/sync/PATENTS b/vendor/golang.org/x/sync/PATENTS
new file mode 100644
index 000000000..733099041
--- /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/semaphore/semaphore.go b/vendor/golang.org/x/sync/semaphore/semaphore.go
new file mode 100644
index 000000000..7f096fef0
--- /dev/null
+++ b/vendor/golang.org/x/sync/semaphore/semaphore.go
@@ -0,0 +1,127 @@
+// Copyright 2017 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 semaphore provides a weighted semaphore implementation.
+package semaphore // import "golang.org/x/sync/semaphore"
+
+import (
+ "container/list"
+ "context"
+ "sync"
+)
+
+type waiter struct {
+ n int64
+ ready chan<- struct{} // Closed when semaphore acquired.
+}
+
+// NewWeighted creates a new weighted semaphore with the given
+// maximum combined weight for concurrent access.
+func NewWeighted(n int64) *Weighted {
+ w := &Weighted{size: n}
+ return w
+}
+
+// Weighted provides a way to bound concurrent access to a resource.
+// The callers can request access with a given weight.
+type Weighted struct {
+ size int64
+ cur int64
+ mu sync.Mutex
+ waiters list.List
+}
+
+// Acquire acquires the semaphore with a weight of n, blocking until resources
+// are available or ctx is done. On success, returns nil. On failure, returns
+// ctx.Err() and leaves the semaphore unchanged.
+//
+// If ctx is already done, Acquire may still succeed without blocking.
+func (s *Weighted) Acquire(ctx context.Context, n int64) error {
+ s.mu.Lock()
+ if s.size-s.cur >= n && s.waiters.Len() == 0 {
+ s.cur += n
+ s.mu.Unlock()
+ return nil
+ }
+
+ if n > s.size {
+ // Don't make other Acquire calls block on one that's doomed to fail.
+ s.mu.Unlock()
+ <-ctx.Done()
+ return ctx.Err()
+ }
+
+ ready := make(chan struct{})
+ w := waiter{n: n, ready: ready}
+ elem := s.waiters.PushBack(w)
+ s.mu.Unlock()
+
+ select {
+ case <-ctx.Done():
+ err := ctx.Err()
+ s.mu.Lock()
+ select {
+ case <-ready:
+ // Acquired the semaphore after we were canceled. Rather than trying to
+ // fix up the queue, just pretend we didn't notice the cancelation.
+ err = nil
+ default:
+ s.waiters.Remove(elem)
+ }
+ s.mu.Unlock()
+ return err
+
+ case <-ready:
+ return nil
+ }
+}
+
+// TryAcquire acquires the semaphore with a weight of n without blocking.
+// On success, returns true. On failure, returns false and leaves the semaphore unchanged.
+func (s *Weighted) TryAcquire(n int64) bool {
+ s.mu.Lock()
+ success := s.size-s.cur >= n && s.waiters.Len() == 0
+ if success {
+ s.cur += n
+ }
+ s.mu.Unlock()
+ return success
+}
+
+// Release releases the semaphore with a weight of n.
+func (s *Weighted) Release(n int64) {
+ s.mu.Lock()
+ s.cur -= n
+ if s.cur < 0 {
+ s.mu.Unlock()
+ panic("semaphore: released more than held")
+ }
+ for {
+ next := s.waiters.Front()
+ if next == nil {
+ break // No more waiters blocked.
+ }
+
+ w := next.Value.(waiter)
+ if s.size-s.cur < w.n {
+ // Not enough tokens for the next waiter. We could keep going (to try to
+ // find a waiter with a smaller request), but under load that could cause
+ // starvation for large requests; instead, we leave all remaining waiters
+ // blocked.
+ //
+ // Consider a semaphore used as a read-write lock, with N tokens, N
+ // readers, and one writer. Each reader can Acquire(1) to obtain a read
+ // lock. The writer can Acquire(N) to obtain a write lock, excluding all
+ // of the readers. If we allow the readers to jump ahead in the queue,
+ // the writer will starve — there is always one token available for every
+ // reader.
+ break
+ }
+
+ s.cur += w.n
+ s.waiters.Remove(next)
+ close(w.ready)
+ }
+ s.mu.Unlock()
+}
diff --git a/vendor/google.golang.org/api/support/bundler/bundler.go b/vendor/google.golang.org/api/support/bundler/bundler.go
new file mode 100644
index 000000000..c55327119
--- /dev/null
+++ b/vendor/google.golang.org/api/support/bundler/bundler.go
@@ -0,0 +1,349 @@
+// Copyright 2016 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 bundler supports bundling (batching) of items. Bundling amortizes an
+// action with fixed costs over multiple items. For example, if an API provides
+// an RPC that accepts a list of items as input, but clients would prefer
+// adding items one at a time, then a Bundler can accept individual items from
+// the client and bundle many of them into a single RPC.
+//
+// This package is experimental and subject to change without notice.
+package bundler
+
+import (
+ "context"
+ "errors"
+ "math"
+ "reflect"
+ "sync"
+ "time"
+
+ "golang.org/x/sync/semaphore"
+)
+
+const (
+ DefaultDelayThreshold = time.Second
+ DefaultBundleCountThreshold = 10
+ DefaultBundleByteThreshold = 1e6 // 1M
+ DefaultBufferedByteLimit = 1e9 // 1G
+)
+
+var (
+ // ErrOverflow indicates that Bundler's stored bytes exceeds its BufferedByteLimit.
+ ErrOverflow = errors.New("bundler reached buffered byte limit")
+
+ // ErrOversizedItem indicates that an item's size exceeds the maximum bundle size.
+ ErrOversizedItem = errors.New("item size exceeds bundle byte limit")
+)
+
+// A Bundler collects items added to it into a bundle until the bundle
+// exceeds a given size, then calls a user-provided function to handle the bundle.
+type Bundler struct {
+ // Starting from the time that the first message is added to a bundle, once
+ // this delay has passed, handle the bundle. The default is DefaultDelayThreshold.
+ DelayThreshold time.Duration
+
+ // Once a bundle has this many items, handle the bundle. Since only one
+ // item at a time is added to a bundle, no bundle will exceed this
+ // threshold, so it also serves as a limit. The default is
+ // DefaultBundleCountThreshold.
+ BundleCountThreshold int
+
+ // Once the number of bytes in current bundle reaches this threshold, handle
+ // the bundle. The default is DefaultBundleByteThreshold. This triggers handling,
+ // but does not cap the total size of a bundle.
+ BundleByteThreshold int
+
+ // The maximum size of a bundle, in bytes. Zero means unlimited.
+ BundleByteLimit int
+
+ // The maximum number of bytes that the Bundler will keep in memory before
+ // returning ErrOverflow. The default is DefaultBufferedByteLimit.
+ BufferedByteLimit int
+
+ // The maximum number of handler invocations that can be running at once.
+ // The default is 1.
+ HandlerLimit int
+
+ handler func(interface{}) // called to handle a bundle
+ itemSliceZero reflect.Value // nil (zero value) for slice of items
+ flushTimer *time.Timer // implements DelayThreshold
+
+ mu sync.Mutex
+ sem *semaphore.Weighted // enforces BufferedByteLimit
+ semOnce sync.Once
+ curBundle bundle // incoming items added to this bundle
+
+ // Each bundle is assigned a unique ticket that determines the order in which the
+ // handler is called. The ticket is assigned with mu locked, but waiting for tickets
+ // to be handled is done via mu2 and cond, below.
+ nextTicket uint64 // next ticket to be assigned
+
+ mu2 sync.Mutex
+ cond *sync.Cond
+ nextHandled uint64 // next ticket to be handled
+
+ // In this implementation, active uses space proportional to HandlerLimit, and
+ // waitUntilAllHandled takes time proportional to HandlerLimit each time an acquire
+ // or release occurs, so large values of HandlerLimit max may cause performance
+ // issues.
+ active map[uint64]bool // tickets of bundles actively being handled
+}
+
+type bundle struct {
+ items reflect.Value // slice of item type
+ size int // size in bytes of all items
+}
+
+// NewBundler creates a new Bundler.
+//
+// itemExample is a value of the type that will be bundled. For example, if you
+// want to create bundles of *Entry, you could pass &Entry{} for itemExample.
+//
+// handler is a function that will be called on each bundle. If itemExample is
+// of type T, the argument to handler is of type []T. handler is always called
+// sequentially for each bundle, and never in parallel.
+//
+// Configure the Bundler by setting its thresholds and limits before calling
+// any of its methods.
+func NewBundler(itemExample interface{}, handler func(interface{})) *Bundler {
+ b := &Bundler{
+ DelayThreshold: DefaultDelayThreshold,
+ BundleCountThreshold: DefaultBundleCountThreshold,
+ BundleByteThreshold: DefaultBundleByteThreshold,
+ BufferedByteLimit: DefaultBufferedByteLimit,
+ HandlerLimit: 1,
+
+ handler: handler,
+ itemSliceZero: reflect.Zero(reflect.SliceOf(reflect.TypeOf(itemExample))),
+ active: map[uint64]bool{},
+ }
+ b.curBundle.items = b.itemSliceZero
+ b.cond = sync.NewCond(&b.mu2)
+ return b
+}
+
+func (b *Bundler) initSemaphores() {
+ // Create the semaphores lazily, because the user may set limits
+ // after NewBundler.
+ b.semOnce.Do(func() {
+ b.sem = semaphore.NewWeighted(int64(b.BufferedByteLimit))
+ })
+}
+
+// Add adds item to the current bundle. It marks the bundle for handling and
+// starts a new one if any of the thresholds or limits are exceeded.
+//
+// If the item's size exceeds the maximum bundle size (Bundler.BundleByteLimit), then
+// the item can never be handled. Add returns ErrOversizedItem in this case.
+//
+// If adding the item would exceed the maximum memory allowed
+// (Bundler.BufferedByteLimit) or an AddWait call is blocked waiting for
+// memory, Add returns ErrOverflow.
+//
+// Add never blocks.
+func (b *Bundler) Add(item interface{}, size int) error {
+ // If this item exceeds the maximum size of a bundle,
+ // we can never send it.
+ if b.BundleByteLimit > 0 && size > b.BundleByteLimit {
+ return ErrOversizedItem
+ }
+ // If adding this item would exceed our allotted memory
+ // footprint, we can't accept it.
+ // (TryAcquire also returns false if anything is waiting on the semaphore,
+ // so calls to Add and AddWait shouldn't be mixed.)
+ b.initSemaphores()
+ if !b.sem.TryAcquire(int64(size)) {
+ return ErrOverflow
+ }
+ b.add(item, size)
+ return nil
+}
+
+// add adds item to the current bundle. It marks the bundle for handling and
+// starts a new one if any of the thresholds or limits are exceeded.
+func (b *Bundler) add(item interface{}, size int) {
+ b.mu.Lock()
+ defer b.mu.Unlock()
+
+ // If adding this item to the current bundle would cause it to exceed the
+ // maximum bundle size, close the current bundle and start a new one.
+ if b.BundleByteLimit > 0 && b.curBundle.size+size > b.BundleByteLimit {
+ b.startFlushLocked()
+ }
+ // Add the item.
+ b.curBundle.items = reflect.Append(b.curBundle.items, reflect.ValueOf(item))
+ b.curBundle.size += size
+
+ // Start a timer to flush the item if one isn't already running.
+ // startFlushLocked clears the timer and closes the bundle at the same time,
+ // so we only allocate a new timer for the first item in each bundle.
+ // (We could try to call Reset on the timer instead, but that would add a lot
+ // of complexity to the code just to save one small allocation.)
+ if b.flushTimer == nil {
+ b.flushTimer = time.AfterFunc(b.DelayThreshold, b.Flush)
+ }
+
+ // If the current bundle equals the count threshold, close it.
+ if b.curBundle.items.Len() == b.BundleCountThreshold {
+ b.startFlushLocked()
+ }
+ // If the current bundle equals or exceeds the byte threshold, close it.
+ if b.curBundle.size >= b.BundleByteThreshold {
+ b.startFlushLocked()
+ }
+}
+
+// AddWait adds item to the current bundle. It marks the bundle for handling and
+// starts a new one if any of the thresholds or limits are exceeded.
+//
+// If the item's size exceeds the maximum bundle size (Bundler.BundleByteLimit), then
+// the item can never be handled. AddWait returns ErrOversizedItem in this case.
+//
+// If adding the item would exceed the maximum memory allowed (Bundler.BufferedByteLimit),
+// AddWait blocks until space is available or ctx is done.
+//
+// Calls to Add and AddWait should not be mixed on the same Bundler.
+func (b *Bundler) AddWait(ctx context.Context, item interface{}, size int) error {
+ // If this item exceeds the maximum size of a bundle,
+ // we can never send it.
+ if b.BundleByteLimit > 0 && size > b.BundleByteLimit {
+ return ErrOversizedItem
+ }
+ // If adding this item would exceed our allotted memory footprint, block
+ // until space is available. The semaphore is FIFO, so there will be no
+ // starvation.
+ b.initSemaphores()
+ if err := b.sem.Acquire(ctx, int64(size)); err != nil {
+ return err
+ }
+ // Here, we've reserved space for item. Other goroutines can call AddWait
+ // and even acquire space, but no one can take away our reservation
+ // (assuming sem.Release is used correctly). So there is no race condition
+ // resulting from locking the mutex after sem.Acquire returns.
+ b.add(item, size)
+ return nil
+}
+
+// Flush invokes the handler for all remaining items in the Bundler and waits
+// for it to return.
+func (b *Bundler) Flush() {
+ b.mu.Lock()
+ b.startFlushLocked()
+ // Here, all bundles with tickets < b.nextTicket are
+ // either finished or active. Those are the ones
+ // we want to wait for.
+ t := b.nextTicket
+ b.mu.Unlock()
+ b.initSemaphores()
+ b.waitUntilAllHandled(t)
+}
+
+func (b *Bundler) startFlushLocked() {
+ if b.flushTimer != nil {
+ b.flushTimer.Stop()
+ b.flushTimer = nil
+ }
+ if b.curBundle.items.Len() == 0 {
+ return
+ }
+ // Here, both semaphores must have been initialized.
+ bun := b.curBundle
+ b.curBundle = bundle{items: b.itemSliceZero}
+ ticket := b.nextTicket
+ b.nextTicket++
+ go func() {
+ defer func() {
+ b.sem.Release(int64(bun.size))
+ b.release(ticket)
+ }()
+ b.acquire(ticket)
+ b.handler(bun.items.Interface())
+ }()
+}
+
+// acquire blocks until ticket is the next to be served, then returns. In order for N
+// acquire calls to return, the tickets must be in the range [0, N). A ticket must
+// not be presented to acquire more than once.
+func (b *Bundler) acquire(ticket uint64) {
+ b.mu2.Lock()
+ defer b.mu2.Unlock()
+ if ticket < b.nextHandled {
+ panic("bundler: acquire: arg too small")
+ }
+ for !(ticket == b.nextHandled && len(b.active) < b.HandlerLimit) {
+ b.cond.Wait()
+ }
+ // Here,
+ // ticket == b.nextHandled: the caller is the next one to be handled;
+ // and len(b.active) < b.HandlerLimit: there is space available.
+ b.active[ticket] = true
+ b.nextHandled++
+ // Broadcast, not Signal: although at most one acquire waiter can make progress,
+ // there might be waiters in waitUntilAllHandled.
+ b.cond.Broadcast()
+}
+
+// If a ticket is used for a call to acquire, it must later be passed to release. A
+// ticket must not be presented to release more than once.
+func (b *Bundler) release(ticket uint64) {
+ b.mu2.Lock()
+ defer b.mu2.Unlock()
+ if !b.active[ticket] {
+ panic("bundler: release: not an active ticket")
+ }
+ delete(b.active, ticket)
+ b.cond.Broadcast()
+}
+
+// waitUntilAllHandled blocks until all tickets < n have called release, meaning
+// all bundles with tickets < n have been handled.
+func (b *Bundler) waitUntilAllHandled(n uint64) {
+ // Proof of correctness of this function.
+ // "N is acquired" means acquire(N) has returned.
+ // "N is released" means release(N) has returned.
+ // 1. If N is acquired, N-1 is acquired.
+ // Follows from the loop test in acquire, and the fact
+ // that nextHandled is incremented by 1.
+ // 2. If nextHandled >= N, then N-1 is acquired.
+ // Because we only increment nextHandled to N after N-1 is acquired.
+ // 3. If nextHandled >= N, then all n < N is acquired.
+ // Follows from #1 and #2.
+ // 4. If N is acquired and N is not in active, then N is released.
+ // Because we put N in active before acquire returns, and only
+ // remove it when it is released.
+ // Let min(active) be the smallest member of active, or infinity if active is empty.
+ // 5. If nextHandled >= N and N <= min(active), then all n < N is released.
+ // From nextHandled >= N and #3, all n < N is acquired.
+ // N <= min(active) implies n < min(active) for all n < N. So all n < N is not in active.
+ // So from #4, all n < N is released.
+ // The loop test below is the antecedent of #5.
+ b.mu2.Lock()
+ defer b.mu2.Unlock()
+ for !(b.nextHandled >= n && n <= min(b.active)) {
+ b.cond.Wait()
+ }
+}
+
+// min returns the minimum value of the set s, or the largest uint64 if
+// s is empty.
+func min(s map[uint64]bool) uint64 {
+ var m uint64 = math.MaxUint64
+ for n := range s {
+ if n < m {
+ m = n
+ }
+ }
+ return m
+}
diff --git a/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go
new file mode 100644
index 000000000..c3e12e5eb
--- /dev/null
+++ b/vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go
@@ -0,0 +1,114 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/api/httpbody.proto
+
+/*
+Package httpbody is a generated protocol buffer package.
+
+It is generated from these files:
+ google/api/httpbody.proto
+
+It has these top-level messages:
+ HttpBody
+*/
+package httpbody
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+
+// Message that represents an arbitrary HTTP body. It should only be used for
+// payload formats that can't be represented as JSON, such as raw binary or
+// an HTML page.
+//
+//
+// This message can be used both in streaming and non-streaming API methods in
+// the request as well as the response.
+//
+// It can be used as a top-level request field, which is convenient if one
+// wants to extract parameters from either the URL or HTTP template into the
+// request fields and also want access to the raw HTTP body.
+//
+// Example:
+//
+// message GetResourceRequest {
+// // A unique request id.
+// string request_id = 1;
+//
+// // The raw HTTP body is bound to this field.
+// google.api.HttpBody http_body = 2;
+// }
+//
+// service ResourceService {
+// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
+// rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty);
+// }
+//
+// Example with streaming methods:
+//
+// service CaldavService {
+// rpc GetCalendar(stream google.api.HttpBody)
+// returns (stream google.api.HttpBody);
+// rpc UpdateCalendar(stream google.api.HttpBody)
+// returns (stream google.api.HttpBody);
+// }
+//
+// Use of this type only changes how the request and response bodies are
+// handled, all other features will continue to work unchanged.
+type HttpBody struct {
+ // The HTTP Content-Type string representing the content type of the body.
+ ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType" json:"content_type,omitempty"`
+ // HTTP body binary data.
+ Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
+}
+
+func (m *HttpBody) Reset() { *m = HttpBody{} }
+func (m *HttpBody) String() string { return proto.CompactTextString(m) }
+func (*HttpBody) ProtoMessage() {}
+func (*HttpBody) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+
+func (m *HttpBody) GetContentType() string {
+ if m != nil {
+ return m.ContentType
+ }
+ return ""
+}
+
+func (m *HttpBody) GetData() []byte {
+ if m != nil {
+ return m.Data
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*HttpBody)(nil), "google.api.HttpBody")
+}
+
+func init() { proto.RegisterFile("google/api/httpbody.proto", fileDescriptor0) }
+
+var fileDescriptor0 = []byte{
+ // 181 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
+ 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0xcf, 0x28, 0x29, 0x29, 0x48, 0xca, 0x4f, 0xa9, 0xd4,
+ 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x82, 0x48, 0xe9, 0x25, 0x16, 0x64, 0x2a, 0x39, 0x72,
+ 0x71, 0x78, 0x94, 0x94, 0x14, 0x38, 0xe5, 0xa7, 0x54, 0x0a, 0x29, 0x72, 0xf1, 0x24, 0xe7, 0xe7,
+ 0x95, 0xa4, 0xe6, 0x95, 0xc4, 0x97, 0x54, 0x16, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06,
+ 0x71, 0x43, 0xc5, 0x42, 0x2a, 0x0b, 0x52, 0x85, 0x84, 0xb8, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25,
+ 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa7, 0x54, 0x2e, 0xbe, 0xe4, 0xfc, 0x5c, 0x3d,
+ 0x84, 0xa1, 0x4e, 0xbc, 0x30, 0x23, 0x03, 0x40, 0xf6, 0x05, 0x30, 0x46, 0x59, 0x43, 0x25, 0xd3,
+ 0xf3, 0x73, 0x12, 0xf3, 0xd2, 0xf5, 0xf2, 0x8b, 0xd2, 0xf5, 0xd3, 0x53, 0xf3, 0xc0, 0xae, 0xd1,
+ 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xa3, 0xb8, 0xd5, 0x1a, 0xc6, 0x58, 0xc4, 0xc4, 0xe2, 0xee,
+ 0x18, 0xe0, 0x99, 0xc4, 0x06, 0x56, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x3a, 0xdf,
+ 0x30, 0xd9, 0x00, 0x00, 0x00,
+}
diff --git a/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go
new file mode 100644
index 000000000..485bf0066
--- /dev/null
+++ b/vendor/google.golang.org/genproto/protobuf/field_mask/field_mask.pb.go
@@ -0,0 +1,267 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: google/protobuf/field_mask.proto
+
+/*
+Package field_mask is a generated protocol buffer package.
+
+It is generated from these files:
+ google/protobuf/field_mask.proto
+
+It has these top-level messages:
+ FieldMask
+*/
+package field_mask
+
+import proto "github.com/golang/protobuf/proto"
+import fmt "fmt"
+import math "math"
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
+
+// `FieldMask` represents a set of symbolic field paths, for example:
+//
+// paths: "f.a"
+// paths: "f.b.d"
+//
+// Here `f` represents a field in some root message, `a` and `b`
+// fields in the message found in `f`, and `d` a field found in the
+// message in `f.b`.
+//
+// Field masks are used to specify a subset of fields that should be
+// returned by a get operation or modified by an update operation.
+// Field masks also have a custom JSON encoding (see below).
+//
+// # Field Masks in Projections
+//
+// When used in the context of a projection, a response message or
+// sub-message is filtered by the API to only contain those fields as
+// specified in the mask. For example, if the mask in the previous
+// example is applied to a response message as follows:
+//
+// f {
+// a : 22
+// b {
+// d : 1
+// x : 2
+// }
+// y : 13
+// }
+// z: 8
+//
+// The result will not contain specific values for fields x,y and z
+// (their value will be set to the default, and omitted in proto text
+// output):
+//
+//
+// f {
+// a : 22
+// b {
+// d : 1
+// }
+// }
+//
+// A repeated field is not allowed except at the last position of a
+// paths string.
+//
+// If a FieldMask object is not present in a get operation, the
+// operation applies to all fields (as if a FieldMask of all fields
+// had been specified).
+//
+// Note that a field mask does not necessarily apply to the
+// top-level response message. In case of a REST get operation, the
+// field mask applies directly to the response, but in case of a REST
+// list operation, the mask instead applies to each individual message
+// in the returned resource list. In case of a REST custom method,
+// other definitions may be used. Where the mask applies will be
+// clearly documented together with its declaration in the API. In
+// any case, the effect on the returned resource/resources is required
+// behavior for APIs.
+//
+// # Field Masks in Update Operations
+//
+// A field mask in update operations specifies which fields of the
+// targeted resource are going to be updated. The API is required
+// to only change the values of the fields as specified in the mask
+// and leave the others untouched. If a resource is passed in to
+// describe the updated values, the API ignores the values of all
+// fields not covered by the mask.
+//
+// If a repeated field is specified for an update operation, the existing
+// repeated values in the target resource will be overwritten by the new values.
+// Note that a repeated field is only allowed in the last position of a `paths`
+// string.
+//
+// If a sub-message is specified in the last position of the field mask for an
+// update operation, then the existing sub-message in the target resource is
+// overwritten. Given the target message:
+//
+// f {
+// b {
+// d : 1
+// x : 2
+// }
+// c : 1
+// }
+//
+// And an update message:
+//
+// f {
+// b {
+// d : 10
+// }
+// }
+//
+// then if the field mask is:
+//
+// paths: "f.b"
+//
+// then the result will be:
+//
+// f {
+// b {
+// d : 10
+// }
+// c : 1
+// }
+//
+// However, if the update mask was:
+//
+// paths: "f.b.d"
+//
+// then the result would be:
+//
+// f {
+// b {
+// d : 10
+// x : 2
+// }
+// c : 1
+// }
+//
+// In order to reset a field's value to the default, the field must
+// be in the mask and set to the default value in the provided resource.
+// Hence, in order to reset all fields of a resource, provide a default
+// instance of the resource and set all fields in the mask, or do
+// not provide a mask as described below.
+//
+// If a field mask is not present on update, the operation applies to
+// all fields (as if a field mask of all fields has been specified).
+// Note that in the presence of schema evolution, this may mean that
+// fields the client does not know and has therefore not filled into
+// the request will be reset to their default. If this is unwanted
+// behavior, a specific service may require a client to always specify
+// a field mask, producing an error if not.
+//
+// As with get operations, the location of the resource which
+// describes the updated values in the request message depends on the
+// operation kind. In any case, the effect of the field mask is
+// required to be honored by the API.
+//
+// ## Considerations for HTTP REST
+//
+// The HTTP kind of an update operation which uses a field mask must
+// be set to PATCH instead of PUT in order to satisfy HTTP semantics
+// (PUT must only be used for full updates).
+//
+// # JSON Encoding of Field Masks
+//
+// In JSON, a field mask is encoded as a single string where paths are
+// separated by a comma. Fields name in each path are converted
+// to/from lower-camel naming conventions.
+//
+// As an example, consider the following message declarations:
+//
+// message Profile {
+// User user = 1;
+// Photo photo = 2;
+// }
+// message User {
+// string display_name = 1;
+// string address = 2;
+// }
+//
+// In proto a field mask for `Profile` may look as such:
+//
+// mask {
+// paths: "user.display_name"
+// paths: "photo"
+// }
+//
+// In JSON, the same mask is represented as below:
+//
+// {
+// mask: "user.displayName,photo"
+// }
+//
+// # Field Masks and Oneof Fields
+//
+// Field masks treat fields in oneofs just as regular fields. Consider the
+// following message:
+//
+// message SampleMessage {
+// oneof test_oneof {
+// string name = 4;
+// SubMessage sub_message = 9;
+// }
+// }
+//
+// The field mask can be:
+//
+// mask {
+// paths: "name"
+// }
+//
+// Or:
+//
+// mask {
+// paths: "sub_message"
+// }
+//
+// Note that oneof type names ("test_oneof" in this case) cannot be used in
+// paths.
+type FieldMask struct {
+ // The set of field mask paths.
+ Paths []string `protobuf:"bytes,1,rep,name=paths" json:"paths,omitempty"`
+}
+
+func (m *FieldMask) Reset() { *m = FieldMask{} }
+func (m *FieldMask) String() string { return proto.CompactTextString(m) }
+func (*FieldMask) ProtoMessage() {}
+func (*FieldMask) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
+
+func (m *FieldMask) GetPaths() []string {
+ if m != nil {
+ return m.Paths
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask")
+}
+
+func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor0) }
+
+var fileDescriptor0 = []byte{
+ // 171 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f,
+ 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd,
+ 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54,
+ 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16,
+ 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x9d, 0x8c,
+ 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01,
+ 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa,
+ 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0x2e, 0x62, 0x62, 0x76, 0x0f, 0x70,
+ 0x5a, 0xc5, 0x24, 0xe7, 0x0e, 0x31, 0x21, 0x00, 0xaa, 0x5a, 0x2f, 0x3c, 0x35, 0x27, 0xc7, 0x3b,
+ 0x2f, 0xbf, 0x3c, 0x2f, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0x8c, 0x31, 0x20, 0x00,
+ 0x00, 0xff, 0xff, 0x5a, 0xdb, 0x3a, 0xc0, 0xea, 0x00, 0x00, 0x00,
+}
diff --git a/vendor/github.com/go-resty/resty/LICENSE b/vendor/gopkg.in/resty.v1/LICENSE
similarity index 94%
rename from vendor/github.com/go-resty/resty/LICENSE
rename to vendor/gopkg.in/resty.v1/LICENSE
index 6ae89ae63..5cf0a2f99 100644
--- a/vendor/github.com/go-resty/resty/LICENSE
+++ b/vendor/gopkg.in/resty.v1/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015-2018 Jeevanandam M., https://myjeeva.com
+Copyright (c) 2015-2019 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/client.go b/vendor/gopkg.in/resty.v1/client.go
similarity index 95%
rename from vendor/github.com/go-resty/resty/client.go
rename to vendor/gopkg.in/resty.v1/client.go
index 8e63ef9f0..68d447fa6 100644
--- a/vendor/github.com/go-resty/resty/client.go
+++ b/vendor/gopkg.in/resty.v1/client.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -58,7 +58,7 @@ var (
jsonContentType = "application/json; charset=utf-8"
formContentType = "application/x-www-form-urlencoded"
- jsonCheck = regexp.MustCompile(`(?i:(application|text)/(json|.*\+json)(;|$))`)
+ jsonCheck = regexp.MustCompile(`(?i:(application|text)/(json|.*\+json|json\-.*)(;|$))`)
xmlCheck = regexp.MustCompile(`(?i:(application|text)/(xml|.*\+xml)(;|$))`)
hdrUserAgentValue = "go-resty/%s (https://github.com/go-resty/resty)"
@@ -103,6 +103,8 @@ type Client struct {
udBeforeRequest []func(*Client, *Request) error
preReqHook func(*Client, *Request) error
afterResponse []func(*Client, *Response) error
+ requestLog func(*RequestLog) error
+ responseLog func(*ResponseLog) error
}
// User type is to hold an username and password information
@@ -309,7 +311,7 @@ func (c *Client) R() *Request {
client: c,
multipartFiles: []*File{},
- multipartFields: []*multipartField{},
+ multipartFields: []*MultipartField{},
pathParams: map[string]string{},
jsonEscapeHTML: true,
}
@@ -383,6 +385,26 @@ 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.
+func (c *Client) OnRequestLog(rl func(*RequestLog) error) *Client {
+ if c.requestLog != nil {
+ c.Log.Printf("Overwriting an existing on-request-log callback from=%s to=%s", functionName(c.requestLog), functionName(rl))
+ }
+ c.requestLog = rl
+ return c
+}
+
+// OnResponseLog method used to set response log callback into resty. Registered callback gets
+// called before the resty actually logs the information.
+func (c *Client) OnResponseLog(rl func(*ResponseLog) error) *Client {
+ if c.responseLog != nil {
+ c.Log.Printf("Overwriting an existing on-response-log callback from=%s to=%s", functionName(c.responseLog), functionName(rl))
+ }
+ c.responseLog = rl
+ return c
+}
+
// SetDisableWarn method disables the warning message on `go-resty` client.
// For example: go-resty warns the user when BasicAuth used on HTTP mode.
// resty.SetDisableWarn(true)
@@ -793,6 +815,10 @@ func (c *Client) execute(req *Request) (*Response, error) {
req.RawRequest.Host = hostHeader
}
+ if err = requestLogger(c, req); err != nil {
+ return nil, err
+ }
+
req.Time = time.Now()
resp, err := c.httpClient.Do(req.RawRequest)
@@ -810,8 +836,8 @@ func (c *Client) execute(req *Request) (*Response, error) {
defer closeq(resp.Body)
body := resp.Body
- // GitHub #142
- if strings.EqualFold(resp.Header.Get(hdrContentEncodingKey), "gzip") && resp.ContentLength > 0 {
+ // GitHub #142 & #187
+ if strings.EqualFold(resp.Header.Get(hdrContentEncodingKey), "gzip") && resp.ContentLength != 0 {
if _, ok := body.(*gzip.Reader); !ok {
body, err = gzip.NewReader(body)
if err != nil {
@@ -891,8 +917,8 @@ func (f *File) String() string {
return fmt.Sprintf("ParamName: %v; FileName: %v", f.ParamName, f.Name)
}
-// multipartField represent custom data part for multipart request
-type multipartField struct {
+// MultipartField represent custom data part for multipart request
+type MultipartField struct {
Param string
FileName string
ContentType string
diff --git a/vendor/github.com/go-resty/resty/default.go b/vendor/gopkg.in/resty.v1/default.go
similarity index 99%
rename from vendor/github.com/go-resty/resty/default.go
rename to vendor/gopkg.in/resty.v1/default.go
index 4fc7b2dc4..cc6ae478c 100644
--- a/vendor/github.com/go-resty/resty/default.go
+++ b/vendor/gopkg.in/resty.v1/default.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -307,7 +307,6 @@ func createClient(hc *http.Client) *Client {
parseRequestBody,
createHTTPRequest,
addCredentials,
- requestLogger,
}
// user defined request middlewares
diff --git a/vendor/github.com/go-resty/resty/middleware.go b/vendor/gopkg.in/resty.v1/middleware.go
similarity index 92%
rename from vendor/github.com/go-resty/resty/middleware.go
rename to vendor/gopkg.in/resty.v1/middleware.go
index 7b7ceb726..9b6f102ed 100644
--- a/vendor/github.com/go-resty/resty/middleware.go
+++ b/vendor/gopkg.in/resty.v1/middleware.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -28,12 +28,12 @@ func parseRequestURL(c *Client, r *Request) error {
// GitHub #103 Path Params
if len(r.pathParams) > 0 {
for p, v := range r.pathParams {
- r.URL = strings.Replace(r.URL, "{"+p+"}", v, -1)
+ r.URL = strings.Replace(r.URL, "{"+p+"}", url.PathEscape(v), -1)
}
}
if len(c.pathParams) > 0 {
for p, v := range c.pathParams {
- r.URL = strings.Replace(r.URL, "{"+p+"}", v, -1)
+ r.URL = strings.Replace(r.URL, "{"+p+"}", url.PathEscape(v), -1)
}
}
@@ -223,12 +223,19 @@ func addCredentials(c *Client, r *Request) error {
func requestLogger(c *Client, r *Request) error {
if c.Debug {
rr := r.RawRequest
+ rl := &RequestLog{Header: copyHeaders(rr.Header), Body: r.fmtBodyString()}
+ if c.requestLog != nil {
+ if err := c.requestLog(rl); err != nil {
+ return err
+ }
+ }
+
reqLog := "\n---------------------- REQUEST LOG -----------------------\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") +
- composeHeaders(rr.Header) + "\n" +
- fmt.Sprintf("BODY :\n%v\n", r.fmtBodyString()) +
+ composeHeaders(rl.Header) + "\n" +
+ fmt.Sprintf("BODY :\n%v\n", rl.Body) +
"----------------------------------------------------------\n"
c.Log.Print(reqLog)
@@ -243,17 +250,23 @@ func requestLogger(c *Client, r *Request) error {
func responseLogger(c *Client, res *Response) error {
if c.Debug {
+ rl := &ResponseLog{Header: copyHeaders(res.Header()), Body: res.fmtBodyString(c.debugBodySizeLimit)}
+ if c.responseLog != nil {
+ if err := c.responseLog(rl); err != nil {
+ return err
+ }
+ }
+
resLog := "\n---------------------- RESPONSE LOG -----------------------\n" +
fmt.Sprintf("STATUS : %s\n", res.Status()) +
fmt.Sprintf("RECEIVED AT : %v\n", res.ReceivedAt().Format(time.RFC3339Nano)) +
fmt.Sprintf("RESPONSE TIME : %v\n", res.Time()) +
"HEADERS:\n" +
- composeHeaders(res.Header()) + "\n"
-
+ composeHeaders(rl.Header) + "\n"
if res.Request.isSaveResponse {
resLog += fmt.Sprintf("BODY :\n***** RESPONSE WRITTEN INTO FILE *****\n")
} else {
- resLog += fmt.Sprintf("BODY :\n%v\n", res.fmtBodyString(c.debugBodySizeLimit))
+ resLog += fmt.Sprintf("BODY :\n%v\n", rl.Body)
}
resLog += "----------------------------------------------------------\n"
@@ -264,6 +277,9 @@ func responseLogger(c *Client, res *Response) error {
}
func parseResponseBody(c *Client, res *Response) (err error) {
+ if res.StatusCode() == http.StatusNoContent {
+ return
+ }
// Handles only JSON or XML content type
ct := firstNonEmpty(res.Header().Get(hdrContentTypeKey), res.Request.fallbackContentType)
if IsJSONType(ct) || IsXMLType(ct) {
diff --git a/vendor/github.com/go-resty/resty/redirect.go b/vendor/gopkg.in/resty.v1/redirect.go
similarity index 98%
rename from vendor/github.com/go-resty/resty/redirect.go
rename to vendor/gopkg.in/resty.v1/redirect.go
index ac362cc44..b426134ad 100644
--- a/vendor/github.com/go-resty/resty/redirect.go
+++ b/vendor/gopkg.in/resty.v1/redirect.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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/request.go b/vendor/gopkg.in/resty.v1/request.go
similarity index 92%
rename from vendor/github.com/go-resty/resty/request.go
rename to vendor/gopkg.in/resty.v1/request.go
index 91ffdc7e6..c6adff3dd 100644
--- a/vendor/github.com/go-resty/resty/request.go
+++ b/vendor/gopkg.in/resty.v1/request.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -159,10 +159,12 @@ func (r *Request) SetMultiValueFormData(params url.Values) *Request {
return r
}
-// SetBody method sets the request body for the request. It supports various realtime need easy.
-// We can say its quite handy or powerful. Supported request body data types is `string`, `[]byte`,
-// `struct` and `map`. Body value can be pointer or non-pointer. Automatic marshalling
-// for JSON and XML content type, if it is `struct` or `map`.
+// 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`.
+//
+// Note: `io.Reader` is processed as bufferless mode while sending request.
//
// Example:
//
@@ -242,7 +244,6 @@ func (r *Request) SetError(err interface{}) *Request {
func (r *Request) SetFile(param, filePath string) *Request {
r.isMultiPart = true
r.FormData.Set("@"+param, filePath)
-
return r
}
@@ -271,27 +272,47 @@ func (r *Request) SetFiles(files map[string]string) *Request {
//
func (r *Request) SetFileReader(param, fileName string, reader io.Reader) *Request {
r.isMultiPart = true
-
r.multipartFiles = append(r.multipartFiles, &File{
Name: fileName,
ParamName: param,
Reader: reader,
})
-
return r
}
// SetMultipartField method is to set custom data 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{
+ r.multipartFields = append(r.multipartFields, &MultipartField{
Param: param,
FileName: fileName,
ContentType: contentType,
Reader: reader,
})
+ return r
+}
+// SetMultipartFields method is to set multiple data fields using io.Reader for multipart upload.
+// Example:
+// resty.R().SetMultipartFields(
+// &resty.MultipartField{
+// Param: "uploadManifest1",
+// FileName: "upload-file-1.json",
+// ContentType: "application/json",
+// Reader: strings.NewReader(`{"input": {"name": "Uploaded document 1", "_filename" : ["file1.txt"]}}`),
+// },
+// &resty.MultipartField{
+// Param: "uploadManifest2",
+// FileName: "upload-file-2.json",
+// ContentType: "application/json",
+// Reader: strings.NewReader(`{"input": {"name": "Uploaded document 2", "_filename" : ["file2.txt"]}}`),
+// })
+//
+// If you have slice already, then simply call-
+// resty.R().SetMultipartFields(fields...)
+func (r *Request) SetMultipartFields(fields ...*MultipartField) *Request {
+ r.isMultiPart = true
+ r.multipartFields = append(r.multipartFields, fields...)
return r
}
@@ -302,7 +323,6 @@ func (r *Request) SetMultipartField(param, fileName, contentType string, reader
//
func (r *Request) SetContentLength(l bool) *Request {
r.setContentLength = true
-
return r
}
diff --git a/vendor/github.com/go-resty/resty/request16.go b/vendor/gopkg.in/resty.v1/request16.go
similarity index 93%
rename from vendor/github.com/go-resty/resty/request16.go
rename to vendor/gopkg.in/resty.v1/request16.go
index 999ba80ae..079ecfca7 100644
--- a/vendor/github.com/go-resty/resty/request16.go
+++ b/vendor/gopkg.in/resty.v1/request16.go
@@ -1,6 +1,6 @@
// +build !go1.7
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com)
+// Copyright (c) 2015-2019 Jeevanandam M (jeeva@myjeeva.com)
// 2016 Andrew Grigorev (https://github.com/ei-grad)
// All rights reserved.
// resty source code and usage is governed by a MIT style
@@ -47,7 +47,7 @@ type Request struct {
client *Client
bodyBuf *bytes.Buffer
multipartFiles []*File
- multipartFields []*multipartField
+ multipartFields []*MultipartField
}
func (r *Request) addContextIfAvailable() {
diff --git a/vendor/github.com/go-resty/resty/request17.go b/vendor/gopkg.in/resty.v1/request17.go
similarity index 86%
rename from vendor/github.com/go-resty/resty/request17.go
rename to vendor/gopkg.in/resty.v1/request17.go
index c81cae715..0629a114c 100644
--- a/vendor/github.com/go-resty/resty/request17.go
+++ b/vendor/gopkg.in/resty.v1/request17.go
@@ -1,6 +1,6 @@
// +build go1.7 go1.8
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com)
+// Copyright (c) 2015-2019 Jeevanandam M (jeeva@myjeeva.com)
// 2016 Andrew Grigorev (https://github.com/ei-grad)
// All rights reserved.
// resty source code and usage is governed by a MIT style
@@ -49,7 +49,16 @@ type Request struct {
client *Client
bodyBuf *bytes.Buffer
multipartFiles []*File
- multipartFields []*multipartField
+ multipartFields []*MultipartField
+}
+
+// Context method returns the Context if its already set in request
+// otherwise it creates new one using `context.Background()`.
+func (r *Request) Context() context.Context {
+ if r.ctx == nil {
+ return context.Background()
+ }
+ return r.ctx
}
// SetContext method sets the context.Context for current Request. It allows
diff --git a/vendor/github.com/go-resty/resty/response.go b/vendor/gopkg.in/resty.v1/response.go
similarity index 98%
rename from vendor/github.com/go-resty/resty/response.go
rename to vendor/gopkg.in/resty.v1/response.go
index f54e90557..ea2a027a5 100644
--- a/vendor/github.com/go-resty/resty/response.go
+++ b/vendor/gopkg.in/resty.v1/response.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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/gopkg.in/resty.v1/resty.go b/vendor/gopkg.in/resty.v1/resty.go
new file mode 100644
index 000000000..9a32463d7
--- /dev/null
+++ b/vendor/gopkg.in/resty.v1/resty.go
@@ -0,0 +1,9 @@
+// Copyright (c) 2015-2019 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.
+
+// Package resty provides Simple HTTP and REST client library for Go.
+package resty
+
+// Version # of resty
+const Version = "1.12.0"
diff --git a/vendor/github.com/go-resty/resty/retry.go b/vendor/gopkg.in/resty.v1/retry.go
similarity index 92%
rename from vendor/github.com/go-resty/resty/retry.go
rename to vendor/gopkg.in/resty.v1/retry.go
index 7b88cb73f..4ed9b6d60 100644
--- a/vendor/github.com/go-resty/resty/retry.go
+++ b/vendor/gopkg.in/resty.v1/retry.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -102,7 +102,11 @@ func Backoff(operation func() (*Response, error), options ...Option) error {
// See the following article...
// http://www.awsarchitectureblog.com/2015/03/backoff.html
temp := math.Min(capLevel, base*math.Exp2(float64(attempt)))
- sleepDuration := time.Duration(int(temp/2) + rand.Intn(int(temp/2)))
+ ri := int(temp / 2)
+ if ri <= 0 {
+ ri = 1<<31 - 1 // max int for arch 386
+ }
+ sleepDuration := time.Duration(math.Abs(float64(ri + rand.Intn(ri))))
if sleepDuration < opts.waitTime {
sleepDuration = opts.waitTime
diff --git a/vendor/github.com/go-resty/resty/util.go b/vendor/gopkg.in/resty.v1/util.go
similarity index 85%
rename from vendor/github.com/go-resty/resty/util.go
rename to vendor/gopkg.in/resty.v1/util.go
index e72374ed8..997cd1009 100644
--- a/vendor/github.com/go-resty/resty/util.go
+++ b/vendor/gopkg.in/resty.v1/util.go
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2018 Jeevanandam M (jeeva@myjeeva.com), All rights reserved.
+// Copyright (c) 2015-2019 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.
@@ -84,6 +84,30 @@ func Unmarshalc(c *Client, ct string, b []byte, d interface{}) (err error) {
return
}
+//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+// RequestLog and ResponseLog type
+//___________________________________
+
+// RequestLog struct is used to collected information from resty request
+// instance for debug logging. It sent to request log callback before resty
+// actually logs the information.
+type RequestLog struct {
+ Header http.Header
+ Body string
+}
+
+// ResponseLog struct is used to collected information from resty response
+// instance for debug logging. It sent to response log callback before resty
+// actually logs the information.
+type ResponseLog struct {
+ Header http.Header
+ Body string
+}
+
+//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+// Package Unexported methods
+//___________________________________
+
// way to disable the HTML escape as opt-in
func jsonMarshal(c *Client, r *Request, d interface{}) ([]byte, error) {
if !r.jsonEscapeHTML {
@@ -94,10 +118,6 @@ func jsonMarshal(c *Client, r *Request, d interface{}) ([]byte, error) {
return c.JSONMarshal(d)
}
-//‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-// Package Unexported methods
-//___________________________________
-
func firstNonEmpty(v ...string) string {
for _, s := range v {
if !IsStringEmpty(s) {
@@ -125,7 +145,7 @@ func createMultipartHeader(param, fileName, contentType string) textproto.MIMEHe
return hdr
}
-func addMultipartFormField(w *multipart.Writer, mf *multipartField) error {
+func addMultipartFormField(w *multipart.Writer, mf *MultipartField) error {
partWriter, err := w.CreatePart(createMultipartHeader(mf.Param, mf.FileName, mf.ContentType))
if err != nil {
return err
@@ -209,7 +229,7 @@ func createDirectory(dir string) (err error) {
}
func canJSONMarshal(contentType string, kind reflect.Kind) bool {
- return IsJSONType(contentType) && (kind == reflect.Struct || kind == reflect.Map)
+ return IsJSONType(contentType) && (kind == reflect.Struct || kind == reflect.Map || kind == reflect.Slice)
}
func functionName(i interface{}) string {
@@ -251,3 +271,11 @@ func sortHeaderKeys(hdrs http.Header) []string {
sort.Strings(keys)
return keys
}
+
+func copyHeaders(hdrs http.Header) http.Header {
+ nh := http.Header{}
+ for k, v := range hdrs {
+ nh[k] = v
+ }
+ return nh
+}
diff --git a/vendor/gopkg.in/square/go-jose.v2/asymmetric.go b/vendor/gopkg.in/square/go-jose.v2/asymmetric.go
index 15e9d11a2..67935561b 100644
--- a/vendor/gopkg.in/square/go-jose.v2/asymmetric.go
+++ b/vendor/gopkg.in/square/go-jose.v2/asymmetric.go
@@ -104,9 +104,9 @@ func newRSASigner(sigAlg SignatureAlgorithm, privateKey *rsa.PrivateKey) (recipi
return recipientSigInfo{
sigAlg: sigAlg,
- publicKey: &JSONWebKey{
- Key: &privateKey.PublicKey,
- },
+ publicKey: staticPublicKey(&JSONWebKey{
+ Key: privateKey.Public(),
+ }),
signer: &rsaDecrypterSigner{
privateKey: privateKey,
},
@@ -123,9 +123,9 @@ func newEd25519Signer(sigAlg SignatureAlgorithm, privateKey ed25519.PrivateKey)
}
return recipientSigInfo{
sigAlg: sigAlg,
- publicKey: &JSONWebKey{
+ publicKey: staticPublicKey(&JSONWebKey{
Key: privateKey.Public(),
- },
+ }),
signer: &edDecrypterSigner{
privateKey: privateKey,
},
@@ -168,9 +168,9 @@ func newECDSASigner(sigAlg SignatureAlgorithm, privateKey *ecdsa.PrivateKey) (re
return recipientSigInfo{
sigAlg: sigAlg,
- publicKey: &JSONWebKey{
- Key: &privateKey.PublicKey,
- },
+ publicKey: staticPublicKey(&JSONWebKey{
+ Key: privateKey.Public(),
+ }),
signer: &ecDecrypterSigner{
privateKey: privateKey,
},
@@ -195,11 +195,11 @@ func (ctx rsaEncrypterVerifier) encryptKey(cek []byte, alg KeyAlgorithm) (recipi
func (ctx rsaEncrypterVerifier) encrypt(cek []byte, alg KeyAlgorithm) ([]byte, error) {
switch alg {
case RSA1_5:
- return rsa.EncryptPKCS1v15(randReader, ctx.publicKey, cek)
+ return rsa.EncryptPKCS1v15(RandReader, ctx.publicKey, cek)
case RSA_OAEP:
- return rsa.EncryptOAEP(sha1.New(), randReader, ctx.publicKey, cek, []byte{})
+ return rsa.EncryptOAEP(sha1.New(), RandReader, ctx.publicKey, cek, []byte{})
case RSA_OAEP_256:
- return rsa.EncryptOAEP(sha256.New(), randReader, ctx.publicKey, cek, []byte{})
+ return rsa.EncryptOAEP(sha256.New(), RandReader, ctx.publicKey, cek, []byte{})
}
return nil, ErrUnsupportedAlgorithm
@@ -285,9 +285,9 @@ func (ctx rsaDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm
switch alg {
case RS256, RS384, RS512:
- out, err = rsa.SignPKCS1v15(randReader, ctx.privateKey, hash, hashed)
+ out, err = rsa.SignPKCS1v15(RandReader, ctx.privateKey, hash, hashed)
case PS256, PS384, PS512:
- out, err = rsa.SignPSS(randReader, ctx.privateKey, hash, hashed, &rsa.PSSOptions{
+ out, err = rsa.SignPSS(RandReader, ctx.privateKey, hash, hashed, &rsa.PSSOptions{
SaltLength: rsa.PSSSaltLengthAuto,
})
}
@@ -388,7 +388,7 @@ func (ctx ecKeyGenerator) keySize() int {
// Get a content encryption key for ECDH-ES
func (ctx ecKeyGenerator) genKey() ([]byte, rawHeader, error) {
- priv, err := ecdsa.GenerateKey(ctx.publicKey.Curve, randReader)
+ priv, err := ecdsa.GenerateKey(ctx.publicKey.Curve, RandReader)
if err != nil {
return nil, rawHeader{}, err
}
@@ -466,12 +466,13 @@ func (ctx ecDecrypterSigner) decryptKey(headers rawHeader, recipient *recipientI
return josecipher.KeyUnwrap(block, recipient.encryptedKey)
}
+
func (ctx edDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm) (Signature, error) {
if alg != EdDSA {
return Signature{}, ErrUnsupportedAlgorithm
}
- sig, err := ctx.privateKey.Sign(randReader, payload, crypto.Hash(0))
+ sig, err := ctx.privateKey.Sign(RandReader, payload, crypto.Hash(0))
if err != nil {
return Signature{}, err
}
@@ -521,7 +522,7 @@ func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm)
_, _ = hasher.Write(payload)
hashed := hasher.Sum(nil)
- r, s, err := ecdsa.Sign(randReader, ctx.privateKey, hashed)
+ r, s, err := ecdsa.Sign(RandReader, ctx.privateKey, hashed)
if err != nil {
return Signature{}, err
}
@@ -531,7 +532,7 @@ func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm)
keyBytes++
}
- // We serialize the outpus (r and s) into big-endian byte arrays and pad
+ // We serialize the outputs (r and s) into big-endian byte arrays and pad
// them with zeros on the left to make sure the sizes work out. Both arrays
// must be keyBytes long, and the output must be 2*keyBytes long.
rBytes := r.Bytes()
diff --git a/vendor/gopkg.in/square/go-jose.v2/crypter.go b/vendor/gopkg.in/square/go-jose.v2/crypter.go
index 0681c8119..c45c71206 100644
--- a/vendor/gopkg.in/square/go-jose.v2/crypter.go
+++ b/vendor/gopkg.in/square/go-jose.v2/crypter.go
@@ -104,10 +104,18 @@ func (eo *EncrypterOptions) WithType(typ ContentType) *EncrypterOptions {
}
// Recipient represents an algorithm/key to encrypt messages to.
+//
+// PBES2Count and PBES2Salt correspond with the "p2c" and "p2s" headers used
+// on the password-based encryption algorithms PBES2-HS256+A128KW,
+// PBES2-HS384+A192KW, and PBES2-HS512+A256KW. If they are not provided a safe
+// default of 100000 will be used for the count and a 128-bit random salt will
+// be generated.
type Recipient struct {
- Algorithm KeyAlgorithm
- Key interface{}
- KeyID string
+ Algorithm KeyAlgorithm
+ Key interface{}
+ KeyID string
+ PBES2Count int
+ PBES2Salt []byte
}
// NewEncrypter creates an appropriate encrypter based on the key type
@@ -143,6 +151,9 @@ func NewEncrypter(enc ContentEncryption, rcpt Recipient, opts *EncrypterOptions)
if reflect.TypeOf(rawKey) != reflect.TypeOf([]byte{}) {
return nil, ErrUnsupportedKeyType
}
+ if encrypter.cipher.keySize() != len(rawKey.([]byte)) {
+ return nil, ErrInvalidKeySize
+ }
encrypter.keyGenerator = staticKeyGenerator{
key: rawKey.([]byte),
}
@@ -228,6 +239,14 @@ func (ctx *genericEncrypter) addRecipient(recipient Recipient) (err error) {
recipientInfo.keyID = recipient.KeyID
}
+ switch recipient.Algorithm {
+ case PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW:
+ if sr, ok := recipientInfo.keyEncrypter.(*symmetricKeyCipher); ok {
+ sr.p2c = recipient.PBES2Count
+ sr.p2s = recipient.PBES2Salt
+ }
+ }
+
if err == nil {
ctx.recipients = append(ctx.recipients, recipientInfo)
}
@@ -242,6 +261,8 @@ func makeJWERecipient(alg KeyAlgorithm, encryptionKey interface{}) (recipientKey
return newECDHRecipient(alg, encryptionKey)
case []byte:
return newSymmetricRecipient(alg, encryptionKey)
+ case string:
+ return newSymmetricRecipient(alg, []byte(encryptionKey))
case *JSONWebKey:
recipient, err := makeJWERecipient(alg, encryptionKey.Key)
recipient.keyID = encryptionKey.KeyID
@@ -266,6 +287,10 @@ func newDecrypter(decryptionKey interface{}) (keyDecrypter, error) {
return &symmetricKeyCipher{
key: decryptionKey,
}, nil
+ case string:
+ return &symmetricKeyCipher{
+ key: []byte(decryptionKey),
+ }, nil
case JSONWebKey:
return newDecrypter(decryptionKey.Key)
case *JSONWebKey:
diff --git a/vendor/gopkg.in/square/go-jose.v2/encoding.go b/vendor/gopkg.in/square/go-jose.v2/encoding.go
index 9f37ef465..b9687c647 100644
--- a/vendor/gopkg.in/square/go-jose.v2/encoding.go
+++ b/vendor/gopkg.in/square/go-jose.v2/encoding.go
@@ -21,10 +21,11 @@ import (
"compress/flate"
"encoding/base64"
"encoding/binary"
- "encoding/json"
"io"
"math/big"
"regexp"
+
+ "gopkg.in/square/go-jose.v2/json"
)
var stripWhitespaceRegex = regexp.MustCompile("\\s")
diff --git a/vendor/gopkg.in/square/go-jose.v2/jwe.go b/vendor/gopkg.in/square/go-jose.v2/jwe.go
index f2176cfb0..b5a6dcdf4 100644
--- a/vendor/gopkg.in/square/go-jose.v2/jwe.go
+++ b/vendor/gopkg.in/square/go-jose.v2/jwe.go
@@ -18,9 +18,10 @@ package jose
import (
"encoding/base64"
- "encoding/json"
"fmt"
"strings"
+
+ "gopkg.in/square/go-jose.v2/json"
)
// rawJSONWebEncryption represents a raw JWE JSON object. Used for parsing/serializing.
@@ -85,10 +86,12 @@ func (obj JSONWebEncryption) mergedHeaders(recipient *recipientInfo) rawHeader {
func (obj JSONWebEncryption) computeAuthData() []byte {
var protected string
- if obj.original != nil {
+ if obj.original != nil && obj.original.Protected != nil {
protected = obj.original.Protected.base64()
- } else {
+ } else if obj.protected != nil {
protected = base64.RawURLEncoding.EncodeToString(mustSerializeJSON((obj.protected)))
+ } else {
+ protected = ""
}
output := []byte(protected)
diff --git a/vendor/gopkg.in/square/go-jose.v2/jwk.go b/vendor/gopkg.in/square/go-jose.v2/jwk.go
index d81bc4075..6cb8adb84 100644
--- a/vendor/gopkg.in/square/go-jose.v2/jwk.go
+++ b/vendor/gopkg.in/square/go-jose.v2/jwk.go
@@ -148,17 +148,10 @@ func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error) {
if err == nil {
*k = JSONWebKey{Key: key, KeyID: raw.Kid, Algorithm: raw.Alg, Use: raw.Use}
- }
- k.Certificates = make([]*x509.Certificate, len(raw.X5c))
- for i, cert := range raw.X5c {
- raw, err := base64.StdEncoding.DecodeString(cert)
+ k.Certificates, err = parseCertificateChain(raw.X5c)
if err != nil {
- return err
- }
- k.Certificates[i], err = x509.ParseCertificate(raw)
- if err != nil {
- return err
+ return fmt.Errorf("failed to unmarshal x5c field: %s", err)
}
}
@@ -196,6 +189,10 @@ func ecThumbprintInput(curve elliptic.Curve, x, y *big.Int) (string, error) {
return "", err
}
+ if len(x.Bytes()) > coordLength || len(y.Bytes()) > coordLength {
+ return "", errors.New("square/go-jose: invalid elliptic key (too large)")
+ }
+
return fmt.Sprintf(ecThumbprintTemplate, crv,
newFixedSizeBuffer(x.Bytes(), coordLength).base64(),
newFixedSizeBuffer(y.Bytes(), coordLength).base64()), nil
@@ -209,6 +206,9 @@ func rsaThumbprintInput(n *big.Int, e int) (string, error) {
func edThumbprintInput(ed ed25519.PublicKey) (string, error) {
crv := "Ed25519"
+ if len(ed) > 32 {
+ return "", errors.New("square/go-jose: invalid elliptic key (too large)")
+ }
return fmt.Sprintf(edThumbprintTemplate, crv,
newFixedSizeBuffer(ed, 32).base64()), nil
}
@@ -230,7 +230,7 @@ func (k *JSONWebKey) Thumbprint(hash crypto.Hash) ([]byte, error) {
case *rsa.PrivateKey:
input, err = rsaThumbprintInput(key.N, key.E)
case ed25519.PrivateKey:
- input, err = edThumbprintInput(ed25519.PublicKey(key[0:32]))
+ input, err = edThumbprintInput(ed25519.PublicKey(key[32:]))
default:
return nil, fmt.Errorf("square/go-jose: unknown key type '%s'", reflect.TypeOf(key))
}
@@ -353,6 +353,17 @@ func (key rawJSONWebKey) ecPublicKey() (*ecdsa.PublicKey, error) {
return nil, errors.New("square/go-jose: invalid EC key, missing x/y values")
}
+ // The length of this octet string MUST be the full size of a coordinate for
+ // the curve specified in the "crv" parameter.
+ // https://tools.ietf.org/html/rfc7518#section-6.2.1.2
+ if curveSize(curve) != len(key.X.data) {
+ return nil, fmt.Errorf("square/go-jose: invalid EC private key, wrong length for x")
+ }
+
+ if curveSize(curve) != len(key.Y.data) {
+ return nil, fmt.Errorf("square/go-jose: invalid EC private key, wrong length for y")
+ }
+
x := key.X.bigInt()
y := key.Y.bigInt()
@@ -410,8 +421,8 @@ func (key rawJSONWebKey) edPrivateKey() (ed25519.PrivateKey, error) {
}
privateKey := make([]byte, ed25519.PrivateKeySize)
- copy(privateKey[0:32], key.X.bytes())
- copy(privateKey[32:], key.D.bytes())
+ copy(privateKey[0:32], key.D.bytes())
+ copy(privateKey[32:], key.X.bytes())
rv := ed25519.PrivateKey(privateKey)
return rv, nil
}
@@ -472,9 +483,9 @@ func (key rawJSONWebKey) rsaPrivateKey() (*rsa.PrivateKey, error) {
}
func fromEdPrivateKey(ed ed25519.PrivateKey) (*rawJSONWebKey, error) {
- raw := fromEdPublicKey(ed25519.PublicKey(ed[0:32]))
+ raw := fromEdPublicKey(ed25519.PublicKey(ed[32:]))
- raw.D = newBuffer(ed[32:])
+ raw.D = newBuffer(ed[0:32])
return raw, nil
}
@@ -489,6 +500,16 @@ func fromRsaPrivateKey(rsa *rsa.PrivateKey) (*rawJSONWebKey, error) {
raw.P = newBuffer(rsa.Primes[0].Bytes())
raw.Q = newBuffer(rsa.Primes[1].Bytes())
+ if rsa.Precomputed.Dp != nil {
+ raw.Dp = newBuffer(rsa.Precomputed.Dp.Bytes())
+ }
+ if rsa.Precomputed.Dq != nil {
+ raw.Dq = newBuffer(rsa.Precomputed.Dq.Bytes())
+ }
+ if rsa.Precomputed.Qinv != nil {
+ raw.Qi = newBuffer(rsa.Precomputed.Qinv.Bytes())
+ }
+
return raw, nil
}
@@ -509,6 +530,22 @@ func (key rawJSONWebKey) ecPrivateKey() (*ecdsa.PrivateKey, error) {
return nil, fmt.Errorf("square/go-jose: invalid EC private key, missing x/y/d values")
}
+ // The length of this octet string MUST be the full size of a coordinate for
+ // the curve specified in the "crv" parameter.
+ // https://tools.ietf.org/html/rfc7518#section-6.2.1.2
+ if curveSize(curve) != len(key.X.data) {
+ return nil, fmt.Errorf("square/go-jose: invalid EC private key, wrong length for x")
+ }
+
+ if curveSize(curve) != len(key.Y.data) {
+ return nil, fmt.Errorf("square/go-jose: invalid EC private key, wrong length for y")
+ }
+
+ // https://tools.ietf.org/html/rfc7518#section-6.2.2.1
+ if dSize(curve) != len(key.D.data) {
+ return nil, fmt.Errorf("square/go-jose: invalid EC private key, wrong length for d")
+ }
+
x := key.X.bigInt()
y := key.Y.bigInt()
@@ -536,11 +573,26 @@ func fromEcPrivateKey(ec *ecdsa.PrivateKey) (*rawJSONWebKey, error) {
return nil, fmt.Errorf("square/go-jose: invalid EC private key")
}
- raw.D = newBuffer(ec.D.Bytes())
+ raw.D = newFixedSizeBuffer(ec.D.Bytes(), dSize(ec.PublicKey.Curve))
return raw, nil
}
+// dSize returns the size in octets for the "d" member of an elliptic curve
+// private key.
+// The length of this octet string MUST be ceiling(log-base-2(n)/8)
+// octets (where n is the order of the curve).
+// https://tools.ietf.org/html/rfc7518#section-6.2.2.1
+func dSize(curve elliptic.Curve) int {
+ order := curve.Params().P
+ bitLen := order.BitLen()
+ size := bitLen / 8
+ if bitLen%8 != 0 {
+ size = size + 1
+ }
+ return size
+}
+
func fromSymmetricKey(key []byte) (*rawJSONWebKey, error) {
return &rawJSONWebKey{
Kty: "oct",
diff --git a/vendor/gopkg.in/square/go-jose.v2/jws.go b/vendor/gopkg.in/square/go-jose.v2/jws.go
index d7d3d6007..8b59b6ab2 100644
--- a/vendor/gopkg.in/square/go-jose.v2/jws.go
+++ b/vendor/gopkg.in/square/go-jose.v2/jws.go
@@ -93,7 +93,7 @@ func (sig Signature) mergedHeaders() rawHeader {
}
// Compute data to be signed
-func (obj JSONWebSignature) computeAuthData(signature *Signature) []byte {
+func (obj JSONWebSignature) computeAuthData(payload []byte, signature *Signature) []byte {
var serializedProtected string
if signature.original != nil && signature.original.Protected != nil {
@@ -106,7 +106,7 @@ func (obj JSONWebSignature) computeAuthData(signature *Signature) []byte {
return []byte(fmt.Sprintf("%s.%s",
serializedProtected,
- base64.RawURLEncoding.EncodeToString(obj.payload)))
+ base64.RawURLEncoding.EncodeToString(payload)))
}
// parseSignedFull parses a message in full format.
diff --git a/vendor/gopkg.in/square/go-jose.v2/opaque.go b/vendor/gopkg.in/square/go-jose.v2/opaque.go
new file mode 100644
index 000000000..4a8bd8f32
--- /dev/null
+++ b/vendor/gopkg.in/square/go-jose.v2/opaque.go
@@ -0,0 +1,83 @@
+/*-
+ * Copyright 2018 Square Inc.
+ *
+ * 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 jose
+
+// OpaqueSigner is an interface that supports signing payloads with opaque
+// private key(s). Private key operations preformed by implementors may, for
+// example, occur in a hardware module. An OpaqueSigner may rotate signing keys
+// transparently to the user of this interface.
+type OpaqueSigner interface {
+ // Public returns the public key of the current signing key.
+ Public() *JSONWebKey
+ // Algs returns a list of supported signing algorithms.
+ Algs() []SignatureAlgorithm
+ // SignPayload signs a payload with the current signing key using the given
+ // algorithm.
+ SignPayload(payload []byte, alg SignatureAlgorithm) ([]byte, error)
+}
+
+type opaqueSigner struct {
+ signer OpaqueSigner
+}
+
+func newOpaqueSigner(alg SignatureAlgorithm, signer OpaqueSigner) (recipientSigInfo, error) {
+ var algSupported bool
+ for _, salg := range signer.Algs() {
+ if alg == salg {
+ algSupported = true
+ break
+ }
+ }
+ if !algSupported {
+ return recipientSigInfo{}, ErrUnsupportedAlgorithm
+ }
+
+ return recipientSigInfo{
+ sigAlg: alg,
+ publicKey: signer.Public,
+ signer: &opaqueSigner{
+ signer: signer,
+ },
+ }, nil
+}
+
+func (o *opaqueSigner) signPayload(payload []byte, alg SignatureAlgorithm) (Signature, error) {
+ out, err := o.signer.SignPayload(payload, alg)
+ if err != nil {
+ return Signature{}, err
+ }
+
+ return Signature{
+ Signature: out,
+ protected: &rawHeader{},
+ }, nil
+}
+
+// OpaqueVerifier is an interface that supports verifying payloads with opaque
+// public key(s). An OpaqueSigner may rotate signing keys transparently to the
+// user of this interface.
+type OpaqueVerifier interface {
+ VerifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error
+}
+
+type opaqueVerifier struct {
+ verifier OpaqueVerifier
+}
+
+func (o *opaqueVerifier) verifyPayload(payload []byte, signature []byte, alg SignatureAlgorithm) error {
+ return o.verifier.VerifyPayload(payload, signature, alg)
+}
diff --git a/vendor/gopkg.in/square/go-jose.v2/shared.go b/vendor/gopkg.in/square/go-jose.v2/shared.go
index 4c19dc382..b0a6255ec 100644
--- a/vendor/gopkg.in/square/go-jose.v2/shared.go
+++ b/vendor/gopkg.in/square/go-jose.v2/shared.go
@@ -18,6 +18,8 @@ package jose
import (
"crypto/elliptic"
+ "crypto/x509"
+ "encoding/base64"
"errors"
"fmt"
@@ -56,6 +58,11 @@ var (
// an RSA private key with more than two primes.
ErrUnsupportedKeyType = errors.New("square/go-jose: unsupported key type/format")
+ // ErrInvalidKeySize indicates that the given key is not the correct size
+ // for the selected algorithm. This can occur, for example, when trying to
+ // encrypt with AES-256 but passing only a 128-bit key as input.
+ ErrInvalidKeySize = errors.New("square/go-jose: invalid key size for algorithm")
+
// ErrNotSupported serialization of object is not supported. This occurs when
// trying to compact-serialize an object which can't be represented in
// compact form.
@@ -141,10 +148,15 @@ const (
headerEPK = "epk" // *JSONWebKey
headerIV = "iv" // *byteBuffer
headerTag = "tag" // *byteBuffer
+ headerX5c = "x5c" // []*x509.Certificate
headerJWK = "jwk" // *JSONWebKey
headerKeyID = "kid" // string
headerNonce = "nonce" // string
+
+ headerP2C = "p2c" // *byteBuffer (int)
+ headerP2S = "p2s" // *byteBuffer ([]byte)
+
)
// rawHeader represents the JOSE header for JWE/JWS objects (used for parsing).
@@ -162,11 +174,34 @@ type Header struct {
Algorithm string
Nonce string
- // Any headers not recognised above get unmarshaled from JSON in a generic
- // manner and placed in this map.
+ // Unverified certificate chain parsed from x5c header.
+ certificates []*x509.Certificate
+
+ // Any headers not recognised above get unmarshaled
+ // from JSON in a generic manner and placed in this map.
ExtraHeaders map[HeaderKey]interface{}
}
+// Certificates verifies & returns the certificate chain present
+// in the x5c header field of a message, if one was present. Returns
+// an error if there was no x5c header present or the chain could
+// not be validated with the given verify options.
+func (h Header) Certificates(opts x509.VerifyOptions) ([][]*x509.Certificate, error) {
+ if len(h.certificates) == 0 {
+ return nil, errors.New("square/go-jose: no x5c header present in message")
+ }
+
+ leaf := h.certificates[0]
+ if opts.Intermediates == nil {
+ opts.Intermediates = x509.NewCertPool()
+ for _, intermediate := range h.certificates[1:] {
+ opts.Intermediates.AddCert(intermediate)
+ }
+ }
+
+ return leaf.Verify(opts)
+}
+
func (parsed rawHeader) set(k HeaderKey, v interface{}) error {
b, err := json.Marshal(v)
if err != nil {
@@ -180,7 +215,7 @@ func (parsed rawHeader) set(k HeaderKey, v interface{}) error {
// getString gets a string from the raw JSON, defaulting to "".
func (parsed rawHeader) getString(k HeaderKey) string {
v, ok := parsed[k]
- if !ok {
+ if !ok || v == nil {
return ""
}
var s string
@@ -294,6 +329,26 @@ func (parsed rawHeader) getCritical() ([]string, error) {
return q, nil
}
+// getS2C extracts parsed "p2c" from the raw JSON.
+func (parsed rawHeader) getP2C() (int, error) {
+ v := parsed[headerP2C]
+ if v == nil {
+ return 0, nil
+ }
+
+ var p2c int
+ err := json.Unmarshal(*v, &p2c)
+ if err != nil {
+ return 0, err
+ }
+ return p2c, nil
+}
+
+// getS2S extracts parsed "p2s" from the raw JSON.
+func (parsed rawHeader) getP2S() (*byteBuffer, error) {
+ return parsed.getByteBuffer(headerP2S)
+}
+
// sanitized produces a cleaned-up header object from the raw JSON.
func (parsed rawHeader) sanitized() (h Header, err error) {
for k, v := range parsed {
@@ -333,6 +388,18 @@ func (parsed rawHeader) sanitized() (h Header, err error) {
return
}
h.Nonce = s
+ case headerX5c:
+ c := []string{}
+ err = json.Unmarshal(*v, &c)
+ if err != nil {
+ err = fmt.Errorf("failed to unmarshal x5c header: %v: %#v", err, string(*v))
+ return
+ }
+ h.certificates, err = parseCertificateChain(c)
+ if err != nil {
+ err = fmt.Errorf("failed to unmarshal x5c header: %v: %#v", err, string(*v))
+ return
+ }
default:
if h.ExtraHeaders == nil {
h.ExtraHeaders = map[HeaderKey]interface{}{}
@@ -349,6 +416,21 @@ func (parsed rawHeader) sanitized() (h Header, err error) {
return
}
+func parseCertificateChain(chain []string) ([]*x509.Certificate, error) {
+ out := make([]*x509.Certificate, len(chain))
+ for i, cert := range chain {
+ raw, err := base64.StdEncoding.DecodeString(cert)
+ if err != nil {
+ return nil, err
+ }
+ out[i], err = x509.ParseCertificate(raw)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return out, nil
+}
+
func (dst rawHeader) isSet(k HeaderKey) bool {
dvr := dst[k]
if dvr == nil {
diff --git a/vendor/gopkg.in/square/go-jose.v2/signing.go b/vendor/gopkg.in/square/go-jose.v2/signing.go
index 13e956d66..be6cf0481 100644
--- a/vendor/gopkg.in/square/go-jose.v2/signing.go
+++ b/vendor/gopkg.in/square/go-jose.v2/signing.go
@@ -94,10 +94,16 @@ type genericSigner struct {
type recipientSigInfo struct {
sigAlg SignatureAlgorithm
- publicKey *JSONWebKey
+ publicKey func() *JSONWebKey
signer payloadSigner
}
+func staticPublicKey(jwk *JSONWebKey) func() *JSONWebKey {
+ return func() *JSONWebKey {
+ return jwk
+ }
+}
+
// NewSigner creates an appropriate signer based on the key type
func NewSigner(sig SigningKey, opts *SignerOptions) (Signer, error) {
return NewMultiSigner([]SigningKey{sig}, opts)
@@ -146,9 +152,11 @@ func newVerifier(verificationKey interface{}) (payloadVerifier, error) {
return newVerifier(verificationKey.Key)
case *JSONWebKey:
return newVerifier(verificationKey.Key)
- default:
- return nil, ErrUnsupportedKeyType
}
+ if ov, ok := verificationKey.(OpaqueVerifier); ok {
+ return &opaqueVerifier{verifier: ov}, nil
+ }
+ return nil, ErrUnsupportedKeyType
}
func (ctx *genericSigner) addRecipient(alg SignatureAlgorithm, signingKey interface{}) error {
@@ -175,9 +183,11 @@ func makeJWSRecipient(alg SignatureAlgorithm, signingKey interface{}) (recipient
return newJWKSigner(alg, signingKey)
case *JSONWebKey:
return newJWKSigner(alg, *signingKey)
- default:
- return recipientSigInfo{}, ErrUnsupportedKeyType
}
+ if signer, ok := signingKey.(OpaqueSigner); ok {
+ return newOpaqueSigner(alg, signer)
+ }
+ return recipientSigInfo{}, ErrUnsupportedKeyType
}
func newJWKSigner(alg SignatureAlgorithm, signingKey JSONWebKey) (recipientSigInfo, error) {
@@ -185,16 +195,16 @@ func newJWKSigner(alg SignatureAlgorithm, signingKey JSONWebKey) (recipientSigIn
if err != nil {
return recipientSigInfo{}, err
}
- if recipient.publicKey != nil {
+ if recipient.publicKey != nil && recipient.publicKey() != nil {
// recipient.publicKey is a JWK synthesized for embedding when recipientSigInfo
// was created for the inner key (such as a RSA or ECDSA public key). It contains
// the pub key for embedding, but doesn't have extra params like key id.
publicKey := signingKey
- publicKey.Key = recipient.publicKey.Key
- recipient.publicKey = &publicKey
+ publicKey.Key = recipient.publicKey().Key
+ recipient.publicKey = staticPublicKey(&publicKey)
// This should be impossible, but let's check anyway.
- if !recipient.publicKey.IsPublic() {
+ if !recipient.publicKey().IsPublic() {
return recipientSigInfo{}, errors.New("square/go-jose: public key was unexpectedly not public")
}
}
@@ -211,7 +221,7 @@ func (ctx *genericSigner) Sign(payload []byte) (*JSONWebSignature, error) {
headerAlgorithm: string(recipient.sigAlg),
}
- if recipient.publicKey != nil {
+ if recipient.publicKey != nil && recipient.publicKey() != nil {
// We want to embed the JWK or set the kid header, but not both. Having a protected
// header that contains an embedded JWK while also simultaneously containing the kid
// header is confusing, and at least in ACME the two are considered to be mutually
@@ -221,9 +231,9 @@ func (ctx *genericSigner) Sign(payload []byte) (*JSONWebSignature, error) {
//
// See https://github.com/square/go-jose/issues/157 for more context.
if ctx.embedJWK {
- protected[headerJWK] = recipient.publicKey
+ protected[headerJWK] = recipient.publicKey()
} else {
- protected[headerKeyID] = recipient.publicKey.KeyID
+ protected[headerKeyID] = recipient.publicKey().KeyID
}
}
@@ -280,34 +290,53 @@ func (ctx *genericSigner) Options() SignerOptions {
// payload header. You cannot assume that the key received in a payload is
// trusted.
func (obj JSONWebSignature) Verify(verificationKey interface{}) ([]byte, error) {
- verifier, err := newVerifier(verificationKey)
+ err := obj.DetachedVerify(obj.payload, verificationKey)
if err != nil {
return nil, err
}
+ return obj.payload, nil
+}
+
+// UnsafePayloadWithoutVerification returns the payload without
+// verifying it. The content returned from this function cannot be
+// trusted.
+func (obj JSONWebSignature) UnsafePayloadWithoutVerification() []byte {
+ return obj.payload
+}
+
+// DetachedVerify validates a detached signature on the given payload. In
+// most cases, you will probably want to use Verify instead. DetachedVerify
+// is only useful if you have a payload and signature that are separated from
+// each other.
+func (obj JSONWebSignature) DetachedVerify(payload []byte, verificationKey interface{}) error {
+ verifier, err := newVerifier(verificationKey)
+ if err != nil {
+ return err
+ }
if len(obj.Signatures) > 1 {
- return nil, errors.New("square/go-jose: too many signatures in payload; expecting only one")
+ return errors.New("square/go-jose: too many signatures in payload; expecting only one")
}
signature := obj.Signatures[0]
headers := signature.mergedHeaders()
critical, err := headers.getCritical()
if err != nil {
- return nil, err
+ return err
}
if len(critical) > 0 {
// Unsupported crit header
- return nil, ErrCryptoFailure
+ return ErrCryptoFailure
}
- input := obj.computeAuthData(&signature)
+ input := obj.computeAuthData(payload, &signature)
alg := headers.getSignatureAlgorithm()
err = verifier.verifyPayload(input, signature.Signature, alg)
if err == nil {
- return obj.payload, nil
+ return nil
}
- return nil, ErrCryptoFailure
+ return ErrCryptoFailure
}
// VerifyMulti validates (one of the multiple) signatures on the object and
@@ -315,10 +344,27 @@ func (obj JSONWebSignature) Verify(verificationKey interface{}) ([]byte, error)
// object and the payload. We return the signature and index to guarantee that
// callers are getting the verified value.
func (obj JSONWebSignature) VerifyMulti(verificationKey interface{}) (int, Signature, []byte, error) {
- verifier, err := newVerifier(verificationKey)
+ idx, sig, err := obj.DetachedVerifyMulti(obj.payload, verificationKey)
if err != nil {
return -1, Signature{}, nil, err
}
+ return idx, sig, obj.payload, nil
+}
+
+// DetachedVerifyMulti validates a detached signature on the given payload with
+// a signature/object that has potentially multiple signers. This returns the index
+// of the signature that was verified, along with the signature object. We return
+// the signature and index to guarantee that callers are getting the verified value.
+//
+// In most cases, you will probably want to use Verify or VerifyMulti instead.
+// DetachedVerifyMulti is only useful if you have a payload and signature that are
+// separated from each other, and the signature can have multiple signers at the
+// same time.
+func (obj JSONWebSignature) DetachedVerifyMulti(payload []byte, verificationKey interface{}) (int, Signature, error) {
+ verifier, err := newVerifier(verificationKey)
+ if err != nil {
+ return -1, Signature{}, err
+ }
for i, signature := range obj.Signatures {
headers := signature.mergedHeaders()
@@ -331,13 +377,13 @@ func (obj JSONWebSignature) VerifyMulti(verificationKey interface{}) (int, Signa
continue
}
- input := obj.computeAuthData(&signature)
+ input := obj.computeAuthData(payload, &signature)
alg := headers.getSignatureAlgorithm()
err = verifier.verifyPayload(input, signature.Signature, alg)
if err == nil {
- return i, signature, obj.payload, nil
+ return i, signature, nil
}
}
- return -1, Signature{}, nil, ErrCryptoFailure
+ return -1, Signature{}, ErrCryptoFailure
}
diff --git a/vendor/gopkg.in/square/go-jose.v2/symmetric.go b/vendor/gopkg.in/square/go-jose.v2/symmetric.go
index 5be00f925..264a0fe37 100644
--- a/vendor/gopkg.in/square/go-jose.v2/symmetric.go
+++ b/vendor/gopkg.in/square/go-jose.v2/symmetric.go
@@ -17,6 +17,7 @@
package jose
import (
+ "bytes"
"crypto/aes"
"crypto/cipher"
"crypto/hmac"
@@ -29,15 +30,30 @@ import (
"hash"
"io"
+ "golang.org/x/crypto/pbkdf2"
"gopkg.in/square/go-jose.v2/cipher"
)
// Random reader (stubbed out in tests)
-var randReader = rand.Reader
+var RandReader = rand.Reader
+
+const (
+ // RFC7518 recommends a minimum of 1,000 iterations:
+ // https://tools.ietf.org/html/rfc7518#section-4.8.1.2
+ // NIST recommends a minimum of 10,000:
+ // https://pages.nist.gov/800-63-3/sp800-63b.html
+ // 1Password uses 100,000:
+ // https://support.1password.com/pbkdf2/
+ defaultP2C = 100000
+ // Default salt size: 128 bits
+ defaultP2SSize = 16
+)
// Dummy key cipher for shared symmetric key mode
type symmetricKeyCipher struct {
key []byte // Pre-shared content-encryption key
+ p2c int // PBES2 Count
+ p2s []byte // PBES2 Salt Input
}
// Signer/verifier for MAC modes
@@ -87,7 +103,7 @@ func newAESGCM(keySize int) contentCipher {
func newAESCBC(keySize int) contentCipher {
return &aeadContentCipher{
keyBytes: keySize * 2,
- authtagBytes: 16,
+ authtagBytes: keySize,
getAead: func(key []byte) (cipher.AEAD, error) {
return josecipher.NewCBCHMAC(key, aes.NewCipher)
},
@@ -114,10 +130,37 @@ func getContentCipher(alg ContentEncryption) contentCipher {
}
}
+// getPbkdf2Params returns the key length and hash function used in
+// pbkdf2.Key.
+func getPbkdf2Params(alg KeyAlgorithm) (int, func() hash.Hash) {
+ switch alg {
+ case PBES2_HS256_A128KW:
+ return 16, sha256.New
+ case PBES2_HS384_A192KW:
+ return 24, sha512.New384
+ case PBES2_HS512_A256KW:
+ return 32, sha512.New
+ default:
+ panic("invalid algorithm")
+ }
+}
+
+// getRandomSalt generates a new salt of the given size.
+func getRandomSalt(size int) ([]byte, error) {
+ salt := make([]byte, size)
+ _, err := io.ReadFull(RandReader, salt)
+ if err != nil {
+ return nil, err
+ }
+
+ return salt, nil
+}
+
// newSymmetricRecipient creates a JWE encrypter based on AES-GCM key wrap.
func newSymmetricRecipient(keyAlg KeyAlgorithm, key []byte) (recipientKeyInfo, error) {
switch keyAlg {
case DIRECT, A128GCMKW, A192GCMKW, A256GCMKW, A128KW, A192KW, A256KW:
+ case PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW:
default:
return recipientKeyInfo{}, ErrUnsupportedAlgorithm
}
@@ -150,7 +193,7 @@ func newSymmetricSigner(sigAlg SignatureAlgorithm, key []byte) (recipientSigInfo
// Generate a random key for the given content cipher
func (ctx randomKeyGenerator) genKey() ([]byte, rawHeader, error) {
key := make([]byte, ctx.size)
- _, err := io.ReadFull(randReader, key)
+ _, err := io.ReadFull(RandReader, key)
if err != nil {
return nil, rawHeader{}, err
}
@@ -190,7 +233,7 @@ func (ctx aeadContentCipher) encrypt(key, aad, pt []byte) (*aeadParts, error) {
// Initialize a new nonce
iv := make([]byte, aead.NonceSize())
- _, err = io.ReadFull(randReader, iv)
+ _, err = io.ReadFull(RandReader, iv)
if err != nil {
return nil, err
}
@@ -212,6 +255,10 @@ func (ctx aeadContentCipher) decrypt(key, aad []byte, parts *aeadParts) ([]byte,
return nil, err
}
+ if len(parts.iv) != aead.NonceSize() || len(parts.tag) < ctx.authtagBytes {
+ return nil, ErrCryptoFailure
+ }
+
return aead.Open(nil, parts.iv, append(parts.ciphertext, parts.tag...), aad)
}
@@ -253,6 +300,45 @@ func (ctx *symmetricKeyCipher) encryptKey(cek []byte, alg KeyAlgorithm) (recipie
encryptedKey: jek,
header: &rawHeader{},
}, nil
+ case PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW:
+ if len(ctx.p2s) == 0 {
+ salt, err := getRandomSalt(defaultP2SSize)
+ if err != nil {
+ return recipientInfo{}, err
+ }
+ ctx.p2s = salt
+ }
+
+ if ctx.p2c <= 0 {
+ ctx.p2c = defaultP2C
+ }
+
+ // salt is UTF8(Alg) || 0x00 || Salt Input
+ salt := bytes.Join([][]byte{[]byte(alg), ctx.p2s}, []byte{0x00})
+
+ // derive key
+ keyLen, h := getPbkdf2Params(alg)
+ key := pbkdf2.Key(ctx.key, salt, ctx.p2c, keyLen, h)
+
+ // use AES cipher with derived key
+ block, err := aes.NewCipher(key)
+ if err != nil {
+ return recipientInfo{}, err
+ }
+
+ jek, err := josecipher.KeyWrap(block, cek)
+ if err != nil {
+ return recipientInfo{}, err
+ }
+
+ header := &rawHeader{}
+ header.set(headerP2C, ctx.p2c)
+ header.set(headerP2S, newBuffer(ctx.p2s))
+
+ return recipientInfo{
+ encryptedKey: jek,
+ header: header,
+ }, nil
}
return recipientInfo{}, ErrUnsupportedAlgorithm
@@ -295,6 +381,42 @@ func (ctx *symmetricKeyCipher) decryptKey(headers rawHeader, recipient *recipien
return nil, err
}
+ cek, err := josecipher.KeyUnwrap(block, recipient.encryptedKey)
+ if err != nil {
+ return nil, err
+ }
+ return cek, nil
+ case PBES2_HS256_A128KW, PBES2_HS384_A192KW, PBES2_HS512_A256KW:
+ p2s, err := headers.getP2S()
+ if err != nil {
+ return nil, fmt.Errorf("square/go-jose: invalid P2S: %v", err)
+ }
+ if p2s == nil || len(p2s.data) == 0 {
+ return nil, fmt.Errorf("square/go-jose: invalid P2S: must be present")
+ }
+
+ p2c, err := headers.getP2C()
+ if err != nil {
+ return nil, fmt.Errorf("square/go-jose: invalid P2C: %v", err)
+ }
+ if p2c <= 0 {
+ return nil, fmt.Errorf("square/go-jose: invalid P2C: must be a positive integer")
+ }
+
+ // salt is UTF8(Alg) || 0x00 || Salt Input
+ alg := headers.getAlgorithm()
+ salt := bytes.Join([][]byte{[]byte(alg), p2s.bytes()}, []byte{0x00})
+
+ // derive key
+ keyLen, h := getPbkdf2Params(alg)
+ key := pbkdf2.Key(ctx.key, salt, p2c, keyLen, h)
+
+ // use AES cipher with derived key
+ block, err := aes.NewCipher(key)
+ if err != nil {
+ return nil, err
+ }
+
cek, err := josecipher.KeyUnwrap(block, recipient.encryptedKey)
if err != nil {
return nil, err