Merge pull request #5871 from evandbrown/gke-new-features

provider/google: Update Container Engine features
This commit is contained in:
Lars Wander 2016-04-15 09:01:50 -04:00
commit a2d8324d4f
21 changed files with 2262 additions and 1577 deletions

28
Godeps/Godeps.json generated
View File

@ -1300,23 +1300,23 @@
},
{
"ImportPath": "golang.org/x/oauth2",
"Rev": "8a57ed94ffd43444c0879fe75701732a38afc985"
"Rev": "2897dcade18a126645f1368de827f1e613a60049"
},
{
"ImportPath": "golang.org/x/oauth2/google",
"Rev": "8a57ed94ffd43444c0879fe75701732a38afc985"
"Rev": "2897dcade18a126645f1368de827f1e613a60049"
},
{
"ImportPath": "golang.org/x/oauth2/internal",
"Rev": "8a57ed94ffd43444c0879fe75701732a38afc985"
"Rev": "2897dcade18a126645f1368de827f1e613a60049"
},
{
"ImportPath": "golang.org/x/oauth2/jws",
"Rev": "8a57ed94ffd43444c0879fe75701732a38afc985"
"Rev": "2897dcade18a126645f1368de827f1e613a60049"
},
{
"ImportPath": "golang.org/x/oauth2/jwt",
"Rev": "8a57ed94ffd43444c0879fe75701732a38afc985"
"Rev": "2897dcade18a126645f1368de827f1e613a60049"
},
{
"ImportPath": "golang.org/x/sys/unix",
@ -1324,39 +1324,39 @@
},
{
"ImportPath": "google.golang.org/api/compute/v1",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/container/v1",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/dns/v1",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/gensupport",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/googleapi",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/googleapi/internal/uritemplates",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/pubsub/v1",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/sqladmin/v1beta4",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/api/storage/v1",
"Rev": "61d74df3f9f3a66898c8e08aa7e702337b34dda3"
"Rev": "43c645d4bcf9251ced36c823a93b6d198764aae4"
},
{
"ImportPath": "google.golang.org/appengine",

View File

@ -146,7 +146,51 @@ func resourceContainerCluster() *schema.Resource {
Default: "default",
ForceNew: true,
},
"subnetwork": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"addons_config": &schema.Schema{
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"http_load_balancing": &schema.Schema{
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"disabled": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},
},
},
},
"horizontal_pod_autoscaling": &schema.Schema{
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"disabled": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
},
},
},
},
},
},
},
"node_config": &schema.Schema{
Type: schema.TypeList,
Optional: true,
@ -249,6 +293,28 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er
cluster.Network = v.(string)
}
if v, ok := d.GetOk("subnetwork"); ok {
cluster.Subnetwork = v.(string)
}
if v, ok := d.GetOk("addons_config"); ok {
addonsConfig := v.([]interface{})[0].(map[string]interface{})
cluster.AddonsConfig = &container.AddonsConfig{}
if v, ok := addonsConfig["http_load_balancing"]; ok {
addon := v.([]interface{})[0].(map[string]interface{})
cluster.AddonsConfig.HttpLoadBalancing = &container.HttpLoadBalancing{
Disabled: addon["disabled"].(bool),
}
}
if v, ok := addonsConfig["horizontal_pod_autoscaling"]; ok {
addon := v.([]interface{})[0].(map[string]interface{})
cluster.AddonsConfig.HorizontalPodAutoscaling = &container.HorizontalPodAutoscaling{
Disabled: addon["disabled"].(bool),
}
}
}
if v, ok := d.GetOk("node_config"); ok {
nodeConfigs := v.([]interface{})
if len(nodeConfigs) > 1 {
@ -360,6 +426,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro
d.Set("logging_service", cluster.LoggingService)
d.Set("monitoring_service", cluster.MonitoringService)
d.Set("network", cluster.Network)
d.Set("subnetwork", cluster.Subnetwork)
d.Set("node_config", flattenClusterNodeConfig(cluster.NodeConfig))
d.Set("instance_group_urls", cluster.InstanceGroupUrls)

View File

@ -105,6 +105,7 @@ var brokenAuthHeaderProviders = []string{
"https://oauth.sandbox.trainingpeaks.com/",
"https://oauth.trainingpeaks.com/",
"https://oauth.vk.com/",
"https://openapi.baidu.com/",
"https://slack.com/",
"https://test-sandbox.auth.corp.google.com",
"https://test.salesforce.com/",
@ -113,6 +114,8 @@ var brokenAuthHeaderProviders = []string{
"https://www.googleapis.com/",
"https://www.linkedin.com/",
"https://www.strava.com/oauth/",
"https://www.wunderlist.com/oauth/",
"https://api.patreon.com/",
}
func RegisterBrokenAuthHeaderProvider(tokenURL string) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
{
"kind": "discovery#restDescription",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/-5Ir9-bAl4HnPM8XDQ5ycW_gSZQ\"",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/OU95LyfeHZcrBJDajlkYXi0P4Wo\"",
"discoveryVersion": "v1",
"id": "container:v1",
"name": "container",
"version": "v1",
"revision": "20150603",
"revision": "20160321",
"title": "Google Container Engine API",
"description": "The Google Container Engine API is used for building and managing container based applications, powered by the open source Kubernetes technology.",
"description": "Builds and manages clusters that run container-based applications, powered by open source Kubernetes technology.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
@ -121,6 +121,13 @@
"items": {
"$ref": "Cluster"
}
},
"missingZones": {
"type": "array",
"description": "If any zones are listed here, the list of clusters returned may be missing those zones.",
"items": {
"type": "string"
}
}
}
},
@ -139,33 +146,41 @@
},
"initialNodeCount": {
"type": "integer",
"description": "The number of nodes to create in this cluster. You must ensure that your Compute Engine [resource quota](/compute/docs/resource-quotas) is sufficient for this number of instances. You must also have available firewall and routes quota.",
"description": "The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota. For requests, this field should only be used in lieu of a \"node_pool\" object, since this configuration (along with the \"node_config\") will be used to create a \"NodePool\" object with an auto-generated name. Do not use this and a node_pool at the same time.",
"format": "int32"
},
"nodeConfig": {
"$ref": "NodeConfig",
"description": "Parameters used in creating the cluster's nodes. See the descriptions of the child properties of `nodeConfig`. If unspecified, the defaults for all child properties are used."
"description": "Parameters used in creating the cluster's nodes. See `nodeConfig` for the description of its properties. For requests, this field should only be used in lieu of a \"node_pool\" object, since this configuration (along with the \"initial_node_count\") will be used to create a \"NodePool\" object with an auto-generated name. Do not use this and a node_pool at the same time. For responses, this field will be populated with the node configuration of the first node pool. If unspecified, the defaults are used."
},
"masterAuth": {
"$ref": "MasterAuth",
"description": "The authentication information for accessing the master."
"description": "The authentication information for accessing the master endpoint."
},
"loggingService": {
"type": "string",
"description": "The logging service that the cluster should write logs to. Currently available options: * \"logging.googleapis.com\" - the Google Cloud Logging service * \"none\" - no logs will be exported from the cluster * \"\" - default value; the default is \"logging.googleapis.com\""
"description": "The logging service the cluster should use to write logs. Currently available options: * `logging.googleapis.com` - the Google Cloud Logging service. * `none` - no logs will be exported from the cluster. * if left as an empty string,`logging.googleapis.com` will be used."
},
"monitoringService": {
"type": "string",
"description": "The monitoring service that the cluster should write metrics to. Currently available options: * \"monitoring.googleapis.com\" - the Google Cloud Monitoring service * \"none\" - no metrics will be exported from the cluster * \"\" - default value; the default is \"monitoring.googleapis.com\""
"description": "The monitoring service the cluster should use to write metrics. Currently available options: * `monitoring.googleapis.com` - the Google Cloud Monitoring service. * `none` - no metrics will be exported from the cluster. * if left as an empty string, `monitoring.googleapis.com` will be used."
},
"network": {
"type": "string",
"description": "The name of the Google Compute Engine [network](/compute/docs/networking#networks_1) to which the cluster is connected. If left unspecified, the \"default\" network will be used."
"description": "The name of the Google Compute Engine [network](/compute/docs/networks-and-firewalls#networks) to which the cluster is connected. If left unspecified, the `default` network will be used."
},
"clusterIpv4Cidr": {
"type": "string",
"description": "The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8`."
},
"addonsConfig": {
"$ref": "AddonsConfig",
"description": "Configurations for the various addons available to run in the cluster."
},
"subnetwork": {
"type": "string",
"description": "The name of the Google Compute Engine [subnetwork](/compute/docs/subnetworks) to which the cluster is connected."
},
"selfLink": {
"type": "string",
"description": "[Output only] Server-defined URL for the resource."
@ -176,11 +191,11 @@
},
"endpoint": {
"type": "string",
"description": "[Output only] The IP address of this cluster's Kubernetes master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information."
"description": "[Output only] The IP address of this cluster's master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information."
},
"initialClusterVersion": {
"type": "string",
"description": "[Output only] The software version of Kubernetes master and kubelets used in the cluster when it was first created. The version can be upgraded over time."
"description": "[Output only] The software version of the master endpoint and kubelets used in the cluster when it was first created. The version can be upgraded over time."
},
"currentMasterVersion": {
"type": "string",
@ -188,7 +203,7 @@
},
"currentNodeVersion": {
"type": "string",
"description": "[Output only] The current version of the node software components. If they are currently at different versions because they're in the process of being upgraded, this reflects the minimum version of any of them."
"description": "[Output only] The current version of the node software components. If they are currently at multiple versions because they're in the process of being upgraded, this reflects the minimum version of all nodes."
},
"createTime": {
"type": "string",
@ -212,12 +227,12 @@
},
"nodeIpv4CidrSize": {
"type": "integer",
"description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the container_ipv4_cidr range.",
"description": "[Output only] The size of the address space on each node for hosting containers. This is provisioned from within the `container_ipv4_cidr` range.",
"format": "int32"
},
"servicesIpv4Cidr": {
"type": "string",
"description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last /16 from the container CIDR."
"description": "[Output only] The IP address range of the Kubernetes services in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last `/16` from the container CIDR."
},
"instanceGroupUrls": {
"type": "array",
@ -225,13 +240,18 @@
"items": {
"type": "string"
}
},
"currentNodeCount": {
"type": "integer",
"description": "[Output only] The number of nodes currently in the cluster.",
"format": "int32"
}
}
},
"NodeConfig": {
"id": "NodeConfig",
"type": "object",
"description": "Per-node parameters.",
"description": "Parameters that describe the nodes in a cluster.",
"properties": {
"machineType": {
"type": "string",
@ -244,10 +264,17 @@
},
"oauthScopes": {
"type": "array",
"description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with *gcr.io*. If unspecified, no scopes are added.",
"description": "The set of Google API scopes to be made available on all of the node VMs under the \"default\" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with **gcr.io** (the [Google Container Registry](/container-registry/)). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added.",
"items": {
"type": "string"
}
},
"metadata": {
"type": "object",
"description": "The metadata key/value pairs assigned to instances in the cluster. Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in length. These are reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the four reserved keys: \"instance-template\", \"kube-env\", \"startup-script\", and \"user-data\" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB.",
"additionalProperties": {
"type": "string"
}
}
}
},
@ -258,23 +285,60 @@
"properties": {
"username": {
"type": "string",
"description": "The username to use for HTTP basic authentication when accessing the Kubernetes master endpoint."
"description": "The username to use for HTTP basic authentication to the master endpoint."
},
"password": {
"type": "string",
"description": "The password to use for HTTP basic authentication when accessing the Kubernetes master endpoint. Because the master endpoint is open to the internet, you should create a strong password."
"description": "The password to use for HTTP basic authentication to the master endpoint. Because the master endpoint is open to the Internet, you should create a strong password."
},
"clusterCaCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate that is the root of trust for the cluster."
"description": "[Output only] Base64-encoded public certificate that is the root of trust for the cluster."
},
"clientCertificate": {
"type": "string",
"description": "[Output only] Base64 encoded public certificate used by clients to authenticate to the cluster endpoint."
"description": "[Output only] Base64-encoded public certificate used by clients to authenticate to the cluster endpoint."
},
"clientKey": {
"type": "string",
"description": "[Output only] Base64 encoded private key used by clients to authenticate to the cluster endpoint."
"description": "[Output only] Base64-encoded private key used by clients to authenticate to the cluster endpoint."
}
}
},
"AddonsConfig": {
"id": "AddonsConfig",
"type": "object",
"description": "Configuration for the addons that can be automatically spun up in the cluster, enabling additional functionality.",
"properties": {
"httpLoadBalancing": {
"$ref": "HttpLoadBalancing",
"description": "Configuration for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster."
},
"horizontalPodAutoscaling": {
"$ref": "HorizontalPodAutoscaling",
"description": "Configuration for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods."
}
}
},
"HttpLoadBalancing": {
"id": "HttpLoadBalancing",
"type": "object",
"description": "Configuration options for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster.",
"properties": {
"disabled": {
"type": "boolean",
"description": "Whether the HTTP Load Balancing controller is enabled in the cluster. When enabled, it runs a small pod in the cluster that manages the load balancers."
}
}
},
"HorizontalPodAutoscaling": {
"id": "HorizontalPodAutoscaling",
"type": "object",
"description": "Configuration options for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods.",
"properties": {
"disabled": {
"type": "boolean",
"description": "Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. When enabled, it ensures that a Heapster pod is running in the cluster, which is also used by the Cloud Monitoring service."
}
}
},
@ -292,7 +356,7 @@
"Operation": {
"id": "Operation",
"type": "object",
"description": "Defines the operation resource. All fields are output only.",
"description": "This operation resource represents operations that may have happened or are happening on the cluster. All fields are output only.",
"properties": {
"name": {
"type": "string",
@ -311,7 +375,10 @@
"DELETE_CLUSTER",
"UPGRADE_MASTER",
"UPGRADE_NODES",
"REPAIR_CLUSTER"
"REPAIR_CLUSTER",
"UPDATE_CLUSTER",
"CREATE_NODE_POOL",
"DELETE_NODE_POOL"
]
},
"status": {
@ -324,6 +391,10 @@
"DONE"
]
},
"detail": {
"type": "string",
"description": "Detailed operation progress, if available."
},
"statusMessage": {
"type": "string",
"description": "If an error has occurred, a textual description of the error."
@ -341,7 +412,7 @@
"UpdateClusterRequest": {
"id": "UpdateClusterRequest",
"type": "object",
"description": "UpdateClusterRequest updates a cluster.",
"description": "UpdateClusterRequest updates the settings of a cluster.",
"properties": {
"update": {
"$ref": "ClusterUpdate",
@ -352,11 +423,23 @@
"ClusterUpdate": {
"id": "ClusterUpdate",
"type": "object",
"description": "ClusterUpdate describes an update to the cluster.",
"description": "ClusterUpdate describes an update to the cluster. Exactly one update can be applied to a cluster with each request, so at most one field can be provided.",
"properties": {
"desiredNodeVersion": {
"type": "string",
"description": "The Kubernetes version to change the nodes to (typically an upgrade). Use \"-\" to upgrade to the latest version supported by the server."
"description": "The Kubernetes version to change the nodes to (typically an upgrade). Use `-` to upgrade to the latest version supported by the server."
},
"desiredMonitoringService": {
"type": "string",
"description": "The monitoring service the cluster should use to write metrics. Currently available options: * \"monitoring.googleapis.com\" - the Google Cloud Monitoring service * \"none\" - no metrics will be exported from the cluster"
},
"desiredAddonsConfig": {
"$ref": "AddonsConfig",
"description": "Configurations for the various addons available to run in the cluster."
},
"desiredMasterVersion": {
"type": "string",
"description": "The Kubernetes version to change the master to. The only valid value is the latest supported version. Use \"-\" to have the server automatically select the latest version."
}
}
},
@ -371,17 +454,24 @@
"items": {
"$ref": "Operation"
}
},
"missingZones": {
"type": "array",
"description": "If any zones are listed here, the list of operations returned may be missing the operations from those zones.",
"items": {
"type": "string"
}
}
}
},
"ServerConfig": {
"id": "ServerConfig",
"type": "object",
"description": "Container Engine Server configuration.",
"description": "Container Engine service configuration.",
"properties": {
"defaultClusterVersion": {
"type": "string",
"description": "What version this server deploys by default."
"description": "Version of Kubernetes the service deploys by default."
},
"validNodeVersions": {
"type": "array",
@ -406,13 +496,13 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for.",
"required": true,
"location": "path"
}
@ -440,7 +530,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
@ -466,11 +556,11 @@
"id": "container.projects.zones.clusters.get",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "GET",
"description": "Gets a specific cluster.",
"description": "Gets the details of a specific cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
@ -503,11 +593,11 @@
"id": "container.projects.zones.clusters.create",
"path": "v1/projects/{projectId}/zones/{zone}/clusters",
"httpMethod": "POST",
"description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
"description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
@ -536,11 +626,11 @@
"id": "container.projects.zones.clusters.update",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "PUT",
"description": "Update settings of a specific cluster.",
"description": "Updates the settings of a specific cluster.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
@ -576,11 +666,11 @@
"id": "container.projects.zones.clusters.delete",
"path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
"httpMethod": "DELETE",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.",
"description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.",
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
@ -621,13 +711,13 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},
"zone": {
"type": "string",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
"description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones.",
"required": true,
"location": "path"
}
@ -651,7 +741,7 @@
"parameters": {
"projectId": {
"type": "string",
"description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
"description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
"required": true,
"location": "path"
},

View File

@ -120,8 +120,42 @@ type ProjectsZonesOperationsService struct {
s *Service
}
// AddonsConfig: Configuration for the addons that can be automatically
// spun up in the cluster, enabling additional functionality.
type AddonsConfig struct {
// HorizontalPodAutoscaling: Configuration for the horizontal pod
// autoscaling feature, which increases or decreases the number of
// replica pods a replication controller has based on the resource usage
// of the existing pods.
HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
// HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
// controller addon, which makes it easy to set up HTTP load balancers
// for services in a cluster.
HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "HorizontalPodAutoscaling") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
type noMethod AddonsConfig
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// Cluster: A Google Container Engine cluster.
type Cluster struct {
// AddonsConfig: Configurations for the various addons available to run
// in the cluster.
AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
// ClusterIpv4Cidr: The IP address range of the container pods in this
// cluster, in
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
@ -137,51 +171,60 @@ type Cluster struct {
// the master endpoint.
CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
// CurrentNodeCount: [Output only] The number of nodes currently in the
// cluster.
CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
// CurrentNodeVersion: [Output only] The current version of the node
// software components. If they are currently at different versions
// software components. If they are currently at multiple versions
// because they're in the process of being upgraded, this reflects the
// minimum version of any of them.
// minimum version of all nodes.
CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
// Description: An optional description of this cluster.
Description string `json:"description,omitempty"`
// Endpoint: [Output only] The IP address of this cluster's Kubernetes
// master endpoint. The endpoint can be accessed from the internet at
// Endpoint: [Output only] The IP address of this cluster's master
// endpoint. The endpoint can be accessed from the internet at
// `https://username:password@endpoint/`. See the `masterAuth` property
// of this resource for username and password information.
Endpoint string `json:"endpoint,omitempty"`
// InitialClusterVersion: [Output only] The software version of
// Kubernetes master and kubelets used in the cluster when it was first
// InitialClusterVersion: [Output only] The software version of the
// master endpoint and kubelets used in the cluster when it was first
// created. The version can be upgraded over time.
InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
// InitialNodeCount: The number of nodes to create in this cluster. You
// must ensure that your Compute Engine [resource
// quota](/compute/docs/resource-quotas) is sufficient for this number
// of instances. You must also have available firewall and routes quota.
// must ensure that your Compute Engine resource quota is sufficient for
// this number of instances. You must also have available firewall and
// routes quota. For requests, this field should only be used in lieu of
// a "node_pool" object, since this configuration (along with the
// "node_config") will be used to create a "NodePool" object with an
// auto-generated name. Do not use this and a node_pool at the same
// time.
InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
// InstanceGroupUrls: [Output only] The resource URLs of [instance
// groups](/compute/docs/instance-groups/) associated with this cluster.
InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
// LoggingService: The logging service that the cluster should write
// logs to. Currently available options: * "logging.googleapis.com" -
// the Google Cloud Logging service * "none" - no logs will be exported
// from the cluster * "" - default value; the default is
// "logging.googleapis.com"
// LoggingService: The logging service the cluster should use to write
// logs. Currently available options: * `logging.googleapis.com` - the
// Google Cloud Logging service. * `none` - no logs will be exported
// from the cluster. * if left as an empty
// string,`logging.googleapis.com` will be used.
LoggingService string `json:"loggingService,omitempty"`
// MasterAuth: The authentication information for accessing the master.
// MasterAuth: The authentication information for accessing the master
// endpoint.
MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
// MonitoringService: The monitoring service that the cluster should
// write metrics to. Currently available options: *
// "monitoring.googleapis.com" - the Google Cloud Monitoring service *
// "none" - no metrics will be exported from the cluster * "" - default
// value; the default is "monitoring.googleapis.com"
// MonitoringService: The monitoring service the cluster should use to
// write metrics. Currently available options: *
// `monitoring.googleapis.com` - the Google Cloud Monitoring service. *
// `none` - no metrics will be exported from the cluster. * if left as
// an empty string, `monitoring.googleapis.com` will be used.
MonitoringService string `json:"monitoringService,omitempty"`
// Name: The name of this cluster. The name must be unique within this
@ -191,19 +234,24 @@ type Cluster struct {
Name string `json:"name,omitempty"`
// Network: The name of the Google Compute Engine
// [network](/compute/docs/networking#networks_1) to which the cluster
// is connected. If left unspecified, the "default" network will be
// used.
// [network](/compute/docs/networks-and-firewalls#networks) to which the
// cluster is connected. If left unspecified, the `default` network will
// be used.
Network string `json:"network,omitempty"`
// NodeConfig: Parameters used in creating the cluster's nodes. See the
// descriptions of the child properties of `nodeConfig`. If unspecified,
// the defaults for all child properties are used.
// NodeConfig: Parameters used in creating the cluster's nodes. See
// `nodeConfig` for the description of its properties. For requests,
// this field should only be used in lieu of a "node_pool" object, since
// this configuration (along with the "initial_node_count") will be used
// to create a "NodePool" object with an auto-generated name. Do not use
// this and a node_pool at the same time. For responses, this field will
// be populated with the node configuration of the first node pool. If
// unspecified, the defaults are used.
NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
// NodeIpv4CidrSize: [Output only] The size of the address space on each
// node for hosting containers. This is provisioned from within the
// container_ipv4_cidr range.
// `container_ipv4_cidr` range.
NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
// SelfLink: [Output only] Server-defined URL for the resource.
@ -213,7 +261,7 @@ type Cluster struct {
// Kubernetes services in this cluster, in
// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// notation (e.g. `1.2.3.4/29`). Service addresses are typically put in
// the last /16 from the container CIDR.
// the last `/16` from the container CIDR.
ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
// Status: [Output only] The current status of this cluster.
@ -231,6 +279,11 @@ type Cluster struct {
// status of this cluster, if available.
StatusMessage string `json:"statusMessage,omitempty"`
// Subnetwork: The name of the Google Compute Engine
// [subnetwork](/compute/docs/subnetworks) to which the cluster is
// connected.
Subnetwork string `json:"subnetwork,omitempty"`
// Zone: [Output only] The name of the Google Compute Engine
// [zone](/compute/docs/zones#available) in which the cluster resides.
Zone string `json:"zone,omitempty"`
@ -239,7 +292,7 @@ type Cluster struct {
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to
// ForceSendFields is a list of field names (e.g. "AddonsConfig") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -255,13 +308,30 @@ func (s *Cluster) MarshalJSON() ([]byte, error) {
}
// ClusterUpdate: ClusterUpdate describes an update to the cluster.
// Exactly one update can be applied to a cluster with each request, so
// at most one field can be provided.
type ClusterUpdate struct {
// DesiredAddonsConfig: Configurations for the various addons available
// to run in the cluster.
DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
// DesiredMasterVersion: The Kubernetes version to change the master to.
// The only valid value is the latest supported version. Use "-" to have
// the server automatically select the latest version.
DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
// DesiredMonitoringService: The monitoring service the cluster should
// use to write metrics. Currently available options: *
// "monitoring.googleapis.com" - the Google Cloud Monitoring service *
// "none" - no metrics will be exported from the cluster
DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
// DesiredNodeVersion: The Kubernetes version to change the nodes to
// (typically an upgrade). Use "-" to upgrade to the latest version
// (typically an upgrade). Use `-` to upgrade to the latest version
// supported by the server.
DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
// ForceSendFields is a list of field names (e.g. "DesiredNodeVersion")
// ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -297,6 +367,56 @@ func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// HorizontalPodAutoscaling: Configuration options for the horizontal
// pod autoscaling feature, which increases or decreases the number of
// replica pods a replication controller has based on the resource usage
// of the existing pods.
type HorizontalPodAutoscaling struct {
// Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
// in the cluster. When enabled, it ensures that a Heapster pod is
// running in the cluster, which is also used by the Cloud Monitoring
// service.
Disabled bool `json:"disabled,omitempty"`
// ForceSendFields is a list of field names (e.g. "Disabled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
type noMethod HorizontalPodAutoscaling
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// HttpLoadBalancing: Configuration options for the HTTP (L7) load
// balancing controller addon, which makes it easy to set up HTTP load
// balancers for services in a cluster.
type HttpLoadBalancing struct {
// Disabled: Whether the HTTP Load Balancing controller is enabled in
// the cluster. When enabled, it runs a small pod in the cluster that
// manages the load balancers.
Disabled bool `json:"disabled,omitempty"`
// ForceSendFields is a list of field names (e.g. "Disabled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
type noMethod HttpLoadBalancing
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// ListClustersResponse: ListClustersResponse is the result of
// ListClustersRequest.
type ListClustersResponse struct {
@ -304,6 +424,10 @@ type ListClustersResponse struct {
// across all ones.
Clusters []*Cluster `json:"clusters,omitempty"`
// MissingZones: If any zones are listed here, the list of clusters
// returned may be missing those zones.
MissingZones []string `json:"missingZones,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
@ -326,6 +450,10 @@ func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
// ListOperationsResponse: ListOperationsResponse is the result of
// ListOperationsRequest.
type ListOperationsResponse struct {
// MissingZones: If any zones are listed here, the list of operations
// returned may be missing the operations from those zones.
MissingZones []string `json:"missingZones,omitempty"`
// Operations: A list of operations in the project in the specified
// zone.
Operations []*Operation `json:"operations,omitempty"`
@ -334,7 +462,7 @@ type ListOperationsResponse struct {
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Operations") to
// ForceSendFields is a list of field names (e.g. "MissingZones") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -353,25 +481,25 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
// endpoint. Authentication can be done using HTTP basic auth or using
// client certificates.
type MasterAuth struct {
// ClientCertificate: [Output only] Base64 encoded public certificate
// ClientCertificate: [Output only] Base64-encoded public certificate
// used by clients to authenticate to the cluster endpoint.
ClientCertificate string `json:"clientCertificate,omitempty"`
// ClientKey: [Output only] Base64 encoded private key used by clients
// ClientKey: [Output only] Base64-encoded private key used by clients
// to authenticate to the cluster endpoint.
ClientKey string `json:"clientKey,omitempty"`
// ClusterCaCertificate: [Output only] Base64 encoded public certificate
// ClusterCaCertificate: [Output only] Base64-encoded public certificate
// that is the root of trust for the cluster.
ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
// Password: The password to use for HTTP basic authentication when
// accessing the Kubernetes master endpoint. Because the master endpoint
// is open to the internet, you should create a strong password.
// Password: The password to use for HTTP basic authentication to the
// master endpoint. Because the master endpoint is open to the Internet,
// you should create a strong password.
Password string `json:"password,omitempty"`
// Username: The username to use for HTTP basic authentication when
// accessing the Kubernetes master endpoint.
// Username: The username to use for HTTP basic authentication to the
// master endpoint.
Username string `json:"username,omitempty"`
// ForceSendFields is a list of field names (e.g. "ClientCertificate")
@ -389,7 +517,7 @@ func (s *MasterAuth) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// NodeConfig: Per-node parameters.
// NodeConfig: Parameters that describe the nodes in a cluster.
type NodeConfig struct {
// DiskSizeGb: Size of the disk attached to each node, specified in GB.
// The smallest allowed disk size is 10GB. If unspecified, the default
@ -401,13 +529,29 @@ type NodeConfig struct {
// unspecified, the default machine type is `n1-standard-1`.
MachineType string `json:"machineType,omitempty"`
// Metadata: The metadata key/value pairs assigned to instances in the
// cluster. Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less
// than 128 bytes in length. These are reflected as part of a URL in the
// metadata server. Additionally, to avoid ambiguity, keys must not
// conflict with any other metadata keys for the project or be one of
// the four reserved keys: "instance-template", "kube-env",
// "startup-script", and "user-data" Values are free-form strings, and
// only have meaning as interpreted by the image running in the
// instance. The only restriction placed on them is that each value's
// size must be less than or equal to 32 KB. The total size of all keys
// and values must be less than 512 KB.
Metadata map[string]string `json:"metadata,omitempty"`
// OauthScopes: The set of Google API scopes to be made available on all
// of the node VMs under the "default" service account. The following
// scopes are recommended, but not required, and by default are not
// included: * `https://www.googleapis.com/auth/compute` is required for
// mounting persistent storage on your nodes. *
// `https://www.googleapis.com/auth/devstorage.read_only` is required
// for communicating with *gcr.io*. If unspecified, no scopes are added.
// for communicating with **gcr.io** (the [Google Container
// Registry](/container-registry/)). If unspecified, no scopes are
// added, unless Cloud Logging or Cloud Monitoring are enabled, in which
// case their required scopes will be added.
OauthScopes []string `json:"oauthScopes,omitempty"`
// ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
@ -425,9 +569,13 @@ func (s *NodeConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// Operation: Defines the operation resource. All fields are output
// Operation: This operation resource represents operations that may
// have happened or are happening on the cluster. All fields are output
// only.
type Operation struct {
// Detail: Detailed operation progress, if available.
Detail string `json:"detail,omitempty"`
// Name: The server-assigned ID for the operation.
Name string `json:"name,omitempty"`
@ -440,6 +588,9 @@ type Operation struct {
// "UPGRADE_MASTER"
// "UPGRADE_NODES"
// "REPAIR_CLUSTER"
// "UPDATE_CLUSTER"
// "CREATE_NODE_POOL"
// "DELETE_NODE_POOL"
OperationType string `json:"operationType,omitempty"`
// SelfLink: Server-defined URL for the resource.
@ -470,7 +621,7 @@ type Operation struct {
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Name") to
// ForceSendFields is a list of field names (e.g. "Detail") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -485,9 +636,10 @@ func (s *Operation) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// ServerConfig: Container Engine Server configuration.
// ServerConfig: Container Engine service configuration.
type ServerConfig struct {
// DefaultClusterVersion: What version this server deploys by default.
// DefaultClusterVersion: Version of Kubernetes the service deploys by
// default.
DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
// ValidNodeVersions: List of valid node upgrade target versions.
@ -513,7 +665,8 @@ func (s *ServerConfig) MarshalJSON() ([]byte, error) {
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// UpdateClusterRequest: UpdateClusterRequest updates a cluster.
// UpdateClusterRequest: UpdateClusterRequest updates the settings of a
// cluster.
type UpdateClusterRequest struct {
// Update: A description of the update.
Update *ClusterUpdate `json:"update,omitempty"`
@ -645,13 +798,13 @@ func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*Se
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "zone": {
// "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
// "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for.",
// "location": "path",
// "required": true,
// "type": "string"
@ -680,9 +833,9 @@ type ProjectsZonesClustersCreateCall struct {
}
// Create: Creates a cluster, consisting of the specified number and
// type of Google Compute Engine instances, plus a Kubernetes master
// endpoint. By default, the cluster is created in the project's
// [default network](/compute/docs/networking#networks_1). One firewall
// type of Google Compute Engine instances. By default, the cluster is
// created in the project's [default
// network](/compute/docs/networks-and-firewalls#networks). One firewall
// is added for the cluster. After cluster creation, the cluster creates
// routes for each node to allow the containers on that node to
// communicate with all other instances in the cluster. Finally, an
@ -772,7 +925,7 @@ func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Ope
}
return ret, nil
// {
// "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances, plus a Kubernetes master endpoint. By default, the cluster is created in the project's [default network](/compute/docs/networking#networks_1). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
// "description": "Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster.",
// "httpMethod": "POST",
// "id": "container.projects.zones.clusters.create",
// "parameterOrder": [
@ -781,7 +934,7 @@ func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Ope
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -820,7 +973,10 @@ type ProjectsZonesClustersDeleteCall struct {
// Delete: Deletes the cluster, including the Kubernetes endpoint and
// all worker nodes. Firewalls and routes that were configured during
// cluster creation are also deleted.
// cluster creation are also deleted. Other Google Compute Engine
// resources that might be in use by the cluster (e.g. load balancer
// resources) will not be deleted if they weren't present at the initial
// create time.
func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.projectId = projectId
@ -900,7 +1056,7 @@ func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Ope
}
return ret, nil
// {
// "description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.",
// "description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time.",
// "httpMethod": "DELETE",
// "id": "container.projects.zones.clusters.delete",
// "parameterOrder": [
@ -916,7 +1072,7 @@ func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Ope
// "type": "string"
// },
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -951,7 +1107,7 @@ type ProjectsZonesClustersGetCall struct {
ctx_ context.Context
}
// Get: Gets a specific cluster.
// Get: Gets the details of a specific cluster.
func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.projectId = projectId
@ -1044,7 +1200,7 @@ func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluste
}
return ret, nil
// {
// "description": "Gets a specific cluster.",
// "description": "Gets the details of a specific cluster.",
// "httpMethod": "GET",
// "id": "container.projects.zones.clusters.get",
// "parameterOrder": [
@ -1060,7 +1216,7 @@ func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluste
// "type": "string"
// },
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -1195,7 +1351,7 @@ func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListC
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -1230,7 +1386,7 @@ type ProjectsZonesClustersUpdateCall struct {
ctx_ context.Context
}
// Update: Update settings of a specific cluster.
// Update: Updates the settings of a specific cluster.
func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.projectId = projectId
@ -1317,7 +1473,7 @@ func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Ope
}
return ret, nil
// {
// "description": "Update settings of a specific cluster.",
// "description": "Updates the settings of a specific cluster.",
// "httpMethod": "PUT",
// "id": "container.projects.zones.clusters.update",
// "parameterOrder": [
@ -1333,7 +1489,7 @@ func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Ope
// "type": "string"
// },
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -1480,7 +1636,7 @@ func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Oper
// "type": "string"
// },
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
@ -1615,13 +1771,13 @@ func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*Lis
// ],
// "parameters": {
// "projectId": {
// "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
// "description": "The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840).",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "zone": {
// "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
// "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones.",
// "location": "path",
// "required": true,
// "type": "string"

View File

@ -1,11 +1,11 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zoueaaoAZQGFJohVmI5skQDTvqg\"",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/YvTvEjSR_sXxd8XvUihYx8e9Xjo\"",
"discoveryVersion": "v1",
"id": "dns:v1",
"name": "dns",
"version": "v1",
"revision": "20150729",
"revision": "20160209",
"title": "Google Cloud DNS API",
"description": "The Google Cloud DNS API provides services for configuring and serving authoritative DNS records.",
"ownerDomain": "google.com",
@ -115,7 +115,7 @@
},
"startTime": {
"type": "string",
"description": "The time that this operation was started by the server. This is in RFC3339 text format."
"description": "The time that this operation was started by the server (output only). This is in RFC3339 text format."
},
"status": {
"type": "string",

View File

@ -146,8 +146,8 @@ type Change struct {
// string "dns#change".
Kind string `json:"kind,omitempty"`
// StartTime: The time that this operation was started by the server.
// This is in RFC3339 text format.
// StartTime: The time that this operation was started by the server
// (output only). This is in RFC3339 text format.
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation (output only).

View File

@ -4,31 +4,43 @@
package gensupport
import "time"
import (
"math/rand"
"time"
)
type BackoffStrategy interface {
// Pause returns the duration of the next pause before a retry should be attempted.
Pause() time.Duration
// Pause returns the duration of the next pause and true if the operation should be
// retried, or false if no further retries should be attempted.
Pause() (time.Duration, bool)
// Reset restores the strategy to its initial state.
Reset()
}
// ExponentialBackoff performs exponential backoff as per https://en.wikipedia.org/wiki/Exponential_backoff.
// The initial pause time is given by Base.
// Once the total pause time exceeds Max, Pause will indicate no further retries.
type ExponentialBackoff struct {
BasePause time.Duration
nextPause time.Duration
Base time.Duration
Max time.Duration
total time.Duration
n uint
}
func (eb *ExponentialBackoff) Pause() time.Duration {
if eb.nextPause == 0 {
eb.Reset()
func (eb *ExponentialBackoff) Pause() (time.Duration, bool) {
if eb.total > eb.Max {
return 0, false
}
d := eb.nextPause
eb.nextPause *= 2
return d
// The next pause is selected from randomly from [0, 2^n * Base).
d := time.Duration(rand.Int63n((1 << eb.n) * int64(eb.Base)))
eb.total += d
eb.n++
return d, true
}
func (eb *ExponentialBackoff) Reset() {
eb.nextPause = eb.BasePause
eb.n = 0
eb.total = 0
}

View File

@ -165,7 +165,9 @@ func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, m
func typeHeader(contentType string) textproto.MIMEHeader {
h := make(textproto.MIMEHeader)
h.Set("Content-Type", contentType)
if contentType != "" {
h.Set("Content-Type", contentType)
}
return h
}

View File

@ -16,14 +16,16 @@ import (
)
const (
// statusResumeIncomplete is the code returned by the Google uploader when the transfer is not yet complete.
// statusResumeIncomplete is the code returned by the Google uploader
// when the transfer is not yet complete.
statusResumeIncomplete = 308
)
// DefaultBackoffStrategy returns a default strategy to use for retrying failed upload requests.
func DefaultBackoffStrategy() BackoffStrategy {
return &ExponentialBackoff{BasePause: time.Second}
}
// statusTooManyRequests is returned by the storage API if the
// per-project limits have been temporarily exceeded. The request
// should be retried.
// https://cloud.google.com/storage/docs/json_api/v1/status-codes#standardcodes
statusTooManyRequests = 429
)
// ResumableUpload is used by the generated APIs to provide resumable uploads.
// It is not used by developers directly.
@ -130,7 +132,8 @@ func contextDone(ctx context.Context) bool {
}
// Upload starts the process of a resumable upload with a cancellable context.
// It retries indefinitely (using exponential backoff) until cancelled.
// It retries using the provided back off strategy until cancelled or the
// strategy indicates to stop retrying.
// It is called from the auto-generated API code and is not visible to the user.
// rx is private to the auto-generated API code.
// Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close.
@ -153,6 +156,33 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
}
resp, err = rx.transferChunk(ctx)
var status int
if resp != nil {
status = resp.StatusCode
}
// Check if we should retry the request.
if shouldRetry(status, err) {
var retry bool
pause, retry = backoff.Pause()
if retry {
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
continue
}
}
// If the chunk was uploaded successfully, but there's still
// more to go, upload the next chunk without any delay.
if status == statusResumeIncomplete {
pause = 0
backoff.Reset()
resp.Body.Close()
continue
}
// It's possible for err and resp to both be non-nil here, but we expose a simpler
// contract to our callers: exactly one of resp and err will be non-nil. This means
// that any response body must be closed here before returning a non-nil error.
@ -162,16 +192,7 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
}
return nil, err
}
if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusOK {
return resp, nil
}
resp.Body.Close()
if resp.StatusCode == statusResumeIncomplete {
pause = 0
backoff.Reset()
} else {
pause = backoff.Pause()
}
return resp, nil
}
}

77
vendor/google.golang.org/api/gensupport/retry.go generated vendored Normal file
View File

@ -0,0 +1,77 @@
package gensupport
import (
"io"
"net"
"net/http"
"time"
"golang.org/x/net/context"
)
// Retry invokes the given function, retrying it multiple times if the connection failed or
// the HTTP status response indicates the request should be attempted again. ctx may be nil.
func Retry(ctx context.Context, f func() (*http.Response, error), backoff BackoffStrategy) (*http.Response, error) {
for {
resp, err := f()
var status int
if resp != nil {
status = resp.StatusCode
}
// Return if we shouldn't retry.
pause, retry := backoff.Pause()
if !shouldRetry(status, err) || !retry {
return resp, err
}
// Ensure the response body is closed, if any.
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
// Pause, but still listen to ctx.Done if context is not nil.
var done <-chan struct{}
if ctx != nil {
done = ctx.Done()
}
select {
case <-done:
return nil, ctx.Err()
case <-time.After(pause):
}
}
}
// DefaultBackoffStrategy returns a default strategy to use for retrying failed upload requests.
func DefaultBackoffStrategy() BackoffStrategy {
return &ExponentialBackoff{
Base: 250 * time.Millisecond,
Max: 16 * time.Second,
}
}
// shouldRetry returns true if the HTTP response / error indicates that the
// request should be attempted again.
func shouldRetry(status int, err error) bool {
// Retry for 5xx response codes.
if 500 <= status && status < 600 {
return true
}
// Retry on statusTooManyRequests{
if status == statusTooManyRequests {
return true
}
// Retry on unexpected EOFs and temporary network errors.
if err == io.ErrUnexpectedEOF {
return true
}
if err, ok := err.(net.Error); ok {
return err.Temporary()
}
return false
}

View File

@ -220,9 +220,13 @@ type contentTypeOption string
func (ct contentTypeOption) setOptions(o *MediaOptions) {
o.ContentType = string(ct)
if o.ContentType == "" {
o.ForceEmptyContentType = true
}
}
// ContentType returns a MediaOption which sets the content type of data to be uploaded.
// ContentType returns a MediaOption which sets the Content-Type header for media uploads.
// If ctype is empty, the Content-Type header will be omitted.
func ContentType(ctype string) MediaOption {
return contentTypeOption(ctype)
}
@ -248,8 +252,10 @@ func ChunkSize(size int) MediaOption {
// MediaOptions stores options for customizing media upload. It is not used by developers directly.
type MediaOptions struct {
ContentType string
ChunkSize int
ContentType string
ForceEmptyContentType bool
ChunkSize int
}
// ProcessMediaOptions stores options from opts in a MediaOptions.

View File

@ -2,26 +2,15 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package uritemplates is a level 4 implementation of RFC 6570 (URI
// Package uritemplates is a level 3 implementation of RFC 6570 (URI
// Template, http://tools.ietf.org/html/rfc6570).
//
// To use uritemplates, parse a template string and expand it with a value
// map:
//
// template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}")
// values := make(map[string]interface{})
// values["user"] = "jtacoma"
// values["repo"] = "uritemplates"
// expanded, _ := template.ExpandString(values)
// fmt.Printf(expanded)
//
// uritemplates does not support composite values (in Go: slices or maps)
// and so does not qualify as a level 4 implementation.
package uritemplates
import (
"bytes"
"errors"
"fmt"
"reflect"
"regexp"
"strconv"
"strings"
@ -45,52 +34,47 @@ func pctEncode(src []byte) []byte {
return dst
}
func escape(s string, allowReserved bool) (escaped string) {
func escape(s string, allowReserved bool) string {
if allowReserved {
escaped = string(reserved.ReplaceAllFunc([]byte(s), pctEncode))
} else {
escaped = string(unreserved.ReplaceAllFunc([]byte(s), pctEncode))
return string(reserved.ReplaceAllFunc([]byte(s), pctEncode))
}
return escaped
return string(unreserved.ReplaceAllFunc([]byte(s), pctEncode))
}
// A UriTemplate is a parsed representation of a URI template.
type UriTemplate struct {
// A uriTemplate is a parsed representation of a URI template.
type uriTemplate struct {
raw string
parts []templatePart
}
// Parse parses a URI template string into a UriTemplate object.
func Parse(rawtemplate string) (template *UriTemplate, err error) {
template = new(UriTemplate)
template.raw = rawtemplate
split := strings.Split(rawtemplate, "{")
template.parts = make([]templatePart, len(split)*2-1)
// parse parses a URI template string into a uriTemplate object.
func parse(rawTemplate string) (*uriTemplate, error) {
split := strings.Split(rawTemplate, "{")
parts := make([]templatePart, len(split)*2-1)
for i, s := range split {
if i == 0 {
if strings.Contains(s, "}") {
err = errors.New("unexpected }")
break
return nil, errors.New("unexpected }")
}
template.parts[i].raw = s
} else {
subsplit := strings.Split(s, "}")
if len(subsplit) != 2 {
err = errors.New("malformed template")
break
}
expression := subsplit[0]
template.parts[i*2-1], err = parseExpression(expression)
if err != nil {
break
}
template.parts[i*2].raw = subsplit[1]
parts[i].raw = s
continue
}
subsplit := strings.Split(s, "}")
if len(subsplit) != 2 {
return nil, errors.New("malformed template")
}
expression := subsplit[0]
var err error
parts[i*2-1], err = parseExpression(expression)
if err != nil {
return nil, err
}
parts[i*2].raw = subsplit[1]
}
if err != nil {
template = nil
}
return template, err
return &uriTemplate{
raw: rawTemplate,
parts: parts,
}, nil
}
type templatePart struct {
@ -160,6 +144,8 @@ func parseExpression(expression string) (result templatePart, err error) {
}
func parseTerm(term string) (result templateTerm, err error) {
// TODO(djd): Remove "*" suffix parsing once we check that no APIs have
// mistakenly used that attribute.
if strings.HasSuffix(term, "*") {
result.explode = true
term = term[:len(term)-1]
@ -185,175 +171,50 @@ func parseTerm(term string) (result templateTerm, err error) {
}
// Expand expands a URI template with a set of values to produce a string.
func (self *UriTemplate) Expand(value interface{}) (string, error) {
values, ismap := value.(map[string]interface{})
if !ismap {
if m, ismap := struct2map(value); !ismap {
return "", errors.New("expected map[string]interface{}, struct, or pointer to struct.")
} else {
return self.Expand(m)
}
}
func (t *uriTemplate) Expand(values map[string]string) string {
var buf bytes.Buffer
for _, p := range self.parts {
err := p.expand(&buf, values)
if err != nil {
return "", err
}
for _, p := range t.parts {
p.expand(&buf, values)
}
return buf.String(), nil
return buf.String()
}
func (self *templatePart) expand(buf *bytes.Buffer, values map[string]interface{}) error {
if len(self.raw) > 0 {
buf.WriteString(self.raw)
return nil
func (tp *templatePart) expand(buf *bytes.Buffer, values map[string]string) {
if len(tp.raw) > 0 {
buf.WriteString(tp.raw)
return
}
var zeroLen = buf.Len()
buf.WriteString(self.first)
var firstLen = buf.Len()
for _, term := range self.terms {
var first = true
for _, term := range tp.terms {
value, exists := values[term.name]
if !exists {
continue
}
if buf.Len() != firstLen {
buf.WriteString(self.sep)
}
switch v := value.(type) {
case string:
self.expandString(buf, term, v)
case []interface{}:
self.expandArray(buf, term, v)
case map[string]interface{}:
if term.truncate > 0 {
return errors.New("cannot truncate a map expansion")
}
self.expandMap(buf, term, v)
default:
if m, ismap := struct2map(value); ismap {
if term.truncate > 0 {
return errors.New("cannot truncate a map expansion")
}
self.expandMap(buf, term, m)
} else {
str := fmt.Sprintf("%v", value)
self.expandString(buf, term, str)
}
if first {
buf.WriteString(tp.first)
first = false
} else {
buf.WriteString(tp.sep)
}
tp.expandString(buf, term, value)
}
if buf.Len() == firstLen {
original := buf.Bytes()[:zeroLen]
buf.Reset()
buf.Write(original)
}
return nil
}
func (self *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) {
if self.named {
func (tp *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) {
if tp.named {
buf.WriteString(name)
if empty {
buf.WriteString(self.ifemp)
buf.WriteString(tp.ifemp)
} else {
buf.WriteString("=")
}
}
}
func (self *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) {
func (tp *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) {
if len(s) > t.truncate && t.truncate > 0 {
s = s[:t.truncate]
}
self.expandName(buf, t.name, len(s) == 0)
buf.WriteString(escape(s, self.allowReserved))
}
func (self *templatePart) expandArray(buf *bytes.Buffer, t templateTerm, a []interface{}) {
if len(a) == 0 {
return
} else if !t.explode {
self.expandName(buf, t.name, false)
}
for i, value := range a {
if t.explode && i > 0 {
buf.WriteString(self.sep)
} else if i > 0 {
buf.WriteString(",")
}
var s string
switch v := value.(type) {
case string:
s = v
default:
s = fmt.Sprintf("%v", v)
}
if len(s) > t.truncate && t.truncate > 0 {
s = s[:t.truncate]
}
if self.named && t.explode {
self.expandName(buf, t.name, len(s) == 0)
}
buf.WriteString(escape(s, self.allowReserved))
}
}
func (self *templatePart) expandMap(buf *bytes.Buffer, t templateTerm, m map[string]interface{}) {
if len(m) == 0 {
return
}
if !t.explode {
self.expandName(buf, t.name, len(m) == 0)
}
var firstLen = buf.Len()
for k, value := range m {
if firstLen != buf.Len() {
if t.explode {
buf.WriteString(self.sep)
} else {
buf.WriteString(",")
}
}
var s string
switch v := value.(type) {
case string:
s = v
default:
s = fmt.Sprintf("%v", v)
}
if t.explode {
buf.WriteString(escape(k, self.allowReserved))
buf.WriteRune('=')
buf.WriteString(escape(s, self.allowReserved))
} else {
buf.WriteString(escape(k, self.allowReserved))
buf.WriteRune(',')
buf.WriteString(escape(s, self.allowReserved))
}
}
}
func struct2map(v interface{}) (map[string]interface{}, bool) {
value := reflect.ValueOf(v)
switch value.Type().Kind() {
case reflect.Ptr:
return struct2map(value.Elem().Interface())
case reflect.Struct:
m := make(map[string]interface{})
for i := 0; i < value.NumField(); i++ {
tag := value.Type().Field(i).Tag
var name string
if strings.Contains(string(tag), ":") {
name = tag.Get("uri")
} else {
name = strings.TrimSpace(string(tag))
}
if len(name) == 0 {
name = value.Type().Field(i).Name
}
m[name] = value.Field(i).Interface()
}
return m, true
}
return nil, false
tp.expandName(buf, t.name, len(s) == 0)
buf.WriteString(escape(s, tp.allowReserved))
}

View File

@ -1,13 +1,13 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uritemplates
func Expand(path string, expansions map[string]string) (string, error) {
template, err := Parse(path)
func Expand(path string, values map[string]string) (string, error) {
template, err := parse(path)
if err != nil {
return "", err
}
values := make(map[string]interface{})
for k, v := range expansions {
values[k] = v
}
return template.Expand(values)
return template.Expand(values), nil
}

View File

@ -1,12 +1,12 @@
{
"kind": "discovery#restDescription",
"etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/CCmkz9wJbxqIZMDlSyPUsI6BFWQ\"",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/OLx7eYKI1NQCi-ys96oQ7ZJUHE8\"",
"discoveryVersion": "v1",
"id": "sqladmin:v1beta4",
"name": "sqladmin",
"canonicalName": "SQL Admin",
"version": "v1beta4",
"revision": "20151117",
"revision": "20160222",
"title": "Cloud SQL Administration API",
"description": "API for Cloud SQL database instance management.",
"ownerDomain": "google.com",
@ -321,14 +321,18 @@
"type": "object",
"description": "A Cloud SQL instance resource.",
"properties": {
"backendType": {
"type": "string",
"description": "FIRST_GEN: Basic Cloud SQL instance that runs in a Google-managed container.\nSECOND_GEN: A newer Cloud SQL backend that runs in a Compute Engine VM.\nEXTERNAL: A MySQL server that is not managed by Google."
},
"currentDiskSize": {
"type": "string",
"description": "The current disk usage of the instance in bytes.",
"description": "The current disk usage of the instance in bytes. This property has been deprecated. Users should use the \"cloudsql.googleapis.com/database/disk/bytes_used\" metric in Cloud Monitoring API instead. Please see https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ for details.",
"format": "int64"
},
"databaseVersion": {
"type": "string",
"description": "The database engine type and version. Can be MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion can not be changed after instance creation."
"description": "The database engine type and version. Can be MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_6. The databaseVersion can not be changed after instance creation."
},
"etag": {
"type": "string",
@ -336,13 +340,15 @@
},
"failoverReplica": {
"type": "object",
"description": "The name and status of the failover replica. Only applies to Second Generation instances.",
"description": "The name and status of the failover replica. This property is applicable only to Second Generation instances.",
"properties": {
"available": {
"type": "boolean"
"type": "boolean",
"description": "The availability status of the failover replica. A false status indicates that the failover replica is out of sync. The master can only failover to the falover replica when the status is true."
},
"name": {
"type": "string"
"type": "string",
"description": "The name of the failover replica."
}
}
},
@ -359,7 +365,7 @@
},
"ipv6Address": {
"type": "string",
"description": "The IPv6 address assigned to the instance."
"description": "The IPv6 address assigned to the instance. This property is applicable only to First Generation instances."
},
"kind": {
"type": "string",
@ -394,7 +400,7 @@
},
"region": {
"type": "string",
"description": "The geographical region. Can be us-central, asia-east1 or europe-west1. Defaults to us-central. The region can not be changed after instance creation."
"description": "The geographical region. Can be us-central (FIRST_GEN instances only), us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. Defaults to us-central or us-central1 depending on the instance type (First Generation or Second Generation). The region can not be changed after instance creation."
},
"replicaConfiguration": {
"$ref": "ReplicaConfiguration",
@ -417,7 +423,7 @@
},
"serviceAccountEmailAddress": {
"type": "string",
"description": "The service account email address assigned to the instance."
"description": "The service account email address assigned to the instance. This property is applicable only to Second Generation instances."
},
"settings": {
"$ref": "Settings",
@ -432,6 +438,13 @@
"state": {
"type": "string",
"description": "The current serving state of the Cloud SQL instance. This can be one of the following.\nRUNNABLE: The instance is running, or is ready to run when accessed.\nSUSPENDED: The instance is not available, for example due to problems with billing.\nPENDING_CREATE: The instance is being created.\nMAINTENANCE: The instance is down for maintenance.\nFAILED: The instance creation failed.\nUNKNOWN_STATE: The state of the instance is unknown."
},
"suspensionReason": {
"type": "array",
"description": "If the instance state is SUSPENDED, the reason for the suspension.",
"items": {
"type": "string"
}
}
}
},
@ -1050,11 +1063,11 @@
"properties": {
"activationPolicy": {
"type": "string",
"description": "The activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is RUNNABLE. This can be one of the following.\nALWAYS: The instance should always be active.\nNEVER: The instance should never be activated.\nON_DEMAND: The instance is activated upon receiving requests."
"description": "The activation policy for this instance. This specifies when the instance should be activated and is applicable only when the instance state is RUNNABLE. This can be one of the following.\nALWAYS: The instance should always be active.\nNEVER: The instance should never be activated.\nON_DEMAND: The instance is activated upon receiving requests; only applicable to First Generation instances."
},
"authorizedGaeApplications": {
"type": "array",
"description": "The App Engine app IDs that can access this instance.",
"description": "The App Engine app IDs that can access this instance. This property is only applicable to First Generation instances.",
"items": {
"type": "string"
}
@ -1065,16 +1078,16 @@
},
"crashSafeReplicationEnabled": {
"type": "boolean",
"description": "Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled."
"description": "Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances."
},
"dataDiskSizeGb": {
"type": "string",
"description": "The size of data disk, in GB. Only supported for 2nd Generation instances. The data disk size minimum is 10GB.",
"description": "The size of data disk, in GB. The data disk size minimum is 10GB. This property is only applicable to Second Generation instances.",
"format": "int64"
},
"dataDiskType": {
"type": "string",
"description": "The type of data disk. Only supported for 2nd Generation instances. The default type is SSD."
"description": "The type of data disk. Only supported for Second Generation instances. The default type is PD_SSD. This property is only applicable to Second Generation instances."
},
"databaseFlags": {
"type": "array",
@ -1089,7 +1102,7 @@
},
"ipConfiguration": {
"$ref": "IpConfiguration",
"description": "The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance."
"description": "The settings for IP Management. This allows to enable or disable the instance IP and manage which external networks can connect to the instance. The IPv4 address cannot be disabled for Second Generation instances."
},
"kind": {
"type": "string",
@ -1098,19 +1111,19 @@
},
"locationPreference": {
"$ref": "LocationPreference",
"description": "The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or GCE zone for better performance."
"description": "The location preference settings. This allows the instance to be located as near as possible to either an App Engine app or GCE zone for better performance. App Engine co-location is only applicable to First Generation instances."
},
"maintenanceWindow": {
"$ref": "MaintenanceWindow",
"description": "The maintenance window for this instance. This specifies when the instance may be restarted for maintenance purposes."
"description": "The maintenance window for this instance. This specifies when the instance may be restarted for maintenance purposes. This property is only applicable to Second Generation instances."
},
"pricingPlan": {
"type": "string",
"description": "The pricing plan for this instance. This can be either PER_USE or PACKAGE."
"description": "The pricing plan for this instance. This can be either PER_USE or PACKAGE. Only PER_USE is supported for Second Generation instances."
},
"replicationType": {
"type": "string",
"description": "The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS."
"description": "The type of replication this instance uses. This can be either ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First Generation instances."
},
"settingsVersion": {
"type": "string",
@ -1319,7 +1332,7 @@
},
"host": {
"type": "string",
"description": "The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name is not mutable with this API."
"description": "The host name from which the user can connect. For insert operations, host defaults to an empty string. For update operations, host is specified as part of the request URL. The host name cannot be updated after insertion."
},
"instance": {
"type": "string",
@ -1499,7 +1512,7 @@
"id": "sql.databases.delete",
"path": "projects/{project}/instances/{instance}/databases/{database}",
"httpMethod": "DELETE",
"description": "Deletes a resource containing information about a database inside a Cloud SQL instance.",
"description": "Deletes a database from a Cloud SQL instance.",
"parameters": {
"database": {
"type": "string",
@ -1743,7 +1756,7 @@
"id": "sql.instances.clone",
"path": "projects/{project}/instances/{instance}/clone",
"httpMethod": "POST",
"description": "Creates a Cloud SQL instance as a clone of the source instance.",
"description": "Creates a Cloud SQL instance as a clone of the source instance. The API is not ready for Second Generation instances yet.",
"parameters": {
"instance": {
"type": "string",

View File

@ -459,19 +459,31 @@ func (s *DatabaseFlags) MarshalJSON() ([]byte, error) {
// DatabaseInstance: A Cloud SQL instance resource.
type DatabaseInstance struct {
// BackendType: FIRST_GEN: Basic Cloud SQL instance that runs in a
// Google-managed container.
// SECOND_GEN: A newer Cloud SQL backend that runs in a Compute Engine
// VM.
// EXTERNAL: A MySQL server that is not managed by Google.
BackendType string `json:"backendType,omitempty"`
// CurrentDiskSize: The current disk usage of the instance in bytes.
// This property has been deprecated. Users should use the
// "cloudsql.googleapis.com/database/disk/bytes_used" metric in Cloud
// Monitoring API instead. Please see
// https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ for
// details.
CurrentDiskSize int64 `json:"currentDiskSize,omitempty,string"`
// DatabaseVersion: The database engine type and version. Can be
// MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_5. The databaseVersion
// MYSQL_5_5 or MYSQL_5_6. Defaults to MYSQL_5_6. The databaseVersion
// can not be changed after instance creation.
DatabaseVersion string `json:"databaseVersion,omitempty"`
// Etag: HTTP 1.1 Entity tag for the resource.
Etag string `json:"etag,omitempty"`
// FailoverReplica: The name and status of the failover replica. Only
// applies to Second Generation instances.
// FailoverReplica: The name and status of the failover replica. This
// property is applicable only to Second Generation instances.
FailoverReplica *DatabaseInstanceFailoverReplica `json:"failoverReplica,omitempty"`
// InstanceType: The instance type. This can be one of the
@ -487,7 +499,8 @@ type DatabaseInstance struct {
// IpAddresses: The assigned IP addresses for the instance.
IpAddresses []*IpMapping `json:"ipAddresses,omitempty"`
// Ipv6Address: The IPv6 address assigned to the instance.
// Ipv6Address: The IPv6 address assigned to the instance. This property
// is applicable only to First Generation instances.
Ipv6Address string `json:"ipv6Address,omitempty"`
// Kind: This is always sql#instance.
@ -512,9 +525,11 @@ type DatabaseInstance struct {
// instance. The Google apps domain is prefixed if applicable.
Project string `json:"project,omitempty"`
// Region: The geographical region. Can be us-central, asia-east1 or
// europe-west1. Defaults to us-central. The region can not be changed
// after instance creation.
// Region: The geographical region. Can be us-central (FIRST_GEN
// instances only), us-central1 (SECOND_GEN instances only), asia-east1
// or europe-west1. Defaults to us-central or us-central1 depending on
// the instance type (First Generation or Second Generation). The region
// can not be changed after instance creation.
Region string `json:"region,omitempty"`
// ReplicaConfiguration: Configuration specific to read-replicas
@ -531,7 +546,8 @@ type DatabaseInstance struct {
ServerCaCert *SslCert `json:"serverCaCert,omitempty"`
// ServiceAccountEmailAddress: The service account email address
// assigned to the instance.
// assigned to the instance. This property is applicable only to Second
// Generation instances.
ServiceAccountEmailAddress string `json:"serviceAccountEmailAddress,omitempty"`
// Settings: The user settings.
@ -549,11 +565,15 @@ type DatabaseInstance struct {
// UNKNOWN_STATE: The state of the instance is unknown.
State string `json:"state,omitempty"`
// SuspensionReason: If the instance state is SUSPENDED, the reason for
// the suspension.
SuspensionReason []string `json:"suspensionReason,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CurrentDiskSize") to
// ForceSendFields is a list of field names (e.g. "BackendType") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
@ -569,10 +589,15 @@ func (s *DatabaseInstance) MarshalJSON() ([]byte, error) {
}
// DatabaseInstanceFailoverReplica: The name and status of the failover
// replica. Only applies to Second Generation instances.
// replica. This property is applicable only to Second Generation
// instances.
type DatabaseInstanceFailoverReplica struct {
// Available: The availability status of the failover replica. A false
// status indicates that the failover replica is out of sync. The master
// can only failover to the falover replica when the status is true.
Available bool `json:"available,omitempty"`
// Name: The name of the failover replica.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Available") to
@ -1443,11 +1468,13 @@ type Settings struct {
// following.
// ALWAYS: The instance should always be active.
// NEVER: The instance should never be activated.
// ON_DEMAND: The instance is activated upon receiving requests.
// ON_DEMAND: The instance is activated upon receiving requests; only
// applicable to First Generation instances.
ActivationPolicy string `json:"activationPolicy,omitempty"`
// AuthorizedGaeApplications: The App Engine app IDs that can access
// this instance.
// this instance. This property is only applicable to First Generation
// instances.
AuthorizedGaeApplications []string `json:"authorizedGaeApplications,omitempty"`
// BackupConfiguration: The daily backup configuration for the instance.
@ -1455,15 +1482,18 @@ type Settings struct {
// CrashSafeReplicationEnabled: Configuration specific to read replica
// instances. Indicates whether database flags for crash-safe
// replication are enabled.
// replication are enabled. This property is only applicable to First
// Generation instances.
CrashSafeReplicationEnabled bool `json:"crashSafeReplicationEnabled,omitempty"`
// DataDiskSizeGb: The size of data disk, in GB. Only supported for 2nd
// Generation instances. The data disk size minimum is 10GB.
// DataDiskSizeGb: The size of data disk, in GB. The data disk size
// minimum is 10GB. This property is only applicable to Second
// Generation instances.
DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
// DataDiskType: The type of data disk. Only supported for 2nd
// Generation instances. The default type is SSD.
// DataDiskType: The type of data disk. Only supported for Second
// Generation instances. The default type is PD_SSD. This property is
// only applicable to Second Generation instances.
DataDiskType string `json:"dataDiskType,omitempty"`
// DatabaseFlags: The database flags passed to the instance at startup.
@ -1475,7 +1505,8 @@ type Settings struct {
// IpConfiguration: The settings for IP Management. This allows to
// enable or disable the instance IP and manage which external networks
// can connect to the instance.
// can connect to the instance. The IPv4 address cannot be disabled for
// Second Generation instances.
IpConfiguration *IpConfiguration `json:"ipConfiguration,omitempty"`
// Kind: This is always sql#settings.
@ -1483,20 +1514,24 @@ type Settings struct {
// LocationPreference: The location preference settings. This allows the
// instance to be located as near as possible to either an App Engine
// app or GCE zone for better performance.
// app or GCE zone for better performance. App Engine co-location is
// only applicable to First Generation instances.
LocationPreference *LocationPreference `json:"locationPreference,omitempty"`
// MaintenanceWindow: The maintenance window for this instance. This
// specifies when the instance may be restarted for maintenance
// purposes.
// purposes. This property is only applicable to Second Generation
// instances.
MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"`
// PricingPlan: The pricing plan for this instance. This can be either
// PER_USE or PACKAGE.
// PER_USE or PACKAGE. Only PER_USE is supported for Second Generation
// instances.
PricingPlan string `json:"pricingPlan,omitempty"`
// ReplicationType: The type of replication this instance uses. This can
// be either ASYNCHRONOUS or SYNCHRONOUS.
// be either ASYNCHRONOUS or SYNCHRONOUS. This property is only
// applicable to First Generation instances.
ReplicationType string `json:"replicationType,omitempty"`
// SettingsVersion: The version of instance settings. This is a required
@ -1770,8 +1805,8 @@ type User struct {
// Host: The host name from which the user can connect. For insert
// operations, host defaults to an empty string. For update operations,
// host is specified as part of the request URL. The host name is not
// mutable with this API.
// host is specified as part of the request URL. The host name cannot be
// updated after insertion.
Host string `json:"host,omitempty"`
// Instance: The name of the Cloud SQL instance. This does not include
@ -2314,8 +2349,7 @@ type DatabasesDeleteCall struct {
ctx_ context.Context
}
// Delete: Deletes a resource containing information about a database
// inside a Cloud SQL instance.
// Delete: Deletes a database from a Cloud SQL instance.
func (r *DatabasesService) Delete(project string, instance string, database string) *DatabasesDeleteCall {
c := &DatabasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
@ -2395,7 +2429,7 @@ func (c *DatabasesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, erro
}
return ret, nil
// {
// "description": "Deletes a resource containing information about a database inside a Cloud SQL instance.",
// "description": "Deletes a database from a Cloud SQL instance.",
// "httpMethod": "DELETE",
// "id": "sql.databases.delete",
// "parameterOrder": [
@ -3258,7 +3292,7 @@ type InstancesCloneCall struct {
}
// Clone: Creates a Cloud SQL instance as a clone of the source
// instance.
// instance. The API is not ready for Second Generation instances yet.
func (r *InstancesService) Clone(project string, instance string, instancesclonerequest *InstancesCloneRequest) *InstancesCloneCall {
c := &InstancesCloneCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.project = project
@ -3343,7 +3377,7 @@ func (c *InstancesCloneCall) Do(opts ...googleapi.CallOption) (*Operation, error
}
return ret, nil
// {
// "description": "Creates a Cloud SQL instance as a clone of the source instance.",
// "description": "Creates a Cloud SQL instance as a clone of the source instance. The API is not ready for Second Generation instances yet.",
// "httpMethod": "POST",
// "id": "sql.instances.clone",
// "parameterOrder": [

View File

@ -1,13 +1,13 @@
{
"kind": "discovery#restDescription",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/obxe7w0FjJgGPQFNs6hMClVbJfI\"",
"etag": "\"bRFOOrZKfO9LweMbPqu0kcu6De8/KVPQfwGxQTBtH0g1kuij0C9i4uc\"",
"discoveryVersion": "v1",
"id": "storage:v1",
"name": "storage",
"version": "v1",
"revision": "20160121",
"revision": "20160304",
"title": "Cloud Storage JSON API",
"description": "Lets you store and retrieve potentially-large, immutable data objects.",
"description": "Stores and retrieves potentially large, immutable data objects.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {

View File

@ -5993,18 +5993,29 @@ func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
return c
}
// Media specifies the media to upload in a single chunk. At most one of
// Media and ResumableMedia may be set.
// Media specifies the media to upload in one or more chunks. The chunk
// size may be controlled by supplying a MediaOption generated by
// googleapi.ChunkSize. The chunk size defaults to
// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
// upload request will be determined by sniffing the contents of r,
// unless a MediaOption generated by googleapi.ContentType is
// supplied.
// At most one of Media and ResumableMedia may be set.
func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
opts := googleapi.ProcessMediaOptions(options)
chunkSize := opts.ChunkSize
r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
if !opts.ForceEmptyContentType {
r, c.mediaType_ = gensupport.DetermineContentType(r, opts.ContentType)
}
c.media_, c.resumableBuffer_ = gensupport.PrepareUpload(r, chunkSize)
return c
}
// ResumableMedia specifies the media to upload in chunks and can be
// canceled with ctx. ResumableMedia is deprecated in favour of Media.
// canceled with ctx.
//
// Deprecated: use Media instead.
//
// At most one of Media and ResumableMedia may be set. mediaType
// identifies the MIME media type of the upload, such as "image/png". If
// mediaType is "", it will be auto-detected. The provided ctx will
@ -6074,7 +6085,7 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
googleapi.Expand(req.URL, map[string]string{
"bucket": c.bucket,
})
if c.resumableBuffer_ != nil {
if c.resumableBuffer_ != nil && c.mediaType_ != "" {
req.Header.Set("X-Upload-Content-Type", c.mediaType_)
}
req.Header.Set("Content-Type", ctype)
@ -6094,7 +6105,9 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
// was returned.
func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
res, err := gensupport.Retry(c.ctx_, func() (*http.Response, error) {
return c.doRequest("json")
}, gensupport.DefaultBackoffStrategy())
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
@ -6134,6 +6147,9 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
return nil, err
}
defer res.Body.Close()
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
}
ret := &Object{
ServerResponse: googleapi.ServerResponse{

View File

@ -50,6 +50,7 @@ resource "google_container_cluster" "primary" {
* `zone` - (Required) The zone that all resources should be created in.
- - -
* `addons_config` - (Optional) The configuration for addons supported by Google Container Engine
* `cluster_ipv4_cidr` - (Optional) The IP address range of the container pods in
this cluster. Default is an automatically assigned CIDR.
@ -78,6 +79,8 @@ resource "google_container_cluster" "primary" {
* `project` - (Optional) The project in which the resource belongs. If it
is not provided, the provider project is used.
* `subnetwork` - (Optional) The name of the Google Compute Engine subnetwork in which the cluster's instances are launched
**Master Auth** supports the following arguments:
* `password` - The password to use for HTTP basic authentication when accessing
@ -103,6 +106,23 @@ resource "google_container_cluster" "primary" {
* `https://www.googleapis.com/auth/logging.write` (if `logging_service` points to Google)
* `https://www.googleapis.com/auth/monitoring` (if `monitoring_service` points to Google)
**Addons Config** supports the following addons:
* `http_load_balancing` - (Optional) The status of the HTTP Load Balancing addon. It is enabled by default; set `disabled = true` to disable.
* `horizontal_pod_autoscaling` - (Optional) The status of the Horizontal Pod Autoscaling addon. It is enabled by default; set `disabled = true` to disable.
This example `addons_config` disables both addons:
```
addons_config {
http_load_balancing {
disabled = false
}
horizontal_pod_autoscaling {
disabled = false
}
}
```
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are