container-gen.go 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639
  1. // Package container provides access to the Google Container Engine API.
  2. //
  3. // See https://cloud.google.com/container-engine/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/container/v1"
  8. // ...
  9. // containerService, err := container.New(oauthHttpClient)
  10. package container // import "google.golang.org/api/container/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "container:v1"
  41. const apiName = "container"
  42. const apiVersion = "v1"
  43. const basePath = "https://container.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Projects = NewProjectsService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Zones = NewProjectsZonesService(s)
  72. return rs
  73. }
  74. type ProjectsService struct {
  75. s *Service
  76. Zones *ProjectsZonesService
  77. }
  78. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  79. rs := &ProjectsZonesService{s: s}
  80. rs.Clusters = NewProjectsZonesClustersService(s)
  81. rs.Operations = NewProjectsZonesOperationsService(s)
  82. return rs
  83. }
  84. type ProjectsZonesService struct {
  85. s *Service
  86. Clusters *ProjectsZonesClustersService
  87. Operations *ProjectsZonesOperationsService
  88. }
  89. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  90. rs := &ProjectsZonesClustersService{s: s}
  91. return rs
  92. }
  93. type ProjectsZonesClustersService struct {
  94. s *Service
  95. }
  96. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  97. rs := &ProjectsZonesOperationsService{s: s}
  98. return rs
  99. }
  100. type ProjectsZonesOperationsService struct {
  101. s *Service
  102. }
  103. // Cluster: A Google Container Engine cluster.
  104. type Cluster struct {
  105. // ClusterIpv4Cidr: The IP address range of the container pods in this
  106. // cluster, in
  107. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  108. // notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically
  109. // chosen or specify a `/14` block in `10.0.0.0/8`.
  110. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  111. // CreateTime: [Output only] The time the cluster was created, in
  112. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  113. CreateTime string `json:"createTime,omitempty"`
  114. // CurrentMasterVersion: [Output only] The current software version of
  115. // the master endpoint.
  116. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  117. // CurrentNodeVersion: [Output only] The current version of the node
  118. // software components. If they are currently at different versions
  119. // because they're in the process of being upgraded, this reflects the
  120. // minimum version of any of them.
  121. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  122. // Description: An optional description of this cluster.
  123. Description string `json:"description,omitempty"`
  124. // Endpoint: [Output only] The IP address of this cluster's Kubernetes
  125. // master endpoint. The endpoint can be accessed from the internet at
  126. // `https://username:password@endpoint/`. See the `masterAuth` property
  127. // of this resource for username and password information.
  128. Endpoint string `json:"endpoint,omitempty"`
  129. // InitialClusterVersion: [Output only] The software version of
  130. // Kubernetes master and kubelets used in the cluster when it was first
  131. // created. The version can be upgraded over time.
  132. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  133. // InitialNodeCount: The number of nodes to create in this cluster. You
  134. // must ensure that your Compute Engine [resource
  135. // quota](/compute/docs/resource-quotas) is sufficient for this number
  136. // of instances. You must also have available firewall and routes quota.
  137. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  138. // InstanceGroupUrls: [Output only] The resource URLs of [instance
  139. // groups](/compute/docs/instance-groups/) associated with this cluster.
  140. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  141. // LoggingService: The logging service that the cluster should write
  142. // logs to. Currently available options: * "logging.googleapis.com" -
  143. // the Google Cloud Logging service * "none" - no logs will be exported
  144. // from the cluster * "" - default value; the default is
  145. // "logging.googleapis.com"
  146. LoggingService string `json:"loggingService,omitempty"`
  147. // MasterAuth: The authentication information for accessing the master.
  148. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  149. // MonitoringService: The monitoring service that the cluster should
  150. // write metrics to. Currently available options: *
  151. // "monitoring.googleapis.com" - the Google Cloud Monitoring service *
  152. // "none" - no metrics will be exported from the cluster * "" - default
  153. // value; the default is "monitoring.googleapis.com"
  154. MonitoringService string `json:"monitoringService,omitempty"`
  155. // Name: The name of this cluster. The name must be unique within this
  156. // project and zone, and can be up to 40 characters with the following
  157. // restrictions: * Lowercase letters, numbers, and hyphens only. * Must
  158. // start with a letter. * Must end with a number or a letter.
  159. Name string `json:"name,omitempty"`
  160. // Network: The name of the Google Compute Engine
  161. // [network](/compute/docs/networking#networks_1) to which the cluster
  162. // is connected. If left unspecified, the "default" network will be
  163. // used.
  164. Network string `json:"network,omitempty"`
  165. // NodeConfig: Parameters used in creating the cluster's nodes. See the
  166. // descriptions of the child properties of `nodeConfig`. If unspecified,
  167. // the defaults for all child properties are used.
  168. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  169. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  170. // node for hosting containers. This is provisioned from within the
  171. // container_ipv4_cidr range.
  172. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  173. // SelfLink: [Output only] Server-defined URL for the resource.
  174. SelfLink string `json:"selfLink,omitempty"`
  175. // ServicesIpv4Cidr: [Output only] The IP address range of the
  176. // Kubernetes services in this cluster, in
  177. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  178. // notation (e.g. `1.2.3.4/29`). Service addresses are typically put in
  179. // the last /16 from the container CIDR.
  180. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  181. // Status: [Output only] The current status of this cluster.
  182. //
  183. // Possible values:
  184. // "STATUS_UNSPECIFIED"
  185. // "PROVISIONING"
  186. // "RUNNING"
  187. // "RECONCILING"
  188. // "STOPPING"
  189. // "ERROR"
  190. Status string `json:"status,omitempty"`
  191. // StatusMessage: [Output only] Additional information about the current
  192. // status of this cluster, if available.
  193. StatusMessage string `json:"statusMessage,omitempty"`
  194. // Zone: [Output only] The name of the Google Compute Engine
  195. // [zone](/compute/docs/zones#available) in which the cluster resides.
  196. Zone string `json:"zone,omitempty"`
  197. // ServerResponse contains the HTTP response code and headers from the
  198. // server.
  199. googleapi.ServerResponse `json:"-"`
  200. // ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  201. // unconditionally include in API requests. By default, fields with
  202. // empty values are omitted from API requests. However, any non-pointer,
  203. // non-interface field appearing in ForceSendFields will be sent to the
  204. // server regardless of whether the field is empty or not. This may be
  205. // used to include empty fields in Patch requests.
  206. ForceSendFields []string `json:"-"`
  207. }
  208. func (s *Cluster) MarshalJSON() ([]byte, error) {
  209. type noMethod Cluster
  210. raw := noMethod(*s)
  211. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  212. }
  213. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  214. type ClusterUpdate struct {
  215. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  216. // (typically an upgrade). Use "-" to upgrade to the latest version
  217. // supported by the server.
  218. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  219. // ForceSendFields is a list of field names (e.g. "DesiredNodeVersion")
  220. // to unconditionally include in API requests. By default, fields with
  221. // empty values are omitted from API requests. However, any non-pointer,
  222. // non-interface field appearing in ForceSendFields will be sent to the
  223. // server regardless of whether the field is empty or not. This may be
  224. // used to include empty fields in Patch requests.
  225. ForceSendFields []string `json:"-"`
  226. }
  227. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  228. type noMethod ClusterUpdate
  229. raw := noMethod(*s)
  230. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  231. }
  232. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  233. type CreateClusterRequest struct {
  234. // Cluster: A [cluster
  235. // resource](/container-engine/reference/rest/v1/projects.zones.clusters)
  236. Cluster *Cluster `json:"cluster,omitempty"`
  237. // ForceSendFields is a list of field names (e.g. "Cluster") to
  238. // unconditionally include in API requests. By default, fields with
  239. // empty values are omitted from API requests. However, any non-pointer,
  240. // non-interface field appearing in ForceSendFields will be sent to the
  241. // server regardless of whether the field is empty or not. This may be
  242. // used to include empty fields in Patch requests.
  243. ForceSendFields []string `json:"-"`
  244. }
  245. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  246. type noMethod CreateClusterRequest
  247. raw := noMethod(*s)
  248. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  249. }
  250. // ListClustersResponse: ListClustersResponse is the result of
  251. // ListClustersRequest.
  252. type ListClustersResponse struct {
  253. // Clusters: A list of clusters in the project in the specified zone, or
  254. // across all ones.
  255. Clusters []*Cluster `json:"clusters,omitempty"`
  256. // ServerResponse contains the HTTP response code and headers from the
  257. // server.
  258. googleapi.ServerResponse `json:"-"`
  259. // ForceSendFields is a list of field names (e.g. "Clusters") to
  260. // unconditionally include in API requests. By default, fields with
  261. // empty values are omitted from API requests. However, any non-pointer,
  262. // non-interface field appearing in ForceSendFields will be sent to the
  263. // server regardless of whether the field is empty or not. This may be
  264. // used to include empty fields in Patch requests.
  265. ForceSendFields []string `json:"-"`
  266. }
  267. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  268. type noMethod ListClustersResponse
  269. raw := noMethod(*s)
  270. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  271. }
  272. // ListOperationsResponse: ListOperationsResponse is the result of
  273. // ListOperationsRequest.
  274. type ListOperationsResponse struct {
  275. // Operations: A list of operations in the project in the specified
  276. // zone.
  277. Operations []*Operation `json:"operations,omitempty"`
  278. // ServerResponse contains the HTTP response code and headers from the
  279. // server.
  280. googleapi.ServerResponse `json:"-"`
  281. // ForceSendFields is a list of field names (e.g. "Operations") to
  282. // unconditionally include in API requests. By default, fields with
  283. // empty values are omitted from API requests. However, any non-pointer,
  284. // non-interface field appearing in ForceSendFields will be sent to the
  285. // server regardless of whether the field is empty or not. This may be
  286. // used to include empty fields in Patch requests.
  287. ForceSendFields []string `json:"-"`
  288. }
  289. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  290. type noMethod ListOperationsResponse
  291. raw := noMethod(*s)
  292. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  293. }
  294. // MasterAuth: The authentication information for accessing the master
  295. // endpoint. Authentication can be done using HTTP basic auth or using
  296. // client certificates.
  297. type MasterAuth struct {
  298. // ClientCertificate: [Output only] Base64 encoded public certificate
  299. // used by clients to authenticate to the cluster endpoint.
  300. ClientCertificate string `json:"clientCertificate,omitempty"`
  301. // ClientKey: [Output only] Base64 encoded private key used by clients
  302. // to authenticate to the cluster endpoint.
  303. ClientKey string `json:"clientKey,omitempty"`
  304. // ClusterCaCertificate: [Output only] Base64 encoded public certificate
  305. // that is the root of trust for the cluster.
  306. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  307. // Password: The password to use for HTTP basic authentication when
  308. // accessing the Kubernetes master endpoint. Because the master endpoint
  309. // is open to the internet, you should create a strong password.
  310. Password string `json:"password,omitempty"`
  311. // Username: The username to use for HTTP basic authentication when
  312. // accessing the Kubernetes master endpoint.
  313. Username string `json:"username,omitempty"`
  314. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  315. // to unconditionally include in API requests. By default, fields with
  316. // empty values are omitted from API requests. However, any non-pointer,
  317. // non-interface field appearing in ForceSendFields will be sent to the
  318. // server regardless of whether the field is empty or not. This may be
  319. // used to include empty fields in Patch requests.
  320. ForceSendFields []string `json:"-"`
  321. }
  322. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  323. type noMethod MasterAuth
  324. raw := noMethod(*s)
  325. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  326. }
  327. // NodeConfig: Per-node parameters.
  328. type NodeConfig struct {
  329. // DiskSizeGb: Size of the disk attached to each node, specified in GB.
  330. // The smallest allowed disk size is 10GB. If unspecified, the default
  331. // disk size is 100GB.
  332. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  333. // MachineType: The name of a Google Compute Engine [machine
  334. // type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If
  335. // unspecified, the default machine type is `n1-standard-1`.
  336. MachineType string `json:"machineType,omitempty"`
  337. // OauthScopes: The set of Google API scopes to be made available on all
  338. // of the node VMs under the "default" service account. The following
  339. // scopes are recommended, but not required, and by default are not
  340. // included: * `https://www.googleapis.com/auth/compute` is required for
  341. // mounting persistent storage on your nodes. *
  342. // `https://www.googleapis.com/auth/devstorage.read_only` is required
  343. // for communicating with *gcr.io*. If unspecified, no scopes are added.
  344. OauthScopes []string `json:"oauthScopes,omitempty"`
  345. // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
  346. // unconditionally include in API requests. By default, fields with
  347. // empty values are omitted from API requests. However, any non-pointer,
  348. // non-interface field appearing in ForceSendFields will be sent to the
  349. // server regardless of whether the field is empty or not. This may be
  350. // used to include empty fields in Patch requests.
  351. ForceSendFields []string `json:"-"`
  352. }
  353. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  354. type noMethod NodeConfig
  355. raw := noMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  357. }
  358. // Operation: Defines the operation resource. All fields are output
  359. // only.
  360. type Operation struct {
  361. // Name: The server-assigned ID for the operation.
  362. Name string `json:"name,omitempty"`
  363. // OperationType: The operation type.
  364. //
  365. // Possible values:
  366. // "TYPE_UNSPECIFIED"
  367. // "CREATE_CLUSTER"
  368. // "DELETE_CLUSTER"
  369. // "UPGRADE_MASTER"
  370. // "UPGRADE_NODES"
  371. // "REPAIR_CLUSTER"
  372. OperationType string `json:"operationType,omitempty"`
  373. // SelfLink: Server-defined URL for the resource.
  374. SelfLink string `json:"selfLink,omitempty"`
  375. // Status: The current status of the operation.
  376. //
  377. // Possible values:
  378. // "STATUS_UNSPECIFIED"
  379. // "PENDING"
  380. // "RUNNING"
  381. // "DONE"
  382. Status string `json:"status,omitempty"`
  383. // StatusMessage: If an error has occurred, a textual description of the
  384. // error.
  385. StatusMessage string `json:"statusMessage,omitempty"`
  386. // TargetLink: Server-defined URL for the target of the operation.
  387. TargetLink string `json:"targetLink,omitempty"`
  388. // Zone: The name of the Google Compute Engine
  389. // [zone](/compute/docs/zones#available) in which the operation is
  390. // taking place.
  391. Zone string `json:"zone,omitempty"`
  392. // ServerResponse contains the HTTP response code and headers from the
  393. // server.
  394. googleapi.ServerResponse `json:"-"`
  395. // ForceSendFields is a list of field names (e.g. "Name") to
  396. // unconditionally include in API requests. By default, fields with
  397. // empty values are omitted from API requests. However, any non-pointer,
  398. // non-interface field appearing in ForceSendFields will be sent to the
  399. // server regardless of whether the field is empty or not. This may be
  400. // used to include empty fields in Patch requests.
  401. ForceSendFields []string `json:"-"`
  402. }
  403. func (s *Operation) MarshalJSON() ([]byte, error) {
  404. type noMethod Operation
  405. raw := noMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  407. }
  408. // ServerConfig: Container Engine Server configuration.
  409. type ServerConfig struct {
  410. // DefaultClusterVersion: What version this server deploys by default.
  411. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  412. // ValidNodeVersions: List of valid node upgrade target versions.
  413. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  414. // ServerResponse contains the HTTP response code and headers from the
  415. // server.
  416. googleapi.ServerResponse `json:"-"`
  417. // ForceSendFields is a list of field names (e.g.
  418. // "DefaultClusterVersion") to unconditionally include in API requests.
  419. // By default, fields with empty values are omitted from API requests.
  420. // However, any non-pointer, non-interface field appearing in
  421. // ForceSendFields will be sent to the server regardless of whether the
  422. // field is empty or not. This may be used to include empty fields in
  423. // Patch requests.
  424. ForceSendFields []string `json:"-"`
  425. }
  426. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  427. type noMethod ServerConfig
  428. raw := noMethod(*s)
  429. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  430. }
  431. // UpdateClusterRequest: UpdateClusterRequest updates a cluster.
  432. type UpdateClusterRequest struct {
  433. // Update: A description of the update.
  434. Update *ClusterUpdate `json:"update,omitempty"`
  435. // ForceSendFields is a list of field names (e.g. "Update") to
  436. // unconditionally include in API requests. By default, fields with
  437. // empty values are omitted from API requests. However, any non-pointer,
  438. // non-interface field appearing in ForceSendFields will be sent to the
  439. // server regardless of whether the field is empty or not. This may be
  440. // used to include empty fields in Patch requests.
  441. ForceSendFields []string `json:"-"`
  442. }
  443. func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  444. type noMethod UpdateClusterRequest
  445. raw := noMethod(*s)
  446. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  447. }
  448. // method id "container.projects.zones.getServerconfig":
  449. type ProjectsZonesGetServerconfigCall struct {
  450. s *Service
  451. projectId string
  452. zone string
  453. urlParams_ gensupport.URLParams
  454. ifNoneMatch_ string
  455. ctx_ context.Context
  456. }
  457. // GetServerconfig: Returns configuration info about the Container
  458. // Engine service.
  459. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  460. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  461. c.projectId = projectId
  462. c.zone = zone
  463. return c
  464. }
  465. // Fields allows partial responses to be retrieved. See
  466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  467. // for more information.
  468. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  470. return c
  471. }
  472. // IfNoneMatch sets the optional parameter which makes the operation
  473. // fail if the object's ETag matches the given value. This is useful for
  474. // getting updates only after the object has changed since the last
  475. // request. Use googleapi.IsNotModified to check whether the response
  476. // error from Do is the result of In-None-Match.
  477. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  478. c.ifNoneMatch_ = entityTag
  479. return c
  480. }
  481. // Context sets the context to be used in this call's Do method. Any
  482. // pending HTTP request will be aborted if the provided context is
  483. // canceled.
  484. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  485. c.ctx_ = ctx
  486. return c
  487. }
  488. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  489. var body io.Reader = nil
  490. c.urlParams_.Set("alt", alt)
  491. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig")
  492. urls += "?" + c.urlParams_.Encode()
  493. req, _ := http.NewRequest("GET", urls, body)
  494. googleapi.Expand(req.URL, map[string]string{
  495. "projectId": c.projectId,
  496. "zone": c.zone,
  497. })
  498. req.Header.Set("User-Agent", c.s.userAgent())
  499. if c.ifNoneMatch_ != "" {
  500. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  501. }
  502. if c.ctx_ != nil {
  503. return ctxhttp.Do(c.ctx_, c.s.client, req)
  504. }
  505. return c.s.client.Do(req)
  506. }
  507. // Do executes the "container.projects.zones.getServerconfig" call.
  508. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  509. // status code is an error. Response headers are in either
  510. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  511. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  512. // to check whether the returned error was because
  513. // http.StatusNotModified was returned.
  514. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  515. gensupport.SetOptions(c.urlParams_, opts...)
  516. res, err := c.doRequest("json")
  517. if res != nil && res.StatusCode == http.StatusNotModified {
  518. if res.Body != nil {
  519. res.Body.Close()
  520. }
  521. return nil, &googleapi.Error{
  522. Code: res.StatusCode,
  523. Header: res.Header,
  524. }
  525. }
  526. if err != nil {
  527. return nil, err
  528. }
  529. defer googleapi.CloseBody(res)
  530. if err := googleapi.CheckResponse(res); err != nil {
  531. return nil, err
  532. }
  533. ret := &ServerConfig{
  534. ServerResponse: googleapi.ServerResponse{
  535. Header: res.Header,
  536. HTTPStatusCode: res.StatusCode,
  537. },
  538. }
  539. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  540. return nil, err
  541. }
  542. return ret, nil
  543. // {
  544. // "description": "Returns configuration info about the Container Engine service.",
  545. // "httpMethod": "GET",
  546. // "id": "container.projects.zones.getServerconfig",
  547. // "parameterOrder": [
  548. // "projectId",
  549. // "zone"
  550. // ],
  551. // "parameters": {
  552. // "projectId": {
  553. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  554. // "location": "path",
  555. // "required": true,
  556. // "type": "string"
  557. // },
  558. // "zone": {
  559. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
  560. // "location": "path",
  561. // "required": true,
  562. // "type": "string"
  563. // }
  564. // },
  565. // "path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  566. // "response": {
  567. // "$ref": "ServerConfig"
  568. // },
  569. // "scopes": [
  570. // "https://www.googleapis.com/auth/cloud-platform"
  571. // ]
  572. // }
  573. }
  574. // method id "container.projects.zones.clusters.create":
  575. type ProjectsZonesClustersCreateCall struct {
  576. s *Service
  577. projectId string
  578. zone string
  579. createclusterrequest *CreateClusterRequest
  580. urlParams_ gensupport.URLParams
  581. ctx_ context.Context
  582. }
  583. // Create: Creates a cluster, consisting of the specified number and
  584. // type of Google Compute Engine instances, plus a Kubernetes master
  585. // endpoint. By default, the cluster is created in the project's
  586. // [default network](/compute/docs/networking#networks_1). One firewall
  587. // is added for the cluster. After cluster creation, the cluster creates
  588. // routes for each node to allow the containers on that node to
  589. // communicate with all other instances in the cluster. Finally, an
  590. // entry is added to the project's global metadata indicating which CIDR
  591. // range is being used by the cluster.
  592. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  593. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  594. c.projectId = projectId
  595. c.zone = zone
  596. c.createclusterrequest = createclusterrequest
  597. return c
  598. }
  599. // Fields allows partial responses to be retrieved. See
  600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  601. // for more information.
  602. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  604. return c
  605. }
  606. // Context sets the context to be used in this call's Do method. Any
  607. // pending HTTP request will be aborted if the provided context is
  608. // canceled.
  609. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  610. c.ctx_ = ctx
  611. return c
  612. }
  613. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  614. var body io.Reader = nil
  615. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  616. if err != nil {
  617. return nil, err
  618. }
  619. ctype := "application/json"
  620. c.urlParams_.Set("alt", alt)
  621. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  622. urls += "?" + c.urlParams_.Encode()
  623. req, _ := http.NewRequest("POST", urls, body)
  624. googleapi.Expand(req.URL, map[string]string{
  625. "projectId": c.projectId,
  626. "zone": c.zone,
  627. })
  628. req.Header.Set("Content-Type", ctype)
  629. req.Header.Set("User-Agent", c.s.userAgent())
  630. if c.ctx_ != nil {
  631. return ctxhttp.Do(c.ctx_, c.s.client, req)
  632. }
  633. return c.s.client.Do(req)
  634. }
  635. // Do executes the "container.projects.zones.clusters.create" call.
  636. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  637. // status code is an error. Response headers are in either
  638. // *Operation.ServerResponse.Header or (if a response was returned at
  639. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  640. // to check whether the returned error was because
  641. // http.StatusNotModified was returned.
  642. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  643. gensupport.SetOptions(c.urlParams_, opts...)
  644. res, err := c.doRequest("json")
  645. if res != nil && res.StatusCode == http.StatusNotModified {
  646. if res.Body != nil {
  647. res.Body.Close()
  648. }
  649. return nil, &googleapi.Error{
  650. Code: res.StatusCode,
  651. Header: res.Header,
  652. }
  653. }
  654. if err != nil {
  655. return nil, err
  656. }
  657. defer googleapi.CloseBody(res)
  658. if err := googleapi.CheckResponse(res); err != nil {
  659. return nil, err
  660. }
  661. ret := &Operation{
  662. ServerResponse: googleapi.ServerResponse{
  663. Header: res.Header,
  664. HTTPStatusCode: res.StatusCode,
  665. },
  666. }
  667. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  668. return nil, err
  669. }
  670. return ret, nil
  671. // {
  672. // "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.",
  673. // "httpMethod": "POST",
  674. // "id": "container.projects.zones.clusters.create",
  675. // "parameterOrder": [
  676. // "projectId",
  677. // "zone"
  678. // ],
  679. // "parameters": {
  680. // "projectId": {
  681. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  682. // "location": "path",
  683. // "required": true,
  684. // "type": "string"
  685. // },
  686. // "zone": {
  687. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
  688. // "location": "path",
  689. // "required": true,
  690. // "type": "string"
  691. // }
  692. // },
  693. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  694. // "request": {
  695. // "$ref": "CreateClusterRequest"
  696. // },
  697. // "response": {
  698. // "$ref": "Operation"
  699. // },
  700. // "scopes": [
  701. // "https://www.googleapis.com/auth/cloud-platform"
  702. // ]
  703. // }
  704. }
  705. // method id "container.projects.zones.clusters.delete":
  706. type ProjectsZonesClustersDeleteCall struct {
  707. s *Service
  708. projectId string
  709. zone string
  710. clusterId string
  711. urlParams_ gensupport.URLParams
  712. ctx_ context.Context
  713. }
  714. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  715. // all worker nodes. Firewalls and routes that were configured during
  716. // cluster creation are also deleted.
  717. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  718. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  719. c.projectId = projectId
  720. c.zone = zone
  721. c.clusterId = clusterId
  722. return c
  723. }
  724. // Fields allows partial responses to be retrieved. See
  725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  726. // for more information.
  727. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  729. return c
  730. }
  731. // Context sets the context to be used in this call's Do method. Any
  732. // pending HTTP request will be aborted if the provided context is
  733. // canceled.
  734. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  735. c.ctx_ = ctx
  736. return c
  737. }
  738. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  739. var body io.Reader = nil
  740. c.urlParams_.Set("alt", alt)
  741. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  742. urls += "?" + c.urlParams_.Encode()
  743. req, _ := http.NewRequest("DELETE", urls, body)
  744. googleapi.Expand(req.URL, map[string]string{
  745. "projectId": c.projectId,
  746. "zone": c.zone,
  747. "clusterId": c.clusterId,
  748. })
  749. req.Header.Set("User-Agent", c.s.userAgent())
  750. if c.ctx_ != nil {
  751. return ctxhttp.Do(c.ctx_, c.s.client, req)
  752. }
  753. return c.s.client.Do(req)
  754. }
  755. // Do executes the "container.projects.zones.clusters.delete" call.
  756. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  757. // status code is an error. Response headers are in either
  758. // *Operation.ServerResponse.Header or (if a response was returned at
  759. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  760. // to check whether the returned error was because
  761. // http.StatusNotModified was returned.
  762. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  763. gensupport.SetOptions(c.urlParams_, opts...)
  764. res, err := c.doRequest("json")
  765. if res != nil && res.StatusCode == http.StatusNotModified {
  766. if res.Body != nil {
  767. res.Body.Close()
  768. }
  769. return nil, &googleapi.Error{
  770. Code: res.StatusCode,
  771. Header: res.Header,
  772. }
  773. }
  774. if err != nil {
  775. return nil, err
  776. }
  777. defer googleapi.CloseBody(res)
  778. if err := googleapi.CheckResponse(res); err != nil {
  779. return nil, err
  780. }
  781. ret := &Operation{
  782. ServerResponse: googleapi.ServerResponse{
  783. Header: res.Header,
  784. HTTPStatusCode: res.StatusCode,
  785. },
  786. }
  787. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  788. return nil, err
  789. }
  790. return ret, nil
  791. // {
  792. // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted.",
  793. // "httpMethod": "DELETE",
  794. // "id": "container.projects.zones.clusters.delete",
  795. // "parameterOrder": [
  796. // "projectId",
  797. // "zone",
  798. // "clusterId"
  799. // ],
  800. // "parameters": {
  801. // "clusterId": {
  802. // "description": "The name of the cluster to delete.",
  803. // "location": "path",
  804. // "required": true,
  805. // "type": "string"
  806. // },
  807. // "projectId": {
  808. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  809. // "location": "path",
  810. // "required": true,
  811. // "type": "string"
  812. // },
  813. // "zone": {
  814. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
  815. // "location": "path",
  816. // "required": true,
  817. // "type": "string"
  818. // }
  819. // },
  820. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  821. // "response": {
  822. // "$ref": "Operation"
  823. // },
  824. // "scopes": [
  825. // "https://www.googleapis.com/auth/cloud-platform"
  826. // ]
  827. // }
  828. }
  829. // method id "container.projects.zones.clusters.get":
  830. type ProjectsZonesClustersGetCall struct {
  831. s *Service
  832. projectId string
  833. zone string
  834. clusterId string
  835. urlParams_ gensupport.URLParams
  836. ifNoneMatch_ string
  837. ctx_ context.Context
  838. }
  839. // Get: Gets a specific cluster.
  840. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  841. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  842. c.projectId = projectId
  843. c.zone = zone
  844. c.clusterId = clusterId
  845. return c
  846. }
  847. // Fields allows partial responses to be retrieved. See
  848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  849. // for more information.
  850. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  852. return c
  853. }
  854. // IfNoneMatch sets the optional parameter which makes the operation
  855. // fail if the object's ETag matches the given value. This is useful for
  856. // getting updates only after the object has changed since the last
  857. // request. Use googleapi.IsNotModified to check whether the response
  858. // error from Do is the result of In-None-Match.
  859. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  860. c.ifNoneMatch_ = entityTag
  861. return c
  862. }
  863. // Context sets the context to be used in this call's Do method. Any
  864. // pending HTTP request will be aborted if the provided context is
  865. // canceled.
  866. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  867. c.ctx_ = ctx
  868. return c
  869. }
  870. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  871. var body io.Reader = nil
  872. c.urlParams_.Set("alt", alt)
  873. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  874. urls += "?" + c.urlParams_.Encode()
  875. req, _ := http.NewRequest("GET", urls, body)
  876. googleapi.Expand(req.URL, map[string]string{
  877. "projectId": c.projectId,
  878. "zone": c.zone,
  879. "clusterId": c.clusterId,
  880. })
  881. req.Header.Set("User-Agent", c.s.userAgent())
  882. if c.ifNoneMatch_ != "" {
  883. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  884. }
  885. if c.ctx_ != nil {
  886. return ctxhttp.Do(c.ctx_, c.s.client, req)
  887. }
  888. return c.s.client.Do(req)
  889. }
  890. // Do executes the "container.projects.zones.clusters.get" call.
  891. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  892. // code is an error. Response headers are in either
  893. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  894. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  895. // check whether the returned error was because http.StatusNotModified
  896. // was returned.
  897. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  898. gensupport.SetOptions(c.urlParams_, opts...)
  899. res, err := c.doRequest("json")
  900. if res != nil && res.StatusCode == http.StatusNotModified {
  901. if res.Body != nil {
  902. res.Body.Close()
  903. }
  904. return nil, &googleapi.Error{
  905. Code: res.StatusCode,
  906. Header: res.Header,
  907. }
  908. }
  909. if err != nil {
  910. return nil, err
  911. }
  912. defer googleapi.CloseBody(res)
  913. if err := googleapi.CheckResponse(res); err != nil {
  914. return nil, err
  915. }
  916. ret := &Cluster{
  917. ServerResponse: googleapi.ServerResponse{
  918. Header: res.Header,
  919. HTTPStatusCode: res.StatusCode,
  920. },
  921. }
  922. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  923. return nil, err
  924. }
  925. return ret, nil
  926. // {
  927. // "description": "Gets a specific cluster.",
  928. // "httpMethod": "GET",
  929. // "id": "container.projects.zones.clusters.get",
  930. // "parameterOrder": [
  931. // "projectId",
  932. // "zone",
  933. // "clusterId"
  934. // ],
  935. // "parameters": {
  936. // "clusterId": {
  937. // "description": "The name of the cluster to retrieve.",
  938. // "location": "path",
  939. // "required": true,
  940. // "type": "string"
  941. // },
  942. // "projectId": {
  943. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  944. // "location": "path",
  945. // "required": true,
  946. // "type": "string"
  947. // },
  948. // "zone": {
  949. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
  950. // "location": "path",
  951. // "required": true,
  952. // "type": "string"
  953. // }
  954. // },
  955. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  956. // "response": {
  957. // "$ref": "Cluster"
  958. // },
  959. // "scopes": [
  960. // "https://www.googleapis.com/auth/cloud-platform"
  961. // ]
  962. // }
  963. }
  964. // method id "container.projects.zones.clusters.list":
  965. type ProjectsZonesClustersListCall struct {
  966. s *Service
  967. projectId string
  968. zone string
  969. urlParams_ gensupport.URLParams
  970. ifNoneMatch_ string
  971. ctx_ context.Context
  972. }
  973. // List: Lists all clusters owned by a project in either the specified
  974. // zone or all zones.
  975. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  976. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  977. c.projectId = projectId
  978. c.zone = zone
  979. return c
  980. }
  981. // Fields allows partial responses to be retrieved. See
  982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  983. // for more information.
  984. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  986. return c
  987. }
  988. // IfNoneMatch sets the optional parameter which makes the operation
  989. // fail if the object's ETag matches the given value. This is useful for
  990. // getting updates only after the object has changed since the last
  991. // request. Use googleapi.IsNotModified to check whether the response
  992. // error from Do is the result of In-None-Match.
  993. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  994. c.ifNoneMatch_ = entityTag
  995. return c
  996. }
  997. // Context sets the context to be used in this call's Do method. Any
  998. // pending HTTP request will be aborted if the provided context is
  999. // canceled.
  1000. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  1001. c.ctx_ = ctx
  1002. return c
  1003. }
  1004. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  1005. var body io.Reader = nil
  1006. c.urlParams_.Set("alt", alt)
  1007. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  1008. urls += "?" + c.urlParams_.Encode()
  1009. req, _ := http.NewRequest("GET", urls, body)
  1010. googleapi.Expand(req.URL, map[string]string{
  1011. "projectId": c.projectId,
  1012. "zone": c.zone,
  1013. })
  1014. req.Header.Set("User-Agent", c.s.userAgent())
  1015. if c.ifNoneMatch_ != "" {
  1016. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1017. }
  1018. if c.ctx_ != nil {
  1019. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1020. }
  1021. return c.s.client.Do(req)
  1022. }
  1023. // Do executes the "container.projects.zones.clusters.list" call.
  1024. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  1025. // non-2xx status code is an error. Response headers are in either
  1026. // *ListClustersResponse.ServerResponse.Header or (if a response was
  1027. // returned at all) in error.(*googleapi.Error).Header. Use
  1028. // googleapi.IsNotModified to check whether the returned error was
  1029. // because http.StatusNotModified was returned.
  1030. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  1031. gensupport.SetOptions(c.urlParams_, opts...)
  1032. res, err := c.doRequest("json")
  1033. if res != nil && res.StatusCode == http.StatusNotModified {
  1034. if res.Body != nil {
  1035. res.Body.Close()
  1036. }
  1037. return nil, &googleapi.Error{
  1038. Code: res.StatusCode,
  1039. Header: res.Header,
  1040. }
  1041. }
  1042. if err != nil {
  1043. return nil, err
  1044. }
  1045. defer googleapi.CloseBody(res)
  1046. if err := googleapi.CheckResponse(res); err != nil {
  1047. return nil, err
  1048. }
  1049. ret := &ListClustersResponse{
  1050. ServerResponse: googleapi.ServerResponse{
  1051. Header: res.Header,
  1052. HTTPStatusCode: res.StatusCode,
  1053. },
  1054. }
  1055. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1056. return nil, err
  1057. }
  1058. return ret, nil
  1059. // {
  1060. // "description": "Lists all clusters owned by a project in either the specified zone or all zones.",
  1061. // "httpMethod": "GET",
  1062. // "id": "container.projects.zones.clusters.list",
  1063. // "parameterOrder": [
  1064. // "projectId",
  1065. // "zone"
  1066. // ],
  1067. // "parameters": {
  1068. // "projectId": {
  1069. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  1070. // "location": "path",
  1071. // "required": true,
  1072. // "type": "string"
  1073. // },
  1074. // "zone": {
  1075. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or \"-\" for all zones.",
  1076. // "location": "path",
  1077. // "required": true,
  1078. // "type": "string"
  1079. // }
  1080. // },
  1081. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  1082. // "response": {
  1083. // "$ref": "ListClustersResponse"
  1084. // },
  1085. // "scopes": [
  1086. // "https://www.googleapis.com/auth/cloud-platform"
  1087. // ]
  1088. // }
  1089. }
  1090. // method id "container.projects.zones.clusters.update":
  1091. type ProjectsZonesClustersUpdateCall struct {
  1092. s *Service
  1093. projectId string
  1094. zone string
  1095. clusterId string
  1096. updateclusterrequest *UpdateClusterRequest
  1097. urlParams_ gensupport.URLParams
  1098. ctx_ context.Context
  1099. }
  1100. // Update: Update settings of a specific cluster.
  1101. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  1102. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1103. c.projectId = projectId
  1104. c.zone = zone
  1105. c.clusterId = clusterId
  1106. c.updateclusterrequest = updateclusterrequest
  1107. return c
  1108. }
  1109. // Fields allows partial responses to be retrieved. See
  1110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1111. // for more information.
  1112. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  1113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1114. return c
  1115. }
  1116. // Context sets the context to be used in this call's Do method. Any
  1117. // pending HTTP request will be aborted if the provided context is
  1118. // canceled.
  1119. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  1120. c.ctx_ = ctx
  1121. return c
  1122. }
  1123. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  1124. var body io.Reader = nil
  1125. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  1126. if err != nil {
  1127. return nil, err
  1128. }
  1129. ctype := "application/json"
  1130. c.urlParams_.Set("alt", alt)
  1131. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  1132. urls += "?" + c.urlParams_.Encode()
  1133. req, _ := http.NewRequest("PUT", urls, body)
  1134. googleapi.Expand(req.URL, map[string]string{
  1135. "projectId": c.projectId,
  1136. "zone": c.zone,
  1137. "clusterId": c.clusterId,
  1138. })
  1139. req.Header.Set("Content-Type", ctype)
  1140. req.Header.Set("User-Agent", c.s.userAgent())
  1141. if c.ctx_ != nil {
  1142. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1143. }
  1144. return c.s.client.Do(req)
  1145. }
  1146. // Do executes the "container.projects.zones.clusters.update" call.
  1147. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1148. // status code is an error. Response headers are in either
  1149. // *Operation.ServerResponse.Header or (if a response was returned at
  1150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1151. // to check whether the returned error was because
  1152. // http.StatusNotModified was returned.
  1153. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1154. gensupport.SetOptions(c.urlParams_, opts...)
  1155. res, err := c.doRequest("json")
  1156. if res != nil && res.StatusCode == http.StatusNotModified {
  1157. if res.Body != nil {
  1158. res.Body.Close()
  1159. }
  1160. return nil, &googleapi.Error{
  1161. Code: res.StatusCode,
  1162. Header: res.Header,
  1163. }
  1164. }
  1165. if err != nil {
  1166. return nil, err
  1167. }
  1168. defer googleapi.CloseBody(res)
  1169. if err := googleapi.CheckResponse(res); err != nil {
  1170. return nil, err
  1171. }
  1172. ret := &Operation{
  1173. ServerResponse: googleapi.ServerResponse{
  1174. Header: res.Header,
  1175. HTTPStatusCode: res.StatusCode,
  1176. },
  1177. }
  1178. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1179. return nil, err
  1180. }
  1181. return ret, nil
  1182. // {
  1183. // "description": "Update settings of a specific cluster.",
  1184. // "httpMethod": "PUT",
  1185. // "id": "container.projects.zones.clusters.update",
  1186. // "parameterOrder": [
  1187. // "projectId",
  1188. // "zone",
  1189. // "clusterId"
  1190. // ],
  1191. // "parameters": {
  1192. // "clusterId": {
  1193. // "description": "The name of the cluster to upgrade.",
  1194. // "location": "path",
  1195. // "required": true,
  1196. // "type": "string"
  1197. // },
  1198. // "projectId": {
  1199. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  1200. // "location": "path",
  1201. // "required": true,
  1202. // "type": "string"
  1203. // },
  1204. // "zone": {
  1205. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
  1206. // "location": "path",
  1207. // "required": true,
  1208. // "type": "string"
  1209. // }
  1210. // },
  1211. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  1212. // "request": {
  1213. // "$ref": "UpdateClusterRequest"
  1214. // },
  1215. // "response": {
  1216. // "$ref": "Operation"
  1217. // },
  1218. // "scopes": [
  1219. // "https://www.googleapis.com/auth/cloud-platform"
  1220. // ]
  1221. // }
  1222. }
  1223. // method id "container.projects.zones.operations.get":
  1224. type ProjectsZonesOperationsGetCall struct {
  1225. s *Service
  1226. projectId string
  1227. zone string
  1228. operationId string
  1229. urlParams_ gensupport.URLParams
  1230. ifNoneMatch_ string
  1231. ctx_ context.Context
  1232. }
  1233. // Get: Gets the specified operation.
  1234. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  1235. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1236. c.projectId = projectId
  1237. c.zone = zone
  1238. c.operationId = operationId
  1239. return c
  1240. }
  1241. // Fields allows partial responses to be retrieved. See
  1242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1243. // for more information.
  1244. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  1245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1246. return c
  1247. }
  1248. // IfNoneMatch sets the optional parameter which makes the operation
  1249. // fail if the object's ETag matches the given value. This is useful for
  1250. // getting updates only after the object has changed since the last
  1251. // request. Use googleapi.IsNotModified to check whether the response
  1252. // error from Do is the result of In-None-Match.
  1253. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  1254. c.ifNoneMatch_ = entityTag
  1255. return c
  1256. }
  1257. // Context sets the context to be used in this call's Do method. Any
  1258. // pending HTTP request will be aborted if the provided context is
  1259. // canceled.
  1260. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  1261. c.ctx_ = ctx
  1262. return c
  1263. }
  1264. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1265. var body io.Reader = nil
  1266. c.urlParams_.Set("alt", alt)
  1267. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  1268. urls += "?" + c.urlParams_.Encode()
  1269. req, _ := http.NewRequest("GET", urls, body)
  1270. googleapi.Expand(req.URL, map[string]string{
  1271. "projectId": c.projectId,
  1272. "zone": c.zone,
  1273. "operationId": c.operationId,
  1274. })
  1275. req.Header.Set("User-Agent", c.s.userAgent())
  1276. if c.ifNoneMatch_ != "" {
  1277. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1278. }
  1279. if c.ctx_ != nil {
  1280. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1281. }
  1282. return c.s.client.Do(req)
  1283. }
  1284. // Do executes the "container.projects.zones.operations.get" call.
  1285. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1286. // status code is an error. Response headers are in either
  1287. // *Operation.ServerResponse.Header or (if a response was returned at
  1288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1289. // to check whether the returned error was because
  1290. // http.StatusNotModified was returned.
  1291. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1292. gensupport.SetOptions(c.urlParams_, opts...)
  1293. res, err := c.doRequest("json")
  1294. if res != nil && res.StatusCode == http.StatusNotModified {
  1295. if res.Body != nil {
  1296. res.Body.Close()
  1297. }
  1298. return nil, &googleapi.Error{
  1299. Code: res.StatusCode,
  1300. Header: res.Header,
  1301. }
  1302. }
  1303. if err != nil {
  1304. return nil, err
  1305. }
  1306. defer googleapi.CloseBody(res)
  1307. if err := googleapi.CheckResponse(res); err != nil {
  1308. return nil, err
  1309. }
  1310. ret := &Operation{
  1311. ServerResponse: googleapi.ServerResponse{
  1312. Header: res.Header,
  1313. HTTPStatusCode: res.StatusCode,
  1314. },
  1315. }
  1316. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1317. return nil, err
  1318. }
  1319. return ret, nil
  1320. // {
  1321. // "description": "Gets the specified operation.",
  1322. // "httpMethod": "GET",
  1323. // "id": "container.projects.zones.operations.get",
  1324. // "parameterOrder": [
  1325. // "projectId",
  1326. // "zone",
  1327. // "operationId"
  1328. // ],
  1329. // "parameters": {
  1330. // "operationId": {
  1331. // "description": "The server-assigned `name` of the operation.",
  1332. // "location": "path",
  1333. // "required": true,
  1334. // "type": "string"
  1335. // },
  1336. // "projectId": {
  1337. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  1338. // "location": "path",
  1339. // "required": true,
  1340. // "type": "string"
  1341. // },
  1342. // "zone": {
  1343. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides.",
  1344. // "location": "path",
  1345. // "required": true,
  1346. // "type": "string"
  1347. // }
  1348. // },
  1349. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  1350. // "response": {
  1351. // "$ref": "Operation"
  1352. // },
  1353. // "scopes": [
  1354. // "https://www.googleapis.com/auth/cloud-platform"
  1355. // ]
  1356. // }
  1357. }
  1358. // method id "container.projects.zones.operations.list":
  1359. type ProjectsZonesOperationsListCall struct {
  1360. s *Service
  1361. projectId string
  1362. zone string
  1363. urlParams_ gensupport.URLParams
  1364. ifNoneMatch_ string
  1365. ctx_ context.Context
  1366. }
  1367. // List: Lists all operations in a project in a specific zone or all
  1368. // zones.
  1369. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  1370. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1371. c.projectId = projectId
  1372. c.zone = zone
  1373. return c
  1374. }
  1375. // Fields allows partial responses to be retrieved. See
  1376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1377. // for more information.
  1378. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  1379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1380. return c
  1381. }
  1382. // IfNoneMatch sets the optional parameter which makes the operation
  1383. // fail if the object's ETag matches the given value. This is useful for
  1384. // getting updates only after the object has changed since the last
  1385. // request. Use googleapi.IsNotModified to check whether the response
  1386. // error from Do is the result of In-None-Match.
  1387. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  1388. c.ifNoneMatch_ = entityTag
  1389. return c
  1390. }
  1391. // Context sets the context to be used in this call's Do method. Any
  1392. // pending HTTP request will be aborted if the provided context is
  1393. // canceled.
  1394. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  1395. c.ctx_ = ctx
  1396. return c
  1397. }
  1398. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  1399. var body io.Reader = nil
  1400. c.urlParams_.Set("alt", alt)
  1401. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations")
  1402. urls += "?" + c.urlParams_.Encode()
  1403. req, _ := http.NewRequest("GET", urls, body)
  1404. googleapi.Expand(req.URL, map[string]string{
  1405. "projectId": c.projectId,
  1406. "zone": c.zone,
  1407. })
  1408. req.Header.Set("User-Agent", c.s.userAgent())
  1409. if c.ifNoneMatch_ != "" {
  1410. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1411. }
  1412. if c.ctx_ != nil {
  1413. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1414. }
  1415. return c.s.client.Do(req)
  1416. }
  1417. // Do executes the "container.projects.zones.operations.list" call.
  1418. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  1419. // non-2xx status code is an error. Response headers are in either
  1420. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  1421. // returned at all) in error.(*googleapi.Error).Header. Use
  1422. // googleapi.IsNotModified to check whether the returned error was
  1423. // because http.StatusNotModified was returned.
  1424. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1425. gensupport.SetOptions(c.urlParams_, opts...)
  1426. res, err := c.doRequest("json")
  1427. if res != nil && res.StatusCode == http.StatusNotModified {
  1428. if res.Body != nil {
  1429. res.Body.Close()
  1430. }
  1431. return nil, &googleapi.Error{
  1432. Code: res.StatusCode,
  1433. Header: res.Header,
  1434. }
  1435. }
  1436. if err != nil {
  1437. return nil, err
  1438. }
  1439. defer googleapi.CloseBody(res)
  1440. if err := googleapi.CheckResponse(res); err != nil {
  1441. return nil, err
  1442. }
  1443. ret := &ListOperationsResponse{
  1444. ServerResponse: googleapi.ServerResponse{
  1445. Header: res.Header,
  1446. HTTPStatusCode: res.StatusCode,
  1447. },
  1448. }
  1449. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1450. return nil, err
  1451. }
  1452. return ret, nil
  1453. // {
  1454. // "description": "Lists all operations in a project in a specific zone or all zones.",
  1455. // "httpMethod": "GET",
  1456. // "id": "container.projects.zones.operations.list",
  1457. // "parameterOrder": [
  1458. // "projectId",
  1459. // "zone"
  1460. // ],
  1461. // "parameters": {
  1462. // "projectId": {
  1463. // "description": "The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber).",
  1464. // "location": "path",
  1465. // "required": true,
  1466. // "type": "string"
  1467. // },
  1468. // "zone": {
  1469. // "description": "The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or \"-\" for all zones.",
  1470. // "location": "path",
  1471. // "required": true,
  1472. // "type": "string"
  1473. // }
  1474. // },
  1475. // "path": "v1/projects/{projectId}/zones/{zone}/operations",
  1476. // "response": {
  1477. // "$ref": "ListOperationsResponse"
  1478. // },
  1479. // "scopes": [
  1480. // "https://www.googleapis.com/auth/cloud-platform"
  1481. // ]
  1482. // }
  1483. }