No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

13503 líneas
482 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package container provides access to the Kubernetes Engine API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/container-engine/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/container/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // containerService, err := container.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // containerService, err := container.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // containerService, err := container.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package container // import "google.golang.org/api/container/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "container:v1"
  67. const apiName = "container"
  68. const apiVersion = "v1"
  69. const basePath = "https://container.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Projects = NewProjectsService(s)
  106. return s, nil
  107. }
  108. type Service struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Projects *ProjectsService
  113. }
  114. func (s *Service) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewProjectsService(s *Service) *ProjectsService {
  121. rs := &ProjectsService{s: s}
  122. rs.Locations = NewProjectsLocationsService(s)
  123. rs.Zones = NewProjectsZonesService(s)
  124. return rs
  125. }
  126. type ProjectsService struct {
  127. s *Service
  128. Locations *ProjectsLocationsService
  129. Zones *ProjectsZonesService
  130. }
  131. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  132. rs := &ProjectsLocationsService{s: s}
  133. rs.Clusters = NewProjectsLocationsClustersService(s)
  134. rs.Operations = NewProjectsLocationsOperationsService(s)
  135. return rs
  136. }
  137. type ProjectsLocationsService struct {
  138. s *Service
  139. Clusters *ProjectsLocationsClustersService
  140. Operations *ProjectsLocationsOperationsService
  141. }
  142. func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
  143. rs := &ProjectsLocationsClustersService{s: s}
  144. rs.NodePools = NewProjectsLocationsClustersNodePoolsService(s)
  145. rs.WellKnown = NewProjectsLocationsClustersWellKnownService(s)
  146. return rs
  147. }
  148. type ProjectsLocationsClustersService struct {
  149. s *Service
  150. NodePools *ProjectsLocationsClustersNodePoolsService
  151. WellKnown *ProjectsLocationsClustersWellKnownService
  152. }
  153. func NewProjectsLocationsClustersNodePoolsService(s *Service) *ProjectsLocationsClustersNodePoolsService {
  154. rs := &ProjectsLocationsClustersNodePoolsService{s: s}
  155. return rs
  156. }
  157. type ProjectsLocationsClustersNodePoolsService struct {
  158. s *Service
  159. }
  160. func NewProjectsLocationsClustersWellKnownService(s *Service) *ProjectsLocationsClustersWellKnownService {
  161. rs := &ProjectsLocationsClustersWellKnownService{s: s}
  162. return rs
  163. }
  164. type ProjectsLocationsClustersWellKnownService struct {
  165. s *Service
  166. }
  167. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  168. rs := &ProjectsLocationsOperationsService{s: s}
  169. return rs
  170. }
  171. type ProjectsLocationsOperationsService struct {
  172. s *Service
  173. }
  174. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  175. rs := &ProjectsZonesService{s: s}
  176. rs.Clusters = NewProjectsZonesClustersService(s)
  177. rs.Operations = NewProjectsZonesOperationsService(s)
  178. return rs
  179. }
  180. type ProjectsZonesService struct {
  181. s *Service
  182. Clusters *ProjectsZonesClustersService
  183. Operations *ProjectsZonesOperationsService
  184. }
  185. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  186. rs := &ProjectsZonesClustersService{s: s}
  187. rs.NodePools = NewProjectsZonesClustersNodePoolsService(s)
  188. return rs
  189. }
  190. type ProjectsZonesClustersService struct {
  191. s *Service
  192. NodePools *ProjectsZonesClustersNodePoolsService
  193. }
  194. func NewProjectsZonesClustersNodePoolsService(s *Service) *ProjectsZonesClustersNodePoolsService {
  195. rs := &ProjectsZonesClustersNodePoolsService{s: s}
  196. return rs
  197. }
  198. type ProjectsZonesClustersNodePoolsService struct {
  199. s *Service
  200. }
  201. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  202. rs := &ProjectsZonesOperationsService{s: s}
  203. return rs
  204. }
  205. type ProjectsZonesOperationsService struct {
  206. s *Service
  207. }
  208. // AcceleratorConfig: AcceleratorConfig represents a Hardware
  209. // Accelerator request.
  210. type AcceleratorConfig struct {
  211. // AcceleratorCount: The number of the accelerator cards exposed to an
  212. // instance.
  213. AcceleratorCount int64 `json:"acceleratorCount,omitempty,string"`
  214. // AcceleratorType: The accelerator type resource name. List of
  215. // supported accelerators
  216. // [here](/compute/docs/gpus/#Introduction)
  217. AcceleratorType string `json:"acceleratorType,omitempty"`
  218. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  219. // unconditionally include in API requests. By default, fields with
  220. // empty values are omitted from API requests. However, any non-pointer,
  221. // non-interface field appearing in ForceSendFields will be sent to the
  222. // server regardless of whether the field is empty or not. This may be
  223. // used to include empty fields in Patch requests.
  224. ForceSendFields []string `json:"-"`
  225. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  226. // include in API requests with the JSON null value. By default, fields
  227. // with empty values are omitted from API requests. However, any field
  228. // with an empty value appearing in NullFields will be sent to the
  229. // server as null. It is an error if a field in this list has a
  230. // non-empty value. This may be used to include null fields in Patch
  231. // requests.
  232. NullFields []string `json:"-"`
  233. }
  234. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  235. type NoMethod AcceleratorConfig
  236. raw := NoMethod(*s)
  237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  238. }
  239. // AddonsConfig: Configuration for the addons that can be automatically
  240. // spun up in the
  241. // cluster, enabling additional functionality.
  242. type AddonsConfig struct {
  243. // HorizontalPodAutoscaling: Configuration for the horizontal pod
  244. // autoscaling feature, which
  245. // increases or decreases the number of replica pods a replication
  246. // controller
  247. // has based on the resource usage of the existing pods.
  248. HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
  249. // HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
  250. // controller addon, which
  251. // makes it easy to set up HTTP load balancers for services in a
  252. // cluster.
  253. HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
  254. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  255. KubernetesDashboard *KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
  256. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  257. // tracks whether the addon
  258. // is enabled or not on the Master, it does not track whether network
  259. // policy
  260. // is enabled for the nodes.
  261. NetworkPolicyConfig *NetworkPolicyConfig `json:"networkPolicyConfig,omitempty"`
  262. // ForceSendFields is a list of field names (e.g.
  263. // "HorizontalPodAutoscaling") to unconditionally include in API
  264. // requests. By default, fields with empty values are omitted from API
  265. // requests. However, any non-pointer, non-interface field appearing in
  266. // ForceSendFields will be sent to the server regardless of whether the
  267. // field is empty or not. This may be used to include empty fields in
  268. // Patch requests.
  269. ForceSendFields []string `json:"-"`
  270. // NullFields is a list of field names (e.g. "HorizontalPodAutoscaling")
  271. // to include in API requests with the JSON null value. By default,
  272. // fields with empty values are omitted from API requests. However, any
  273. // field with an empty value appearing in NullFields will be sent to the
  274. // server as null. It is an error if a field in this list has a
  275. // non-empty value. This may be used to include null fields in Patch
  276. // requests.
  277. NullFields []string `json:"-"`
  278. }
  279. func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
  280. type NoMethod AddonsConfig
  281. raw := NoMethod(*s)
  282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  283. }
  284. // AutoUpgradeOptions: AutoUpgradeOptions defines the set of options for
  285. // the user to control how
  286. // the Auto Upgrades will proceed.
  287. type AutoUpgradeOptions struct {
  288. // AutoUpgradeStartTime: [Output only] This field is set when upgrades
  289. // are about to commence
  290. // with the approximate start time for the upgrades,
  291. // in
  292. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  293. AutoUpgradeStartTime string `json:"autoUpgradeStartTime,omitempty"`
  294. // Description: [Output only] This field is set when upgrades are about
  295. // to commence
  296. // with the description of the upgrade.
  297. Description string `json:"description,omitempty"`
  298. // ForceSendFields is a list of field names (e.g.
  299. // "AutoUpgradeStartTime") to unconditionally include in API requests.
  300. // By default, fields with empty values are omitted from API requests.
  301. // However, any non-pointer, non-interface field appearing in
  302. // ForceSendFields will be sent to the server regardless of whether the
  303. // field is empty or not. This may be used to include empty fields in
  304. // Patch requests.
  305. ForceSendFields []string `json:"-"`
  306. // NullFields is a list of field names (e.g. "AutoUpgradeStartTime") to
  307. // include in API requests with the JSON null value. By default, fields
  308. // with empty values are omitted from API requests. However, any field
  309. // with an empty value appearing in NullFields will be sent to the
  310. // server as null. It is an error if a field in this list has a
  311. // non-empty value. This may be used to include null fields in Patch
  312. // requests.
  313. NullFields []string `json:"-"`
  314. }
  315. func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) {
  316. type NoMethod AutoUpgradeOptions
  317. raw := NoMethod(*s)
  318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  319. }
  320. // CancelOperationRequest: CancelOperationRequest cancels a single
  321. // operation.
  322. type CancelOperationRequest struct {
  323. // Name: The name (project, location, operation id) of the operation to
  324. // cancel.
  325. // Specified in the format 'projects/*/locations/*/operations/*'.
  326. Name string `json:"name,omitempty"`
  327. // OperationId: Deprecated. The server-assigned `name` of the
  328. // operation.
  329. // This field has been deprecated and replaced by the name field.
  330. OperationId string `json:"operationId,omitempty"`
  331. // ProjectId: Deprecated. The Google Developers Console [project ID or
  332. // project
  333. // number](https://support.google.com/cloud/answer/6158840).
  334. // This
  335. // field has been deprecated and replaced by the name field.
  336. ProjectId string `json:"projectId,omitempty"`
  337. // Zone: Deprecated. The name of the Google Compute
  338. // Engine
  339. // [zone](/compute/docs/zones#available) in which the operation
  340. // resides.
  341. // This field has been deprecated and replaced by the name field.
  342. Zone string `json:"zone,omitempty"`
  343. // ForceSendFields is a list of field names (e.g. "Name") to
  344. // unconditionally include in API requests. By default, fields with
  345. // empty values are omitted from API requests. However, any non-pointer,
  346. // non-interface field appearing in ForceSendFields will be sent to the
  347. // server regardless of whether the field is empty or not. This may be
  348. // used to include empty fields in Patch requests.
  349. ForceSendFields []string `json:"-"`
  350. // NullFields is a list of field names (e.g. "Name") to include in API
  351. // requests with the JSON null value. By default, fields with empty
  352. // values are omitted from API requests. However, any field with an
  353. // empty value appearing in NullFields will be sent to the server as
  354. // null. It is an error if a field in this list has a non-empty value.
  355. // This may be used to include null fields in Patch requests.
  356. NullFields []string `json:"-"`
  357. }
  358. func (s *CancelOperationRequest) MarshalJSON() ([]byte, error) {
  359. type NoMethod CancelOperationRequest
  360. raw := NoMethod(*s)
  361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  362. }
  363. // CidrBlock: CidrBlock contains an optional name and one CIDR block.
  364. type CidrBlock struct {
  365. // CidrBlock: cidr_block must be specified in CIDR notation.
  366. CidrBlock string `json:"cidrBlock,omitempty"`
  367. // DisplayName: display_name is an optional field for users to identify
  368. // CIDR blocks.
  369. DisplayName string `json:"displayName,omitempty"`
  370. // ForceSendFields is a list of field names (e.g. "CidrBlock") to
  371. // unconditionally include in API requests. By default, fields with
  372. // empty values are omitted from API requests. However, any non-pointer,
  373. // non-interface field appearing in ForceSendFields will be sent to the
  374. // server regardless of whether the field is empty or not. This may be
  375. // used to include empty fields in Patch requests.
  376. ForceSendFields []string `json:"-"`
  377. // NullFields is a list of field names (e.g. "CidrBlock") to include in
  378. // API requests with the JSON null value. By default, fields with empty
  379. // values are omitted from API requests. However, any field with an
  380. // empty value appearing in NullFields will be sent to the server as
  381. // null. It is an error if a field in this list has a non-empty value.
  382. // This may be used to include null fields in Patch requests.
  383. NullFields []string `json:"-"`
  384. }
  385. func (s *CidrBlock) MarshalJSON() ([]byte, error) {
  386. type NoMethod CidrBlock
  387. raw := NoMethod(*s)
  388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  389. }
  390. // ClientCertificateConfig: Configuration for client certificates on the
  391. // cluster.
  392. type ClientCertificateConfig struct {
  393. // IssueClientCertificate: Issue a client certificate.
  394. IssueClientCertificate bool `json:"issueClientCertificate,omitempty"`
  395. // ForceSendFields is a list of field names (e.g.
  396. // "IssueClientCertificate") to unconditionally include in API requests.
  397. // By default, fields with empty values are omitted from API requests.
  398. // However, any non-pointer, non-interface field appearing in
  399. // ForceSendFields will be sent to the server regardless of whether the
  400. // field is empty or not. This may be used to include empty fields in
  401. // Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. // NullFields is a list of field names (e.g. "IssueClientCertificate")
  404. // to include in API requests with the JSON null value. By default,
  405. // fields with empty values are omitted from API requests. However, any
  406. // field with an empty value appearing in NullFields will be sent to the
  407. // server as null. It is an error if a field in this list has a
  408. // non-empty value. This may be used to include null fields in Patch
  409. // requests.
  410. NullFields []string `json:"-"`
  411. }
  412. func (s *ClientCertificateConfig) MarshalJSON() ([]byte, error) {
  413. type NoMethod ClientCertificateConfig
  414. raw := NoMethod(*s)
  415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  416. }
  417. // Cluster: A Google Kubernetes Engine cluster.
  418. type Cluster struct {
  419. // AddonsConfig: Configurations for the various addons available to run
  420. // in the cluster.
  421. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  422. // ClusterIpv4Cidr: The IP address range of the container pods in this
  423. // cluster,
  424. // in
  425. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  426. //
  427. // notation (e.g. `10.96.0.0/14`). Leave blank to have
  428. // one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  429. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  430. // Conditions: Which conditions caused the current cluster state.
  431. Conditions []*StatusCondition `json:"conditions,omitempty"`
  432. // CreateTime: [Output only] The time the cluster was created,
  433. // in
  434. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  435. CreateTime string `json:"createTime,omitempty"`
  436. // CurrentMasterVersion: [Output only] The current software version of
  437. // the master endpoint.
  438. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  439. // CurrentNodeCount: [Output only] The number of nodes currently in the
  440. // cluster. Deprecated.
  441. // Call Kubernetes API directly to retrieve node information.
  442. CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
  443. // CurrentNodeVersion: [Output only] Deprecated,
  444. // use
  445. // [NodePool.version](/kubernetes-engine/docs/reference/rest/v1/proje
  446. // cts.zones.clusters.nodePool)
  447. // instead. The current version of the node software components. If they
  448. // are
  449. // currently at multiple versions because they're in the process of
  450. // being
  451. // upgraded, this reflects the minimum version of all nodes.
  452. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  453. // Description: An optional description of this cluster.
  454. Description string `json:"description,omitempty"`
  455. // EnableKubernetesAlpha: Kubernetes alpha features are enabled on this
  456. // cluster. This includes alpha
  457. // API groups (e.g. v1alpha1) and features that may not be production
  458. // ready in
  459. // the kubernetes version of the master and nodes.
  460. // The cluster has no SLA for uptime and master/node upgrades are
  461. // disabled.
  462. // Alpha enabled clusters are automatically deleted thirty days
  463. // after
  464. // creation.
  465. EnableKubernetesAlpha bool `json:"enableKubernetesAlpha,omitempty"`
  466. // Endpoint: [Output only] The IP address of this cluster's master
  467. // endpoint.
  468. // The endpoint can be accessed from the internet
  469. // at
  470. // `https://username:password@endpoint/`.
  471. //
  472. // See the `masterAuth` property of this resource for username
  473. // and
  474. // password information.
  475. Endpoint string `json:"endpoint,omitempty"`
  476. // ExpireTime: [Output only] The time the cluster will be
  477. // automatically
  478. // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
  479. // format.
  480. ExpireTime string `json:"expireTime,omitempty"`
  481. // InitialClusterVersion: The initial Kubernetes version for this
  482. // cluster. Valid versions are those
  483. // found in validMasterVersions returned by getServerConfig. The
  484. // version can
  485. // be upgraded over time; such upgrades are reflected
  486. // in
  487. // currentMasterVersion and currentNodeVersion.
  488. //
  489. // Users may specify either explicit versions offered by
  490. // Kubernetes Engine or version aliases, which have the following
  491. // behavior:
  492. //
  493. // - "latest": picks the highest valid Kubernetes version
  494. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  495. // version
  496. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  497. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  498. // - "","-": picks the default Kubernetes version
  499. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  500. // InitialNodeCount: The number of nodes to create in this cluster. You
  501. // must ensure that your
  502. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  503. // quota</a>
  504. // is sufficient for this number of instances. You must also have
  505. // available
  506. // firewall and routes quota.
  507. // For requests, this field should only be used in lieu of a
  508. // "node_pool" object, since this configuration (along with
  509. // the
  510. // "node_config") will be used to create a "NodePool" object with
  511. // an
  512. // auto-generated name. Do not use this and a node_pool at the same
  513. // time.
  514. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  515. // InstanceGroupUrls: Deprecated. Use node_pools.instance_group_urls.
  516. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  517. // IpAllocationPolicy: Configuration for cluster IP allocation.
  518. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  519. // LabelFingerprint: The fingerprint of the set of labels for this
  520. // cluster.
  521. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  522. // LegacyAbac: Configuration for the legacy ABAC authorization mode.
  523. LegacyAbac *LegacyAbac `json:"legacyAbac,omitempty"`
  524. // Location: [Output only] The name of the Google Compute
  525. // Engine
  526. // [zone](/compute/docs/regions-zones/regions-zones#available)
  527. // or
  528. // [region](/compute/docs/regions-zones/regions-zones#available) in
  529. // which
  530. // the cluster resides.
  531. Location string `json:"location,omitempty"`
  532. // Locations: The list of Google Compute
  533. // Engine
  534. // [zones](/compute/docs/zones#available) in which the cluster's
  535. // nodes
  536. // should be located.
  537. Locations []string `json:"locations,omitempty"`
  538. // LoggingService: The logging service the cluster should use to write
  539. // logs.
  540. // Currently available options:
  541. //
  542. // * `logging.googleapis.com` - the Google Cloud Logging service.
  543. // * `none` - no logs will be exported from the cluster.
  544. // * if left as an empty string,`logging.googleapis.com` will be used.
  545. LoggingService string `json:"loggingService,omitempty"`
  546. // MaintenancePolicy: Configure the maintenance policy for this cluster.
  547. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  548. // MasterAuth: The authentication information for accessing the master
  549. // endpoint.
  550. // If unspecified, the defaults are used:
  551. // For clusters before v1.12, if master_auth is unspecified, `username`
  552. // will
  553. // be set to "admin", a random password will be generated, and a
  554. // client
  555. // certificate will be issued.
  556. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  557. // MasterAuthorizedNetworksConfig: The configuration options for master
  558. // authorized networks feature.
  559. MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworksConfig,omitempty"`
  560. // MonitoringService: The monitoring service the cluster should use to
  561. // write metrics.
  562. // Currently available options:
  563. //
  564. // * `monitoring.googleapis.com` - the Google Cloud Monitoring
  565. // service.
  566. // * `none` - no metrics will be exported from the cluster.
  567. // * if left as an empty string, `monitoring.googleapis.com` will be
  568. // used.
  569. MonitoringService string `json:"monitoringService,omitempty"`
  570. // Name: The name of this cluster. The name must be unique within this
  571. // project
  572. // and zone, and can be up to 40 characters with the following
  573. // restrictions:
  574. //
  575. // * Lowercase letters, numbers, and hyphens only.
  576. // * Must start with a letter.
  577. // * Must end with a number or a letter.
  578. Name string `json:"name,omitempty"`
  579. // Network: The name of the Google Compute
  580. // Engine
  581. // [network](/compute/docs/networks-and-firewalls#networks) to which
  582. // the
  583. // cluster is connected. If left unspecified, the `default` network
  584. // will be used.
  585. Network string `json:"network,omitempty"`
  586. // NetworkConfig: Configuration for cluster networking.
  587. NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
  588. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  589. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  590. // NodeConfig: Parameters used in creating the cluster's nodes.
  591. // See `nodeConfig` for the description of its properties.
  592. // For requests, this field should only be used in lieu of a
  593. // "node_pool" object, since this configuration (along with
  594. // the
  595. // "initial_node_count") will be used to create a "NodePool" object with
  596. // an
  597. // auto-generated name. Do not use this and a node_pool at the same
  598. // time.
  599. // For responses, this field will be populated with the node
  600. // configuration of
  601. // the first node pool.
  602. //
  603. // If unspecified, the defaults are used.
  604. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  605. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  606. // node for hosting
  607. // containers. This is provisioned from within the
  608. // `container_ipv4_cidr`
  609. // range.
  610. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  611. // NodePools: The node pools associated with this cluster.
  612. // This field should not be set if "node_config" or "initial_node_count"
  613. // are
  614. // specified.
  615. NodePools []*NodePool `json:"nodePools,omitempty"`
  616. // PrivateClusterConfig: Configuration for private cluster.
  617. PrivateClusterConfig *PrivateClusterConfig `json:"privateClusterConfig,omitempty"`
  618. // ResourceLabels: The resource labels for the cluster to use to
  619. // annotate any related
  620. // Google Compute Engine resources.
  621. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  622. // SelfLink: [Output only] Server-defined URL for the resource.
  623. SelfLink string `json:"selfLink,omitempty"`
  624. // ServicesIpv4Cidr: [Output only] The IP address range of the
  625. // Kubernetes services in
  626. // this cluster,
  627. // in
  628. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  629. //
  630. // notation (e.g. `1.2.3.4/29`). Service addresses are
  631. // typically put in the last `/16` from the container CIDR.
  632. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  633. // Status: [Output only] The current status of this cluster.
  634. //
  635. // Possible values:
  636. // "STATUS_UNSPECIFIED" - Not set.
  637. // "PROVISIONING" - The PROVISIONING state indicates the cluster is
  638. // being created.
  639. // "RUNNING" - The RUNNING state indicates the cluster has been
  640. // created and is fully
  641. // usable.
  642. // "RECONCILING" - The RECONCILING state indicates that some work is
  643. // actively being done on
  644. // the cluster, such as upgrading the master or node software. Details
  645. // can
  646. // be found in the `statusMessage` field.
  647. // "STOPPING" - The STOPPING state indicates the cluster is being
  648. // deleted.
  649. // "ERROR" - The ERROR state indicates the cluster may be unusable.
  650. // Details
  651. // can be found in the `statusMessage` field.
  652. // "DEGRADED" - The DEGRADED state indicates the cluster requires user
  653. // action to restore
  654. // full functionality. Details can be found in the `statusMessage`
  655. // field.
  656. Status string `json:"status,omitempty"`
  657. // StatusMessage: [Output only] Additional information about the current
  658. // status of this
  659. // cluster, if available.
  660. StatusMessage string `json:"statusMessage,omitempty"`
  661. // Subnetwork: The name of the Google Compute
  662. // Engine
  663. // [subnetwork](/compute/docs/subnetworks) to which the
  664. // cluster is connected.
  665. Subnetwork string `json:"subnetwork,omitempty"`
  666. // Zone: [Output only] The name of the Google Compute
  667. // Engine
  668. // [zone](/compute/docs/zones#available) in which the
  669. // cluster
  670. // resides.
  671. // This field is deprecated, use location instead.
  672. Zone string `json:"zone,omitempty"`
  673. // ServerResponse contains the HTTP response code and headers from the
  674. // server.
  675. googleapi.ServerResponse `json:"-"`
  676. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  677. // unconditionally include in API requests. By default, fields with
  678. // empty values are omitted from API requests. However, any non-pointer,
  679. // non-interface field appearing in ForceSendFields will be sent to the
  680. // server regardless of whether the field is empty or not. This may be
  681. // used to include empty fields in Patch requests.
  682. ForceSendFields []string `json:"-"`
  683. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  684. // in API requests with the JSON null value. By default, fields with
  685. // empty values are omitted from API requests. However, any field with
  686. // an empty value appearing in NullFields will be sent to the server as
  687. // null. It is an error if a field in this list has a non-empty value.
  688. // This may be used to include null fields in Patch requests.
  689. NullFields []string `json:"-"`
  690. }
  691. func (s *Cluster) MarshalJSON() ([]byte, error) {
  692. type NoMethod Cluster
  693. raw := NoMethod(*s)
  694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  695. }
  696. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  697. // Exactly one update can
  698. // be applied to a cluster with each request, so at most one field can
  699. // be
  700. // provided.
  701. type ClusterUpdate struct {
  702. // DesiredAddonsConfig: Configurations for the various addons available
  703. // to run in the cluster.
  704. DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
  705. // DesiredImageType: The desired image type for the node pool.
  706. // NOTE: Set the "desired_node_pool" field as well.
  707. DesiredImageType string `json:"desiredImageType,omitempty"`
  708. // DesiredLocations: The desired list of Google Compute
  709. // Engine
  710. // [zones](/compute/docs/zones#available) in which the cluster's
  711. // nodes
  712. // should be located. Changing the locations a cluster is in will
  713. // result
  714. // in nodes being either created or removed from the cluster, depending
  715. // on
  716. // whether locations are being added or removed.
  717. //
  718. // This list must always include the cluster's primary zone.
  719. DesiredLocations []string `json:"desiredLocations,omitempty"`
  720. // DesiredMasterAuthorizedNetworksConfig: The desired configuration
  721. // options for master authorized networks feature.
  722. DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"desiredMasterAuthorizedNetworksConfig,omitempty"`
  723. // DesiredMasterVersion: The Kubernetes version to change the master
  724. // to.
  725. //
  726. // Users may specify either explicit versions offered by
  727. // Kubernetes Engine or version aliases, which have the following
  728. // behavior:
  729. //
  730. // - "latest": picks the highest valid Kubernetes version
  731. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  732. // version
  733. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  734. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  735. // - "-": picks the default Kubernetes version
  736. DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
  737. // DesiredMonitoringService: The monitoring service the cluster should
  738. // use to write metrics.
  739. // Currently available options:
  740. //
  741. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  742. // * "none" - no metrics will be exported from the cluster
  743. DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
  744. // DesiredNodePoolAutoscaling: Autoscaler configuration for the node
  745. // pool specified in
  746. // desired_node_pool_id. If there is only one pool in the
  747. // cluster and desired_node_pool_id is not provided then
  748. // the change applies to that single node pool.
  749. DesiredNodePoolAutoscaling *NodePoolAutoscaling `json:"desiredNodePoolAutoscaling,omitempty"`
  750. // DesiredNodePoolId: The node pool to be upgraded. This field is
  751. // mandatory if
  752. // "desired_node_version", "desired_image_family"
  753. // or
  754. // "desired_node_pool_autoscaling" is specified and there is more than
  755. // one
  756. // node pool on the cluster.
  757. DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
  758. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  759. // (typically an
  760. // upgrade).
  761. //
  762. // Users may specify either explicit versions offered by
  763. // Kubernetes Engine or version aliases, which have the following
  764. // behavior:
  765. //
  766. // - "latest": picks the highest valid Kubernetes version
  767. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  768. // version
  769. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  770. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  771. // - "-": picks the Kubernetes master version
  772. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  773. // ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
  774. // to unconditionally include in API requests. By default, fields with
  775. // empty values are omitted from API requests. However, any non-pointer,
  776. // non-interface field appearing in ForceSendFields will be sent to the
  777. // server regardless of whether the field is empty or not. This may be
  778. // used to include empty fields in Patch requests.
  779. ForceSendFields []string `json:"-"`
  780. // NullFields is a list of field names (e.g. "DesiredAddonsConfig") to
  781. // include in API requests with the JSON null value. By default, fields
  782. // with empty values are omitted from API requests. However, any field
  783. // with an empty value appearing in NullFields will be sent to the
  784. // server as null. It is an error if a field in this list has a
  785. // non-empty value. This may be used to include null fields in Patch
  786. // requests.
  787. NullFields []string `json:"-"`
  788. }
  789. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  790. type NoMethod ClusterUpdate
  791. raw := NoMethod(*s)
  792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  793. }
  794. // CompleteIPRotationRequest: CompleteIPRotationRequest moves the
  795. // cluster master back into single-IP mode.
  796. type CompleteIPRotationRequest struct {
  797. // ClusterId: Deprecated. The name of the cluster.
  798. // This field has been deprecated and replaced by the name field.
  799. ClusterId string `json:"clusterId,omitempty"`
  800. // Name: The name (project, location, cluster id) of the cluster to
  801. // complete IP
  802. // rotation. Specified in the format
  803. // 'projects/*/locations/*/clusters/*'.
  804. Name string `json:"name,omitempty"`
  805. // ProjectId: Deprecated. The Google Developers Console [project ID or
  806. // project
  807. // number](https://developers.google.com/console/help/new/#projec
  808. // tnumber).
  809. // This field has been deprecated and replaced by the name field.
  810. ProjectId string `json:"projectId,omitempty"`
  811. // Zone: Deprecated. The name of the Google Compute
  812. // Engine
  813. // [zone](/compute/docs/zones#available) in which the
  814. // cluster
  815. // resides.
  816. // This field has been deprecated and replaced by the name field.
  817. Zone string `json:"zone,omitempty"`
  818. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  819. // unconditionally include in API requests. By default, fields with
  820. // empty values are omitted from API requests. However, any non-pointer,
  821. // non-interface field appearing in ForceSendFields will be sent to the
  822. // server regardless of whether the field is empty or not. This may be
  823. // used to include empty fields in Patch requests.
  824. ForceSendFields []string `json:"-"`
  825. // NullFields is a list of field names (e.g. "ClusterId") to include in
  826. // API requests with the JSON null value. By default, fields with empty
  827. // values are omitted from API requests. However, any field with an
  828. // empty value appearing in NullFields will be sent to the server as
  829. // null. It is an error if a field in this list has a non-empty value.
  830. // This may be used to include null fields in Patch requests.
  831. NullFields []string `json:"-"`
  832. }
  833. func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) {
  834. type NoMethod CompleteIPRotationRequest
  835. raw := NoMethod(*s)
  836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  837. }
  838. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  839. type CreateClusterRequest struct {
  840. // Cluster: A
  841. // [cluster
  842. // resource](/container-engine/reference/rest/v1/projects.zones.
  843. // clusters)
  844. Cluster *Cluster `json:"cluster,omitempty"`
  845. // Parent: The parent (project and location) where the cluster will be
  846. // created.
  847. // Specified in the format 'projects/*/locations/*'.
  848. Parent string `json:"parent,omitempty"`
  849. // ProjectId: Deprecated. The Google Developers Console [project ID or
  850. // project
  851. // number](https://support.google.com/cloud/answer/6158840).
  852. // This
  853. // field has been deprecated and replaced by the parent field.
  854. ProjectId string `json:"projectId,omitempty"`
  855. // Zone: Deprecated. The name of the Google Compute
  856. // Engine
  857. // [zone](/compute/docs/zones#available) in which the
  858. // cluster
  859. // resides.
  860. // This field has been deprecated and replaced by the parent field.
  861. Zone string `json:"zone,omitempty"`
  862. // ForceSendFields is a list of field names (e.g. "Cluster") to
  863. // unconditionally include in API requests. By default, fields with
  864. // empty values are omitted from API requests. However, any non-pointer,
  865. // non-interface field appearing in ForceSendFields will be sent to the
  866. // server regardless of whether the field is empty or not. This may be
  867. // used to include empty fields in Patch requests.
  868. ForceSendFields []string `json:"-"`
  869. // NullFields is a list of field names (e.g. "Cluster") to include in
  870. // API requests with the JSON null value. By default, fields with empty
  871. // values are omitted from API requests. However, any field with an
  872. // empty value appearing in NullFields will be sent to the server as
  873. // null. It is an error if a field in this list has a non-empty value.
  874. // This may be used to include null fields in Patch requests.
  875. NullFields []string `json:"-"`
  876. }
  877. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  878. type NoMethod CreateClusterRequest
  879. raw := NoMethod(*s)
  880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  881. }
  882. // CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
  883. // a cluster.
  884. type CreateNodePoolRequest struct {
  885. // ClusterId: Deprecated. The name of the cluster.
  886. // This field has been deprecated and replaced by the parent field.
  887. ClusterId string `json:"clusterId,omitempty"`
  888. // NodePool: The node pool to create.
  889. NodePool *NodePool `json:"nodePool,omitempty"`
  890. // Parent: The parent (project, location, cluster id) where the node
  891. // pool will be
  892. // created. Specified in the format
  893. // 'projects/*/locations/*/clusters/*'.
  894. Parent string `json:"parent,omitempty"`
  895. // ProjectId: Deprecated. The Google Developers Console [project ID or
  896. // project
  897. // number](https://developers.google.com/console/help/new/#projec
  898. // tnumber).
  899. // This field has been deprecated and replaced by the parent field.
  900. ProjectId string `json:"projectId,omitempty"`
  901. // Zone: Deprecated. The name of the Google Compute
  902. // Engine
  903. // [zone](/compute/docs/zones#available) in which the
  904. // cluster
  905. // resides.
  906. // This field has been deprecated and replaced by the parent field.
  907. Zone string `json:"zone,omitempty"`
  908. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  909. // unconditionally include in API requests. By default, fields with
  910. // empty values are omitted from API requests. However, any non-pointer,
  911. // non-interface field appearing in ForceSendFields will be sent to the
  912. // server regardless of whether the field is empty or not. This may be
  913. // used to include empty fields in Patch requests.
  914. ForceSendFields []string `json:"-"`
  915. // NullFields is a list of field names (e.g. "ClusterId") to include in
  916. // API requests with the JSON null value. By default, fields with empty
  917. // values are omitted from API requests. However, any field with an
  918. // empty value appearing in NullFields will be sent to the server as
  919. // null. It is an error if a field in this list has a non-empty value.
  920. // This may be used to include null fields in Patch requests.
  921. NullFields []string `json:"-"`
  922. }
  923. func (s *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
  924. type NoMethod CreateNodePoolRequest
  925. raw := NoMethod(*s)
  926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  927. }
  928. // DailyMaintenanceWindow: Time window specified for daily maintenance
  929. // operations.
  930. type DailyMaintenanceWindow struct {
  931. // Duration: [Output only] Duration of the time window, automatically
  932. // chosen to be
  933. // smallest possible in the given scenario.
  934. // Duration will be in
  935. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  936. // format "PTnHnMnS".
  937. Duration string `json:"duration,omitempty"`
  938. // StartTime: Time within the maintenance window to start the
  939. // maintenance operations.
  940. // Time format should be in
  941. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  942. // format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT.
  943. StartTime string `json:"startTime,omitempty"`
  944. // ForceSendFields is a list of field names (e.g. "Duration") to
  945. // unconditionally include in API requests. By default, fields with
  946. // empty values are omitted from API requests. However, any non-pointer,
  947. // non-interface field appearing in ForceSendFields will be sent to the
  948. // server regardless of whether the field is empty or not. This may be
  949. // used to include empty fields in Patch requests.
  950. ForceSendFields []string `json:"-"`
  951. // NullFields is a list of field names (e.g. "Duration") to include in
  952. // API requests with the JSON null value. By default, fields with empty
  953. // values are omitted from API requests. However, any field with an
  954. // empty value appearing in NullFields will be sent to the server as
  955. // null. It is an error if a field in this list has a non-empty value.
  956. // This may be used to include null fields in Patch requests.
  957. NullFields []string `json:"-"`
  958. }
  959. func (s *DailyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  960. type NoMethod DailyMaintenanceWindow
  961. raw := NoMethod(*s)
  962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  963. }
  964. // Empty: A generic empty message that you can re-use to avoid defining
  965. // duplicated
  966. // empty messages in your APIs. A typical example is to use it as the
  967. // request
  968. // or the response type of an API method. For instance:
  969. //
  970. // service Foo {
  971. // rpc Bar(google.protobuf.Empty) returns
  972. // (google.protobuf.Empty);
  973. // }
  974. //
  975. // The JSON representation for `Empty` is empty JSON object `{}`.
  976. type Empty struct {
  977. // ServerResponse contains the HTTP response code and headers from the
  978. // server.
  979. googleapi.ServerResponse `json:"-"`
  980. }
  981. // GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web
  982. // Key Set as specififed in rfc 7517
  983. type GetJSONWebKeysResponse struct {
  984. // Keys: The public component of the keys used by the cluster to sign
  985. // token
  986. // requests.
  987. Keys []*Jwk `json:"keys,omitempty"`
  988. // ServerResponse contains the HTTP response code and headers from the
  989. // server.
  990. googleapi.ServerResponse `json:"-"`
  991. // ForceSendFields is a list of field names (e.g. "Keys") to
  992. // unconditionally include in API requests. By default, fields with
  993. // empty values are omitted from API requests. However, any non-pointer,
  994. // non-interface field appearing in ForceSendFields will be sent to the
  995. // server regardless of whether the field is empty or not. This may be
  996. // used to include empty fields in Patch requests.
  997. ForceSendFields []string `json:"-"`
  998. // NullFields is a list of field names (e.g. "Keys") to include in API
  999. // requests with the JSON null value. By default, fields with empty
  1000. // values are omitted from API requests. However, any field with an
  1001. // empty value appearing in NullFields will be sent to the server as
  1002. // null. It is an error if a field in this list has a non-empty value.
  1003. // This may be used to include null fields in Patch requests.
  1004. NullFields []string `json:"-"`
  1005. }
  1006. func (s *GetJSONWebKeysResponse) MarshalJSON() ([]byte, error) {
  1007. type NoMethod GetJSONWebKeysResponse
  1008. raw := NoMethod(*s)
  1009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1010. }
  1011. // GetOpenIDConfigResponse: GetOpenIDConfigResponse is an OIDC discovery
  1012. // document for the cluster.
  1013. // See the OpenID Connect Discovery 1.0 specification for details.
  1014. type GetOpenIDConfigResponse struct {
  1015. // ClaimsSupported: NOLINT
  1016. ClaimsSupported []string `json:"claims_supported,omitempty"`
  1017. // GrantTypes: NOLINT
  1018. GrantTypes []string `json:"grant_types,omitempty"`
  1019. // IdTokenSigningAlgValuesSupported: NOLINT
  1020. IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported,omitempty"`
  1021. // Issuer: NOLINT
  1022. Issuer string `json:"issuer,omitempty"`
  1023. // JwksUri: NOLINT
  1024. JwksUri string `json:"jwks_uri,omitempty"`
  1025. // ResponseTypesSupported: NOLINT
  1026. ResponseTypesSupported []string `json:"response_types_supported,omitempty"`
  1027. // SubjectTypesSupported: NOLINT
  1028. SubjectTypesSupported []string `json:"subject_types_supported,omitempty"`
  1029. // ServerResponse contains the HTTP response code and headers from the
  1030. // server.
  1031. googleapi.ServerResponse `json:"-"`
  1032. // ForceSendFields is a list of field names (e.g. "ClaimsSupported") to
  1033. // unconditionally include in API requests. By default, fields with
  1034. // empty values are omitted from API requests. However, any non-pointer,
  1035. // non-interface field appearing in ForceSendFields will be sent to the
  1036. // server regardless of whether the field is empty or not. This may be
  1037. // used to include empty fields in Patch requests.
  1038. ForceSendFields []string `json:"-"`
  1039. // NullFields is a list of field names (e.g. "ClaimsSupported") to
  1040. // include in API requests with the JSON null value. By default, fields
  1041. // with empty values are omitted from API requests. However, any field
  1042. // with an empty value appearing in NullFields will be sent to the
  1043. // server as null. It is an error if a field in this list has a
  1044. // non-empty value. This may be used to include null fields in Patch
  1045. // requests.
  1046. NullFields []string `json:"-"`
  1047. }
  1048. func (s *GetOpenIDConfigResponse) MarshalJSON() ([]byte, error) {
  1049. type NoMethod GetOpenIDConfigResponse
  1050. raw := NoMethod(*s)
  1051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1052. }
  1053. // HorizontalPodAutoscaling: Configuration options for the horizontal
  1054. // pod autoscaling feature, which
  1055. // increases or decreases the number of replica pods a replication
  1056. // controller
  1057. // has based on the resource usage of the existing pods.
  1058. type HorizontalPodAutoscaling struct {
  1059. // Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
  1060. // in the cluster.
  1061. // When enabled, it ensures that a Heapster pod is running in the
  1062. // cluster,
  1063. // which is also used by the Cloud Monitoring service.
  1064. Disabled bool `json:"disabled,omitempty"`
  1065. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1066. // unconditionally include in API requests. By default, fields with
  1067. // empty values are omitted from API requests. However, any non-pointer,
  1068. // non-interface field appearing in ForceSendFields will be sent to the
  1069. // server regardless of whether the field is empty or not. This may be
  1070. // used to include empty fields in Patch requests.
  1071. ForceSendFields []string `json:"-"`
  1072. // NullFields is a list of field names (e.g. "Disabled") to include in
  1073. // API requests with the JSON null value. By default, fields with empty
  1074. // values are omitted from API requests. However, any field with an
  1075. // empty value appearing in NullFields will be sent to the server as
  1076. // null. It is an error if a field in this list has a non-empty value.
  1077. // This may be used to include null fields in Patch requests.
  1078. NullFields []string `json:"-"`
  1079. }
  1080. func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
  1081. type NoMethod HorizontalPodAutoscaling
  1082. raw := NoMethod(*s)
  1083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1084. }
  1085. // HttpLoadBalancing: Configuration options for the HTTP (L7) load
  1086. // balancing controller addon,
  1087. // which makes it easy to set up HTTP load balancers for services in a
  1088. // cluster.
  1089. type HttpLoadBalancing struct {
  1090. // Disabled: Whether the HTTP Load Balancing controller is enabled in
  1091. // the cluster.
  1092. // When enabled, it runs a small pod in the cluster that manages the
  1093. // load
  1094. // balancers.
  1095. Disabled bool `json:"disabled,omitempty"`
  1096. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1097. // unconditionally include in API requests. By default, fields with
  1098. // empty values are omitted from API requests. However, any non-pointer,
  1099. // non-interface field appearing in ForceSendFields will be sent to the
  1100. // server regardless of whether the field is empty or not. This may be
  1101. // used to include empty fields in Patch requests.
  1102. ForceSendFields []string `json:"-"`
  1103. // NullFields is a list of field names (e.g. "Disabled") to include in
  1104. // API requests with the JSON null value. By default, fields with empty
  1105. // values are omitted from API requests. However, any field with an
  1106. // empty value appearing in NullFields will be sent to the server as
  1107. // null. It is an error if a field in this list has a non-empty value.
  1108. // This may be used to include null fields in Patch requests.
  1109. NullFields []string `json:"-"`
  1110. }
  1111. func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
  1112. type NoMethod HttpLoadBalancing
  1113. raw := NoMethod(*s)
  1114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1115. }
  1116. // IPAllocationPolicy: Configuration for controlling how IPs are
  1117. // allocated in the cluster.
  1118. type IPAllocationPolicy struct {
  1119. // ClusterIpv4Cidr: This field is deprecated, use
  1120. // cluster_ipv4_cidr_block.
  1121. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  1122. // ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
  1123. // If this field is set, then
  1124. // `cluster.cluster_ipv4_cidr` must be left blank.
  1125. //
  1126. // This field is only applicable when `use_ip_aliases` is true.
  1127. //
  1128. // Set to blank to have a range chosen with the default size.
  1129. //
  1130. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1131. // specific
  1132. // netmask.
  1133. //
  1134. // Set to
  1135. // a
  1136. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1137. //
  1138. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1139. // (e.g.
  1140. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1141. // range
  1142. // to use.
  1143. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  1144. // ClusterSecondaryRangeName: The name of the secondary range to be used
  1145. // for the cluster CIDR
  1146. // block. The secondary range will be used for pod IP
  1147. // addresses. This must be an existing secondary range associated
  1148. // with the cluster subnetwork.
  1149. //
  1150. // This field is only applicable with use_ip_aliases is true
  1151. // and
  1152. // create_subnetwork is false.
  1153. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  1154. // CreateSubnetwork: Whether a new subnetwork will be created
  1155. // automatically for the cluster.
  1156. //
  1157. // This field is only applicable when `use_ip_aliases` is true.
  1158. CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
  1159. // NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
  1160. NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
  1161. // NodeIpv4CidrBlock: The IP address range of the instance IPs in this
  1162. // cluster.
  1163. //
  1164. // This is applicable only if `create_subnetwork` is true.
  1165. //
  1166. // Set to blank to have a range chosen with the default size.
  1167. //
  1168. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1169. // specific
  1170. // netmask.
  1171. //
  1172. // Set to
  1173. // a
  1174. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1175. //
  1176. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1177. // (e.g.
  1178. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1179. // range
  1180. // to use.
  1181. NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
  1182. // ServicesIpv4Cidr: This field is deprecated, use
  1183. // services_ipv4_cidr_block.
  1184. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  1185. // ServicesIpv4CidrBlock: The IP address range of the services IPs in
  1186. // this cluster. If blank, a range
  1187. // will be automatically chosen with the default size.
  1188. //
  1189. // This field is only applicable when `use_ip_aliases` is true.
  1190. //
  1191. // Set to blank to have a range chosen with the default size.
  1192. //
  1193. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1194. // specific
  1195. // netmask.
  1196. //
  1197. // Set to
  1198. // a
  1199. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1200. //
  1201. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1202. // (e.g.
  1203. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1204. // range
  1205. // to use.
  1206. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  1207. // ServicesSecondaryRangeName: The name of the secondary range to be
  1208. // used as for the services
  1209. // CIDR block. The secondary range will be used for service
  1210. // ClusterIPs. This must be an existing secondary range associated
  1211. // with the cluster subnetwork.
  1212. //
  1213. // This field is only applicable with use_ip_aliases is true
  1214. // and
  1215. // create_subnetwork is false.
  1216. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  1217. // SubnetworkName: A custom subnetwork name to be used if
  1218. // `create_subnetwork` is true. If
  1219. // this field is empty, then an automatic name will be chosen for the
  1220. // new
  1221. // subnetwork.
  1222. SubnetworkName string `json:"subnetworkName,omitempty"`
  1223. // UseIpAliases: Whether alias IPs will be used for pod IPs in the
  1224. // cluster.
  1225. UseIpAliases bool `json:"useIpAliases,omitempty"`
  1226. // ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1227. // unconditionally include in API requests. By default, fields with
  1228. // empty values are omitted from API requests. However, any non-pointer,
  1229. // non-interface field appearing in ForceSendFields will be sent to the
  1230. // server regardless of whether the field is empty or not. This may be
  1231. // used to include empty fields in Patch requests.
  1232. ForceSendFields []string `json:"-"`
  1233. // NullFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1234. // include in API requests with the JSON null value. By default, fields
  1235. // with empty values are omitted from API requests. However, any field
  1236. // with an empty value appearing in NullFields will be sent to the
  1237. // server as null. It is an error if a field in this list has a
  1238. // non-empty value. This may be used to include null fields in Patch
  1239. // requests.
  1240. NullFields []string `json:"-"`
  1241. }
  1242. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  1243. type NoMethod IPAllocationPolicy
  1244. raw := NoMethod(*s)
  1245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1246. }
  1247. // Jwk: Jwk is a JSON Web Key as specified in RFC 7517
  1248. type Jwk struct {
  1249. // Alg: NOLINT
  1250. Alg string `json:"alg,omitempty"`
  1251. // Crv: NOLINT
  1252. Crv string `json:"crv,omitempty"`
  1253. // E: NOLINT
  1254. E string `json:"e,omitempty"`
  1255. // Kid: NOLINT
  1256. Kid string `json:"kid,omitempty"`
  1257. // Kty: NOLINT
  1258. Kty string `json:"kty,omitempty"`
  1259. // N: Fields for RSA keys.
  1260. // NOLINT
  1261. N string `json:"n,omitempty"`
  1262. // Use: NOLINT
  1263. Use string `json:"use,omitempty"`
  1264. // X: Fields for ECDSA keys.
  1265. // NOLINT
  1266. X string `json:"x,omitempty"`
  1267. // Y: NOLINT
  1268. Y string `json:"y,omitempty"`
  1269. // ForceSendFields is a list of field names (e.g. "Alg") to
  1270. // unconditionally include in API requests. By default, fields with
  1271. // empty values are omitted from API requests. However, any non-pointer,
  1272. // non-interface field appearing in ForceSendFields will be sent to the
  1273. // server regardless of whether the field is empty or not. This may be
  1274. // used to include empty fields in Patch requests.
  1275. ForceSendFields []string `json:"-"`
  1276. // NullFields is a list of field names (e.g. "Alg") to include in API
  1277. // requests with the JSON null value. By default, fields with empty
  1278. // values are omitted from API requests. However, any field with an
  1279. // empty value appearing in NullFields will be sent to the server as
  1280. // null. It is an error if a field in this list has a non-empty value.
  1281. // This may be used to include null fields in Patch requests.
  1282. NullFields []string `json:"-"`
  1283. }
  1284. func (s *Jwk) MarshalJSON() ([]byte, error) {
  1285. type NoMethod Jwk
  1286. raw := NoMethod(*s)
  1287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1288. }
  1289. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  1290. type KubernetesDashboard struct {
  1291. // Disabled: Whether the Kubernetes Dashboard is enabled for this
  1292. // cluster.
  1293. Disabled bool `json:"disabled,omitempty"`
  1294. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1295. // unconditionally include in API requests. By default, fields with
  1296. // empty values are omitted from API requests. However, any non-pointer,
  1297. // non-interface field appearing in ForceSendFields will be sent to the
  1298. // server regardless of whether the field is empty or not. This may be
  1299. // used to include empty fields in Patch requests.
  1300. ForceSendFields []string `json:"-"`
  1301. // NullFields is a list of field names (e.g. "Disabled") to include in
  1302. // API requests with the JSON null value. By default, fields with empty
  1303. // values are omitted from API requests. However, any field with an
  1304. // empty value appearing in NullFields will be sent to the server as
  1305. // null. It is an error if a field in this list has a non-empty value.
  1306. // This may be used to include null fields in Patch requests.
  1307. NullFields []string `json:"-"`
  1308. }
  1309. func (s *KubernetesDashboard) MarshalJSON() ([]byte, error) {
  1310. type NoMethod KubernetesDashboard
  1311. raw := NoMethod(*s)
  1312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1313. }
  1314. // LegacyAbac: Configuration for the legacy Attribute Based Access
  1315. // Control authorization
  1316. // mode.
  1317. type LegacyAbac struct {
  1318. // Enabled: Whether the ABAC authorizer is enabled for this cluster.
  1319. // When enabled,
  1320. // identities in the system, including service accounts, nodes,
  1321. // and
  1322. // controllers, will have statically granted permissions beyond
  1323. // those
  1324. // provided by the RBAC configuration or IAM.
  1325. Enabled bool `json:"enabled,omitempty"`
  1326. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1327. // unconditionally include in API requests. By default, fields with
  1328. // empty values are omitted from API requests. However, any non-pointer,
  1329. // non-interface field appearing in ForceSendFields will be sent to the
  1330. // server regardless of whether the field is empty or not. This may be
  1331. // used to include empty fields in Patch requests.
  1332. ForceSendFields []string `json:"-"`
  1333. // NullFields is a list of field names (e.g. "Enabled") to include in
  1334. // API requests with the JSON null value. By default, fields with empty
  1335. // values are omitted from API requests. However, any field with an
  1336. // empty value appearing in NullFields will be sent to the server as
  1337. // null. It is an error if a field in this list has a non-empty value.
  1338. // This may be used to include null fields in Patch requests.
  1339. NullFields []string `json:"-"`
  1340. }
  1341. func (s *LegacyAbac) MarshalJSON() ([]byte, error) {
  1342. type NoMethod LegacyAbac
  1343. raw := NoMethod(*s)
  1344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1345. }
  1346. // ListClustersResponse: ListClustersResponse is the result of
  1347. // ListClustersRequest.
  1348. type ListClustersResponse struct {
  1349. // Clusters: A list of clusters in the project in the specified zone,
  1350. // or
  1351. // across all ones.
  1352. Clusters []*Cluster `json:"clusters,omitempty"`
  1353. // MissingZones: If any zones are listed here, the list of clusters
  1354. // returned
  1355. // may be missing those zones.
  1356. MissingZones []string `json:"missingZones,omitempty"`
  1357. // ServerResponse contains the HTTP response code and headers from the
  1358. // server.
  1359. googleapi.ServerResponse `json:"-"`
  1360. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1361. // unconditionally include in API requests. By default, fields with
  1362. // empty values are omitted from API requests. However, any non-pointer,
  1363. // non-interface field appearing in ForceSendFields will be sent to the
  1364. // server regardless of whether the field is empty or not. This may be
  1365. // used to include empty fields in Patch requests.
  1366. ForceSendFields []string `json:"-"`
  1367. // NullFields is a list of field names (e.g. "Clusters") to include in
  1368. // API requests with the JSON null value. By default, fields with empty
  1369. // values are omitted from API requests. However, any field with an
  1370. // empty value appearing in NullFields will be sent to the server as
  1371. // null. It is an error if a field in this list has a non-empty value.
  1372. // This may be used to include null fields in Patch requests.
  1373. NullFields []string `json:"-"`
  1374. }
  1375. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1376. type NoMethod ListClustersResponse
  1377. raw := NoMethod(*s)
  1378. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1379. }
  1380. // ListNodePoolsResponse: ListNodePoolsResponse is the result of
  1381. // ListNodePoolsRequest.
  1382. type ListNodePoolsResponse struct {
  1383. // NodePools: A list of node pools for a cluster.
  1384. NodePools []*NodePool `json:"nodePools,omitempty"`
  1385. // ServerResponse contains the HTTP response code and headers from the
  1386. // server.
  1387. googleapi.ServerResponse `json:"-"`
  1388. // ForceSendFields is a list of field names (e.g. "NodePools") to
  1389. // unconditionally include in API requests. By default, fields with
  1390. // empty values are omitted from API requests. However, any non-pointer,
  1391. // non-interface field appearing in ForceSendFields will be sent to the
  1392. // server regardless of whether the field is empty or not. This may be
  1393. // used to include empty fields in Patch requests.
  1394. ForceSendFields []string `json:"-"`
  1395. // NullFields is a list of field names (e.g. "NodePools") to include in
  1396. // API requests with the JSON null value. By default, fields with empty
  1397. // values are omitted from API requests. However, any field with an
  1398. // empty value appearing in NullFields will be sent to the server as
  1399. // null. It is an error if a field in this list has a non-empty value.
  1400. // This may be used to include null fields in Patch requests.
  1401. NullFields []string `json:"-"`
  1402. }
  1403. func (s *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
  1404. type NoMethod ListNodePoolsResponse
  1405. raw := NoMethod(*s)
  1406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1407. }
  1408. // ListOperationsResponse: ListOperationsResponse is the result of
  1409. // ListOperationsRequest.
  1410. type ListOperationsResponse struct {
  1411. // MissingZones: If any zones are listed here, the list of operations
  1412. // returned
  1413. // may be missing the operations from those zones.
  1414. MissingZones []string `json:"missingZones,omitempty"`
  1415. // Operations: A list of operations in the project in the specified
  1416. // zone.
  1417. Operations []*Operation `json:"operations,omitempty"`
  1418. // ServerResponse contains the HTTP response code and headers from the
  1419. // server.
  1420. googleapi.ServerResponse `json:"-"`
  1421. // ForceSendFields is a list of field names (e.g. "MissingZones") to
  1422. // unconditionally include in API requests. By default, fields with
  1423. // empty values are omitted from API requests. However, any non-pointer,
  1424. // non-interface field appearing in ForceSendFields will be sent to the
  1425. // server regardless of whether the field is empty or not. This may be
  1426. // used to include empty fields in Patch requests.
  1427. ForceSendFields []string `json:"-"`
  1428. // NullFields is a list of field names (e.g. "MissingZones") to include
  1429. // in API requests with the JSON null value. By default, fields with
  1430. // empty values are omitted from API requests. However, any field with
  1431. // an empty value appearing in NullFields will be sent to the server as
  1432. // null. It is an error if a field in this list has a non-empty value.
  1433. // This may be used to include null fields in Patch requests.
  1434. NullFields []string `json:"-"`
  1435. }
  1436. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1437. type NoMethod ListOperationsResponse
  1438. raw := NoMethod(*s)
  1439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1440. }
  1441. // MaintenancePolicy: MaintenancePolicy defines the maintenance policy
  1442. // to be used for the cluster.
  1443. type MaintenancePolicy struct {
  1444. // Window: Specifies the maintenance window in which maintenance may be
  1445. // performed.
  1446. Window *MaintenanceWindow `json:"window,omitempty"`
  1447. // ForceSendFields is a list of field names (e.g. "Window") to
  1448. // unconditionally include in API requests. By default, fields with
  1449. // empty values are omitted from API requests. However, any non-pointer,
  1450. // non-interface field appearing in ForceSendFields will be sent to the
  1451. // server regardless of whether the field is empty or not. This may be
  1452. // used to include empty fields in Patch requests.
  1453. ForceSendFields []string `json:"-"`
  1454. // NullFields is a list of field names (e.g. "Window") to include in API
  1455. // requests with the JSON null value. By default, fields with empty
  1456. // values are omitted from API requests. However, any field with an
  1457. // empty value appearing in NullFields will be sent to the server as
  1458. // null. It is an error if a field in this list has a non-empty value.
  1459. // This may be used to include null fields in Patch requests.
  1460. NullFields []string `json:"-"`
  1461. }
  1462. func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
  1463. type NoMethod MaintenancePolicy
  1464. raw := NoMethod(*s)
  1465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1466. }
  1467. // MaintenanceWindow: MaintenanceWindow defines the maintenance window
  1468. // to be used for the cluster.
  1469. type MaintenanceWindow struct {
  1470. // DailyMaintenanceWindow: DailyMaintenanceWindow specifies a daily
  1471. // maintenance operation window.
  1472. DailyMaintenanceWindow *DailyMaintenanceWindow `json:"dailyMaintenanceWindow,omitempty"`
  1473. // ForceSendFields is a list of field names (e.g.
  1474. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  1475. // By default, fields with empty values are omitted from API requests.
  1476. // However, any non-pointer, non-interface field appearing in
  1477. // ForceSendFields will be sent to the server regardless of whether the
  1478. // field is empty or not. This may be used to include empty fields in
  1479. // Patch requests.
  1480. ForceSendFields []string `json:"-"`
  1481. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  1482. // to include in API requests with the JSON null value. By default,
  1483. // fields with empty values are omitted from API requests. However, any
  1484. // field with an empty value appearing in NullFields will be sent to the
  1485. // server as null. It is an error if a field in this list has a
  1486. // non-empty value. This may be used to include null fields in Patch
  1487. // requests.
  1488. NullFields []string `json:"-"`
  1489. }
  1490. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1491. type NoMethod MaintenanceWindow
  1492. raw := NoMethod(*s)
  1493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1494. }
  1495. // MasterAuth: The authentication information for accessing the master
  1496. // endpoint.
  1497. // Authentication can be done using HTTP basic auth or using
  1498. // client
  1499. // certificates.
  1500. type MasterAuth struct {
  1501. // ClientCertificate: [Output only] Base64-encoded public certificate
  1502. // used by clients to
  1503. // authenticate to the cluster endpoint.
  1504. ClientCertificate string `json:"clientCertificate,omitempty"`
  1505. // ClientCertificateConfig: Configuration for client certificate
  1506. // authentication on the cluster. For
  1507. // clusters before v1.12, if no configuration is specified, a
  1508. // client
  1509. // certificate is issued.
  1510. ClientCertificateConfig *ClientCertificateConfig `json:"clientCertificateConfig,omitempty"`
  1511. // ClientKey: [Output only] Base64-encoded private key used by clients
  1512. // to authenticate
  1513. // to the cluster endpoint.
  1514. ClientKey string `json:"clientKey,omitempty"`
  1515. // ClusterCaCertificate: [Output only] Base64-encoded public certificate
  1516. // that is the root of
  1517. // trust for the cluster.
  1518. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  1519. // Password: The password to use for HTTP basic authentication to the
  1520. // master endpoint.
  1521. // Because the master endpoint is open to the Internet, you should
  1522. // create a
  1523. // strong password. If a password is provided for cluster creation,
  1524. // username
  1525. // must be non-empty.
  1526. Password string `json:"password,omitempty"`
  1527. // Username: The username to use for HTTP basic authentication to the
  1528. // master endpoint.
  1529. // For clusters v1.6.0 and later, basic authentication can be disabled
  1530. // by
  1531. // leaving username unspecified (or setting it to the empty string).
  1532. Username string `json:"username,omitempty"`
  1533. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  1534. // to unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. // NullFields is a list of field names (e.g. "ClientCertificate") to
  1541. // include in API requests with the JSON null value. By default, fields
  1542. // with empty values are omitted from API requests. However, any field
  1543. // with an empty value appearing in NullFields will be sent to the
  1544. // server as null. It is an error if a field in this list has a
  1545. // non-empty value. This may be used to include null fields in Patch
  1546. // requests.
  1547. NullFields []string `json:"-"`
  1548. }
  1549. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  1550. type NoMethod MasterAuth
  1551. raw := NoMethod(*s)
  1552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1553. }
  1554. // MasterAuthorizedNetworksConfig: Configuration options for the master
  1555. // authorized networks feature. Enabled
  1556. // master authorized networks will disallow all external traffic to
  1557. // access
  1558. // Kubernetes master through HTTPS except traffic from the given CIDR
  1559. // blocks,
  1560. // Google Compute Engine Public IPs and Google Prod IPs.
  1561. type MasterAuthorizedNetworksConfig struct {
  1562. // CidrBlocks: cidr_blocks define up to 10 external networks that could
  1563. // access
  1564. // Kubernetes master through HTTPS.
  1565. CidrBlocks []*CidrBlock `json:"cidrBlocks,omitempty"`
  1566. // Enabled: Whether or not master authorized networks is enabled.
  1567. Enabled bool `json:"enabled,omitempty"`
  1568. // ForceSendFields is a list of field names (e.g. "CidrBlocks") to
  1569. // unconditionally include in API requests. By default, fields with
  1570. // empty values are omitted from API requests. However, any non-pointer,
  1571. // non-interface field appearing in ForceSendFields will be sent to the
  1572. // server regardless of whether the field is empty or not. This may be
  1573. // used to include empty fields in Patch requests.
  1574. ForceSendFields []string `json:"-"`
  1575. // NullFields is a list of field names (e.g. "CidrBlocks") to include in
  1576. // API requests with the JSON null value. By default, fields with empty
  1577. // values are omitted from API requests. However, any field with an
  1578. // empty value appearing in NullFields will be sent to the server as
  1579. // null. It is an error if a field in this list has a non-empty value.
  1580. // This may be used to include null fields in Patch requests.
  1581. NullFields []string `json:"-"`
  1582. }
  1583. func (s *MasterAuthorizedNetworksConfig) MarshalJSON() ([]byte, error) {
  1584. type NoMethod MasterAuthorizedNetworksConfig
  1585. raw := NoMethod(*s)
  1586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1587. }
  1588. // NetworkConfig: NetworkConfig reports the relative names of network &
  1589. // subnetwork.
  1590. type NetworkConfig struct {
  1591. // Network: Output only. The relative name of the Google Compute
  1592. // Engine
  1593. // network(/compute/docs/networks-and-firewalls#networks) to which
  1594. // the cluster is connected.
  1595. // Example: projects/my-project/global/networks/my-network
  1596. Network string `json:"network,omitempty"`
  1597. // Subnetwork: Output only. The relative name of the Google Compute
  1598. // Engine
  1599. // [subnetwork](/compute/docs/vpc) to which the cluster is
  1600. // connected.
  1601. // Example:
  1602. // projects/my-project/regions/us-central1/subnetworks/my-subnet
  1603. Subnetwork string `json:"subnetwork,omitempty"`
  1604. // ForceSendFields is a list of field names (e.g. "Network") to
  1605. // unconditionally include in API requests. By default, fields with
  1606. // empty values are omitted from API requests. However, any non-pointer,
  1607. // non-interface field appearing in ForceSendFields will be sent to the
  1608. // server regardless of whether the field is empty or not. This may be
  1609. // used to include empty fields in Patch requests.
  1610. ForceSendFields []string `json:"-"`
  1611. // NullFields is a list of field names (e.g. "Network") to include in
  1612. // API requests with the JSON null value. By default, fields with empty
  1613. // values are omitted from API requests. However, any field with an
  1614. // empty value appearing in NullFields will be sent to the server as
  1615. // null. It is an error if a field in this list has a non-empty value.
  1616. // This may be used to include null fields in Patch requests.
  1617. NullFields []string `json:"-"`
  1618. }
  1619. func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
  1620. type NoMethod NetworkConfig
  1621. raw := NoMethod(*s)
  1622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1623. }
  1624. // NetworkPolicy: Configuration options for the NetworkPolicy
  1625. // feature.
  1626. // https://kubernetes.io/docs/concepts/services-networking/netwo
  1627. // rkpolicies/
  1628. type NetworkPolicy struct {
  1629. // Enabled: Whether network policy is enabled on the cluster.
  1630. Enabled bool `json:"enabled,omitempty"`
  1631. // Provider: The selected network policy provider.
  1632. //
  1633. // Possible values:
  1634. // "PROVIDER_UNSPECIFIED" - Not set
  1635. // "CALICO" - Tigera (Calico Felix).
  1636. Provider string `json:"provider,omitempty"`
  1637. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1638. // unconditionally include in API requests. By default, fields with
  1639. // empty values are omitted from API requests. However, any non-pointer,
  1640. // non-interface field appearing in ForceSendFields will be sent to the
  1641. // server regardless of whether the field is empty or not. This may be
  1642. // used to include empty fields in Patch requests.
  1643. ForceSendFields []string `json:"-"`
  1644. // NullFields is a list of field names (e.g. "Enabled") to include in
  1645. // API requests with the JSON null value. By default, fields with empty
  1646. // values are omitted from API requests. However, any field with an
  1647. // empty value appearing in NullFields will be sent to the server as
  1648. // null. It is an error if a field in this list has a non-empty value.
  1649. // This may be used to include null fields in Patch requests.
  1650. NullFields []string `json:"-"`
  1651. }
  1652. func (s *NetworkPolicy) MarshalJSON() ([]byte, error) {
  1653. type NoMethod NetworkPolicy
  1654. raw := NoMethod(*s)
  1655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1656. }
  1657. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  1658. // tracks whether the addon
  1659. // is enabled or not on the Master, it does not track whether network
  1660. // policy
  1661. // is enabled for the nodes.
  1662. type NetworkPolicyConfig struct {
  1663. // Disabled: Whether NetworkPolicy is enabled for this cluster.
  1664. Disabled bool `json:"disabled,omitempty"`
  1665. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1666. // unconditionally include in API requests. By default, fields with
  1667. // empty values are omitted from API requests. However, any non-pointer,
  1668. // non-interface field appearing in ForceSendFields will be sent to the
  1669. // server regardless of whether the field is empty or not. This may be
  1670. // used to include empty fields in Patch requests.
  1671. ForceSendFields []string `json:"-"`
  1672. // NullFields is a list of field names (e.g. "Disabled") to include in
  1673. // API requests with the JSON null value. By default, fields with empty
  1674. // values are omitted from API requests. However, any field with an
  1675. // empty value appearing in NullFields will be sent to the server as
  1676. // null. It is an error if a field in this list has a non-empty value.
  1677. // This may be used to include null fields in Patch requests.
  1678. NullFields []string `json:"-"`
  1679. }
  1680. func (s *NetworkPolicyConfig) MarshalJSON() ([]byte, error) {
  1681. type NoMethod NetworkPolicyConfig
  1682. raw := NoMethod(*s)
  1683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1684. }
  1685. // NodeConfig: Parameters that describe the nodes in a cluster.
  1686. type NodeConfig struct {
  1687. // Accelerators: A list of hardware accelerators to be attached to each
  1688. // node.
  1689. // See https://cloud.google.com/compute/docs/gpus for more information
  1690. // about
  1691. // support for GPUs.
  1692. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  1693. // DiskSizeGb: Size of the disk attached to each node, specified in
  1694. // GB.
  1695. // The smallest allowed disk size is 10GB.
  1696. //
  1697. // If unspecified, the default disk size is 100GB.
  1698. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  1699. // DiskType: Type of the disk attached to each node (e.g. 'pd-standard'
  1700. // or 'pd-ssd')
  1701. //
  1702. // If unspecified, the default disk type is 'pd-standard'
  1703. DiskType string `json:"diskType,omitempty"`
  1704. // ImageType: The image type to use for this node. Note that for a given
  1705. // image type,
  1706. // the latest version of it will be used.
  1707. ImageType string `json:"imageType,omitempty"`
  1708. // Labels: The map of Kubernetes labels (key/value pairs) to be applied
  1709. // to each node.
  1710. // These will added in addition to any default label(s) that
  1711. // Kubernetes may apply to the node.
  1712. // In case of conflict in label keys, the applied set may differ
  1713. // depending on
  1714. // the Kubernetes version -- it's best to assume the behavior is
  1715. // undefined
  1716. // and conflicts should be avoided.
  1717. // For more information, including usage and the valid values,
  1718. // see:
  1719. // https://kubernetes.io/docs/concepts/overview/working-with-objects
  1720. // /labels/
  1721. Labels map[string]string `json:"labels,omitempty"`
  1722. // LocalSsdCount: The number of local SSD disks to be attached to the
  1723. // node.
  1724. //
  1725. // The limit for this value is dependant upon the maximum number
  1726. // of
  1727. // disks available on a machine per zone.
  1728. // See:
  1729. // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_l
  1730. // imits
  1731. // for more information.
  1732. LocalSsdCount int64 `json:"localSsdCount,omitempty"`
  1733. // MachineType: The name of a Google Compute Engine
  1734. // [machine
  1735. // type](/compute/docs/machine-types) (e.g.
  1736. // `n1-standard-1`).
  1737. //
  1738. // If unspecified, the default machine type is
  1739. // `n1-standard-1`.
  1740. MachineType string `json:"machineType,omitempty"`
  1741. // Metadata: The metadata key/value pairs assigned to instances in the
  1742. // cluster.
  1743. //
  1744. // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128
  1745. // bytes
  1746. // in length. These are reflected as part of a URL in the metadata
  1747. // server.
  1748. // Additionally, to avoid ambiguity, keys must not conflict with any
  1749. // other
  1750. // metadata keys for the project or be one of the reserved keys:
  1751. // "cluster-location"
  1752. // "cluster-name"
  1753. // "cluster-uid"
  1754. // "configure-sh"
  1755. // "containerd-configure-sh"
  1756. // "enable-os-login"
  1757. // "gci-update-strategy"
  1758. // "gci-ensure-gke-docker"
  1759. // "instance-template"
  1760. // "kube-env"
  1761. // "startup-script"
  1762. // "user-data"
  1763. //
  1764. // Values are free-form strings, and only have meaning as interpreted
  1765. // by
  1766. // the image running in the instance. The only restriction placed on
  1767. // them is
  1768. // that each value's size must be less than or equal to 32 KB.
  1769. //
  1770. // The total size of all keys and values must be less than 512 KB.
  1771. Metadata map[string]string `json:"metadata,omitempty"`
  1772. // MinCpuPlatform: Minimum CPU platform to be used by this instance. The
  1773. // instance may be
  1774. // scheduled on the specified or newer CPU platform. Applicable values
  1775. // are the
  1776. // friendly names of CPU platforms, such as
  1777. // <code>minCpuPlatform: &quot;Intel Haswell&quot;</code>
  1778. // or
  1779. // <code>minCpuPlatform: &quot;Intel Sandy Bridge&quot;</code>. For
  1780. // more
  1781. // information, read [how to specify min
  1782. // CPU
  1783. // platform](https://cloud.google.com/compute/docs/instances/specify-
  1784. // min-cpu-platform)
  1785. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1786. // OauthScopes: The set of Google API scopes to be made available on all
  1787. // of the
  1788. // node VMs under the "default" service account.
  1789. //
  1790. // The following scopes are recommended, but not required, and by
  1791. // default are
  1792. // not included:
  1793. //
  1794. // * `https://www.googleapis.com/auth/compute` is required for
  1795. // mounting
  1796. // persistent storage on your nodes.
  1797. // * `https://www.googleapis.com/auth/devstorage.read_only` is required
  1798. // for
  1799. // communicating with **gcr.io**
  1800. // (the [Google Container Registry](/container-registry/)).
  1801. //
  1802. // If unspecified, no scopes are added, unless Cloud Logging or
  1803. // Cloud
  1804. // Monitoring are enabled, in which case their required scopes will be
  1805. // added.
  1806. OauthScopes []string `json:"oauthScopes,omitempty"`
  1807. // Preemptible: Whether the nodes are created as preemptible VM
  1808. // instances.
  1809. // See:
  1810. // https://cloud.google.com/compute/docs/instances/preemptible for
  1811. // more
  1812. // information about preemptible VM instances.
  1813. Preemptible bool `json:"preemptible,omitempty"`
  1814. // ServiceAccount: The Google Cloud Platform Service Account to be used
  1815. // by the node VMs. If
  1816. // no Service Account is specified, the "default" service account is
  1817. // used.
  1818. ServiceAccount string `json:"serviceAccount,omitempty"`
  1819. // Tags: The list of instance tags applied to all nodes. Tags are used
  1820. // to identify
  1821. // valid sources or targets for network firewalls and are specified
  1822. // by
  1823. // the client during cluster or node pool creation. Each tag within the
  1824. // list
  1825. // must comply with RFC1035.
  1826. Tags []string `json:"tags,omitempty"`
  1827. // Taints: List of kubernetes taints to be applied to each node.
  1828. //
  1829. // For more information, including usage and the valid values,
  1830. // see:
  1831. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  1832. // ation/
  1833. Taints []*NodeTaint `json:"taints,omitempty"`
  1834. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1835. // unconditionally include in API requests. By default, fields with
  1836. // empty values are omitted from API requests. However, any non-pointer,
  1837. // non-interface field appearing in ForceSendFields will be sent to the
  1838. // server regardless of whether the field is empty or not. This may be
  1839. // used to include empty fields in Patch requests.
  1840. ForceSendFields []string `json:"-"`
  1841. // NullFields is a list of field names (e.g. "Accelerators") to include
  1842. // in API requests with the JSON null value. By default, fields with
  1843. // empty values are omitted from API requests. However, any field with
  1844. // an empty value appearing in NullFields will be sent to the server as
  1845. // null. It is an error if a field in this list has a non-empty value.
  1846. // This may be used to include null fields in Patch requests.
  1847. NullFields []string `json:"-"`
  1848. }
  1849. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  1850. type NoMethod NodeConfig
  1851. raw := NoMethod(*s)
  1852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1853. }
  1854. // NodeManagement: NodeManagement defines the set of node management
  1855. // services turned on for the
  1856. // node pool.
  1857. type NodeManagement struct {
  1858. // AutoRepair: A flag that specifies whether the node auto-repair is
  1859. // enabled for the node
  1860. // pool. If enabled, the nodes in this node pool will be monitored and,
  1861. // if
  1862. // they fail health checks too many times, an automatic repair action
  1863. // will be
  1864. // triggered.
  1865. AutoRepair bool `json:"autoRepair,omitempty"`
  1866. // AutoUpgrade: A flag that specifies whether node auto-upgrade is
  1867. // enabled for the node
  1868. // pool. If enabled, node auto-upgrade helps keep the nodes in your node
  1869. // pool
  1870. // up to date with the latest release version of Kubernetes.
  1871. AutoUpgrade bool `json:"autoUpgrade,omitempty"`
  1872. // UpgradeOptions: Specifies the Auto Upgrade knobs for the node pool.
  1873. UpgradeOptions *AutoUpgradeOptions `json:"upgradeOptions,omitempty"`
  1874. // ForceSendFields is a list of field names (e.g. "AutoRepair") to
  1875. // unconditionally include in API requests. By default, fields with
  1876. // empty values are omitted from API requests. However, any non-pointer,
  1877. // non-interface field appearing in ForceSendFields will be sent to the
  1878. // server regardless of whether the field is empty or not. This may be
  1879. // used to include empty fields in Patch requests.
  1880. ForceSendFields []string `json:"-"`
  1881. // NullFields is a list of field names (e.g. "AutoRepair") to include in
  1882. // API requests with the JSON null value. By default, fields with empty
  1883. // values are omitted from API requests. However, any field with an
  1884. // empty value appearing in NullFields will be sent to the server as
  1885. // null. It is an error if a field in this list has a non-empty value.
  1886. // This may be used to include null fields in Patch requests.
  1887. NullFields []string `json:"-"`
  1888. }
  1889. func (s *NodeManagement) MarshalJSON() ([]byte, error) {
  1890. type NoMethod NodeManagement
  1891. raw := NoMethod(*s)
  1892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1893. }
  1894. // NodePool: NodePool contains the name and configuration for a
  1895. // cluster's node pool.
  1896. // Node pools are a set of nodes (i.e. VM's), with a common
  1897. // configuration and
  1898. // specification, under the control of the cluster master. They may have
  1899. // a set
  1900. // of Kubernetes labels applied to them, which may be used to reference
  1901. // them
  1902. // during pod scheduling. They may also be resized up or down, to
  1903. // accommodate
  1904. // the workload.
  1905. type NodePool struct {
  1906. // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler
  1907. // is enabled
  1908. // only if a valid configuration is present.
  1909. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  1910. // Conditions: Which conditions caused the current node pool state.
  1911. Conditions []*StatusCondition `json:"conditions,omitempty"`
  1912. // Config: The node configuration of the pool.
  1913. Config *NodeConfig `json:"config,omitempty"`
  1914. // InitialNodeCount: The initial node count for the pool. You must
  1915. // ensure that your
  1916. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  1917. // quota</a>
  1918. // is sufficient for this number of instances. You must also have
  1919. // available
  1920. // firewall and routes quota.
  1921. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  1922. // InstanceGroupUrls: [Output only] The resource URLs of the [managed
  1923. // instance
  1924. // groups](/compute/docs/instance-groups/creating-groups-of-mana
  1925. // ged-instances)
  1926. // associated with this node pool.
  1927. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  1928. // Management: NodeManagement configuration for this NodePool.
  1929. Management *NodeManagement `json:"management,omitempty"`
  1930. // Name: The name of the node pool.
  1931. Name string `json:"name,omitempty"`
  1932. // SelfLink: [Output only] Server-defined URL for the resource.
  1933. SelfLink string `json:"selfLink,omitempty"`
  1934. // Status: [Output only] The status of the nodes in this pool instance.
  1935. //
  1936. // Possible values:
  1937. // "STATUS_UNSPECIFIED" - Not set.
  1938. // "PROVISIONING" - The PROVISIONING state indicates the node pool is
  1939. // being created.
  1940. // "RUNNING" - The RUNNING state indicates the node pool has been
  1941. // created
  1942. // and is fully usable.
  1943. // "RUNNING_WITH_ERROR" - The RUNNING_WITH_ERROR state indicates the
  1944. // node pool has been created
  1945. // and is partially usable. Some error state has occurred and
  1946. // some
  1947. // functionality may be impaired. Customer may need to reissue a
  1948. // request
  1949. // or trigger a new update.
  1950. // "RECONCILING" - The RECONCILING state indicates that some work is
  1951. // actively being done on
  1952. // the node pool, such as upgrading node software. Details can
  1953. // be found in the `statusMessage` field.
  1954. // "STOPPING" - The STOPPING state indicates the node pool is being
  1955. // deleted.
  1956. // "ERROR" - The ERROR state indicates the node pool may be unusable.
  1957. // Details
  1958. // can be found in the `statusMessage` field.
  1959. Status string `json:"status,omitempty"`
  1960. // StatusMessage: [Output only] Additional information about the current
  1961. // status of this
  1962. // node pool instance, if available.
  1963. StatusMessage string `json:"statusMessage,omitempty"`
  1964. // Version: The version of the Kubernetes of this node.
  1965. Version string `json:"version,omitempty"`
  1966. // ServerResponse contains the HTTP response code and headers from the
  1967. // server.
  1968. googleapi.ServerResponse `json:"-"`
  1969. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  1970. // unconditionally include in API requests. By default, fields with
  1971. // empty values are omitted from API requests. However, any non-pointer,
  1972. // non-interface field appearing in ForceSendFields will be sent to the
  1973. // server regardless of whether the field is empty or not. This may be
  1974. // used to include empty fields in Patch requests.
  1975. ForceSendFields []string `json:"-"`
  1976. // NullFields is a list of field names (e.g. "Autoscaling") to include
  1977. // in API requests with the JSON null value. By default, fields with
  1978. // empty values are omitted from API requests. However, any field with
  1979. // an empty value appearing in NullFields will be sent to the server as
  1980. // null. It is an error if a field in this list has a non-empty value.
  1981. // This may be used to include null fields in Patch requests.
  1982. NullFields []string `json:"-"`
  1983. }
  1984. func (s *NodePool) MarshalJSON() ([]byte, error) {
  1985. type NoMethod NodePool
  1986. raw := NoMethod(*s)
  1987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1988. }
  1989. // NodePoolAutoscaling: NodePoolAutoscaling contains information
  1990. // required by cluster autoscaler to
  1991. // adjust the size of the node pool to the current cluster usage.
  1992. type NodePoolAutoscaling struct {
  1993. // Enabled: Is autoscaling enabled for this node pool.
  1994. Enabled bool `json:"enabled,omitempty"`
  1995. // MaxNodeCount: Maximum number of nodes in the NodePool. Must be >=
  1996. // min_node_count. There
  1997. // has to enough quota to scale up the cluster.
  1998. MaxNodeCount int64 `json:"maxNodeCount,omitempty"`
  1999. // MinNodeCount: Minimum number of nodes in the NodePool. Must be >= 1
  2000. // and <=
  2001. // max_node_count.
  2002. MinNodeCount int64 `json:"minNodeCount,omitempty"`
  2003. // ForceSendFields is a list of field names (e.g. "Enabled") to
  2004. // unconditionally include in API requests. By default, fields with
  2005. // empty values are omitted from API requests. However, any non-pointer,
  2006. // non-interface field appearing in ForceSendFields will be sent to the
  2007. // server regardless of whether the field is empty or not. This may be
  2008. // used to include empty fields in Patch requests.
  2009. ForceSendFields []string `json:"-"`
  2010. // NullFields is a list of field names (e.g. "Enabled") to include in
  2011. // API requests with the JSON null value. By default, fields with empty
  2012. // values are omitted from API requests. However, any field with an
  2013. // empty value appearing in NullFields will be sent to the server as
  2014. // null. It is an error if a field in this list has a non-empty value.
  2015. // This may be used to include null fields in Patch requests.
  2016. NullFields []string `json:"-"`
  2017. }
  2018. func (s *NodePoolAutoscaling) MarshalJSON() ([]byte, error) {
  2019. type NoMethod NodePoolAutoscaling
  2020. raw := NoMethod(*s)
  2021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2022. }
  2023. // NodeTaint: Kubernetes taint is comprised of three fields: key, value,
  2024. // and effect. Effect
  2025. // can only be one of three types: NoSchedule, PreferNoSchedule or
  2026. // NoExecute.
  2027. //
  2028. // For more information, including usage and the valid values,
  2029. // see:
  2030. // https://kubernetes.io/docs/concepts/configuration/taint-and-toler
  2031. // ation/
  2032. type NodeTaint struct {
  2033. // Effect: Effect for taint.
  2034. //
  2035. // Possible values:
  2036. // "EFFECT_UNSPECIFIED" - Not set
  2037. // "NO_SCHEDULE" - NoSchedule
  2038. // "PREFER_NO_SCHEDULE" - PreferNoSchedule
  2039. // "NO_EXECUTE" - NoExecute
  2040. Effect string `json:"effect,omitempty"`
  2041. // Key: Key for taint.
  2042. Key string `json:"key,omitempty"`
  2043. // Value: Value for taint.
  2044. Value string `json:"value,omitempty"`
  2045. // ForceSendFields is a list of field names (e.g. "Effect") to
  2046. // unconditionally include in API requests. By default, fields with
  2047. // empty values are omitted from API requests. However, any non-pointer,
  2048. // non-interface field appearing in ForceSendFields will be sent to the
  2049. // server regardless of whether the field is empty or not. This may be
  2050. // used to include empty fields in Patch requests.
  2051. ForceSendFields []string `json:"-"`
  2052. // NullFields is a list of field names (e.g. "Effect") to include in API
  2053. // requests with the JSON null value. By default, fields with empty
  2054. // values are omitted from API requests. However, any field with an
  2055. // empty value appearing in NullFields will be sent to the server as
  2056. // null. It is an error if a field in this list has a non-empty value.
  2057. // This may be used to include null fields in Patch requests.
  2058. NullFields []string `json:"-"`
  2059. }
  2060. func (s *NodeTaint) MarshalJSON() ([]byte, error) {
  2061. type NoMethod NodeTaint
  2062. raw := NoMethod(*s)
  2063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2064. }
  2065. // Operation: This operation resource represents operations that may
  2066. // have happened or are
  2067. // happening on the cluster. All fields are output only.
  2068. type Operation struct {
  2069. // ClusterConditions: Which conditions caused the current cluster state.
  2070. ClusterConditions []*StatusCondition `json:"clusterConditions,omitempty"`
  2071. // Detail: Detailed operation progress, if available.
  2072. Detail string `json:"detail,omitempty"`
  2073. // EndTime: [Output only] The time the operation completed,
  2074. // in
  2075. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2076. EndTime string `json:"endTime,omitempty"`
  2077. // Location: [Output only] The name of the Google Compute
  2078. // Engine
  2079. // [zone](/compute/docs/regions-zones/regions-zones#available)
  2080. // or
  2081. // [region](/compute/docs/regions-zones/regions-zones#available) in
  2082. // which
  2083. // the cluster resides.
  2084. Location string `json:"location,omitempty"`
  2085. // Name: The server-assigned ID for the operation.
  2086. Name string `json:"name,omitempty"`
  2087. // NodepoolConditions: Which conditions caused the current node pool
  2088. // state.
  2089. NodepoolConditions []*StatusCondition `json:"nodepoolConditions,omitempty"`
  2090. // OperationType: The operation type.
  2091. //
  2092. // Possible values:
  2093. // "TYPE_UNSPECIFIED" - Not set.
  2094. // "CREATE_CLUSTER" - Cluster create.
  2095. // "DELETE_CLUSTER" - Cluster delete.
  2096. // "UPGRADE_MASTER" - A master upgrade.
  2097. // "UPGRADE_NODES" - A node upgrade.
  2098. // "REPAIR_CLUSTER" - Cluster repair.
  2099. // "UPDATE_CLUSTER" - Cluster update.
  2100. // "CREATE_NODE_POOL" - Node pool create.
  2101. // "DELETE_NODE_POOL" - Node pool delete.
  2102. // "SET_NODE_POOL_MANAGEMENT" - Set node pool management.
  2103. // "AUTO_REPAIR_NODES" - Automatic node pool repair.
  2104. // "AUTO_UPGRADE_NODES" - Automatic node upgrade.
  2105. // "SET_LABELS" - Set labels.
  2106. // "SET_MASTER_AUTH" - Set/generate master auth materials
  2107. // "SET_NODE_POOL_SIZE" - Set node pool size.
  2108. // "SET_NETWORK_POLICY" - Updates network policy for a cluster.
  2109. // "SET_MAINTENANCE_POLICY" - Set the maintenance policy.
  2110. OperationType string `json:"operationType,omitempty"`
  2111. // SelfLink: Server-defined URL for the resource.
  2112. SelfLink string `json:"selfLink,omitempty"`
  2113. // StartTime: [Output only] The time the operation started,
  2114. // in
  2115. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  2116. StartTime string `json:"startTime,omitempty"`
  2117. // Status: The current status of the operation.
  2118. //
  2119. // Possible values:
  2120. // "STATUS_UNSPECIFIED" - Not set.
  2121. // "PENDING" - The operation has been created.
  2122. // "RUNNING" - The operation is currently running.
  2123. // "DONE" - The operation is done, either cancelled or completed.
  2124. // "ABORTING" - The operation is aborting.
  2125. Status string `json:"status,omitempty"`
  2126. // StatusMessage: If an error has occurred, a textual description of the
  2127. // error.
  2128. StatusMessage string `json:"statusMessage,omitempty"`
  2129. // TargetLink: Server-defined URL for the target of the operation.
  2130. TargetLink string `json:"targetLink,omitempty"`
  2131. // Zone: The name of the Google Compute
  2132. // Engine
  2133. // [zone](/compute/docs/zones#available) in which the operation
  2134. // is taking place.
  2135. // This field is deprecated, use location instead.
  2136. Zone string `json:"zone,omitempty"`
  2137. // ServerResponse contains the HTTP response code and headers from the
  2138. // server.
  2139. googleapi.ServerResponse `json:"-"`
  2140. // ForceSendFields is a list of field names (e.g. "ClusterConditions")
  2141. // to unconditionally include in API requests. By default, fields with
  2142. // empty values are omitted from API requests. However, any non-pointer,
  2143. // non-interface field appearing in ForceSendFields will be sent to the
  2144. // server regardless of whether the field is empty or not. This may be
  2145. // used to include empty fields in Patch requests.
  2146. ForceSendFields []string `json:"-"`
  2147. // NullFields is a list of field names (e.g. "ClusterConditions") to
  2148. // include in API requests with the JSON null value. By default, fields
  2149. // with empty values are omitted from API requests. However, any field
  2150. // with an empty value appearing in NullFields will be sent to the
  2151. // server as null. It is an error if a field in this list has a
  2152. // non-empty value. This may be used to include null fields in Patch
  2153. // requests.
  2154. NullFields []string `json:"-"`
  2155. }
  2156. func (s *Operation) MarshalJSON() ([]byte, error) {
  2157. type NoMethod Operation
  2158. raw := NoMethod(*s)
  2159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2160. }
  2161. // PrivateClusterConfig: Configuration options for private clusters.
  2162. type PrivateClusterConfig struct {
  2163. // EnablePrivateEndpoint: Whether the master's internal IP address is
  2164. // used as the cluster endpoint.
  2165. EnablePrivateEndpoint bool `json:"enablePrivateEndpoint,omitempty"`
  2166. // EnablePrivateNodes: Whether nodes have internal IP addresses only. If
  2167. // enabled, all nodes are
  2168. // given only RFC 1918 private addresses and communicate with the master
  2169. // via
  2170. // private networking.
  2171. EnablePrivateNodes bool `json:"enablePrivateNodes,omitempty"`
  2172. // MasterIpv4CidrBlock: The IP range in CIDR notation to use for the
  2173. // hosted master network. This
  2174. // range will be used for assigning internal IP addresses to the master
  2175. // or
  2176. // set of masters, as well as the ILB VIP. This range must not overlap
  2177. // with
  2178. // any other ranges in use within the cluster's network.
  2179. MasterIpv4CidrBlock string `json:"masterIpv4CidrBlock,omitempty"`
  2180. // PrivateEndpoint: Output only. The internal IP address of this
  2181. // cluster's master endpoint.
  2182. PrivateEndpoint string `json:"privateEndpoint,omitempty"`
  2183. // PublicEndpoint: Output only. The external IP address of this
  2184. // cluster's master endpoint.
  2185. PublicEndpoint string `json:"publicEndpoint,omitempty"`
  2186. // ForceSendFields is a list of field names (e.g.
  2187. // "EnablePrivateEndpoint") to unconditionally include in API requests.
  2188. // By default, fields with empty values are omitted from API requests.
  2189. // However, any non-pointer, non-interface field appearing in
  2190. // ForceSendFields will be sent to the server regardless of whether the
  2191. // field is empty or not. This may be used to include empty fields in
  2192. // Patch requests.
  2193. ForceSendFields []string `json:"-"`
  2194. // NullFields is a list of field names (e.g. "EnablePrivateEndpoint") to
  2195. // include in API requests with the JSON null value. By default, fields
  2196. // with empty values are omitted from API requests. However, any field
  2197. // with an empty value appearing in NullFields will be sent to the
  2198. // server as null. It is an error if a field in this list has a
  2199. // non-empty value. This may be used to include null fields in Patch
  2200. // requests.
  2201. NullFields []string `json:"-"`
  2202. }
  2203. func (s *PrivateClusterConfig) MarshalJSON() ([]byte, error) {
  2204. type NoMethod PrivateClusterConfig
  2205. raw := NoMethod(*s)
  2206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2207. }
  2208. // RollbackNodePoolUpgradeRequest: RollbackNodePoolUpgradeRequest
  2209. // rollbacks the previously Aborted or Failed
  2210. // NodePool upgrade. This will be an no-op if the last upgrade
  2211. // successfully
  2212. // completed.
  2213. type RollbackNodePoolUpgradeRequest struct {
  2214. // ClusterId: Deprecated. The name of the cluster to rollback.
  2215. // This field has been deprecated and replaced by the name field.
  2216. ClusterId string `json:"clusterId,omitempty"`
  2217. // Name: The name (project, location, cluster, node pool id) of the node
  2218. // poll to
  2219. // rollback upgrade.
  2220. // Specified in the format
  2221. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2222. Name string `json:"name,omitempty"`
  2223. // NodePoolId: Deprecated. The name of the node pool to rollback.
  2224. // This field has been deprecated and replaced by the name field.
  2225. NodePoolId string `json:"nodePoolId,omitempty"`
  2226. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2227. // project
  2228. // number](https://support.google.com/cloud/answer/6158840).
  2229. // This
  2230. // field has been deprecated and replaced by the name field.
  2231. ProjectId string `json:"projectId,omitempty"`
  2232. // Zone: Deprecated. The name of the Google Compute
  2233. // Engine
  2234. // [zone](/compute/docs/zones#available) in which the
  2235. // cluster
  2236. // resides.
  2237. // This field has been deprecated and replaced by the name field.
  2238. Zone string `json:"zone,omitempty"`
  2239. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2240. // unconditionally include in API requests. By default, fields with
  2241. // empty values are omitted from API requests. However, any non-pointer,
  2242. // non-interface field appearing in ForceSendFields will be sent to the
  2243. // server regardless of whether the field is empty or not. This may be
  2244. // used to include empty fields in Patch requests.
  2245. ForceSendFields []string `json:"-"`
  2246. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2247. // API requests with the JSON null value. By default, fields with empty
  2248. // values are omitted from API requests. However, any field with an
  2249. // empty value appearing in NullFields will be sent to the server as
  2250. // null. It is an error if a field in this list has a non-empty value.
  2251. // This may be used to include null fields in Patch requests.
  2252. NullFields []string `json:"-"`
  2253. }
  2254. func (s *RollbackNodePoolUpgradeRequest) MarshalJSON() ([]byte, error) {
  2255. type NoMethod RollbackNodePoolUpgradeRequest
  2256. raw := NoMethod(*s)
  2257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2258. }
  2259. // ServerConfig: Kubernetes Engine service configuration.
  2260. type ServerConfig struct {
  2261. // DefaultClusterVersion: Version of Kubernetes the service deploys by
  2262. // default.
  2263. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  2264. // DefaultImageType: Default image type.
  2265. DefaultImageType string `json:"defaultImageType,omitempty"`
  2266. // ValidImageTypes: List of valid image types.
  2267. ValidImageTypes []string `json:"validImageTypes,omitempty"`
  2268. // ValidMasterVersions: List of valid master versions.
  2269. ValidMasterVersions []string `json:"validMasterVersions,omitempty"`
  2270. // ValidNodeVersions: List of valid node upgrade target versions.
  2271. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  2272. // ServerResponse contains the HTTP response code and headers from the
  2273. // server.
  2274. googleapi.ServerResponse `json:"-"`
  2275. // ForceSendFields is a list of field names (e.g.
  2276. // "DefaultClusterVersion") to unconditionally include in API requests.
  2277. // By default, fields with empty values are omitted from API requests.
  2278. // However, any non-pointer, non-interface field appearing in
  2279. // ForceSendFields will be sent to the server regardless of whether the
  2280. // field is empty or not. This may be used to include empty fields in
  2281. // Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "DefaultClusterVersion") to
  2284. // include in API requests with the JSON null value. By default, fields
  2285. // with empty values are omitted from API requests. However, any field
  2286. // with an empty value appearing in NullFields will be sent to the
  2287. // server as null. It is an error if a field in this list has a
  2288. // non-empty value. This may be used to include null fields in Patch
  2289. // requests.
  2290. NullFields []string `json:"-"`
  2291. }
  2292. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  2293. type NoMethod ServerConfig
  2294. raw := NoMethod(*s)
  2295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2296. }
  2297. // SetAddonsConfigRequest: SetAddonsConfigRequest sets the addons
  2298. // associated with the cluster.
  2299. type SetAddonsConfigRequest struct {
  2300. // AddonsConfig: The desired configurations for the various addons
  2301. // available to run in the
  2302. // cluster.
  2303. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  2304. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2305. // This field has been deprecated and replaced by the name field.
  2306. ClusterId string `json:"clusterId,omitempty"`
  2307. // Name: The name (project, location, cluster) of the cluster to set
  2308. // addons.
  2309. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2310. Name string `json:"name,omitempty"`
  2311. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2312. // project
  2313. // number](https://support.google.com/cloud/answer/6158840).
  2314. // This
  2315. // field has been deprecated and replaced by the name field.
  2316. ProjectId string `json:"projectId,omitempty"`
  2317. // Zone: Deprecated. The name of the Google Compute
  2318. // Engine
  2319. // [zone](/compute/docs/zones#available) in which the
  2320. // cluster
  2321. // resides.
  2322. // This field has been deprecated and replaced by the name field.
  2323. Zone string `json:"zone,omitempty"`
  2324. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  2325. // unconditionally include in API requests. By default, fields with
  2326. // empty values are omitted from API requests. However, any non-pointer,
  2327. // non-interface field appearing in ForceSendFields will be sent to the
  2328. // server regardless of whether the field is empty or not. This may be
  2329. // used to include empty fields in Patch requests.
  2330. ForceSendFields []string `json:"-"`
  2331. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  2332. // in API requests with the JSON null value. By default, fields with
  2333. // empty values are omitted from API requests. However, any field with
  2334. // an empty value appearing in NullFields will be sent to the server as
  2335. // null. It is an error if a field in this list has a non-empty value.
  2336. // This may be used to include null fields in Patch requests.
  2337. NullFields []string `json:"-"`
  2338. }
  2339. func (s *SetAddonsConfigRequest) MarshalJSON() ([]byte, error) {
  2340. type NoMethod SetAddonsConfigRequest
  2341. raw := NoMethod(*s)
  2342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2343. }
  2344. // SetLabelsRequest: SetLabelsRequest sets the Google Cloud Platform
  2345. // labels on a Google Container
  2346. // Engine cluster, which will in turn set them for Google Compute
  2347. // Engine
  2348. // resources used by that cluster
  2349. type SetLabelsRequest struct {
  2350. // ClusterId: Deprecated. The name of the cluster.
  2351. // This field has been deprecated and replaced by the name field.
  2352. ClusterId string `json:"clusterId,omitempty"`
  2353. // LabelFingerprint: The fingerprint of the previous set of labels for
  2354. // this resource,
  2355. // used to detect conflicts. The fingerprint is initially generated
  2356. // by
  2357. // Kubernetes Engine and changes after every request to modify or
  2358. // update
  2359. // labels. You must always provide an up-to-date fingerprint hash
  2360. // when
  2361. // updating or changing labels. Make a <code>get()</code> request to
  2362. // the
  2363. // resource to get the latest fingerprint.
  2364. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2365. // Name: The name (project, location, cluster id) of the cluster to set
  2366. // labels.
  2367. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2368. Name string `json:"name,omitempty"`
  2369. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2370. // project
  2371. // number](https://developers.google.com/console/help/new/#projec
  2372. // tnumber).
  2373. // This field has been deprecated and replaced by the name field.
  2374. ProjectId string `json:"projectId,omitempty"`
  2375. // ResourceLabels: The labels to set for that cluster.
  2376. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  2377. // Zone: Deprecated. The name of the Google Compute
  2378. // Engine
  2379. // [zone](/compute/docs/zones#available) in which the
  2380. // cluster
  2381. // resides.
  2382. // This field has been deprecated and replaced by the name field.
  2383. Zone string `json:"zone,omitempty"`
  2384. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2385. // unconditionally include in API requests. By default, fields with
  2386. // empty values are omitted from API requests. However, any non-pointer,
  2387. // non-interface field appearing in ForceSendFields will be sent to the
  2388. // server regardless of whether the field is empty or not. This may be
  2389. // used to include empty fields in Patch requests.
  2390. ForceSendFields []string `json:"-"`
  2391. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2392. // API requests with the JSON null value. By default, fields with empty
  2393. // values are omitted from API requests. However, any field with an
  2394. // empty value appearing in NullFields will be sent to the server as
  2395. // null. It is an error if a field in this list has a non-empty value.
  2396. // This may be used to include null fields in Patch requests.
  2397. NullFields []string `json:"-"`
  2398. }
  2399. func (s *SetLabelsRequest) MarshalJSON() ([]byte, error) {
  2400. type NoMethod SetLabelsRequest
  2401. raw := NoMethod(*s)
  2402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2403. }
  2404. // SetLegacyAbacRequest: SetLegacyAbacRequest enables or disables the
  2405. // ABAC authorization mechanism for
  2406. // a cluster.
  2407. type SetLegacyAbacRequest struct {
  2408. // ClusterId: Deprecated. The name of the cluster to update.
  2409. // This field has been deprecated and replaced by the name field.
  2410. ClusterId string `json:"clusterId,omitempty"`
  2411. // Enabled: Whether ABAC authorization will be enabled in the cluster.
  2412. Enabled bool `json:"enabled,omitempty"`
  2413. // Name: The name (project, location, cluster id) of the cluster to set
  2414. // legacy abac.
  2415. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2416. Name string `json:"name,omitempty"`
  2417. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2418. // project
  2419. // number](https://support.google.com/cloud/answer/6158840).
  2420. // This
  2421. // field has been deprecated and replaced by the name field.
  2422. ProjectId string `json:"projectId,omitempty"`
  2423. // Zone: Deprecated. The name of the Google Compute
  2424. // Engine
  2425. // [zone](/compute/docs/zones#available) in which the
  2426. // cluster
  2427. // resides.
  2428. // This field has been deprecated and replaced by the name field.
  2429. Zone string `json:"zone,omitempty"`
  2430. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2431. // unconditionally include in API requests. By default, fields with
  2432. // empty values are omitted from API requests. However, any non-pointer,
  2433. // non-interface field appearing in ForceSendFields will be sent to the
  2434. // server regardless of whether the field is empty or not. This may be
  2435. // used to include empty fields in Patch requests.
  2436. ForceSendFields []string `json:"-"`
  2437. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2438. // API requests with the JSON null value. By default, fields with empty
  2439. // values are omitted from API requests. However, any field with an
  2440. // empty value appearing in NullFields will be sent to the server as
  2441. // null. It is an error if a field in this list has a non-empty value.
  2442. // This may be used to include null fields in Patch requests.
  2443. NullFields []string `json:"-"`
  2444. }
  2445. func (s *SetLegacyAbacRequest) MarshalJSON() ([]byte, error) {
  2446. type NoMethod SetLegacyAbacRequest
  2447. raw := NoMethod(*s)
  2448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2449. }
  2450. // SetLocationsRequest: SetLocationsRequest sets the locations of the
  2451. // cluster.
  2452. type SetLocationsRequest struct {
  2453. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2454. // This field has been deprecated and replaced by the name field.
  2455. ClusterId string `json:"clusterId,omitempty"`
  2456. // Locations: The desired list of Google Compute
  2457. // Engine
  2458. // [zones](/compute/docs/zones#available) in which the cluster's
  2459. // nodes
  2460. // should be located. Changing the locations a cluster is in will
  2461. // result
  2462. // in nodes being either created or removed from the cluster, depending
  2463. // on
  2464. // whether locations are being added or removed.
  2465. //
  2466. // This list must always include the cluster's primary zone.
  2467. Locations []string `json:"locations,omitempty"`
  2468. // Name: The name (project, location, cluster) of the cluster to set
  2469. // locations.
  2470. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2471. Name string `json:"name,omitempty"`
  2472. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2473. // project
  2474. // number](https://support.google.com/cloud/answer/6158840).
  2475. // This
  2476. // field has been deprecated and replaced by the name field.
  2477. ProjectId string `json:"projectId,omitempty"`
  2478. // Zone: Deprecated. The name of the Google Compute
  2479. // Engine
  2480. // [zone](/compute/docs/zones#available) in which the
  2481. // cluster
  2482. // resides.
  2483. // This field has been deprecated and replaced by the name field.
  2484. Zone string `json:"zone,omitempty"`
  2485. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2486. // unconditionally include in API requests. By default, fields with
  2487. // empty values are omitted from API requests. However, any non-pointer,
  2488. // non-interface field appearing in ForceSendFields will be sent to the
  2489. // server regardless of whether the field is empty or not. This may be
  2490. // used to include empty fields in Patch requests.
  2491. ForceSendFields []string `json:"-"`
  2492. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2493. // API requests with the JSON null value. By default, fields with empty
  2494. // values are omitted from API requests. However, any field with an
  2495. // empty value appearing in NullFields will be sent to the server as
  2496. // null. It is an error if a field in this list has a non-empty value.
  2497. // This may be used to include null fields in Patch requests.
  2498. NullFields []string `json:"-"`
  2499. }
  2500. func (s *SetLocationsRequest) MarshalJSON() ([]byte, error) {
  2501. type NoMethod SetLocationsRequest
  2502. raw := NoMethod(*s)
  2503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2504. }
  2505. // SetLoggingServiceRequest: SetLoggingServiceRequest sets the logging
  2506. // service of a cluster.
  2507. type SetLoggingServiceRequest struct {
  2508. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2509. // This field has been deprecated and replaced by the name field.
  2510. ClusterId string `json:"clusterId,omitempty"`
  2511. // LoggingService: The logging service the cluster should use to write
  2512. // metrics.
  2513. // Currently available options:
  2514. //
  2515. // * "logging.googleapis.com" - the Google Cloud Logging service
  2516. // * "none" - no metrics will be exported from the cluster
  2517. LoggingService string `json:"loggingService,omitempty"`
  2518. // Name: The name (project, location, cluster) of the cluster to set
  2519. // logging.
  2520. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2521. Name string `json:"name,omitempty"`
  2522. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2523. // project
  2524. // number](https://support.google.com/cloud/answer/6158840).
  2525. // This
  2526. // field has been deprecated and replaced by the name field.
  2527. ProjectId string `json:"projectId,omitempty"`
  2528. // Zone: Deprecated. The name of the Google Compute
  2529. // Engine
  2530. // [zone](/compute/docs/zones#available) in which the
  2531. // cluster
  2532. // resides.
  2533. // This field has been deprecated and replaced by the name field.
  2534. Zone string `json:"zone,omitempty"`
  2535. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2536. // unconditionally include in API requests. By default, fields with
  2537. // empty values are omitted from API requests. However, any non-pointer,
  2538. // non-interface field appearing in ForceSendFields will be sent to the
  2539. // server regardless of whether the field is empty or not. This may be
  2540. // used to include empty fields in Patch requests.
  2541. ForceSendFields []string `json:"-"`
  2542. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2543. // API requests with the JSON null value. By default, fields with empty
  2544. // values are omitted from API requests. However, any field with an
  2545. // empty value appearing in NullFields will be sent to the server as
  2546. // null. It is an error if a field in this list has a non-empty value.
  2547. // This may be used to include null fields in Patch requests.
  2548. NullFields []string `json:"-"`
  2549. }
  2550. func (s *SetLoggingServiceRequest) MarshalJSON() ([]byte, error) {
  2551. type NoMethod SetLoggingServiceRequest
  2552. raw := NoMethod(*s)
  2553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2554. }
  2555. // SetMaintenancePolicyRequest: SetMaintenancePolicyRequest sets the
  2556. // maintenance policy for a cluster.
  2557. type SetMaintenancePolicyRequest struct {
  2558. // ClusterId: The name of the cluster to update.
  2559. ClusterId string `json:"clusterId,omitempty"`
  2560. // MaintenancePolicy: The maintenance policy to be set for the cluster.
  2561. // An empty field
  2562. // clears the existing maintenance policy.
  2563. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  2564. // Name: The name (project, location, cluster id) of the cluster to set
  2565. // maintenance
  2566. // policy.
  2567. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2568. Name string `json:"name,omitempty"`
  2569. // ProjectId: The Google Developers Console [project ID or
  2570. // project
  2571. // number](https://support.google.com/cloud/answer/6158840).
  2572. ProjectId string `json:"projectId,omitempty"`
  2573. // Zone: The name of the Google Compute
  2574. // Engine
  2575. // [zone](/compute/docs/zones#available) in which the cluster
  2576. // resides.
  2577. Zone string `json:"zone,omitempty"`
  2578. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2579. // unconditionally include in API requests. By default, fields with
  2580. // empty values are omitted from API requests. However, any non-pointer,
  2581. // non-interface field appearing in ForceSendFields will be sent to the
  2582. // server regardless of whether the field is empty or not. This may be
  2583. // used to include empty fields in Patch requests.
  2584. ForceSendFields []string `json:"-"`
  2585. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2586. // API requests with the JSON null value. By default, fields with empty
  2587. // values are omitted from API requests. However, any field with an
  2588. // empty value appearing in NullFields will be sent to the server as
  2589. // null. It is an error if a field in this list has a non-empty value.
  2590. // This may be used to include null fields in Patch requests.
  2591. NullFields []string `json:"-"`
  2592. }
  2593. func (s *SetMaintenancePolicyRequest) MarshalJSON() ([]byte, error) {
  2594. type NoMethod SetMaintenancePolicyRequest
  2595. raw := NoMethod(*s)
  2596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2597. }
  2598. // SetMasterAuthRequest: SetMasterAuthRequest updates the admin password
  2599. // of a cluster.
  2600. type SetMasterAuthRequest struct {
  2601. // Action: The exact form of action to be taken on the master auth.
  2602. //
  2603. // Possible values:
  2604. // "UNKNOWN" - Operation is unknown and will error out.
  2605. // "SET_PASSWORD" - Set the password to a user generated value.
  2606. // "GENERATE_PASSWORD" - Generate a new password and set it to that.
  2607. // "SET_USERNAME" - Set the username. If an empty username is
  2608. // provided, basic authentication
  2609. // is disabled for the cluster. If a non-empty username is provided,
  2610. // basic
  2611. // authentication is enabled, with either a provided password or a
  2612. // generated
  2613. // one.
  2614. Action string `json:"action,omitempty"`
  2615. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2616. // This field has been deprecated and replaced by the name field.
  2617. ClusterId string `json:"clusterId,omitempty"`
  2618. // Name: The name (project, location, cluster) of the cluster to set
  2619. // auth.
  2620. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2621. Name string `json:"name,omitempty"`
  2622. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2623. // project
  2624. // number](https://support.google.com/cloud/answer/6158840).
  2625. // This
  2626. // field has been deprecated and replaced by the name field.
  2627. ProjectId string `json:"projectId,omitempty"`
  2628. // Update: A description of the update.
  2629. Update *MasterAuth `json:"update,omitempty"`
  2630. // Zone: Deprecated. The name of the Google Compute
  2631. // Engine
  2632. // [zone](/compute/docs/zones#available) in which the
  2633. // cluster
  2634. // resides.
  2635. // This field has been deprecated and replaced by the name field.
  2636. Zone string `json:"zone,omitempty"`
  2637. // ForceSendFields is a list of field names (e.g. "Action") to
  2638. // unconditionally include in API requests. By default, fields with
  2639. // empty values are omitted from API requests. However, any non-pointer,
  2640. // non-interface field appearing in ForceSendFields will be sent to the
  2641. // server regardless of whether the field is empty or not. This may be
  2642. // used to include empty fields in Patch requests.
  2643. ForceSendFields []string `json:"-"`
  2644. // NullFields is a list of field names (e.g. "Action") to include in API
  2645. // requests with the JSON null value. By default, fields with empty
  2646. // values are omitted from API requests. However, any field with an
  2647. // empty value appearing in NullFields will be sent to the server as
  2648. // null. It is an error if a field in this list has a non-empty value.
  2649. // This may be used to include null fields in Patch requests.
  2650. NullFields []string `json:"-"`
  2651. }
  2652. func (s *SetMasterAuthRequest) MarshalJSON() ([]byte, error) {
  2653. type NoMethod SetMasterAuthRequest
  2654. raw := NoMethod(*s)
  2655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2656. }
  2657. // SetMonitoringServiceRequest: SetMonitoringServiceRequest sets the
  2658. // monitoring service of a cluster.
  2659. type SetMonitoringServiceRequest struct {
  2660. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2661. // This field has been deprecated and replaced by the name field.
  2662. ClusterId string `json:"clusterId,omitempty"`
  2663. // MonitoringService: The monitoring service the cluster should use to
  2664. // write metrics.
  2665. // Currently available options:
  2666. //
  2667. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  2668. // * "none" - no metrics will be exported from the cluster
  2669. MonitoringService string `json:"monitoringService,omitempty"`
  2670. // Name: The name (project, location, cluster) of the cluster to set
  2671. // monitoring.
  2672. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2673. Name string `json:"name,omitempty"`
  2674. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2675. // project
  2676. // number](https://support.google.com/cloud/answer/6158840).
  2677. // This
  2678. // field has been deprecated and replaced by the name field.
  2679. ProjectId string `json:"projectId,omitempty"`
  2680. // Zone: Deprecated. The name of the Google Compute
  2681. // Engine
  2682. // [zone](/compute/docs/zones#available) in which the
  2683. // cluster
  2684. // resides.
  2685. // This field has been deprecated and replaced by the name field.
  2686. Zone string `json:"zone,omitempty"`
  2687. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2688. // unconditionally include in API requests. By default, fields with
  2689. // empty values are omitted from API requests. However, any non-pointer,
  2690. // non-interface field appearing in ForceSendFields will be sent to the
  2691. // server regardless of whether the field is empty or not. This may be
  2692. // used to include empty fields in Patch requests.
  2693. ForceSendFields []string `json:"-"`
  2694. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2695. // API requests with the JSON null value. By default, fields with empty
  2696. // values are omitted from API requests. However, any field with an
  2697. // empty value appearing in NullFields will be sent to the server as
  2698. // null. It is an error if a field in this list has a non-empty value.
  2699. // This may be used to include null fields in Patch requests.
  2700. NullFields []string `json:"-"`
  2701. }
  2702. func (s *SetMonitoringServiceRequest) MarshalJSON() ([]byte, error) {
  2703. type NoMethod SetMonitoringServiceRequest
  2704. raw := NoMethod(*s)
  2705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2706. }
  2707. // SetNetworkPolicyRequest: SetNetworkPolicyRequest enables/disables
  2708. // network policy for a cluster.
  2709. type SetNetworkPolicyRequest struct {
  2710. // ClusterId: Deprecated. The name of the cluster.
  2711. // This field has been deprecated and replaced by the name field.
  2712. ClusterId string `json:"clusterId,omitempty"`
  2713. // Name: The name (project, location, cluster id) of the cluster to set
  2714. // networking
  2715. // policy. Specified in the format 'projects/*/locations/*/clusters/*'.
  2716. Name string `json:"name,omitempty"`
  2717. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  2718. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  2719. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2720. // project
  2721. // number](https://developers.google.com/console/help/new/#projec
  2722. // tnumber).
  2723. // This field has been deprecated and replaced by the name field.
  2724. ProjectId string `json:"projectId,omitempty"`
  2725. // Zone: Deprecated. The name of the Google Compute
  2726. // Engine
  2727. // [zone](/compute/docs/zones#available) in which the
  2728. // cluster
  2729. // resides.
  2730. // This field has been deprecated and replaced by the name field.
  2731. Zone string `json:"zone,omitempty"`
  2732. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2733. // unconditionally include in API requests. By default, fields with
  2734. // empty values are omitted from API requests. However, any non-pointer,
  2735. // non-interface field appearing in ForceSendFields will be sent to the
  2736. // server regardless of whether the field is empty or not. This may be
  2737. // used to include empty fields in Patch requests.
  2738. ForceSendFields []string `json:"-"`
  2739. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2740. // API requests with the JSON null value. By default, fields with empty
  2741. // values are omitted from API requests. However, any field with an
  2742. // empty value appearing in NullFields will be sent to the server as
  2743. // null. It is an error if a field in this list has a non-empty value.
  2744. // This may be used to include null fields in Patch requests.
  2745. NullFields []string `json:"-"`
  2746. }
  2747. func (s *SetNetworkPolicyRequest) MarshalJSON() ([]byte, error) {
  2748. type NoMethod SetNetworkPolicyRequest
  2749. raw := NoMethod(*s)
  2750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2751. }
  2752. // SetNodePoolAutoscalingRequest: SetNodePoolAutoscalingRequest sets the
  2753. // autoscaler settings of a node pool.
  2754. type SetNodePoolAutoscalingRequest struct {
  2755. // Autoscaling: Autoscaling configuration for the node pool.
  2756. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2757. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2758. // This field has been deprecated and replaced by the name field.
  2759. ClusterId string `json:"clusterId,omitempty"`
  2760. // Name: The name (project, location, cluster, node pool) of the node
  2761. // pool to set
  2762. // autoscaler settings. Specified in the
  2763. // format
  2764. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2765. Name string `json:"name,omitempty"`
  2766. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  2767. // This field has been deprecated and replaced by the name field.
  2768. NodePoolId string `json:"nodePoolId,omitempty"`
  2769. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2770. // project
  2771. // number](https://support.google.com/cloud/answer/6158840).
  2772. // This
  2773. // field has been deprecated and replaced by the name field.
  2774. ProjectId string `json:"projectId,omitempty"`
  2775. // Zone: Deprecated. The name of the Google Compute
  2776. // Engine
  2777. // [zone](/compute/docs/zones#available) in which the
  2778. // cluster
  2779. // resides.
  2780. // This field has been deprecated and replaced by the name field.
  2781. Zone string `json:"zone,omitempty"`
  2782. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2783. // unconditionally include in API requests. By default, fields with
  2784. // empty values are omitted from API requests. However, any non-pointer,
  2785. // non-interface field appearing in ForceSendFields will be sent to the
  2786. // server regardless of whether the field is empty or not. This may be
  2787. // used to include empty fields in Patch requests.
  2788. ForceSendFields []string `json:"-"`
  2789. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2790. // in API requests with the JSON null value. By default, fields with
  2791. // empty values are omitted from API requests. However, any field with
  2792. // an empty value appearing in NullFields will be sent to the server as
  2793. // null. It is an error if a field in this list has a non-empty value.
  2794. // This may be used to include null fields in Patch requests.
  2795. NullFields []string `json:"-"`
  2796. }
  2797. func (s *SetNodePoolAutoscalingRequest) MarshalJSON() ([]byte, error) {
  2798. type NoMethod SetNodePoolAutoscalingRequest
  2799. raw := NoMethod(*s)
  2800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2801. }
  2802. // SetNodePoolManagementRequest: SetNodePoolManagementRequest sets the
  2803. // node management properties of a node
  2804. // pool.
  2805. type SetNodePoolManagementRequest struct {
  2806. // ClusterId: Deprecated. The name of the cluster to update.
  2807. // This field has been deprecated and replaced by the name field.
  2808. ClusterId string `json:"clusterId,omitempty"`
  2809. // Management: NodeManagement configuration for the node pool.
  2810. Management *NodeManagement `json:"management,omitempty"`
  2811. // Name: The name (project, location, cluster, node pool id) of the node
  2812. // pool to set
  2813. // management properties. Specified in the
  2814. // format
  2815. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2816. Name string `json:"name,omitempty"`
  2817. // NodePoolId: Deprecated. The name of the node pool to update.
  2818. // This field has been deprecated and replaced by the name field.
  2819. NodePoolId string `json:"nodePoolId,omitempty"`
  2820. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2821. // project
  2822. // number](https://support.google.com/cloud/answer/6158840).
  2823. // This
  2824. // field has been deprecated and replaced by the name field.
  2825. ProjectId string `json:"projectId,omitempty"`
  2826. // Zone: Deprecated. The name of the Google Compute
  2827. // Engine
  2828. // [zone](/compute/docs/zones#available) in which the
  2829. // cluster
  2830. // resides.
  2831. // This field has been deprecated and replaced by the name field.
  2832. Zone string `json:"zone,omitempty"`
  2833. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2834. // unconditionally include in API requests. By default, fields with
  2835. // empty values are omitted from API requests. However, any non-pointer,
  2836. // non-interface field appearing in ForceSendFields will be sent to the
  2837. // server regardless of whether the field is empty or not. This may be
  2838. // used to include empty fields in Patch requests.
  2839. ForceSendFields []string `json:"-"`
  2840. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2841. // API requests with the JSON null value. By default, fields with empty
  2842. // values are omitted from API requests. However, any field with an
  2843. // empty value appearing in NullFields will be sent to the server as
  2844. // null. It is an error if a field in this list has a non-empty value.
  2845. // This may be used to include null fields in Patch requests.
  2846. NullFields []string `json:"-"`
  2847. }
  2848. func (s *SetNodePoolManagementRequest) MarshalJSON() ([]byte, error) {
  2849. type NoMethod SetNodePoolManagementRequest
  2850. raw := NoMethod(*s)
  2851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2852. }
  2853. // SetNodePoolSizeRequest: SetNodePoolSizeRequest sets the size a
  2854. // node
  2855. // pool.
  2856. type SetNodePoolSizeRequest struct {
  2857. // ClusterId: Deprecated. The name of the cluster to update.
  2858. // This field has been deprecated and replaced by the name field.
  2859. ClusterId string `json:"clusterId,omitempty"`
  2860. // Name: The name (project, location, cluster, node pool id) of the node
  2861. // pool to set
  2862. // size.
  2863. // Specified in the format
  2864. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2865. Name string `json:"name,omitempty"`
  2866. // NodeCount: The desired node count for the pool.
  2867. NodeCount int64 `json:"nodeCount,omitempty"`
  2868. // NodePoolId: Deprecated. The name of the node pool to update.
  2869. // This field has been deprecated and replaced by the name field.
  2870. NodePoolId string `json:"nodePoolId,omitempty"`
  2871. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2872. // project
  2873. // number](https://support.google.com/cloud/answer/6158840).
  2874. // This
  2875. // field has been deprecated and replaced by the name field.
  2876. ProjectId string `json:"projectId,omitempty"`
  2877. // Zone: Deprecated. The name of the Google Compute
  2878. // Engine
  2879. // [zone](/compute/docs/zones#available) in which the
  2880. // cluster
  2881. // resides.
  2882. // This field has been deprecated and replaced by the name field.
  2883. Zone string `json:"zone,omitempty"`
  2884. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2885. // unconditionally include in API requests. By default, fields with
  2886. // empty values are omitted from API requests. However, any non-pointer,
  2887. // non-interface field appearing in ForceSendFields will be sent to the
  2888. // server regardless of whether the field is empty or not. This may be
  2889. // used to include empty fields in Patch requests.
  2890. ForceSendFields []string `json:"-"`
  2891. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2892. // API requests with the JSON null value. By default, fields with empty
  2893. // values are omitted from API requests. However, any field with an
  2894. // empty value appearing in NullFields will be sent to the server as
  2895. // null. It is an error if a field in this list has a non-empty value.
  2896. // This may be used to include null fields in Patch requests.
  2897. NullFields []string `json:"-"`
  2898. }
  2899. func (s *SetNodePoolSizeRequest) MarshalJSON() ([]byte, error) {
  2900. type NoMethod SetNodePoolSizeRequest
  2901. raw := NoMethod(*s)
  2902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2903. }
  2904. // StartIPRotationRequest: StartIPRotationRequest creates a new IP for
  2905. // the cluster and then performs
  2906. // a node upgrade on each node pool to point to the new IP.
  2907. type StartIPRotationRequest struct {
  2908. // ClusterId: Deprecated. The name of the cluster.
  2909. // This field has been deprecated and replaced by the name field.
  2910. ClusterId string `json:"clusterId,omitempty"`
  2911. // Name: The name (project, location, cluster id) of the cluster to
  2912. // start IP
  2913. // rotation. Specified in the format
  2914. // 'projects/*/locations/*/clusters/*'.
  2915. Name string `json:"name,omitempty"`
  2916. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2917. // project
  2918. // number](https://developers.google.com/console/help/new/#projec
  2919. // tnumber).
  2920. // This field has been deprecated and replaced by the name field.
  2921. ProjectId string `json:"projectId,omitempty"`
  2922. // RotateCredentials: Whether to rotate credentials during IP rotation.
  2923. RotateCredentials bool `json:"rotateCredentials,omitempty"`
  2924. // Zone: Deprecated. The name of the Google Compute
  2925. // Engine
  2926. // [zone](/compute/docs/zones#available) in which the
  2927. // cluster
  2928. // resides.
  2929. // This field has been deprecated and replaced by the name field.
  2930. Zone string `json:"zone,omitempty"`
  2931. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2932. // unconditionally include in API requests. By default, fields with
  2933. // empty values are omitted from API requests. However, any non-pointer,
  2934. // non-interface field appearing in ForceSendFields will be sent to the
  2935. // server regardless of whether the field is empty or not. This may be
  2936. // used to include empty fields in Patch requests.
  2937. ForceSendFields []string `json:"-"`
  2938. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2939. // API requests with the JSON null value. By default, fields with empty
  2940. // values are omitted from API requests. However, any field with an
  2941. // empty value appearing in NullFields will be sent to the server as
  2942. // null. It is an error if a field in this list has a non-empty value.
  2943. // This may be used to include null fields in Patch requests.
  2944. NullFields []string `json:"-"`
  2945. }
  2946. func (s *StartIPRotationRequest) MarshalJSON() ([]byte, error) {
  2947. type NoMethod StartIPRotationRequest
  2948. raw := NoMethod(*s)
  2949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2950. }
  2951. // StatusCondition: StatusCondition describes why a cluster or a node
  2952. // pool has a certain status
  2953. // (e.g., ERROR or DEGRADED).
  2954. type StatusCondition struct {
  2955. // Code: Machine-friendly representation of the condition
  2956. //
  2957. // Possible values:
  2958. // "UNKNOWN" - UNKNOWN indicates a generic condition.
  2959. // "GCE_STOCKOUT" - GCE_STOCKOUT indicates a Google Compute Engine
  2960. // stockout.
  2961. // "GKE_SERVICE_ACCOUNT_DELETED" - GKE_SERVICE_ACCOUNT_DELETED
  2962. // indicates that the user deleted their robot
  2963. // service account.
  2964. // "GCE_QUOTA_EXCEEDED" - Google Compute Engine quota was exceeded.
  2965. // "SET_BY_OPERATOR" - Cluster state was manually changed by an SRE
  2966. // due to a system logic error.
  2967. // More codes TBA
  2968. Code string `json:"code,omitempty"`
  2969. // Message: Human-friendly representation of the condition
  2970. Message string `json:"message,omitempty"`
  2971. // ForceSendFields is a list of field names (e.g. "Code") to
  2972. // unconditionally include in API requests. By default, fields with
  2973. // empty values are omitted from API requests. However, any non-pointer,
  2974. // non-interface field appearing in ForceSendFields will be sent to the
  2975. // server regardless of whether the field is empty or not. This may be
  2976. // used to include empty fields in Patch requests.
  2977. ForceSendFields []string `json:"-"`
  2978. // NullFields is a list of field names (e.g. "Code") to include in API
  2979. // requests with the JSON null value. By default, fields with empty
  2980. // values are omitted from API requests. However, any field with an
  2981. // empty value appearing in NullFields will be sent to the server as
  2982. // null. It is an error if a field in this list has a non-empty value.
  2983. // This may be used to include null fields in Patch requests.
  2984. NullFields []string `json:"-"`
  2985. }
  2986. func (s *StatusCondition) MarshalJSON() ([]byte, error) {
  2987. type NoMethod StatusCondition
  2988. raw := NoMethod(*s)
  2989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2990. }
  2991. // UpdateClusterRequest: UpdateClusterRequest updates the settings of a
  2992. // cluster.
  2993. type UpdateClusterRequest struct {
  2994. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2995. // This field has been deprecated and replaced by the name field.
  2996. ClusterId string `json:"clusterId,omitempty"`
  2997. // Name: The name (project, location, cluster) of the cluster to
  2998. // update.
  2999. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3000. Name string `json:"name,omitempty"`
  3001. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3002. // project
  3003. // number](https://support.google.com/cloud/answer/6158840).
  3004. // This
  3005. // field has been deprecated and replaced by the name field.
  3006. ProjectId string `json:"projectId,omitempty"`
  3007. // Update: A description of the update.
  3008. Update *ClusterUpdate `json:"update,omitempty"`
  3009. // Zone: Deprecated. The name of the Google Compute
  3010. // Engine
  3011. // [zone](/compute/docs/zones#available) in which the
  3012. // cluster
  3013. // resides.
  3014. // This field has been deprecated and replaced by the name field.
  3015. Zone string `json:"zone,omitempty"`
  3016. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3017. // unconditionally include in API requests. By default, fields with
  3018. // empty values are omitted from API requests. However, any non-pointer,
  3019. // non-interface field appearing in ForceSendFields will be sent to the
  3020. // server regardless of whether the field is empty or not. This may be
  3021. // used to include empty fields in Patch requests.
  3022. ForceSendFields []string `json:"-"`
  3023. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3024. // API requests with the JSON null value. By default, fields with empty
  3025. // values are omitted from API requests. However, any field with an
  3026. // empty value appearing in NullFields will be sent to the server as
  3027. // null. It is an error if a field in this list has a non-empty value.
  3028. // This may be used to include null fields in Patch requests.
  3029. NullFields []string `json:"-"`
  3030. }
  3031. func (s *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  3032. type NoMethod UpdateClusterRequest
  3033. raw := NoMethod(*s)
  3034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3035. }
  3036. // UpdateMasterRequest: UpdateMasterRequest updates the master of the
  3037. // cluster.
  3038. type UpdateMasterRequest struct {
  3039. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3040. // This field has been deprecated and replaced by the name field.
  3041. ClusterId string `json:"clusterId,omitempty"`
  3042. // MasterVersion: The Kubernetes version to change the master to.
  3043. //
  3044. // Users may specify either explicit versions offered by Kubernetes
  3045. // Engine or
  3046. // version aliases, which have the following behavior:
  3047. //
  3048. // - "latest": picks the highest valid Kubernetes version
  3049. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3050. // version
  3051. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3052. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3053. // - "-": picks the default Kubernetes version
  3054. MasterVersion string `json:"masterVersion,omitempty"`
  3055. // Name: The name (project, location, cluster) of the cluster to
  3056. // update.
  3057. // Specified in the format 'projects/*/locations/*/clusters/*'.
  3058. Name string `json:"name,omitempty"`
  3059. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3060. // project
  3061. // number](https://support.google.com/cloud/answer/6158840).
  3062. // This
  3063. // field has been deprecated and replaced by the name field.
  3064. ProjectId string `json:"projectId,omitempty"`
  3065. // Zone: Deprecated. The name of the Google Compute
  3066. // Engine
  3067. // [zone](/compute/docs/zones#available) in which the
  3068. // cluster
  3069. // resides.
  3070. // This field has been deprecated and replaced by the name field.
  3071. Zone string `json:"zone,omitempty"`
  3072. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3073. // unconditionally include in API requests. By default, fields with
  3074. // empty values are omitted from API requests. However, any non-pointer,
  3075. // non-interface field appearing in ForceSendFields will be sent to the
  3076. // server regardless of whether the field is empty or not. This may be
  3077. // used to include empty fields in Patch requests.
  3078. ForceSendFields []string `json:"-"`
  3079. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3080. // API requests with the JSON null value. By default, fields with empty
  3081. // values are omitted from API requests. However, any field with an
  3082. // empty value appearing in NullFields will be sent to the server as
  3083. // null. It is an error if a field in this list has a non-empty value.
  3084. // This may be used to include null fields in Patch requests.
  3085. NullFields []string `json:"-"`
  3086. }
  3087. func (s *UpdateMasterRequest) MarshalJSON() ([]byte, error) {
  3088. type NoMethod UpdateMasterRequest
  3089. raw := NoMethod(*s)
  3090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3091. }
  3092. // UpdateNodePoolRequest: UpdateNodePoolRequests update a node pool's
  3093. // image and/or version.
  3094. type UpdateNodePoolRequest struct {
  3095. // ClusterId: Deprecated. The name of the cluster to upgrade.
  3096. // This field has been deprecated and replaced by the name field.
  3097. ClusterId string `json:"clusterId,omitempty"`
  3098. // ImageType: The desired image type for the node pool.
  3099. ImageType string `json:"imageType,omitempty"`
  3100. // Name: The name (project, location, cluster, node pool) of the node
  3101. // pool to
  3102. // update. Specified in the
  3103. // format
  3104. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  3105. Name string `json:"name,omitempty"`
  3106. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  3107. // This field has been deprecated and replaced by the name field.
  3108. NodePoolId string `json:"nodePoolId,omitempty"`
  3109. // NodeVersion: The Kubernetes version to change the nodes to (typically
  3110. // an
  3111. // upgrade).
  3112. //
  3113. // Users may specify either explicit versions offered by Kubernetes
  3114. // Engine or
  3115. // version aliases, which have the following behavior:
  3116. //
  3117. // - "latest": picks the highest valid Kubernetes version
  3118. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  3119. // version
  3120. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  3121. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  3122. // - "-": picks the Kubernetes master version
  3123. NodeVersion string `json:"nodeVersion,omitempty"`
  3124. // ProjectId: Deprecated. The Google Developers Console [project ID or
  3125. // project
  3126. // number](https://support.google.com/cloud/answer/6158840).
  3127. // This
  3128. // field has been deprecated and replaced by the name field.
  3129. ProjectId string `json:"projectId,omitempty"`
  3130. // Zone: Deprecated. The name of the Google Compute
  3131. // Engine
  3132. // [zone](/compute/docs/zones#available) in which the
  3133. // cluster
  3134. // resides.
  3135. // This field has been deprecated and replaced by the name field.
  3136. Zone string `json:"zone,omitempty"`
  3137. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  3138. // unconditionally include in API requests. By default, fields with
  3139. // empty values are omitted from API requests. However, any non-pointer,
  3140. // non-interface field appearing in ForceSendFields will be sent to the
  3141. // server regardless of whether the field is empty or not. This may be
  3142. // used to include empty fields in Patch requests.
  3143. ForceSendFields []string `json:"-"`
  3144. // NullFields is a list of field names (e.g. "ClusterId") to include in
  3145. // API requests with the JSON null value. By default, fields with empty
  3146. // values are omitted from API requests. However, any field with an
  3147. // empty value appearing in NullFields will be sent to the server as
  3148. // null. It is an error if a field in this list has a non-empty value.
  3149. // This may be used to include null fields in Patch requests.
  3150. NullFields []string `json:"-"`
  3151. }
  3152. func (s *UpdateNodePoolRequest) MarshalJSON() ([]byte, error) {
  3153. type NoMethod UpdateNodePoolRequest
  3154. raw := NoMethod(*s)
  3155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3156. }
  3157. // method id "container.projects.locations.getServerConfig":
  3158. type ProjectsLocationsGetServerConfigCall struct {
  3159. s *Service
  3160. name string
  3161. urlParams_ gensupport.URLParams
  3162. ifNoneMatch_ string
  3163. ctx_ context.Context
  3164. header_ http.Header
  3165. }
  3166. // GetServerConfig: Returns configuration info about the Kubernetes
  3167. // Engine service.
  3168. func (r *ProjectsLocationsService) GetServerConfig(name string) *ProjectsLocationsGetServerConfigCall {
  3169. c := &ProjectsLocationsGetServerConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3170. c.name = name
  3171. return c
  3172. }
  3173. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3174. // Google Developers Console [project ID or
  3175. // project
  3176. // number](https://support.google.com/cloud/answer/6158840).
  3177. // This
  3178. // field has been deprecated and replaced by the name field.
  3179. func (c *ProjectsLocationsGetServerConfigCall) ProjectId(projectId string) *ProjectsLocationsGetServerConfigCall {
  3180. c.urlParams_.Set("projectId", projectId)
  3181. return c
  3182. }
  3183. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3184. // Google Compute Engine
  3185. // [zone](/compute/docs/zones#available) to return operations for.
  3186. // This field has been deprecated and replaced by the name field.
  3187. func (c *ProjectsLocationsGetServerConfigCall) Zone(zone string) *ProjectsLocationsGetServerConfigCall {
  3188. c.urlParams_.Set("zone", zone)
  3189. return c
  3190. }
  3191. // Fields allows partial responses to be retrieved. See
  3192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3193. // for more information.
  3194. func (c *ProjectsLocationsGetServerConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetServerConfigCall {
  3195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3196. return c
  3197. }
  3198. // IfNoneMatch sets the optional parameter which makes the operation
  3199. // fail if the object's ETag matches the given value. This is useful for
  3200. // getting updates only after the object has changed since the last
  3201. // request. Use googleapi.IsNotModified to check whether the response
  3202. // error from Do is the result of In-None-Match.
  3203. func (c *ProjectsLocationsGetServerConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetServerConfigCall {
  3204. c.ifNoneMatch_ = entityTag
  3205. return c
  3206. }
  3207. // Context sets the context to be used in this call's Do method. Any
  3208. // pending HTTP request will be aborted if the provided context is
  3209. // canceled.
  3210. func (c *ProjectsLocationsGetServerConfigCall) Context(ctx context.Context) *ProjectsLocationsGetServerConfigCall {
  3211. c.ctx_ = ctx
  3212. return c
  3213. }
  3214. // Header returns an http.Header that can be modified by the caller to
  3215. // add HTTP headers to the request.
  3216. func (c *ProjectsLocationsGetServerConfigCall) Header() http.Header {
  3217. if c.header_ == nil {
  3218. c.header_ = make(http.Header)
  3219. }
  3220. return c.header_
  3221. }
  3222. func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Response, error) {
  3223. reqHeaders := make(http.Header)
  3224. for k, v := range c.header_ {
  3225. reqHeaders[k] = v
  3226. }
  3227. reqHeaders.Set("User-Agent", c.s.userAgent())
  3228. if c.ifNoneMatch_ != "" {
  3229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3230. }
  3231. var body io.Reader = nil
  3232. c.urlParams_.Set("alt", alt)
  3233. c.urlParams_.Set("prettyPrint", "false")
  3234. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/serverConfig")
  3235. urls += "?" + c.urlParams_.Encode()
  3236. req, err := http.NewRequest("GET", urls, body)
  3237. if err != nil {
  3238. return nil, err
  3239. }
  3240. req.Header = reqHeaders
  3241. googleapi.Expand(req.URL, map[string]string{
  3242. "name": c.name,
  3243. })
  3244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3245. }
  3246. // Do executes the "container.projects.locations.getServerConfig" call.
  3247. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  3248. // status code is an error. Response headers are in either
  3249. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  3250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3251. // to check whether the returned error was because
  3252. // http.StatusNotModified was returned.
  3253. func (c *ProjectsLocationsGetServerConfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  3254. gensupport.SetOptions(c.urlParams_, opts...)
  3255. res, err := c.doRequest("json")
  3256. if res != nil && res.StatusCode == http.StatusNotModified {
  3257. if res.Body != nil {
  3258. res.Body.Close()
  3259. }
  3260. return nil, &googleapi.Error{
  3261. Code: res.StatusCode,
  3262. Header: res.Header,
  3263. }
  3264. }
  3265. if err != nil {
  3266. return nil, err
  3267. }
  3268. defer googleapi.CloseBody(res)
  3269. if err := googleapi.CheckResponse(res); err != nil {
  3270. return nil, err
  3271. }
  3272. ret := &ServerConfig{
  3273. ServerResponse: googleapi.ServerResponse{
  3274. Header: res.Header,
  3275. HTTPStatusCode: res.StatusCode,
  3276. },
  3277. }
  3278. target := &ret
  3279. if err := gensupport.DecodeResponse(target, res); err != nil {
  3280. return nil, err
  3281. }
  3282. return ret, nil
  3283. // {
  3284. // "description": "Returns configuration info about the Kubernetes Engine service.",
  3285. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/serverConfig",
  3286. // "httpMethod": "GET",
  3287. // "id": "container.projects.locations.getServerConfig",
  3288. // "parameterOrder": [
  3289. // "name"
  3290. // ],
  3291. // "parameters": {
  3292. // "name": {
  3293. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  3294. // "location": "path",
  3295. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3296. // "required": true,
  3297. // "type": "string"
  3298. // },
  3299. // "projectId": {
  3300. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  3301. // "location": "query",
  3302. // "type": "string"
  3303. // },
  3304. // "zone": {
  3305. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for.\nThis field has been deprecated and replaced by the name field.",
  3306. // "location": "query",
  3307. // "type": "string"
  3308. // }
  3309. // },
  3310. // "path": "v1/{+name}/serverConfig",
  3311. // "response": {
  3312. // "$ref": "ServerConfig"
  3313. // },
  3314. // "scopes": [
  3315. // "https://www.googleapis.com/auth/cloud-platform"
  3316. // ]
  3317. // }
  3318. }
  3319. // method id "container.projects.locations.clusters.completeIpRotation":
  3320. type ProjectsLocationsClustersCompleteIpRotationCall struct {
  3321. s *Service
  3322. name string
  3323. completeiprotationrequest *CompleteIPRotationRequest
  3324. urlParams_ gensupport.URLParams
  3325. ctx_ context.Context
  3326. header_ http.Header
  3327. }
  3328. // CompleteIpRotation: Completes master IP rotation.
  3329. func (r *ProjectsLocationsClustersService) CompleteIpRotation(name string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsLocationsClustersCompleteIpRotationCall {
  3330. c := &ProjectsLocationsClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3331. c.name = name
  3332. c.completeiprotationrequest = completeiprotationrequest
  3333. return c
  3334. }
  3335. // Fields allows partial responses to be retrieved. See
  3336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3337. // for more information.
  3338. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCompleteIpRotationCall {
  3339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3340. return c
  3341. }
  3342. // Context sets the context to be used in this call's Do method. Any
  3343. // pending HTTP request will be aborted if the provided context is
  3344. // canceled.
  3345. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersCompleteIpRotationCall {
  3346. c.ctx_ = ctx
  3347. return c
  3348. }
  3349. // Header returns an http.Header that can be modified by the caller to
  3350. // add HTTP headers to the request.
  3351. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header {
  3352. if c.header_ == nil {
  3353. c.header_ = make(http.Header)
  3354. }
  3355. return c.header_
  3356. }
  3357. func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  3358. reqHeaders := make(http.Header)
  3359. for k, v := range c.header_ {
  3360. reqHeaders[k] = v
  3361. }
  3362. reqHeaders.Set("User-Agent", c.s.userAgent())
  3363. var body io.Reader = nil
  3364. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  3365. if err != nil {
  3366. return nil, err
  3367. }
  3368. reqHeaders.Set("Content-Type", "application/json")
  3369. c.urlParams_.Set("alt", alt)
  3370. c.urlParams_.Set("prettyPrint", "false")
  3371. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:completeIpRotation")
  3372. urls += "?" + c.urlParams_.Encode()
  3373. req, err := http.NewRequest("POST", urls, body)
  3374. if err != nil {
  3375. return nil, err
  3376. }
  3377. req.Header = reqHeaders
  3378. googleapi.Expand(req.URL, map[string]string{
  3379. "name": c.name,
  3380. })
  3381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3382. }
  3383. // Do executes the "container.projects.locations.clusters.completeIpRotation" call.
  3384. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3385. // status code is an error. Response headers are in either
  3386. // *Operation.ServerResponse.Header or (if a response was returned at
  3387. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3388. // to check whether the returned error was because
  3389. // http.StatusNotModified was returned.
  3390. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3391. gensupport.SetOptions(c.urlParams_, opts...)
  3392. res, err := c.doRequest("json")
  3393. if res != nil && res.StatusCode == http.StatusNotModified {
  3394. if res.Body != nil {
  3395. res.Body.Close()
  3396. }
  3397. return nil, &googleapi.Error{
  3398. Code: res.StatusCode,
  3399. Header: res.Header,
  3400. }
  3401. }
  3402. if err != nil {
  3403. return nil, err
  3404. }
  3405. defer googleapi.CloseBody(res)
  3406. if err := googleapi.CheckResponse(res); err != nil {
  3407. return nil, err
  3408. }
  3409. ret := &Operation{
  3410. ServerResponse: googleapi.ServerResponse{
  3411. Header: res.Header,
  3412. HTTPStatusCode: res.StatusCode,
  3413. },
  3414. }
  3415. target := &ret
  3416. if err := gensupport.DecodeResponse(target, res); err != nil {
  3417. return nil, err
  3418. }
  3419. return ret, nil
  3420. // {
  3421. // "description": "Completes master IP rotation.",
  3422. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation",
  3423. // "httpMethod": "POST",
  3424. // "id": "container.projects.locations.clusters.completeIpRotation",
  3425. // "parameterOrder": [
  3426. // "name"
  3427. // ],
  3428. // "parameters": {
  3429. // "name": {
  3430. // "description": "The name (project, location, cluster id) of the cluster to complete IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  3431. // "location": "path",
  3432. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3433. // "required": true,
  3434. // "type": "string"
  3435. // }
  3436. // },
  3437. // "path": "v1/{+name}:completeIpRotation",
  3438. // "request": {
  3439. // "$ref": "CompleteIPRotationRequest"
  3440. // },
  3441. // "response": {
  3442. // "$ref": "Operation"
  3443. // },
  3444. // "scopes": [
  3445. // "https://www.googleapis.com/auth/cloud-platform"
  3446. // ]
  3447. // }
  3448. }
  3449. // method id "container.projects.locations.clusters.create":
  3450. type ProjectsLocationsClustersCreateCall struct {
  3451. s *Service
  3452. parent string
  3453. createclusterrequest *CreateClusterRequest
  3454. urlParams_ gensupport.URLParams
  3455. ctx_ context.Context
  3456. header_ http.Header
  3457. }
  3458. // Create: Creates a cluster, consisting of the specified number and
  3459. // type of Google
  3460. // Compute Engine instances.
  3461. //
  3462. // By default, the cluster is created in the project's
  3463. // [default
  3464. // network](/compute/docs/networks-and-firewalls#networks).
  3465. //
  3466. // One firewall is added for the cluster. After cluster creation,
  3467. // the cluster creates routes for each node to allow the containers
  3468. // on that node to communicate with all other instances in
  3469. // the
  3470. // cluster.
  3471. //
  3472. // Finally, an entry is added to the project's global metadata
  3473. // indicating
  3474. // which CIDR range is being used by the cluster.
  3475. func (r *ProjectsLocationsClustersService) Create(parent string, createclusterrequest *CreateClusterRequest) *ProjectsLocationsClustersCreateCall {
  3476. c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3477. c.parent = parent
  3478. c.createclusterrequest = createclusterrequest
  3479. return c
  3480. }
  3481. // Fields allows partial responses to be retrieved. See
  3482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3483. // for more information.
  3484. func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall {
  3485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3486. return c
  3487. }
  3488. // Context sets the context to be used in this call's Do method. Any
  3489. // pending HTTP request will be aborted if the provided context is
  3490. // canceled.
  3491. func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall {
  3492. c.ctx_ = ctx
  3493. return c
  3494. }
  3495. // Header returns an http.Header that can be modified by the caller to
  3496. // add HTTP headers to the request.
  3497. func (c *ProjectsLocationsClustersCreateCall) Header() http.Header {
  3498. if c.header_ == nil {
  3499. c.header_ = make(http.Header)
  3500. }
  3501. return c.header_
  3502. }
  3503. func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  3504. reqHeaders := make(http.Header)
  3505. for k, v := range c.header_ {
  3506. reqHeaders[k] = v
  3507. }
  3508. reqHeaders.Set("User-Agent", c.s.userAgent())
  3509. var body io.Reader = nil
  3510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  3511. if err != nil {
  3512. return nil, err
  3513. }
  3514. reqHeaders.Set("Content-Type", "application/json")
  3515. c.urlParams_.Set("alt", alt)
  3516. c.urlParams_.Set("prettyPrint", "false")
  3517. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  3518. urls += "?" + c.urlParams_.Encode()
  3519. req, err := http.NewRequest("POST", urls, body)
  3520. if err != nil {
  3521. return nil, err
  3522. }
  3523. req.Header = reqHeaders
  3524. googleapi.Expand(req.URL, map[string]string{
  3525. "parent": c.parent,
  3526. })
  3527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3528. }
  3529. // Do executes the "container.projects.locations.clusters.create" call.
  3530. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3531. // status code is an error. Response headers are in either
  3532. // *Operation.ServerResponse.Header or (if a response was returned at
  3533. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3534. // to check whether the returned error was because
  3535. // http.StatusNotModified was returned.
  3536. func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3537. gensupport.SetOptions(c.urlParams_, opts...)
  3538. res, err := c.doRequest("json")
  3539. if res != nil && res.StatusCode == http.StatusNotModified {
  3540. if res.Body != nil {
  3541. res.Body.Close()
  3542. }
  3543. return nil, &googleapi.Error{
  3544. Code: res.StatusCode,
  3545. Header: res.Header,
  3546. }
  3547. }
  3548. if err != nil {
  3549. return nil, err
  3550. }
  3551. defer googleapi.CloseBody(res)
  3552. if err := googleapi.CheckResponse(res); err != nil {
  3553. return nil, err
  3554. }
  3555. ret := &Operation{
  3556. ServerResponse: googleapi.ServerResponse{
  3557. Header: res.Header,
  3558. HTTPStatusCode: res.StatusCode,
  3559. },
  3560. }
  3561. target := &ret
  3562. if err := gensupport.DecodeResponse(target, res); err != nil {
  3563. return nil, err
  3564. }
  3565. return ret, nil
  3566. // {
  3567. // "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
  3568. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  3569. // "httpMethod": "POST",
  3570. // "id": "container.projects.locations.clusters.create",
  3571. // "parameterOrder": [
  3572. // "parent"
  3573. // ],
  3574. // "parameters": {
  3575. // "parent": {
  3576. // "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.",
  3577. // "location": "path",
  3578. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3579. // "required": true,
  3580. // "type": "string"
  3581. // }
  3582. // },
  3583. // "path": "v1/{+parent}/clusters",
  3584. // "request": {
  3585. // "$ref": "CreateClusterRequest"
  3586. // },
  3587. // "response": {
  3588. // "$ref": "Operation"
  3589. // },
  3590. // "scopes": [
  3591. // "https://www.googleapis.com/auth/cloud-platform"
  3592. // ]
  3593. // }
  3594. }
  3595. // method id "container.projects.locations.clusters.delete":
  3596. type ProjectsLocationsClustersDeleteCall struct {
  3597. s *Service
  3598. name string
  3599. urlParams_ gensupport.URLParams
  3600. ctx_ context.Context
  3601. header_ http.Header
  3602. }
  3603. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  3604. // all worker
  3605. // nodes.
  3606. //
  3607. // Firewalls and routes that were configured during cluster creation
  3608. // are also deleted.
  3609. //
  3610. // Other Google Compute Engine resources that might be in use by the
  3611. // cluster
  3612. // (e.g. load balancer resources) will not be deleted if they weren't
  3613. // present
  3614. // at the initial create time.
  3615. func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall {
  3616. c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3617. c.name = name
  3618. return c
  3619. }
  3620. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  3621. // name of the cluster to delete.
  3622. // This field has been deprecated and replaced by the name field.
  3623. func (c *ProjectsLocationsClustersDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersDeleteCall {
  3624. c.urlParams_.Set("clusterId", clusterId)
  3625. return c
  3626. }
  3627. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3628. // Google Developers Console [project ID or
  3629. // project
  3630. // number](https://support.google.com/cloud/answer/6158840).
  3631. // This
  3632. // field has been deprecated and replaced by the name field.
  3633. func (c *ProjectsLocationsClustersDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersDeleteCall {
  3634. c.urlParams_.Set("projectId", projectId)
  3635. return c
  3636. }
  3637. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3638. // Google Compute Engine
  3639. // [zone](/compute/docs/zones#available) in which the
  3640. // cluster
  3641. // resides.
  3642. // This field has been deprecated and replaced by the name field.
  3643. func (c *ProjectsLocationsClustersDeleteCall) Zone(zone string) *ProjectsLocationsClustersDeleteCall {
  3644. c.urlParams_.Set("zone", zone)
  3645. return c
  3646. }
  3647. // Fields allows partial responses to be retrieved. See
  3648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3649. // for more information.
  3650. func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall {
  3651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3652. return c
  3653. }
  3654. // Context sets the context to be used in this call's Do method. Any
  3655. // pending HTTP request will be aborted if the provided context is
  3656. // canceled.
  3657. func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall {
  3658. c.ctx_ = ctx
  3659. return c
  3660. }
  3661. // Header returns an http.Header that can be modified by the caller to
  3662. // add HTTP headers to the request.
  3663. func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header {
  3664. if c.header_ == nil {
  3665. c.header_ = make(http.Header)
  3666. }
  3667. return c.header_
  3668. }
  3669. func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3670. reqHeaders := make(http.Header)
  3671. for k, v := range c.header_ {
  3672. reqHeaders[k] = v
  3673. }
  3674. reqHeaders.Set("User-Agent", c.s.userAgent())
  3675. var body io.Reader = nil
  3676. c.urlParams_.Set("alt", alt)
  3677. c.urlParams_.Set("prettyPrint", "false")
  3678. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3679. urls += "?" + c.urlParams_.Encode()
  3680. req, err := http.NewRequest("DELETE", urls, body)
  3681. if err != nil {
  3682. return nil, err
  3683. }
  3684. req.Header = reqHeaders
  3685. googleapi.Expand(req.URL, map[string]string{
  3686. "name": c.name,
  3687. })
  3688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3689. }
  3690. // Do executes the "container.projects.locations.clusters.delete" call.
  3691. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3692. // status code is an error. Response headers are in either
  3693. // *Operation.ServerResponse.Header or (if a response was returned at
  3694. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3695. // to check whether the returned error was because
  3696. // http.StatusNotModified was returned.
  3697. func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3698. gensupport.SetOptions(c.urlParams_, opts...)
  3699. res, err := c.doRequest("json")
  3700. if res != nil && res.StatusCode == http.StatusNotModified {
  3701. if res.Body != nil {
  3702. res.Body.Close()
  3703. }
  3704. return nil, &googleapi.Error{
  3705. Code: res.StatusCode,
  3706. Header: res.Header,
  3707. }
  3708. }
  3709. if err != nil {
  3710. return nil, err
  3711. }
  3712. defer googleapi.CloseBody(res)
  3713. if err := googleapi.CheckResponse(res); err != nil {
  3714. return nil, err
  3715. }
  3716. ret := &Operation{
  3717. ServerResponse: googleapi.ServerResponse{
  3718. Header: res.Header,
  3719. HTTPStatusCode: res.StatusCode,
  3720. },
  3721. }
  3722. target := &ret
  3723. if err := gensupport.DecodeResponse(target, res); err != nil {
  3724. return nil, err
  3725. }
  3726. return ret, nil
  3727. // {
  3728. // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
  3729. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  3730. // "httpMethod": "DELETE",
  3731. // "id": "container.projects.locations.clusters.delete",
  3732. // "parameterOrder": [
  3733. // "name"
  3734. // ],
  3735. // "parameters": {
  3736. // "clusterId": {
  3737. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  3738. // "location": "query",
  3739. // "type": "string"
  3740. // },
  3741. // "name": {
  3742. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3743. // "location": "path",
  3744. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3745. // "required": true,
  3746. // "type": "string"
  3747. // },
  3748. // "projectId": {
  3749. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  3750. // "location": "query",
  3751. // "type": "string"
  3752. // },
  3753. // "zone": {
  3754. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  3755. // "location": "query",
  3756. // "type": "string"
  3757. // }
  3758. // },
  3759. // "path": "v1/{+name}",
  3760. // "response": {
  3761. // "$ref": "Operation"
  3762. // },
  3763. // "scopes": [
  3764. // "https://www.googleapis.com/auth/cloud-platform"
  3765. // ]
  3766. // }
  3767. }
  3768. // method id "container.projects.locations.clusters.get":
  3769. type ProjectsLocationsClustersGetCall struct {
  3770. s *Service
  3771. name string
  3772. urlParams_ gensupport.URLParams
  3773. ifNoneMatch_ string
  3774. ctx_ context.Context
  3775. header_ http.Header
  3776. }
  3777. // Get: Gets the details of a specific cluster.
  3778. func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall {
  3779. c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3780. c.name = name
  3781. return c
  3782. }
  3783. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  3784. // name of the cluster to retrieve.
  3785. // This field has been deprecated and replaced by the name field.
  3786. func (c *ProjectsLocationsClustersGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersGetCall {
  3787. c.urlParams_.Set("clusterId", clusterId)
  3788. return c
  3789. }
  3790. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3791. // Google Developers Console [project ID or
  3792. // project
  3793. // number](https://support.google.com/cloud/answer/6158840).
  3794. // This
  3795. // field has been deprecated and replaced by the name field.
  3796. func (c *ProjectsLocationsClustersGetCall) ProjectId(projectId string) *ProjectsLocationsClustersGetCall {
  3797. c.urlParams_.Set("projectId", projectId)
  3798. return c
  3799. }
  3800. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3801. // Google Compute Engine
  3802. // [zone](/compute/docs/zones#available) in which the
  3803. // cluster
  3804. // resides.
  3805. // This field has been deprecated and replaced by the name field.
  3806. func (c *ProjectsLocationsClustersGetCall) Zone(zone string) *ProjectsLocationsClustersGetCall {
  3807. c.urlParams_.Set("zone", zone)
  3808. return c
  3809. }
  3810. // Fields allows partial responses to be retrieved. See
  3811. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3812. // for more information.
  3813. func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall {
  3814. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3815. return c
  3816. }
  3817. // IfNoneMatch sets the optional parameter which makes the operation
  3818. // fail if the object's ETag matches the given value. This is useful for
  3819. // getting updates only after the object has changed since the last
  3820. // request. Use googleapi.IsNotModified to check whether the response
  3821. // error from Do is the result of In-None-Match.
  3822. func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall {
  3823. c.ifNoneMatch_ = entityTag
  3824. return c
  3825. }
  3826. // Context sets the context to be used in this call's Do method. Any
  3827. // pending HTTP request will be aborted if the provided context is
  3828. // canceled.
  3829. func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall {
  3830. c.ctx_ = ctx
  3831. return c
  3832. }
  3833. // Header returns an http.Header that can be modified by the caller to
  3834. // add HTTP headers to the request.
  3835. func (c *ProjectsLocationsClustersGetCall) Header() http.Header {
  3836. if c.header_ == nil {
  3837. c.header_ = make(http.Header)
  3838. }
  3839. return c.header_
  3840. }
  3841. func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  3842. reqHeaders := make(http.Header)
  3843. for k, v := range c.header_ {
  3844. reqHeaders[k] = v
  3845. }
  3846. reqHeaders.Set("User-Agent", c.s.userAgent())
  3847. if c.ifNoneMatch_ != "" {
  3848. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3849. }
  3850. var body io.Reader = nil
  3851. c.urlParams_.Set("alt", alt)
  3852. c.urlParams_.Set("prettyPrint", "false")
  3853. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3854. urls += "?" + c.urlParams_.Encode()
  3855. req, err := http.NewRequest("GET", urls, body)
  3856. if err != nil {
  3857. return nil, err
  3858. }
  3859. req.Header = reqHeaders
  3860. googleapi.Expand(req.URL, map[string]string{
  3861. "name": c.name,
  3862. })
  3863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3864. }
  3865. // Do executes the "container.projects.locations.clusters.get" call.
  3866. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  3867. // code is an error. Response headers are in either
  3868. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  3869. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3870. // check whether the returned error was because http.StatusNotModified
  3871. // was returned.
  3872. func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  3873. gensupport.SetOptions(c.urlParams_, opts...)
  3874. res, err := c.doRequest("json")
  3875. if res != nil && res.StatusCode == http.StatusNotModified {
  3876. if res.Body != nil {
  3877. res.Body.Close()
  3878. }
  3879. return nil, &googleapi.Error{
  3880. Code: res.StatusCode,
  3881. Header: res.Header,
  3882. }
  3883. }
  3884. if err != nil {
  3885. return nil, err
  3886. }
  3887. defer googleapi.CloseBody(res)
  3888. if err := googleapi.CheckResponse(res); err != nil {
  3889. return nil, err
  3890. }
  3891. ret := &Cluster{
  3892. ServerResponse: googleapi.ServerResponse{
  3893. Header: res.Header,
  3894. HTTPStatusCode: res.StatusCode,
  3895. },
  3896. }
  3897. target := &ret
  3898. if err := gensupport.DecodeResponse(target, res); err != nil {
  3899. return nil, err
  3900. }
  3901. return ret, nil
  3902. // {
  3903. // "description": "Gets the details of a specific cluster.",
  3904. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  3905. // "httpMethod": "GET",
  3906. // "id": "container.projects.locations.clusters.get",
  3907. // "parameterOrder": [
  3908. // "name"
  3909. // ],
  3910. // "parameters": {
  3911. // "clusterId": {
  3912. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  3913. // "location": "query",
  3914. // "type": "string"
  3915. // },
  3916. // "name": {
  3917. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3918. // "location": "path",
  3919. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3920. // "required": true,
  3921. // "type": "string"
  3922. // },
  3923. // "projectId": {
  3924. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  3925. // "location": "query",
  3926. // "type": "string"
  3927. // },
  3928. // "zone": {
  3929. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  3930. // "location": "query",
  3931. // "type": "string"
  3932. // }
  3933. // },
  3934. // "path": "v1/{+name}",
  3935. // "response": {
  3936. // "$ref": "Cluster"
  3937. // },
  3938. // "scopes": [
  3939. // "https://www.googleapis.com/auth/cloud-platform"
  3940. // ]
  3941. // }
  3942. }
  3943. // method id "container.projects.locations.clusters.getJwks":
  3944. type ProjectsLocationsClustersGetJwksCall struct {
  3945. s *Service
  3946. parent string
  3947. urlParams_ gensupport.URLParams
  3948. ifNoneMatch_ string
  3949. ctx_ context.Context
  3950. header_ http.Header
  3951. }
  3952. // GetJwks: GetJSONWebKeys gets the public component of the cluster
  3953. // signing keys in
  3954. // JSON Web Key format.
  3955. // This API is not yet intended for general use, and is not available
  3956. // for all
  3957. // clusters.
  3958. func (r *ProjectsLocationsClustersService) GetJwks(parent string) *ProjectsLocationsClustersGetJwksCall {
  3959. c := &ProjectsLocationsClustersGetJwksCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3960. c.parent = parent
  3961. return c
  3962. }
  3963. // Fields allows partial responses to be retrieved. See
  3964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3965. // for more information.
  3966. func (c *ProjectsLocationsClustersGetJwksCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetJwksCall {
  3967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3968. return c
  3969. }
  3970. // IfNoneMatch sets the optional parameter which makes the operation
  3971. // fail if the object's ETag matches the given value. This is useful for
  3972. // getting updates only after the object has changed since the last
  3973. // request. Use googleapi.IsNotModified to check whether the response
  3974. // error from Do is the result of In-None-Match.
  3975. func (c *ProjectsLocationsClustersGetJwksCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetJwksCall {
  3976. c.ifNoneMatch_ = entityTag
  3977. return c
  3978. }
  3979. // Context sets the context to be used in this call's Do method. Any
  3980. // pending HTTP request will be aborted if the provided context is
  3981. // canceled.
  3982. func (c *ProjectsLocationsClustersGetJwksCall) Context(ctx context.Context) *ProjectsLocationsClustersGetJwksCall {
  3983. c.ctx_ = ctx
  3984. return c
  3985. }
  3986. // Header returns an http.Header that can be modified by the caller to
  3987. // add HTTP headers to the request.
  3988. func (c *ProjectsLocationsClustersGetJwksCall) Header() http.Header {
  3989. if c.header_ == nil {
  3990. c.header_ = make(http.Header)
  3991. }
  3992. return c.header_
  3993. }
  3994. func (c *ProjectsLocationsClustersGetJwksCall) doRequest(alt string) (*http.Response, error) {
  3995. reqHeaders := make(http.Header)
  3996. for k, v := range c.header_ {
  3997. reqHeaders[k] = v
  3998. }
  3999. reqHeaders.Set("User-Agent", c.s.userAgent())
  4000. if c.ifNoneMatch_ != "" {
  4001. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4002. }
  4003. var body io.Reader = nil
  4004. c.urlParams_.Set("alt", alt)
  4005. c.urlParams_.Set("prettyPrint", "false")
  4006. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jwks")
  4007. urls += "?" + c.urlParams_.Encode()
  4008. req, err := http.NewRequest("GET", urls, body)
  4009. if err != nil {
  4010. return nil, err
  4011. }
  4012. req.Header = reqHeaders
  4013. googleapi.Expand(req.URL, map[string]string{
  4014. "parent": c.parent,
  4015. })
  4016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4017. }
  4018. // Do executes the "container.projects.locations.clusters.getJwks" call.
  4019. // Exactly one of *GetJSONWebKeysResponse or error will be non-nil. Any
  4020. // non-2xx status code is an error. Response headers are in either
  4021. // *GetJSONWebKeysResponse.ServerResponse.Header or (if a response was
  4022. // returned at all) in error.(*googleapi.Error).Header. Use
  4023. // googleapi.IsNotModified to check whether the returned error was
  4024. // because http.StatusNotModified was returned.
  4025. func (c *ProjectsLocationsClustersGetJwksCall) Do(opts ...googleapi.CallOption) (*GetJSONWebKeysResponse, error) {
  4026. gensupport.SetOptions(c.urlParams_, opts...)
  4027. res, err := c.doRequest("json")
  4028. if res != nil && res.StatusCode == http.StatusNotModified {
  4029. if res.Body != nil {
  4030. res.Body.Close()
  4031. }
  4032. return nil, &googleapi.Error{
  4033. Code: res.StatusCode,
  4034. Header: res.Header,
  4035. }
  4036. }
  4037. if err != nil {
  4038. return nil, err
  4039. }
  4040. defer googleapi.CloseBody(res)
  4041. if err := googleapi.CheckResponse(res); err != nil {
  4042. return nil, err
  4043. }
  4044. ret := &GetJSONWebKeysResponse{
  4045. ServerResponse: googleapi.ServerResponse{
  4046. Header: res.Header,
  4047. HTTPStatusCode: res.StatusCode,
  4048. },
  4049. }
  4050. target := &ret
  4051. if err := gensupport.DecodeResponse(target, res); err != nil {
  4052. return nil, err
  4053. }
  4054. return ret, nil
  4055. // {
  4056. // "description": "GetJSONWebKeys gets the public component of the cluster signing keys in\nJSON Web Key format.\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  4057. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/jwks",
  4058. // "httpMethod": "GET",
  4059. // "id": "container.projects.locations.clusters.getJwks",
  4060. // "parameterOrder": [
  4061. // "parent"
  4062. // ],
  4063. // "parameters": {
  4064. // "parent": {
  4065. // "description": "The cluster (project, location, cluster id) to get keys for. Specified in\nthe format 'projects/*/locations/*/clusters/*'.",
  4066. // "location": "path",
  4067. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4068. // "required": true,
  4069. // "type": "string"
  4070. // }
  4071. // },
  4072. // "path": "v1/{+parent}/jwks",
  4073. // "response": {
  4074. // "$ref": "GetJSONWebKeysResponse"
  4075. // },
  4076. // "scopes": [
  4077. // "https://www.googleapis.com/auth/cloud-platform"
  4078. // ]
  4079. // }
  4080. }
  4081. // method id "container.projects.locations.clusters.list":
  4082. type ProjectsLocationsClustersListCall struct {
  4083. s *Service
  4084. parent string
  4085. urlParams_ gensupport.URLParams
  4086. ifNoneMatch_ string
  4087. ctx_ context.Context
  4088. header_ http.Header
  4089. }
  4090. // List: Lists all clusters owned by a project in either the specified
  4091. // zone or all
  4092. // zones.
  4093. func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall {
  4094. c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4095. c.parent = parent
  4096. return c
  4097. }
  4098. // ProjectId sets the optional parameter "projectId": Deprecated. The
  4099. // Google Developers Console [project ID or
  4100. // project
  4101. // number](https://support.google.com/cloud/answer/6158840).
  4102. // This
  4103. // field has been deprecated and replaced by the parent field.
  4104. func (c *ProjectsLocationsClustersListCall) ProjectId(projectId string) *ProjectsLocationsClustersListCall {
  4105. c.urlParams_.Set("projectId", projectId)
  4106. return c
  4107. }
  4108. // Zone sets the optional parameter "zone": Deprecated. The name of the
  4109. // Google Compute Engine
  4110. // [zone](/compute/docs/zones#available) in which the cluster
  4111. // resides, or "-" for all zones.
  4112. // This field has been deprecated and replaced by the parent field.
  4113. func (c *ProjectsLocationsClustersListCall) Zone(zone string) *ProjectsLocationsClustersListCall {
  4114. c.urlParams_.Set("zone", zone)
  4115. return c
  4116. }
  4117. // Fields allows partial responses to be retrieved. See
  4118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4119. // for more information.
  4120. func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall {
  4121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4122. return c
  4123. }
  4124. // IfNoneMatch sets the optional parameter which makes the operation
  4125. // fail if the object's ETag matches the given value. This is useful for
  4126. // getting updates only after the object has changed since the last
  4127. // request. Use googleapi.IsNotModified to check whether the response
  4128. // error from Do is the result of In-None-Match.
  4129. func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall {
  4130. c.ifNoneMatch_ = entityTag
  4131. return c
  4132. }
  4133. // Context sets the context to be used in this call's Do method. Any
  4134. // pending HTTP request will be aborted if the provided context is
  4135. // canceled.
  4136. func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall {
  4137. c.ctx_ = ctx
  4138. return c
  4139. }
  4140. // Header returns an http.Header that can be modified by the caller to
  4141. // add HTTP headers to the request.
  4142. func (c *ProjectsLocationsClustersListCall) Header() http.Header {
  4143. if c.header_ == nil {
  4144. c.header_ = make(http.Header)
  4145. }
  4146. return c.header_
  4147. }
  4148. func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) {
  4149. reqHeaders := make(http.Header)
  4150. for k, v := range c.header_ {
  4151. reqHeaders[k] = v
  4152. }
  4153. reqHeaders.Set("User-Agent", c.s.userAgent())
  4154. if c.ifNoneMatch_ != "" {
  4155. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4156. }
  4157. var body io.Reader = nil
  4158. c.urlParams_.Set("alt", alt)
  4159. c.urlParams_.Set("prettyPrint", "false")
  4160. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  4161. urls += "?" + c.urlParams_.Encode()
  4162. req, err := http.NewRequest("GET", urls, body)
  4163. if err != nil {
  4164. return nil, err
  4165. }
  4166. req.Header = reqHeaders
  4167. googleapi.Expand(req.URL, map[string]string{
  4168. "parent": c.parent,
  4169. })
  4170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4171. }
  4172. // Do executes the "container.projects.locations.clusters.list" call.
  4173. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  4174. // non-2xx status code is an error. Response headers are in either
  4175. // *ListClustersResponse.ServerResponse.Header or (if a response was
  4176. // returned at all) in error.(*googleapi.Error).Header. Use
  4177. // googleapi.IsNotModified to check whether the returned error was
  4178. // because http.StatusNotModified was returned.
  4179. func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  4180. gensupport.SetOptions(c.urlParams_, opts...)
  4181. res, err := c.doRequest("json")
  4182. if res != nil && res.StatusCode == http.StatusNotModified {
  4183. if res.Body != nil {
  4184. res.Body.Close()
  4185. }
  4186. return nil, &googleapi.Error{
  4187. Code: res.StatusCode,
  4188. Header: res.Header,
  4189. }
  4190. }
  4191. if err != nil {
  4192. return nil, err
  4193. }
  4194. defer googleapi.CloseBody(res)
  4195. if err := googleapi.CheckResponse(res); err != nil {
  4196. return nil, err
  4197. }
  4198. ret := &ListClustersResponse{
  4199. ServerResponse: googleapi.ServerResponse{
  4200. Header: res.Header,
  4201. HTTPStatusCode: res.StatusCode,
  4202. },
  4203. }
  4204. target := &ret
  4205. if err := gensupport.DecodeResponse(target, res); err != nil {
  4206. return nil, err
  4207. }
  4208. return ret, nil
  4209. // {
  4210. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  4211. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  4212. // "httpMethod": "GET",
  4213. // "id": "container.projects.locations.clusters.list",
  4214. // "parameterOrder": [
  4215. // "parent"
  4216. // ],
  4217. // "parameters": {
  4218. // "parent": {
  4219. // "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  4220. // "location": "path",
  4221. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4222. // "required": true,
  4223. // "type": "string"
  4224. // },
  4225. // "projectId": {
  4226. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  4227. // "location": "query",
  4228. // "type": "string"
  4229. // },
  4230. // "zone": {
  4231. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field has been deprecated and replaced by the parent field.",
  4232. // "location": "query",
  4233. // "type": "string"
  4234. // }
  4235. // },
  4236. // "path": "v1/{+parent}/clusters",
  4237. // "response": {
  4238. // "$ref": "ListClustersResponse"
  4239. // },
  4240. // "scopes": [
  4241. // "https://www.googleapis.com/auth/cloud-platform"
  4242. // ]
  4243. // }
  4244. }
  4245. // method id "container.projects.locations.clusters.setAddons":
  4246. type ProjectsLocationsClustersSetAddonsCall struct {
  4247. s *Service
  4248. name string
  4249. setaddonsconfigrequest *SetAddonsConfigRequest
  4250. urlParams_ gensupport.URLParams
  4251. ctx_ context.Context
  4252. header_ http.Header
  4253. }
  4254. // SetAddons: Sets the addons for a specific cluster.
  4255. func (r *ProjectsLocationsClustersService) SetAddons(name string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsLocationsClustersSetAddonsCall {
  4256. c := &ProjectsLocationsClustersSetAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4257. c.name = name
  4258. c.setaddonsconfigrequest = setaddonsconfigrequest
  4259. return c
  4260. }
  4261. // Fields allows partial responses to be retrieved. See
  4262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4263. // for more information.
  4264. func (c *ProjectsLocationsClustersSetAddonsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetAddonsCall {
  4265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4266. return c
  4267. }
  4268. // Context sets the context to be used in this call's Do method. Any
  4269. // pending HTTP request will be aborted if the provided context is
  4270. // canceled.
  4271. func (c *ProjectsLocationsClustersSetAddonsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetAddonsCall {
  4272. c.ctx_ = ctx
  4273. return c
  4274. }
  4275. // Header returns an http.Header that can be modified by the caller to
  4276. // add HTTP headers to the request.
  4277. func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header {
  4278. if c.header_ == nil {
  4279. c.header_ = make(http.Header)
  4280. }
  4281. return c.header_
  4282. }
  4283. func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) {
  4284. reqHeaders := make(http.Header)
  4285. for k, v := range c.header_ {
  4286. reqHeaders[k] = v
  4287. }
  4288. reqHeaders.Set("User-Agent", c.s.userAgent())
  4289. var body io.Reader = nil
  4290. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  4291. if err != nil {
  4292. return nil, err
  4293. }
  4294. reqHeaders.Set("Content-Type", "application/json")
  4295. c.urlParams_.Set("alt", alt)
  4296. c.urlParams_.Set("prettyPrint", "false")
  4297. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAddons")
  4298. urls += "?" + c.urlParams_.Encode()
  4299. req, err := http.NewRequest("POST", urls, body)
  4300. if err != nil {
  4301. return nil, err
  4302. }
  4303. req.Header = reqHeaders
  4304. googleapi.Expand(req.URL, map[string]string{
  4305. "name": c.name,
  4306. })
  4307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4308. }
  4309. // Do executes the "container.projects.locations.clusters.setAddons" call.
  4310. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4311. // status code is an error. Response headers are in either
  4312. // *Operation.ServerResponse.Header or (if a response was returned at
  4313. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4314. // to check whether the returned error was because
  4315. // http.StatusNotModified was returned.
  4316. func (c *ProjectsLocationsClustersSetAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4317. gensupport.SetOptions(c.urlParams_, opts...)
  4318. res, err := c.doRequest("json")
  4319. if res != nil && res.StatusCode == http.StatusNotModified {
  4320. if res.Body != nil {
  4321. res.Body.Close()
  4322. }
  4323. return nil, &googleapi.Error{
  4324. Code: res.StatusCode,
  4325. Header: res.Header,
  4326. }
  4327. }
  4328. if err != nil {
  4329. return nil, err
  4330. }
  4331. defer googleapi.CloseBody(res)
  4332. if err := googleapi.CheckResponse(res); err != nil {
  4333. return nil, err
  4334. }
  4335. ret := &Operation{
  4336. ServerResponse: googleapi.ServerResponse{
  4337. Header: res.Header,
  4338. HTTPStatusCode: res.StatusCode,
  4339. },
  4340. }
  4341. target := &ret
  4342. if err := gensupport.DecodeResponse(target, res); err != nil {
  4343. return nil, err
  4344. }
  4345. return ret, nil
  4346. // {
  4347. // "description": "Sets the addons for a specific cluster.",
  4348. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons",
  4349. // "httpMethod": "POST",
  4350. // "id": "container.projects.locations.clusters.setAddons",
  4351. // "parameterOrder": [
  4352. // "name"
  4353. // ],
  4354. // "parameters": {
  4355. // "name": {
  4356. // "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4357. // "location": "path",
  4358. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4359. // "required": true,
  4360. // "type": "string"
  4361. // }
  4362. // },
  4363. // "path": "v1/{+name}:setAddons",
  4364. // "request": {
  4365. // "$ref": "SetAddonsConfigRequest"
  4366. // },
  4367. // "response": {
  4368. // "$ref": "Operation"
  4369. // },
  4370. // "scopes": [
  4371. // "https://www.googleapis.com/auth/cloud-platform"
  4372. // ]
  4373. // }
  4374. }
  4375. // method id "container.projects.locations.clusters.setLegacyAbac":
  4376. type ProjectsLocationsClustersSetLegacyAbacCall struct {
  4377. s *Service
  4378. name string
  4379. setlegacyabacrequest *SetLegacyAbacRequest
  4380. urlParams_ gensupport.URLParams
  4381. ctx_ context.Context
  4382. header_ http.Header
  4383. }
  4384. // SetLegacyAbac: Enables or disables the ABAC authorization mechanism
  4385. // on a cluster.
  4386. func (r *ProjectsLocationsClustersService) SetLegacyAbac(name string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsLocationsClustersSetLegacyAbacCall {
  4387. c := &ProjectsLocationsClustersSetLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4388. c.name = name
  4389. c.setlegacyabacrequest = setlegacyabacrequest
  4390. return c
  4391. }
  4392. // Fields allows partial responses to be retrieved. See
  4393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4394. // for more information.
  4395. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLegacyAbacCall {
  4396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4397. return c
  4398. }
  4399. // Context sets the context to be used in this call's Do method. Any
  4400. // pending HTTP request will be aborted if the provided context is
  4401. // canceled.
  4402. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLegacyAbacCall {
  4403. c.ctx_ = ctx
  4404. return c
  4405. }
  4406. // Header returns an http.Header that can be modified by the caller to
  4407. // add HTTP headers to the request.
  4408. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header {
  4409. if c.header_ == nil {
  4410. c.header_ = make(http.Header)
  4411. }
  4412. return c.header_
  4413. }
  4414. func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  4415. reqHeaders := make(http.Header)
  4416. for k, v := range c.header_ {
  4417. reqHeaders[k] = v
  4418. }
  4419. reqHeaders.Set("User-Agent", c.s.userAgent())
  4420. var body io.Reader = nil
  4421. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  4422. if err != nil {
  4423. return nil, err
  4424. }
  4425. reqHeaders.Set("Content-Type", "application/json")
  4426. c.urlParams_.Set("alt", alt)
  4427. c.urlParams_.Set("prettyPrint", "false")
  4428. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLegacyAbac")
  4429. urls += "?" + c.urlParams_.Encode()
  4430. req, err := http.NewRequest("POST", urls, body)
  4431. if err != nil {
  4432. return nil, err
  4433. }
  4434. req.Header = reqHeaders
  4435. googleapi.Expand(req.URL, map[string]string{
  4436. "name": c.name,
  4437. })
  4438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4439. }
  4440. // Do executes the "container.projects.locations.clusters.setLegacyAbac" call.
  4441. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4442. // status code is an error. Response headers are in either
  4443. // *Operation.ServerResponse.Header or (if a response was returned at
  4444. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4445. // to check whether the returned error was because
  4446. // http.StatusNotModified was returned.
  4447. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4448. gensupport.SetOptions(c.urlParams_, opts...)
  4449. res, err := c.doRequest("json")
  4450. if res != nil && res.StatusCode == http.StatusNotModified {
  4451. if res.Body != nil {
  4452. res.Body.Close()
  4453. }
  4454. return nil, &googleapi.Error{
  4455. Code: res.StatusCode,
  4456. Header: res.Header,
  4457. }
  4458. }
  4459. if err != nil {
  4460. return nil, err
  4461. }
  4462. defer googleapi.CloseBody(res)
  4463. if err := googleapi.CheckResponse(res); err != nil {
  4464. return nil, err
  4465. }
  4466. ret := &Operation{
  4467. ServerResponse: googleapi.ServerResponse{
  4468. Header: res.Header,
  4469. HTTPStatusCode: res.StatusCode,
  4470. },
  4471. }
  4472. target := &ret
  4473. if err := gensupport.DecodeResponse(target, res); err != nil {
  4474. return nil, err
  4475. }
  4476. return ret, nil
  4477. // {
  4478. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  4479. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac",
  4480. // "httpMethod": "POST",
  4481. // "id": "container.projects.locations.clusters.setLegacyAbac",
  4482. // "parameterOrder": [
  4483. // "name"
  4484. // ],
  4485. // "parameters": {
  4486. // "name": {
  4487. // "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4488. // "location": "path",
  4489. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4490. // "required": true,
  4491. // "type": "string"
  4492. // }
  4493. // },
  4494. // "path": "v1/{+name}:setLegacyAbac",
  4495. // "request": {
  4496. // "$ref": "SetLegacyAbacRequest"
  4497. // },
  4498. // "response": {
  4499. // "$ref": "Operation"
  4500. // },
  4501. // "scopes": [
  4502. // "https://www.googleapis.com/auth/cloud-platform"
  4503. // ]
  4504. // }
  4505. }
  4506. // method id "container.projects.locations.clusters.setLocations":
  4507. type ProjectsLocationsClustersSetLocationsCall struct {
  4508. s *Service
  4509. name string
  4510. setlocationsrequest *SetLocationsRequest
  4511. urlParams_ gensupport.URLParams
  4512. ctx_ context.Context
  4513. header_ http.Header
  4514. }
  4515. // SetLocations: Sets the locations for a specific cluster.
  4516. func (r *ProjectsLocationsClustersService) SetLocations(name string, setlocationsrequest *SetLocationsRequest) *ProjectsLocationsClustersSetLocationsCall {
  4517. c := &ProjectsLocationsClustersSetLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4518. c.name = name
  4519. c.setlocationsrequest = setlocationsrequest
  4520. return c
  4521. }
  4522. // Fields allows partial responses to be retrieved. See
  4523. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4524. // for more information.
  4525. func (c *ProjectsLocationsClustersSetLocationsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLocationsCall {
  4526. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4527. return c
  4528. }
  4529. // Context sets the context to be used in this call's Do method. Any
  4530. // pending HTTP request will be aborted if the provided context is
  4531. // canceled.
  4532. func (c *ProjectsLocationsClustersSetLocationsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLocationsCall {
  4533. c.ctx_ = ctx
  4534. return c
  4535. }
  4536. // Header returns an http.Header that can be modified by the caller to
  4537. // add HTTP headers to the request.
  4538. func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header {
  4539. if c.header_ == nil {
  4540. c.header_ = make(http.Header)
  4541. }
  4542. return c.header_
  4543. }
  4544. func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) {
  4545. reqHeaders := make(http.Header)
  4546. for k, v := range c.header_ {
  4547. reqHeaders[k] = v
  4548. }
  4549. reqHeaders.Set("User-Agent", c.s.userAgent())
  4550. var body io.Reader = nil
  4551. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  4552. if err != nil {
  4553. return nil, err
  4554. }
  4555. reqHeaders.Set("Content-Type", "application/json")
  4556. c.urlParams_.Set("alt", alt)
  4557. c.urlParams_.Set("prettyPrint", "false")
  4558. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLocations")
  4559. urls += "?" + c.urlParams_.Encode()
  4560. req, err := http.NewRequest("POST", urls, body)
  4561. if err != nil {
  4562. return nil, err
  4563. }
  4564. req.Header = reqHeaders
  4565. googleapi.Expand(req.URL, map[string]string{
  4566. "name": c.name,
  4567. })
  4568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4569. }
  4570. // Do executes the "container.projects.locations.clusters.setLocations" call.
  4571. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4572. // status code is an error. Response headers are in either
  4573. // *Operation.ServerResponse.Header or (if a response was returned at
  4574. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4575. // to check whether the returned error was because
  4576. // http.StatusNotModified was returned.
  4577. func (c *ProjectsLocationsClustersSetLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4578. gensupport.SetOptions(c.urlParams_, opts...)
  4579. res, err := c.doRequest("json")
  4580. if res != nil && res.StatusCode == http.StatusNotModified {
  4581. if res.Body != nil {
  4582. res.Body.Close()
  4583. }
  4584. return nil, &googleapi.Error{
  4585. Code: res.StatusCode,
  4586. Header: res.Header,
  4587. }
  4588. }
  4589. if err != nil {
  4590. return nil, err
  4591. }
  4592. defer googleapi.CloseBody(res)
  4593. if err := googleapi.CheckResponse(res); err != nil {
  4594. return nil, err
  4595. }
  4596. ret := &Operation{
  4597. ServerResponse: googleapi.ServerResponse{
  4598. Header: res.Header,
  4599. HTTPStatusCode: res.StatusCode,
  4600. },
  4601. }
  4602. target := &ret
  4603. if err := gensupport.DecodeResponse(target, res); err != nil {
  4604. return nil, err
  4605. }
  4606. return ret, nil
  4607. // {
  4608. // "description": "Sets the locations for a specific cluster.",
  4609. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations",
  4610. // "httpMethod": "POST",
  4611. // "id": "container.projects.locations.clusters.setLocations",
  4612. // "parameterOrder": [
  4613. // "name"
  4614. // ],
  4615. // "parameters": {
  4616. // "name": {
  4617. // "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4618. // "location": "path",
  4619. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4620. // "required": true,
  4621. // "type": "string"
  4622. // }
  4623. // },
  4624. // "path": "v1/{+name}:setLocations",
  4625. // "request": {
  4626. // "$ref": "SetLocationsRequest"
  4627. // },
  4628. // "response": {
  4629. // "$ref": "Operation"
  4630. // },
  4631. // "scopes": [
  4632. // "https://www.googleapis.com/auth/cloud-platform"
  4633. // ]
  4634. // }
  4635. }
  4636. // method id "container.projects.locations.clusters.setLogging":
  4637. type ProjectsLocationsClustersSetLoggingCall struct {
  4638. s *Service
  4639. name string
  4640. setloggingservicerequest *SetLoggingServiceRequest
  4641. urlParams_ gensupport.URLParams
  4642. ctx_ context.Context
  4643. header_ http.Header
  4644. }
  4645. // SetLogging: Sets the logging service for a specific cluster.
  4646. func (r *ProjectsLocationsClustersService) SetLogging(name string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsLocationsClustersSetLoggingCall {
  4647. c := &ProjectsLocationsClustersSetLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4648. c.name = name
  4649. c.setloggingservicerequest = setloggingservicerequest
  4650. return c
  4651. }
  4652. // Fields allows partial responses to be retrieved. See
  4653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4654. // for more information.
  4655. func (c *ProjectsLocationsClustersSetLoggingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLoggingCall {
  4656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4657. return c
  4658. }
  4659. // Context sets the context to be used in this call's Do method. Any
  4660. // pending HTTP request will be aborted if the provided context is
  4661. // canceled.
  4662. func (c *ProjectsLocationsClustersSetLoggingCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLoggingCall {
  4663. c.ctx_ = ctx
  4664. return c
  4665. }
  4666. // Header returns an http.Header that can be modified by the caller to
  4667. // add HTTP headers to the request.
  4668. func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header {
  4669. if c.header_ == nil {
  4670. c.header_ = make(http.Header)
  4671. }
  4672. return c.header_
  4673. }
  4674. func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) {
  4675. reqHeaders := make(http.Header)
  4676. for k, v := range c.header_ {
  4677. reqHeaders[k] = v
  4678. }
  4679. reqHeaders.Set("User-Agent", c.s.userAgent())
  4680. var body io.Reader = nil
  4681. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  4682. if err != nil {
  4683. return nil, err
  4684. }
  4685. reqHeaders.Set("Content-Type", "application/json")
  4686. c.urlParams_.Set("alt", alt)
  4687. c.urlParams_.Set("prettyPrint", "false")
  4688. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLogging")
  4689. urls += "?" + c.urlParams_.Encode()
  4690. req, err := http.NewRequest("POST", urls, body)
  4691. if err != nil {
  4692. return nil, err
  4693. }
  4694. req.Header = reqHeaders
  4695. googleapi.Expand(req.URL, map[string]string{
  4696. "name": c.name,
  4697. })
  4698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4699. }
  4700. // Do executes the "container.projects.locations.clusters.setLogging" call.
  4701. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4702. // status code is an error. Response headers are in either
  4703. // *Operation.ServerResponse.Header or (if a response was returned at
  4704. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4705. // to check whether the returned error was because
  4706. // http.StatusNotModified was returned.
  4707. func (c *ProjectsLocationsClustersSetLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4708. gensupport.SetOptions(c.urlParams_, opts...)
  4709. res, err := c.doRequest("json")
  4710. if res != nil && res.StatusCode == http.StatusNotModified {
  4711. if res.Body != nil {
  4712. res.Body.Close()
  4713. }
  4714. return nil, &googleapi.Error{
  4715. Code: res.StatusCode,
  4716. Header: res.Header,
  4717. }
  4718. }
  4719. if err != nil {
  4720. return nil, err
  4721. }
  4722. defer googleapi.CloseBody(res)
  4723. if err := googleapi.CheckResponse(res); err != nil {
  4724. return nil, err
  4725. }
  4726. ret := &Operation{
  4727. ServerResponse: googleapi.ServerResponse{
  4728. Header: res.Header,
  4729. HTTPStatusCode: res.StatusCode,
  4730. },
  4731. }
  4732. target := &ret
  4733. if err := gensupport.DecodeResponse(target, res); err != nil {
  4734. return nil, err
  4735. }
  4736. return ret, nil
  4737. // {
  4738. // "description": "Sets the logging service for a specific cluster.",
  4739. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging",
  4740. // "httpMethod": "POST",
  4741. // "id": "container.projects.locations.clusters.setLogging",
  4742. // "parameterOrder": [
  4743. // "name"
  4744. // ],
  4745. // "parameters": {
  4746. // "name": {
  4747. // "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4748. // "location": "path",
  4749. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4750. // "required": true,
  4751. // "type": "string"
  4752. // }
  4753. // },
  4754. // "path": "v1/{+name}:setLogging",
  4755. // "request": {
  4756. // "$ref": "SetLoggingServiceRequest"
  4757. // },
  4758. // "response": {
  4759. // "$ref": "Operation"
  4760. // },
  4761. // "scopes": [
  4762. // "https://www.googleapis.com/auth/cloud-platform"
  4763. // ]
  4764. // }
  4765. }
  4766. // method id "container.projects.locations.clusters.setMaintenancePolicy":
  4767. type ProjectsLocationsClustersSetMaintenancePolicyCall struct {
  4768. s *Service
  4769. name string
  4770. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  4771. urlParams_ gensupport.URLParams
  4772. ctx_ context.Context
  4773. header_ http.Header
  4774. }
  4775. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  4776. func (r *ProjectsLocationsClustersService) SetMaintenancePolicy(name string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4777. c := &ProjectsLocationsClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4778. c.name = name
  4779. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  4780. return c
  4781. }
  4782. // Fields allows partial responses to be retrieved. See
  4783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4784. // for more information.
  4785. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4787. return c
  4788. }
  4789. // Context sets the context to be used in this call's Do method. Any
  4790. // pending HTTP request will be aborted if the provided context is
  4791. // canceled.
  4792. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4793. c.ctx_ = ctx
  4794. return c
  4795. }
  4796. // Header returns an http.Header that can be modified by the caller to
  4797. // add HTTP headers to the request.
  4798. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header {
  4799. if c.header_ == nil {
  4800. c.header_ = make(http.Header)
  4801. }
  4802. return c.header_
  4803. }
  4804. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  4805. reqHeaders := make(http.Header)
  4806. for k, v := range c.header_ {
  4807. reqHeaders[k] = v
  4808. }
  4809. reqHeaders.Set("User-Agent", c.s.userAgent())
  4810. var body io.Reader = nil
  4811. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  4812. if err != nil {
  4813. return nil, err
  4814. }
  4815. reqHeaders.Set("Content-Type", "application/json")
  4816. c.urlParams_.Set("alt", alt)
  4817. c.urlParams_.Set("prettyPrint", "false")
  4818. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMaintenancePolicy")
  4819. urls += "?" + c.urlParams_.Encode()
  4820. req, err := http.NewRequest("POST", urls, body)
  4821. if err != nil {
  4822. return nil, err
  4823. }
  4824. req.Header = reqHeaders
  4825. googleapi.Expand(req.URL, map[string]string{
  4826. "name": c.name,
  4827. })
  4828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4829. }
  4830. // Do executes the "container.projects.locations.clusters.setMaintenancePolicy" call.
  4831. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4832. // status code is an error. Response headers are in either
  4833. // *Operation.ServerResponse.Header or (if a response was returned at
  4834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4835. // to check whether the returned error was because
  4836. // http.StatusNotModified was returned.
  4837. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4838. gensupport.SetOptions(c.urlParams_, opts...)
  4839. res, err := c.doRequest("json")
  4840. if res != nil && res.StatusCode == http.StatusNotModified {
  4841. if res.Body != nil {
  4842. res.Body.Close()
  4843. }
  4844. return nil, &googleapi.Error{
  4845. Code: res.StatusCode,
  4846. Header: res.Header,
  4847. }
  4848. }
  4849. if err != nil {
  4850. return nil, err
  4851. }
  4852. defer googleapi.CloseBody(res)
  4853. if err := googleapi.CheckResponse(res); err != nil {
  4854. return nil, err
  4855. }
  4856. ret := &Operation{
  4857. ServerResponse: googleapi.ServerResponse{
  4858. Header: res.Header,
  4859. HTTPStatusCode: res.StatusCode,
  4860. },
  4861. }
  4862. target := &ret
  4863. if err := gensupport.DecodeResponse(target, res); err != nil {
  4864. return nil, err
  4865. }
  4866. return ret, nil
  4867. // {
  4868. // "description": "Sets the maintenance policy for a cluster.",
  4869. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy",
  4870. // "httpMethod": "POST",
  4871. // "id": "container.projects.locations.clusters.setMaintenancePolicy",
  4872. // "parameterOrder": [
  4873. // "name"
  4874. // ],
  4875. // "parameters": {
  4876. // "name": {
  4877. // "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4878. // "location": "path",
  4879. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4880. // "required": true,
  4881. // "type": "string"
  4882. // }
  4883. // },
  4884. // "path": "v1/{+name}:setMaintenancePolicy",
  4885. // "request": {
  4886. // "$ref": "SetMaintenancePolicyRequest"
  4887. // },
  4888. // "response": {
  4889. // "$ref": "Operation"
  4890. // },
  4891. // "scopes": [
  4892. // "https://www.googleapis.com/auth/cloud-platform"
  4893. // ]
  4894. // }
  4895. }
  4896. // method id "container.projects.locations.clusters.setMasterAuth":
  4897. type ProjectsLocationsClustersSetMasterAuthCall struct {
  4898. s *Service
  4899. name string
  4900. setmasterauthrequest *SetMasterAuthRequest
  4901. urlParams_ gensupport.URLParams
  4902. ctx_ context.Context
  4903. header_ http.Header
  4904. }
  4905. // SetMasterAuth: Used to set master auth materials. Currently supports
  4906. // :-
  4907. // Changing the admin password for a specific cluster.
  4908. // This can be either via password generation or explicitly set the
  4909. // password.
  4910. func (r *ProjectsLocationsClustersService) SetMasterAuth(name string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsLocationsClustersSetMasterAuthCall {
  4911. c := &ProjectsLocationsClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4912. c.name = name
  4913. c.setmasterauthrequest = setmasterauthrequest
  4914. return c
  4915. }
  4916. // Fields allows partial responses to be retrieved. See
  4917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4918. // for more information.
  4919. func (c *ProjectsLocationsClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMasterAuthCall {
  4920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4921. return c
  4922. }
  4923. // Context sets the context to be used in this call's Do method. Any
  4924. // pending HTTP request will be aborted if the provided context is
  4925. // canceled.
  4926. func (c *ProjectsLocationsClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMasterAuthCall {
  4927. c.ctx_ = ctx
  4928. return c
  4929. }
  4930. // Header returns an http.Header that can be modified by the caller to
  4931. // add HTTP headers to the request.
  4932. func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header {
  4933. if c.header_ == nil {
  4934. c.header_ = make(http.Header)
  4935. }
  4936. return c.header_
  4937. }
  4938. func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  4939. reqHeaders := make(http.Header)
  4940. for k, v := range c.header_ {
  4941. reqHeaders[k] = v
  4942. }
  4943. reqHeaders.Set("User-Agent", c.s.userAgent())
  4944. var body io.Reader = nil
  4945. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  4946. if err != nil {
  4947. return nil, err
  4948. }
  4949. reqHeaders.Set("Content-Type", "application/json")
  4950. c.urlParams_.Set("alt", alt)
  4951. c.urlParams_.Set("prettyPrint", "false")
  4952. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMasterAuth")
  4953. urls += "?" + c.urlParams_.Encode()
  4954. req, err := http.NewRequest("POST", urls, body)
  4955. if err != nil {
  4956. return nil, err
  4957. }
  4958. req.Header = reqHeaders
  4959. googleapi.Expand(req.URL, map[string]string{
  4960. "name": c.name,
  4961. })
  4962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4963. }
  4964. // Do executes the "container.projects.locations.clusters.setMasterAuth" call.
  4965. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4966. // status code is an error. Response headers are in either
  4967. // *Operation.ServerResponse.Header or (if a response was returned at
  4968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4969. // to check whether the returned error was because
  4970. // http.StatusNotModified was returned.
  4971. func (c *ProjectsLocationsClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4972. gensupport.SetOptions(c.urlParams_, opts...)
  4973. res, err := c.doRequest("json")
  4974. if res != nil && res.StatusCode == http.StatusNotModified {
  4975. if res.Body != nil {
  4976. res.Body.Close()
  4977. }
  4978. return nil, &googleapi.Error{
  4979. Code: res.StatusCode,
  4980. Header: res.Header,
  4981. }
  4982. }
  4983. if err != nil {
  4984. return nil, err
  4985. }
  4986. defer googleapi.CloseBody(res)
  4987. if err := googleapi.CheckResponse(res); err != nil {
  4988. return nil, err
  4989. }
  4990. ret := &Operation{
  4991. ServerResponse: googleapi.ServerResponse{
  4992. Header: res.Header,
  4993. HTTPStatusCode: res.StatusCode,
  4994. },
  4995. }
  4996. target := &ret
  4997. if err := gensupport.DecodeResponse(target, res); err != nil {
  4998. return nil, err
  4999. }
  5000. return ret, nil
  5001. // {
  5002. // "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set the password.",
  5003. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
  5004. // "httpMethod": "POST",
  5005. // "id": "container.projects.locations.clusters.setMasterAuth",
  5006. // "parameterOrder": [
  5007. // "name"
  5008. // ],
  5009. // "parameters": {
  5010. // "name": {
  5011. // "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5012. // "location": "path",
  5013. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5014. // "required": true,
  5015. // "type": "string"
  5016. // }
  5017. // },
  5018. // "path": "v1/{+name}:setMasterAuth",
  5019. // "request": {
  5020. // "$ref": "SetMasterAuthRequest"
  5021. // },
  5022. // "response": {
  5023. // "$ref": "Operation"
  5024. // },
  5025. // "scopes": [
  5026. // "https://www.googleapis.com/auth/cloud-platform"
  5027. // ]
  5028. // }
  5029. }
  5030. // method id "container.projects.locations.clusters.setMonitoring":
  5031. type ProjectsLocationsClustersSetMonitoringCall struct {
  5032. s *Service
  5033. name string
  5034. setmonitoringservicerequest *SetMonitoringServiceRequest
  5035. urlParams_ gensupport.URLParams
  5036. ctx_ context.Context
  5037. header_ http.Header
  5038. }
  5039. // SetMonitoring: Sets the monitoring service for a specific cluster.
  5040. func (r *ProjectsLocationsClustersService) SetMonitoring(name string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsLocationsClustersSetMonitoringCall {
  5041. c := &ProjectsLocationsClustersSetMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5042. c.name = name
  5043. c.setmonitoringservicerequest = setmonitoringservicerequest
  5044. return c
  5045. }
  5046. // Fields allows partial responses to be retrieved. See
  5047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5048. // for more information.
  5049. func (c *ProjectsLocationsClustersSetMonitoringCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMonitoringCall {
  5050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5051. return c
  5052. }
  5053. // Context sets the context to be used in this call's Do method. Any
  5054. // pending HTTP request will be aborted if the provided context is
  5055. // canceled.
  5056. func (c *ProjectsLocationsClustersSetMonitoringCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMonitoringCall {
  5057. c.ctx_ = ctx
  5058. return c
  5059. }
  5060. // Header returns an http.Header that can be modified by the caller to
  5061. // add HTTP headers to the request.
  5062. func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header {
  5063. if c.header_ == nil {
  5064. c.header_ = make(http.Header)
  5065. }
  5066. return c.header_
  5067. }
  5068. func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) {
  5069. reqHeaders := make(http.Header)
  5070. for k, v := range c.header_ {
  5071. reqHeaders[k] = v
  5072. }
  5073. reqHeaders.Set("User-Agent", c.s.userAgent())
  5074. var body io.Reader = nil
  5075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  5076. if err != nil {
  5077. return nil, err
  5078. }
  5079. reqHeaders.Set("Content-Type", "application/json")
  5080. c.urlParams_.Set("alt", alt)
  5081. c.urlParams_.Set("prettyPrint", "false")
  5082. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMonitoring")
  5083. urls += "?" + c.urlParams_.Encode()
  5084. req, err := http.NewRequest("POST", urls, body)
  5085. if err != nil {
  5086. return nil, err
  5087. }
  5088. req.Header = reqHeaders
  5089. googleapi.Expand(req.URL, map[string]string{
  5090. "name": c.name,
  5091. })
  5092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5093. }
  5094. // Do executes the "container.projects.locations.clusters.setMonitoring" call.
  5095. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5096. // status code is an error. Response headers are in either
  5097. // *Operation.ServerResponse.Header or (if a response was returned at
  5098. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5099. // to check whether the returned error was because
  5100. // http.StatusNotModified was returned.
  5101. func (c *ProjectsLocationsClustersSetMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5102. gensupport.SetOptions(c.urlParams_, opts...)
  5103. res, err := c.doRequest("json")
  5104. if res != nil && res.StatusCode == http.StatusNotModified {
  5105. if res.Body != nil {
  5106. res.Body.Close()
  5107. }
  5108. return nil, &googleapi.Error{
  5109. Code: res.StatusCode,
  5110. Header: res.Header,
  5111. }
  5112. }
  5113. if err != nil {
  5114. return nil, err
  5115. }
  5116. defer googleapi.CloseBody(res)
  5117. if err := googleapi.CheckResponse(res); err != nil {
  5118. return nil, err
  5119. }
  5120. ret := &Operation{
  5121. ServerResponse: googleapi.ServerResponse{
  5122. Header: res.Header,
  5123. HTTPStatusCode: res.StatusCode,
  5124. },
  5125. }
  5126. target := &ret
  5127. if err := gensupport.DecodeResponse(target, res); err != nil {
  5128. return nil, err
  5129. }
  5130. return ret, nil
  5131. // {
  5132. // "description": "Sets the monitoring service for a specific cluster.",
  5133. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring",
  5134. // "httpMethod": "POST",
  5135. // "id": "container.projects.locations.clusters.setMonitoring",
  5136. // "parameterOrder": [
  5137. // "name"
  5138. // ],
  5139. // "parameters": {
  5140. // "name": {
  5141. // "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5142. // "location": "path",
  5143. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5144. // "required": true,
  5145. // "type": "string"
  5146. // }
  5147. // },
  5148. // "path": "v1/{+name}:setMonitoring",
  5149. // "request": {
  5150. // "$ref": "SetMonitoringServiceRequest"
  5151. // },
  5152. // "response": {
  5153. // "$ref": "Operation"
  5154. // },
  5155. // "scopes": [
  5156. // "https://www.googleapis.com/auth/cloud-platform"
  5157. // ]
  5158. // }
  5159. }
  5160. // method id "container.projects.locations.clusters.setNetworkPolicy":
  5161. type ProjectsLocationsClustersSetNetworkPolicyCall struct {
  5162. s *Service
  5163. name string
  5164. setnetworkpolicyrequest *SetNetworkPolicyRequest
  5165. urlParams_ gensupport.URLParams
  5166. ctx_ context.Context
  5167. header_ http.Header
  5168. }
  5169. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  5170. func (r *ProjectsLocationsClustersService) SetNetworkPolicy(name string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5171. c := &ProjectsLocationsClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5172. c.name = name
  5173. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  5174. return c
  5175. }
  5176. // Fields allows partial responses to be retrieved. See
  5177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5178. // for more information.
  5179. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5181. return c
  5182. }
  5183. // Context sets the context to be used in this call's Do method. Any
  5184. // pending HTTP request will be aborted if the provided context is
  5185. // canceled.
  5186. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetNetworkPolicyCall {
  5187. c.ctx_ = ctx
  5188. return c
  5189. }
  5190. // Header returns an http.Header that can be modified by the caller to
  5191. // add HTTP headers to the request.
  5192. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header {
  5193. if c.header_ == nil {
  5194. c.header_ = make(http.Header)
  5195. }
  5196. return c.header_
  5197. }
  5198. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  5199. reqHeaders := make(http.Header)
  5200. for k, v := range c.header_ {
  5201. reqHeaders[k] = v
  5202. }
  5203. reqHeaders.Set("User-Agent", c.s.userAgent())
  5204. var body io.Reader = nil
  5205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  5206. if err != nil {
  5207. return nil, err
  5208. }
  5209. reqHeaders.Set("Content-Type", "application/json")
  5210. c.urlParams_.Set("alt", alt)
  5211. c.urlParams_.Set("prettyPrint", "false")
  5212. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setNetworkPolicy")
  5213. urls += "?" + c.urlParams_.Encode()
  5214. req, err := http.NewRequest("POST", urls, body)
  5215. if err != nil {
  5216. return nil, err
  5217. }
  5218. req.Header = reqHeaders
  5219. googleapi.Expand(req.URL, map[string]string{
  5220. "name": c.name,
  5221. })
  5222. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5223. }
  5224. // Do executes the "container.projects.locations.clusters.setNetworkPolicy" call.
  5225. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5226. // status code is an error. Response headers are in either
  5227. // *Operation.ServerResponse.Header or (if a response was returned at
  5228. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5229. // to check whether the returned error was because
  5230. // http.StatusNotModified was returned.
  5231. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5232. gensupport.SetOptions(c.urlParams_, opts...)
  5233. res, err := c.doRequest("json")
  5234. if res != nil && res.StatusCode == http.StatusNotModified {
  5235. if res.Body != nil {
  5236. res.Body.Close()
  5237. }
  5238. return nil, &googleapi.Error{
  5239. Code: res.StatusCode,
  5240. Header: res.Header,
  5241. }
  5242. }
  5243. if err != nil {
  5244. return nil, err
  5245. }
  5246. defer googleapi.CloseBody(res)
  5247. if err := googleapi.CheckResponse(res); err != nil {
  5248. return nil, err
  5249. }
  5250. ret := &Operation{
  5251. ServerResponse: googleapi.ServerResponse{
  5252. Header: res.Header,
  5253. HTTPStatusCode: res.StatusCode,
  5254. },
  5255. }
  5256. target := &ret
  5257. if err := gensupport.DecodeResponse(target, res); err != nil {
  5258. return nil, err
  5259. }
  5260. return ret, nil
  5261. // {
  5262. // "description": "Enables/Disables Network Policy for a cluster.",
  5263. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
  5264. // "httpMethod": "POST",
  5265. // "id": "container.projects.locations.clusters.setNetworkPolicy",
  5266. // "parameterOrder": [
  5267. // "name"
  5268. // ],
  5269. // "parameters": {
  5270. // "name": {
  5271. // "description": "The name (project, location, cluster id) of the cluster to set networking\npolicy. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5272. // "location": "path",
  5273. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5274. // "required": true,
  5275. // "type": "string"
  5276. // }
  5277. // },
  5278. // "path": "v1/{+name}:setNetworkPolicy",
  5279. // "request": {
  5280. // "$ref": "SetNetworkPolicyRequest"
  5281. // },
  5282. // "response": {
  5283. // "$ref": "Operation"
  5284. // },
  5285. // "scopes": [
  5286. // "https://www.googleapis.com/auth/cloud-platform"
  5287. // ]
  5288. // }
  5289. }
  5290. // method id "container.projects.locations.clusters.setResourceLabels":
  5291. type ProjectsLocationsClustersSetResourceLabelsCall struct {
  5292. s *Service
  5293. name string
  5294. setlabelsrequest *SetLabelsRequest
  5295. urlParams_ gensupport.URLParams
  5296. ctx_ context.Context
  5297. header_ http.Header
  5298. }
  5299. // SetResourceLabels: Sets labels on a cluster.
  5300. func (r *ProjectsLocationsClustersService) SetResourceLabels(name string, setlabelsrequest *SetLabelsRequest) *ProjectsLocationsClustersSetResourceLabelsCall {
  5301. c := &ProjectsLocationsClustersSetResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5302. c.name = name
  5303. c.setlabelsrequest = setlabelsrequest
  5304. return c
  5305. }
  5306. // Fields allows partial responses to be retrieved. See
  5307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5308. // for more information.
  5309. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetResourceLabelsCall {
  5310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5311. return c
  5312. }
  5313. // Context sets the context to be used in this call's Do method. Any
  5314. // pending HTTP request will be aborted if the provided context is
  5315. // canceled.
  5316. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetResourceLabelsCall {
  5317. c.ctx_ = ctx
  5318. return c
  5319. }
  5320. // Header returns an http.Header that can be modified by the caller to
  5321. // add HTTP headers to the request.
  5322. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header {
  5323. if c.header_ == nil {
  5324. c.header_ = make(http.Header)
  5325. }
  5326. return c.header_
  5327. }
  5328. func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  5329. reqHeaders := make(http.Header)
  5330. for k, v := range c.header_ {
  5331. reqHeaders[k] = v
  5332. }
  5333. reqHeaders.Set("User-Agent", c.s.userAgent())
  5334. var body io.Reader = nil
  5335. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  5336. if err != nil {
  5337. return nil, err
  5338. }
  5339. reqHeaders.Set("Content-Type", "application/json")
  5340. c.urlParams_.Set("alt", alt)
  5341. c.urlParams_.Set("prettyPrint", "false")
  5342. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setResourceLabels")
  5343. urls += "?" + c.urlParams_.Encode()
  5344. req, err := http.NewRequest("POST", urls, body)
  5345. if err != nil {
  5346. return nil, err
  5347. }
  5348. req.Header = reqHeaders
  5349. googleapi.Expand(req.URL, map[string]string{
  5350. "name": c.name,
  5351. })
  5352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5353. }
  5354. // Do executes the "container.projects.locations.clusters.setResourceLabels" call.
  5355. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5356. // status code is an error. Response headers are in either
  5357. // *Operation.ServerResponse.Header or (if a response was returned at
  5358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5359. // to check whether the returned error was because
  5360. // http.StatusNotModified was returned.
  5361. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5362. gensupport.SetOptions(c.urlParams_, opts...)
  5363. res, err := c.doRequest("json")
  5364. if res != nil && res.StatusCode == http.StatusNotModified {
  5365. if res.Body != nil {
  5366. res.Body.Close()
  5367. }
  5368. return nil, &googleapi.Error{
  5369. Code: res.StatusCode,
  5370. Header: res.Header,
  5371. }
  5372. }
  5373. if err != nil {
  5374. return nil, err
  5375. }
  5376. defer googleapi.CloseBody(res)
  5377. if err := googleapi.CheckResponse(res); err != nil {
  5378. return nil, err
  5379. }
  5380. ret := &Operation{
  5381. ServerResponse: googleapi.ServerResponse{
  5382. Header: res.Header,
  5383. HTTPStatusCode: res.StatusCode,
  5384. },
  5385. }
  5386. target := &ret
  5387. if err := gensupport.DecodeResponse(target, res); err != nil {
  5388. return nil, err
  5389. }
  5390. return ret, nil
  5391. // {
  5392. // "description": "Sets labels on a cluster.",
  5393. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels",
  5394. // "httpMethod": "POST",
  5395. // "id": "container.projects.locations.clusters.setResourceLabels",
  5396. // "parameterOrder": [
  5397. // "name"
  5398. // ],
  5399. // "parameters": {
  5400. // "name": {
  5401. // "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5402. // "location": "path",
  5403. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5404. // "required": true,
  5405. // "type": "string"
  5406. // }
  5407. // },
  5408. // "path": "v1/{+name}:setResourceLabels",
  5409. // "request": {
  5410. // "$ref": "SetLabelsRequest"
  5411. // },
  5412. // "response": {
  5413. // "$ref": "Operation"
  5414. // },
  5415. // "scopes": [
  5416. // "https://www.googleapis.com/auth/cloud-platform"
  5417. // ]
  5418. // }
  5419. }
  5420. // method id "container.projects.locations.clusters.startIpRotation":
  5421. type ProjectsLocationsClustersStartIpRotationCall struct {
  5422. s *Service
  5423. name string
  5424. startiprotationrequest *StartIPRotationRequest
  5425. urlParams_ gensupport.URLParams
  5426. ctx_ context.Context
  5427. header_ http.Header
  5428. }
  5429. // StartIpRotation: Start master IP rotation.
  5430. func (r *ProjectsLocationsClustersService) StartIpRotation(name string, startiprotationrequest *StartIPRotationRequest) *ProjectsLocationsClustersStartIpRotationCall {
  5431. c := &ProjectsLocationsClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5432. c.name = name
  5433. c.startiprotationrequest = startiprotationrequest
  5434. return c
  5435. }
  5436. // Fields allows partial responses to be retrieved. See
  5437. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5438. // for more information.
  5439. func (c *ProjectsLocationsClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersStartIpRotationCall {
  5440. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5441. return c
  5442. }
  5443. // Context sets the context to be used in this call's Do method. Any
  5444. // pending HTTP request will be aborted if the provided context is
  5445. // canceled.
  5446. func (c *ProjectsLocationsClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersStartIpRotationCall {
  5447. c.ctx_ = ctx
  5448. return c
  5449. }
  5450. // Header returns an http.Header that can be modified by the caller to
  5451. // add HTTP headers to the request.
  5452. func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header {
  5453. if c.header_ == nil {
  5454. c.header_ = make(http.Header)
  5455. }
  5456. return c.header_
  5457. }
  5458. func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  5459. reqHeaders := make(http.Header)
  5460. for k, v := range c.header_ {
  5461. reqHeaders[k] = v
  5462. }
  5463. reqHeaders.Set("User-Agent", c.s.userAgent())
  5464. var body io.Reader = nil
  5465. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  5466. if err != nil {
  5467. return nil, err
  5468. }
  5469. reqHeaders.Set("Content-Type", "application/json")
  5470. c.urlParams_.Set("alt", alt)
  5471. c.urlParams_.Set("prettyPrint", "false")
  5472. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:startIpRotation")
  5473. urls += "?" + c.urlParams_.Encode()
  5474. req, err := http.NewRequest("POST", urls, body)
  5475. if err != nil {
  5476. return nil, err
  5477. }
  5478. req.Header = reqHeaders
  5479. googleapi.Expand(req.URL, map[string]string{
  5480. "name": c.name,
  5481. })
  5482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5483. }
  5484. // Do executes the "container.projects.locations.clusters.startIpRotation" call.
  5485. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5486. // status code is an error. Response headers are in either
  5487. // *Operation.ServerResponse.Header or (if a response was returned at
  5488. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5489. // to check whether the returned error was because
  5490. // http.StatusNotModified was returned.
  5491. func (c *ProjectsLocationsClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5492. gensupport.SetOptions(c.urlParams_, opts...)
  5493. res, err := c.doRequest("json")
  5494. if res != nil && res.StatusCode == http.StatusNotModified {
  5495. if res.Body != nil {
  5496. res.Body.Close()
  5497. }
  5498. return nil, &googleapi.Error{
  5499. Code: res.StatusCode,
  5500. Header: res.Header,
  5501. }
  5502. }
  5503. if err != nil {
  5504. return nil, err
  5505. }
  5506. defer googleapi.CloseBody(res)
  5507. if err := googleapi.CheckResponse(res); err != nil {
  5508. return nil, err
  5509. }
  5510. ret := &Operation{
  5511. ServerResponse: googleapi.ServerResponse{
  5512. Header: res.Header,
  5513. HTTPStatusCode: res.StatusCode,
  5514. },
  5515. }
  5516. target := &ret
  5517. if err := gensupport.DecodeResponse(target, res); err != nil {
  5518. return nil, err
  5519. }
  5520. return ret, nil
  5521. // {
  5522. // "description": "Start master IP rotation.",
  5523. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
  5524. // "httpMethod": "POST",
  5525. // "id": "container.projects.locations.clusters.startIpRotation",
  5526. // "parameterOrder": [
  5527. // "name"
  5528. // ],
  5529. // "parameters": {
  5530. // "name": {
  5531. // "description": "The name (project, location, cluster id) of the cluster to start IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5532. // "location": "path",
  5533. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5534. // "required": true,
  5535. // "type": "string"
  5536. // }
  5537. // },
  5538. // "path": "v1/{+name}:startIpRotation",
  5539. // "request": {
  5540. // "$ref": "StartIPRotationRequest"
  5541. // },
  5542. // "response": {
  5543. // "$ref": "Operation"
  5544. // },
  5545. // "scopes": [
  5546. // "https://www.googleapis.com/auth/cloud-platform"
  5547. // ]
  5548. // }
  5549. }
  5550. // method id "container.projects.locations.clusters.update":
  5551. type ProjectsLocationsClustersUpdateCall struct {
  5552. s *Service
  5553. name string
  5554. updateclusterrequest *UpdateClusterRequest
  5555. urlParams_ gensupport.URLParams
  5556. ctx_ context.Context
  5557. header_ http.Header
  5558. }
  5559. // Update: Updates the settings of a specific cluster.
  5560. func (r *ProjectsLocationsClustersService) Update(name string, updateclusterrequest *UpdateClusterRequest) *ProjectsLocationsClustersUpdateCall {
  5561. c := &ProjectsLocationsClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5562. c.name = name
  5563. c.updateclusterrequest = updateclusterrequest
  5564. return c
  5565. }
  5566. // Fields allows partial responses to be retrieved. See
  5567. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5568. // for more information.
  5569. func (c *ProjectsLocationsClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateCall {
  5570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5571. return c
  5572. }
  5573. // Context sets the context to be used in this call's Do method. Any
  5574. // pending HTTP request will be aborted if the provided context is
  5575. // canceled.
  5576. func (c *ProjectsLocationsClustersUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateCall {
  5577. c.ctx_ = ctx
  5578. return c
  5579. }
  5580. // Header returns an http.Header that can be modified by the caller to
  5581. // add HTTP headers to the request.
  5582. func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header {
  5583. if c.header_ == nil {
  5584. c.header_ = make(http.Header)
  5585. }
  5586. return c.header_
  5587. }
  5588. func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  5589. reqHeaders := make(http.Header)
  5590. for k, v := range c.header_ {
  5591. reqHeaders[k] = v
  5592. }
  5593. reqHeaders.Set("User-Agent", c.s.userAgent())
  5594. var body io.Reader = nil
  5595. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  5596. if err != nil {
  5597. return nil, err
  5598. }
  5599. reqHeaders.Set("Content-Type", "application/json")
  5600. c.urlParams_.Set("alt", alt)
  5601. c.urlParams_.Set("prettyPrint", "false")
  5602. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5603. urls += "?" + c.urlParams_.Encode()
  5604. req, err := http.NewRequest("PUT", urls, body)
  5605. if err != nil {
  5606. return nil, err
  5607. }
  5608. req.Header = reqHeaders
  5609. googleapi.Expand(req.URL, map[string]string{
  5610. "name": c.name,
  5611. })
  5612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5613. }
  5614. // Do executes the "container.projects.locations.clusters.update" call.
  5615. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5616. // status code is an error. Response headers are in either
  5617. // *Operation.ServerResponse.Header or (if a response was returned at
  5618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5619. // to check whether the returned error was because
  5620. // http.StatusNotModified was returned.
  5621. func (c *ProjectsLocationsClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5622. gensupport.SetOptions(c.urlParams_, opts...)
  5623. res, err := c.doRequest("json")
  5624. if res != nil && res.StatusCode == http.StatusNotModified {
  5625. if res.Body != nil {
  5626. res.Body.Close()
  5627. }
  5628. return nil, &googleapi.Error{
  5629. Code: res.StatusCode,
  5630. Header: res.Header,
  5631. }
  5632. }
  5633. if err != nil {
  5634. return nil, err
  5635. }
  5636. defer googleapi.CloseBody(res)
  5637. if err := googleapi.CheckResponse(res); err != nil {
  5638. return nil, err
  5639. }
  5640. ret := &Operation{
  5641. ServerResponse: googleapi.ServerResponse{
  5642. Header: res.Header,
  5643. HTTPStatusCode: res.StatusCode,
  5644. },
  5645. }
  5646. target := &ret
  5647. if err := gensupport.DecodeResponse(target, res); err != nil {
  5648. return nil, err
  5649. }
  5650. return ret, nil
  5651. // {
  5652. // "description": "Updates the settings of a specific cluster.",
  5653. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  5654. // "httpMethod": "PUT",
  5655. // "id": "container.projects.locations.clusters.update",
  5656. // "parameterOrder": [
  5657. // "name"
  5658. // ],
  5659. // "parameters": {
  5660. // "name": {
  5661. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5662. // "location": "path",
  5663. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5664. // "required": true,
  5665. // "type": "string"
  5666. // }
  5667. // },
  5668. // "path": "v1/{+name}",
  5669. // "request": {
  5670. // "$ref": "UpdateClusterRequest"
  5671. // },
  5672. // "response": {
  5673. // "$ref": "Operation"
  5674. // },
  5675. // "scopes": [
  5676. // "https://www.googleapis.com/auth/cloud-platform"
  5677. // ]
  5678. // }
  5679. }
  5680. // method id "container.projects.locations.clusters.updateMaster":
  5681. type ProjectsLocationsClustersUpdateMasterCall struct {
  5682. s *Service
  5683. name string
  5684. updatemasterrequest *UpdateMasterRequest
  5685. urlParams_ gensupport.URLParams
  5686. ctx_ context.Context
  5687. header_ http.Header
  5688. }
  5689. // UpdateMaster: Updates the master for a specific cluster.
  5690. func (r *ProjectsLocationsClustersService) UpdateMaster(name string, updatemasterrequest *UpdateMasterRequest) *ProjectsLocationsClustersUpdateMasterCall {
  5691. c := &ProjectsLocationsClustersUpdateMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5692. c.name = name
  5693. c.updatemasterrequest = updatemasterrequest
  5694. return c
  5695. }
  5696. // Fields allows partial responses to be retrieved. See
  5697. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5698. // for more information.
  5699. func (c *ProjectsLocationsClustersUpdateMasterCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateMasterCall {
  5700. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5701. return c
  5702. }
  5703. // Context sets the context to be used in this call's Do method. Any
  5704. // pending HTTP request will be aborted if the provided context is
  5705. // canceled.
  5706. func (c *ProjectsLocationsClustersUpdateMasterCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateMasterCall {
  5707. c.ctx_ = ctx
  5708. return c
  5709. }
  5710. // Header returns an http.Header that can be modified by the caller to
  5711. // add HTTP headers to the request.
  5712. func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header {
  5713. if c.header_ == nil {
  5714. c.header_ = make(http.Header)
  5715. }
  5716. return c.header_
  5717. }
  5718. func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) {
  5719. reqHeaders := make(http.Header)
  5720. for k, v := range c.header_ {
  5721. reqHeaders[k] = v
  5722. }
  5723. reqHeaders.Set("User-Agent", c.s.userAgent())
  5724. var body io.Reader = nil
  5725. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  5726. if err != nil {
  5727. return nil, err
  5728. }
  5729. reqHeaders.Set("Content-Type", "application/json")
  5730. c.urlParams_.Set("alt", alt)
  5731. c.urlParams_.Set("prettyPrint", "false")
  5732. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:updateMaster")
  5733. urls += "?" + c.urlParams_.Encode()
  5734. req, err := http.NewRequest("POST", urls, body)
  5735. if err != nil {
  5736. return nil, err
  5737. }
  5738. req.Header = reqHeaders
  5739. googleapi.Expand(req.URL, map[string]string{
  5740. "name": c.name,
  5741. })
  5742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5743. }
  5744. // Do executes the "container.projects.locations.clusters.updateMaster" call.
  5745. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5746. // status code is an error. Response headers are in either
  5747. // *Operation.ServerResponse.Header or (if a response was returned at
  5748. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5749. // to check whether the returned error was because
  5750. // http.StatusNotModified was returned.
  5751. func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5752. gensupport.SetOptions(c.urlParams_, opts...)
  5753. res, err := c.doRequest("json")
  5754. if res != nil && res.StatusCode == http.StatusNotModified {
  5755. if res.Body != nil {
  5756. res.Body.Close()
  5757. }
  5758. return nil, &googleapi.Error{
  5759. Code: res.StatusCode,
  5760. Header: res.Header,
  5761. }
  5762. }
  5763. if err != nil {
  5764. return nil, err
  5765. }
  5766. defer googleapi.CloseBody(res)
  5767. if err := googleapi.CheckResponse(res); err != nil {
  5768. return nil, err
  5769. }
  5770. ret := &Operation{
  5771. ServerResponse: googleapi.ServerResponse{
  5772. Header: res.Header,
  5773. HTTPStatusCode: res.StatusCode,
  5774. },
  5775. }
  5776. target := &ret
  5777. if err := gensupport.DecodeResponse(target, res); err != nil {
  5778. return nil, err
  5779. }
  5780. return ret, nil
  5781. // {
  5782. // "description": "Updates the master for a specific cluster.",
  5783. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster",
  5784. // "httpMethod": "POST",
  5785. // "id": "container.projects.locations.clusters.updateMaster",
  5786. // "parameterOrder": [
  5787. // "name"
  5788. // ],
  5789. // "parameters": {
  5790. // "name": {
  5791. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5792. // "location": "path",
  5793. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5794. // "required": true,
  5795. // "type": "string"
  5796. // }
  5797. // },
  5798. // "path": "v1/{+name}:updateMaster",
  5799. // "request": {
  5800. // "$ref": "UpdateMasterRequest"
  5801. // },
  5802. // "response": {
  5803. // "$ref": "Operation"
  5804. // },
  5805. // "scopes": [
  5806. // "https://www.googleapis.com/auth/cloud-platform"
  5807. // ]
  5808. // }
  5809. }
  5810. // method id "container.projects.locations.clusters.nodePools.create":
  5811. type ProjectsLocationsClustersNodePoolsCreateCall struct {
  5812. s *Service
  5813. parent string
  5814. createnodepoolrequest *CreateNodePoolRequest
  5815. urlParams_ gensupport.URLParams
  5816. ctx_ context.Context
  5817. header_ http.Header
  5818. }
  5819. // Create: Creates a node pool for a cluster.
  5820. func (r *ProjectsLocationsClustersNodePoolsService) Create(parent string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsLocationsClustersNodePoolsCreateCall {
  5821. c := &ProjectsLocationsClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5822. c.parent = parent
  5823. c.createnodepoolrequest = createnodepoolrequest
  5824. return c
  5825. }
  5826. // Fields allows partial responses to be retrieved. See
  5827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5828. // for more information.
  5829. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCreateCall {
  5830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5831. return c
  5832. }
  5833. // Context sets the context to be used in this call's Do method. Any
  5834. // pending HTTP request will be aborted if the provided context is
  5835. // canceled.
  5836. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCreateCall {
  5837. c.ctx_ = ctx
  5838. return c
  5839. }
  5840. // Header returns an http.Header that can be modified by the caller to
  5841. // add HTTP headers to the request.
  5842. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header {
  5843. if c.header_ == nil {
  5844. c.header_ = make(http.Header)
  5845. }
  5846. return c.header_
  5847. }
  5848. func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  5849. reqHeaders := make(http.Header)
  5850. for k, v := range c.header_ {
  5851. reqHeaders[k] = v
  5852. }
  5853. reqHeaders.Set("User-Agent", c.s.userAgent())
  5854. var body io.Reader = nil
  5855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  5856. if err != nil {
  5857. return nil, err
  5858. }
  5859. reqHeaders.Set("Content-Type", "application/json")
  5860. c.urlParams_.Set("alt", alt)
  5861. c.urlParams_.Set("prettyPrint", "false")
  5862. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  5863. urls += "?" + c.urlParams_.Encode()
  5864. req, err := http.NewRequest("POST", urls, body)
  5865. if err != nil {
  5866. return nil, err
  5867. }
  5868. req.Header = reqHeaders
  5869. googleapi.Expand(req.URL, map[string]string{
  5870. "parent": c.parent,
  5871. })
  5872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5873. }
  5874. // Do executes the "container.projects.locations.clusters.nodePools.create" call.
  5875. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5876. // status code is an error. Response headers are in either
  5877. // *Operation.ServerResponse.Header or (if a response was returned at
  5878. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5879. // to check whether the returned error was because
  5880. // http.StatusNotModified was returned.
  5881. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5882. gensupport.SetOptions(c.urlParams_, opts...)
  5883. res, err := c.doRequest("json")
  5884. if res != nil && res.StatusCode == http.StatusNotModified {
  5885. if res.Body != nil {
  5886. res.Body.Close()
  5887. }
  5888. return nil, &googleapi.Error{
  5889. Code: res.StatusCode,
  5890. Header: res.Header,
  5891. }
  5892. }
  5893. if err != nil {
  5894. return nil, err
  5895. }
  5896. defer googleapi.CloseBody(res)
  5897. if err := googleapi.CheckResponse(res); err != nil {
  5898. return nil, err
  5899. }
  5900. ret := &Operation{
  5901. ServerResponse: googleapi.ServerResponse{
  5902. Header: res.Header,
  5903. HTTPStatusCode: res.StatusCode,
  5904. },
  5905. }
  5906. target := &ret
  5907. if err := gensupport.DecodeResponse(target, res); err != nil {
  5908. return nil, err
  5909. }
  5910. return ret, nil
  5911. // {
  5912. // "description": "Creates a node pool for a cluster.",
  5913. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  5914. // "httpMethod": "POST",
  5915. // "id": "container.projects.locations.clusters.nodePools.create",
  5916. // "parameterOrder": [
  5917. // "parent"
  5918. // ],
  5919. // "parameters": {
  5920. // "parent": {
  5921. // "description": "The parent (project, location, cluster id) where the node pool will be\ncreated. Specified in the format\n'projects/*/locations/*/clusters/*'.",
  5922. // "location": "path",
  5923. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5924. // "required": true,
  5925. // "type": "string"
  5926. // }
  5927. // },
  5928. // "path": "v1/{+parent}/nodePools",
  5929. // "request": {
  5930. // "$ref": "CreateNodePoolRequest"
  5931. // },
  5932. // "response": {
  5933. // "$ref": "Operation"
  5934. // },
  5935. // "scopes": [
  5936. // "https://www.googleapis.com/auth/cloud-platform"
  5937. // ]
  5938. // }
  5939. }
  5940. // method id "container.projects.locations.clusters.nodePools.delete":
  5941. type ProjectsLocationsClustersNodePoolsDeleteCall struct {
  5942. s *Service
  5943. name string
  5944. urlParams_ gensupport.URLParams
  5945. ctx_ context.Context
  5946. header_ http.Header
  5947. }
  5948. // Delete: Deletes a node pool from a cluster.
  5949. func (r *ProjectsLocationsClustersNodePoolsService) Delete(name string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5950. c := &ProjectsLocationsClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5951. c.name = name
  5952. return c
  5953. }
  5954. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  5955. // name of the cluster.
  5956. // This field has been deprecated and replaced by the name field.
  5957. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5958. c.urlParams_.Set("clusterId", clusterId)
  5959. return c
  5960. }
  5961. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  5962. // name of the node pool to delete.
  5963. // This field has been deprecated and replaced by the name field.
  5964. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5965. c.urlParams_.Set("nodePoolId", nodePoolId)
  5966. return c
  5967. }
  5968. // ProjectId sets the optional parameter "projectId": Deprecated. The
  5969. // Google Developers Console [project ID or
  5970. // project
  5971. // number](https://developers.google.com/console/help/new/#projec
  5972. // tnumber).
  5973. // This field has been deprecated and replaced by the name field.
  5974. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5975. c.urlParams_.Set("projectId", projectId)
  5976. return c
  5977. }
  5978. // Zone sets the optional parameter "zone": Deprecated. The name of the
  5979. // Google Compute Engine
  5980. // [zone](/compute/docs/zones#available) in which the
  5981. // cluster
  5982. // resides.
  5983. // This field has been deprecated and replaced by the name field.
  5984. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5985. c.urlParams_.Set("zone", zone)
  5986. return c
  5987. }
  5988. // Fields allows partial responses to be retrieved. See
  5989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5990. // for more information.
  5991. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5993. return c
  5994. }
  5995. // Context sets the context to be used in this call's Do method. Any
  5996. // pending HTTP request will be aborted if the provided context is
  5997. // canceled.
  5998. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5999. c.ctx_ = ctx
  6000. return c
  6001. }
  6002. // Header returns an http.Header that can be modified by the caller to
  6003. // add HTTP headers to the request.
  6004. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header {
  6005. if c.header_ == nil {
  6006. c.header_ = make(http.Header)
  6007. }
  6008. return c.header_
  6009. }
  6010. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6011. reqHeaders := make(http.Header)
  6012. for k, v := range c.header_ {
  6013. reqHeaders[k] = v
  6014. }
  6015. reqHeaders.Set("User-Agent", c.s.userAgent())
  6016. var body io.Reader = nil
  6017. c.urlParams_.Set("alt", alt)
  6018. c.urlParams_.Set("prettyPrint", "false")
  6019. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6020. urls += "?" + c.urlParams_.Encode()
  6021. req, err := http.NewRequest("DELETE", urls, body)
  6022. if err != nil {
  6023. return nil, err
  6024. }
  6025. req.Header = reqHeaders
  6026. googleapi.Expand(req.URL, map[string]string{
  6027. "name": c.name,
  6028. })
  6029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6030. }
  6031. // Do executes the "container.projects.locations.clusters.nodePools.delete" call.
  6032. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6033. // status code is an error. Response headers are in either
  6034. // *Operation.ServerResponse.Header or (if a response was returned at
  6035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6036. // to check whether the returned error was because
  6037. // http.StatusNotModified was returned.
  6038. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6039. gensupport.SetOptions(c.urlParams_, opts...)
  6040. res, err := c.doRequest("json")
  6041. if res != nil && res.StatusCode == http.StatusNotModified {
  6042. if res.Body != nil {
  6043. res.Body.Close()
  6044. }
  6045. return nil, &googleapi.Error{
  6046. Code: res.StatusCode,
  6047. Header: res.Header,
  6048. }
  6049. }
  6050. if err != nil {
  6051. return nil, err
  6052. }
  6053. defer googleapi.CloseBody(res)
  6054. if err := googleapi.CheckResponse(res); err != nil {
  6055. return nil, err
  6056. }
  6057. ret := &Operation{
  6058. ServerResponse: googleapi.ServerResponse{
  6059. Header: res.Header,
  6060. HTTPStatusCode: res.StatusCode,
  6061. },
  6062. }
  6063. target := &ret
  6064. if err := gensupport.DecodeResponse(target, res); err != nil {
  6065. return nil, err
  6066. }
  6067. return ret, nil
  6068. // {
  6069. // "description": "Deletes a node pool from a cluster.",
  6070. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6071. // "httpMethod": "DELETE",
  6072. // "id": "container.projects.locations.clusters.nodePools.delete",
  6073. // "parameterOrder": [
  6074. // "name"
  6075. // ],
  6076. // "parameters": {
  6077. // "clusterId": {
  6078. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6079. // "location": "query",
  6080. // "type": "string"
  6081. // },
  6082. // "name": {
  6083. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6084. // "location": "path",
  6085. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6086. // "required": true,
  6087. // "type": "string"
  6088. // },
  6089. // "nodePoolId": {
  6090. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  6091. // "location": "query",
  6092. // "type": "string"
  6093. // },
  6094. // "projectId": {
  6095. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  6096. // "location": "query",
  6097. // "type": "string"
  6098. // },
  6099. // "zone": {
  6100. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  6101. // "location": "query",
  6102. // "type": "string"
  6103. // }
  6104. // },
  6105. // "path": "v1/{+name}",
  6106. // "response": {
  6107. // "$ref": "Operation"
  6108. // },
  6109. // "scopes": [
  6110. // "https://www.googleapis.com/auth/cloud-platform"
  6111. // ]
  6112. // }
  6113. }
  6114. // method id "container.projects.locations.clusters.nodePools.get":
  6115. type ProjectsLocationsClustersNodePoolsGetCall struct {
  6116. s *Service
  6117. name string
  6118. urlParams_ gensupport.URLParams
  6119. ifNoneMatch_ string
  6120. ctx_ context.Context
  6121. header_ http.Header
  6122. }
  6123. // Get: Retrieves the node pool requested.
  6124. func (r *ProjectsLocationsClustersNodePoolsService) Get(name string) *ProjectsLocationsClustersNodePoolsGetCall {
  6125. c := &ProjectsLocationsClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6126. c.name = name
  6127. return c
  6128. }
  6129. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6130. // name of the cluster.
  6131. // This field has been deprecated and replaced by the name field.
  6132. func (c *ProjectsLocationsClustersNodePoolsGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6133. c.urlParams_.Set("clusterId", clusterId)
  6134. return c
  6135. }
  6136. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  6137. // name of the node pool.
  6138. // This field has been deprecated and replaced by the name field.
  6139. func (c *ProjectsLocationsClustersNodePoolsGetCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6140. c.urlParams_.Set("nodePoolId", nodePoolId)
  6141. return c
  6142. }
  6143. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6144. // Google Developers Console [project ID or
  6145. // project
  6146. // number](https://developers.google.com/console/help/new/#projec
  6147. // tnumber).
  6148. // This field has been deprecated and replaced by the name field.
  6149. func (c *ProjectsLocationsClustersNodePoolsGetCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsGetCall {
  6150. c.urlParams_.Set("projectId", projectId)
  6151. return c
  6152. }
  6153. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6154. // Google Compute Engine
  6155. // [zone](/compute/docs/zones#available) in which the
  6156. // cluster
  6157. // resides.
  6158. // This field has been deprecated and replaced by the name field.
  6159. func (c *ProjectsLocationsClustersNodePoolsGetCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsGetCall {
  6160. c.urlParams_.Set("zone", zone)
  6161. return c
  6162. }
  6163. // Fields allows partial responses to be retrieved. See
  6164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6165. // for more information.
  6166. func (c *ProjectsLocationsClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsGetCall {
  6167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6168. return c
  6169. }
  6170. // IfNoneMatch sets the optional parameter which makes the operation
  6171. // fail if the object's ETag matches the given value. This is useful for
  6172. // getting updates only after the object has changed since the last
  6173. // request. Use googleapi.IsNotModified to check whether the response
  6174. // error from Do is the result of In-None-Match.
  6175. func (c *ProjectsLocationsClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsGetCall {
  6176. c.ifNoneMatch_ = entityTag
  6177. return c
  6178. }
  6179. // Context sets the context to be used in this call's Do method. Any
  6180. // pending HTTP request will be aborted if the provided context is
  6181. // canceled.
  6182. func (c *ProjectsLocationsClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsGetCall {
  6183. c.ctx_ = ctx
  6184. return c
  6185. }
  6186. // Header returns an http.Header that can be modified by the caller to
  6187. // add HTTP headers to the request.
  6188. func (c *ProjectsLocationsClustersNodePoolsGetCall) Header() http.Header {
  6189. if c.header_ == nil {
  6190. c.header_ = make(http.Header)
  6191. }
  6192. return c.header_
  6193. }
  6194. func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  6195. reqHeaders := make(http.Header)
  6196. for k, v := range c.header_ {
  6197. reqHeaders[k] = v
  6198. }
  6199. reqHeaders.Set("User-Agent", c.s.userAgent())
  6200. if c.ifNoneMatch_ != "" {
  6201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6202. }
  6203. var body io.Reader = nil
  6204. c.urlParams_.Set("alt", alt)
  6205. c.urlParams_.Set("prettyPrint", "false")
  6206. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6207. urls += "?" + c.urlParams_.Encode()
  6208. req, err := http.NewRequest("GET", urls, body)
  6209. if err != nil {
  6210. return nil, err
  6211. }
  6212. req.Header = reqHeaders
  6213. googleapi.Expand(req.URL, map[string]string{
  6214. "name": c.name,
  6215. })
  6216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6217. }
  6218. // Do executes the "container.projects.locations.clusters.nodePools.get" call.
  6219. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  6220. // code is an error. Response headers are in either
  6221. // *NodePool.ServerResponse.Header or (if a response was returned at
  6222. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6223. // to check whether the returned error was because
  6224. // http.StatusNotModified was returned.
  6225. func (c *ProjectsLocationsClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  6226. gensupport.SetOptions(c.urlParams_, opts...)
  6227. res, err := c.doRequest("json")
  6228. if res != nil && res.StatusCode == http.StatusNotModified {
  6229. if res.Body != nil {
  6230. res.Body.Close()
  6231. }
  6232. return nil, &googleapi.Error{
  6233. Code: res.StatusCode,
  6234. Header: res.Header,
  6235. }
  6236. }
  6237. if err != nil {
  6238. return nil, err
  6239. }
  6240. defer googleapi.CloseBody(res)
  6241. if err := googleapi.CheckResponse(res); err != nil {
  6242. return nil, err
  6243. }
  6244. ret := &NodePool{
  6245. ServerResponse: googleapi.ServerResponse{
  6246. Header: res.Header,
  6247. HTTPStatusCode: res.StatusCode,
  6248. },
  6249. }
  6250. target := &ret
  6251. if err := gensupport.DecodeResponse(target, res); err != nil {
  6252. return nil, err
  6253. }
  6254. return ret, nil
  6255. // {
  6256. // "description": "Retrieves the node pool requested.",
  6257. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6258. // "httpMethod": "GET",
  6259. // "id": "container.projects.locations.clusters.nodePools.get",
  6260. // "parameterOrder": [
  6261. // "name"
  6262. // ],
  6263. // "parameters": {
  6264. // "clusterId": {
  6265. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  6266. // "location": "query",
  6267. // "type": "string"
  6268. // },
  6269. // "name": {
  6270. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6271. // "location": "path",
  6272. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6273. // "required": true,
  6274. // "type": "string"
  6275. // },
  6276. // "nodePoolId": {
  6277. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  6278. // "location": "query",
  6279. // "type": "string"
  6280. // },
  6281. // "projectId": {
  6282. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  6283. // "location": "query",
  6284. // "type": "string"
  6285. // },
  6286. // "zone": {
  6287. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  6288. // "location": "query",
  6289. // "type": "string"
  6290. // }
  6291. // },
  6292. // "path": "v1/{+name}",
  6293. // "response": {
  6294. // "$ref": "NodePool"
  6295. // },
  6296. // "scopes": [
  6297. // "https://www.googleapis.com/auth/cloud-platform"
  6298. // ]
  6299. // }
  6300. }
  6301. // method id "container.projects.locations.clusters.nodePools.list":
  6302. type ProjectsLocationsClustersNodePoolsListCall struct {
  6303. s *Service
  6304. parent string
  6305. urlParams_ gensupport.URLParams
  6306. ifNoneMatch_ string
  6307. ctx_ context.Context
  6308. header_ http.Header
  6309. }
  6310. // List: Lists the node pools for a cluster.
  6311. func (r *ProjectsLocationsClustersNodePoolsService) List(parent string) *ProjectsLocationsClustersNodePoolsListCall {
  6312. c := &ProjectsLocationsClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6313. c.parent = parent
  6314. return c
  6315. }
  6316. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  6317. // name of the cluster.
  6318. // This field has been deprecated and replaced by the parent field.
  6319. func (c *ProjectsLocationsClustersNodePoolsListCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsListCall {
  6320. c.urlParams_.Set("clusterId", clusterId)
  6321. return c
  6322. }
  6323. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6324. // Google Developers Console [project ID or
  6325. // project
  6326. // number](https://developers.google.com/console/help/new/#projec
  6327. // tnumber).
  6328. // This field has been deprecated and replaced by the parent field.
  6329. func (c *ProjectsLocationsClustersNodePoolsListCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsListCall {
  6330. c.urlParams_.Set("projectId", projectId)
  6331. return c
  6332. }
  6333. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6334. // Google Compute Engine
  6335. // [zone](/compute/docs/zones#available) in which the
  6336. // cluster
  6337. // resides.
  6338. // This field has been deprecated and replaced by the parent field.
  6339. func (c *ProjectsLocationsClustersNodePoolsListCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsListCall {
  6340. c.urlParams_.Set("zone", zone)
  6341. return c
  6342. }
  6343. // Fields allows partial responses to be retrieved. See
  6344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6345. // for more information.
  6346. func (c *ProjectsLocationsClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsListCall {
  6347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6348. return c
  6349. }
  6350. // IfNoneMatch sets the optional parameter which makes the operation
  6351. // fail if the object's ETag matches the given value. This is useful for
  6352. // getting updates only after the object has changed since the last
  6353. // request. Use googleapi.IsNotModified to check whether the response
  6354. // error from Do is the result of In-None-Match.
  6355. func (c *ProjectsLocationsClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsListCall {
  6356. c.ifNoneMatch_ = entityTag
  6357. return c
  6358. }
  6359. // Context sets the context to be used in this call's Do method. Any
  6360. // pending HTTP request will be aborted if the provided context is
  6361. // canceled.
  6362. func (c *ProjectsLocationsClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsListCall {
  6363. c.ctx_ = ctx
  6364. return c
  6365. }
  6366. // Header returns an http.Header that can be modified by the caller to
  6367. // add HTTP headers to the request.
  6368. func (c *ProjectsLocationsClustersNodePoolsListCall) Header() http.Header {
  6369. if c.header_ == nil {
  6370. c.header_ = make(http.Header)
  6371. }
  6372. return c.header_
  6373. }
  6374. func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  6375. reqHeaders := make(http.Header)
  6376. for k, v := range c.header_ {
  6377. reqHeaders[k] = v
  6378. }
  6379. reqHeaders.Set("User-Agent", c.s.userAgent())
  6380. if c.ifNoneMatch_ != "" {
  6381. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6382. }
  6383. var body io.Reader = nil
  6384. c.urlParams_.Set("alt", alt)
  6385. c.urlParams_.Set("prettyPrint", "false")
  6386. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  6387. urls += "?" + c.urlParams_.Encode()
  6388. req, err := http.NewRequest("GET", urls, body)
  6389. if err != nil {
  6390. return nil, err
  6391. }
  6392. req.Header = reqHeaders
  6393. googleapi.Expand(req.URL, map[string]string{
  6394. "parent": c.parent,
  6395. })
  6396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6397. }
  6398. // Do executes the "container.projects.locations.clusters.nodePools.list" call.
  6399. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  6400. // non-2xx status code is an error. Response headers are in either
  6401. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  6402. // returned at all) in error.(*googleapi.Error).Header. Use
  6403. // googleapi.IsNotModified to check whether the returned error was
  6404. // because http.StatusNotModified was returned.
  6405. func (c *ProjectsLocationsClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  6406. gensupport.SetOptions(c.urlParams_, opts...)
  6407. res, err := c.doRequest("json")
  6408. if res != nil && res.StatusCode == http.StatusNotModified {
  6409. if res.Body != nil {
  6410. res.Body.Close()
  6411. }
  6412. return nil, &googleapi.Error{
  6413. Code: res.StatusCode,
  6414. Header: res.Header,
  6415. }
  6416. }
  6417. if err != nil {
  6418. return nil, err
  6419. }
  6420. defer googleapi.CloseBody(res)
  6421. if err := googleapi.CheckResponse(res); err != nil {
  6422. return nil, err
  6423. }
  6424. ret := &ListNodePoolsResponse{
  6425. ServerResponse: googleapi.ServerResponse{
  6426. Header: res.Header,
  6427. HTTPStatusCode: res.StatusCode,
  6428. },
  6429. }
  6430. target := &ret
  6431. if err := gensupport.DecodeResponse(target, res); err != nil {
  6432. return nil, err
  6433. }
  6434. return ret, nil
  6435. // {
  6436. // "description": "Lists the node pools for a cluster.",
  6437. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  6438. // "httpMethod": "GET",
  6439. // "id": "container.projects.locations.clusters.nodePools.list",
  6440. // "parameterOrder": [
  6441. // "parent"
  6442. // ],
  6443. // "parameters": {
  6444. // "clusterId": {
  6445. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  6446. // "location": "query",
  6447. // "type": "string"
  6448. // },
  6449. // "parent": {
  6450. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  6451. // "location": "path",
  6452. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  6453. // "required": true,
  6454. // "type": "string"
  6455. // },
  6456. // "projectId": {
  6457. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  6458. // "location": "query",
  6459. // "type": "string"
  6460. // },
  6461. // "zone": {
  6462. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  6463. // "location": "query",
  6464. // "type": "string"
  6465. // }
  6466. // },
  6467. // "path": "v1/{+parent}/nodePools",
  6468. // "response": {
  6469. // "$ref": "ListNodePoolsResponse"
  6470. // },
  6471. // "scopes": [
  6472. // "https://www.googleapis.com/auth/cloud-platform"
  6473. // ]
  6474. // }
  6475. }
  6476. // method id "container.projects.locations.clusters.nodePools.rollback":
  6477. type ProjectsLocationsClustersNodePoolsRollbackCall struct {
  6478. s *Service
  6479. name string
  6480. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  6481. urlParams_ gensupport.URLParams
  6482. ctx_ context.Context
  6483. header_ http.Header
  6484. }
  6485. // Rollback: Roll back the previously Aborted or Failed NodePool
  6486. // upgrade.
  6487. // This will be an no-op if the last upgrade successfully completed.
  6488. func (r *ProjectsLocationsClustersNodePoolsService) Rollback(name string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6489. c := &ProjectsLocationsClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6490. c.name = name
  6491. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  6492. return c
  6493. }
  6494. // Fields allows partial responses to be retrieved. See
  6495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6496. // for more information.
  6497. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6499. return c
  6500. }
  6501. // Context sets the context to be used in this call's Do method. Any
  6502. // pending HTTP request will be aborted if the provided context is
  6503. // canceled.
  6504. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsRollbackCall {
  6505. c.ctx_ = ctx
  6506. return c
  6507. }
  6508. // Header returns an http.Header that can be modified by the caller to
  6509. // add HTTP headers to the request.
  6510. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header {
  6511. if c.header_ == nil {
  6512. c.header_ = make(http.Header)
  6513. }
  6514. return c.header_
  6515. }
  6516. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  6517. reqHeaders := make(http.Header)
  6518. for k, v := range c.header_ {
  6519. reqHeaders[k] = v
  6520. }
  6521. reqHeaders.Set("User-Agent", c.s.userAgent())
  6522. var body io.Reader = nil
  6523. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  6524. if err != nil {
  6525. return nil, err
  6526. }
  6527. reqHeaders.Set("Content-Type", "application/json")
  6528. c.urlParams_.Set("alt", alt)
  6529. c.urlParams_.Set("prettyPrint", "false")
  6530. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
  6531. urls += "?" + c.urlParams_.Encode()
  6532. req, err := http.NewRequest("POST", urls, body)
  6533. if err != nil {
  6534. return nil, err
  6535. }
  6536. req.Header = reqHeaders
  6537. googleapi.Expand(req.URL, map[string]string{
  6538. "name": c.name,
  6539. })
  6540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6541. }
  6542. // Do executes the "container.projects.locations.clusters.nodePools.rollback" call.
  6543. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6544. // status code is an error. Response headers are in either
  6545. // *Operation.ServerResponse.Header or (if a response was returned at
  6546. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6547. // to check whether the returned error was because
  6548. // http.StatusNotModified was returned.
  6549. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6550. gensupport.SetOptions(c.urlParams_, opts...)
  6551. res, err := c.doRequest("json")
  6552. if res != nil && res.StatusCode == http.StatusNotModified {
  6553. if res.Body != nil {
  6554. res.Body.Close()
  6555. }
  6556. return nil, &googleapi.Error{
  6557. Code: res.StatusCode,
  6558. Header: res.Header,
  6559. }
  6560. }
  6561. if err != nil {
  6562. return nil, err
  6563. }
  6564. defer googleapi.CloseBody(res)
  6565. if err := googleapi.CheckResponse(res); err != nil {
  6566. return nil, err
  6567. }
  6568. ret := &Operation{
  6569. ServerResponse: googleapi.ServerResponse{
  6570. Header: res.Header,
  6571. HTTPStatusCode: res.StatusCode,
  6572. },
  6573. }
  6574. target := &ret
  6575. if err := gensupport.DecodeResponse(target, res); err != nil {
  6576. return nil, err
  6577. }
  6578. return ret, nil
  6579. // {
  6580. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  6581. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
  6582. // "httpMethod": "POST",
  6583. // "id": "container.projects.locations.clusters.nodePools.rollback",
  6584. // "parameterOrder": [
  6585. // "name"
  6586. // ],
  6587. // "parameters": {
  6588. // "name": {
  6589. // "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  6590. // "location": "path",
  6591. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6592. // "required": true,
  6593. // "type": "string"
  6594. // }
  6595. // },
  6596. // "path": "v1/{+name}:rollback",
  6597. // "request": {
  6598. // "$ref": "RollbackNodePoolUpgradeRequest"
  6599. // },
  6600. // "response": {
  6601. // "$ref": "Operation"
  6602. // },
  6603. // "scopes": [
  6604. // "https://www.googleapis.com/auth/cloud-platform"
  6605. // ]
  6606. // }
  6607. }
  6608. // method id "container.projects.locations.clusters.nodePools.setAutoscaling":
  6609. type ProjectsLocationsClustersNodePoolsSetAutoscalingCall struct {
  6610. s *Service
  6611. name string
  6612. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  6613. urlParams_ gensupport.URLParams
  6614. ctx_ context.Context
  6615. header_ http.Header
  6616. }
  6617. // SetAutoscaling: Sets the autoscaling settings for a specific node
  6618. // pool.
  6619. func (r *ProjectsLocationsClustersNodePoolsService) SetAutoscaling(name string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6620. c := &ProjectsLocationsClustersNodePoolsSetAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6621. c.name = name
  6622. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  6623. return c
  6624. }
  6625. // Fields allows partial responses to be retrieved. See
  6626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6627. // for more information.
  6628. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6630. return c
  6631. }
  6632. // Context sets the context to be used in this call's Do method. Any
  6633. // pending HTTP request will be aborted if the provided context is
  6634. // canceled.
  6635. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6636. c.ctx_ = ctx
  6637. return c
  6638. }
  6639. // Header returns an http.Header that can be modified by the caller to
  6640. // add HTTP headers to the request.
  6641. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Header {
  6642. if c.header_ == nil {
  6643. c.header_ = make(http.Header)
  6644. }
  6645. return c.header_
  6646. }
  6647. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  6648. reqHeaders := make(http.Header)
  6649. for k, v := range c.header_ {
  6650. reqHeaders[k] = v
  6651. }
  6652. reqHeaders.Set("User-Agent", c.s.userAgent())
  6653. var body io.Reader = nil
  6654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  6655. if err != nil {
  6656. return nil, err
  6657. }
  6658. reqHeaders.Set("Content-Type", "application/json")
  6659. c.urlParams_.Set("alt", alt)
  6660. c.urlParams_.Set("prettyPrint", "false")
  6661. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAutoscaling")
  6662. urls += "?" + c.urlParams_.Encode()
  6663. req, err := http.NewRequest("POST", urls, body)
  6664. if err != nil {
  6665. return nil, err
  6666. }
  6667. req.Header = reqHeaders
  6668. googleapi.Expand(req.URL, map[string]string{
  6669. "name": c.name,
  6670. })
  6671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6672. }
  6673. // Do executes the "container.projects.locations.clusters.nodePools.setAutoscaling" call.
  6674. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6675. // status code is an error. Response headers are in either
  6676. // *Operation.ServerResponse.Header or (if a response was returned at
  6677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6678. // to check whether the returned error was because
  6679. // http.StatusNotModified was returned.
  6680. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6681. gensupport.SetOptions(c.urlParams_, opts...)
  6682. res, err := c.doRequest("json")
  6683. if res != nil && res.StatusCode == http.StatusNotModified {
  6684. if res.Body != nil {
  6685. res.Body.Close()
  6686. }
  6687. return nil, &googleapi.Error{
  6688. Code: res.StatusCode,
  6689. Header: res.Header,
  6690. }
  6691. }
  6692. if err != nil {
  6693. return nil, err
  6694. }
  6695. defer googleapi.CloseBody(res)
  6696. if err := googleapi.CheckResponse(res); err != nil {
  6697. return nil, err
  6698. }
  6699. ret := &Operation{
  6700. ServerResponse: googleapi.ServerResponse{
  6701. Header: res.Header,
  6702. HTTPStatusCode: res.StatusCode,
  6703. },
  6704. }
  6705. target := &ret
  6706. if err := gensupport.DecodeResponse(target, res); err != nil {
  6707. return nil, err
  6708. }
  6709. return ret, nil
  6710. // {
  6711. // "description": "Sets the autoscaling settings for a specific node pool.",
  6712. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
  6713. // "httpMethod": "POST",
  6714. // "id": "container.projects.locations.clusters.nodePools.setAutoscaling",
  6715. // "parameterOrder": [
  6716. // "name"
  6717. // ],
  6718. // "parameters": {
  6719. // "name": {
  6720. // "description": "The name (project, location, cluster, node pool) of the node pool to set\nautoscaler settings. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6721. // "location": "path",
  6722. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6723. // "required": true,
  6724. // "type": "string"
  6725. // }
  6726. // },
  6727. // "path": "v1/{+name}:setAutoscaling",
  6728. // "request": {
  6729. // "$ref": "SetNodePoolAutoscalingRequest"
  6730. // },
  6731. // "response": {
  6732. // "$ref": "Operation"
  6733. // },
  6734. // "scopes": [
  6735. // "https://www.googleapis.com/auth/cloud-platform"
  6736. // ]
  6737. // }
  6738. }
  6739. // method id "container.projects.locations.clusters.nodePools.setManagement":
  6740. type ProjectsLocationsClustersNodePoolsSetManagementCall struct {
  6741. s *Service
  6742. name string
  6743. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  6744. urlParams_ gensupport.URLParams
  6745. ctx_ context.Context
  6746. header_ http.Header
  6747. }
  6748. // SetManagement: Sets the NodeManagement options for a node pool.
  6749. func (r *ProjectsLocationsClustersNodePoolsService) SetManagement(name string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6750. c := &ProjectsLocationsClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6751. c.name = name
  6752. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  6753. return c
  6754. }
  6755. // Fields allows partial responses to be retrieved. See
  6756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6757. // for more information.
  6758. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6760. return c
  6761. }
  6762. // Context sets the context to be used in this call's Do method. Any
  6763. // pending HTTP request will be aborted if the provided context is
  6764. // canceled.
  6765. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6766. c.ctx_ = ctx
  6767. return c
  6768. }
  6769. // Header returns an http.Header that can be modified by the caller to
  6770. // add HTTP headers to the request.
  6771. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Header {
  6772. if c.header_ == nil {
  6773. c.header_ = make(http.Header)
  6774. }
  6775. return c.header_
  6776. }
  6777. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  6778. reqHeaders := make(http.Header)
  6779. for k, v := range c.header_ {
  6780. reqHeaders[k] = v
  6781. }
  6782. reqHeaders.Set("User-Agent", c.s.userAgent())
  6783. var body io.Reader = nil
  6784. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  6785. if err != nil {
  6786. return nil, err
  6787. }
  6788. reqHeaders.Set("Content-Type", "application/json")
  6789. c.urlParams_.Set("alt", alt)
  6790. c.urlParams_.Set("prettyPrint", "false")
  6791. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setManagement")
  6792. urls += "?" + c.urlParams_.Encode()
  6793. req, err := http.NewRequest("POST", urls, body)
  6794. if err != nil {
  6795. return nil, err
  6796. }
  6797. req.Header = reqHeaders
  6798. googleapi.Expand(req.URL, map[string]string{
  6799. "name": c.name,
  6800. })
  6801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6802. }
  6803. // Do executes the "container.projects.locations.clusters.nodePools.setManagement" call.
  6804. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6805. // status code is an error. Response headers are in either
  6806. // *Operation.ServerResponse.Header or (if a response was returned at
  6807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6808. // to check whether the returned error was because
  6809. // http.StatusNotModified was returned.
  6810. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6811. gensupport.SetOptions(c.urlParams_, opts...)
  6812. res, err := c.doRequest("json")
  6813. if res != nil && res.StatusCode == http.StatusNotModified {
  6814. if res.Body != nil {
  6815. res.Body.Close()
  6816. }
  6817. return nil, &googleapi.Error{
  6818. Code: res.StatusCode,
  6819. Header: res.Header,
  6820. }
  6821. }
  6822. if err != nil {
  6823. return nil, err
  6824. }
  6825. defer googleapi.CloseBody(res)
  6826. if err := googleapi.CheckResponse(res); err != nil {
  6827. return nil, err
  6828. }
  6829. ret := &Operation{
  6830. ServerResponse: googleapi.ServerResponse{
  6831. Header: res.Header,
  6832. HTTPStatusCode: res.StatusCode,
  6833. },
  6834. }
  6835. target := &ret
  6836. if err := gensupport.DecodeResponse(target, res); err != nil {
  6837. return nil, err
  6838. }
  6839. return ret, nil
  6840. // {
  6841. // "description": "Sets the NodeManagement options for a node pool.",
  6842. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement",
  6843. // "httpMethod": "POST",
  6844. // "id": "container.projects.locations.clusters.nodePools.setManagement",
  6845. // "parameterOrder": [
  6846. // "name"
  6847. // ],
  6848. // "parameters": {
  6849. // "name": {
  6850. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nmanagement properties. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6851. // "location": "path",
  6852. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6853. // "required": true,
  6854. // "type": "string"
  6855. // }
  6856. // },
  6857. // "path": "v1/{+name}:setManagement",
  6858. // "request": {
  6859. // "$ref": "SetNodePoolManagementRequest"
  6860. // },
  6861. // "response": {
  6862. // "$ref": "Operation"
  6863. // },
  6864. // "scopes": [
  6865. // "https://www.googleapis.com/auth/cloud-platform"
  6866. // ]
  6867. // }
  6868. }
  6869. // method id "container.projects.locations.clusters.nodePools.setSize":
  6870. type ProjectsLocationsClustersNodePoolsSetSizeCall struct {
  6871. s *Service
  6872. name string
  6873. setnodepoolsizerequest *SetNodePoolSizeRequest
  6874. urlParams_ gensupport.URLParams
  6875. ctx_ context.Context
  6876. header_ http.Header
  6877. }
  6878. // SetSize: Sets the size for a specific node pool.
  6879. func (r *ProjectsLocationsClustersNodePoolsService) SetSize(name string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6880. c := &ProjectsLocationsClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6881. c.name = name
  6882. c.setnodepoolsizerequest = setnodepoolsizerequest
  6883. return c
  6884. }
  6885. // Fields allows partial responses to be retrieved. See
  6886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6887. // for more information.
  6888. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6890. return c
  6891. }
  6892. // Context sets the context to be used in this call's Do method. Any
  6893. // pending HTTP request will be aborted if the provided context is
  6894. // canceled.
  6895. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6896. c.ctx_ = ctx
  6897. return c
  6898. }
  6899. // Header returns an http.Header that can be modified by the caller to
  6900. // add HTTP headers to the request.
  6901. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header {
  6902. if c.header_ == nil {
  6903. c.header_ = make(http.Header)
  6904. }
  6905. return c.header_
  6906. }
  6907. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  6908. reqHeaders := make(http.Header)
  6909. for k, v := range c.header_ {
  6910. reqHeaders[k] = v
  6911. }
  6912. reqHeaders.Set("User-Agent", c.s.userAgent())
  6913. var body io.Reader = nil
  6914. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  6915. if err != nil {
  6916. return nil, err
  6917. }
  6918. reqHeaders.Set("Content-Type", "application/json")
  6919. c.urlParams_.Set("alt", alt)
  6920. c.urlParams_.Set("prettyPrint", "false")
  6921. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setSize")
  6922. urls += "?" + c.urlParams_.Encode()
  6923. req, err := http.NewRequest("POST", urls, body)
  6924. if err != nil {
  6925. return nil, err
  6926. }
  6927. req.Header = reqHeaders
  6928. googleapi.Expand(req.URL, map[string]string{
  6929. "name": c.name,
  6930. })
  6931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6932. }
  6933. // Do executes the "container.projects.locations.clusters.nodePools.setSize" call.
  6934. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6935. // status code is an error. Response headers are in either
  6936. // *Operation.ServerResponse.Header or (if a response was returned at
  6937. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6938. // to check whether the returned error was because
  6939. // http.StatusNotModified was returned.
  6940. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6941. gensupport.SetOptions(c.urlParams_, opts...)
  6942. res, err := c.doRequest("json")
  6943. if res != nil && res.StatusCode == http.StatusNotModified {
  6944. if res.Body != nil {
  6945. res.Body.Close()
  6946. }
  6947. return nil, &googleapi.Error{
  6948. Code: res.StatusCode,
  6949. Header: res.Header,
  6950. }
  6951. }
  6952. if err != nil {
  6953. return nil, err
  6954. }
  6955. defer googleapi.CloseBody(res)
  6956. if err := googleapi.CheckResponse(res); err != nil {
  6957. return nil, err
  6958. }
  6959. ret := &Operation{
  6960. ServerResponse: googleapi.ServerResponse{
  6961. Header: res.Header,
  6962. HTTPStatusCode: res.StatusCode,
  6963. },
  6964. }
  6965. target := &ret
  6966. if err := gensupport.DecodeResponse(target, res); err != nil {
  6967. return nil, err
  6968. }
  6969. return ret, nil
  6970. // {
  6971. // "description": "Sets the size for a specific node pool.",
  6972. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setSize",
  6973. // "httpMethod": "POST",
  6974. // "id": "container.projects.locations.clusters.nodePools.setSize",
  6975. // "parameterOrder": [
  6976. // "name"
  6977. // ],
  6978. // "parameters": {
  6979. // "name": {
  6980. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nsize.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  6981. // "location": "path",
  6982. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6983. // "required": true,
  6984. // "type": "string"
  6985. // }
  6986. // },
  6987. // "path": "v1/{+name}:setSize",
  6988. // "request": {
  6989. // "$ref": "SetNodePoolSizeRequest"
  6990. // },
  6991. // "response": {
  6992. // "$ref": "Operation"
  6993. // },
  6994. // "scopes": [
  6995. // "https://www.googleapis.com/auth/cloud-platform"
  6996. // ]
  6997. // }
  6998. }
  6999. // method id "container.projects.locations.clusters.nodePools.update":
  7000. type ProjectsLocationsClustersNodePoolsUpdateCall struct {
  7001. s *Service
  7002. name string
  7003. updatenodepoolrequest *UpdateNodePoolRequest
  7004. urlParams_ gensupport.URLParams
  7005. ctx_ context.Context
  7006. header_ http.Header
  7007. }
  7008. // Update: Updates the version and/or image type for a specific node
  7009. // pool.
  7010. func (r *ProjectsLocationsClustersNodePoolsService) Update(name string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7011. c := &ProjectsLocationsClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7012. c.name = name
  7013. c.updatenodepoolrequest = updatenodepoolrequest
  7014. return c
  7015. }
  7016. // Fields allows partial responses to be retrieved. See
  7017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7018. // for more information.
  7019. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7021. return c
  7022. }
  7023. // Context sets the context to be used in this call's Do method. Any
  7024. // pending HTTP request will be aborted if the provided context is
  7025. // canceled.
  7026. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsUpdateCall {
  7027. c.ctx_ = ctx
  7028. return c
  7029. }
  7030. // Header returns an http.Header that can be modified by the caller to
  7031. // add HTTP headers to the request.
  7032. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header {
  7033. if c.header_ == nil {
  7034. c.header_ = make(http.Header)
  7035. }
  7036. return c.header_
  7037. }
  7038. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7039. reqHeaders := make(http.Header)
  7040. for k, v := range c.header_ {
  7041. reqHeaders[k] = v
  7042. }
  7043. reqHeaders.Set("User-Agent", c.s.userAgent())
  7044. var body io.Reader = nil
  7045. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  7046. if err != nil {
  7047. return nil, err
  7048. }
  7049. reqHeaders.Set("Content-Type", "application/json")
  7050. c.urlParams_.Set("alt", alt)
  7051. c.urlParams_.Set("prettyPrint", "false")
  7052. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7053. urls += "?" + c.urlParams_.Encode()
  7054. req, err := http.NewRequest("PUT", urls, body)
  7055. if err != nil {
  7056. return nil, err
  7057. }
  7058. req.Header = reqHeaders
  7059. googleapi.Expand(req.URL, map[string]string{
  7060. "name": c.name,
  7061. })
  7062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7063. }
  7064. // Do executes the "container.projects.locations.clusters.nodePools.update" call.
  7065. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7066. // status code is an error. Response headers are in either
  7067. // *Operation.ServerResponse.Header or (if a response was returned at
  7068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7069. // to check whether the returned error was because
  7070. // http.StatusNotModified was returned.
  7071. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7072. gensupport.SetOptions(c.urlParams_, opts...)
  7073. res, err := c.doRequest("json")
  7074. if res != nil && res.StatusCode == http.StatusNotModified {
  7075. if res.Body != nil {
  7076. res.Body.Close()
  7077. }
  7078. return nil, &googleapi.Error{
  7079. Code: res.StatusCode,
  7080. Header: res.Header,
  7081. }
  7082. }
  7083. if err != nil {
  7084. return nil, err
  7085. }
  7086. defer googleapi.CloseBody(res)
  7087. if err := googleapi.CheckResponse(res); err != nil {
  7088. return nil, err
  7089. }
  7090. ret := &Operation{
  7091. ServerResponse: googleapi.ServerResponse{
  7092. Header: res.Header,
  7093. HTTPStatusCode: res.StatusCode,
  7094. },
  7095. }
  7096. target := &ret
  7097. if err := gensupport.DecodeResponse(target, res); err != nil {
  7098. return nil, err
  7099. }
  7100. return ret, nil
  7101. // {
  7102. // "description": "Updates the version and/or image type for a specific node pool.",
  7103. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  7104. // "httpMethod": "PUT",
  7105. // "id": "container.projects.locations.clusters.nodePools.update",
  7106. // "parameterOrder": [
  7107. // "name"
  7108. // ],
  7109. // "parameters": {
  7110. // "name": {
  7111. // "description": "The name (project, location, cluster, node pool) of the node pool to\nupdate. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  7112. // "location": "path",
  7113. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  7114. // "required": true,
  7115. // "type": "string"
  7116. // }
  7117. // },
  7118. // "path": "v1/{+name}",
  7119. // "request": {
  7120. // "$ref": "UpdateNodePoolRequest"
  7121. // },
  7122. // "response": {
  7123. // "$ref": "Operation"
  7124. // },
  7125. // "scopes": [
  7126. // "https://www.googleapis.com/auth/cloud-platform"
  7127. // ]
  7128. // }
  7129. }
  7130. // method id "container.projects.locations.clusters.well-known.getOpenid-configuration":
  7131. type ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall struct {
  7132. s *Service
  7133. parent string
  7134. urlParams_ gensupport.URLParams
  7135. ifNoneMatch_ string
  7136. ctx_ context.Context
  7137. header_ http.Header
  7138. }
  7139. // GetOpenidConfiguration: GetOpenIDConfig gets the OIDC discovery
  7140. // document for the cluster.
  7141. // See the OpenID Connect Discovery 1.0 specification for
  7142. // details.
  7143. // https://openid.net/specs/openid-connect-discovery-1_0.html
  7144. // Th
  7145. // is API is not yet intended for general use, and is not available for
  7146. // all
  7147. // clusters.
  7148. func (r *ProjectsLocationsClustersWellKnownService) GetOpenidConfiguration(parent string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7149. c := &ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7150. c.parent = parent
  7151. return c
  7152. }
  7153. // Fields allows partial responses to be retrieved. See
  7154. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7155. // for more information.
  7156. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7157. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7158. return c
  7159. }
  7160. // IfNoneMatch sets the optional parameter which makes the operation
  7161. // fail if the object's ETag matches the given value. This is useful for
  7162. // getting updates only after the object has changed since the last
  7163. // request. Use googleapi.IsNotModified to check whether the response
  7164. // error from Do is the result of In-None-Match.
  7165. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7166. c.ifNoneMatch_ = entityTag
  7167. return c
  7168. }
  7169. // Context sets the context to be used in this call's Do method. Any
  7170. // pending HTTP request will be aborted if the provided context is
  7171. // canceled.
  7172. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Context(ctx context.Context) *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall {
  7173. c.ctx_ = ctx
  7174. return c
  7175. }
  7176. // Header returns an http.Header that can be modified by the caller to
  7177. // add HTTP headers to the request.
  7178. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Header() http.Header {
  7179. if c.header_ == nil {
  7180. c.header_ = make(http.Header)
  7181. }
  7182. return c.header_
  7183. }
  7184. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) doRequest(alt string) (*http.Response, error) {
  7185. reqHeaders := make(http.Header)
  7186. for k, v := range c.header_ {
  7187. reqHeaders[k] = v
  7188. }
  7189. reqHeaders.Set("User-Agent", c.s.userAgent())
  7190. if c.ifNoneMatch_ != "" {
  7191. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7192. }
  7193. var body io.Reader = nil
  7194. c.urlParams_.Set("alt", alt)
  7195. c.urlParams_.Set("prettyPrint", "false")
  7196. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/.well-known/openid-configuration")
  7197. urls += "?" + c.urlParams_.Encode()
  7198. req, err := http.NewRequest("GET", urls, body)
  7199. if err != nil {
  7200. return nil, err
  7201. }
  7202. req.Header = reqHeaders
  7203. googleapi.Expand(req.URL, map[string]string{
  7204. "parent": c.parent,
  7205. })
  7206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7207. }
  7208. // Do executes the "container.projects.locations.clusters.well-known.getOpenid-configuration" call.
  7209. // Exactly one of *GetOpenIDConfigResponse or error will be non-nil. Any
  7210. // non-2xx status code is an error. Response headers are in either
  7211. // *GetOpenIDConfigResponse.ServerResponse.Header or (if a response was
  7212. // returned at all) in error.(*googleapi.Error).Header. Use
  7213. // googleapi.IsNotModified to check whether the returned error was
  7214. // because http.StatusNotModified was returned.
  7215. func (c *ProjectsLocationsClustersWellKnownGetOpenidConfigurationCall) Do(opts ...googleapi.CallOption) (*GetOpenIDConfigResponse, error) {
  7216. gensupport.SetOptions(c.urlParams_, opts...)
  7217. res, err := c.doRequest("json")
  7218. if res != nil && res.StatusCode == http.StatusNotModified {
  7219. if res.Body != nil {
  7220. res.Body.Close()
  7221. }
  7222. return nil, &googleapi.Error{
  7223. Code: res.StatusCode,
  7224. Header: res.Header,
  7225. }
  7226. }
  7227. if err != nil {
  7228. return nil, err
  7229. }
  7230. defer googleapi.CloseBody(res)
  7231. if err := googleapi.CheckResponse(res); err != nil {
  7232. return nil, err
  7233. }
  7234. ret := &GetOpenIDConfigResponse{
  7235. ServerResponse: googleapi.ServerResponse{
  7236. Header: res.Header,
  7237. HTTPStatusCode: res.StatusCode,
  7238. },
  7239. }
  7240. target := &ret
  7241. if err := gensupport.DecodeResponse(target, res); err != nil {
  7242. return nil, err
  7243. }
  7244. return ret, nil
  7245. // {
  7246. // "description": "GetOpenIDConfig gets the OIDC discovery document for the cluster.\nSee the OpenID Connect Discovery 1.0 specification for details.\nhttps://openid.net/specs/openid-connect-discovery-1_0.html\nThis API is not yet intended for general use, and is not available for all\nclusters.",
  7247. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/.well-known/openid-configuration",
  7248. // "httpMethod": "GET",
  7249. // "id": "container.projects.locations.clusters.well-known.getOpenid-configuration",
  7250. // "parameterOrder": [
  7251. // "parent"
  7252. // ],
  7253. // "parameters": {
  7254. // "parent": {
  7255. // "description": "The cluster (project, location, cluster id) to get the discovery document\nfor. Specified in the format 'projects/*/locations/*/clusters/*'.",
  7256. // "location": "path",
  7257. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  7258. // "required": true,
  7259. // "type": "string"
  7260. // }
  7261. // },
  7262. // "path": "v1/{+parent}/.well-known/openid-configuration",
  7263. // "response": {
  7264. // "$ref": "GetOpenIDConfigResponse"
  7265. // },
  7266. // "scopes": [
  7267. // "https://www.googleapis.com/auth/cloud-platform"
  7268. // ]
  7269. // }
  7270. }
  7271. // method id "container.projects.locations.operations.cancel":
  7272. type ProjectsLocationsOperationsCancelCall struct {
  7273. s *Service
  7274. name string
  7275. canceloperationrequest *CancelOperationRequest
  7276. urlParams_ gensupport.URLParams
  7277. ctx_ context.Context
  7278. header_ http.Header
  7279. }
  7280. // Cancel: Cancels the specified operation.
  7281. func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  7282. c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7283. c.name = name
  7284. c.canceloperationrequest = canceloperationrequest
  7285. return c
  7286. }
  7287. // Fields allows partial responses to be retrieved. See
  7288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7289. // for more information.
  7290. func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  7291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7292. return c
  7293. }
  7294. // Context sets the context to be used in this call's Do method. Any
  7295. // pending HTTP request will be aborted if the provided context is
  7296. // canceled.
  7297. func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  7298. c.ctx_ = ctx
  7299. return c
  7300. }
  7301. // Header returns an http.Header that can be modified by the caller to
  7302. // add HTTP headers to the request.
  7303. func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  7304. if c.header_ == nil {
  7305. c.header_ = make(http.Header)
  7306. }
  7307. return c.header_
  7308. }
  7309. func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  7310. reqHeaders := make(http.Header)
  7311. for k, v := range c.header_ {
  7312. reqHeaders[k] = v
  7313. }
  7314. reqHeaders.Set("User-Agent", c.s.userAgent())
  7315. var body io.Reader = nil
  7316. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  7317. if err != nil {
  7318. return nil, err
  7319. }
  7320. reqHeaders.Set("Content-Type", "application/json")
  7321. c.urlParams_.Set("alt", alt)
  7322. c.urlParams_.Set("prettyPrint", "false")
  7323. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  7324. urls += "?" + c.urlParams_.Encode()
  7325. req, err := http.NewRequest("POST", urls, body)
  7326. if err != nil {
  7327. return nil, err
  7328. }
  7329. req.Header = reqHeaders
  7330. googleapi.Expand(req.URL, map[string]string{
  7331. "name": c.name,
  7332. })
  7333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7334. }
  7335. // Do executes the "container.projects.locations.operations.cancel" call.
  7336. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7337. // code is an error. Response headers are in either
  7338. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7339. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7340. // check whether the returned error was because http.StatusNotModified
  7341. // was returned.
  7342. func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7343. gensupport.SetOptions(c.urlParams_, opts...)
  7344. res, err := c.doRequest("json")
  7345. if res != nil && res.StatusCode == http.StatusNotModified {
  7346. if res.Body != nil {
  7347. res.Body.Close()
  7348. }
  7349. return nil, &googleapi.Error{
  7350. Code: res.StatusCode,
  7351. Header: res.Header,
  7352. }
  7353. }
  7354. if err != nil {
  7355. return nil, err
  7356. }
  7357. defer googleapi.CloseBody(res)
  7358. if err := googleapi.CheckResponse(res); err != nil {
  7359. return nil, err
  7360. }
  7361. ret := &Empty{
  7362. ServerResponse: googleapi.ServerResponse{
  7363. Header: res.Header,
  7364. HTTPStatusCode: res.StatusCode,
  7365. },
  7366. }
  7367. target := &ret
  7368. if err := gensupport.DecodeResponse(target, res); err != nil {
  7369. return nil, err
  7370. }
  7371. return ret, nil
  7372. // {
  7373. // "description": "Cancels the specified operation.",
  7374. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  7375. // "httpMethod": "POST",
  7376. // "id": "container.projects.locations.operations.cancel",
  7377. // "parameterOrder": [
  7378. // "name"
  7379. // ],
  7380. // "parameters": {
  7381. // "name": {
  7382. // "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7383. // "location": "path",
  7384. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7385. // "required": true,
  7386. // "type": "string"
  7387. // }
  7388. // },
  7389. // "path": "v1/{+name}:cancel",
  7390. // "request": {
  7391. // "$ref": "CancelOperationRequest"
  7392. // },
  7393. // "response": {
  7394. // "$ref": "Empty"
  7395. // },
  7396. // "scopes": [
  7397. // "https://www.googleapis.com/auth/cloud-platform"
  7398. // ]
  7399. // }
  7400. }
  7401. // method id "container.projects.locations.operations.get":
  7402. type ProjectsLocationsOperationsGetCall struct {
  7403. s *Service
  7404. name string
  7405. urlParams_ gensupport.URLParams
  7406. ifNoneMatch_ string
  7407. ctx_ context.Context
  7408. header_ http.Header
  7409. }
  7410. // Get: Gets the specified operation.
  7411. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  7412. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7413. c.name = name
  7414. return c
  7415. }
  7416. // OperationId sets the optional parameter "operationId": Deprecated.
  7417. // The server-assigned `name` of the operation.
  7418. // This field has been deprecated and replaced by the name field.
  7419. func (c *ProjectsLocationsOperationsGetCall) OperationId(operationId string) *ProjectsLocationsOperationsGetCall {
  7420. c.urlParams_.Set("operationId", operationId)
  7421. return c
  7422. }
  7423. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7424. // Google Developers Console [project ID or
  7425. // project
  7426. // number](https://support.google.com/cloud/answer/6158840).
  7427. // This
  7428. // field has been deprecated and replaced by the name field.
  7429. func (c *ProjectsLocationsOperationsGetCall) ProjectId(projectId string) *ProjectsLocationsOperationsGetCall {
  7430. c.urlParams_.Set("projectId", projectId)
  7431. return c
  7432. }
  7433. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7434. // Google Compute Engine
  7435. // [zone](/compute/docs/zones#available) in which the
  7436. // cluster
  7437. // resides.
  7438. // This field has been deprecated and replaced by the name field.
  7439. func (c *ProjectsLocationsOperationsGetCall) Zone(zone string) *ProjectsLocationsOperationsGetCall {
  7440. c.urlParams_.Set("zone", zone)
  7441. return c
  7442. }
  7443. // Fields allows partial responses to be retrieved. See
  7444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7445. // for more information.
  7446. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  7447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7448. return c
  7449. }
  7450. // IfNoneMatch sets the optional parameter which makes the operation
  7451. // fail if the object's ETag matches the given value. This is useful for
  7452. // getting updates only after the object has changed since the last
  7453. // request. Use googleapi.IsNotModified to check whether the response
  7454. // error from Do is the result of In-None-Match.
  7455. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  7456. c.ifNoneMatch_ = entityTag
  7457. return c
  7458. }
  7459. // Context sets the context to be used in this call's Do method. Any
  7460. // pending HTTP request will be aborted if the provided context is
  7461. // canceled.
  7462. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  7463. c.ctx_ = ctx
  7464. return c
  7465. }
  7466. // Header returns an http.Header that can be modified by the caller to
  7467. // add HTTP headers to the request.
  7468. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  7469. if c.header_ == nil {
  7470. c.header_ = make(http.Header)
  7471. }
  7472. return c.header_
  7473. }
  7474. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  7475. reqHeaders := make(http.Header)
  7476. for k, v := range c.header_ {
  7477. reqHeaders[k] = v
  7478. }
  7479. reqHeaders.Set("User-Agent", c.s.userAgent())
  7480. if c.ifNoneMatch_ != "" {
  7481. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7482. }
  7483. var body io.Reader = nil
  7484. c.urlParams_.Set("alt", alt)
  7485. c.urlParams_.Set("prettyPrint", "false")
  7486. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7487. urls += "?" + c.urlParams_.Encode()
  7488. req, err := http.NewRequest("GET", urls, body)
  7489. if err != nil {
  7490. return nil, err
  7491. }
  7492. req.Header = reqHeaders
  7493. googleapi.Expand(req.URL, map[string]string{
  7494. "name": c.name,
  7495. })
  7496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7497. }
  7498. // Do executes the "container.projects.locations.operations.get" call.
  7499. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7500. // status code is an error. Response headers are in either
  7501. // *Operation.ServerResponse.Header or (if a response was returned at
  7502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7503. // to check whether the returned error was because
  7504. // http.StatusNotModified was returned.
  7505. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7506. gensupport.SetOptions(c.urlParams_, opts...)
  7507. res, err := c.doRequest("json")
  7508. if res != nil && res.StatusCode == http.StatusNotModified {
  7509. if res.Body != nil {
  7510. res.Body.Close()
  7511. }
  7512. return nil, &googleapi.Error{
  7513. Code: res.StatusCode,
  7514. Header: res.Header,
  7515. }
  7516. }
  7517. if err != nil {
  7518. return nil, err
  7519. }
  7520. defer googleapi.CloseBody(res)
  7521. if err := googleapi.CheckResponse(res); err != nil {
  7522. return nil, err
  7523. }
  7524. ret := &Operation{
  7525. ServerResponse: googleapi.ServerResponse{
  7526. Header: res.Header,
  7527. HTTPStatusCode: res.StatusCode,
  7528. },
  7529. }
  7530. target := &ret
  7531. if err := gensupport.DecodeResponse(target, res); err != nil {
  7532. return nil, err
  7533. }
  7534. return ret, nil
  7535. // {
  7536. // "description": "Gets the specified operation.",
  7537. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  7538. // "httpMethod": "GET",
  7539. // "id": "container.projects.locations.operations.get",
  7540. // "parameterOrder": [
  7541. // "name"
  7542. // ],
  7543. // "parameters": {
  7544. // "name": {
  7545. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  7546. // "location": "path",
  7547. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  7548. // "required": true,
  7549. // "type": "string"
  7550. // },
  7551. // "operationId": {
  7552. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  7553. // "location": "query",
  7554. // "type": "string"
  7555. // },
  7556. // "projectId": {
  7557. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  7558. // "location": "query",
  7559. // "type": "string"
  7560. // },
  7561. // "zone": {
  7562. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  7563. // "location": "query",
  7564. // "type": "string"
  7565. // }
  7566. // },
  7567. // "path": "v1/{+name}",
  7568. // "response": {
  7569. // "$ref": "Operation"
  7570. // },
  7571. // "scopes": [
  7572. // "https://www.googleapis.com/auth/cloud-platform"
  7573. // ]
  7574. // }
  7575. }
  7576. // method id "container.projects.locations.operations.list":
  7577. type ProjectsLocationsOperationsListCall struct {
  7578. s *Service
  7579. parent string
  7580. urlParams_ gensupport.URLParams
  7581. ifNoneMatch_ string
  7582. ctx_ context.Context
  7583. header_ http.Header
  7584. }
  7585. // List: Lists all operations in a project in a specific zone or all
  7586. // zones.
  7587. func (r *ProjectsLocationsOperationsService) List(parent string) *ProjectsLocationsOperationsListCall {
  7588. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7589. c.parent = parent
  7590. return c
  7591. }
  7592. // ProjectId sets the optional parameter "projectId": Deprecated. The
  7593. // Google Developers Console [project ID or
  7594. // project
  7595. // number](https://support.google.com/cloud/answer/6158840).
  7596. // This
  7597. // field has been deprecated and replaced by the parent field.
  7598. func (c *ProjectsLocationsOperationsListCall) ProjectId(projectId string) *ProjectsLocationsOperationsListCall {
  7599. c.urlParams_.Set("projectId", projectId)
  7600. return c
  7601. }
  7602. // Zone sets the optional parameter "zone": Deprecated. The name of the
  7603. // Google Compute Engine
  7604. // [zone](/compute/docs/zones#available) to return operations for, or
  7605. // `-` for
  7606. // all zones. This field has been deprecated and replaced by the parent
  7607. // field.
  7608. func (c *ProjectsLocationsOperationsListCall) Zone(zone string) *ProjectsLocationsOperationsListCall {
  7609. c.urlParams_.Set("zone", zone)
  7610. return c
  7611. }
  7612. // Fields allows partial responses to be retrieved. See
  7613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7614. // for more information.
  7615. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  7616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7617. return c
  7618. }
  7619. // IfNoneMatch sets the optional parameter which makes the operation
  7620. // fail if the object's ETag matches the given value. This is useful for
  7621. // getting updates only after the object has changed since the last
  7622. // request. Use googleapi.IsNotModified to check whether the response
  7623. // error from Do is the result of In-None-Match.
  7624. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  7625. c.ifNoneMatch_ = entityTag
  7626. return c
  7627. }
  7628. // Context sets the context to be used in this call's Do method. Any
  7629. // pending HTTP request will be aborted if the provided context is
  7630. // canceled.
  7631. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  7632. c.ctx_ = ctx
  7633. return c
  7634. }
  7635. // Header returns an http.Header that can be modified by the caller to
  7636. // add HTTP headers to the request.
  7637. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  7638. if c.header_ == nil {
  7639. c.header_ = make(http.Header)
  7640. }
  7641. return c.header_
  7642. }
  7643. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7644. reqHeaders := make(http.Header)
  7645. for k, v := range c.header_ {
  7646. reqHeaders[k] = v
  7647. }
  7648. reqHeaders.Set("User-Agent", c.s.userAgent())
  7649. if c.ifNoneMatch_ != "" {
  7650. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7651. }
  7652. var body io.Reader = nil
  7653. c.urlParams_.Set("alt", alt)
  7654. c.urlParams_.Set("prettyPrint", "false")
  7655. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/operations")
  7656. urls += "?" + c.urlParams_.Encode()
  7657. req, err := http.NewRequest("GET", urls, body)
  7658. if err != nil {
  7659. return nil, err
  7660. }
  7661. req.Header = reqHeaders
  7662. googleapi.Expand(req.URL, map[string]string{
  7663. "parent": c.parent,
  7664. })
  7665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7666. }
  7667. // Do executes the "container.projects.locations.operations.list" call.
  7668. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  7669. // non-2xx status code is an error. Response headers are in either
  7670. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  7671. // returned at all) in error.(*googleapi.Error).Header. Use
  7672. // googleapi.IsNotModified to check whether the returned error was
  7673. // because http.StatusNotModified was returned.
  7674. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  7675. gensupport.SetOptions(c.urlParams_, opts...)
  7676. res, err := c.doRequest("json")
  7677. if res != nil && res.StatusCode == http.StatusNotModified {
  7678. if res.Body != nil {
  7679. res.Body.Close()
  7680. }
  7681. return nil, &googleapi.Error{
  7682. Code: res.StatusCode,
  7683. Header: res.Header,
  7684. }
  7685. }
  7686. if err != nil {
  7687. return nil, err
  7688. }
  7689. defer googleapi.CloseBody(res)
  7690. if err := googleapi.CheckResponse(res); err != nil {
  7691. return nil, err
  7692. }
  7693. ret := &ListOperationsResponse{
  7694. ServerResponse: googleapi.ServerResponse{
  7695. Header: res.Header,
  7696. HTTPStatusCode: res.StatusCode,
  7697. },
  7698. }
  7699. target := &ret
  7700. if err := gensupport.DecodeResponse(target, res); err != nil {
  7701. return nil, err
  7702. }
  7703. return ret, nil
  7704. // {
  7705. // "description": "Lists all operations in a project in a specific zone or all zones.",
  7706. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations",
  7707. // "httpMethod": "GET",
  7708. // "id": "container.projects.locations.operations.list",
  7709. // "parameterOrder": [
  7710. // "parent"
  7711. // ],
  7712. // "parameters": {
  7713. // "parent": {
  7714. // "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  7715. // "location": "path",
  7716. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  7717. // "required": true,
  7718. // "type": "string"
  7719. // },
  7720. // "projectId": {
  7721. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  7722. // "location": "query",
  7723. // "type": "string"
  7724. // },
  7725. // "zone": {
  7726. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for, or `-` for\nall zones. This field has been deprecated and replaced by the parent field.",
  7727. // "location": "query",
  7728. // "type": "string"
  7729. // }
  7730. // },
  7731. // "path": "v1/{+parent}/operations",
  7732. // "response": {
  7733. // "$ref": "ListOperationsResponse"
  7734. // },
  7735. // "scopes": [
  7736. // "https://www.googleapis.com/auth/cloud-platform"
  7737. // ]
  7738. // }
  7739. }
  7740. // method id "container.projects.zones.getServerconfig":
  7741. type ProjectsZonesGetServerconfigCall struct {
  7742. s *Service
  7743. projectId string
  7744. zone string
  7745. urlParams_ gensupport.URLParams
  7746. ifNoneMatch_ string
  7747. ctx_ context.Context
  7748. header_ http.Header
  7749. }
  7750. // GetServerconfig: Returns configuration info about the Kubernetes
  7751. // Engine service.
  7752. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  7753. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7754. c.projectId = projectId
  7755. c.zone = zone
  7756. return c
  7757. }
  7758. // Name sets the optional parameter "name": The name (project and
  7759. // location) of the server config to get,
  7760. // specified in the format 'projects/*/locations/*'.
  7761. func (c *ProjectsZonesGetServerconfigCall) Name(name string) *ProjectsZonesGetServerconfigCall {
  7762. c.urlParams_.Set("name", name)
  7763. return c
  7764. }
  7765. // Fields allows partial responses to be retrieved. See
  7766. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7767. // for more information.
  7768. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  7769. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7770. return c
  7771. }
  7772. // IfNoneMatch sets the optional parameter which makes the operation
  7773. // fail if the object's ETag matches the given value. This is useful for
  7774. // getting updates only after the object has changed since the last
  7775. // request. Use googleapi.IsNotModified to check whether the response
  7776. // error from Do is the result of In-None-Match.
  7777. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  7778. c.ifNoneMatch_ = entityTag
  7779. return c
  7780. }
  7781. // Context sets the context to be used in this call's Do method. Any
  7782. // pending HTTP request will be aborted if the provided context is
  7783. // canceled.
  7784. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  7785. c.ctx_ = ctx
  7786. return c
  7787. }
  7788. // Header returns an http.Header that can be modified by the caller to
  7789. // add HTTP headers to the request.
  7790. func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
  7791. if c.header_ == nil {
  7792. c.header_ = make(http.Header)
  7793. }
  7794. return c.header_
  7795. }
  7796. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  7797. reqHeaders := make(http.Header)
  7798. for k, v := range c.header_ {
  7799. reqHeaders[k] = v
  7800. }
  7801. reqHeaders.Set("User-Agent", c.s.userAgent())
  7802. if c.ifNoneMatch_ != "" {
  7803. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7804. }
  7805. var body io.Reader = nil
  7806. c.urlParams_.Set("alt", alt)
  7807. c.urlParams_.Set("prettyPrint", "false")
  7808. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig")
  7809. urls += "?" + c.urlParams_.Encode()
  7810. req, err := http.NewRequest("GET", urls, body)
  7811. if err != nil {
  7812. return nil, err
  7813. }
  7814. req.Header = reqHeaders
  7815. googleapi.Expand(req.URL, map[string]string{
  7816. "projectId": c.projectId,
  7817. "zone": c.zone,
  7818. })
  7819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7820. }
  7821. // Do executes the "container.projects.zones.getServerconfig" call.
  7822. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  7823. // status code is an error. Response headers are in either
  7824. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  7825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7826. // to check whether the returned error was because
  7827. // http.StatusNotModified was returned.
  7828. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  7829. gensupport.SetOptions(c.urlParams_, opts...)
  7830. res, err := c.doRequest("json")
  7831. if res != nil && res.StatusCode == http.StatusNotModified {
  7832. if res.Body != nil {
  7833. res.Body.Close()
  7834. }
  7835. return nil, &googleapi.Error{
  7836. Code: res.StatusCode,
  7837. Header: res.Header,
  7838. }
  7839. }
  7840. if err != nil {
  7841. return nil, err
  7842. }
  7843. defer googleapi.CloseBody(res)
  7844. if err := googleapi.CheckResponse(res); err != nil {
  7845. return nil, err
  7846. }
  7847. ret := &ServerConfig{
  7848. ServerResponse: googleapi.ServerResponse{
  7849. Header: res.Header,
  7850. HTTPStatusCode: res.StatusCode,
  7851. },
  7852. }
  7853. target := &ret
  7854. if err := gensupport.DecodeResponse(target, res); err != nil {
  7855. return nil, err
  7856. }
  7857. return ret, nil
  7858. // {
  7859. // "description": "Returns configuration info about the Kubernetes Engine service.",
  7860. // "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  7861. // "httpMethod": "GET",
  7862. // "id": "container.projects.zones.getServerconfig",
  7863. // "parameterOrder": [
  7864. // "projectId",
  7865. // "zone"
  7866. // ],
  7867. // "parameters": {
  7868. // "name": {
  7869. // "description": "The name (project and location) of the server config to get,\nspecified in the format 'projects/*/locations/*'.",
  7870. // "location": "query",
  7871. // "type": "string"
  7872. // },
  7873. // "projectId": {
  7874. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  7875. // "location": "path",
  7876. // "required": true,
  7877. // "type": "string"
  7878. // },
  7879. // "zone": {
  7880. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for.\nThis field has been deprecated and replaced by the name field.",
  7881. // "location": "path",
  7882. // "required": true,
  7883. // "type": "string"
  7884. // }
  7885. // },
  7886. // "path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  7887. // "response": {
  7888. // "$ref": "ServerConfig"
  7889. // },
  7890. // "scopes": [
  7891. // "https://www.googleapis.com/auth/cloud-platform"
  7892. // ]
  7893. // }
  7894. }
  7895. // method id "container.projects.zones.clusters.addons":
  7896. type ProjectsZonesClustersAddonsCall struct {
  7897. s *Service
  7898. projectId string
  7899. zone string
  7900. clusterId string
  7901. setaddonsconfigrequest *SetAddonsConfigRequest
  7902. urlParams_ gensupport.URLParams
  7903. ctx_ context.Context
  7904. header_ http.Header
  7905. }
  7906. // Addons: Sets the addons for a specific cluster.
  7907. func (r *ProjectsZonesClustersService) Addons(projectId string, zone string, clusterId string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsZonesClustersAddonsCall {
  7908. c := &ProjectsZonesClustersAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7909. c.projectId = projectId
  7910. c.zone = zone
  7911. c.clusterId = clusterId
  7912. c.setaddonsconfigrequest = setaddonsconfigrequest
  7913. return c
  7914. }
  7915. // Fields allows partial responses to be retrieved. See
  7916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7917. // for more information.
  7918. func (c *ProjectsZonesClustersAddonsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersAddonsCall {
  7919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7920. return c
  7921. }
  7922. // Context sets the context to be used in this call's Do method. Any
  7923. // pending HTTP request will be aborted if the provided context is
  7924. // canceled.
  7925. func (c *ProjectsZonesClustersAddonsCall) Context(ctx context.Context) *ProjectsZonesClustersAddonsCall {
  7926. c.ctx_ = ctx
  7927. return c
  7928. }
  7929. // Header returns an http.Header that can be modified by the caller to
  7930. // add HTTP headers to the request.
  7931. func (c *ProjectsZonesClustersAddonsCall) Header() http.Header {
  7932. if c.header_ == nil {
  7933. c.header_ = make(http.Header)
  7934. }
  7935. return c.header_
  7936. }
  7937. func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) {
  7938. reqHeaders := make(http.Header)
  7939. for k, v := range c.header_ {
  7940. reqHeaders[k] = v
  7941. }
  7942. reqHeaders.Set("User-Agent", c.s.userAgent())
  7943. var body io.Reader = nil
  7944. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  7945. if err != nil {
  7946. return nil, err
  7947. }
  7948. reqHeaders.Set("Content-Type", "application/json")
  7949. c.urlParams_.Set("alt", alt)
  7950. c.urlParams_.Set("prettyPrint", "false")
  7951. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons")
  7952. urls += "?" + c.urlParams_.Encode()
  7953. req, err := http.NewRequest("POST", urls, body)
  7954. if err != nil {
  7955. return nil, err
  7956. }
  7957. req.Header = reqHeaders
  7958. googleapi.Expand(req.URL, map[string]string{
  7959. "projectId": c.projectId,
  7960. "zone": c.zone,
  7961. "clusterId": c.clusterId,
  7962. })
  7963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7964. }
  7965. // Do executes the "container.projects.zones.clusters.addons" call.
  7966. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7967. // status code is an error. Response headers are in either
  7968. // *Operation.ServerResponse.Header or (if a response was returned at
  7969. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7970. // to check whether the returned error was because
  7971. // http.StatusNotModified was returned.
  7972. func (c *ProjectsZonesClustersAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7973. gensupport.SetOptions(c.urlParams_, opts...)
  7974. res, err := c.doRequest("json")
  7975. if res != nil && res.StatusCode == http.StatusNotModified {
  7976. if res.Body != nil {
  7977. res.Body.Close()
  7978. }
  7979. return nil, &googleapi.Error{
  7980. Code: res.StatusCode,
  7981. Header: res.Header,
  7982. }
  7983. }
  7984. if err != nil {
  7985. return nil, err
  7986. }
  7987. defer googleapi.CloseBody(res)
  7988. if err := googleapi.CheckResponse(res); err != nil {
  7989. return nil, err
  7990. }
  7991. ret := &Operation{
  7992. ServerResponse: googleapi.ServerResponse{
  7993. Header: res.Header,
  7994. HTTPStatusCode: res.StatusCode,
  7995. },
  7996. }
  7997. target := &ret
  7998. if err := gensupport.DecodeResponse(target, res); err != nil {
  7999. return nil, err
  8000. }
  8001. return ret, nil
  8002. // {
  8003. // "description": "Sets the addons for a specific cluster.",
  8004. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8005. // "httpMethod": "POST",
  8006. // "id": "container.projects.zones.clusters.addons",
  8007. // "parameterOrder": [
  8008. // "projectId",
  8009. // "zone",
  8010. // "clusterId"
  8011. // ],
  8012. // "parameters": {
  8013. // "clusterId": {
  8014. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8015. // "location": "path",
  8016. // "required": true,
  8017. // "type": "string"
  8018. // },
  8019. // "projectId": {
  8020. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8021. // "location": "path",
  8022. // "required": true,
  8023. // "type": "string"
  8024. // },
  8025. // "zone": {
  8026. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8027. // "location": "path",
  8028. // "required": true,
  8029. // "type": "string"
  8030. // }
  8031. // },
  8032. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  8033. // "request": {
  8034. // "$ref": "SetAddonsConfigRequest"
  8035. // },
  8036. // "response": {
  8037. // "$ref": "Operation"
  8038. // },
  8039. // "scopes": [
  8040. // "https://www.googleapis.com/auth/cloud-platform"
  8041. // ]
  8042. // }
  8043. }
  8044. // method id "container.projects.zones.clusters.completeIpRotation":
  8045. type ProjectsZonesClustersCompleteIpRotationCall struct {
  8046. s *Service
  8047. projectId string
  8048. zone string
  8049. clusterId string
  8050. completeiprotationrequest *CompleteIPRotationRequest
  8051. urlParams_ gensupport.URLParams
  8052. ctx_ context.Context
  8053. header_ http.Header
  8054. }
  8055. // CompleteIpRotation: Completes master IP rotation.
  8056. func (r *ProjectsZonesClustersService) CompleteIpRotation(projectId string, zone string, clusterId string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsZonesClustersCompleteIpRotationCall {
  8057. c := &ProjectsZonesClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8058. c.projectId = projectId
  8059. c.zone = zone
  8060. c.clusterId = clusterId
  8061. c.completeiprotationrequest = completeiprotationrequest
  8062. return c
  8063. }
  8064. // Fields allows partial responses to be retrieved. See
  8065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8066. // for more information.
  8067. func (c *ProjectsZonesClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCompleteIpRotationCall {
  8068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8069. return c
  8070. }
  8071. // Context sets the context to be used in this call's Do method. Any
  8072. // pending HTTP request will be aborted if the provided context is
  8073. // canceled.
  8074. func (c *ProjectsZonesClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersCompleteIpRotationCall {
  8075. c.ctx_ = ctx
  8076. return c
  8077. }
  8078. // Header returns an http.Header that can be modified by the caller to
  8079. // add HTTP headers to the request.
  8080. func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header {
  8081. if c.header_ == nil {
  8082. c.header_ = make(http.Header)
  8083. }
  8084. return c.header_
  8085. }
  8086. func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  8087. reqHeaders := make(http.Header)
  8088. for k, v := range c.header_ {
  8089. reqHeaders[k] = v
  8090. }
  8091. reqHeaders.Set("User-Agent", c.s.userAgent())
  8092. var body io.Reader = nil
  8093. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  8094. if err != nil {
  8095. return nil, err
  8096. }
  8097. reqHeaders.Set("Content-Type", "application/json")
  8098. c.urlParams_.Set("alt", alt)
  8099. c.urlParams_.Set("prettyPrint", "false")
  8100. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation")
  8101. urls += "?" + c.urlParams_.Encode()
  8102. req, err := http.NewRequest("POST", urls, body)
  8103. if err != nil {
  8104. return nil, err
  8105. }
  8106. req.Header = reqHeaders
  8107. googleapi.Expand(req.URL, map[string]string{
  8108. "projectId": c.projectId,
  8109. "zone": c.zone,
  8110. "clusterId": c.clusterId,
  8111. })
  8112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8113. }
  8114. // Do executes the "container.projects.zones.clusters.completeIpRotation" call.
  8115. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8116. // status code is an error. Response headers are in either
  8117. // *Operation.ServerResponse.Header or (if a response was returned at
  8118. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8119. // to check whether the returned error was because
  8120. // http.StatusNotModified was returned.
  8121. func (c *ProjectsZonesClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8122. gensupport.SetOptions(c.urlParams_, opts...)
  8123. res, err := c.doRequest("json")
  8124. if res != nil && res.StatusCode == http.StatusNotModified {
  8125. if res.Body != nil {
  8126. res.Body.Close()
  8127. }
  8128. return nil, &googleapi.Error{
  8129. Code: res.StatusCode,
  8130. Header: res.Header,
  8131. }
  8132. }
  8133. if err != nil {
  8134. return nil, err
  8135. }
  8136. defer googleapi.CloseBody(res)
  8137. if err := googleapi.CheckResponse(res); err != nil {
  8138. return nil, err
  8139. }
  8140. ret := &Operation{
  8141. ServerResponse: googleapi.ServerResponse{
  8142. Header: res.Header,
  8143. HTTPStatusCode: res.StatusCode,
  8144. },
  8145. }
  8146. target := &ret
  8147. if err := gensupport.DecodeResponse(target, res); err != nil {
  8148. return nil, err
  8149. }
  8150. return ret, nil
  8151. // {
  8152. // "description": "Completes master IP rotation.",
  8153. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8154. // "httpMethod": "POST",
  8155. // "id": "container.projects.zones.clusters.completeIpRotation",
  8156. // "parameterOrder": [
  8157. // "projectId",
  8158. // "zone",
  8159. // "clusterId"
  8160. // ],
  8161. // "parameters": {
  8162. // "clusterId": {
  8163. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  8164. // "location": "path",
  8165. // "required": true,
  8166. // "type": "string"
  8167. // },
  8168. // "projectId": {
  8169. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  8170. // "location": "path",
  8171. // "required": true,
  8172. // "type": "string"
  8173. // },
  8174. // "zone": {
  8175. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8176. // "location": "path",
  8177. // "required": true,
  8178. // "type": "string"
  8179. // }
  8180. // },
  8181. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  8182. // "request": {
  8183. // "$ref": "CompleteIPRotationRequest"
  8184. // },
  8185. // "response": {
  8186. // "$ref": "Operation"
  8187. // },
  8188. // "scopes": [
  8189. // "https://www.googleapis.com/auth/cloud-platform"
  8190. // ]
  8191. // }
  8192. }
  8193. // method id "container.projects.zones.clusters.create":
  8194. type ProjectsZonesClustersCreateCall struct {
  8195. s *Service
  8196. projectId string
  8197. zone string
  8198. createclusterrequest *CreateClusterRequest
  8199. urlParams_ gensupport.URLParams
  8200. ctx_ context.Context
  8201. header_ http.Header
  8202. }
  8203. // Create: Creates a cluster, consisting of the specified number and
  8204. // type of Google
  8205. // Compute Engine instances.
  8206. //
  8207. // By default, the cluster is created in the project's
  8208. // [default
  8209. // network](/compute/docs/networks-and-firewalls#networks).
  8210. //
  8211. // One firewall is added for the cluster. After cluster creation,
  8212. // the cluster creates routes for each node to allow the containers
  8213. // on that node to communicate with all other instances in
  8214. // the
  8215. // cluster.
  8216. //
  8217. // Finally, an entry is added to the project's global metadata
  8218. // indicating
  8219. // which CIDR range is being used by the cluster.
  8220. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  8221. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8222. c.projectId = projectId
  8223. c.zone = zone
  8224. c.createclusterrequest = createclusterrequest
  8225. return c
  8226. }
  8227. // Fields allows partial responses to be retrieved. See
  8228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8229. // for more information.
  8230. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  8231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8232. return c
  8233. }
  8234. // Context sets the context to be used in this call's Do method. Any
  8235. // pending HTTP request will be aborted if the provided context is
  8236. // canceled.
  8237. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  8238. c.ctx_ = ctx
  8239. return c
  8240. }
  8241. // Header returns an http.Header that can be modified by the caller to
  8242. // add HTTP headers to the request.
  8243. func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
  8244. if c.header_ == nil {
  8245. c.header_ = make(http.Header)
  8246. }
  8247. return c.header_
  8248. }
  8249. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  8250. reqHeaders := make(http.Header)
  8251. for k, v := range c.header_ {
  8252. reqHeaders[k] = v
  8253. }
  8254. reqHeaders.Set("User-Agent", c.s.userAgent())
  8255. var body io.Reader = nil
  8256. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  8257. if err != nil {
  8258. return nil, err
  8259. }
  8260. reqHeaders.Set("Content-Type", "application/json")
  8261. c.urlParams_.Set("alt", alt)
  8262. c.urlParams_.Set("prettyPrint", "false")
  8263. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  8264. urls += "?" + c.urlParams_.Encode()
  8265. req, err := http.NewRequest("POST", urls, body)
  8266. if err != nil {
  8267. return nil, err
  8268. }
  8269. req.Header = reqHeaders
  8270. googleapi.Expand(req.URL, map[string]string{
  8271. "projectId": c.projectId,
  8272. "zone": c.zone,
  8273. })
  8274. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8275. }
  8276. // Do executes the "container.projects.zones.clusters.create" call.
  8277. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8278. // status code is an error. Response headers are in either
  8279. // *Operation.ServerResponse.Header or (if a response was returned at
  8280. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8281. // to check whether the returned error was because
  8282. // http.StatusNotModified was returned.
  8283. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8284. gensupport.SetOptions(c.urlParams_, opts...)
  8285. res, err := c.doRequest("json")
  8286. if res != nil && res.StatusCode == http.StatusNotModified {
  8287. if res.Body != nil {
  8288. res.Body.Close()
  8289. }
  8290. return nil, &googleapi.Error{
  8291. Code: res.StatusCode,
  8292. Header: res.Header,
  8293. }
  8294. }
  8295. if err != nil {
  8296. return nil, err
  8297. }
  8298. defer googleapi.CloseBody(res)
  8299. if err := googleapi.CheckResponse(res); err != nil {
  8300. return nil, err
  8301. }
  8302. ret := &Operation{
  8303. ServerResponse: googleapi.ServerResponse{
  8304. Header: res.Header,
  8305. HTTPStatusCode: res.StatusCode,
  8306. },
  8307. }
  8308. target := &ret
  8309. if err := gensupport.DecodeResponse(target, res); err != nil {
  8310. return nil, err
  8311. }
  8312. return ret, nil
  8313. // {
  8314. // "description": "Creates a cluster, consisting of the specified number and type of Google\nCompute Engine instances.\n\nBy default, the cluster is created in the project's\n[default network](/compute/docs/networks-and-firewalls#networks).\n\nOne firewall is added for the cluster. After cluster creation,\nthe cluster creates routes for each node to allow the containers\non that node to communicate with all other instances in the\ncluster.\n\nFinally, an entry is added to the project's global metadata indicating\nwhich CIDR range is being used by the cluster.",
  8315. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  8316. // "httpMethod": "POST",
  8317. // "id": "container.projects.zones.clusters.create",
  8318. // "parameterOrder": [
  8319. // "projectId",
  8320. // "zone"
  8321. // ],
  8322. // "parameters": {
  8323. // "projectId": {
  8324. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  8325. // "location": "path",
  8326. // "required": true,
  8327. // "type": "string"
  8328. // },
  8329. // "zone": {
  8330. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  8331. // "location": "path",
  8332. // "required": true,
  8333. // "type": "string"
  8334. // }
  8335. // },
  8336. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  8337. // "request": {
  8338. // "$ref": "CreateClusterRequest"
  8339. // },
  8340. // "response": {
  8341. // "$ref": "Operation"
  8342. // },
  8343. // "scopes": [
  8344. // "https://www.googleapis.com/auth/cloud-platform"
  8345. // ]
  8346. // }
  8347. }
  8348. // method id "container.projects.zones.clusters.delete":
  8349. type ProjectsZonesClustersDeleteCall struct {
  8350. s *Service
  8351. projectId string
  8352. zone string
  8353. clusterId string
  8354. urlParams_ gensupport.URLParams
  8355. ctx_ context.Context
  8356. header_ http.Header
  8357. }
  8358. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  8359. // all worker
  8360. // nodes.
  8361. //
  8362. // Firewalls and routes that were configured during cluster creation
  8363. // are also deleted.
  8364. //
  8365. // Other Google Compute Engine resources that might be in use by the
  8366. // cluster
  8367. // (e.g. load balancer resources) will not be deleted if they weren't
  8368. // present
  8369. // at the initial create time.
  8370. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  8371. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8372. c.projectId = projectId
  8373. c.zone = zone
  8374. c.clusterId = clusterId
  8375. return c
  8376. }
  8377. // Name sets the optional parameter "name": The name (project, location,
  8378. // cluster) of the cluster to delete.
  8379. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8380. func (c *ProjectsZonesClustersDeleteCall) Name(name string) *ProjectsZonesClustersDeleteCall {
  8381. c.urlParams_.Set("name", name)
  8382. return c
  8383. }
  8384. // Fields allows partial responses to be retrieved. See
  8385. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8386. // for more information.
  8387. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  8388. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8389. return c
  8390. }
  8391. // Context sets the context to be used in this call's Do method. Any
  8392. // pending HTTP request will be aborted if the provided context is
  8393. // canceled.
  8394. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  8395. c.ctx_ = ctx
  8396. return c
  8397. }
  8398. // Header returns an http.Header that can be modified by the caller to
  8399. // add HTTP headers to the request.
  8400. func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
  8401. if c.header_ == nil {
  8402. c.header_ = make(http.Header)
  8403. }
  8404. return c.header_
  8405. }
  8406. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  8407. reqHeaders := make(http.Header)
  8408. for k, v := range c.header_ {
  8409. reqHeaders[k] = v
  8410. }
  8411. reqHeaders.Set("User-Agent", c.s.userAgent())
  8412. var body io.Reader = nil
  8413. c.urlParams_.Set("alt", alt)
  8414. c.urlParams_.Set("prettyPrint", "false")
  8415. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  8416. urls += "?" + c.urlParams_.Encode()
  8417. req, err := http.NewRequest("DELETE", urls, body)
  8418. if err != nil {
  8419. return nil, err
  8420. }
  8421. req.Header = reqHeaders
  8422. googleapi.Expand(req.URL, map[string]string{
  8423. "projectId": c.projectId,
  8424. "zone": c.zone,
  8425. "clusterId": c.clusterId,
  8426. })
  8427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8428. }
  8429. // Do executes the "container.projects.zones.clusters.delete" call.
  8430. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8431. // status code is an error. Response headers are in either
  8432. // *Operation.ServerResponse.Header or (if a response was returned at
  8433. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8434. // to check whether the returned error was because
  8435. // http.StatusNotModified was returned.
  8436. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8437. gensupport.SetOptions(c.urlParams_, opts...)
  8438. res, err := c.doRequest("json")
  8439. if res != nil && res.StatusCode == http.StatusNotModified {
  8440. if res.Body != nil {
  8441. res.Body.Close()
  8442. }
  8443. return nil, &googleapi.Error{
  8444. Code: res.StatusCode,
  8445. Header: res.Header,
  8446. }
  8447. }
  8448. if err != nil {
  8449. return nil, err
  8450. }
  8451. defer googleapi.CloseBody(res)
  8452. if err := googleapi.CheckResponse(res); err != nil {
  8453. return nil, err
  8454. }
  8455. ret := &Operation{
  8456. ServerResponse: googleapi.ServerResponse{
  8457. Header: res.Header,
  8458. HTTPStatusCode: res.StatusCode,
  8459. },
  8460. }
  8461. target := &ret
  8462. if err := gensupport.DecodeResponse(target, res); err != nil {
  8463. return nil, err
  8464. }
  8465. return ret, nil
  8466. // {
  8467. // "description": "Deletes the cluster, including the Kubernetes endpoint and all worker\nnodes.\n\nFirewalls and routes that were configured during cluster creation\nare also deleted.\n\nOther Google Compute Engine resources that might be in use by the cluster\n(e.g. load balancer resources) will not be deleted if they weren't present\nat the initial create time.",
  8468. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8469. // "httpMethod": "DELETE",
  8470. // "id": "container.projects.zones.clusters.delete",
  8471. // "parameterOrder": [
  8472. // "projectId",
  8473. // "zone",
  8474. // "clusterId"
  8475. // ],
  8476. // "parameters": {
  8477. // "clusterId": {
  8478. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  8479. // "location": "path",
  8480. // "required": true,
  8481. // "type": "string"
  8482. // },
  8483. // "name": {
  8484. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  8485. // "location": "query",
  8486. // "type": "string"
  8487. // },
  8488. // "projectId": {
  8489. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8490. // "location": "path",
  8491. // "required": true,
  8492. // "type": "string"
  8493. // },
  8494. // "zone": {
  8495. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8496. // "location": "path",
  8497. // "required": true,
  8498. // "type": "string"
  8499. // }
  8500. // },
  8501. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8502. // "response": {
  8503. // "$ref": "Operation"
  8504. // },
  8505. // "scopes": [
  8506. // "https://www.googleapis.com/auth/cloud-platform"
  8507. // ]
  8508. // }
  8509. }
  8510. // method id "container.projects.zones.clusters.get":
  8511. type ProjectsZonesClustersGetCall struct {
  8512. s *Service
  8513. projectId string
  8514. zone string
  8515. clusterId string
  8516. urlParams_ gensupport.URLParams
  8517. ifNoneMatch_ string
  8518. ctx_ context.Context
  8519. header_ http.Header
  8520. }
  8521. // Get: Gets the details of a specific cluster.
  8522. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  8523. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8524. c.projectId = projectId
  8525. c.zone = zone
  8526. c.clusterId = clusterId
  8527. return c
  8528. }
  8529. // Name sets the optional parameter "name": The name (project, location,
  8530. // cluster) of the cluster to retrieve.
  8531. // Specified in the format 'projects/*/locations/*/clusters/*'.
  8532. func (c *ProjectsZonesClustersGetCall) Name(name string) *ProjectsZonesClustersGetCall {
  8533. c.urlParams_.Set("name", name)
  8534. return c
  8535. }
  8536. // Fields allows partial responses to be retrieved. See
  8537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8538. // for more information.
  8539. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  8540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8541. return c
  8542. }
  8543. // IfNoneMatch sets the optional parameter which makes the operation
  8544. // fail if the object's ETag matches the given value. This is useful for
  8545. // getting updates only after the object has changed since the last
  8546. // request. Use googleapi.IsNotModified to check whether the response
  8547. // error from Do is the result of In-None-Match.
  8548. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  8549. c.ifNoneMatch_ = entityTag
  8550. return c
  8551. }
  8552. // Context sets the context to be used in this call's Do method. Any
  8553. // pending HTTP request will be aborted if the provided context is
  8554. // canceled.
  8555. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  8556. c.ctx_ = ctx
  8557. return c
  8558. }
  8559. // Header returns an http.Header that can be modified by the caller to
  8560. // add HTTP headers to the request.
  8561. func (c *ProjectsZonesClustersGetCall) Header() http.Header {
  8562. if c.header_ == nil {
  8563. c.header_ = make(http.Header)
  8564. }
  8565. return c.header_
  8566. }
  8567. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  8568. reqHeaders := make(http.Header)
  8569. for k, v := range c.header_ {
  8570. reqHeaders[k] = v
  8571. }
  8572. reqHeaders.Set("User-Agent", c.s.userAgent())
  8573. if c.ifNoneMatch_ != "" {
  8574. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8575. }
  8576. var body io.Reader = nil
  8577. c.urlParams_.Set("alt", alt)
  8578. c.urlParams_.Set("prettyPrint", "false")
  8579. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  8580. urls += "?" + c.urlParams_.Encode()
  8581. req, err := http.NewRequest("GET", urls, body)
  8582. if err != nil {
  8583. return nil, err
  8584. }
  8585. req.Header = reqHeaders
  8586. googleapi.Expand(req.URL, map[string]string{
  8587. "projectId": c.projectId,
  8588. "zone": c.zone,
  8589. "clusterId": c.clusterId,
  8590. })
  8591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8592. }
  8593. // Do executes the "container.projects.zones.clusters.get" call.
  8594. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  8595. // code is an error. Response headers are in either
  8596. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  8597. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8598. // check whether the returned error was because http.StatusNotModified
  8599. // was returned.
  8600. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  8601. gensupport.SetOptions(c.urlParams_, opts...)
  8602. res, err := c.doRequest("json")
  8603. if res != nil && res.StatusCode == http.StatusNotModified {
  8604. if res.Body != nil {
  8605. res.Body.Close()
  8606. }
  8607. return nil, &googleapi.Error{
  8608. Code: res.StatusCode,
  8609. Header: res.Header,
  8610. }
  8611. }
  8612. if err != nil {
  8613. return nil, err
  8614. }
  8615. defer googleapi.CloseBody(res)
  8616. if err := googleapi.CheckResponse(res); err != nil {
  8617. return nil, err
  8618. }
  8619. ret := &Cluster{
  8620. ServerResponse: googleapi.ServerResponse{
  8621. Header: res.Header,
  8622. HTTPStatusCode: res.StatusCode,
  8623. },
  8624. }
  8625. target := &ret
  8626. if err := gensupport.DecodeResponse(target, res); err != nil {
  8627. return nil, err
  8628. }
  8629. return ret, nil
  8630. // {
  8631. // "description": "Gets the details of a specific cluster.",
  8632. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8633. // "httpMethod": "GET",
  8634. // "id": "container.projects.zones.clusters.get",
  8635. // "parameterOrder": [
  8636. // "projectId",
  8637. // "zone",
  8638. // "clusterId"
  8639. // ],
  8640. // "parameters": {
  8641. // "clusterId": {
  8642. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  8643. // "location": "path",
  8644. // "required": true,
  8645. // "type": "string"
  8646. // },
  8647. // "name": {
  8648. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  8649. // "location": "query",
  8650. // "type": "string"
  8651. // },
  8652. // "projectId": {
  8653. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8654. // "location": "path",
  8655. // "required": true,
  8656. // "type": "string"
  8657. // },
  8658. // "zone": {
  8659. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8660. // "location": "path",
  8661. // "required": true,
  8662. // "type": "string"
  8663. // }
  8664. // },
  8665. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  8666. // "response": {
  8667. // "$ref": "Cluster"
  8668. // },
  8669. // "scopes": [
  8670. // "https://www.googleapis.com/auth/cloud-platform"
  8671. // ]
  8672. // }
  8673. }
  8674. // method id "container.projects.zones.clusters.legacyAbac":
  8675. type ProjectsZonesClustersLegacyAbacCall struct {
  8676. s *Service
  8677. projectId string
  8678. zone string
  8679. clusterId string
  8680. setlegacyabacrequest *SetLegacyAbacRequest
  8681. urlParams_ gensupport.URLParams
  8682. ctx_ context.Context
  8683. header_ http.Header
  8684. }
  8685. // LegacyAbac: Enables or disables the ABAC authorization mechanism on a
  8686. // cluster.
  8687. func (r *ProjectsZonesClustersService) LegacyAbac(projectId string, zone string, clusterId string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsZonesClustersLegacyAbacCall {
  8688. c := &ProjectsZonesClustersLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8689. c.projectId = projectId
  8690. c.zone = zone
  8691. c.clusterId = clusterId
  8692. c.setlegacyabacrequest = setlegacyabacrequest
  8693. return c
  8694. }
  8695. // Fields allows partial responses to be retrieved. See
  8696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8697. // for more information.
  8698. func (c *ProjectsZonesClustersLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLegacyAbacCall {
  8699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8700. return c
  8701. }
  8702. // Context sets the context to be used in this call's Do method. Any
  8703. // pending HTTP request will be aborted if the provided context is
  8704. // canceled.
  8705. func (c *ProjectsZonesClustersLegacyAbacCall) Context(ctx context.Context) *ProjectsZonesClustersLegacyAbacCall {
  8706. c.ctx_ = ctx
  8707. return c
  8708. }
  8709. // Header returns an http.Header that can be modified by the caller to
  8710. // add HTTP headers to the request.
  8711. func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header {
  8712. if c.header_ == nil {
  8713. c.header_ = make(http.Header)
  8714. }
  8715. return c.header_
  8716. }
  8717. func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  8718. reqHeaders := make(http.Header)
  8719. for k, v := range c.header_ {
  8720. reqHeaders[k] = v
  8721. }
  8722. reqHeaders.Set("User-Agent", c.s.userAgent())
  8723. var body io.Reader = nil
  8724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  8725. if err != nil {
  8726. return nil, err
  8727. }
  8728. reqHeaders.Set("Content-Type", "application/json")
  8729. c.urlParams_.Set("alt", alt)
  8730. c.urlParams_.Set("prettyPrint", "false")
  8731. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac")
  8732. urls += "?" + c.urlParams_.Encode()
  8733. req, err := http.NewRequest("POST", urls, body)
  8734. if err != nil {
  8735. return nil, err
  8736. }
  8737. req.Header = reqHeaders
  8738. googleapi.Expand(req.URL, map[string]string{
  8739. "projectId": c.projectId,
  8740. "zone": c.zone,
  8741. "clusterId": c.clusterId,
  8742. })
  8743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8744. }
  8745. // Do executes the "container.projects.zones.clusters.legacyAbac" call.
  8746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8747. // status code is an error. Response headers are in either
  8748. // *Operation.ServerResponse.Header or (if a response was returned at
  8749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8750. // to check whether the returned error was because
  8751. // http.StatusNotModified was returned.
  8752. func (c *ProjectsZonesClustersLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8753. gensupport.SetOptions(c.urlParams_, opts...)
  8754. res, err := c.doRequest("json")
  8755. if res != nil && res.StatusCode == http.StatusNotModified {
  8756. if res.Body != nil {
  8757. res.Body.Close()
  8758. }
  8759. return nil, &googleapi.Error{
  8760. Code: res.StatusCode,
  8761. Header: res.Header,
  8762. }
  8763. }
  8764. if err != nil {
  8765. return nil, err
  8766. }
  8767. defer googleapi.CloseBody(res)
  8768. if err := googleapi.CheckResponse(res); err != nil {
  8769. return nil, err
  8770. }
  8771. ret := &Operation{
  8772. ServerResponse: googleapi.ServerResponse{
  8773. Header: res.Header,
  8774. HTTPStatusCode: res.StatusCode,
  8775. },
  8776. }
  8777. target := &ret
  8778. if err := gensupport.DecodeResponse(target, res); err != nil {
  8779. return nil, err
  8780. }
  8781. return ret, nil
  8782. // {
  8783. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  8784. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  8785. // "httpMethod": "POST",
  8786. // "id": "container.projects.zones.clusters.legacyAbac",
  8787. // "parameterOrder": [
  8788. // "projectId",
  8789. // "zone",
  8790. // "clusterId"
  8791. // ],
  8792. // "parameters": {
  8793. // "clusterId": {
  8794. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  8795. // "location": "path",
  8796. // "required": true,
  8797. // "type": "string"
  8798. // },
  8799. // "projectId": {
  8800. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  8801. // "location": "path",
  8802. // "required": true,
  8803. // "type": "string"
  8804. // },
  8805. // "zone": {
  8806. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  8807. // "location": "path",
  8808. // "required": true,
  8809. // "type": "string"
  8810. // }
  8811. // },
  8812. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  8813. // "request": {
  8814. // "$ref": "SetLegacyAbacRequest"
  8815. // },
  8816. // "response": {
  8817. // "$ref": "Operation"
  8818. // },
  8819. // "scopes": [
  8820. // "https://www.googleapis.com/auth/cloud-platform"
  8821. // ]
  8822. // }
  8823. }
  8824. // method id "container.projects.zones.clusters.list":
  8825. type ProjectsZonesClustersListCall struct {
  8826. s *Service
  8827. projectId string
  8828. zone string
  8829. urlParams_ gensupport.URLParams
  8830. ifNoneMatch_ string
  8831. ctx_ context.Context
  8832. header_ http.Header
  8833. }
  8834. // List: Lists all clusters owned by a project in either the specified
  8835. // zone or all
  8836. // zones.
  8837. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  8838. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8839. c.projectId = projectId
  8840. c.zone = zone
  8841. return c
  8842. }
  8843. // Parent sets the optional parameter "parent": The parent (project and
  8844. // location) where the clusters will be listed.
  8845. // Specified in the format 'projects/*/locations/*'.
  8846. // Location "-" matches all zones and all regions.
  8847. func (c *ProjectsZonesClustersListCall) Parent(parent string) *ProjectsZonesClustersListCall {
  8848. c.urlParams_.Set("parent", parent)
  8849. return c
  8850. }
  8851. // Fields allows partial responses to be retrieved. See
  8852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8853. // for more information.
  8854. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  8855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8856. return c
  8857. }
  8858. // IfNoneMatch sets the optional parameter which makes the operation
  8859. // fail if the object's ETag matches the given value. This is useful for
  8860. // getting updates only after the object has changed since the last
  8861. // request. Use googleapi.IsNotModified to check whether the response
  8862. // error from Do is the result of In-None-Match.
  8863. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  8864. c.ifNoneMatch_ = entityTag
  8865. return c
  8866. }
  8867. // Context sets the context to be used in this call's Do method. Any
  8868. // pending HTTP request will be aborted if the provided context is
  8869. // canceled.
  8870. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  8871. c.ctx_ = ctx
  8872. return c
  8873. }
  8874. // Header returns an http.Header that can be modified by the caller to
  8875. // add HTTP headers to the request.
  8876. func (c *ProjectsZonesClustersListCall) Header() http.Header {
  8877. if c.header_ == nil {
  8878. c.header_ = make(http.Header)
  8879. }
  8880. return c.header_
  8881. }
  8882. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  8883. reqHeaders := make(http.Header)
  8884. for k, v := range c.header_ {
  8885. reqHeaders[k] = v
  8886. }
  8887. reqHeaders.Set("User-Agent", c.s.userAgent())
  8888. if c.ifNoneMatch_ != "" {
  8889. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8890. }
  8891. var body io.Reader = nil
  8892. c.urlParams_.Set("alt", alt)
  8893. c.urlParams_.Set("prettyPrint", "false")
  8894. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  8895. urls += "?" + c.urlParams_.Encode()
  8896. req, err := http.NewRequest("GET", urls, body)
  8897. if err != nil {
  8898. return nil, err
  8899. }
  8900. req.Header = reqHeaders
  8901. googleapi.Expand(req.URL, map[string]string{
  8902. "projectId": c.projectId,
  8903. "zone": c.zone,
  8904. })
  8905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8906. }
  8907. // Do executes the "container.projects.zones.clusters.list" call.
  8908. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  8909. // non-2xx status code is an error. Response headers are in either
  8910. // *ListClustersResponse.ServerResponse.Header or (if a response was
  8911. // returned at all) in error.(*googleapi.Error).Header. Use
  8912. // googleapi.IsNotModified to check whether the returned error was
  8913. // because http.StatusNotModified was returned.
  8914. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  8915. gensupport.SetOptions(c.urlParams_, opts...)
  8916. res, err := c.doRequest("json")
  8917. if res != nil && res.StatusCode == http.StatusNotModified {
  8918. if res.Body != nil {
  8919. res.Body.Close()
  8920. }
  8921. return nil, &googleapi.Error{
  8922. Code: res.StatusCode,
  8923. Header: res.Header,
  8924. }
  8925. }
  8926. if err != nil {
  8927. return nil, err
  8928. }
  8929. defer googleapi.CloseBody(res)
  8930. if err := googleapi.CheckResponse(res); err != nil {
  8931. return nil, err
  8932. }
  8933. ret := &ListClustersResponse{
  8934. ServerResponse: googleapi.ServerResponse{
  8935. Header: res.Header,
  8936. HTTPStatusCode: res.StatusCode,
  8937. },
  8938. }
  8939. target := &ret
  8940. if err := gensupport.DecodeResponse(target, res); err != nil {
  8941. return nil, err
  8942. }
  8943. return ret, nil
  8944. // {
  8945. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  8946. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  8947. // "httpMethod": "GET",
  8948. // "id": "container.projects.zones.clusters.list",
  8949. // "parameterOrder": [
  8950. // "projectId",
  8951. // "zone"
  8952. // ],
  8953. // "parameters": {
  8954. // "parent": {
  8955. // "description": "The parent (project and location) where the clusters will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  8956. // "location": "query",
  8957. // "type": "string"
  8958. // },
  8959. // "projectId": {
  8960. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  8961. // "location": "path",
  8962. // "required": true,
  8963. // "type": "string"
  8964. // },
  8965. // "zone": {
  8966. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides, or \"-\" for all zones.\nThis field has been deprecated and replaced by the parent field.",
  8967. // "location": "path",
  8968. // "required": true,
  8969. // "type": "string"
  8970. // }
  8971. // },
  8972. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  8973. // "response": {
  8974. // "$ref": "ListClustersResponse"
  8975. // },
  8976. // "scopes": [
  8977. // "https://www.googleapis.com/auth/cloud-platform"
  8978. // ]
  8979. // }
  8980. }
  8981. // method id "container.projects.zones.clusters.locations":
  8982. type ProjectsZonesClustersLocationsCall struct {
  8983. s *Service
  8984. projectId string
  8985. zone string
  8986. clusterId string
  8987. setlocationsrequest *SetLocationsRequest
  8988. urlParams_ gensupport.URLParams
  8989. ctx_ context.Context
  8990. header_ http.Header
  8991. }
  8992. // Locations: Sets the locations for a specific cluster.
  8993. func (r *ProjectsZonesClustersService) Locations(projectId string, zone string, clusterId string, setlocationsrequest *SetLocationsRequest) *ProjectsZonesClustersLocationsCall {
  8994. c := &ProjectsZonesClustersLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8995. c.projectId = projectId
  8996. c.zone = zone
  8997. c.clusterId = clusterId
  8998. c.setlocationsrequest = setlocationsrequest
  8999. return c
  9000. }
  9001. // Fields allows partial responses to be retrieved. See
  9002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9003. // for more information.
  9004. func (c *ProjectsZonesClustersLocationsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLocationsCall {
  9005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9006. return c
  9007. }
  9008. // Context sets the context to be used in this call's Do method. Any
  9009. // pending HTTP request will be aborted if the provided context is
  9010. // canceled.
  9011. func (c *ProjectsZonesClustersLocationsCall) Context(ctx context.Context) *ProjectsZonesClustersLocationsCall {
  9012. c.ctx_ = ctx
  9013. return c
  9014. }
  9015. // Header returns an http.Header that can be modified by the caller to
  9016. // add HTTP headers to the request.
  9017. func (c *ProjectsZonesClustersLocationsCall) Header() http.Header {
  9018. if c.header_ == nil {
  9019. c.header_ = make(http.Header)
  9020. }
  9021. return c.header_
  9022. }
  9023. func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) {
  9024. reqHeaders := make(http.Header)
  9025. for k, v := range c.header_ {
  9026. reqHeaders[k] = v
  9027. }
  9028. reqHeaders.Set("User-Agent", c.s.userAgent())
  9029. var body io.Reader = nil
  9030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  9031. if err != nil {
  9032. return nil, err
  9033. }
  9034. reqHeaders.Set("Content-Type", "application/json")
  9035. c.urlParams_.Set("alt", alt)
  9036. c.urlParams_.Set("prettyPrint", "false")
  9037. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations")
  9038. urls += "?" + c.urlParams_.Encode()
  9039. req, err := http.NewRequest("POST", urls, body)
  9040. if err != nil {
  9041. return nil, err
  9042. }
  9043. req.Header = reqHeaders
  9044. googleapi.Expand(req.URL, map[string]string{
  9045. "projectId": c.projectId,
  9046. "zone": c.zone,
  9047. "clusterId": c.clusterId,
  9048. })
  9049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9050. }
  9051. // Do executes the "container.projects.zones.clusters.locations" call.
  9052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9053. // status code is an error. Response headers are in either
  9054. // *Operation.ServerResponse.Header or (if a response was returned at
  9055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9056. // to check whether the returned error was because
  9057. // http.StatusNotModified was returned.
  9058. func (c *ProjectsZonesClustersLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9059. gensupport.SetOptions(c.urlParams_, opts...)
  9060. res, err := c.doRequest("json")
  9061. if res != nil && res.StatusCode == http.StatusNotModified {
  9062. if res.Body != nil {
  9063. res.Body.Close()
  9064. }
  9065. return nil, &googleapi.Error{
  9066. Code: res.StatusCode,
  9067. Header: res.Header,
  9068. }
  9069. }
  9070. if err != nil {
  9071. return nil, err
  9072. }
  9073. defer googleapi.CloseBody(res)
  9074. if err := googleapi.CheckResponse(res); err != nil {
  9075. return nil, err
  9076. }
  9077. ret := &Operation{
  9078. ServerResponse: googleapi.ServerResponse{
  9079. Header: res.Header,
  9080. HTTPStatusCode: res.StatusCode,
  9081. },
  9082. }
  9083. target := &ret
  9084. if err := gensupport.DecodeResponse(target, res); err != nil {
  9085. return nil, err
  9086. }
  9087. return ret, nil
  9088. // {
  9089. // "description": "Sets the locations for a specific cluster.",
  9090. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9091. // "httpMethod": "POST",
  9092. // "id": "container.projects.zones.clusters.locations",
  9093. // "parameterOrder": [
  9094. // "projectId",
  9095. // "zone",
  9096. // "clusterId"
  9097. // ],
  9098. // "parameters": {
  9099. // "clusterId": {
  9100. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9101. // "location": "path",
  9102. // "required": true,
  9103. // "type": "string"
  9104. // },
  9105. // "projectId": {
  9106. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9107. // "location": "path",
  9108. // "required": true,
  9109. // "type": "string"
  9110. // },
  9111. // "zone": {
  9112. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9113. // "location": "path",
  9114. // "required": true,
  9115. // "type": "string"
  9116. // }
  9117. // },
  9118. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  9119. // "request": {
  9120. // "$ref": "SetLocationsRequest"
  9121. // },
  9122. // "response": {
  9123. // "$ref": "Operation"
  9124. // },
  9125. // "scopes": [
  9126. // "https://www.googleapis.com/auth/cloud-platform"
  9127. // ]
  9128. // }
  9129. }
  9130. // method id "container.projects.zones.clusters.logging":
  9131. type ProjectsZonesClustersLoggingCall struct {
  9132. s *Service
  9133. projectId string
  9134. zone string
  9135. clusterId string
  9136. setloggingservicerequest *SetLoggingServiceRequest
  9137. urlParams_ gensupport.URLParams
  9138. ctx_ context.Context
  9139. header_ http.Header
  9140. }
  9141. // Logging: Sets the logging service for a specific cluster.
  9142. func (r *ProjectsZonesClustersService) Logging(projectId string, zone string, clusterId string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsZonesClustersLoggingCall {
  9143. c := &ProjectsZonesClustersLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9144. c.projectId = projectId
  9145. c.zone = zone
  9146. c.clusterId = clusterId
  9147. c.setloggingservicerequest = setloggingservicerequest
  9148. return c
  9149. }
  9150. // Fields allows partial responses to be retrieved. See
  9151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9152. // for more information.
  9153. func (c *ProjectsZonesClustersLoggingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLoggingCall {
  9154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9155. return c
  9156. }
  9157. // Context sets the context to be used in this call's Do method. Any
  9158. // pending HTTP request will be aborted if the provided context is
  9159. // canceled.
  9160. func (c *ProjectsZonesClustersLoggingCall) Context(ctx context.Context) *ProjectsZonesClustersLoggingCall {
  9161. c.ctx_ = ctx
  9162. return c
  9163. }
  9164. // Header returns an http.Header that can be modified by the caller to
  9165. // add HTTP headers to the request.
  9166. func (c *ProjectsZonesClustersLoggingCall) Header() http.Header {
  9167. if c.header_ == nil {
  9168. c.header_ = make(http.Header)
  9169. }
  9170. return c.header_
  9171. }
  9172. func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) {
  9173. reqHeaders := make(http.Header)
  9174. for k, v := range c.header_ {
  9175. reqHeaders[k] = v
  9176. }
  9177. reqHeaders.Set("User-Agent", c.s.userAgent())
  9178. var body io.Reader = nil
  9179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  9180. if err != nil {
  9181. return nil, err
  9182. }
  9183. reqHeaders.Set("Content-Type", "application/json")
  9184. c.urlParams_.Set("alt", alt)
  9185. c.urlParams_.Set("prettyPrint", "false")
  9186. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging")
  9187. urls += "?" + c.urlParams_.Encode()
  9188. req, err := http.NewRequest("POST", urls, body)
  9189. if err != nil {
  9190. return nil, err
  9191. }
  9192. req.Header = reqHeaders
  9193. googleapi.Expand(req.URL, map[string]string{
  9194. "projectId": c.projectId,
  9195. "zone": c.zone,
  9196. "clusterId": c.clusterId,
  9197. })
  9198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9199. }
  9200. // Do executes the "container.projects.zones.clusters.logging" call.
  9201. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9202. // status code is an error. Response headers are in either
  9203. // *Operation.ServerResponse.Header or (if a response was returned at
  9204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9205. // to check whether the returned error was because
  9206. // http.StatusNotModified was returned.
  9207. func (c *ProjectsZonesClustersLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9208. gensupport.SetOptions(c.urlParams_, opts...)
  9209. res, err := c.doRequest("json")
  9210. if res != nil && res.StatusCode == http.StatusNotModified {
  9211. if res.Body != nil {
  9212. res.Body.Close()
  9213. }
  9214. return nil, &googleapi.Error{
  9215. Code: res.StatusCode,
  9216. Header: res.Header,
  9217. }
  9218. }
  9219. if err != nil {
  9220. return nil, err
  9221. }
  9222. defer googleapi.CloseBody(res)
  9223. if err := googleapi.CheckResponse(res); err != nil {
  9224. return nil, err
  9225. }
  9226. ret := &Operation{
  9227. ServerResponse: googleapi.ServerResponse{
  9228. Header: res.Header,
  9229. HTTPStatusCode: res.StatusCode,
  9230. },
  9231. }
  9232. target := &ret
  9233. if err := gensupport.DecodeResponse(target, res); err != nil {
  9234. return nil, err
  9235. }
  9236. return ret, nil
  9237. // {
  9238. // "description": "Sets the logging service for a specific cluster.",
  9239. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9240. // "httpMethod": "POST",
  9241. // "id": "container.projects.zones.clusters.logging",
  9242. // "parameterOrder": [
  9243. // "projectId",
  9244. // "zone",
  9245. // "clusterId"
  9246. // ],
  9247. // "parameters": {
  9248. // "clusterId": {
  9249. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9250. // "location": "path",
  9251. // "required": true,
  9252. // "type": "string"
  9253. // },
  9254. // "projectId": {
  9255. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9256. // "location": "path",
  9257. // "required": true,
  9258. // "type": "string"
  9259. // },
  9260. // "zone": {
  9261. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9262. // "location": "path",
  9263. // "required": true,
  9264. // "type": "string"
  9265. // }
  9266. // },
  9267. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  9268. // "request": {
  9269. // "$ref": "SetLoggingServiceRequest"
  9270. // },
  9271. // "response": {
  9272. // "$ref": "Operation"
  9273. // },
  9274. // "scopes": [
  9275. // "https://www.googleapis.com/auth/cloud-platform"
  9276. // ]
  9277. // }
  9278. }
  9279. // method id "container.projects.zones.clusters.master":
  9280. type ProjectsZonesClustersMasterCall struct {
  9281. s *Service
  9282. projectId string
  9283. zone string
  9284. clusterId string
  9285. updatemasterrequest *UpdateMasterRequest
  9286. urlParams_ gensupport.URLParams
  9287. ctx_ context.Context
  9288. header_ http.Header
  9289. }
  9290. // Master: Updates the master for a specific cluster.
  9291. func (r *ProjectsZonesClustersService) Master(projectId string, zone string, clusterId string, updatemasterrequest *UpdateMasterRequest) *ProjectsZonesClustersMasterCall {
  9292. c := &ProjectsZonesClustersMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9293. c.projectId = projectId
  9294. c.zone = zone
  9295. c.clusterId = clusterId
  9296. c.updatemasterrequest = updatemasterrequest
  9297. return c
  9298. }
  9299. // Fields allows partial responses to be retrieved. See
  9300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9301. // for more information.
  9302. func (c *ProjectsZonesClustersMasterCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMasterCall {
  9303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9304. return c
  9305. }
  9306. // Context sets the context to be used in this call's Do method. Any
  9307. // pending HTTP request will be aborted if the provided context is
  9308. // canceled.
  9309. func (c *ProjectsZonesClustersMasterCall) Context(ctx context.Context) *ProjectsZonesClustersMasterCall {
  9310. c.ctx_ = ctx
  9311. return c
  9312. }
  9313. // Header returns an http.Header that can be modified by the caller to
  9314. // add HTTP headers to the request.
  9315. func (c *ProjectsZonesClustersMasterCall) Header() http.Header {
  9316. if c.header_ == nil {
  9317. c.header_ = make(http.Header)
  9318. }
  9319. return c.header_
  9320. }
  9321. func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) {
  9322. reqHeaders := make(http.Header)
  9323. for k, v := range c.header_ {
  9324. reqHeaders[k] = v
  9325. }
  9326. reqHeaders.Set("User-Agent", c.s.userAgent())
  9327. var body io.Reader = nil
  9328. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  9329. if err != nil {
  9330. return nil, err
  9331. }
  9332. reqHeaders.Set("Content-Type", "application/json")
  9333. c.urlParams_.Set("alt", alt)
  9334. c.urlParams_.Set("prettyPrint", "false")
  9335. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master")
  9336. urls += "?" + c.urlParams_.Encode()
  9337. req, err := http.NewRequest("POST", urls, body)
  9338. if err != nil {
  9339. return nil, err
  9340. }
  9341. req.Header = reqHeaders
  9342. googleapi.Expand(req.URL, map[string]string{
  9343. "projectId": c.projectId,
  9344. "zone": c.zone,
  9345. "clusterId": c.clusterId,
  9346. })
  9347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9348. }
  9349. // Do executes the "container.projects.zones.clusters.master" call.
  9350. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9351. // status code is an error. Response headers are in either
  9352. // *Operation.ServerResponse.Header or (if a response was returned at
  9353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9354. // to check whether the returned error was because
  9355. // http.StatusNotModified was returned.
  9356. func (c *ProjectsZonesClustersMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9357. gensupport.SetOptions(c.urlParams_, opts...)
  9358. res, err := c.doRequest("json")
  9359. if res != nil && res.StatusCode == http.StatusNotModified {
  9360. if res.Body != nil {
  9361. res.Body.Close()
  9362. }
  9363. return nil, &googleapi.Error{
  9364. Code: res.StatusCode,
  9365. Header: res.Header,
  9366. }
  9367. }
  9368. if err != nil {
  9369. return nil, err
  9370. }
  9371. defer googleapi.CloseBody(res)
  9372. if err := googleapi.CheckResponse(res); err != nil {
  9373. return nil, err
  9374. }
  9375. ret := &Operation{
  9376. ServerResponse: googleapi.ServerResponse{
  9377. Header: res.Header,
  9378. HTTPStatusCode: res.StatusCode,
  9379. },
  9380. }
  9381. target := &ret
  9382. if err := gensupport.DecodeResponse(target, res); err != nil {
  9383. return nil, err
  9384. }
  9385. return ret, nil
  9386. // {
  9387. // "description": "Updates the master for a specific cluster.",
  9388. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9389. // "httpMethod": "POST",
  9390. // "id": "container.projects.zones.clusters.master",
  9391. // "parameterOrder": [
  9392. // "projectId",
  9393. // "zone",
  9394. // "clusterId"
  9395. // ],
  9396. // "parameters": {
  9397. // "clusterId": {
  9398. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9399. // "location": "path",
  9400. // "required": true,
  9401. // "type": "string"
  9402. // },
  9403. // "projectId": {
  9404. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9405. // "location": "path",
  9406. // "required": true,
  9407. // "type": "string"
  9408. // },
  9409. // "zone": {
  9410. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9411. // "location": "path",
  9412. // "required": true,
  9413. // "type": "string"
  9414. // }
  9415. // },
  9416. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  9417. // "request": {
  9418. // "$ref": "UpdateMasterRequest"
  9419. // },
  9420. // "response": {
  9421. // "$ref": "Operation"
  9422. // },
  9423. // "scopes": [
  9424. // "https://www.googleapis.com/auth/cloud-platform"
  9425. // ]
  9426. // }
  9427. }
  9428. // method id "container.projects.zones.clusters.monitoring":
  9429. type ProjectsZonesClustersMonitoringCall struct {
  9430. s *Service
  9431. projectId string
  9432. zone string
  9433. clusterId string
  9434. setmonitoringservicerequest *SetMonitoringServiceRequest
  9435. urlParams_ gensupport.URLParams
  9436. ctx_ context.Context
  9437. header_ http.Header
  9438. }
  9439. // Monitoring: Sets the monitoring service for a specific cluster.
  9440. func (r *ProjectsZonesClustersService) Monitoring(projectId string, zone string, clusterId string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsZonesClustersMonitoringCall {
  9441. c := &ProjectsZonesClustersMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9442. c.projectId = projectId
  9443. c.zone = zone
  9444. c.clusterId = clusterId
  9445. c.setmonitoringservicerequest = setmonitoringservicerequest
  9446. return c
  9447. }
  9448. // Fields allows partial responses to be retrieved. See
  9449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9450. // for more information.
  9451. func (c *ProjectsZonesClustersMonitoringCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMonitoringCall {
  9452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9453. return c
  9454. }
  9455. // Context sets the context to be used in this call's Do method. Any
  9456. // pending HTTP request will be aborted if the provided context is
  9457. // canceled.
  9458. func (c *ProjectsZonesClustersMonitoringCall) Context(ctx context.Context) *ProjectsZonesClustersMonitoringCall {
  9459. c.ctx_ = ctx
  9460. return c
  9461. }
  9462. // Header returns an http.Header that can be modified by the caller to
  9463. // add HTTP headers to the request.
  9464. func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header {
  9465. if c.header_ == nil {
  9466. c.header_ = make(http.Header)
  9467. }
  9468. return c.header_
  9469. }
  9470. func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) {
  9471. reqHeaders := make(http.Header)
  9472. for k, v := range c.header_ {
  9473. reqHeaders[k] = v
  9474. }
  9475. reqHeaders.Set("User-Agent", c.s.userAgent())
  9476. var body io.Reader = nil
  9477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  9478. if err != nil {
  9479. return nil, err
  9480. }
  9481. reqHeaders.Set("Content-Type", "application/json")
  9482. c.urlParams_.Set("alt", alt)
  9483. c.urlParams_.Set("prettyPrint", "false")
  9484. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring")
  9485. urls += "?" + c.urlParams_.Encode()
  9486. req, err := http.NewRequest("POST", urls, body)
  9487. if err != nil {
  9488. return nil, err
  9489. }
  9490. req.Header = reqHeaders
  9491. googleapi.Expand(req.URL, map[string]string{
  9492. "projectId": c.projectId,
  9493. "zone": c.zone,
  9494. "clusterId": c.clusterId,
  9495. })
  9496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9497. }
  9498. // Do executes the "container.projects.zones.clusters.monitoring" call.
  9499. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9500. // status code is an error. Response headers are in either
  9501. // *Operation.ServerResponse.Header or (if a response was returned at
  9502. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9503. // to check whether the returned error was because
  9504. // http.StatusNotModified was returned.
  9505. func (c *ProjectsZonesClustersMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9506. gensupport.SetOptions(c.urlParams_, opts...)
  9507. res, err := c.doRequest("json")
  9508. if res != nil && res.StatusCode == http.StatusNotModified {
  9509. if res.Body != nil {
  9510. res.Body.Close()
  9511. }
  9512. return nil, &googleapi.Error{
  9513. Code: res.StatusCode,
  9514. Header: res.Header,
  9515. }
  9516. }
  9517. if err != nil {
  9518. return nil, err
  9519. }
  9520. defer googleapi.CloseBody(res)
  9521. if err := googleapi.CheckResponse(res); err != nil {
  9522. return nil, err
  9523. }
  9524. ret := &Operation{
  9525. ServerResponse: googleapi.ServerResponse{
  9526. Header: res.Header,
  9527. HTTPStatusCode: res.StatusCode,
  9528. },
  9529. }
  9530. target := &ret
  9531. if err := gensupport.DecodeResponse(target, res); err != nil {
  9532. return nil, err
  9533. }
  9534. return ret, nil
  9535. // {
  9536. // "description": "Sets the monitoring service for a specific cluster.",
  9537. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9538. // "httpMethod": "POST",
  9539. // "id": "container.projects.zones.clusters.monitoring",
  9540. // "parameterOrder": [
  9541. // "projectId",
  9542. // "zone",
  9543. // "clusterId"
  9544. // ],
  9545. // "parameters": {
  9546. // "clusterId": {
  9547. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9548. // "location": "path",
  9549. // "required": true,
  9550. // "type": "string"
  9551. // },
  9552. // "projectId": {
  9553. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  9554. // "location": "path",
  9555. // "required": true,
  9556. // "type": "string"
  9557. // },
  9558. // "zone": {
  9559. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9560. // "location": "path",
  9561. // "required": true,
  9562. // "type": "string"
  9563. // }
  9564. // },
  9565. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  9566. // "request": {
  9567. // "$ref": "SetMonitoringServiceRequest"
  9568. // },
  9569. // "response": {
  9570. // "$ref": "Operation"
  9571. // },
  9572. // "scopes": [
  9573. // "https://www.googleapis.com/auth/cloud-platform"
  9574. // ]
  9575. // }
  9576. }
  9577. // method id "container.projects.zones.clusters.resourceLabels":
  9578. type ProjectsZonesClustersResourceLabelsCall struct {
  9579. s *Service
  9580. projectId string
  9581. zone string
  9582. clusterId string
  9583. setlabelsrequest *SetLabelsRequest
  9584. urlParams_ gensupport.URLParams
  9585. ctx_ context.Context
  9586. header_ http.Header
  9587. }
  9588. // ResourceLabels: Sets labels on a cluster.
  9589. func (r *ProjectsZonesClustersService) ResourceLabels(projectId string, zone string, clusterId string, setlabelsrequest *SetLabelsRequest) *ProjectsZonesClustersResourceLabelsCall {
  9590. c := &ProjectsZonesClustersResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9591. c.projectId = projectId
  9592. c.zone = zone
  9593. c.clusterId = clusterId
  9594. c.setlabelsrequest = setlabelsrequest
  9595. return c
  9596. }
  9597. // Fields allows partial responses to be retrieved. See
  9598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9599. // for more information.
  9600. func (c *ProjectsZonesClustersResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersResourceLabelsCall {
  9601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9602. return c
  9603. }
  9604. // Context sets the context to be used in this call's Do method. Any
  9605. // pending HTTP request will be aborted if the provided context is
  9606. // canceled.
  9607. func (c *ProjectsZonesClustersResourceLabelsCall) Context(ctx context.Context) *ProjectsZonesClustersResourceLabelsCall {
  9608. c.ctx_ = ctx
  9609. return c
  9610. }
  9611. // Header returns an http.Header that can be modified by the caller to
  9612. // add HTTP headers to the request.
  9613. func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header {
  9614. if c.header_ == nil {
  9615. c.header_ = make(http.Header)
  9616. }
  9617. return c.header_
  9618. }
  9619. func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  9620. reqHeaders := make(http.Header)
  9621. for k, v := range c.header_ {
  9622. reqHeaders[k] = v
  9623. }
  9624. reqHeaders.Set("User-Agent", c.s.userAgent())
  9625. var body io.Reader = nil
  9626. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  9627. if err != nil {
  9628. return nil, err
  9629. }
  9630. reqHeaders.Set("Content-Type", "application/json")
  9631. c.urlParams_.Set("alt", alt)
  9632. c.urlParams_.Set("prettyPrint", "false")
  9633. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels")
  9634. urls += "?" + c.urlParams_.Encode()
  9635. req, err := http.NewRequest("POST", urls, body)
  9636. if err != nil {
  9637. return nil, err
  9638. }
  9639. req.Header = reqHeaders
  9640. googleapi.Expand(req.URL, map[string]string{
  9641. "projectId": c.projectId,
  9642. "zone": c.zone,
  9643. "clusterId": c.clusterId,
  9644. })
  9645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9646. }
  9647. // Do executes the "container.projects.zones.clusters.resourceLabels" call.
  9648. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9649. // status code is an error. Response headers are in either
  9650. // *Operation.ServerResponse.Header or (if a response was returned at
  9651. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9652. // to check whether the returned error was because
  9653. // http.StatusNotModified was returned.
  9654. func (c *ProjectsZonesClustersResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9655. gensupport.SetOptions(c.urlParams_, opts...)
  9656. res, err := c.doRequest("json")
  9657. if res != nil && res.StatusCode == http.StatusNotModified {
  9658. if res.Body != nil {
  9659. res.Body.Close()
  9660. }
  9661. return nil, &googleapi.Error{
  9662. Code: res.StatusCode,
  9663. Header: res.Header,
  9664. }
  9665. }
  9666. if err != nil {
  9667. return nil, err
  9668. }
  9669. defer googleapi.CloseBody(res)
  9670. if err := googleapi.CheckResponse(res); err != nil {
  9671. return nil, err
  9672. }
  9673. ret := &Operation{
  9674. ServerResponse: googleapi.ServerResponse{
  9675. Header: res.Header,
  9676. HTTPStatusCode: res.StatusCode,
  9677. },
  9678. }
  9679. target := &ret
  9680. if err := gensupport.DecodeResponse(target, res); err != nil {
  9681. return nil, err
  9682. }
  9683. return ret, nil
  9684. // {
  9685. // "description": "Sets labels on a cluster.",
  9686. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  9687. // "httpMethod": "POST",
  9688. // "id": "container.projects.zones.clusters.resourceLabels",
  9689. // "parameterOrder": [
  9690. // "projectId",
  9691. // "zone",
  9692. // "clusterId"
  9693. // ],
  9694. // "parameters": {
  9695. // "clusterId": {
  9696. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  9697. // "location": "path",
  9698. // "required": true,
  9699. // "type": "string"
  9700. // },
  9701. // "projectId": {
  9702. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  9703. // "location": "path",
  9704. // "required": true,
  9705. // "type": "string"
  9706. // },
  9707. // "zone": {
  9708. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  9709. // "location": "path",
  9710. // "required": true,
  9711. // "type": "string"
  9712. // }
  9713. // },
  9714. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  9715. // "request": {
  9716. // "$ref": "SetLabelsRequest"
  9717. // },
  9718. // "response": {
  9719. // "$ref": "Operation"
  9720. // },
  9721. // "scopes": [
  9722. // "https://www.googleapis.com/auth/cloud-platform"
  9723. // ]
  9724. // }
  9725. }
  9726. // method id "container.projects.zones.clusters.setMaintenancePolicy":
  9727. type ProjectsZonesClustersSetMaintenancePolicyCall struct {
  9728. s *Service
  9729. projectId string
  9730. zone string
  9731. clusterId string
  9732. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  9733. urlParams_ gensupport.URLParams
  9734. ctx_ context.Context
  9735. header_ http.Header
  9736. }
  9737. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  9738. func (r *ProjectsZonesClustersService) SetMaintenancePolicy(projectId string, zone string, clusterId string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9739. c := &ProjectsZonesClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9740. c.projectId = projectId
  9741. c.zone = zone
  9742. c.clusterId = clusterId
  9743. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  9744. return c
  9745. }
  9746. // Fields allows partial responses to be retrieved. See
  9747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9748. // for more information.
  9749. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9751. return c
  9752. }
  9753. // Context sets the context to be used in this call's Do method. Any
  9754. // pending HTTP request will be aborted if the provided context is
  9755. // canceled.
  9756. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetMaintenancePolicyCall {
  9757. c.ctx_ = ctx
  9758. return c
  9759. }
  9760. // Header returns an http.Header that can be modified by the caller to
  9761. // add HTTP headers to the request.
  9762. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header {
  9763. if c.header_ == nil {
  9764. c.header_ = make(http.Header)
  9765. }
  9766. return c.header_
  9767. }
  9768. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  9769. reqHeaders := make(http.Header)
  9770. for k, v := range c.header_ {
  9771. reqHeaders[k] = v
  9772. }
  9773. reqHeaders.Set("User-Agent", c.s.userAgent())
  9774. var body io.Reader = nil
  9775. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  9776. if err != nil {
  9777. return nil, err
  9778. }
  9779. reqHeaders.Set("Content-Type", "application/json")
  9780. c.urlParams_.Set("alt", alt)
  9781. c.urlParams_.Set("prettyPrint", "false")
  9782. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy")
  9783. urls += "?" + c.urlParams_.Encode()
  9784. req, err := http.NewRequest("POST", urls, body)
  9785. if err != nil {
  9786. return nil, err
  9787. }
  9788. req.Header = reqHeaders
  9789. googleapi.Expand(req.URL, map[string]string{
  9790. "projectId": c.projectId,
  9791. "zone": c.zone,
  9792. "clusterId": c.clusterId,
  9793. })
  9794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9795. }
  9796. // Do executes the "container.projects.zones.clusters.setMaintenancePolicy" call.
  9797. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9798. // status code is an error. Response headers are in either
  9799. // *Operation.ServerResponse.Header or (if a response was returned at
  9800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9801. // to check whether the returned error was because
  9802. // http.StatusNotModified was returned.
  9803. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9804. gensupport.SetOptions(c.urlParams_, opts...)
  9805. res, err := c.doRequest("json")
  9806. if res != nil && res.StatusCode == http.StatusNotModified {
  9807. if res.Body != nil {
  9808. res.Body.Close()
  9809. }
  9810. return nil, &googleapi.Error{
  9811. Code: res.StatusCode,
  9812. Header: res.Header,
  9813. }
  9814. }
  9815. if err != nil {
  9816. return nil, err
  9817. }
  9818. defer googleapi.CloseBody(res)
  9819. if err := googleapi.CheckResponse(res); err != nil {
  9820. return nil, err
  9821. }
  9822. ret := &Operation{
  9823. ServerResponse: googleapi.ServerResponse{
  9824. Header: res.Header,
  9825. HTTPStatusCode: res.StatusCode,
  9826. },
  9827. }
  9828. target := &ret
  9829. if err := gensupport.DecodeResponse(target, res); err != nil {
  9830. return nil, err
  9831. }
  9832. return ret, nil
  9833. // {
  9834. // "description": "Sets the maintenance policy for a cluster.",
  9835. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9836. // "httpMethod": "POST",
  9837. // "id": "container.projects.zones.clusters.setMaintenancePolicy",
  9838. // "parameterOrder": [
  9839. // "projectId",
  9840. // "zone",
  9841. // "clusterId"
  9842. // ],
  9843. // "parameters": {
  9844. // "clusterId": {
  9845. // "description": "The name of the cluster to update.",
  9846. // "location": "path",
  9847. // "required": true,
  9848. // "type": "string"
  9849. // },
  9850. // "projectId": {
  9851. // "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).",
  9852. // "location": "path",
  9853. // "required": true,
  9854. // "type": "string"
  9855. // },
  9856. // "zone": {
  9857. // "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.",
  9858. // "location": "path",
  9859. // "required": true,
  9860. // "type": "string"
  9861. // }
  9862. // },
  9863. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9864. // "request": {
  9865. // "$ref": "SetMaintenancePolicyRequest"
  9866. // },
  9867. // "response": {
  9868. // "$ref": "Operation"
  9869. // },
  9870. // "scopes": [
  9871. // "https://www.googleapis.com/auth/cloud-platform"
  9872. // ]
  9873. // }
  9874. }
  9875. // method id "container.projects.zones.clusters.setMasterAuth":
  9876. type ProjectsZonesClustersSetMasterAuthCall struct {
  9877. s *Service
  9878. projectId string
  9879. zone string
  9880. clusterId string
  9881. setmasterauthrequest *SetMasterAuthRequest
  9882. urlParams_ gensupport.URLParams
  9883. ctx_ context.Context
  9884. header_ http.Header
  9885. }
  9886. // SetMasterAuth: Used to set master auth materials. Currently supports
  9887. // :-
  9888. // Changing the admin password for a specific cluster.
  9889. // This can be either via password generation or explicitly set the
  9890. // password.
  9891. func (r *ProjectsZonesClustersService) SetMasterAuth(projectId string, zone string, clusterId string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsZonesClustersSetMasterAuthCall {
  9892. c := &ProjectsZonesClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9893. c.projectId = projectId
  9894. c.zone = zone
  9895. c.clusterId = clusterId
  9896. c.setmasterauthrequest = setmasterauthrequest
  9897. return c
  9898. }
  9899. // Fields allows partial responses to be retrieved. See
  9900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9901. // for more information.
  9902. func (c *ProjectsZonesClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMasterAuthCall {
  9903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9904. return c
  9905. }
  9906. // Context sets the context to be used in this call's Do method. Any
  9907. // pending HTTP request will be aborted if the provided context is
  9908. // canceled.
  9909. func (c *ProjectsZonesClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsZonesClustersSetMasterAuthCall {
  9910. c.ctx_ = ctx
  9911. return c
  9912. }
  9913. // Header returns an http.Header that can be modified by the caller to
  9914. // add HTTP headers to the request.
  9915. func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header {
  9916. if c.header_ == nil {
  9917. c.header_ = make(http.Header)
  9918. }
  9919. return c.header_
  9920. }
  9921. func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  9922. reqHeaders := make(http.Header)
  9923. for k, v := range c.header_ {
  9924. reqHeaders[k] = v
  9925. }
  9926. reqHeaders.Set("User-Agent", c.s.userAgent())
  9927. var body io.Reader = nil
  9928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  9929. if err != nil {
  9930. return nil, err
  9931. }
  9932. reqHeaders.Set("Content-Type", "application/json")
  9933. c.urlParams_.Set("alt", alt)
  9934. c.urlParams_.Set("prettyPrint", "false")
  9935. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth")
  9936. urls += "?" + c.urlParams_.Encode()
  9937. req, err := http.NewRequest("POST", urls, body)
  9938. if err != nil {
  9939. return nil, err
  9940. }
  9941. req.Header = reqHeaders
  9942. googleapi.Expand(req.URL, map[string]string{
  9943. "projectId": c.projectId,
  9944. "zone": c.zone,
  9945. "clusterId": c.clusterId,
  9946. })
  9947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9948. }
  9949. // Do executes the "container.projects.zones.clusters.setMasterAuth" call.
  9950. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9951. // status code is an error. Response headers are in either
  9952. // *Operation.ServerResponse.Header or (if a response was returned at
  9953. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9954. // to check whether the returned error was because
  9955. // http.StatusNotModified was returned.
  9956. func (c *ProjectsZonesClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9957. gensupport.SetOptions(c.urlParams_, opts...)
  9958. res, err := c.doRequest("json")
  9959. if res != nil && res.StatusCode == http.StatusNotModified {
  9960. if res.Body != nil {
  9961. res.Body.Close()
  9962. }
  9963. return nil, &googleapi.Error{
  9964. Code: res.StatusCode,
  9965. Header: res.Header,
  9966. }
  9967. }
  9968. if err != nil {
  9969. return nil, err
  9970. }
  9971. defer googleapi.CloseBody(res)
  9972. if err := googleapi.CheckResponse(res); err != nil {
  9973. return nil, err
  9974. }
  9975. ret := &Operation{
  9976. ServerResponse: googleapi.ServerResponse{
  9977. Header: res.Header,
  9978. HTTPStatusCode: res.StatusCode,
  9979. },
  9980. }
  9981. target := &ret
  9982. if err := gensupport.DecodeResponse(target, res); err != nil {
  9983. return nil, err
  9984. }
  9985. return ret, nil
  9986. // {
  9987. // "description": "Used to set master auth materials. Currently supports :-\nChanging the admin password for a specific cluster.\nThis can be either via password generation or explicitly set the password.",
  9988. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  9989. // "httpMethod": "POST",
  9990. // "id": "container.projects.zones.clusters.setMasterAuth",
  9991. // "parameterOrder": [
  9992. // "projectId",
  9993. // "zone",
  9994. // "clusterId"
  9995. // ],
  9996. // "parameters": {
  9997. // "clusterId": {
  9998. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9999. // "location": "path",
  10000. // "required": true,
  10001. // "type": "string"
  10002. // },
  10003. // "projectId": {
  10004. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  10005. // "location": "path",
  10006. // "required": true,
  10007. // "type": "string"
  10008. // },
  10009. // "zone": {
  10010. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10011. // "location": "path",
  10012. // "required": true,
  10013. // "type": "string"
  10014. // }
  10015. // },
  10016. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  10017. // "request": {
  10018. // "$ref": "SetMasterAuthRequest"
  10019. // },
  10020. // "response": {
  10021. // "$ref": "Operation"
  10022. // },
  10023. // "scopes": [
  10024. // "https://www.googleapis.com/auth/cloud-platform"
  10025. // ]
  10026. // }
  10027. }
  10028. // method id "container.projects.zones.clusters.setNetworkPolicy":
  10029. type ProjectsZonesClustersSetNetworkPolicyCall struct {
  10030. s *Service
  10031. projectId string
  10032. zone string
  10033. clusterId string
  10034. setnetworkpolicyrequest *SetNetworkPolicyRequest
  10035. urlParams_ gensupport.URLParams
  10036. ctx_ context.Context
  10037. header_ http.Header
  10038. }
  10039. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  10040. func (r *ProjectsZonesClustersService) SetNetworkPolicy(projectId string, zone string, clusterId string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsZonesClustersSetNetworkPolicyCall {
  10041. c := &ProjectsZonesClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10042. c.projectId = projectId
  10043. c.zone = zone
  10044. c.clusterId = clusterId
  10045. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  10046. return c
  10047. }
  10048. // Fields allows partial responses to be retrieved. See
  10049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10050. // for more information.
  10051. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetNetworkPolicyCall {
  10052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10053. return c
  10054. }
  10055. // Context sets the context to be used in this call's Do method. Any
  10056. // pending HTTP request will be aborted if the provided context is
  10057. // canceled.
  10058. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetNetworkPolicyCall {
  10059. c.ctx_ = ctx
  10060. return c
  10061. }
  10062. // Header returns an http.Header that can be modified by the caller to
  10063. // add HTTP headers to the request.
  10064. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header {
  10065. if c.header_ == nil {
  10066. c.header_ = make(http.Header)
  10067. }
  10068. return c.header_
  10069. }
  10070. func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  10071. reqHeaders := make(http.Header)
  10072. for k, v := range c.header_ {
  10073. reqHeaders[k] = v
  10074. }
  10075. reqHeaders.Set("User-Agent", c.s.userAgent())
  10076. var body io.Reader = nil
  10077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  10078. if err != nil {
  10079. return nil, err
  10080. }
  10081. reqHeaders.Set("Content-Type", "application/json")
  10082. c.urlParams_.Set("alt", alt)
  10083. c.urlParams_.Set("prettyPrint", "false")
  10084. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy")
  10085. urls += "?" + c.urlParams_.Encode()
  10086. req, err := http.NewRequest("POST", urls, body)
  10087. if err != nil {
  10088. return nil, err
  10089. }
  10090. req.Header = reqHeaders
  10091. googleapi.Expand(req.URL, map[string]string{
  10092. "projectId": c.projectId,
  10093. "zone": c.zone,
  10094. "clusterId": c.clusterId,
  10095. })
  10096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10097. }
  10098. // Do executes the "container.projects.zones.clusters.setNetworkPolicy" call.
  10099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10100. // status code is an error. Response headers are in either
  10101. // *Operation.ServerResponse.Header or (if a response was returned at
  10102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10103. // to check whether the returned error was because
  10104. // http.StatusNotModified was returned.
  10105. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10106. gensupport.SetOptions(c.urlParams_, opts...)
  10107. res, err := c.doRequest("json")
  10108. if res != nil && res.StatusCode == http.StatusNotModified {
  10109. if res.Body != nil {
  10110. res.Body.Close()
  10111. }
  10112. return nil, &googleapi.Error{
  10113. Code: res.StatusCode,
  10114. Header: res.Header,
  10115. }
  10116. }
  10117. if err != nil {
  10118. return nil, err
  10119. }
  10120. defer googleapi.CloseBody(res)
  10121. if err := googleapi.CheckResponse(res); err != nil {
  10122. return nil, err
  10123. }
  10124. ret := &Operation{
  10125. ServerResponse: googleapi.ServerResponse{
  10126. Header: res.Header,
  10127. HTTPStatusCode: res.StatusCode,
  10128. },
  10129. }
  10130. target := &ret
  10131. if err := gensupport.DecodeResponse(target, res); err != nil {
  10132. return nil, err
  10133. }
  10134. return ret, nil
  10135. // {
  10136. // "description": "Enables/Disables Network Policy for a cluster.",
  10137. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10138. // "httpMethod": "POST",
  10139. // "id": "container.projects.zones.clusters.setNetworkPolicy",
  10140. // "parameterOrder": [
  10141. // "projectId",
  10142. // "zone",
  10143. // "clusterId"
  10144. // ],
  10145. // "parameters": {
  10146. // "clusterId": {
  10147. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10148. // "location": "path",
  10149. // "required": true,
  10150. // "type": "string"
  10151. // },
  10152. // "projectId": {
  10153. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10154. // "location": "path",
  10155. // "required": true,
  10156. // "type": "string"
  10157. // },
  10158. // "zone": {
  10159. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10160. // "location": "path",
  10161. // "required": true,
  10162. // "type": "string"
  10163. // }
  10164. // },
  10165. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  10166. // "request": {
  10167. // "$ref": "SetNetworkPolicyRequest"
  10168. // },
  10169. // "response": {
  10170. // "$ref": "Operation"
  10171. // },
  10172. // "scopes": [
  10173. // "https://www.googleapis.com/auth/cloud-platform"
  10174. // ]
  10175. // }
  10176. }
  10177. // method id "container.projects.zones.clusters.startIpRotation":
  10178. type ProjectsZonesClustersStartIpRotationCall struct {
  10179. s *Service
  10180. projectId string
  10181. zone string
  10182. clusterId string
  10183. startiprotationrequest *StartIPRotationRequest
  10184. urlParams_ gensupport.URLParams
  10185. ctx_ context.Context
  10186. header_ http.Header
  10187. }
  10188. // StartIpRotation: Start master IP rotation.
  10189. func (r *ProjectsZonesClustersService) StartIpRotation(projectId string, zone string, clusterId string, startiprotationrequest *StartIPRotationRequest) *ProjectsZonesClustersStartIpRotationCall {
  10190. c := &ProjectsZonesClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10191. c.projectId = projectId
  10192. c.zone = zone
  10193. c.clusterId = clusterId
  10194. c.startiprotationrequest = startiprotationrequest
  10195. return c
  10196. }
  10197. // Fields allows partial responses to be retrieved. See
  10198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10199. // for more information.
  10200. func (c *ProjectsZonesClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersStartIpRotationCall {
  10201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10202. return c
  10203. }
  10204. // Context sets the context to be used in this call's Do method. Any
  10205. // pending HTTP request will be aborted if the provided context is
  10206. // canceled.
  10207. func (c *ProjectsZonesClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersStartIpRotationCall {
  10208. c.ctx_ = ctx
  10209. return c
  10210. }
  10211. // Header returns an http.Header that can be modified by the caller to
  10212. // add HTTP headers to the request.
  10213. func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header {
  10214. if c.header_ == nil {
  10215. c.header_ = make(http.Header)
  10216. }
  10217. return c.header_
  10218. }
  10219. func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  10220. reqHeaders := make(http.Header)
  10221. for k, v := range c.header_ {
  10222. reqHeaders[k] = v
  10223. }
  10224. reqHeaders.Set("User-Agent", c.s.userAgent())
  10225. var body io.Reader = nil
  10226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  10227. if err != nil {
  10228. return nil, err
  10229. }
  10230. reqHeaders.Set("Content-Type", "application/json")
  10231. c.urlParams_.Set("alt", alt)
  10232. c.urlParams_.Set("prettyPrint", "false")
  10233. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation")
  10234. urls += "?" + c.urlParams_.Encode()
  10235. req, err := http.NewRequest("POST", urls, body)
  10236. if err != nil {
  10237. return nil, err
  10238. }
  10239. req.Header = reqHeaders
  10240. googleapi.Expand(req.URL, map[string]string{
  10241. "projectId": c.projectId,
  10242. "zone": c.zone,
  10243. "clusterId": c.clusterId,
  10244. })
  10245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10246. }
  10247. // Do executes the "container.projects.zones.clusters.startIpRotation" call.
  10248. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10249. // status code is an error. Response headers are in either
  10250. // *Operation.ServerResponse.Header or (if a response was returned at
  10251. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10252. // to check whether the returned error was because
  10253. // http.StatusNotModified was returned.
  10254. func (c *ProjectsZonesClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10255. gensupport.SetOptions(c.urlParams_, opts...)
  10256. res, err := c.doRequest("json")
  10257. if res != nil && res.StatusCode == http.StatusNotModified {
  10258. if res.Body != nil {
  10259. res.Body.Close()
  10260. }
  10261. return nil, &googleapi.Error{
  10262. Code: res.StatusCode,
  10263. Header: res.Header,
  10264. }
  10265. }
  10266. if err != nil {
  10267. return nil, err
  10268. }
  10269. defer googleapi.CloseBody(res)
  10270. if err := googleapi.CheckResponse(res); err != nil {
  10271. return nil, err
  10272. }
  10273. ret := &Operation{
  10274. ServerResponse: googleapi.ServerResponse{
  10275. Header: res.Header,
  10276. HTTPStatusCode: res.StatusCode,
  10277. },
  10278. }
  10279. target := &ret
  10280. if err := gensupport.DecodeResponse(target, res); err != nil {
  10281. return nil, err
  10282. }
  10283. return ret, nil
  10284. // {
  10285. // "description": "Start master IP rotation.",
  10286. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10287. // "httpMethod": "POST",
  10288. // "id": "container.projects.zones.clusters.startIpRotation",
  10289. // "parameterOrder": [
  10290. // "projectId",
  10291. // "zone",
  10292. // "clusterId"
  10293. // ],
  10294. // "parameters": {
  10295. // "clusterId": {
  10296. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10297. // "location": "path",
  10298. // "required": true,
  10299. // "type": "string"
  10300. // },
  10301. // "projectId": {
  10302. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10303. // "location": "path",
  10304. // "required": true,
  10305. // "type": "string"
  10306. // },
  10307. // "zone": {
  10308. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10309. // "location": "path",
  10310. // "required": true,
  10311. // "type": "string"
  10312. // }
  10313. // },
  10314. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  10315. // "request": {
  10316. // "$ref": "StartIPRotationRequest"
  10317. // },
  10318. // "response": {
  10319. // "$ref": "Operation"
  10320. // },
  10321. // "scopes": [
  10322. // "https://www.googleapis.com/auth/cloud-platform"
  10323. // ]
  10324. // }
  10325. }
  10326. // method id "container.projects.zones.clusters.update":
  10327. type ProjectsZonesClustersUpdateCall struct {
  10328. s *Service
  10329. projectId string
  10330. zone string
  10331. clusterId string
  10332. updateclusterrequest *UpdateClusterRequest
  10333. urlParams_ gensupport.URLParams
  10334. ctx_ context.Context
  10335. header_ http.Header
  10336. }
  10337. // Update: Updates the settings of a specific cluster.
  10338. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  10339. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10340. c.projectId = projectId
  10341. c.zone = zone
  10342. c.clusterId = clusterId
  10343. c.updateclusterrequest = updateclusterrequest
  10344. return c
  10345. }
  10346. // Fields allows partial responses to be retrieved. See
  10347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10348. // for more information.
  10349. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  10350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10351. return c
  10352. }
  10353. // Context sets the context to be used in this call's Do method. Any
  10354. // pending HTTP request will be aborted if the provided context is
  10355. // canceled.
  10356. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  10357. c.ctx_ = ctx
  10358. return c
  10359. }
  10360. // Header returns an http.Header that can be modified by the caller to
  10361. // add HTTP headers to the request.
  10362. func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
  10363. if c.header_ == nil {
  10364. c.header_ = make(http.Header)
  10365. }
  10366. return c.header_
  10367. }
  10368. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  10369. reqHeaders := make(http.Header)
  10370. for k, v := range c.header_ {
  10371. reqHeaders[k] = v
  10372. }
  10373. reqHeaders.Set("User-Agent", c.s.userAgent())
  10374. var body io.Reader = nil
  10375. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  10376. if err != nil {
  10377. return nil, err
  10378. }
  10379. reqHeaders.Set("Content-Type", "application/json")
  10380. c.urlParams_.Set("alt", alt)
  10381. c.urlParams_.Set("prettyPrint", "false")
  10382. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  10383. urls += "?" + c.urlParams_.Encode()
  10384. req, err := http.NewRequest("PUT", urls, body)
  10385. if err != nil {
  10386. return nil, err
  10387. }
  10388. req.Header = reqHeaders
  10389. googleapi.Expand(req.URL, map[string]string{
  10390. "projectId": c.projectId,
  10391. "zone": c.zone,
  10392. "clusterId": c.clusterId,
  10393. })
  10394. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10395. }
  10396. // Do executes the "container.projects.zones.clusters.update" call.
  10397. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10398. // status code is an error. Response headers are in either
  10399. // *Operation.ServerResponse.Header or (if a response was returned at
  10400. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10401. // to check whether the returned error was because
  10402. // http.StatusNotModified was returned.
  10403. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10404. gensupport.SetOptions(c.urlParams_, opts...)
  10405. res, err := c.doRequest("json")
  10406. if res != nil && res.StatusCode == http.StatusNotModified {
  10407. if res.Body != nil {
  10408. res.Body.Close()
  10409. }
  10410. return nil, &googleapi.Error{
  10411. Code: res.StatusCode,
  10412. Header: res.Header,
  10413. }
  10414. }
  10415. if err != nil {
  10416. return nil, err
  10417. }
  10418. defer googleapi.CloseBody(res)
  10419. if err := googleapi.CheckResponse(res); err != nil {
  10420. return nil, err
  10421. }
  10422. ret := &Operation{
  10423. ServerResponse: googleapi.ServerResponse{
  10424. Header: res.Header,
  10425. HTTPStatusCode: res.StatusCode,
  10426. },
  10427. }
  10428. target := &ret
  10429. if err := gensupport.DecodeResponse(target, res); err != nil {
  10430. return nil, err
  10431. }
  10432. return ret, nil
  10433. // {
  10434. // "description": "Updates the settings of a specific cluster.",
  10435. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10436. // "httpMethod": "PUT",
  10437. // "id": "container.projects.zones.clusters.update",
  10438. // "parameterOrder": [
  10439. // "projectId",
  10440. // "zone",
  10441. // "clusterId"
  10442. // ],
  10443. // "parameters": {
  10444. // "clusterId": {
  10445. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10446. // "location": "path",
  10447. // "required": true,
  10448. // "type": "string"
  10449. // },
  10450. // "projectId": {
  10451. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  10452. // "location": "path",
  10453. // "required": true,
  10454. // "type": "string"
  10455. // },
  10456. // "zone": {
  10457. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10458. // "location": "path",
  10459. // "required": true,
  10460. // "type": "string"
  10461. // }
  10462. // },
  10463. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  10464. // "request": {
  10465. // "$ref": "UpdateClusterRequest"
  10466. // },
  10467. // "response": {
  10468. // "$ref": "Operation"
  10469. // },
  10470. // "scopes": [
  10471. // "https://www.googleapis.com/auth/cloud-platform"
  10472. // ]
  10473. // }
  10474. }
  10475. // method id "container.projects.zones.clusters.nodePools.autoscaling":
  10476. type ProjectsZonesClustersNodePoolsAutoscalingCall struct {
  10477. s *Service
  10478. projectId string
  10479. zone string
  10480. clusterId string
  10481. nodePoolId string
  10482. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  10483. urlParams_ gensupport.URLParams
  10484. ctx_ context.Context
  10485. header_ http.Header
  10486. }
  10487. // Autoscaling: Sets the autoscaling settings for a specific node pool.
  10488. func (r *ProjectsZonesClustersNodePoolsService) Autoscaling(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10489. c := &ProjectsZonesClustersNodePoolsAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10490. c.projectId = projectId
  10491. c.zone = zone
  10492. c.clusterId = clusterId
  10493. c.nodePoolId = nodePoolId
  10494. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  10495. return c
  10496. }
  10497. // Fields allows partial responses to be retrieved. See
  10498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10499. // for more information.
  10500. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10502. return c
  10503. }
  10504. // Context sets the context to be used in this call's Do method. Any
  10505. // pending HTTP request will be aborted if the provided context is
  10506. // canceled.
  10507. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  10508. c.ctx_ = ctx
  10509. return c
  10510. }
  10511. // Header returns an http.Header that can be modified by the caller to
  10512. // add HTTP headers to the request.
  10513. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header {
  10514. if c.header_ == nil {
  10515. c.header_ = make(http.Header)
  10516. }
  10517. return c.header_
  10518. }
  10519. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  10520. reqHeaders := make(http.Header)
  10521. for k, v := range c.header_ {
  10522. reqHeaders[k] = v
  10523. }
  10524. reqHeaders.Set("User-Agent", c.s.userAgent())
  10525. var body io.Reader = nil
  10526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  10527. if err != nil {
  10528. return nil, err
  10529. }
  10530. reqHeaders.Set("Content-Type", "application/json")
  10531. c.urlParams_.Set("alt", alt)
  10532. c.urlParams_.Set("prettyPrint", "false")
  10533. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling")
  10534. urls += "?" + c.urlParams_.Encode()
  10535. req, err := http.NewRequest("POST", urls, body)
  10536. if err != nil {
  10537. return nil, err
  10538. }
  10539. req.Header = reqHeaders
  10540. googleapi.Expand(req.URL, map[string]string{
  10541. "projectId": c.projectId,
  10542. "zone": c.zone,
  10543. "clusterId": c.clusterId,
  10544. "nodePoolId": c.nodePoolId,
  10545. })
  10546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10547. }
  10548. // Do executes the "container.projects.zones.clusters.nodePools.autoscaling" call.
  10549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10550. // status code is an error. Response headers are in either
  10551. // *Operation.ServerResponse.Header or (if a response was returned at
  10552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10553. // to check whether the returned error was because
  10554. // http.StatusNotModified was returned.
  10555. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10556. gensupport.SetOptions(c.urlParams_, opts...)
  10557. res, err := c.doRequest("json")
  10558. if res != nil && res.StatusCode == http.StatusNotModified {
  10559. if res.Body != nil {
  10560. res.Body.Close()
  10561. }
  10562. return nil, &googleapi.Error{
  10563. Code: res.StatusCode,
  10564. Header: res.Header,
  10565. }
  10566. }
  10567. if err != nil {
  10568. return nil, err
  10569. }
  10570. defer googleapi.CloseBody(res)
  10571. if err := googleapi.CheckResponse(res); err != nil {
  10572. return nil, err
  10573. }
  10574. ret := &Operation{
  10575. ServerResponse: googleapi.ServerResponse{
  10576. Header: res.Header,
  10577. HTTPStatusCode: res.StatusCode,
  10578. },
  10579. }
  10580. target := &ret
  10581. if err := gensupport.DecodeResponse(target, res); err != nil {
  10582. return nil, err
  10583. }
  10584. return ret, nil
  10585. // {
  10586. // "description": "Sets the autoscaling settings for a specific node pool.",
  10587. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  10588. // "httpMethod": "POST",
  10589. // "id": "container.projects.zones.clusters.nodePools.autoscaling",
  10590. // "parameterOrder": [
  10591. // "projectId",
  10592. // "zone",
  10593. // "clusterId",
  10594. // "nodePoolId"
  10595. // ],
  10596. // "parameters": {
  10597. // "clusterId": {
  10598. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10599. // "location": "path",
  10600. // "required": true,
  10601. // "type": "string"
  10602. // },
  10603. // "nodePoolId": {
  10604. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  10605. // "location": "path",
  10606. // "required": true,
  10607. // "type": "string"
  10608. // },
  10609. // "projectId": {
  10610. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  10611. // "location": "path",
  10612. // "required": true,
  10613. // "type": "string"
  10614. // },
  10615. // "zone": {
  10616. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10617. // "location": "path",
  10618. // "required": true,
  10619. // "type": "string"
  10620. // }
  10621. // },
  10622. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  10623. // "request": {
  10624. // "$ref": "SetNodePoolAutoscalingRequest"
  10625. // },
  10626. // "response": {
  10627. // "$ref": "Operation"
  10628. // },
  10629. // "scopes": [
  10630. // "https://www.googleapis.com/auth/cloud-platform"
  10631. // ]
  10632. // }
  10633. }
  10634. // method id "container.projects.zones.clusters.nodePools.create":
  10635. type ProjectsZonesClustersNodePoolsCreateCall struct {
  10636. s *Service
  10637. projectId string
  10638. zone string
  10639. clusterId string
  10640. createnodepoolrequest *CreateNodePoolRequest
  10641. urlParams_ gensupport.URLParams
  10642. ctx_ context.Context
  10643. header_ http.Header
  10644. }
  10645. // Create: Creates a node pool for a cluster.
  10646. func (r *ProjectsZonesClustersNodePoolsService) Create(projectId string, zone string, clusterId string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsZonesClustersNodePoolsCreateCall {
  10647. c := &ProjectsZonesClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10648. c.projectId = projectId
  10649. c.zone = zone
  10650. c.clusterId = clusterId
  10651. c.createnodepoolrequest = createnodepoolrequest
  10652. return c
  10653. }
  10654. // Fields allows partial responses to be retrieved. See
  10655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10656. // for more information.
  10657. func (c *ProjectsZonesClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsCreateCall {
  10658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10659. return c
  10660. }
  10661. // Context sets the context to be used in this call's Do method. Any
  10662. // pending HTTP request will be aborted if the provided context is
  10663. // canceled.
  10664. func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsCreateCall {
  10665. c.ctx_ = ctx
  10666. return c
  10667. }
  10668. // Header returns an http.Header that can be modified by the caller to
  10669. // add HTTP headers to the request.
  10670. func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
  10671. if c.header_ == nil {
  10672. c.header_ = make(http.Header)
  10673. }
  10674. return c.header_
  10675. }
  10676. func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  10677. reqHeaders := make(http.Header)
  10678. for k, v := range c.header_ {
  10679. reqHeaders[k] = v
  10680. }
  10681. reqHeaders.Set("User-Agent", c.s.userAgent())
  10682. var body io.Reader = nil
  10683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  10684. if err != nil {
  10685. return nil, err
  10686. }
  10687. reqHeaders.Set("Content-Type", "application/json")
  10688. c.urlParams_.Set("alt", alt)
  10689. c.urlParams_.Set("prettyPrint", "false")
  10690. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  10691. urls += "?" + c.urlParams_.Encode()
  10692. req, err := http.NewRequest("POST", urls, body)
  10693. if err != nil {
  10694. return nil, err
  10695. }
  10696. req.Header = reqHeaders
  10697. googleapi.Expand(req.URL, map[string]string{
  10698. "projectId": c.projectId,
  10699. "zone": c.zone,
  10700. "clusterId": c.clusterId,
  10701. })
  10702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10703. }
  10704. // Do executes the "container.projects.zones.clusters.nodePools.create" call.
  10705. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10706. // status code is an error. Response headers are in either
  10707. // *Operation.ServerResponse.Header or (if a response was returned at
  10708. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10709. // to check whether the returned error was because
  10710. // http.StatusNotModified was returned.
  10711. func (c *ProjectsZonesClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10712. gensupport.SetOptions(c.urlParams_, opts...)
  10713. res, err := c.doRequest("json")
  10714. if res != nil && res.StatusCode == http.StatusNotModified {
  10715. if res.Body != nil {
  10716. res.Body.Close()
  10717. }
  10718. return nil, &googleapi.Error{
  10719. Code: res.StatusCode,
  10720. Header: res.Header,
  10721. }
  10722. }
  10723. if err != nil {
  10724. return nil, err
  10725. }
  10726. defer googleapi.CloseBody(res)
  10727. if err := googleapi.CheckResponse(res); err != nil {
  10728. return nil, err
  10729. }
  10730. ret := &Operation{
  10731. ServerResponse: googleapi.ServerResponse{
  10732. Header: res.Header,
  10733. HTTPStatusCode: res.StatusCode,
  10734. },
  10735. }
  10736. target := &ret
  10737. if err := gensupport.DecodeResponse(target, res); err != nil {
  10738. return nil, err
  10739. }
  10740. return ret, nil
  10741. // {
  10742. // "description": "Creates a node pool for a cluster.",
  10743. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10744. // "httpMethod": "POST",
  10745. // "id": "container.projects.zones.clusters.nodePools.create",
  10746. // "parameterOrder": [
  10747. // "projectId",
  10748. // "zone",
  10749. // "clusterId"
  10750. // ],
  10751. // "parameters": {
  10752. // "clusterId": {
  10753. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  10754. // "location": "path",
  10755. // "required": true,
  10756. // "type": "string"
  10757. // },
  10758. // "projectId": {
  10759. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  10760. // "location": "path",
  10761. // "required": true,
  10762. // "type": "string"
  10763. // },
  10764. // "zone": {
  10765. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  10766. // "location": "path",
  10767. // "required": true,
  10768. // "type": "string"
  10769. // }
  10770. // },
  10771. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10772. // "request": {
  10773. // "$ref": "CreateNodePoolRequest"
  10774. // },
  10775. // "response": {
  10776. // "$ref": "Operation"
  10777. // },
  10778. // "scopes": [
  10779. // "https://www.googleapis.com/auth/cloud-platform"
  10780. // ]
  10781. // }
  10782. }
  10783. // method id "container.projects.zones.clusters.nodePools.delete":
  10784. type ProjectsZonesClustersNodePoolsDeleteCall struct {
  10785. s *Service
  10786. projectId string
  10787. zone string
  10788. clusterId string
  10789. nodePoolId string
  10790. urlParams_ gensupport.URLParams
  10791. ctx_ context.Context
  10792. header_ http.Header
  10793. }
  10794. // Delete: Deletes a node pool from a cluster.
  10795. func (r *ProjectsZonesClustersNodePoolsService) Delete(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsDeleteCall {
  10796. c := &ProjectsZonesClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10797. c.projectId = projectId
  10798. c.zone = zone
  10799. c.clusterId = clusterId
  10800. c.nodePoolId = nodePoolId
  10801. return c
  10802. }
  10803. // Name sets the optional parameter "name": The name (project, location,
  10804. // cluster, node pool id) of the node pool to
  10805. // delete. Specified in the
  10806. // format
  10807. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  10808. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Name(name string) *ProjectsZonesClustersNodePoolsDeleteCall {
  10809. c.urlParams_.Set("name", name)
  10810. return c
  10811. }
  10812. // Fields allows partial responses to be retrieved. See
  10813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10814. // for more information.
  10815. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsDeleteCall {
  10816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10817. return c
  10818. }
  10819. // Context sets the context to be used in this call's Do method. Any
  10820. // pending HTTP request will be aborted if the provided context is
  10821. // canceled.
  10822. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsDeleteCall {
  10823. c.ctx_ = ctx
  10824. return c
  10825. }
  10826. // Header returns an http.Header that can be modified by the caller to
  10827. // add HTTP headers to the request.
  10828. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
  10829. if c.header_ == nil {
  10830. c.header_ = make(http.Header)
  10831. }
  10832. return c.header_
  10833. }
  10834. func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10835. reqHeaders := make(http.Header)
  10836. for k, v := range c.header_ {
  10837. reqHeaders[k] = v
  10838. }
  10839. reqHeaders.Set("User-Agent", c.s.userAgent())
  10840. var body io.Reader = nil
  10841. c.urlParams_.Set("alt", alt)
  10842. c.urlParams_.Set("prettyPrint", "false")
  10843. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  10844. urls += "?" + c.urlParams_.Encode()
  10845. req, err := http.NewRequest("DELETE", urls, body)
  10846. if err != nil {
  10847. return nil, err
  10848. }
  10849. req.Header = reqHeaders
  10850. googleapi.Expand(req.URL, map[string]string{
  10851. "projectId": c.projectId,
  10852. "zone": c.zone,
  10853. "clusterId": c.clusterId,
  10854. "nodePoolId": c.nodePoolId,
  10855. })
  10856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10857. }
  10858. // Do executes the "container.projects.zones.clusters.nodePools.delete" call.
  10859. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10860. // status code is an error. Response headers are in either
  10861. // *Operation.ServerResponse.Header or (if a response was returned at
  10862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10863. // to check whether the returned error was because
  10864. // http.StatusNotModified was returned.
  10865. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10866. gensupport.SetOptions(c.urlParams_, opts...)
  10867. res, err := c.doRequest("json")
  10868. if res != nil && res.StatusCode == http.StatusNotModified {
  10869. if res.Body != nil {
  10870. res.Body.Close()
  10871. }
  10872. return nil, &googleapi.Error{
  10873. Code: res.StatusCode,
  10874. Header: res.Header,
  10875. }
  10876. }
  10877. if err != nil {
  10878. return nil, err
  10879. }
  10880. defer googleapi.CloseBody(res)
  10881. if err := googleapi.CheckResponse(res); err != nil {
  10882. return nil, err
  10883. }
  10884. ret := &Operation{
  10885. ServerResponse: googleapi.ServerResponse{
  10886. Header: res.Header,
  10887. HTTPStatusCode: res.StatusCode,
  10888. },
  10889. }
  10890. target := &ret
  10891. if err := gensupport.DecodeResponse(target, res); err != nil {
  10892. return nil, err
  10893. }
  10894. return ret, nil
  10895. // {
  10896. // "description": "Deletes a node pool from a cluster.",
  10897. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10898. // "httpMethod": "DELETE",
  10899. // "id": "container.projects.zones.clusters.nodePools.delete",
  10900. // "parameterOrder": [
  10901. // "projectId",
  10902. // "zone",
  10903. // "clusterId",
  10904. // "nodePoolId"
  10905. // ],
  10906. // "parameters": {
  10907. // "clusterId": {
  10908. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10909. // "location": "path",
  10910. // "required": true,
  10911. // "type": "string"
  10912. // },
  10913. // "name": {
  10914. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  10915. // "location": "query",
  10916. // "type": "string"
  10917. // },
  10918. // "nodePoolId": {
  10919. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  10920. // "location": "path",
  10921. // "required": true,
  10922. // "type": "string"
  10923. // },
  10924. // "projectId": {
  10925. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  10926. // "location": "path",
  10927. // "required": true,
  10928. // "type": "string"
  10929. // },
  10930. // "zone": {
  10931. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  10932. // "location": "path",
  10933. // "required": true,
  10934. // "type": "string"
  10935. // }
  10936. // },
  10937. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10938. // "response": {
  10939. // "$ref": "Operation"
  10940. // },
  10941. // "scopes": [
  10942. // "https://www.googleapis.com/auth/cloud-platform"
  10943. // ]
  10944. // }
  10945. }
  10946. // method id "container.projects.zones.clusters.nodePools.get":
  10947. type ProjectsZonesClustersNodePoolsGetCall struct {
  10948. s *Service
  10949. projectId string
  10950. zone string
  10951. clusterId string
  10952. nodePoolId string
  10953. urlParams_ gensupport.URLParams
  10954. ifNoneMatch_ string
  10955. ctx_ context.Context
  10956. header_ http.Header
  10957. }
  10958. // Get: Retrieves the node pool requested.
  10959. func (r *ProjectsZonesClustersNodePoolsService) Get(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsGetCall {
  10960. c := &ProjectsZonesClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10961. c.projectId = projectId
  10962. c.zone = zone
  10963. c.clusterId = clusterId
  10964. c.nodePoolId = nodePoolId
  10965. return c
  10966. }
  10967. // Name sets the optional parameter "name": The name (project, location,
  10968. // cluster, node pool id) of the node pool to
  10969. // get. Specified in the
  10970. // format
  10971. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  10972. func (c *ProjectsZonesClustersNodePoolsGetCall) Name(name string) *ProjectsZonesClustersNodePoolsGetCall {
  10973. c.urlParams_.Set("name", name)
  10974. return c
  10975. }
  10976. // Fields allows partial responses to be retrieved. See
  10977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10978. // for more information.
  10979. func (c *ProjectsZonesClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsGetCall {
  10980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10981. return c
  10982. }
  10983. // IfNoneMatch sets the optional parameter which makes the operation
  10984. // fail if the object's ETag matches the given value. This is useful for
  10985. // getting updates only after the object has changed since the last
  10986. // request. Use googleapi.IsNotModified to check whether the response
  10987. // error from Do is the result of In-None-Match.
  10988. func (c *ProjectsZonesClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsGetCall {
  10989. c.ifNoneMatch_ = entityTag
  10990. return c
  10991. }
  10992. // Context sets the context to be used in this call's Do method. Any
  10993. // pending HTTP request will be aborted if the provided context is
  10994. // canceled.
  10995. func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsGetCall {
  10996. c.ctx_ = ctx
  10997. return c
  10998. }
  10999. // Header returns an http.Header that can be modified by the caller to
  11000. // add HTTP headers to the request.
  11001. func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
  11002. if c.header_ == nil {
  11003. c.header_ = make(http.Header)
  11004. }
  11005. return c.header_
  11006. }
  11007. func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  11008. reqHeaders := make(http.Header)
  11009. for k, v := range c.header_ {
  11010. reqHeaders[k] = v
  11011. }
  11012. reqHeaders.Set("User-Agent", c.s.userAgent())
  11013. if c.ifNoneMatch_ != "" {
  11014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11015. }
  11016. var body io.Reader = nil
  11017. c.urlParams_.Set("alt", alt)
  11018. c.urlParams_.Set("prettyPrint", "false")
  11019. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  11020. urls += "?" + c.urlParams_.Encode()
  11021. req, err := http.NewRequest("GET", urls, body)
  11022. if err != nil {
  11023. return nil, err
  11024. }
  11025. req.Header = reqHeaders
  11026. googleapi.Expand(req.URL, map[string]string{
  11027. "projectId": c.projectId,
  11028. "zone": c.zone,
  11029. "clusterId": c.clusterId,
  11030. "nodePoolId": c.nodePoolId,
  11031. })
  11032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11033. }
  11034. // Do executes the "container.projects.zones.clusters.nodePools.get" call.
  11035. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  11036. // code is an error. Response headers are in either
  11037. // *NodePool.ServerResponse.Header or (if a response was returned at
  11038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11039. // to check whether the returned error was because
  11040. // http.StatusNotModified was returned.
  11041. func (c *ProjectsZonesClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  11042. gensupport.SetOptions(c.urlParams_, opts...)
  11043. res, err := c.doRequest("json")
  11044. if res != nil && res.StatusCode == http.StatusNotModified {
  11045. if res.Body != nil {
  11046. res.Body.Close()
  11047. }
  11048. return nil, &googleapi.Error{
  11049. Code: res.StatusCode,
  11050. Header: res.Header,
  11051. }
  11052. }
  11053. if err != nil {
  11054. return nil, err
  11055. }
  11056. defer googleapi.CloseBody(res)
  11057. if err := googleapi.CheckResponse(res); err != nil {
  11058. return nil, err
  11059. }
  11060. ret := &NodePool{
  11061. ServerResponse: googleapi.ServerResponse{
  11062. Header: res.Header,
  11063. HTTPStatusCode: res.StatusCode,
  11064. },
  11065. }
  11066. target := &ret
  11067. if err := gensupport.DecodeResponse(target, res); err != nil {
  11068. return nil, err
  11069. }
  11070. return ret, nil
  11071. // {
  11072. // "description": "Retrieves the node pool requested.",
  11073. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11074. // "httpMethod": "GET",
  11075. // "id": "container.projects.zones.clusters.nodePools.get",
  11076. // "parameterOrder": [
  11077. // "projectId",
  11078. // "zone",
  11079. // "clusterId",
  11080. // "nodePoolId"
  11081. // ],
  11082. // "parameters": {
  11083. // "clusterId": {
  11084. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  11085. // "location": "path",
  11086. // "required": true,
  11087. // "type": "string"
  11088. // },
  11089. // "name": {
  11090. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  11091. // "location": "query",
  11092. // "type": "string"
  11093. // },
  11094. // "nodePoolId": {
  11095. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  11096. // "location": "path",
  11097. // "required": true,
  11098. // "type": "string"
  11099. // },
  11100. // "projectId": {
  11101. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the name field.",
  11102. // "location": "path",
  11103. // "required": true,
  11104. // "type": "string"
  11105. // },
  11106. // "zone": {
  11107. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11108. // "location": "path",
  11109. // "required": true,
  11110. // "type": "string"
  11111. // }
  11112. // },
  11113. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  11114. // "response": {
  11115. // "$ref": "NodePool"
  11116. // },
  11117. // "scopes": [
  11118. // "https://www.googleapis.com/auth/cloud-platform"
  11119. // ]
  11120. // }
  11121. }
  11122. // method id "container.projects.zones.clusters.nodePools.list":
  11123. type ProjectsZonesClustersNodePoolsListCall struct {
  11124. s *Service
  11125. projectId string
  11126. zone string
  11127. clusterId string
  11128. urlParams_ gensupport.URLParams
  11129. ifNoneMatch_ string
  11130. ctx_ context.Context
  11131. header_ http.Header
  11132. }
  11133. // List: Lists the node pools for a cluster.
  11134. func (r *ProjectsZonesClustersNodePoolsService) List(projectId string, zone string, clusterId string) *ProjectsZonesClustersNodePoolsListCall {
  11135. c := &ProjectsZonesClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11136. c.projectId = projectId
  11137. c.zone = zone
  11138. c.clusterId = clusterId
  11139. return c
  11140. }
  11141. // Parent sets the optional parameter "parent": The parent (project,
  11142. // location, cluster id) where the node pools will be
  11143. // listed. Specified in the format 'projects/*/locations/*/clusters/*'.
  11144. func (c *ProjectsZonesClustersNodePoolsListCall) Parent(parent string) *ProjectsZonesClustersNodePoolsListCall {
  11145. c.urlParams_.Set("parent", parent)
  11146. return c
  11147. }
  11148. // Fields allows partial responses to be retrieved. See
  11149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11150. // for more information.
  11151. func (c *ProjectsZonesClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsListCall {
  11152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11153. return c
  11154. }
  11155. // IfNoneMatch sets the optional parameter which makes the operation
  11156. // fail if the object's ETag matches the given value. This is useful for
  11157. // getting updates only after the object has changed since the last
  11158. // request. Use googleapi.IsNotModified to check whether the response
  11159. // error from Do is the result of In-None-Match.
  11160. func (c *ProjectsZonesClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsListCall {
  11161. c.ifNoneMatch_ = entityTag
  11162. return c
  11163. }
  11164. // Context sets the context to be used in this call's Do method. Any
  11165. // pending HTTP request will be aborted if the provided context is
  11166. // canceled.
  11167. func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsListCall {
  11168. c.ctx_ = ctx
  11169. return c
  11170. }
  11171. // Header returns an http.Header that can be modified by the caller to
  11172. // add HTTP headers to the request.
  11173. func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
  11174. if c.header_ == nil {
  11175. c.header_ = make(http.Header)
  11176. }
  11177. return c.header_
  11178. }
  11179. func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  11180. reqHeaders := make(http.Header)
  11181. for k, v := range c.header_ {
  11182. reqHeaders[k] = v
  11183. }
  11184. reqHeaders.Set("User-Agent", c.s.userAgent())
  11185. if c.ifNoneMatch_ != "" {
  11186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11187. }
  11188. var body io.Reader = nil
  11189. c.urlParams_.Set("alt", alt)
  11190. c.urlParams_.Set("prettyPrint", "false")
  11191. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  11192. urls += "?" + c.urlParams_.Encode()
  11193. req, err := http.NewRequest("GET", urls, body)
  11194. if err != nil {
  11195. return nil, err
  11196. }
  11197. req.Header = reqHeaders
  11198. googleapi.Expand(req.URL, map[string]string{
  11199. "projectId": c.projectId,
  11200. "zone": c.zone,
  11201. "clusterId": c.clusterId,
  11202. })
  11203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11204. }
  11205. // Do executes the "container.projects.zones.clusters.nodePools.list" call.
  11206. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  11207. // non-2xx status code is an error. Response headers are in either
  11208. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  11209. // returned at all) in error.(*googleapi.Error).Header. Use
  11210. // googleapi.IsNotModified to check whether the returned error was
  11211. // because http.StatusNotModified was returned.
  11212. func (c *ProjectsZonesClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  11213. gensupport.SetOptions(c.urlParams_, opts...)
  11214. res, err := c.doRequest("json")
  11215. if res != nil && res.StatusCode == http.StatusNotModified {
  11216. if res.Body != nil {
  11217. res.Body.Close()
  11218. }
  11219. return nil, &googleapi.Error{
  11220. Code: res.StatusCode,
  11221. Header: res.Header,
  11222. }
  11223. }
  11224. if err != nil {
  11225. return nil, err
  11226. }
  11227. defer googleapi.CloseBody(res)
  11228. if err := googleapi.CheckResponse(res); err != nil {
  11229. return nil, err
  11230. }
  11231. ret := &ListNodePoolsResponse{
  11232. ServerResponse: googleapi.ServerResponse{
  11233. Header: res.Header,
  11234. HTTPStatusCode: res.StatusCode,
  11235. },
  11236. }
  11237. target := &ret
  11238. if err := gensupport.DecodeResponse(target, res); err != nil {
  11239. return nil, err
  11240. }
  11241. return ret, nil
  11242. // {
  11243. // "description": "Lists the node pools for a cluster.",
  11244. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11245. // "httpMethod": "GET",
  11246. // "id": "container.projects.zones.clusters.nodePools.list",
  11247. // "parameterOrder": [
  11248. // "projectId",
  11249. // "zone",
  11250. // "clusterId"
  11251. // ],
  11252. // "parameters": {
  11253. // "clusterId": {
  11254. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  11255. // "location": "path",
  11256. // "required": true,
  11257. // "type": "string"
  11258. // },
  11259. // "parent": {
  11260. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  11261. // "location": "query",
  11262. // "type": "string"
  11263. // },
  11264. // "projectId": {
  11265. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://developers.google.com/console/help/new/#projectnumber).\nThis field has been deprecated and replaced by the parent field.",
  11266. // "location": "path",
  11267. // "required": true,
  11268. // "type": "string"
  11269. // },
  11270. // "zone": {
  11271. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the parent field.",
  11272. // "location": "path",
  11273. // "required": true,
  11274. // "type": "string"
  11275. // }
  11276. // },
  11277. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  11278. // "response": {
  11279. // "$ref": "ListNodePoolsResponse"
  11280. // },
  11281. // "scopes": [
  11282. // "https://www.googleapis.com/auth/cloud-platform"
  11283. // ]
  11284. // }
  11285. }
  11286. // method id "container.projects.zones.clusters.nodePools.rollback":
  11287. type ProjectsZonesClustersNodePoolsRollbackCall struct {
  11288. s *Service
  11289. projectId string
  11290. zone string
  11291. clusterId string
  11292. nodePoolId string
  11293. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  11294. urlParams_ gensupport.URLParams
  11295. ctx_ context.Context
  11296. header_ http.Header
  11297. }
  11298. // Rollback: Roll back the previously Aborted or Failed NodePool
  11299. // upgrade.
  11300. // This will be an no-op if the last upgrade successfully completed.
  11301. func (r *ProjectsZonesClustersNodePoolsService) Rollback(projectId string, zone string, clusterId string, nodePoolId string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsZonesClustersNodePoolsRollbackCall {
  11302. c := &ProjectsZonesClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11303. c.projectId = projectId
  11304. c.zone = zone
  11305. c.clusterId = clusterId
  11306. c.nodePoolId = nodePoolId
  11307. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  11308. return c
  11309. }
  11310. // Fields allows partial responses to be retrieved. See
  11311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11312. // for more information.
  11313. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsRollbackCall {
  11314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11315. return c
  11316. }
  11317. // Context sets the context to be used in this call's Do method. Any
  11318. // pending HTTP request will be aborted if the provided context is
  11319. // canceled.
  11320. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsRollbackCall {
  11321. c.ctx_ = ctx
  11322. return c
  11323. }
  11324. // Header returns an http.Header that can be modified by the caller to
  11325. // add HTTP headers to the request.
  11326. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header {
  11327. if c.header_ == nil {
  11328. c.header_ = make(http.Header)
  11329. }
  11330. return c.header_
  11331. }
  11332. func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  11333. reqHeaders := make(http.Header)
  11334. for k, v := range c.header_ {
  11335. reqHeaders[k] = v
  11336. }
  11337. reqHeaders.Set("User-Agent", c.s.userAgent())
  11338. var body io.Reader = nil
  11339. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  11340. if err != nil {
  11341. return nil, err
  11342. }
  11343. reqHeaders.Set("Content-Type", "application/json")
  11344. c.urlParams_.Set("alt", alt)
  11345. c.urlParams_.Set("prettyPrint", "false")
  11346. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback")
  11347. urls += "?" + c.urlParams_.Encode()
  11348. req, err := http.NewRequest("POST", urls, body)
  11349. if err != nil {
  11350. return nil, err
  11351. }
  11352. req.Header = reqHeaders
  11353. googleapi.Expand(req.URL, map[string]string{
  11354. "projectId": c.projectId,
  11355. "zone": c.zone,
  11356. "clusterId": c.clusterId,
  11357. "nodePoolId": c.nodePoolId,
  11358. })
  11359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11360. }
  11361. // Do executes the "container.projects.zones.clusters.nodePools.rollback" call.
  11362. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11363. // status code is an error. Response headers are in either
  11364. // *Operation.ServerResponse.Header or (if a response was returned at
  11365. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11366. // to check whether the returned error was because
  11367. // http.StatusNotModified was returned.
  11368. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11369. gensupport.SetOptions(c.urlParams_, opts...)
  11370. res, err := c.doRequest("json")
  11371. if res != nil && res.StatusCode == http.StatusNotModified {
  11372. if res.Body != nil {
  11373. res.Body.Close()
  11374. }
  11375. return nil, &googleapi.Error{
  11376. Code: res.StatusCode,
  11377. Header: res.Header,
  11378. }
  11379. }
  11380. if err != nil {
  11381. return nil, err
  11382. }
  11383. defer googleapi.CloseBody(res)
  11384. if err := googleapi.CheckResponse(res); err != nil {
  11385. return nil, err
  11386. }
  11387. ret := &Operation{
  11388. ServerResponse: googleapi.ServerResponse{
  11389. Header: res.Header,
  11390. HTTPStatusCode: res.StatusCode,
  11391. },
  11392. }
  11393. target := &ret
  11394. if err := gensupport.DecodeResponse(target, res); err != nil {
  11395. return nil, err
  11396. }
  11397. return ret, nil
  11398. // {
  11399. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  11400. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11401. // "httpMethod": "POST",
  11402. // "id": "container.projects.zones.clusters.nodePools.rollback",
  11403. // "parameterOrder": [
  11404. // "projectId",
  11405. // "zone",
  11406. // "clusterId",
  11407. // "nodePoolId"
  11408. // ],
  11409. // "parameters": {
  11410. // "clusterId": {
  11411. // "description": "Deprecated. The name of the cluster to rollback.\nThis field has been deprecated and replaced by the name field.",
  11412. // "location": "path",
  11413. // "required": true,
  11414. // "type": "string"
  11415. // },
  11416. // "nodePoolId": {
  11417. // "description": "Deprecated. The name of the node pool to rollback.\nThis field has been deprecated and replaced by the name field.",
  11418. // "location": "path",
  11419. // "required": true,
  11420. // "type": "string"
  11421. // },
  11422. // "projectId": {
  11423. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11424. // "location": "path",
  11425. // "required": true,
  11426. // "type": "string"
  11427. // },
  11428. // "zone": {
  11429. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11430. // "location": "path",
  11431. // "required": true,
  11432. // "type": "string"
  11433. // }
  11434. // },
  11435. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  11436. // "request": {
  11437. // "$ref": "RollbackNodePoolUpgradeRequest"
  11438. // },
  11439. // "response": {
  11440. // "$ref": "Operation"
  11441. // },
  11442. // "scopes": [
  11443. // "https://www.googleapis.com/auth/cloud-platform"
  11444. // ]
  11445. // }
  11446. }
  11447. // method id "container.projects.zones.clusters.nodePools.setManagement":
  11448. type ProjectsZonesClustersNodePoolsSetManagementCall struct {
  11449. s *Service
  11450. projectId string
  11451. zone string
  11452. clusterId string
  11453. nodePoolId string
  11454. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  11455. urlParams_ gensupport.URLParams
  11456. ctx_ context.Context
  11457. header_ http.Header
  11458. }
  11459. // SetManagement: Sets the NodeManagement options for a node pool.
  11460. func (r *ProjectsZonesClustersNodePoolsService) SetManagement(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11461. c := &ProjectsZonesClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11462. c.projectId = projectId
  11463. c.zone = zone
  11464. c.clusterId = clusterId
  11465. c.nodePoolId = nodePoolId
  11466. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  11467. return c
  11468. }
  11469. // Fields allows partial responses to be retrieved. See
  11470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11471. // for more information.
  11472. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11474. return c
  11475. }
  11476. // Context sets the context to be used in this call's Do method. Any
  11477. // pending HTTP request will be aborted if the provided context is
  11478. // canceled.
  11479. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetManagementCall {
  11480. c.ctx_ = ctx
  11481. return c
  11482. }
  11483. // Header returns an http.Header that can be modified by the caller to
  11484. // add HTTP headers to the request.
  11485. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header {
  11486. if c.header_ == nil {
  11487. c.header_ = make(http.Header)
  11488. }
  11489. return c.header_
  11490. }
  11491. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  11492. reqHeaders := make(http.Header)
  11493. for k, v := range c.header_ {
  11494. reqHeaders[k] = v
  11495. }
  11496. reqHeaders.Set("User-Agent", c.s.userAgent())
  11497. var body io.Reader = nil
  11498. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  11499. if err != nil {
  11500. return nil, err
  11501. }
  11502. reqHeaders.Set("Content-Type", "application/json")
  11503. c.urlParams_.Set("alt", alt)
  11504. c.urlParams_.Set("prettyPrint", "false")
  11505. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement")
  11506. urls += "?" + c.urlParams_.Encode()
  11507. req, err := http.NewRequest("POST", urls, body)
  11508. if err != nil {
  11509. return nil, err
  11510. }
  11511. req.Header = reqHeaders
  11512. googleapi.Expand(req.URL, map[string]string{
  11513. "projectId": c.projectId,
  11514. "zone": c.zone,
  11515. "clusterId": c.clusterId,
  11516. "nodePoolId": c.nodePoolId,
  11517. })
  11518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11519. }
  11520. // Do executes the "container.projects.zones.clusters.nodePools.setManagement" call.
  11521. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11522. // status code is an error. Response headers are in either
  11523. // *Operation.ServerResponse.Header or (if a response was returned at
  11524. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11525. // to check whether the returned error was because
  11526. // http.StatusNotModified was returned.
  11527. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11528. gensupport.SetOptions(c.urlParams_, opts...)
  11529. res, err := c.doRequest("json")
  11530. if res != nil && res.StatusCode == http.StatusNotModified {
  11531. if res.Body != nil {
  11532. res.Body.Close()
  11533. }
  11534. return nil, &googleapi.Error{
  11535. Code: res.StatusCode,
  11536. Header: res.Header,
  11537. }
  11538. }
  11539. if err != nil {
  11540. return nil, err
  11541. }
  11542. defer googleapi.CloseBody(res)
  11543. if err := googleapi.CheckResponse(res); err != nil {
  11544. return nil, err
  11545. }
  11546. ret := &Operation{
  11547. ServerResponse: googleapi.ServerResponse{
  11548. Header: res.Header,
  11549. HTTPStatusCode: res.StatusCode,
  11550. },
  11551. }
  11552. target := &ret
  11553. if err := gensupport.DecodeResponse(target, res); err != nil {
  11554. return nil, err
  11555. }
  11556. return ret, nil
  11557. // {
  11558. // "description": "Sets the NodeManagement options for a node pool.",
  11559. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  11560. // "httpMethod": "POST",
  11561. // "id": "container.projects.zones.clusters.nodePools.setManagement",
  11562. // "parameterOrder": [
  11563. // "projectId",
  11564. // "zone",
  11565. // "clusterId",
  11566. // "nodePoolId"
  11567. // ],
  11568. // "parameters": {
  11569. // "clusterId": {
  11570. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  11571. // "location": "path",
  11572. // "required": true,
  11573. // "type": "string"
  11574. // },
  11575. // "nodePoolId": {
  11576. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  11577. // "location": "path",
  11578. // "required": true,
  11579. // "type": "string"
  11580. // },
  11581. // "projectId": {
  11582. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11583. // "location": "path",
  11584. // "required": true,
  11585. // "type": "string"
  11586. // },
  11587. // "zone": {
  11588. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11589. // "location": "path",
  11590. // "required": true,
  11591. // "type": "string"
  11592. // }
  11593. // },
  11594. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  11595. // "request": {
  11596. // "$ref": "SetNodePoolManagementRequest"
  11597. // },
  11598. // "response": {
  11599. // "$ref": "Operation"
  11600. // },
  11601. // "scopes": [
  11602. // "https://www.googleapis.com/auth/cloud-platform"
  11603. // ]
  11604. // }
  11605. }
  11606. // method id "container.projects.zones.clusters.nodePools.setSize":
  11607. type ProjectsZonesClustersNodePoolsSetSizeCall struct {
  11608. s *Service
  11609. projectId string
  11610. zone string
  11611. clusterId string
  11612. nodePoolId string
  11613. setnodepoolsizerequest *SetNodePoolSizeRequest
  11614. urlParams_ gensupport.URLParams
  11615. ctx_ context.Context
  11616. header_ http.Header
  11617. }
  11618. // SetSize: Sets the size for a specific node pool.
  11619. func (r *ProjectsZonesClustersNodePoolsService) SetSize(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11620. c := &ProjectsZonesClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11621. c.projectId = projectId
  11622. c.zone = zone
  11623. c.clusterId = clusterId
  11624. c.nodePoolId = nodePoolId
  11625. c.setnodepoolsizerequest = setnodepoolsizerequest
  11626. return c
  11627. }
  11628. // Fields allows partial responses to be retrieved. See
  11629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11630. // for more information.
  11631. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11633. return c
  11634. }
  11635. // Context sets the context to be used in this call's Do method. Any
  11636. // pending HTTP request will be aborted if the provided context is
  11637. // canceled.
  11638. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetSizeCall {
  11639. c.ctx_ = ctx
  11640. return c
  11641. }
  11642. // Header returns an http.Header that can be modified by the caller to
  11643. // add HTTP headers to the request.
  11644. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header {
  11645. if c.header_ == nil {
  11646. c.header_ = make(http.Header)
  11647. }
  11648. return c.header_
  11649. }
  11650. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  11651. reqHeaders := make(http.Header)
  11652. for k, v := range c.header_ {
  11653. reqHeaders[k] = v
  11654. }
  11655. reqHeaders.Set("User-Agent", c.s.userAgent())
  11656. var body io.Reader = nil
  11657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  11658. if err != nil {
  11659. return nil, err
  11660. }
  11661. reqHeaders.Set("Content-Type", "application/json")
  11662. c.urlParams_.Set("alt", alt)
  11663. c.urlParams_.Set("prettyPrint", "false")
  11664. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize")
  11665. urls += "?" + c.urlParams_.Encode()
  11666. req, err := http.NewRequest("POST", urls, body)
  11667. if err != nil {
  11668. return nil, err
  11669. }
  11670. req.Header = reqHeaders
  11671. googleapi.Expand(req.URL, map[string]string{
  11672. "projectId": c.projectId,
  11673. "zone": c.zone,
  11674. "clusterId": c.clusterId,
  11675. "nodePoolId": c.nodePoolId,
  11676. })
  11677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11678. }
  11679. // Do executes the "container.projects.zones.clusters.nodePools.setSize" call.
  11680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11681. // status code is an error. Response headers are in either
  11682. // *Operation.ServerResponse.Header or (if a response was returned at
  11683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11684. // to check whether the returned error was because
  11685. // http.StatusNotModified was returned.
  11686. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11687. gensupport.SetOptions(c.urlParams_, opts...)
  11688. res, err := c.doRequest("json")
  11689. if res != nil && res.StatusCode == http.StatusNotModified {
  11690. if res.Body != nil {
  11691. res.Body.Close()
  11692. }
  11693. return nil, &googleapi.Error{
  11694. Code: res.StatusCode,
  11695. Header: res.Header,
  11696. }
  11697. }
  11698. if err != nil {
  11699. return nil, err
  11700. }
  11701. defer googleapi.CloseBody(res)
  11702. if err := googleapi.CheckResponse(res); err != nil {
  11703. return nil, err
  11704. }
  11705. ret := &Operation{
  11706. ServerResponse: googleapi.ServerResponse{
  11707. Header: res.Header,
  11708. HTTPStatusCode: res.StatusCode,
  11709. },
  11710. }
  11711. target := &ret
  11712. if err := gensupport.DecodeResponse(target, res); err != nil {
  11713. return nil, err
  11714. }
  11715. return ret, nil
  11716. // {
  11717. // "description": "Sets the size for a specific node pool.",
  11718. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  11719. // "httpMethod": "POST",
  11720. // "id": "container.projects.zones.clusters.nodePools.setSize",
  11721. // "parameterOrder": [
  11722. // "projectId",
  11723. // "zone",
  11724. // "clusterId",
  11725. // "nodePoolId"
  11726. // ],
  11727. // "parameters": {
  11728. // "clusterId": {
  11729. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  11730. // "location": "path",
  11731. // "required": true,
  11732. // "type": "string"
  11733. // },
  11734. // "nodePoolId": {
  11735. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  11736. // "location": "path",
  11737. // "required": true,
  11738. // "type": "string"
  11739. // },
  11740. // "projectId": {
  11741. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11742. // "location": "path",
  11743. // "required": true,
  11744. // "type": "string"
  11745. // },
  11746. // "zone": {
  11747. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11748. // "location": "path",
  11749. // "required": true,
  11750. // "type": "string"
  11751. // }
  11752. // },
  11753. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  11754. // "request": {
  11755. // "$ref": "SetNodePoolSizeRequest"
  11756. // },
  11757. // "response": {
  11758. // "$ref": "Operation"
  11759. // },
  11760. // "scopes": [
  11761. // "https://www.googleapis.com/auth/cloud-platform"
  11762. // ]
  11763. // }
  11764. }
  11765. // method id "container.projects.zones.clusters.nodePools.update":
  11766. type ProjectsZonesClustersNodePoolsUpdateCall struct {
  11767. s *Service
  11768. projectId string
  11769. zone string
  11770. clusterId string
  11771. nodePoolId string
  11772. updatenodepoolrequest *UpdateNodePoolRequest
  11773. urlParams_ gensupport.URLParams
  11774. ctx_ context.Context
  11775. header_ http.Header
  11776. }
  11777. // Update: Updates the version and/or image type for a specific node
  11778. // pool.
  11779. func (r *ProjectsZonesClustersNodePoolsService) Update(projectId string, zone string, clusterId string, nodePoolId string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsZonesClustersNodePoolsUpdateCall {
  11780. c := &ProjectsZonesClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11781. c.projectId = projectId
  11782. c.zone = zone
  11783. c.clusterId = clusterId
  11784. c.nodePoolId = nodePoolId
  11785. c.updatenodepoolrequest = updatenodepoolrequest
  11786. return c
  11787. }
  11788. // Fields allows partial responses to be retrieved. See
  11789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11790. // for more information.
  11791. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsUpdateCall {
  11792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11793. return c
  11794. }
  11795. // Context sets the context to be used in this call's Do method. Any
  11796. // pending HTTP request will be aborted if the provided context is
  11797. // canceled.
  11798. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsUpdateCall {
  11799. c.ctx_ = ctx
  11800. return c
  11801. }
  11802. // Header returns an http.Header that can be modified by the caller to
  11803. // add HTTP headers to the request.
  11804. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header {
  11805. if c.header_ == nil {
  11806. c.header_ = make(http.Header)
  11807. }
  11808. return c.header_
  11809. }
  11810. func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  11811. reqHeaders := make(http.Header)
  11812. for k, v := range c.header_ {
  11813. reqHeaders[k] = v
  11814. }
  11815. reqHeaders.Set("User-Agent", c.s.userAgent())
  11816. var body io.Reader = nil
  11817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  11818. if err != nil {
  11819. return nil, err
  11820. }
  11821. reqHeaders.Set("Content-Type", "application/json")
  11822. c.urlParams_.Set("alt", alt)
  11823. c.urlParams_.Set("prettyPrint", "false")
  11824. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update")
  11825. urls += "?" + c.urlParams_.Encode()
  11826. req, err := http.NewRequest("POST", urls, body)
  11827. if err != nil {
  11828. return nil, err
  11829. }
  11830. req.Header = reqHeaders
  11831. googleapi.Expand(req.URL, map[string]string{
  11832. "projectId": c.projectId,
  11833. "zone": c.zone,
  11834. "clusterId": c.clusterId,
  11835. "nodePoolId": c.nodePoolId,
  11836. })
  11837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11838. }
  11839. // Do executes the "container.projects.zones.clusters.nodePools.update" call.
  11840. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11841. // status code is an error. Response headers are in either
  11842. // *Operation.ServerResponse.Header or (if a response was returned at
  11843. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11844. // to check whether the returned error was because
  11845. // http.StatusNotModified was returned.
  11846. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11847. gensupport.SetOptions(c.urlParams_, opts...)
  11848. res, err := c.doRequest("json")
  11849. if res != nil && res.StatusCode == http.StatusNotModified {
  11850. if res.Body != nil {
  11851. res.Body.Close()
  11852. }
  11853. return nil, &googleapi.Error{
  11854. Code: res.StatusCode,
  11855. Header: res.Header,
  11856. }
  11857. }
  11858. if err != nil {
  11859. return nil, err
  11860. }
  11861. defer googleapi.CloseBody(res)
  11862. if err := googleapi.CheckResponse(res); err != nil {
  11863. return nil, err
  11864. }
  11865. ret := &Operation{
  11866. ServerResponse: googleapi.ServerResponse{
  11867. Header: res.Header,
  11868. HTTPStatusCode: res.StatusCode,
  11869. },
  11870. }
  11871. target := &ret
  11872. if err := gensupport.DecodeResponse(target, res); err != nil {
  11873. return nil, err
  11874. }
  11875. return ret, nil
  11876. // {
  11877. // "description": "Updates the version and/or image type for a specific node pool.",
  11878. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  11879. // "httpMethod": "POST",
  11880. // "id": "container.projects.zones.clusters.nodePools.update",
  11881. // "parameterOrder": [
  11882. // "projectId",
  11883. // "zone",
  11884. // "clusterId",
  11885. // "nodePoolId"
  11886. // ],
  11887. // "parameters": {
  11888. // "clusterId": {
  11889. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11890. // "location": "path",
  11891. // "required": true,
  11892. // "type": "string"
  11893. // },
  11894. // "nodePoolId": {
  11895. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11896. // "location": "path",
  11897. // "required": true,
  11898. // "type": "string"
  11899. // },
  11900. // "projectId": {
  11901. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  11902. // "location": "path",
  11903. // "required": true,
  11904. // "type": "string"
  11905. // },
  11906. // "zone": {
  11907. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  11908. // "location": "path",
  11909. // "required": true,
  11910. // "type": "string"
  11911. // }
  11912. // },
  11913. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  11914. // "request": {
  11915. // "$ref": "UpdateNodePoolRequest"
  11916. // },
  11917. // "response": {
  11918. // "$ref": "Operation"
  11919. // },
  11920. // "scopes": [
  11921. // "https://www.googleapis.com/auth/cloud-platform"
  11922. // ]
  11923. // }
  11924. }
  11925. // method id "container.projects.zones.operations.cancel":
  11926. type ProjectsZonesOperationsCancelCall struct {
  11927. s *Service
  11928. projectId string
  11929. zone string
  11930. operationId string
  11931. canceloperationrequest *CancelOperationRequest
  11932. urlParams_ gensupport.URLParams
  11933. ctx_ context.Context
  11934. header_ http.Header
  11935. }
  11936. // Cancel: Cancels the specified operation.
  11937. func (r *ProjectsZonesOperationsService) Cancel(projectId string, zone string, operationId string, canceloperationrequest *CancelOperationRequest) *ProjectsZonesOperationsCancelCall {
  11938. c := &ProjectsZonesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11939. c.projectId = projectId
  11940. c.zone = zone
  11941. c.operationId = operationId
  11942. c.canceloperationrequest = canceloperationrequest
  11943. return c
  11944. }
  11945. // Fields allows partial responses to be retrieved. See
  11946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11947. // for more information.
  11948. func (c *ProjectsZonesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsCancelCall {
  11949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11950. return c
  11951. }
  11952. // Context sets the context to be used in this call's Do method. Any
  11953. // pending HTTP request will be aborted if the provided context is
  11954. // canceled.
  11955. func (c *ProjectsZonesOperationsCancelCall) Context(ctx context.Context) *ProjectsZonesOperationsCancelCall {
  11956. c.ctx_ = ctx
  11957. return c
  11958. }
  11959. // Header returns an http.Header that can be modified by the caller to
  11960. // add HTTP headers to the request.
  11961. func (c *ProjectsZonesOperationsCancelCall) Header() http.Header {
  11962. if c.header_ == nil {
  11963. c.header_ = make(http.Header)
  11964. }
  11965. return c.header_
  11966. }
  11967. func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  11968. reqHeaders := make(http.Header)
  11969. for k, v := range c.header_ {
  11970. reqHeaders[k] = v
  11971. }
  11972. reqHeaders.Set("User-Agent", c.s.userAgent())
  11973. var body io.Reader = nil
  11974. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  11975. if err != nil {
  11976. return nil, err
  11977. }
  11978. reqHeaders.Set("Content-Type", "application/json")
  11979. c.urlParams_.Set("alt", alt)
  11980. c.urlParams_.Set("prettyPrint", "false")
  11981. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel")
  11982. urls += "?" + c.urlParams_.Encode()
  11983. req, err := http.NewRequest("POST", urls, body)
  11984. if err != nil {
  11985. return nil, err
  11986. }
  11987. req.Header = reqHeaders
  11988. googleapi.Expand(req.URL, map[string]string{
  11989. "projectId": c.projectId,
  11990. "zone": c.zone,
  11991. "operationId": c.operationId,
  11992. })
  11993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11994. }
  11995. // Do executes the "container.projects.zones.operations.cancel" call.
  11996. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  11997. // code is an error. Response headers are in either
  11998. // *Empty.ServerResponse.Header or (if a response was returned at all)
  11999. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12000. // check whether the returned error was because http.StatusNotModified
  12001. // was returned.
  12002. func (c *ProjectsZonesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  12003. gensupport.SetOptions(c.urlParams_, opts...)
  12004. res, err := c.doRequest("json")
  12005. if res != nil && res.StatusCode == http.StatusNotModified {
  12006. if res.Body != nil {
  12007. res.Body.Close()
  12008. }
  12009. return nil, &googleapi.Error{
  12010. Code: res.StatusCode,
  12011. Header: res.Header,
  12012. }
  12013. }
  12014. if err != nil {
  12015. return nil, err
  12016. }
  12017. defer googleapi.CloseBody(res)
  12018. if err := googleapi.CheckResponse(res); err != nil {
  12019. return nil, err
  12020. }
  12021. ret := &Empty{
  12022. ServerResponse: googleapi.ServerResponse{
  12023. Header: res.Header,
  12024. HTTPStatusCode: res.StatusCode,
  12025. },
  12026. }
  12027. target := &ret
  12028. if err := gensupport.DecodeResponse(target, res); err != nil {
  12029. return nil, err
  12030. }
  12031. return ret, nil
  12032. // {
  12033. // "description": "Cancels the specified operation.",
  12034. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  12035. // "httpMethod": "POST",
  12036. // "id": "container.projects.zones.operations.cancel",
  12037. // "parameterOrder": [
  12038. // "projectId",
  12039. // "zone",
  12040. // "operationId"
  12041. // ],
  12042. // "parameters": {
  12043. // "operationId": {
  12044. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  12045. // "location": "path",
  12046. // "required": true,
  12047. // "type": "string"
  12048. // },
  12049. // "projectId": {
  12050. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12051. // "location": "path",
  12052. // "required": true,
  12053. // "type": "string"
  12054. // },
  12055. // "zone": {
  12056. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the operation resides.\nThis field has been deprecated and replaced by the name field.",
  12057. // "location": "path",
  12058. // "required": true,
  12059. // "type": "string"
  12060. // }
  12061. // },
  12062. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  12063. // "request": {
  12064. // "$ref": "CancelOperationRequest"
  12065. // },
  12066. // "response": {
  12067. // "$ref": "Empty"
  12068. // },
  12069. // "scopes": [
  12070. // "https://www.googleapis.com/auth/cloud-platform"
  12071. // ]
  12072. // }
  12073. }
  12074. // method id "container.projects.zones.operations.get":
  12075. type ProjectsZonesOperationsGetCall struct {
  12076. s *Service
  12077. projectId string
  12078. zone string
  12079. operationId string
  12080. urlParams_ gensupport.URLParams
  12081. ifNoneMatch_ string
  12082. ctx_ context.Context
  12083. header_ http.Header
  12084. }
  12085. // Get: Gets the specified operation.
  12086. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  12087. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12088. c.projectId = projectId
  12089. c.zone = zone
  12090. c.operationId = operationId
  12091. return c
  12092. }
  12093. // Name sets the optional parameter "name": The name (project, location,
  12094. // operation id) of the operation to get.
  12095. // Specified in the format 'projects/*/locations/*/operations/*'.
  12096. func (c *ProjectsZonesOperationsGetCall) Name(name string) *ProjectsZonesOperationsGetCall {
  12097. c.urlParams_.Set("name", name)
  12098. return c
  12099. }
  12100. // Fields allows partial responses to be retrieved. See
  12101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12102. // for more information.
  12103. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  12104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12105. return c
  12106. }
  12107. // IfNoneMatch sets the optional parameter which makes the operation
  12108. // fail if the object's ETag matches the given value. This is useful for
  12109. // getting updates only after the object has changed since the last
  12110. // request. Use googleapi.IsNotModified to check whether the response
  12111. // error from Do is the result of In-None-Match.
  12112. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  12113. c.ifNoneMatch_ = entityTag
  12114. return c
  12115. }
  12116. // Context sets the context to be used in this call's Do method. Any
  12117. // pending HTTP request will be aborted if the provided context is
  12118. // canceled.
  12119. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  12120. c.ctx_ = ctx
  12121. return c
  12122. }
  12123. // Header returns an http.Header that can be modified by the caller to
  12124. // add HTTP headers to the request.
  12125. func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
  12126. if c.header_ == nil {
  12127. c.header_ = make(http.Header)
  12128. }
  12129. return c.header_
  12130. }
  12131. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  12132. reqHeaders := make(http.Header)
  12133. for k, v := range c.header_ {
  12134. reqHeaders[k] = v
  12135. }
  12136. reqHeaders.Set("User-Agent", c.s.userAgent())
  12137. if c.ifNoneMatch_ != "" {
  12138. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12139. }
  12140. var body io.Reader = nil
  12141. c.urlParams_.Set("alt", alt)
  12142. c.urlParams_.Set("prettyPrint", "false")
  12143. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  12144. urls += "?" + c.urlParams_.Encode()
  12145. req, err := http.NewRequest("GET", urls, body)
  12146. if err != nil {
  12147. return nil, err
  12148. }
  12149. req.Header = reqHeaders
  12150. googleapi.Expand(req.URL, map[string]string{
  12151. "projectId": c.projectId,
  12152. "zone": c.zone,
  12153. "operationId": c.operationId,
  12154. })
  12155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12156. }
  12157. // Do executes the "container.projects.zones.operations.get" call.
  12158. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  12159. // status code is an error. Response headers are in either
  12160. // *Operation.ServerResponse.Header or (if a response was returned at
  12161. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12162. // to check whether the returned error was because
  12163. // http.StatusNotModified was returned.
  12164. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  12165. gensupport.SetOptions(c.urlParams_, opts...)
  12166. res, err := c.doRequest("json")
  12167. if res != nil && res.StatusCode == http.StatusNotModified {
  12168. if res.Body != nil {
  12169. res.Body.Close()
  12170. }
  12171. return nil, &googleapi.Error{
  12172. Code: res.StatusCode,
  12173. Header: res.Header,
  12174. }
  12175. }
  12176. if err != nil {
  12177. return nil, err
  12178. }
  12179. defer googleapi.CloseBody(res)
  12180. if err := googleapi.CheckResponse(res); err != nil {
  12181. return nil, err
  12182. }
  12183. ret := &Operation{
  12184. ServerResponse: googleapi.ServerResponse{
  12185. Header: res.Header,
  12186. HTTPStatusCode: res.StatusCode,
  12187. },
  12188. }
  12189. target := &ret
  12190. if err := gensupport.DecodeResponse(target, res); err != nil {
  12191. return nil, err
  12192. }
  12193. return ret, nil
  12194. // {
  12195. // "description": "Gets the specified operation.",
  12196. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12197. // "httpMethod": "GET",
  12198. // "id": "container.projects.zones.operations.get",
  12199. // "parameterOrder": [
  12200. // "projectId",
  12201. // "zone",
  12202. // "operationId"
  12203. // ],
  12204. // "parameters": {
  12205. // "name": {
  12206. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  12207. // "location": "query",
  12208. // "type": "string"
  12209. // },
  12210. // "operationId": {
  12211. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  12212. // "location": "path",
  12213. // "required": true,
  12214. // "type": "string"
  12215. // },
  12216. // "projectId": {
  12217. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the name field.",
  12218. // "location": "path",
  12219. // "required": true,
  12220. // "type": "string"
  12221. // },
  12222. // "zone": {
  12223. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.\nThis field has been deprecated and replaced by the name field.",
  12224. // "location": "path",
  12225. // "required": true,
  12226. // "type": "string"
  12227. // }
  12228. // },
  12229. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  12230. // "response": {
  12231. // "$ref": "Operation"
  12232. // },
  12233. // "scopes": [
  12234. // "https://www.googleapis.com/auth/cloud-platform"
  12235. // ]
  12236. // }
  12237. }
  12238. // method id "container.projects.zones.operations.list":
  12239. type ProjectsZonesOperationsListCall struct {
  12240. s *Service
  12241. projectId string
  12242. zone string
  12243. urlParams_ gensupport.URLParams
  12244. ifNoneMatch_ string
  12245. ctx_ context.Context
  12246. header_ http.Header
  12247. }
  12248. // List: Lists all operations in a project in a specific zone or all
  12249. // zones.
  12250. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  12251. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12252. c.projectId = projectId
  12253. c.zone = zone
  12254. return c
  12255. }
  12256. // Parent sets the optional parameter "parent": The parent (project and
  12257. // location) where the operations will be listed.
  12258. // Specified in the format 'projects/*/locations/*'.
  12259. // Location "-" matches all zones and all regions.
  12260. func (c *ProjectsZonesOperationsListCall) Parent(parent string) *ProjectsZonesOperationsListCall {
  12261. c.urlParams_.Set("parent", parent)
  12262. return c
  12263. }
  12264. // Fields allows partial responses to be retrieved. See
  12265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12266. // for more information.
  12267. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  12268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12269. return c
  12270. }
  12271. // IfNoneMatch sets the optional parameter which makes the operation
  12272. // fail if the object's ETag matches the given value. This is useful for
  12273. // getting updates only after the object has changed since the last
  12274. // request. Use googleapi.IsNotModified to check whether the response
  12275. // error from Do is the result of In-None-Match.
  12276. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  12277. c.ifNoneMatch_ = entityTag
  12278. return c
  12279. }
  12280. // Context sets the context to be used in this call's Do method. Any
  12281. // pending HTTP request will be aborted if the provided context is
  12282. // canceled.
  12283. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  12284. c.ctx_ = ctx
  12285. return c
  12286. }
  12287. // Header returns an http.Header that can be modified by the caller to
  12288. // add HTTP headers to the request.
  12289. func (c *ProjectsZonesOperationsListCall) Header() http.Header {
  12290. if c.header_ == nil {
  12291. c.header_ = make(http.Header)
  12292. }
  12293. return c.header_
  12294. }
  12295. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  12296. reqHeaders := make(http.Header)
  12297. for k, v := range c.header_ {
  12298. reqHeaders[k] = v
  12299. }
  12300. reqHeaders.Set("User-Agent", c.s.userAgent())
  12301. if c.ifNoneMatch_ != "" {
  12302. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12303. }
  12304. var body io.Reader = nil
  12305. c.urlParams_.Set("alt", alt)
  12306. c.urlParams_.Set("prettyPrint", "false")
  12307. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations")
  12308. urls += "?" + c.urlParams_.Encode()
  12309. req, err := http.NewRequest("GET", urls, body)
  12310. if err != nil {
  12311. return nil, err
  12312. }
  12313. req.Header = reqHeaders
  12314. googleapi.Expand(req.URL, map[string]string{
  12315. "projectId": c.projectId,
  12316. "zone": c.zone,
  12317. })
  12318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12319. }
  12320. // Do executes the "container.projects.zones.operations.list" call.
  12321. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  12322. // non-2xx status code is an error. Response headers are in either
  12323. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  12324. // returned at all) in error.(*googleapi.Error).Header. Use
  12325. // googleapi.IsNotModified to check whether the returned error was
  12326. // because http.StatusNotModified was returned.
  12327. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  12328. gensupport.SetOptions(c.urlParams_, opts...)
  12329. res, err := c.doRequest("json")
  12330. if res != nil && res.StatusCode == http.StatusNotModified {
  12331. if res.Body != nil {
  12332. res.Body.Close()
  12333. }
  12334. return nil, &googleapi.Error{
  12335. Code: res.StatusCode,
  12336. Header: res.Header,
  12337. }
  12338. }
  12339. if err != nil {
  12340. return nil, err
  12341. }
  12342. defer googleapi.CloseBody(res)
  12343. if err := googleapi.CheckResponse(res); err != nil {
  12344. return nil, err
  12345. }
  12346. ret := &ListOperationsResponse{
  12347. ServerResponse: googleapi.ServerResponse{
  12348. Header: res.Header,
  12349. HTTPStatusCode: res.StatusCode,
  12350. },
  12351. }
  12352. target := &ret
  12353. if err := gensupport.DecodeResponse(target, res); err != nil {
  12354. return nil, err
  12355. }
  12356. return ret, nil
  12357. // {
  12358. // "description": "Lists all operations in a project in a specific zone or all zones.",
  12359. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations",
  12360. // "httpMethod": "GET",
  12361. // "id": "container.projects.zones.operations.list",
  12362. // "parameterOrder": [
  12363. // "projectId",
  12364. // "zone"
  12365. // ],
  12366. // "parameters": {
  12367. // "parent": {
  12368. // "description": "The parent (project and location) where the operations will be listed.\nSpecified in the format 'projects/*/locations/*'.\nLocation \"-\" matches all zones and all regions.",
  12369. // "location": "query",
  12370. // "type": "string"
  12371. // },
  12372. // "projectId": {
  12373. // "description": "Deprecated. The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).\nThis field has been deprecated and replaced by the parent field.",
  12374. // "location": "path",
  12375. // "required": true,
  12376. // "type": "string"
  12377. // },
  12378. // "zone": {
  12379. // "description": "Deprecated. The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) to return operations for, or `-` for\nall zones. This field has been deprecated and replaced by the parent field.",
  12380. // "location": "path",
  12381. // "required": true,
  12382. // "type": "string"
  12383. // }
  12384. // },
  12385. // "path": "v1/projects/{projectId}/zones/{zone}/operations",
  12386. // "response": {
  12387. // "$ref": "ListOperationsResponse"
  12388. // },
  12389. // "scopes": [
  12390. // "https://www.googleapis.com/auth/cloud-platform"
  12391. // ]
  12392. // }
  12393. }