Add update support for routing mode in google_compute_network (#857)

* Fetch latest compute v1 client

* Add update support for rounting in google_compute_network
This commit is contained in:
Vincent Roseberry 2017-12-14 14:28:58 -08:00 committed by GitHub
parent 734156e88f
commit 293728929f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 187 additions and 102 deletions

View File

@ -12,6 +12,7 @@ func resourceComputeNetwork() *schema.Resource {
return &schema.Resource{
Create: resourceComputeNetworkCreate,
Read: resourceComputeNetworkRead,
Update: resourceComputeNetworkUpdate,
Delete: resourceComputeNetworkDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
@ -41,7 +42,6 @@ func resourceComputeNetwork() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"gateway_ipv4": &schema.Schema{
@ -154,12 +154,39 @@ func resourceComputeNetworkRead(d *schema.ResourceData, meta interface{}) error
d.Set("ipv4_range", network.IPv4Range)
d.Set("self_link", network.SelfLink)
d.Set("name", network.Name)
d.Set("description", network.Description)
d.Set("auto_create_subnetworks", network.AutoCreateSubnetworks)
d.Set("project", project)
return nil
}
func resourceComputeNetworkUpdate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
project, err := getProject(d, config)
if err != nil {
return err
}
op, err := config.clientCompute.Networks.Patch(project, d.Id(), &compute.Network{
RoutingConfig: &compute.NetworkRoutingConfig{
RoutingMode: d.Get("routing_mode").(string),
},
}).Do()
if err != nil {
return fmt.Errorf("Error updating network: %s", err)
}
err = computeSharedOperationWait(config.clientCompute, op, project, "UpdateNetwork")
if err != nil {
return err
}
return resourceComputeNetworkRead(d, meta)
}
func resourceComputeNetworkDelete(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

View File

@ -82,20 +82,28 @@ func TestAccComputeNetwork_routing_mode(t *testing.T) {
var network compute.Network
routingMode := "GLOBAL"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckComputeNetworkDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: testAccComputeNetwork_routing_mode(routingMode),
Config: testAccComputeNetwork_routing_mode("GLOBAL"),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeNetworkExists(
"google_compute_network.acc_network_routing_mode", &network),
testAccCheckComputeNetworkHasRoutingMode(
"google_compute_network.acc_network_routing_mode", &network, routingMode),
"google_compute_network.acc_network_routing_mode", &network, "GLOBAL"),
),
},
// Test updating the routing field (only updateable field).
resource.TestStep{
Config: testAccComputeNetwork_routing_mode("REGIONAL"),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeNetworkExists(
"google_compute_network.acc_network_routing_mode", &network),
testAccCheckComputeNetworkHasRoutingMode(
"google_compute_network.acc_network_routing_mode", &network, "REGIONAL"),
),
},
},

View File

@ -1,11 +1,11 @@
{
"kind": "discovery#restDescription",
"etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/HqQuvNGps38O7DKua7SJgoho9d8\"",
"etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/BzHLXiml7t9ltKStcz-Ic74UmRU\"",
"discoveryVersion": "v1",
"id": "compute:v1",
"name": "compute",
"version": "v1",
"revision": "20171107",
"revision": "20171122",
"title": "Compute Engine API",
"description": "Creates and runs virtual machines on Google Cloud Platform.",
"ownerDomain": "google.com",
@ -110,7 +110,7 @@
"AcceleratorType": {
"id": "AcceleratorType",
"type": "object",
"description": "An Accelerator Type resource.",
"description": "An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -506,7 +506,7 @@
"Address": {
"id": "Address",
"type": "object",
"description": "A reserved address resource.",
"description": "A reserved address resource. (== resource_for beta.addresses ==) (== resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)",
"properties": {
"address": {
"type": "string",
@ -590,7 +590,7 @@
},
"subnetwork": {
"type": "string",
"description": "For external addresses, this field should not be used.\n\nThe URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range."
"description": "The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER purposes."
},
"users": {
"type": "array",
@ -1049,7 +1049,7 @@
"Autoscaler": {
"id": "Autoscaler",
"type": "object",
"description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.",
"description": "Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)",
"properties": {
"autoscalingPolicy": {
"$ref": "AutoscalingPolicy",
@ -1797,7 +1797,7 @@
"BackendService": {
"id": "BackendService",
"type": "object",
"description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity.",
"description": "A BackendService resource. This resource defines a group of backend virtual machines and their serving capacity. (== resource_for v1.backendService ==) (== resource_for beta.backendService ==)",
"properties": {
"affinityCookieTtlSec": {
"type": "integer",
@ -2350,7 +2350,7 @@
"Commitment": {
"id": "Commitment",
"type": "object",
"description": "Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts.\n\nCommitted use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts.",
"description": "Represents a Commitment resource. Creating a Commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts.\n\nCommitted use discounts are subject to Google Cloud Platform's Service Specific Terms. By purchasing a committed use discount, you agree to these terms. Committed use discounts will not renew, so you must purchase a new commitment to continue receiving discounts. (== resource_for beta.commitments ==) (== resource_for v1.commitments ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -2833,7 +2833,7 @@
"Disk": {
"id": "Disk",
"type": "object",
"description": "A Disk resource.",
"description": "A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -3205,7 +3205,7 @@
"DiskType": {
"id": "DiskType",
"type": "object",
"description": "A DiskType resource.",
"description": "A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for v1.diskTypes ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -3934,7 +3934,7 @@
"ForwardingRule": {
"id": "ForwardingRule",
"type": "object",
"description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple.",
"description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules ==) (== resource_for v1.forwardingRules ==) (== resource_for beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) (== resource_for beta.regionForwardingRules ==) (== resource_for v1.regionForwardingRules ==)",
"properties": {
"IPAddress": {
"type": "string",
@ -4391,7 +4391,7 @@
"properties": {
"type": {
"type": "string",
"description": "The type of supported feature. Currently only VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.",
"description": "The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.",
"enum": [
"FEATURE_TYPE_UNSPECIFIED",
"VIRTIO_SCSI_MULTIQUEUE",
@ -5095,7 +5095,7 @@
"Image": {
"id": "Image",
"type": "object",
"description": "An Image resource.",
"description": "An Image resource. (== resource_for beta.images ==) (== resource_for v1.images ==)",
"properties": {
"archiveSizeBytes": {
"type": "string",
@ -5125,7 +5125,7 @@
},
"guestOsFeatures": {
"type": "array",
"description": "A list of features to enable on the guest OS. Applicable for bootable images only. Currently, only one feature can be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to have its own queue. For Windows images, you can only enable VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or higher. Linux images with kernel versions 3.17 and higher will support VIRTIO_SCSI_MULTIQUEUE.\n\nFor newer Windows images, the server might also populate this property with the value WINDOWS to indicate that this is a Windows image.",
"description": "A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.",
"items": {
"$ref": "GuestOsFeature"
}
@ -5373,7 +5373,7 @@
"Instance": {
"id": "Instance",
"type": "object",
"description": "An Instance resource.",
"description": "An Instance resource. (== resource_for beta.instances ==) (== resource_for v1.instances ==)",
"properties": {
"canIpForward": {
"type": "boolean",
@ -5637,6 +5637,7 @@
"InstanceGroup": {
"id": "InstanceGroup",
"type": "object",
"description": "InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== resource_for v1.regionInstanceGroups ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -5932,7 +5933,7 @@
"InstanceGroupManager": {
"id": "InstanceGroupManager",
"type": "object",
"description": "An Instance Group Manager resource.",
"description": "An Instance Group Manager resource. (== resource_for beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for v1.regionInstanceGroupManagers ==)",
"properties": {
"baseInstanceName": {
"type": "string",
@ -6954,7 +6955,7 @@
"InstanceTemplate": {
"id": "InstanceTemplate",
"type": "object",
"description": "An Instance Template resource.",
"description": "An Instance Template resource. (== resource_for beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -7324,7 +7325,7 @@
"Interconnect": {
"id": "Interconnect",
"type": "object",
"description": "Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page.",
"description": "Represents an Interconnects resource. The Interconnects resource is a dedicated connection between Google's network and your on-premises network. For more information, see the Dedicated overview page. (== resource_for v1.interconnects ==) (== resource_for beta.interconnects ==)",
"properties": {
"adminEnabled": {
"type": "boolean",
@ -7456,7 +7457,7 @@
"InterconnectAttachment": {
"id": "InterconnectAttachment",
"type": "object",
"description": "Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments.",
"description": "Represents an InterconnectAttachment (VLAN attachment) resource. For more information, see Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)",
"properties": {
"cloudRouterIpAddress": {
"type": "string",
@ -8333,7 +8334,7 @@
"MachineType": {
"id": "MachineType",
"type": "object",
"description": "A Machine Type resource.",
"description": "A Machine Type resource. (== resource_for v1.machineTypes ==) (== resource_for beta.machineTypes ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -8899,7 +8900,7 @@
"Network": {
"id": "Network",
"type": "object",
"description": "Represents a Network resource. Read Networks and Firewalls for more information.",
"description": "Represents a Network resource. Read Networks and Firewalls for more information. (== resource_for v1.networks ==) (== resource_for beta.networks ==)",
"properties": {
"IPv4Range": {
"type": "string",
@ -9185,7 +9186,12 @@
},
"name": {
"type": "string",
"description": "Name of the peering, which should conform to RFC1035."
"description": "Name of the peering, which should conform to RFC1035.",
"annotations": {
"required": [
"compute.networks.addPeering"
]
}
},
"peerNetwork": {
"type": "string",
@ -9206,7 +9212,7 @@
"Operation": {
"id": "Operation",
"type": "object",
"description": "An Operation resource, used to manage asynchronous API requests.",
"description": "An Operation resource, used to manage asynchronous API requests. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)",
"properties": {
"clientOperationId": {
"type": "string",
@ -9785,7 +9791,7 @@
"Project": {
"id": "Project",
"type": "object",
"description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.",
"description": "A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console. (== resource_for v1.projects ==) (== resource_for beta.projects ==)",
"properties": {
"commonInstanceMetadata": {
"$ref": "Metadata",
@ -10025,7 +10031,7 @@
"Region": {
"id": "Region",
"type": "object",
"description": "Region resource.",
"description": "Region resource. (== resource_for beta.regions ==) (== resource_for v1.regions ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -10804,7 +10810,7 @@
"Route": {
"id": "Route",
"type": "object",
"description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped.",
"description": "Represents a Route resource. A route specifies how certain packets should be handled by the network. Routes are associated with instances by tags and the set of routes for a particular instance is called its routing table.\n\nFor each packet leaving an instance, the system searches that instance's routing table for a single best matching route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching routes. The packet is then forwarded as specified by the nextHop field of the winning route - either to another instance destination, an instance gateway, or a Google Compute Engine-operated gateway.\n\nPackets that do not match any route in the sending instance's routing table are dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -11783,7 +11789,7 @@
"Snapshot": {
"id": "Snapshot",
"type": "object",
"description": "A persistent disk snapshot resource.",
"description": "A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== resource_for v1.snapshots ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -12004,7 +12010,7 @@
"SslCertificate": {
"id": "SslCertificate",
"type": "object",
"description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user.",
"description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to the load balancer to serve secure connections from the user. (== resource_for beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)",
"properties": {
"certificate": {
"type": "string",
@ -12158,7 +12164,7 @@
"Subnetwork": {
"id": "Subnetwork",
"type": "object",
"description": "A Subnetwork resource.",
"description": "A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for v1.subnetworks ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -12625,7 +12631,7 @@
"TargetHttpProxy": {
"id": "TargetHttpProxy",
"type": "object",
"description": "A TargetHttpProxy resource. This resource defines an HTTP proxy.",
"description": "A TargetHttpProxy resource. This resource defines an HTTP proxy. (== resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -12788,7 +12794,7 @@
"TargetHttpsProxy": {
"id": "TargetHttpsProxy",
"type": "object",
"description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.",
"description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (== resource_for v1.targetHttpsProxies ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -12945,7 +12951,7 @@
"TargetInstance": {
"id": "TargetInstance",
"type": "object",
"description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.",
"description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols. (== resource_for beta.targetInstances ==) (== resource_for v1.targetInstances ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -13315,7 +13321,7 @@
"TargetPool": {
"id": "TargetPool",
"type": "object",
"description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool.",
"description": "A TargetPool resource. This resource defines a pool of instances, an associated HttpHealthCheck resource, and the fallback target pool. (== resource_for beta.targetPools ==) (== resource_for v1.targetPools ==)",
"properties": {
"backupPool": {
"type": "string",
@ -13831,7 +13837,7 @@
"TargetSslProxy": {
"id": "TargetSslProxy",
"type": "object",
"description": "A TargetSslProxy resource. This resource defines an SSL proxy.",
"description": "A TargetSslProxy resource. This resource defines an SSL proxy. (== resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -14028,7 +14034,7 @@
"TargetTcpProxy": {
"id": "TargetTcpProxy",
"type": "object",
"description": "A TargetTcpProxy resource. This resource defines a TCP proxy.",
"description": "A TargetTcpProxy resource. This resource defines a TCP proxy. (== resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -14190,7 +14196,7 @@
"TargetVpnGateway": {
"id": "TargetVpnGateway",
"type": "object",
"description": "Represents a Target VPN gateway resource.",
"description": "Represents a Target VPN gateway resource. (== resource_for beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -14877,6 +14883,7 @@
"VpnTunnel": {
"id": "VpnTunnel",
"type": "object",
"description": "VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for v1.vpnTunnels ==)",
"properties": {
"creationTimestamp": {
"type": "string",
@ -15451,7 +15458,7 @@
"Zone": {
"id": "Zone",
"type": "object",
"description": "A Zone resource.",
"description": "A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones ==)",
"properties": {
"availableCpuPlatforms": {
"type": "array",
@ -17379,7 +17386,7 @@
"id": "compute.disks.resize",
"path": "{project}/zones/{zone}/disks/{disk}/resize",
"httpMethod": "POST",
"description": "Resizes the specified persistent disk.",
"description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
"parameters": {
"disk": {
"type": "string",
@ -22822,7 +22829,7 @@
"id": "compute.networks.patch",
"path": "{project}/global/networks/{network}",
"httpMethod": "PATCH",
"description": "Patches the specified network with the data included in the request.",
"description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
"parameters": {
"network": {
"type": "string",

View File

@ -722,7 +722,8 @@ func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AcceleratorType: An Accelerator Type resource.
// AcceleratorType: An Accelerator Type resource. (== resource_for
// beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
type AcceleratorType struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -1283,7 +1284,9 @@ func (s *AccessConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Address: A reserved address resource.
// Address: A reserved address resource. (== resource_for beta.addresses
// ==) (== resource_for v1.addresses ==) (== resource_for
// beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
type Address struct {
// Address: The static IP address represented by this resource.
Address string `json:"address,omitempty"`
@ -1350,11 +1353,10 @@ type Address struct {
// "RESERVED"
Status string `json:"status,omitempty"`
// Subnetwork: For external addresses, this field should not be
// used.
//
// The URL of the subnetwork in which to reserve the address. If an IP
// address is specified, it must be within the subnetwork's IP range.
// Subnetwork: The URL of the subnetwork in which to reserve the
// address. If an IP address is specified, it must be within the
// subnetwork's IP range. This field can only be used with INTERNAL type
// with GCE_ENDPOINT/DNS_RESOLVER purposes.
Subnetwork string `json:"subnetwork,omitempty"`
// Users: [Output Only] The URLs of the resources that are using this
@ -2101,7 +2103,10 @@ func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
// Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
// to automatically scale virtual machine instances in managed instance
// groups according to an autoscaling policy that you define. For more
// information, read Autoscaling Groups of Instances.
// information, read Autoscaling Groups of Instances. (== resource_for
// beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
// resource_for beta.regionAutoscalers ==) (== resource_for
// v1.regionAutoscalers ==)
type Autoscaler struct {
// AutoscalingPolicy: The configuration parameters for the autoscaling
// algorithm. You can define one or more of the policies for an
@ -3263,7 +3268,9 @@ func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
}
// BackendService: A BackendService resource. This resource defines a
// group of backend virtual machines and their serving capacity.
// group of backend virtual machines and their serving capacity. (==
// resource_for v1.backendService ==) (== resource_for
// beta.backendService ==)
type BackendService struct {
// AffinityCookieTtlSec: Lifetime of cookies in seconds if
// session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
@ -4068,7 +4075,8 @@ func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
// Committed use discounts are subject to Google Cloud Platform's
// Service Specific Terms. By purchasing a committed use discount, you
// agree to these terms. Committed use discounts will not renew, so you
// must purchase a new commitment to continue receiving discounts.
// must purchase a new commitment to continue receiving discounts. (==
// resource_for beta.commitments ==) (== resource_for v1.commitments ==)
type Commitment struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -4770,7 +4778,8 @@ func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Disk: A Disk resource.
// Disk: A Disk resource. (== resource_for beta.disks ==) (==
// resource_for v1.disks ==)
type Disk struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -5321,7 +5330,8 @@ func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DiskType: A DiskType resource.
// DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
// (== resource_for v1.diskTypes ==)
type DiskType struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -6381,7 +6391,12 @@ func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
// ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
// specifies which pool of target virtual machines to forward a packet
// to if it matches the given [IPAddress, IPProtocol, ports] tuple.
// to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
// resource_for beta.forwardingRules ==) (== resource_for
// v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
// ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
// beta.regionForwardingRules ==) (== resource_for
// v1.regionForwardingRules ==)
type ForwardingRule struct {
// IPAddress: The IP address that this forwarding rule is serving on
// behalf of.
@ -7069,10 +7084,8 @@ func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
// GuestOsFeature: Guest OS features.
type GuestOsFeature struct {
// Type: The type of supported feature. Currently only
// VIRTIO_SCSI_MULTIQUEUE is supported. For newer Windows images, the
// server might also populate this property with the value WINDOWS to
// indicate that this is a Windows image.
// Type: The ID of a supported feature. Read Enabling guest operating
// system features to see a list of available options.
//
// Possible values:
// "FEATURE_TYPE_UNSPECIFIED"
@ -8058,7 +8071,8 @@ func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Image: An Image resource.
// Image: An Image resource. (== resource_for beta.images ==) (==
// resource_for v1.images ==)
type Image struct {
// ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
// Cloud Storage (in bytes).
@ -8086,17 +8100,9 @@ type Image struct {
// RFC1035.
Family string `json:"family,omitempty"`
// GuestOsFeatures: A list of features to enable on the guest OS.
// Applicable for bootable images only. Currently, only one feature can
// be enabled, VIRTIO_SCSI_MULTIQUEUE, which allows each virtual CPU to
// have its own queue. For Windows images, you can only enable
// VIRTIO_SCSI_MULTIQUEUE on images with driver version 1.2.0.1621 or
// higher. Linux images with kernel versions 3.17 and higher will
// support VIRTIO_SCSI_MULTIQUEUE.
//
// For newer Windows images, the server might also populate this
// property with the value WINDOWS to indicate that this is a Windows
// image.
// GuestOsFeatures: A list of features to enable on the guest operating
// system. Applicable only for bootable images. Read Enabling guest
// operating system features to see a list of available options.
GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
// Id: [Output Only] The unique identifier for the resource. This
@ -8436,7 +8442,8 @@ func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Instance: An Instance resource.
// Instance: An Instance resource. (== resource_for beta.instances ==)
// (== resource_for v1.instances ==)
type Instance struct {
// CanIpForward: Allows this instance to send and receive packets with
// non-matching destination or source IPs. This is required if you plan
@ -8770,6 +8777,10 @@ func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
// ==) (== resource_for v1.instanceGroups ==) (== resource_for
// beta.regionInstanceGroups ==) (== resource_for
// v1.regionInstanceGroups ==)
type InstanceGroup struct {
// CreationTimestamp: [Output Only] The creation timestamp for this
// instance group in RFC3339 text format.
@ -9171,7 +9182,11 @@ func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceGroupManager: An Instance Group Manager resource.
// InstanceGroupManager: An Instance Group Manager resource. (==
// resource_for beta.instanceGroupManagers ==) (== resource_for
// v1.instanceGroupManagers ==) (== resource_for
// beta.regionInstanceGroupManagers ==) (== resource_for
// v1.regionInstanceGroupManagers ==)
type InstanceGroupManager struct {
// BaseInstanceName: The base instance name to use for instances in this
// group. The value must be 1-58 characters long. Instances are named by
@ -10712,7 +10727,8 @@ func (s *InstanceReference) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// InstanceTemplate: An Instance Template resource.
// InstanceTemplate: An Instance Template resource. (== resource_for
// beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
type InstanceTemplate struct {
// CreationTimestamp: [Output Only] The creation timestamp for this
// instance template in RFC3339 text format.
@ -11294,7 +11310,8 @@ func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
// Interconnect: Represents an Interconnects resource. The Interconnects
// resource is a dedicated connection between Google's network and your
// on-premises network. For more information, see the Dedicated
// overview page.
// overview page. (== resource_for v1.interconnects ==) (== resource_for
// beta.interconnects ==)
type Interconnect struct {
// AdminEnabled: Administrative status of the interconnect. When this is
// set to true, the Interconnect is functional and can carry traffic.
@ -11434,7 +11451,8 @@ func (s *Interconnect) MarshalJSON() ([]byte, error) {
// InterconnectAttachment: Represents an InterconnectAttachment (VLAN
// attachment) resource. For more information, see Creating VLAN
// Attachments.
// Attachments. (== resource_for beta.interconnectAttachments ==) (==
// resource_for v1.interconnectAttachments ==)
type InterconnectAttachment struct {
// CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
// be configured on Cloud Router Interface for this interconnect
@ -12628,7 +12646,8 @@ func (s *License) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// MachineType: A Machine Type resource.
// MachineType: A Machine Type resource. (== resource_for
// v1.machineTypes ==) (== resource_for beta.machineTypes ==)
type MachineType struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -13477,7 +13496,8 @@ func (s *NamedPort) MarshalJSON() ([]byte, error) {
}
// Network: Represents a Network resource. Read Networks and Firewalls
// for more information.
// for more information. (== resource_for v1.networks ==) (==
// resource_for beta.networks ==)
type Network struct {
// IPv4Range: The range of internal addresses that are legal on this
// network. This range is a CIDR specification, for example:
@ -13967,7 +13987,10 @@ func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
}
// Operation: An Operation resource, used to manage asynchronous API
// requests.
// requests. (== resource_for v1.globalOperations ==) (== resource_for
// beta.globalOperations ==) (== resource_for v1.regionOperations ==)
// (== resource_for beta.regionOperations ==) (== resource_for
// v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
type Operation struct {
// ClientOperationId: [Output Only] Reserved for future use.
ClientOperationId string `json:"clientOperationId,omitempty"`
@ -14789,7 +14812,8 @@ func (s *PathRule) MarshalJSON() ([]byte, error) {
// Project: A Project resource. Projects can only be created in the
// Google Cloud Platform Console. Unless marked otherwise, values can
// only be modified in the console.
// only be modified in the console. (== resource_for v1.projects ==) (==
// resource_for beta.projects ==)
type Project struct {
// CommonInstanceMetadata: Metadata key/value pairs available to all
// instances contained in this project. See Custom metadata for more
@ -15096,7 +15120,8 @@ func (s *Quota) UnmarshalJSON(data []byte) error {
return nil
}
// Region: Region resource.
// Region: Region resource. (== resource_for beta.regions ==) (==
// resource_for v1.regions ==)
type Region struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -16283,7 +16308,8 @@ func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
// Compute Engine-operated gateway.
//
// Packets that do not match any route in the sending instance's routing
// table are dropped.
// table are dropped. (== resource_for beta.routes ==) (== resource_for
// v1.routes ==)
type Route struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -17640,7 +17666,8 @@ func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Snapshot: A persistent disk snapshot resource.
// Snapshot: A persistent disk snapshot resource. (== resource_for
// beta.snapshots ==) (== resource_for v1.snapshots ==)
type Snapshot struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -17935,7 +17962,8 @@ func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
// SslCertificate: An SslCertificate resource. This resource provides a
// mechanism to upload an SSL key and certificate to the load balancer
// to serve secure connections from the user.
// to serve secure connections from the user. (== resource_for
// beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
type SslCertificate struct {
// Certificate: A local certificate file. The certificate must be in PEM
// format. The certificate chain must be no greater than 5 certs long.
@ -18156,7 +18184,8 @@ func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Subnetwork: A Subnetwork resource.
// Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
// ==) (== resource_for v1.subnetworks ==)
type Subnetwork struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -18882,7 +18911,8 @@ func (s *Tags) MarshalJSON() ([]byte, error) {
}
// TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
// HTTP proxy.
// HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
// resource_for v1.targetHttpProxies ==)
type TargetHttpProxy struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -19131,7 +19161,8 @@ func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, err
}
// TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
// an HTTPS proxy.
// an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
// resource_for v1.targetHttpsProxies ==)
type TargetHttpsProxy struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -19360,7 +19391,9 @@ func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
}
// TargetInstance: A TargetInstance resource. This resource defines an
// endpoint instance that terminates traffic of certain protocols.
// endpoint instance that terminates traffic of certain protocols. (==
// resource_for beta.targetInstances ==) (== resource_for
// v1.targetInstances ==)
type TargetInstance struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -19884,7 +19917,8 @@ func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
// TargetPool: A TargetPool resource. This resource defines a pool of
// instances, an associated HttpHealthCheck resource, and the fallback
// target pool.
// target pool. (== resource_for beta.targetPools ==) (== resource_for
// v1.targetPools ==)
type TargetPool struct {
// BackupPool: This field is applicable only when the containing target
// pool is serving a forwarding rule as the primary pool, and its
@ -20740,7 +20774,8 @@ func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error
}
// TargetSslProxy: A TargetSslProxy resource. This resource defines an
// SSL proxy.
// SSL proxy. (== resource_for beta.targetSslProxies ==) (==
// resource_for v1.targetSslProxies ==)
type TargetSslProxy struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -21031,7 +21066,8 @@ func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
}
// TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
// TCP proxy.
// TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
// resource_for v1.targetTcpProxies ==)
type TargetTcpProxy struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -21256,7 +21292,9 @@ func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TargetVpnGateway: Represents a Target VPN gateway resource.
// TargetVpnGateway: Represents a Target VPN gateway resource. (==
// resource_for beta.targetVpnGateways ==) (== resource_for
// v1.targetVpnGateways ==)
type TargetVpnGateway struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -22256,6 +22294,8 @@ func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
// (== resource_for v1.vpnTunnels ==)
type VpnTunnel struct {
// CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
// format.
@ -23005,7 +23045,8 @@ func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Zone: A Zone resource.
// Zone: A Zone resource. (== resource_for beta.zones ==) (==
// resource_for v1.zones ==)
type Zone struct {
// AvailableCpuPlatforms: [Output Only] Available cpu/platform
// selections for the zone.
@ -30827,7 +30868,8 @@ type DisksResizeCall struct {
header_ http.Header
}
// Resize: Resizes the specified persistent disk.
// Resize: Resizes the specified persistent disk. You can only increase
// the size of the disk.
func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
@ -30944,7 +30986,7 @@ func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
}
return ret, nil
// {
// "description": "Resizes the specified persistent disk.",
// "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
// "httpMethod": "POST",
// "id": "compute.disks.resize",
// "parameterOrder": [
@ -53774,7 +53816,8 @@ type NetworksPatchCall struct {
}
// Patch: Patches the specified network with the data included in the
// request.
// request. Only the following fields can be modified:
// routingConfig.routingMode.
func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
@ -53889,7 +53932,7 @@ func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error)
}
return ret, nil
// {
// "description": "Patches the specified network with the data included in the request.",
// "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
// "httpMethod": "PATCH",
// "id": "compute.networks.patch",
// "parameterOrder": [

6
vendor/vendor.json vendored
View File

@ -1062,10 +1062,10 @@
"revisionTime": "2017-11-21T19:49:26Z"
},
{
"checksumSHA1": "FDH3RnrVbXNiOeQ0Wfi41oXZ+p0=",
"checksumSHA1": "mAsa+xKdihWif0c4tJ6hOwpDuhk=",
"path": "google.golang.org/api/compute/v1",
"revision": "17b5f22a248d6d3913171c1a557552ace0d9c806",
"revisionTime": "2017-11-21T19:49:26Z"
"revision": "7219ace1c3535de1864b2706ea9397ad2d269f07",
"revisionTime": "2017-12-14T00:03:52Z"
},
{
"checksumSHA1": "acuDPZa9rxUvFhdijdVfG4jy+rw=",