You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

12518 line
450 KiB

  1. // Package container provides access to the Kubernetes Engine API.
  2. //
  3. // See https://cloud.google.com/container-engine/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/container/v1"
  8. // ...
  9. // containerService, err := container.New(oauthHttpClient)
  10. package container // import "google.golang.org/api/container/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "container:v1"
  41. const apiName = "container"
  42. const apiVersion = "v1"
  43. const basePath = "https://container.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Projects = NewProjectsService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Locations = NewProjectsLocationsService(s)
  72. rs.Zones = NewProjectsZonesService(s)
  73. return rs
  74. }
  75. type ProjectsService struct {
  76. s *Service
  77. Locations *ProjectsLocationsService
  78. Zones *ProjectsZonesService
  79. }
  80. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  81. rs := &ProjectsLocationsService{s: s}
  82. rs.Clusters = NewProjectsLocationsClustersService(s)
  83. rs.Operations = NewProjectsLocationsOperationsService(s)
  84. return rs
  85. }
  86. type ProjectsLocationsService struct {
  87. s *Service
  88. Clusters *ProjectsLocationsClustersService
  89. Operations *ProjectsLocationsOperationsService
  90. }
  91. func NewProjectsLocationsClustersService(s *Service) *ProjectsLocationsClustersService {
  92. rs := &ProjectsLocationsClustersService{s: s}
  93. rs.NodePools = NewProjectsLocationsClustersNodePoolsService(s)
  94. return rs
  95. }
  96. type ProjectsLocationsClustersService struct {
  97. s *Service
  98. NodePools *ProjectsLocationsClustersNodePoolsService
  99. }
  100. func NewProjectsLocationsClustersNodePoolsService(s *Service) *ProjectsLocationsClustersNodePoolsService {
  101. rs := &ProjectsLocationsClustersNodePoolsService{s: s}
  102. return rs
  103. }
  104. type ProjectsLocationsClustersNodePoolsService struct {
  105. s *Service
  106. }
  107. func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
  108. rs := &ProjectsLocationsOperationsService{s: s}
  109. return rs
  110. }
  111. type ProjectsLocationsOperationsService struct {
  112. s *Service
  113. }
  114. func NewProjectsZonesService(s *Service) *ProjectsZonesService {
  115. rs := &ProjectsZonesService{s: s}
  116. rs.Clusters = NewProjectsZonesClustersService(s)
  117. rs.Operations = NewProjectsZonesOperationsService(s)
  118. return rs
  119. }
  120. type ProjectsZonesService struct {
  121. s *Service
  122. Clusters *ProjectsZonesClustersService
  123. Operations *ProjectsZonesOperationsService
  124. }
  125. func NewProjectsZonesClustersService(s *Service) *ProjectsZonesClustersService {
  126. rs := &ProjectsZonesClustersService{s: s}
  127. rs.NodePools = NewProjectsZonesClustersNodePoolsService(s)
  128. return rs
  129. }
  130. type ProjectsZonesClustersService struct {
  131. s *Service
  132. NodePools *ProjectsZonesClustersNodePoolsService
  133. }
  134. func NewProjectsZonesClustersNodePoolsService(s *Service) *ProjectsZonesClustersNodePoolsService {
  135. rs := &ProjectsZonesClustersNodePoolsService{s: s}
  136. return rs
  137. }
  138. type ProjectsZonesClustersNodePoolsService struct {
  139. s *Service
  140. }
  141. func NewProjectsZonesOperationsService(s *Service) *ProjectsZonesOperationsService {
  142. rs := &ProjectsZonesOperationsService{s: s}
  143. return rs
  144. }
  145. type ProjectsZonesOperationsService struct {
  146. s *Service
  147. }
  148. // AcceleratorConfig: AcceleratorConfig represents a Hardware
  149. // Accelerator request.
  150. type AcceleratorConfig struct {
  151. // AcceleratorCount: The number of the accelerator cards exposed to an
  152. // instance.
  153. AcceleratorCount int64 `json:"acceleratorCount,omitempty,string"`
  154. // AcceleratorType: The accelerator type resource name. List of
  155. // supported accelerators
  156. // [here](/compute/docs/gpus/#Introduction)
  157. AcceleratorType string `json:"acceleratorType,omitempty"`
  158. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  159. // unconditionally include in API requests. By default, fields with
  160. // empty values are omitted from API requests. However, any non-pointer,
  161. // non-interface field appearing in ForceSendFields will be sent to the
  162. // server regardless of whether the field is empty or not. This may be
  163. // used to include empty fields in Patch requests.
  164. ForceSendFields []string `json:"-"`
  165. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  166. // include in API requests with the JSON null value. By default, fields
  167. // with empty values are omitted from API requests. However, any field
  168. // with an empty value appearing in NullFields will be sent to the
  169. // server as null. It is an error if a field in this list has a
  170. // non-empty value. This may be used to include null fields in Patch
  171. // requests.
  172. NullFields []string `json:"-"`
  173. }
  174. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  175. type NoMethod AcceleratorConfig
  176. raw := NoMethod(*s)
  177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  178. }
  179. // AddonsConfig: Configuration for the addons that can be automatically
  180. // spun up in the
  181. // cluster, enabling additional functionality.
  182. type AddonsConfig struct {
  183. // HorizontalPodAutoscaling: Configuration for the horizontal pod
  184. // autoscaling feature, which
  185. // increases or decreases the number of replica pods a replication
  186. // controller
  187. // has based on the resource usage of the existing pods.
  188. HorizontalPodAutoscaling *HorizontalPodAutoscaling `json:"horizontalPodAutoscaling,omitempty"`
  189. // HttpLoadBalancing: Configuration for the HTTP (L7) load balancing
  190. // controller addon, which
  191. // makes it easy to set up HTTP load balancers for services in a
  192. // cluster.
  193. HttpLoadBalancing *HttpLoadBalancing `json:"httpLoadBalancing,omitempty"`
  194. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  195. KubernetesDashboard *KubernetesDashboard `json:"kubernetesDashboard,omitempty"`
  196. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  197. // tracks whether the addon
  198. // is enabled or not on the Master, it does not track whether network
  199. // policy
  200. // is enabled for the nodes.
  201. NetworkPolicyConfig *NetworkPolicyConfig `json:"networkPolicyConfig,omitempty"`
  202. // ForceSendFields is a list of field names (e.g.
  203. // "HorizontalPodAutoscaling") to unconditionally include in API
  204. // requests. By default, fields with empty values are omitted from API
  205. // requests. However, any non-pointer, non-interface field appearing in
  206. // ForceSendFields will be sent to the server regardless of whether the
  207. // field is empty or not. This may be used to include empty fields in
  208. // Patch requests.
  209. ForceSendFields []string `json:"-"`
  210. // NullFields is a list of field names (e.g. "HorizontalPodAutoscaling")
  211. // to include in API requests with the JSON null value. By default,
  212. // fields with empty values are omitted from API requests. However, any
  213. // field with an empty value appearing in NullFields will be sent to the
  214. // server as null. It is an error if a field in this list has a
  215. // non-empty value. This may be used to include null fields in Patch
  216. // requests.
  217. NullFields []string `json:"-"`
  218. }
  219. func (s *AddonsConfig) MarshalJSON() ([]byte, error) {
  220. type NoMethod AddonsConfig
  221. raw := NoMethod(*s)
  222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  223. }
  224. // AutoUpgradeOptions: AutoUpgradeOptions defines the set of options for
  225. // the user to control how
  226. // the Auto Upgrades will proceed.
  227. type AutoUpgradeOptions struct {
  228. // AutoUpgradeStartTime: [Output only] This field is set when upgrades
  229. // are about to commence
  230. // with the approximate start time for the upgrades,
  231. // in
  232. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  233. AutoUpgradeStartTime string `json:"autoUpgradeStartTime,omitempty"`
  234. // Description: [Output only] This field is set when upgrades are about
  235. // to commence
  236. // with the description of the upgrade.
  237. Description string `json:"description,omitempty"`
  238. // ForceSendFields is a list of field names (e.g.
  239. // "AutoUpgradeStartTime") to unconditionally include in API requests.
  240. // By default, fields with empty values are omitted from API requests.
  241. // However, any non-pointer, non-interface field appearing in
  242. // ForceSendFields will be sent to the server regardless of whether the
  243. // field is empty or not. This may be used to include empty fields in
  244. // Patch requests.
  245. ForceSendFields []string `json:"-"`
  246. // NullFields is a list of field names (e.g. "AutoUpgradeStartTime") to
  247. // include in API requests with the JSON null value. By default, fields
  248. // with empty values are omitted from API requests. However, any field
  249. // with an empty value appearing in NullFields will be sent to the
  250. // server as null. It is an error if a field in this list has a
  251. // non-empty value. This may be used to include null fields in Patch
  252. // requests.
  253. NullFields []string `json:"-"`
  254. }
  255. func (s *AutoUpgradeOptions) MarshalJSON() ([]byte, error) {
  256. type NoMethod AutoUpgradeOptions
  257. raw := NoMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  259. }
  260. // CancelOperationRequest: CancelOperationRequest cancels a single
  261. // operation.
  262. type CancelOperationRequest struct {
  263. // Name: The name (project, location, operation id) of the operation to
  264. // cancel.
  265. // Specified in the format 'projects/*/locations/*/operations/*'.
  266. Name string `json:"name,omitempty"`
  267. // OperationId: Deprecated. The server-assigned `name` of the
  268. // operation.
  269. // This field has been deprecated and replaced by the name field.
  270. OperationId string `json:"operationId,omitempty"`
  271. // ProjectId: Deprecated. The Google Developers Console [project ID or
  272. // project
  273. // number](https://support.google.com/cloud/answer/6158840).
  274. // This
  275. // field has been deprecated and replaced by the name field.
  276. ProjectId string `json:"projectId,omitempty"`
  277. // Zone: Deprecated. The name of the Google Compute
  278. // Engine
  279. // [zone](/compute/docs/zones#available) in which the operation
  280. // resides.
  281. // This field has been deprecated and replaced by the name field.
  282. Zone string `json:"zone,omitempty"`
  283. // ForceSendFields is a list of field names (e.g. "Name") to
  284. // unconditionally include in API requests. By default, fields with
  285. // empty values are omitted from API requests. However, any non-pointer,
  286. // non-interface field appearing in ForceSendFields will be sent to the
  287. // server regardless of whether the field is empty or not. This may be
  288. // used to include empty fields in Patch requests.
  289. ForceSendFields []string `json:"-"`
  290. // NullFields is a list of field names (e.g. "Name") to include in API
  291. // requests with the JSON null value. By default, fields with empty
  292. // values are omitted from API requests. However, any field with an
  293. // empty value appearing in NullFields will be sent to the server as
  294. // null. It is an error if a field in this list has a non-empty value.
  295. // This may be used to include null fields in Patch requests.
  296. NullFields []string `json:"-"`
  297. }
  298. func (s *CancelOperationRequest) MarshalJSON() ([]byte, error) {
  299. type NoMethod CancelOperationRequest
  300. raw := NoMethod(*s)
  301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  302. }
  303. // CidrBlock: CidrBlock contains an optional name and one CIDR block.
  304. type CidrBlock struct {
  305. // CidrBlock: cidr_block must be specified in CIDR notation.
  306. CidrBlock string `json:"cidrBlock,omitempty"`
  307. // DisplayName: display_name is an optional field for users to identify
  308. // CIDR blocks.
  309. DisplayName string `json:"displayName,omitempty"`
  310. // ForceSendFields is a list of field names (e.g. "CidrBlock") to
  311. // unconditionally include in API requests. By default, fields with
  312. // empty values are omitted from API requests. However, any non-pointer,
  313. // non-interface field appearing in ForceSendFields will be sent to the
  314. // server regardless of whether the field is empty or not. This may be
  315. // used to include empty fields in Patch requests.
  316. ForceSendFields []string `json:"-"`
  317. // NullFields is a list of field names (e.g. "CidrBlock") to include in
  318. // API requests with the JSON null value. By default, fields with empty
  319. // values are omitted from API requests. However, any field with an
  320. // empty value appearing in NullFields will be sent to the server as
  321. // null. It is an error if a field in this list has a non-empty value.
  322. // This may be used to include null fields in Patch requests.
  323. NullFields []string `json:"-"`
  324. }
  325. func (s *CidrBlock) MarshalJSON() ([]byte, error) {
  326. type NoMethod CidrBlock
  327. raw := NoMethod(*s)
  328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  329. }
  330. // ClientCertificateConfig: Configuration for client certificates on the
  331. // cluster.
  332. type ClientCertificateConfig struct {
  333. // IssueClientCertificate: Issue a client certificate.
  334. IssueClientCertificate bool `json:"issueClientCertificate,omitempty"`
  335. // ForceSendFields is a list of field names (e.g.
  336. // "IssueClientCertificate") to unconditionally include in API requests.
  337. // By default, fields with empty values are omitted from API requests.
  338. // However, any non-pointer, non-interface field appearing in
  339. // ForceSendFields will be sent to the server regardless of whether the
  340. // field is empty or not. This may be used to include empty fields in
  341. // Patch requests.
  342. ForceSendFields []string `json:"-"`
  343. // NullFields is a list of field names (e.g. "IssueClientCertificate")
  344. // to include in API requests with the JSON null value. By default,
  345. // fields with empty values are omitted from API requests. However, any
  346. // field with an empty value appearing in NullFields will be sent to the
  347. // server as null. It is an error if a field in this list has a
  348. // non-empty value. This may be used to include null fields in Patch
  349. // requests.
  350. NullFields []string `json:"-"`
  351. }
  352. func (s *ClientCertificateConfig) MarshalJSON() ([]byte, error) {
  353. type NoMethod ClientCertificateConfig
  354. raw := NoMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  356. }
  357. // Cluster: A Google Kubernetes Engine cluster.
  358. type Cluster struct {
  359. // AddonsConfig: Configurations for the various addons available to run
  360. // in the cluster.
  361. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  362. // ClusterIpv4Cidr: The IP address range of the container pods in this
  363. // cluster,
  364. // in
  365. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  366. //
  367. // notation (e.g. `10.96.0.0/14`). Leave blank to have
  368. // one automatically chosen or specify a `/14` block in `10.0.0.0/8`.
  369. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  370. // CreateTime: [Output only] The time the cluster was created,
  371. // in
  372. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  373. CreateTime string `json:"createTime,omitempty"`
  374. // CurrentMasterVersion: [Output only] The current software version of
  375. // the master endpoint.
  376. CurrentMasterVersion string `json:"currentMasterVersion,omitempty"`
  377. // CurrentNodeCount: [Output only] The number of nodes currently in the
  378. // cluster.
  379. CurrentNodeCount int64 `json:"currentNodeCount,omitempty"`
  380. // CurrentNodeVersion: [Output only] The current version of the node
  381. // software components.
  382. // If they are currently at multiple versions because they're in the
  383. // process
  384. // of being upgraded, this reflects the minimum version of all nodes.
  385. CurrentNodeVersion string `json:"currentNodeVersion,omitempty"`
  386. // Description: An optional description of this cluster.
  387. Description string `json:"description,omitempty"`
  388. // EnableKubernetesAlpha: Kubernetes alpha features are enabled on this
  389. // cluster. This includes alpha
  390. // API groups (e.g. v1alpha1) and features that may not be production
  391. // ready in
  392. // the kubernetes version of the master and nodes.
  393. // The cluster has no SLA for uptime and master/node upgrades are
  394. // disabled.
  395. // Alpha enabled clusters are automatically deleted thirty days
  396. // after
  397. // creation.
  398. EnableKubernetesAlpha bool `json:"enableKubernetesAlpha,omitempty"`
  399. // Endpoint: [Output only] The IP address of this cluster's master
  400. // endpoint.
  401. // The endpoint can be accessed from the internet
  402. // at
  403. // `https://username:password@endpoint/`.
  404. //
  405. // See the `masterAuth` property of this resource for username
  406. // and
  407. // password information.
  408. Endpoint string `json:"endpoint,omitempty"`
  409. // ExpireTime: [Output only] The time the cluster will be
  410. // automatically
  411. // deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text
  412. // format.
  413. ExpireTime string `json:"expireTime,omitempty"`
  414. // InitialClusterVersion: The initial Kubernetes version for this
  415. // cluster. Valid versions are those
  416. // found in validMasterVersions returned by getServerConfig. The
  417. // version can
  418. // be upgraded over time; such upgrades are reflected
  419. // in
  420. // currentMasterVersion and currentNodeVersion.
  421. //
  422. // Users may specify either explicit versions offered by
  423. // Kubernetes Engine or version aliases, which have the following
  424. // behavior:
  425. //
  426. // - "latest": picks the highest valid Kubernetes version
  427. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  428. // version
  429. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  430. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  431. // - "","-": picks the default Kubernetes version
  432. InitialClusterVersion string `json:"initialClusterVersion,omitempty"`
  433. // InitialNodeCount: The number of nodes to create in this cluster. You
  434. // must ensure that your
  435. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  436. // quota</a>
  437. // is sufficient for this number of instances. You must also have
  438. // available
  439. // firewall and routes quota.
  440. // For requests, this field should only be used in lieu of a
  441. // "node_pool" object, since this configuration (along with
  442. // the
  443. // "node_config") will be used to create a "NodePool" object with
  444. // an
  445. // auto-generated name. Do not use this and a node_pool at the same
  446. // time.
  447. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  448. // InstanceGroupUrls: Deprecated. Use node_pools.instance_group_urls.
  449. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  450. // IpAllocationPolicy: Configuration for cluster IP allocation.
  451. IpAllocationPolicy *IPAllocationPolicy `json:"ipAllocationPolicy,omitempty"`
  452. // LabelFingerprint: The fingerprint of the set of labels for this
  453. // cluster.
  454. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  455. // LegacyAbac: Configuration for the legacy ABAC authorization mode.
  456. LegacyAbac *LegacyAbac `json:"legacyAbac,omitempty"`
  457. // Location: [Output only] The name of the Google Compute
  458. // Engine
  459. // [zone](/compute/docs/regions-zones/regions-zones#available)
  460. // or
  461. // [region](/compute/docs/regions-zones/regions-zones#available) in
  462. // which
  463. // the cluster resides.
  464. Location string `json:"location,omitempty"`
  465. // Locations: The list of Google Compute
  466. // Engine
  467. // [locations](/compute/docs/zones#available) in which the cluster's
  468. // nodes
  469. // should be located.
  470. Locations []string `json:"locations,omitempty"`
  471. // LoggingService: The logging service the cluster should use to write
  472. // logs.
  473. // Currently available options:
  474. //
  475. // * `logging.googleapis.com` - the Google Cloud Logging service.
  476. // * `none` - no logs will be exported from the cluster.
  477. // * if left as an empty string,`logging.googleapis.com` will be used.
  478. LoggingService string `json:"loggingService,omitempty"`
  479. // MaintenancePolicy: Configure the maintenance policy for this cluster.
  480. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  481. // MasterAuth: The authentication information for accessing the master
  482. // endpoint.
  483. MasterAuth *MasterAuth `json:"masterAuth,omitempty"`
  484. // MasterAuthorizedNetworksConfig: The configuration options for master
  485. // authorized networks feature.
  486. MasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"masterAuthorizedNetworksConfig,omitempty"`
  487. // MonitoringService: The monitoring service the cluster should use to
  488. // write metrics.
  489. // Currently available options:
  490. //
  491. // * `monitoring.googleapis.com` - the Google Cloud Monitoring
  492. // service.
  493. // * `none` - no metrics will be exported from the cluster.
  494. // * if left as an empty string, `monitoring.googleapis.com` will be
  495. // used.
  496. MonitoringService string `json:"monitoringService,omitempty"`
  497. // Name: The name of this cluster. The name must be unique within this
  498. // project
  499. // and zone, and can be up to 40 characters with the following
  500. // restrictions:
  501. //
  502. // * Lowercase letters, numbers, and hyphens only.
  503. // * Must start with a letter.
  504. // * Must end with a number or a letter.
  505. Name string `json:"name,omitempty"`
  506. // Network: The name of the Google Compute
  507. // Engine
  508. // [network](/compute/docs/networks-and-firewalls#networks) to which
  509. // the
  510. // cluster is connected. If left unspecified, the `default` network
  511. // will be used.
  512. Network string `json:"network,omitempty"`
  513. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  514. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  515. // NodeConfig: Parameters used in creating the cluster's nodes.
  516. // See `nodeConfig` for the description of its properties.
  517. // For requests, this field should only be used in lieu of a
  518. // "node_pool" object, since this configuration (along with
  519. // the
  520. // "initial_node_count") will be used to create a "NodePool" object with
  521. // an
  522. // auto-generated name. Do not use this and a node_pool at the same
  523. // time.
  524. // For responses, this field will be populated with the node
  525. // configuration of
  526. // the first node pool.
  527. //
  528. // If unspecified, the defaults are used.
  529. NodeConfig *NodeConfig `json:"nodeConfig,omitempty"`
  530. // NodeIpv4CidrSize: [Output only] The size of the address space on each
  531. // node for hosting
  532. // containers. This is provisioned from within the
  533. // `container_ipv4_cidr`
  534. // range.
  535. NodeIpv4CidrSize int64 `json:"nodeIpv4CidrSize,omitempty"`
  536. // NodePools: The node pools associated with this cluster.
  537. // This field should not be set if "node_config" or "initial_node_count"
  538. // are
  539. // specified.
  540. NodePools []*NodePool `json:"nodePools,omitempty"`
  541. // ResourceLabels: The resource labels for the cluster to use to
  542. // annotate any related
  543. // Google Compute Engine resources.
  544. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  545. // SelfLink: [Output only] Server-defined URL for the resource.
  546. SelfLink string `json:"selfLink,omitempty"`
  547. // ServicesIpv4Cidr: [Output only] The IP address range of the
  548. // Kubernetes services in
  549. // this cluster,
  550. // in
  551. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  552. //
  553. // notation (e.g. `1.2.3.4/29`). Service addresses are
  554. // typically put in the last `/16` from the container CIDR.
  555. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  556. // Status: [Output only] The current status of this cluster.
  557. //
  558. // Possible values:
  559. // "STATUS_UNSPECIFIED" - Not set.
  560. // "PROVISIONING" - The PROVISIONING state indicates the cluster is
  561. // being created.
  562. // "RUNNING" - The RUNNING state indicates the cluster has been
  563. // created and is fully
  564. // usable.
  565. // "RECONCILING" - The RECONCILING state indicates that some work is
  566. // actively being done on
  567. // the cluster, such as upgrading the master or node software. Details
  568. // can
  569. // be found in the `statusMessage` field.
  570. // "STOPPING" - The STOPPING state indicates the cluster is being
  571. // deleted.
  572. // "ERROR" - The ERROR state indicates the cluster may be unusable.
  573. // Details
  574. // can be found in the `statusMessage` field.
  575. // "DEGRADED" - The DEGRADED state indicates the cluster requires user
  576. // action to restore
  577. // full functionality. Details can be found in the `statusMessage`
  578. // field.
  579. Status string `json:"status,omitempty"`
  580. // StatusMessage: [Output only] Additional information about the current
  581. // status of this
  582. // cluster, if available.
  583. StatusMessage string `json:"statusMessage,omitempty"`
  584. // Subnetwork: The name of the Google Compute
  585. // Engine
  586. // [subnetwork](/compute/docs/subnetworks) to which the
  587. // cluster is connected.
  588. Subnetwork string `json:"subnetwork,omitempty"`
  589. // Zone: [Output only] The name of the Google Compute
  590. // Engine
  591. // [zone](/compute/docs/zones#available) in which the
  592. // cluster
  593. // resides.
  594. // This field is deprecated, use location instead.
  595. Zone string `json:"zone,omitempty"`
  596. // ServerResponse contains the HTTP response code and headers from the
  597. // server.
  598. googleapi.ServerResponse `json:"-"`
  599. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  600. // unconditionally include in API requests. By default, fields with
  601. // empty values are omitted from API requests. However, any non-pointer,
  602. // non-interface field appearing in ForceSendFields will be sent to the
  603. // server regardless of whether the field is empty or not. This may be
  604. // used to include empty fields in Patch requests.
  605. ForceSendFields []string `json:"-"`
  606. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  607. // in API requests with the JSON null value. By default, fields with
  608. // empty values are omitted from API requests. However, any field with
  609. // an empty value appearing in NullFields will be sent to the server as
  610. // null. It is an error if a field in this list has a non-empty value.
  611. // This may be used to include null fields in Patch requests.
  612. NullFields []string `json:"-"`
  613. }
  614. func (s *Cluster) MarshalJSON() ([]byte, error) {
  615. type NoMethod Cluster
  616. raw := NoMethod(*s)
  617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  618. }
  619. // ClusterUpdate: ClusterUpdate describes an update to the cluster.
  620. // Exactly one update can
  621. // be applied to a cluster with each request, so at most one field can
  622. // be
  623. // provided.
  624. type ClusterUpdate struct {
  625. // DesiredAddonsConfig: Configurations for the various addons available
  626. // to run in the cluster.
  627. DesiredAddonsConfig *AddonsConfig `json:"desiredAddonsConfig,omitempty"`
  628. // DesiredImageType: The desired image type for the node pool.
  629. // NOTE: Set the "desired_node_pool" field as well.
  630. DesiredImageType string `json:"desiredImageType,omitempty"`
  631. // DesiredLocations: The desired list of Google Compute
  632. // Engine
  633. // [locations](/compute/docs/zones#available) in which the cluster's
  634. // nodes
  635. // should be located. Changing the locations a cluster is in will
  636. // result
  637. // in nodes being either created or removed from the cluster, depending
  638. // on
  639. // whether locations are being added or removed.
  640. //
  641. // This list must always include the cluster's primary zone.
  642. DesiredLocations []string `json:"desiredLocations,omitempty"`
  643. // DesiredMasterAuthorizedNetworksConfig: The desired configuration
  644. // options for master authorized networks feature.
  645. DesiredMasterAuthorizedNetworksConfig *MasterAuthorizedNetworksConfig `json:"desiredMasterAuthorizedNetworksConfig,omitempty"`
  646. // DesiredMasterVersion: The Kubernetes version to change the master
  647. // to.
  648. //
  649. // Users may specify either explicit versions offered by
  650. // Kubernetes Engine or version aliases, which have the following
  651. // behavior:
  652. //
  653. // - "latest": picks the highest valid Kubernetes version
  654. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  655. // version
  656. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  657. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  658. // - "-": picks the default Kubernetes version
  659. DesiredMasterVersion string `json:"desiredMasterVersion,omitempty"`
  660. // DesiredMonitoringService: The monitoring service the cluster should
  661. // use to write metrics.
  662. // Currently available options:
  663. //
  664. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  665. // * "none" - no metrics will be exported from the cluster
  666. DesiredMonitoringService string `json:"desiredMonitoringService,omitempty"`
  667. // DesiredNodePoolAutoscaling: Autoscaler configuration for the node
  668. // pool specified in
  669. // desired_node_pool_id. If there is only one pool in the
  670. // cluster and desired_node_pool_id is not provided then
  671. // the change applies to that single node pool.
  672. DesiredNodePoolAutoscaling *NodePoolAutoscaling `json:"desiredNodePoolAutoscaling,omitempty"`
  673. // DesiredNodePoolId: The node pool to be upgraded. This field is
  674. // mandatory if
  675. // "desired_node_version", "desired_image_family"
  676. // or
  677. // "desired_node_pool_autoscaling" is specified and there is more than
  678. // one
  679. // node pool on the cluster.
  680. DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
  681. // DesiredNodeVersion: The Kubernetes version to change the nodes to
  682. // (typically an
  683. // upgrade).
  684. //
  685. // Users may specify either explicit versions offered by
  686. // Kubernetes Engine or version aliases, which have the following
  687. // behavior:
  688. //
  689. // - "latest": picks the highest valid Kubernetes version
  690. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  691. // version
  692. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  693. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  694. // - "-": picks the Kubernetes master version
  695. DesiredNodeVersion string `json:"desiredNodeVersion,omitempty"`
  696. // ForceSendFields is a list of field names (e.g. "DesiredAddonsConfig")
  697. // to unconditionally include in API requests. By default, fields with
  698. // empty values are omitted from API requests. However, any non-pointer,
  699. // non-interface field appearing in ForceSendFields will be sent to the
  700. // server regardless of whether the field is empty or not. This may be
  701. // used to include empty fields in Patch requests.
  702. ForceSendFields []string `json:"-"`
  703. // NullFields is a list of field names (e.g. "DesiredAddonsConfig") to
  704. // include in API requests with the JSON null value. By default, fields
  705. // with empty values are omitted from API requests. However, any field
  706. // with an empty value appearing in NullFields will be sent to the
  707. // server as null. It is an error if a field in this list has a
  708. // non-empty value. This may be used to include null fields in Patch
  709. // requests.
  710. NullFields []string `json:"-"`
  711. }
  712. func (s *ClusterUpdate) MarshalJSON() ([]byte, error) {
  713. type NoMethod ClusterUpdate
  714. raw := NoMethod(*s)
  715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  716. }
  717. // CompleteIPRotationRequest: CompleteIPRotationRequest moves the
  718. // cluster master back into single-IP mode.
  719. type CompleteIPRotationRequest struct {
  720. // ClusterId: Deprecated. The name of the cluster.
  721. // This field has been deprecated and replaced by the name field.
  722. ClusterId string `json:"clusterId,omitempty"`
  723. // Name: The name (project, location, cluster id) of the cluster to
  724. // complete IP
  725. // rotation. Specified in the format
  726. // 'projects/*/locations/*/clusters/*'.
  727. Name string `json:"name,omitempty"`
  728. // ProjectId: Deprecated. The Google Developers Console [project ID or
  729. // project
  730. // number](https://developers.google.com/console/help/new/#projec
  731. // tnumber).
  732. // This field has been deprecated and replaced by the name field.
  733. ProjectId string `json:"projectId,omitempty"`
  734. // Zone: Deprecated. The name of the Google Compute
  735. // Engine
  736. // [zone](/compute/docs/zones#available) in which the
  737. // cluster
  738. // resides.
  739. // This field has been deprecated and replaced by the name field.
  740. Zone string `json:"zone,omitempty"`
  741. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  742. // unconditionally include in API requests. By default, fields with
  743. // empty values are omitted from API requests. However, any non-pointer,
  744. // non-interface field appearing in ForceSendFields will be sent to the
  745. // server regardless of whether the field is empty or not. This may be
  746. // used to include empty fields in Patch requests.
  747. ForceSendFields []string `json:"-"`
  748. // NullFields is a list of field names (e.g. "ClusterId") to include in
  749. // API requests with the JSON null value. By default, fields with empty
  750. // values are omitted from API requests. However, any field with an
  751. // empty value appearing in NullFields will be sent to the server as
  752. // null. It is an error if a field in this list has a non-empty value.
  753. // This may be used to include null fields in Patch requests.
  754. NullFields []string `json:"-"`
  755. }
  756. func (s *CompleteIPRotationRequest) MarshalJSON() ([]byte, error) {
  757. type NoMethod CompleteIPRotationRequest
  758. raw := NoMethod(*s)
  759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  760. }
  761. // CreateClusterRequest: CreateClusterRequest creates a cluster.
  762. type CreateClusterRequest struct {
  763. // Cluster: A
  764. // [cluster
  765. // resource](/container-engine/reference/rest/v1/projects.zones.
  766. // clusters)
  767. Cluster *Cluster `json:"cluster,omitempty"`
  768. // Parent: The parent (project and location) where the cluster will be
  769. // created.
  770. // Specified in the format 'projects/*/locations/*'.
  771. Parent string `json:"parent,omitempty"`
  772. // ProjectId: Deprecated. The Google Developers Console [project ID or
  773. // project
  774. // number](https://support.google.com/cloud/answer/6158840).
  775. // This
  776. // field has been deprecated and replaced by the parent field.
  777. ProjectId string `json:"projectId,omitempty"`
  778. // Zone: Deprecated. The name of the Google Compute
  779. // Engine
  780. // [zone](/compute/docs/zones#available) in which the
  781. // cluster
  782. // resides.
  783. // This field has been deprecated and replaced by the parent field.
  784. Zone string `json:"zone,omitempty"`
  785. // ForceSendFields is a list of field names (e.g. "Cluster") to
  786. // unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. // NullFields is a list of field names (e.g. "Cluster") to include in
  793. // API requests with the JSON null value. By default, fields with empty
  794. // values are omitted from API requests. However, any field with an
  795. // empty value appearing in NullFields will be sent to the server as
  796. // null. It is an error if a field in this list has a non-empty value.
  797. // This may be used to include null fields in Patch requests.
  798. NullFields []string `json:"-"`
  799. }
  800. func (s *CreateClusterRequest) MarshalJSON() ([]byte, error) {
  801. type NoMethod CreateClusterRequest
  802. raw := NoMethod(*s)
  803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  804. }
  805. // CreateNodePoolRequest: CreateNodePoolRequest creates a node pool for
  806. // a cluster.
  807. type CreateNodePoolRequest struct {
  808. // ClusterId: Deprecated. The name of the cluster.
  809. // This field has been deprecated and replaced by the parent field.
  810. ClusterId string `json:"clusterId,omitempty"`
  811. // NodePool: The node pool to create.
  812. NodePool *NodePool `json:"nodePool,omitempty"`
  813. // Parent: The parent (project, location, cluster id) where the node
  814. // pool will be
  815. // created. Specified in the
  816. // format
  817. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  818. Parent string `json:"parent,omitempty"`
  819. // ProjectId: Deprecated. The Google Developers Console [project ID or
  820. // project
  821. // number](https://developers.google.com/console/help/new/#projec
  822. // tnumber).
  823. // This field has been deprecated and replaced by the parent field.
  824. ProjectId string `json:"projectId,omitempty"`
  825. // Zone: Deprecated. The name of the Google Compute
  826. // Engine
  827. // [zone](/compute/docs/zones#available) in which the
  828. // cluster
  829. // resides.
  830. // This field has been deprecated and replaced by the parent field.
  831. Zone string `json:"zone,omitempty"`
  832. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  833. // unconditionally include in API requests. By default, fields with
  834. // empty values are omitted from API requests. However, any non-pointer,
  835. // non-interface field appearing in ForceSendFields will be sent to the
  836. // server regardless of whether the field is empty or not. This may be
  837. // used to include empty fields in Patch requests.
  838. ForceSendFields []string `json:"-"`
  839. // NullFields is a list of field names (e.g. "ClusterId") to include in
  840. // API requests with the JSON null value. By default, fields with empty
  841. // values are omitted from API requests. However, any field with an
  842. // empty value appearing in NullFields will be sent to the server as
  843. // null. It is an error if a field in this list has a non-empty value.
  844. // This may be used to include null fields in Patch requests.
  845. NullFields []string `json:"-"`
  846. }
  847. func (s *CreateNodePoolRequest) MarshalJSON() ([]byte, error) {
  848. type NoMethod CreateNodePoolRequest
  849. raw := NoMethod(*s)
  850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  851. }
  852. // DailyMaintenanceWindow: Time window specified for daily maintenance
  853. // operations.
  854. type DailyMaintenanceWindow struct {
  855. // Duration: [Output only] Duration of the time window, automatically
  856. // chosen to be
  857. // smallest possible in the given scenario.
  858. // Duration will be in
  859. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  860. // format "PTnHnMnS".
  861. Duration string `json:"duration,omitempty"`
  862. // StartTime: Time within the maintenance window to start the
  863. // maintenance operations.
  864. // Time format should be in
  865. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt)
  866. // format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT.
  867. StartTime string `json:"startTime,omitempty"`
  868. // ForceSendFields is a list of field names (e.g. "Duration") to
  869. // unconditionally include in API requests. By default, fields with
  870. // empty values are omitted from API requests. However, any non-pointer,
  871. // non-interface field appearing in ForceSendFields will be sent to the
  872. // server regardless of whether the field is empty or not. This may be
  873. // used to include empty fields in Patch requests.
  874. ForceSendFields []string `json:"-"`
  875. // NullFields is a list of field names (e.g. "Duration") to include in
  876. // API requests with the JSON null value. By default, fields with empty
  877. // values are omitted from API requests. However, any field with an
  878. // empty value appearing in NullFields will be sent to the server as
  879. // null. It is an error if a field in this list has a non-empty value.
  880. // This may be used to include null fields in Patch requests.
  881. NullFields []string `json:"-"`
  882. }
  883. func (s *DailyMaintenanceWindow) MarshalJSON() ([]byte, error) {
  884. type NoMethod DailyMaintenanceWindow
  885. raw := NoMethod(*s)
  886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  887. }
  888. // Empty: A generic empty message that you can re-use to avoid defining
  889. // duplicated
  890. // empty messages in your APIs. A typical example is to use it as the
  891. // request
  892. // or the response type of an API method. For instance:
  893. //
  894. // service Foo {
  895. // rpc Bar(google.protobuf.Empty) returns
  896. // (google.protobuf.Empty);
  897. // }
  898. //
  899. // The JSON representation for `Empty` is empty JSON object `{}`.
  900. type Empty struct {
  901. // ServerResponse contains the HTTP response code and headers from the
  902. // server.
  903. googleapi.ServerResponse `json:"-"`
  904. }
  905. // HorizontalPodAutoscaling: Configuration options for the horizontal
  906. // pod autoscaling feature, which
  907. // increases or decreases the number of replica pods a replication
  908. // controller
  909. // has based on the resource usage of the existing pods.
  910. type HorizontalPodAutoscaling struct {
  911. // Disabled: Whether the Horizontal Pod Autoscaling feature is enabled
  912. // in the cluster.
  913. // When enabled, it ensures that a Heapster pod is running in the
  914. // cluster,
  915. // which is also used by the Cloud Monitoring service.
  916. Disabled bool `json:"disabled,omitempty"`
  917. // ForceSendFields is a list of field names (e.g. "Disabled") to
  918. // unconditionally include in API requests. By default, fields with
  919. // empty values are omitted from API requests. However, any non-pointer,
  920. // non-interface field appearing in ForceSendFields will be sent to the
  921. // server regardless of whether the field is empty or not. This may be
  922. // used to include empty fields in Patch requests.
  923. ForceSendFields []string `json:"-"`
  924. // NullFields is a list of field names (e.g. "Disabled") to include in
  925. // API requests with the JSON null value. By default, fields with empty
  926. // values are omitted from API requests. However, any field with an
  927. // empty value appearing in NullFields will be sent to the server as
  928. // null. It is an error if a field in this list has a non-empty value.
  929. // This may be used to include null fields in Patch requests.
  930. NullFields []string `json:"-"`
  931. }
  932. func (s *HorizontalPodAutoscaling) MarshalJSON() ([]byte, error) {
  933. type NoMethod HorizontalPodAutoscaling
  934. raw := NoMethod(*s)
  935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  936. }
  937. // HttpLoadBalancing: Configuration options for the HTTP (L7) load
  938. // balancing controller addon,
  939. // which makes it easy to set up HTTP load balancers for services in a
  940. // cluster.
  941. type HttpLoadBalancing struct {
  942. // Disabled: Whether the HTTP Load Balancing controller is enabled in
  943. // the cluster.
  944. // When enabled, it runs a small pod in the cluster that manages the
  945. // load
  946. // balancers.
  947. Disabled bool `json:"disabled,omitempty"`
  948. // ForceSendFields is a list of field names (e.g. "Disabled") to
  949. // unconditionally include in API requests. By default, fields with
  950. // empty values are omitted from API requests. However, any non-pointer,
  951. // non-interface field appearing in ForceSendFields will be sent to the
  952. // server regardless of whether the field is empty or not. This may be
  953. // used to include empty fields in Patch requests.
  954. ForceSendFields []string `json:"-"`
  955. // NullFields is a list of field names (e.g. "Disabled") to include in
  956. // API requests with the JSON null value. By default, fields with empty
  957. // values are omitted from API requests. However, any field with an
  958. // empty value appearing in NullFields will be sent to the server as
  959. // null. It is an error if a field in this list has a non-empty value.
  960. // This may be used to include null fields in Patch requests.
  961. NullFields []string `json:"-"`
  962. }
  963. func (s *HttpLoadBalancing) MarshalJSON() ([]byte, error) {
  964. type NoMethod HttpLoadBalancing
  965. raw := NoMethod(*s)
  966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  967. }
  968. // IPAllocationPolicy: Configuration for controlling how IPs are
  969. // allocated in the cluster.
  970. type IPAllocationPolicy struct {
  971. // ClusterIpv4Cidr: This field is deprecated, use
  972. // cluster_ipv4_cidr_block.
  973. ClusterIpv4Cidr string `json:"clusterIpv4Cidr,omitempty"`
  974. // ClusterIpv4CidrBlock: The IP address range for the cluster pod IPs.
  975. // If this field is set, then
  976. // `cluster.cluster_ipv4_cidr` must be left blank.
  977. //
  978. // This field is only applicable when `use_ip_aliases` is true.
  979. //
  980. // Set to blank to have a range chosen with the default size.
  981. //
  982. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  983. // specific
  984. // netmask.
  985. //
  986. // Set to
  987. // a
  988. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  989. //
  990. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  991. // (e.g.
  992. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  993. // range
  994. // to use.
  995. ClusterIpv4CidrBlock string `json:"clusterIpv4CidrBlock,omitempty"`
  996. // ClusterSecondaryRangeName: The name of the secondary range to be used
  997. // for the cluster CIDR
  998. // block. The secondary range will be used for pod IP
  999. // addresses. This must be an existing secondary range associated
  1000. // with the cluster subnetwork.
  1001. //
  1002. // This field is only applicable with use_ip_aliases is true
  1003. // and
  1004. // create_subnetwork is false.
  1005. ClusterSecondaryRangeName string `json:"clusterSecondaryRangeName,omitempty"`
  1006. // CreateSubnetwork: Whether a new subnetwork will be created
  1007. // automatically for the cluster.
  1008. //
  1009. // This field is only applicable when `use_ip_aliases` is true.
  1010. CreateSubnetwork bool `json:"createSubnetwork,omitempty"`
  1011. // NodeIpv4Cidr: This field is deprecated, use node_ipv4_cidr_block.
  1012. NodeIpv4Cidr string `json:"nodeIpv4Cidr,omitempty"`
  1013. // NodeIpv4CidrBlock: The IP address range of the instance IPs in this
  1014. // cluster.
  1015. //
  1016. // This is applicable only if `create_subnetwork` is true.
  1017. //
  1018. // Set to blank to have a range chosen with the default size.
  1019. //
  1020. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1021. // specific
  1022. // netmask.
  1023. //
  1024. // Set to
  1025. // a
  1026. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1027. //
  1028. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1029. // (e.g.
  1030. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1031. // range
  1032. // to use.
  1033. NodeIpv4CidrBlock string `json:"nodeIpv4CidrBlock,omitempty"`
  1034. // ServicesIpv4Cidr: This field is deprecated, use
  1035. // services_ipv4_cidr_block.
  1036. ServicesIpv4Cidr string `json:"servicesIpv4Cidr,omitempty"`
  1037. // ServicesIpv4CidrBlock: The IP address range of the services IPs in
  1038. // this cluster. If blank, a range
  1039. // will be automatically chosen with the default size.
  1040. //
  1041. // This field is only applicable when `use_ip_aliases` is true.
  1042. //
  1043. // Set to blank to have a range chosen with the default size.
  1044. //
  1045. // Set to /netmask (e.g. `/14`) to have a range chosen with a
  1046. // specific
  1047. // netmask.
  1048. //
  1049. // Set to
  1050. // a
  1051. // [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
  1052. //
  1053. // notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks
  1054. // (e.g.
  1055. // `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific
  1056. // range
  1057. // to use.
  1058. ServicesIpv4CidrBlock string `json:"servicesIpv4CidrBlock,omitempty"`
  1059. // ServicesSecondaryRangeName: The name of the secondary range to be
  1060. // used as for the services
  1061. // CIDR block. The secondary range will be used for service
  1062. // ClusterIPs. This must be an existing secondary range associated
  1063. // with the cluster subnetwork.
  1064. //
  1065. // This field is only applicable with use_ip_aliases is true
  1066. // and
  1067. // create_subnetwork is false.
  1068. ServicesSecondaryRangeName string `json:"servicesSecondaryRangeName,omitempty"`
  1069. // SubnetworkName: A custom subnetwork name to be used if
  1070. // `create_subnetwork` is true. If
  1071. // this field is empty, then an automatic name will be chosen for the
  1072. // new
  1073. // subnetwork.
  1074. SubnetworkName string `json:"subnetworkName,omitempty"`
  1075. // UseIpAliases: Whether alias IPs will be used for pod IPs in the
  1076. // cluster.
  1077. UseIpAliases bool `json:"useIpAliases,omitempty"`
  1078. // ForceSendFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1079. // unconditionally include in API requests. By default, fields with
  1080. // empty values are omitted from API requests. However, any non-pointer,
  1081. // non-interface field appearing in ForceSendFields will be sent to the
  1082. // server regardless of whether the field is empty or not. This may be
  1083. // used to include empty fields in Patch requests.
  1084. ForceSendFields []string `json:"-"`
  1085. // NullFields is a list of field names (e.g. "ClusterIpv4Cidr") to
  1086. // include in API requests with the JSON null value. By default, fields
  1087. // with empty values are omitted from API requests. However, any field
  1088. // with an empty value appearing in NullFields will be sent to the
  1089. // server as null. It is an error if a field in this list has a
  1090. // non-empty value. This may be used to include null fields in Patch
  1091. // requests.
  1092. NullFields []string `json:"-"`
  1093. }
  1094. func (s *IPAllocationPolicy) MarshalJSON() ([]byte, error) {
  1095. type NoMethod IPAllocationPolicy
  1096. raw := NoMethod(*s)
  1097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1098. }
  1099. // KubernetesDashboard: Configuration for the Kubernetes Dashboard.
  1100. type KubernetesDashboard struct {
  1101. // Disabled: Whether the Kubernetes Dashboard is enabled for this
  1102. // cluster.
  1103. Disabled bool `json:"disabled,omitempty"`
  1104. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1105. // unconditionally include in API requests. By default, fields with
  1106. // empty values are omitted from API requests. However, any non-pointer,
  1107. // non-interface field appearing in ForceSendFields will be sent to the
  1108. // server regardless of whether the field is empty or not. This may be
  1109. // used to include empty fields in Patch requests.
  1110. ForceSendFields []string `json:"-"`
  1111. // NullFields is a list of field names (e.g. "Disabled") to include in
  1112. // API requests with the JSON null value. By default, fields with empty
  1113. // values are omitted from API requests. However, any field with an
  1114. // empty value appearing in NullFields will be sent to the server as
  1115. // null. It is an error if a field in this list has a non-empty value.
  1116. // This may be used to include null fields in Patch requests.
  1117. NullFields []string `json:"-"`
  1118. }
  1119. func (s *KubernetesDashboard) MarshalJSON() ([]byte, error) {
  1120. type NoMethod KubernetesDashboard
  1121. raw := NoMethod(*s)
  1122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1123. }
  1124. // LegacyAbac: Configuration for the legacy Attribute Based Access
  1125. // Control authorization
  1126. // mode.
  1127. type LegacyAbac struct {
  1128. // Enabled: Whether the ABAC authorizer is enabled for this cluster.
  1129. // When enabled,
  1130. // identities in the system, including service accounts, nodes,
  1131. // and
  1132. // controllers, will have statically granted permissions beyond
  1133. // those
  1134. // provided by the RBAC configuration or IAM.
  1135. Enabled bool `json:"enabled,omitempty"`
  1136. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1137. // unconditionally include in API requests. By default, fields with
  1138. // empty values are omitted from API requests. However, any non-pointer,
  1139. // non-interface field appearing in ForceSendFields will be sent to the
  1140. // server regardless of whether the field is empty or not. This may be
  1141. // used to include empty fields in Patch requests.
  1142. ForceSendFields []string `json:"-"`
  1143. // NullFields is a list of field names (e.g. "Enabled") to include in
  1144. // API requests with the JSON null value. By default, fields with empty
  1145. // values are omitted from API requests. However, any field with an
  1146. // empty value appearing in NullFields will be sent to the server as
  1147. // null. It is an error if a field in this list has a non-empty value.
  1148. // This may be used to include null fields in Patch requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *LegacyAbac) MarshalJSON() ([]byte, error) {
  1152. type NoMethod LegacyAbac
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. // ListClustersResponse: ListClustersResponse is the result of
  1157. // ListClustersRequest.
  1158. type ListClustersResponse struct {
  1159. // Clusters: A list of clusters in the project in the specified zone,
  1160. // or
  1161. // across all ones.
  1162. Clusters []*Cluster `json:"clusters,omitempty"`
  1163. // MissingZones: If any zones are listed here, the list of clusters
  1164. // returned
  1165. // may be missing those zones.
  1166. MissingZones []string `json:"missingZones,omitempty"`
  1167. // ServerResponse contains the HTTP response code and headers from the
  1168. // server.
  1169. googleapi.ServerResponse `json:"-"`
  1170. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1171. // unconditionally include in API requests. By default, fields with
  1172. // empty values are omitted from API requests. However, any non-pointer,
  1173. // non-interface field appearing in ForceSendFields will be sent to the
  1174. // server regardless of whether the field is empty or not. This may be
  1175. // used to include empty fields in Patch requests.
  1176. ForceSendFields []string `json:"-"`
  1177. // NullFields is a list of field names (e.g. "Clusters") to include in
  1178. // API requests with the JSON null value. By default, fields with empty
  1179. // values are omitted from API requests. However, any field with an
  1180. // empty value appearing in NullFields will be sent to the server as
  1181. // null. It is an error if a field in this list has a non-empty value.
  1182. // This may be used to include null fields in Patch requests.
  1183. NullFields []string `json:"-"`
  1184. }
  1185. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1186. type NoMethod ListClustersResponse
  1187. raw := NoMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1189. }
  1190. // ListNodePoolsResponse: ListNodePoolsResponse is the result of
  1191. // ListNodePoolsRequest.
  1192. type ListNodePoolsResponse struct {
  1193. // NodePools: A list of node pools for a cluster.
  1194. NodePools []*NodePool `json:"nodePools,omitempty"`
  1195. // ServerResponse contains the HTTP response code and headers from the
  1196. // server.
  1197. googleapi.ServerResponse `json:"-"`
  1198. // ForceSendFields is a list of field names (e.g. "NodePools") to
  1199. // unconditionally include in API requests. By default, fields with
  1200. // empty values are omitted from API requests. However, any non-pointer,
  1201. // non-interface field appearing in ForceSendFields will be sent to the
  1202. // server regardless of whether the field is empty or not. This may be
  1203. // used to include empty fields in Patch requests.
  1204. ForceSendFields []string `json:"-"`
  1205. // NullFields is a list of field names (e.g. "NodePools") to include in
  1206. // API requests with the JSON null value. By default, fields with empty
  1207. // values are omitted from API requests. However, any field with an
  1208. // empty value appearing in NullFields will be sent to the server as
  1209. // null. It is an error if a field in this list has a non-empty value.
  1210. // This may be used to include null fields in Patch requests.
  1211. NullFields []string `json:"-"`
  1212. }
  1213. func (s *ListNodePoolsResponse) MarshalJSON() ([]byte, error) {
  1214. type NoMethod ListNodePoolsResponse
  1215. raw := NoMethod(*s)
  1216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1217. }
  1218. // ListOperationsResponse: ListOperationsResponse is the result of
  1219. // ListOperationsRequest.
  1220. type ListOperationsResponse struct {
  1221. // MissingZones: If any zones are listed here, the list of operations
  1222. // returned
  1223. // may be missing the operations from those zones.
  1224. MissingZones []string `json:"missingZones,omitempty"`
  1225. // Operations: A list of operations in the project in the specified
  1226. // zone.
  1227. Operations []*Operation `json:"operations,omitempty"`
  1228. // ServerResponse contains the HTTP response code and headers from the
  1229. // server.
  1230. googleapi.ServerResponse `json:"-"`
  1231. // ForceSendFields is a list of field names (e.g. "MissingZones") to
  1232. // unconditionally include in API requests. By default, fields with
  1233. // empty values are omitted from API requests. However, any non-pointer,
  1234. // non-interface field appearing in ForceSendFields will be sent to the
  1235. // server regardless of whether the field is empty or not. This may be
  1236. // used to include empty fields in Patch requests.
  1237. ForceSendFields []string `json:"-"`
  1238. // NullFields is a list of field names (e.g. "MissingZones") to include
  1239. // in API requests with the JSON null value. By default, fields with
  1240. // empty values are omitted from API requests. However, any field with
  1241. // an empty value appearing in NullFields will be sent to the server as
  1242. // null. It is an error if a field in this list has a non-empty value.
  1243. // This may be used to include null fields in Patch requests.
  1244. NullFields []string `json:"-"`
  1245. }
  1246. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1247. type NoMethod ListOperationsResponse
  1248. raw := NoMethod(*s)
  1249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1250. }
  1251. // MaintenancePolicy: MaintenancePolicy defines the maintenance policy
  1252. // to be used for the cluster.
  1253. type MaintenancePolicy struct {
  1254. // Window: Specifies the maintenance window in which maintenance may be
  1255. // performed.
  1256. Window *MaintenanceWindow `json:"window,omitempty"`
  1257. // ForceSendFields is a list of field names (e.g. "Window") to
  1258. // unconditionally include in API requests. By default, fields with
  1259. // empty values are omitted from API requests. However, any non-pointer,
  1260. // non-interface field appearing in ForceSendFields will be sent to the
  1261. // server regardless of whether the field is empty or not. This may be
  1262. // used to include empty fields in Patch requests.
  1263. ForceSendFields []string `json:"-"`
  1264. // NullFields is a list of field names (e.g. "Window") to include in API
  1265. // requests with the JSON null value. By default, fields with empty
  1266. // values are omitted from API requests. However, any field with an
  1267. // empty value appearing in NullFields will be sent to the server as
  1268. // null. It is an error if a field in this list has a non-empty value.
  1269. // This may be used to include null fields in Patch requests.
  1270. NullFields []string `json:"-"`
  1271. }
  1272. func (s *MaintenancePolicy) MarshalJSON() ([]byte, error) {
  1273. type NoMethod MaintenancePolicy
  1274. raw := NoMethod(*s)
  1275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1276. }
  1277. // MaintenanceWindow: MaintenanceWindow defines the maintenance window
  1278. // to be used for the cluster.
  1279. type MaintenanceWindow struct {
  1280. // DailyMaintenanceWindow: DailyMaintenanceWindow specifies a daily
  1281. // maintenance operation window.
  1282. DailyMaintenanceWindow *DailyMaintenanceWindow `json:"dailyMaintenanceWindow,omitempty"`
  1283. // ForceSendFields is a list of field names (e.g.
  1284. // "DailyMaintenanceWindow") to unconditionally include in API requests.
  1285. // By default, fields with empty values are omitted from API requests.
  1286. // However, any non-pointer, non-interface field appearing in
  1287. // ForceSendFields will be sent to the server regardless of whether the
  1288. // field is empty or not. This may be used to include empty fields in
  1289. // Patch requests.
  1290. ForceSendFields []string `json:"-"`
  1291. // NullFields is a list of field names (e.g. "DailyMaintenanceWindow")
  1292. // to include in API requests with the JSON null value. By default,
  1293. // fields with empty values are omitted from API requests. However, any
  1294. // field with an empty value appearing in NullFields will be sent to the
  1295. // server as null. It is an error if a field in this list has a
  1296. // non-empty value. This may be used to include null fields in Patch
  1297. // requests.
  1298. NullFields []string `json:"-"`
  1299. }
  1300. func (s *MaintenanceWindow) MarshalJSON() ([]byte, error) {
  1301. type NoMethod MaintenanceWindow
  1302. raw := NoMethod(*s)
  1303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1304. }
  1305. // MasterAuth: The authentication information for accessing the master
  1306. // endpoint.
  1307. // Authentication can be done using HTTP basic auth or using
  1308. // client
  1309. // certificates.
  1310. type MasterAuth struct {
  1311. // ClientCertificate: [Output only] Base64-encoded public certificate
  1312. // used by clients to
  1313. // authenticate to the cluster endpoint.
  1314. ClientCertificate string `json:"clientCertificate,omitempty"`
  1315. // ClientCertificateConfig: Configuration for client certificate
  1316. // authentication on the cluster. If no
  1317. // configuration is specified, a client certificate is issued.
  1318. ClientCertificateConfig *ClientCertificateConfig `json:"clientCertificateConfig,omitempty"`
  1319. // ClientKey: [Output only] Base64-encoded private key used by clients
  1320. // to authenticate
  1321. // to the cluster endpoint.
  1322. ClientKey string `json:"clientKey,omitempty"`
  1323. // ClusterCaCertificate: [Output only] Base64-encoded public certificate
  1324. // that is the root of
  1325. // trust for the cluster.
  1326. ClusterCaCertificate string `json:"clusterCaCertificate,omitempty"`
  1327. // Password: The password to use for HTTP basic authentication to the
  1328. // master endpoint.
  1329. // Because the master endpoint is open to the Internet, you should
  1330. // create a
  1331. // strong password. If a password is provided for cluster creation,
  1332. // username
  1333. // must be non-empty.
  1334. Password string `json:"password,omitempty"`
  1335. // Username: The username to use for HTTP basic authentication to the
  1336. // master endpoint.
  1337. // For clusters v1.6.0 and later, you can disable basic authentication
  1338. // by
  1339. // providing an empty username.
  1340. Username string `json:"username,omitempty"`
  1341. // ForceSendFields is a list of field names (e.g. "ClientCertificate")
  1342. // to unconditionally include in API requests. By default, fields with
  1343. // empty values are omitted from API requests. However, any non-pointer,
  1344. // non-interface field appearing in ForceSendFields will be sent to the
  1345. // server regardless of whether the field is empty or not. This may be
  1346. // used to include empty fields in Patch requests.
  1347. ForceSendFields []string `json:"-"`
  1348. // NullFields is a list of field names (e.g. "ClientCertificate") to
  1349. // include in API requests with the JSON null value. By default, fields
  1350. // with empty values are omitted from API requests. However, any field
  1351. // with an empty value appearing in NullFields will be sent to the
  1352. // server as null. It is an error if a field in this list has a
  1353. // non-empty value. This may be used to include null fields in Patch
  1354. // requests.
  1355. NullFields []string `json:"-"`
  1356. }
  1357. func (s *MasterAuth) MarshalJSON() ([]byte, error) {
  1358. type NoMethod MasterAuth
  1359. raw := NoMethod(*s)
  1360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1361. }
  1362. // MasterAuthorizedNetworksConfig: Configuration options for the master
  1363. // authorized networks feature. Enabled
  1364. // master authorized networks will disallow all external traffic to
  1365. // access
  1366. // Kubernetes master through HTTPS except traffic from the given CIDR
  1367. // blocks,
  1368. // Google Compute Engine Public IPs and Google Prod IPs.
  1369. type MasterAuthorizedNetworksConfig struct {
  1370. // CidrBlocks: cidr_blocks define up to 10 external networks that could
  1371. // access
  1372. // Kubernetes master through HTTPS.
  1373. CidrBlocks []*CidrBlock `json:"cidrBlocks,omitempty"`
  1374. // Enabled: Whether or not master authorized networks is enabled.
  1375. Enabled bool `json:"enabled,omitempty"`
  1376. // ForceSendFields is a list of field names (e.g. "CidrBlocks") to
  1377. // unconditionally include in API requests. By default, fields with
  1378. // empty values are omitted from API requests. However, any non-pointer,
  1379. // non-interface field appearing in ForceSendFields will be sent to the
  1380. // server regardless of whether the field is empty or not. This may be
  1381. // used to include empty fields in Patch requests.
  1382. ForceSendFields []string `json:"-"`
  1383. // NullFields is a list of field names (e.g. "CidrBlocks") to include in
  1384. // API requests with the JSON null value. By default, fields with empty
  1385. // values are omitted from API requests. However, any field with an
  1386. // empty value appearing in NullFields will be sent to the server as
  1387. // null. It is an error if a field in this list has a non-empty value.
  1388. // This may be used to include null fields in Patch requests.
  1389. NullFields []string `json:"-"`
  1390. }
  1391. func (s *MasterAuthorizedNetworksConfig) MarshalJSON() ([]byte, error) {
  1392. type NoMethod MasterAuthorizedNetworksConfig
  1393. raw := NoMethod(*s)
  1394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1395. }
  1396. // NetworkPolicy: Configuration options for the NetworkPolicy
  1397. // feature.
  1398. // https://kubernetes.io/docs/concepts/services-networking/netwo
  1399. // rkpolicies/
  1400. type NetworkPolicy struct {
  1401. // Enabled: Whether network policy is enabled on the cluster.
  1402. Enabled bool `json:"enabled,omitempty"`
  1403. // Provider: The selected network policy provider.
  1404. //
  1405. // Possible values:
  1406. // "PROVIDER_UNSPECIFIED" - Not set
  1407. // "CALICO" - Tigera (Calico Felix).
  1408. Provider string `json:"provider,omitempty"`
  1409. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1410. // unconditionally include in API requests. By default, fields with
  1411. // empty values are omitted from API requests. However, any non-pointer,
  1412. // non-interface field appearing in ForceSendFields will be sent to the
  1413. // server regardless of whether the field is empty or not. This may be
  1414. // used to include empty fields in Patch requests.
  1415. ForceSendFields []string `json:"-"`
  1416. // NullFields is a list of field names (e.g. "Enabled") to include in
  1417. // API requests with the JSON null value. By default, fields with empty
  1418. // values are omitted from API requests. However, any field with an
  1419. // empty value appearing in NullFields will be sent to the server as
  1420. // null. It is an error if a field in this list has a non-empty value.
  1421. // This may be used to include null fields in Patch requests.
  1422. NullFields []string `json:"-"`
  1423. }
  1424. func (s *NetworkPolicy) MarshalJSON() ([]byte, error) {
  1425. type NoMethod NetworkPolicy
  1426. raw := NoMethod(*s)
  1427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1428. }
  1429. // NetworkPolicyConfig: Configuration for NetworkPolicy. This only
  1430. // tracks whether the addon
  1431. // is enabled or not on the Master, it does not track whether network
  1432. // policy
  1433. // is enabled for the nodes.
  1434. type NetworkPolicyConfig struct {
  1435. // Disabled: Whether NetworkPolicy is enabled for this cluster.
  1436. Disabled bool `json:"disabled,omitempty"`
  1437. // ForceSendFields is a list of field names (e.g. "Disabled") to
  1438. // unconditionally include in API requests. By default, fields with
  1439. // empty values are omitted from API requests. However, any non-pointer,
  1440. // non-interface field appearing in ForceSendFields will be sent to the
  1441. // server regardless of whether the field is empty or not. This may be
  1442. // used to include empty fields in Patch requests.
  1443. ForceSendFields []string `json:"-"`
  1444. // NullFields is a list of field names (e.g. "Disabled") to include in
  1445. // API requests with the JSON null value. By default, fields with empty
  1446. // values are omitted from API requests. However, any field with an
  1447. // empty value appearing in NullFields will be sent to the server as
  1448. // null. It is an error if a field in this list has a non-empty value.
  1449. // This may be used to include null fields in Patch requests.
  1450. NullFields []string `json:"-"`
  1451. }
  1452. func (s *NetworkPolicyConfig) MarshalJSON() ([]byte, error) {
  1453. type NoMethod NetworkPolicyConfig
  1454. raw := NoMethod(*s)
  1455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1456. }
  1457. // NodeConfig: Parameters that describe the nodes in a cluster.
  1458. type NodeConfig struct {
  1459. // Accelerators: A list of hardware accelerators to be attached to each
  1460. // node.
  1461. // See https://cloud.google.com/compute/docs/gpus for more information
  1462. // about
  1463. // support for GPUs.
  1464. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  1465. // DiskSizeGb: Size of the disk attached to each node, specified in
  1466. // GB.
  1467. // The smallest allowed disk size is 10GB.
  1468. //
  1469. // If unspecified, the default disk size is 100GB.
  1470. DiskSizeGb int64 `json:"diskSizeGb,omitempty"`
  1471. // ImageType: The image type to use for this node. Note that for a given
  1472. // image type,
  1473. // the latest version of it will be used.
  1474. ImageType string `json:"imageType,omitempty"`
  1475. // Labels: The map of Kubernetes labels (key/value pairs) to be applied
  1476. // to each node.
  1477. // These will added in addition to any default label(s) that
  1478. // Kubernetes may apply to the node.
  1479. // In case of conflict in label keys, the applied set may differ
  1480. // depending on
  1481. // the Kubernetes version -- it's best to assume the behavior is
  1482. // undefined
  1483. // and conflicts should be avoided.
  1484. // For more information, including usage and the valid values,
  1485. // see:
  1486. // https://kubernetes.io/docs/concepts/overview/working-with-objects
  1487. // /labels/
  1488. Labels map[string]string `json:"labels,omitempty"`
  1489. // LocalSsdCount: The number of local SSD disks to be attached to the
  1490. // node.
  1491. //
  1492. // The limit for this value is dependant upon the maximum number
  1493. // of
  1494. // disks available on a machine per zone.
  1495. // See:
  1496. // https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_l
  1497. // imits
  1498. // for more information.
  1499. LocalSsdCount int64 `json:"localSsdCount,omitempty"`
  1500. // MachineType: The name of a Google Compute Engine
  1501. // [machine
  1502. // type](/compute/docs/machine-types) (e.g.
  1503. // `n1-standard-1`).
  1504. //
  1505. // If unspecified, the default machine type is
  1506. // `n1-standard-1`.
  1507. MachineType string `json:"machineType,omitempty"`
  1508. // Metadata: The metadata key/value pairs assigned to instances in the
  1509. // cluster.
  1510. //
  1511. // Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128
  1512. // bytes
  1513. // in length. These are reflected as part of a URL in the metadata
  1514. // server.
  1515. // Additionally, to avoid ambiguity, keys must not conflict with any
  1516. // other
  1517. // metadata keys for the project or be one of the reserved keys:
  1518. // "cluster-location"
  1519. // "cluster-name"
  1520. // "cluster-uid"
  1521. // "configure-sh"
  1522. // "gci-update-strategy"
  1523. // "gci-ensure-gke-docker"
  1524. // "instance-template"
  1525. // "kube-env"
  1526. // "startup-script"
  1527. // "user-data"
  1528. //
  1529. // Values are free-form strings, and only have meaning as interpreted
  1530. // by
  1531. // the image running in the instance. The only restriction placed on
  1532. // them is
  1533. // that each value's size must be less than or equal to 32 KB.
  1534. //
  1535. // The total size of all keys and values must be less than 512 KB.
  1536. Metadata map[string]string `json:"metadata,omitempty"`
  1537. // MinCpuPlatform: Minimum CPU platform to be used by this instance. The
  1538. // instance may be
  1539. // scheduled on the specified or newer CPU platform. Applicable values
  1540. // are the
  1541. // friendly names of CPU platforms, such as
  1542. // <code>minCpuPlatform: &quot;Intel Haswell&quot;</code>
  1543. // or
  1544. // <code>minCpuPlatform: &quot;Intel Sandy Bridge&quot;</code>. For
  1545. // more
  1546. // information, read [how to specify min
  1547. // CPU
  1548. // platform](https://cloud.google.com/compute/docs/instances/specify-
  1549. // min-cpu-platform)
  1550. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1551. // OauthScopes: The set of Google API scopes to be made available on all
  1552. // of the
  1553. // node VMs under the "default" service account.
  1554. //
  1555. // The following scopes are recommended, but not required, and by
  1556. // default are
  1557. // not included:
  1558. //
  1559. // * `https://www.googleapis.com/auth/compute` is required for
  1560. // mounting
  1561. // persistent storage on your nodes.
  1562. // * `https://www.googleapis.com/auth/devstorage.read_only` is required
  1563. // for
  1564. // communicating with **gcr.io**
  1565. // (the [Google Container Registry](/container-registry/)).
  1566. //
  1567. // If unspecified, no scopes are added, unless Cloud Logging or
  1568. // Cloud
  1569. // Monitoring are enabled, in which case their required scopes will be
  1570. // added.
  1571. OauthScopes []string `json:"oauthScopes,omitempty"`
  1572. // Preemptible: Whether the nodes are created as preemptible VM
  1573. // instances.
  1574. // See:
  1575. // https://cloud.google.com/compute/docs/instances/preemptible for
  1576. // more
  1577. // information about preemptible VM instances.
  1578. Preemptible bool `json:"preemptible,omitempty"`
  1579. // ServiceAccount: The Google Cloud Platform Service Account to be used
  1580. // by the node VMs. If
  1581. // no Service Account is specified, the "default" service account is
  1582. // used.
  1583. ServiceAccount string `json:"serviceAccount,omitempty"`
  1584. // Tags: The list of instance tags applied to all nodes. Tags are used
  1585. // to identify
  1586. // valid sources or targets for network firewalls and are specified
  1587. // by
  1588. // the client during cluster or node pool creation. Each tag within the
  1589. // list
  1590. // must comply with RFC1035.
  1591. Tags []string `json:"tags,omitempty"`
  1592. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1593. // unconditionally include in API requests. By default, fields with
  1594. // empty values are omitted from API requests. However, any non-pointer,
  1595. // non-interface field appearing in ForceSendFields will be sent to the
  1596. // server regardless of whether the field is empty or not. This may be
  1597. // used to include empty fields in Patch requests.
  1598. ForceSendFields []string `json:"-"`
  1599. // NullFields is a list of field names (e.g. "Accelerators") to include
  1600. // in API requests with the JSON null value. By default, fields with
  1601. // empty values are omitted from API requests. However, any field with
  1602. // an empty value appearing in NullFields will be sent to the server as
  1603. // null. It is an error if a field in this list has a non-empty value.
  1604. // This may be used to include null fields in Patch requests.
  1605. NullFields []string `json:"-"`
  1606. }
  1607. func (s *NodeConfig) MarshalJSON() ([]byte, error) {
  1608. type NoMethod NodeConfig
  1609. raw := NoMethod(*s)
  1610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1611. }
  1612. // NodeManagement: NodeManagement defines the set of node management
  1613. // services turned on for the
  1614. // node pool.
  1615. type NodeManagement struct {
  1616. // AutoRepair: A flag that specifies whether the node auto-repair is
  1617. // enabled for the node
  1618. // pool. If enabled, the nodes in this node pool will be monitored and,
  1619. // if
  1620. // they fail health checks too many times, an automatic repair action
  1621. // will be
  1622. // triggered.
  1623. AutoRepair bool `json:"autoRepair,omitempty"`
  1624. // AutoUpgrade: A flag that specifies whether node auto-upgrade is
  1625. // enabled for the node
  1626. // pool. If enabled, node auto-upgrade helps keep the nodes in your node
  1627. // pool
  1628. // up to date with the latest release version of Kubernetes.
  1629. AutoUpgrade bool `json:"autoUpgrade,omitempty"`
  1630. // UpgradeOptions: Specifies the Auto Upgrade knobs for the node pool.
  1631. UpgradeOptions *AutoUpgradeOptions `json:"upgradeOptions,omitempty"`
  1632. // ForceSendFields is a list of field names (e.g. "AutoRepair") to
  1633. // unconditionally include in API requests. By default, fields with
  1634. // empty values are omitted from API requests. However, any non-pointer,
  1635. // non-interface field appearing in ForceSendFields will be sent to the
  1636. // server regardless of whether the field is empty or not. This may be
  1637. // used to include empty fields in Patch requests.
  1638. ForceSendFields []string `json:"-"`
  1639. // NullFields is a list of field names (e.g. "AutoRepair") to include in
  1640. // API requests with the JSON null value. By default, fields with empty
  1641. // values are omitted from API requests. However, any field with an
  1642. // empty value appearing in NullFields will be sent to the server as
  1643. // null. It is an error if a field in this list has a non-empty value.
  1644. // This may be used to include null fields in Patch requests.
  1645. NullFields []string `json:"-"`
  1646. }
  1647. func (s *NodeManagement) MarshalJSON() ([]byte, error) {
  1648. type NoMethod NodeManagement
  1649. raw := NoMethod(*s)
  1650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1651. }
  1652. // NodePool: NodePool contains the name and configuration for a
  1653. // cluster's node pool.
  1654. // Node pools are a set of nodes (i.e. VM's), with a common
  1655. // configuration and
  1656. // specification, under the control of the cluster master. They may have
  1657. // a set
  1658. // of Kubernetes labels applied to them, which may be used to reference
  1659. // them
  1660. // during pod scheduling. They may also be resized up or down, to
  1661. // accommodate
  1662. // the workload.
  1663. type NodePool struct {
  1664. // Autoscaling: Autoscaler configuration for this NodePool. Autoscaler
  1665. // is enabled
  1666. // only if a valid configuration is present.
  1667. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  1668. // Config: The node configuration of the pool.
  1669. Config *NodeConfig `json:"config,omitempty"`
  1670. // InitialNodeCount: The initial node count for the pool. You must
  1671. // ensure that your
  1672. // Compute Engine <a href="/compute/docs/resource-quotas">resource
  1673. // quota</a>
  1674. // is sufficient for this number of instances. You must also have
  1675. // available
  1676. // firewall and routes quota.
  1677. InitialNodeCount int64 `json:"initialNodeCount,omitempty"`
  1678. // InstanceGroupUrls: [Output only] The resource URLs of the [managed
  1679. // instance
  1680. // groups](/compute/docs/instance-groups/creating-groups-of-mana
  1681. // ged-instances)
  1682. // associated with this node pool.
  1683. InstanceGroupUrls []string `json:"instanceGroupUrls,omitempty"`
  1684. // Management: NodeManagement configuration for this NodePool.
  1685. Management *NodeManagement `json:"management,omitempty"`
  1686. // Name: The name of the node pool.
  1687. Name string `json:"name,omitempty"`
  1688. // SelfLink: [Output only] Server-defined URL for the resource.
  1689. SelfLink string `json:"selfLink,omitempty"`
  1690. // Status: [Output only] The status of the nodes in this pool instance.
  1691. //
  1692. // Possible values:
  1693. // "STATUS_UNSPECIFIED" - Not set.
  1694. // "PROVISIONING" - The PROVISIONING state indicates the node pool is
  1695. // being created.
  1696. // "RUNNING" - The RUNNING state indicates the node pool has been
  1697. // created
  1698. // and is fully usable.
  1699. // "RUNNING_WITH_ERROR" - The RUNNING_WITH_ERROR state indicates the
  1700. // node pool has been created
  1701. // and is partially usable. Some error state has occurred and
  1702. // some
  1703. // functionality may be impaired. Customer may need to reissue a
  1704. // request
  1705. // or trigger a new update.
  1706. // "RECONCILING" - The RECONCILING state indicates that some work is
  1707. // actively being done on
  1708. // the node pool, such as upgrading node software. Details can
  1709. // be found in the `statusMessage` field.
  1710. // "STOPPING" - The STOPPING state indicates the node pool is being
  1711. // deleted.
  1712. // "ERROR" - The ERROR state indicates the node pool may be unusable.
  1713. // Details
  1714. // can be found in the `statusMessage` field.
  1715. Status string `json:"status,omitempty"`
  1716. // StatusMessage: [Output only] Additional information about the current
  1717. // status of this
  1718. // node pool instance, if available.
  1719. StatusMessage string `json:"statusMessage,omitempty"`
  1720. // Version: The version of the Kubernetes of this node.
  1721. Version string `json:"version,omitempty"`
  1722. // ServerResponse contains the HTTP response code and headers from the
  1723. // server.
  1724. googleapi.ServerResponse `json:"-"`
  1725. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  1726. // unconditionally include in API requests. By default, fields with
  1727. // empty values are omitted from API requests. However, any non-pointer,
  1728. // non-interface field appearing in ForceSendFields will be sent to the
  1729. // server regardless of whether the field is empty or not. This may be
  1730. // used to include empty fields in Patch requests.
  1731. ForceSendFields []string `json:"-"`
  1732. // NullFields is a list of field names (e.g. "Autoscaling") to include
  1733. // in API requests with the JSON null value. By default, fields with
  1734. // empty values are omitted from API requests. However, any field with
  1735. // an empty value appearing in NullFields will be sent to the server as
  1736. // null. It is an error if a field in this list has a non-empty value.
  1737. // This may be used to include null fields in Patch requests.
  1738. NullFields []string `json:"-"`
  1739. }
  1740. func (s *NodePool) MarshalJSON() ([]byte, error) {
  1741. type NoMethod NodePool
  1742. raw := NoMethod(*s)
  1743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1744. }
  1745. // NodePoolAutoscaling: NodePoolAutoscaling contains information
  1746. // required by cluster autoscaler to
  1747. // adjust the size of the node pool to the current cluster usage.
  1748. type NodePoolAutoscaling struct {
  1749. // Enabled: Is autoscaling enabled for this node pool.
  1750. Enabled bool `json:"enabled,omitempty"`
  1751. // MaxNodeCount: Maximum number of nodes in the NodePool. Must be >=
  1752. // min_node_count. There
  1753. // has to enough quota to scale up the cluster.
  1754. MaxNodeCount int64 `json:"maxNodeCount,omitempty"`
  1755. // MinNodeCount: Minimum number of nodes in the NodePool. Must be >= 1
  1756. // and <=
  1757. // max_node_count.
  1758. MinNodeCount int64 `json:"minNodeCount,omitempty"`
  1759. // ForceSendFields is a list of field names (e.g. "Enabled") to
  1760. // unconditionally include in API requests. By default, fields with
  1761. // empty values are omitted from API requests. However, any non-pointer,
  1762. // non-interface field appearing in ForceSendFields will be sent to the
  1763. // server regardless of whether the field is empty or not. This may be
  1764. // used to include empty fields in Patch requests.
  1765. ForceSendFields []string `json:"-"`
  1766. // NullFields is a list of field names (e.g. "Enabled") to include in
  1767. // API requests with the JSON null value. By default, fields with empty
  1768. // values are omitted from API requests. However, any field with an
  1769. // empty value appearing in NullFields will be sent to the server as
  1770. // null. It is an error if a field in this list has a non-empty value.
  1771. // This may be used to include null fields in Patch requests.
  1772. NullFields []string `json:"-"`
  1773. }
  1774. func (s *NodePoolAutoscaling) MarshalJSON() ([]byte, error) {
  1775. type NoMethod NodePoolAutoscaling
  1776. raw := NoMethod(*s)
  1777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1778. }
  1779. // Operation: This operation resource represents operations that may
  1780. // have happened or are
  1781. // happening on the cluster. All fields are output only.
  1782. type Operation struct {
  1783. // Detail: Detailed operation progress, if available.
  1784. Detail string `json:"detail,omitempty"`
  1785. // EndTime: [Output only] The time the operation completed,
  1786. // in
  1787. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  1788. EndTime string `json:"endTime,omitempty"`
  1789. // Location: [Output only] The name of the Google Compute
  1790. // Engine
  1791. // [zone](/compute/docs/regions-zones/regions-zones#available)
  1792. // or
  1793. // [region](/compute/docs/regions-zones/regions-zones#available) in
  1794. // which
  1795. // the cluster resides.
  1796. Location string `json:"location,omitempty"`
  1797. // Name: The server-assigned ID for the operation.
  1798. Name string `json:"name,omitempty"`
  1799. // OperationType: The operation type.
  1800. //
  1801. // Possible values:
  1802. // "TYPE_UNSPECIFIED" - Not set.
  1803. // "CREATE_CLUSTER" - Cluster create.
  1804. // "DELETE_CLUSTER" - Cluster delete.
  1805. // "UPGRADE_MASTER" - A master upgrade.
  1806. // "UPGRADE_NODES" - A node upgrade.
  1807. // "REPAIR_CLUSTER" - Cluster repair.
  1808. // "UPDATE_CLUSTER" - Cluster update.
  1809. // "CREATE_NODE_POOL" - Node pool create.
  1810. // "DELETE_NODE_POOL" - Node pool delete.
  1811. // "SET_NODE_POOL_MANAGEMENT" - Set node pool management.
  1812. // "AUTO_REPAIR_NODES" - Automatic node pool repair.
  1813. // "AUTO_UPGRADE_NODES" - Automatic node upgrade.
  1814. // "SET_LABELS" - Set labels.
  1815. // "SET_MASTER_AUTH" - Set/generate master auth materials
  1816. // "SET_NODE_POOL_SIZE" - Set node pool size.
  1817. // "SET_NETWORK_POLICY" - Updates network policy for a cluster.
  1818. // "SET_MAINTENANCE_POLICY" - Set the maintenance policy.
  1819. OperationType string `json:"operationType,omitempty"`
  1820. // SelfLink: Server-defined URL for the resource.
  1821. SelfLink string `json:"selfLink,omitempty"`
  1822. // StartTime: [Output only] The time the operation started,
  1823. // in
  1824. // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format.
  1825. StartTime string `json:"startTime,omitempty"`
  1826. // Status: The current status of the operation.
  1827. //
  1828. // Possible values:
  1829. // "STATUS_UNSPECIFIED" - Not set.
  1830. // "PENDING" - The operation has been created.
  1831. // "RUNNING" - The operation is currently running.
  1832. // "DONE" - The operation is done, either cancelled or completed.
  1833. // "ABORTING" - The operation is aborting.
  1834. Status string `json:"status,omitempty"`
  1835. // StatusMessage: If an error has occurred, a textual description of the
  1836. // error.
  1837. StatusMessage string `json:"statusMessage,omitempty"`
  1838. // TargetLink: Server-defined URL for the target of the operation.
  1839. TargetLink string `json:"targetLink,omitempty"`
  1840. // Zone: The name of the Google Compute
  1841. // Engine
  1842. // [zone](/compute/docs/zones#available) in which the operation
  1843. // is taking place.
  1844. // This field is deprecated, use location instead.
  1845. Zone string `json:"zone,omitempty"`
  1846. // ServerResponse contains the HTTP response code and headers from the
  1847. // server.
  1848. googleapi.ServerResponse `json:"-"`
  1849. // ForceSendFields is a list of field names (e.g. "Detail") to
  1850. // unconditionally include in API requests. By default, fields with
  1851. // empty values are omitted from API requests. However, any non-pointer,
  1852. // non-interface field appearing in ForceSendFields will be sent to the
  1853. // server regardless of whether the field is empty or not. This may be
  1854. // used to include empty fields in Patch requests.
  1855. ForceSendFields []string `json:"-"`
  1856. // NullFields is a list of field names (e.g. "Detail") to include in API
  1857. // requests with the JSON null value. By default, fields with empty
  1858. // values are omitted from API requests. However, any field with an
  1859. // empty value appearing in NullFields will be sent to the server as
  1860. // null. It is an error if a field in this list has a non-empty value.
  1861. // This may be used to include null fields in Patch requests.
  1862. NullFields []string `json:"-"`
  1863. }
  1864. func (s *Operation) MarshalJSON() ([]byte, error) {
  1865. type NoMethod Operation
  1866. raw := NoMethod(*s)
  1867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1868. }
  1869. // RollbackNodePoolUpgradeRequest: RollbackNodePoolUpgradeRequest
  1870. // rollbacks the previously Aborted or Failed
  1871. // NodePool upgrade. This will be an no-op if the last upgrade
  1872. // successfully
  1873. // completed.
  1874. type RollbackNodePoolUpgradeRequest struct {
  1875. // ClusterId: Deprecated. The name of the cluster to rollback.
  1876. // This field has been deprecated and replaced by the name field.
  1877. ClusterId string `json:"clusterId,omitempty"`
  1878. // Name: The name (project, location, cluster, node pool id) of the node
  1879. // poll to
  1880. // rollback upgrade.
  1881. // Specified in the format
  1882. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  1883. Name string `json:"name,omitempty"`
  1884. // NodePoolId: Deprecated. The name of the node pool to rollback.
  1885. // This field has been deprecated and replaced by the name field.
  1886. NodePoolId string `json:"nodePoolId,omitempty"`
  1887. // ProjectId: Deprecated. The Google Developers Console [project ID or
  1888. // project
  1889. // number](https://support.google.com/cloud/answer/6158840).
  1890. // This
  1891. // field has been deprecated and replaced by the name field.
  1892. ProjectId string `json:"projectId,omitempty"`
  1893. // Zone: Deprecated. The name of the Google Compute
  1894. // Engine
  1895. // [zone](/compute/docs/zones#available) in which the
  1896. // cluster
  1897. // resides.
  1898. // This field has been deprecated and replaced by the name field.
  1899. Zone string `json:"zone,omitempty"`
  1900. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  1901. // unconditionally include in API requests. By default, fields with
  1902. // empty values are omitted from API requests. However, any non-pointer,
  1903. // non-interface field appearing in ForceSendFields will be sent to the
  1904. // server regardless of whether the field is empty or not. This may be
  1905. // used to include empty fields in Patch requests.
  1906. ForceSendFields []string `json:"-"`
  1907. // NullFields is a list of field names (e.g. "ClusterId") to include in
  1908. // API requests with the JSON null value. By default, fields with empty
  1909. // values are omitted from API requests. However, any field with an
  1910. // empty value appearing in NullFields will be sent to the server as
  1911. // null. It is an error if a field in this list has a non-empty value.
  1912. // This may be used to include null fields in Patch requests.
  1913. NullFields []string `json:"-"`
  1914. }
  1915. func (s *RollbackNodePoolUpgradeRequest) MarshalJSON() ([]byte, error) {
  1916. type NoMethod RollbackNodePoolUpgradeRequest
  1917. raw := NoMethod(*s)
  1918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1919. }
  1920. // ServerConfig: Kubernetes Engine service configuration.
  1921. type ServerConfig struct {
  1922. // DefaultClusterVersion: Version of Kubernetes the service deploys by
  1923. // default.
  1924. DefaultClusterVersion string `json:"defaultClusterVersion,omitempty"`
  1925. // DefaultImageType: Default image type.
  1926. DefaultImageType string `json:"defaultImageType,omitempty"`
  1927. // ValidImageTypes: List of valid image types.
  1928. ValidImageTypes []string `json:"validImageTypes,omitempty"`
  1929. // ValidMasterVersions: List of valid master versions.
  1930. ValidMasterVersions []string `json:"validMasterVersions,omitempty"`
  1931. // ValidNodeVersions: List of valid node upgrade target versions.
  1932. ValidNodeVersions []string `json:"validNodeVersions,omitempty"`
  1933. // ServerResponse contains the HTTP response code and headers from the
  1934. // server.
  1935. googleapi.ServerResponse `json:"-"`
  1936. // ForceSendFields is a list of field names (e.g.
  1937. // "DefaultClusterVersion") to unconditionally include in API requests.
  1938. // By default, fields with empty values are omitted from API requests.
  1939. // However, any non-pointer, non-interface field appearing in
  1940. // ForceSendFields will be sent to the server regardless of whether the
  1941. // field is empty or not. This may be used to include empty fields in
  1942. // Patch requests.
  1943. ForceSendFields []string `json:"-"`
  1944. // NullFields is a list of field names (e.g. "DefaultClusterVersion") to
  1945. // include in API requests with the JSON null value. By default, fields
  1946. // with empty values are omitted from API requests. However, any field
  1947. // with an empty value appearing in NullFields will be sent to the
  1948. // server as null. It is an error if a field in this list has a
  1949. // non-empty value. This may be used to include null fields in Patch
  1950. // requests.
  1951. NullFields []string `json:"-"`
  1952. }
  1953. func (s *ServerConfig) MarshalJSON() ([]byte, error) {
  1954. type NoMethod ServerConfig
  1955. raw := NoMethod(*s)
  1956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1957. }
  1958. // SetAddonsConfigRequest: SetAddonsConfigRequest sets the addons
  1959. // associated with the cluster.
  1960. type SetAddonsConfigRequest struct {
  1961. // AddonsConfig: The desired configurations for the various addons
  1962. // available to run in the
  1963. // cluster.
  1964. AddonsConfig *AddonsConfig `json:"addonsConfig,omitempty"`
  1965. // ClusterId: Deprecated. The name of the cluster to upgrade.
  1966. // This field has been deprecated and replaced by the name field.
  1967. ClusterId string `json:"clusterId,omitempty"`
  1968. // Name: The name (project, location, cluster) of the cluster to set
  1969. // addons.
  1970. // Specified in the format 'projects/*/locations/*/clusters/*'.
  1971. Name string `json:"name,omitempty"`
  1972. // ProjectId: Deprecated. The Google Developers Console [project ID or
  1973. // project
  1974. // number](https://support.google.com/cloud/answer/6158840).
  1975. // This
  1976. // field has been deprecated and replaced by the name field.
  1977. ProjectId string `json:"projectId,omitempty"`
  1978. // Zone: Deprecated. The name of the Google Compute
  1979. // Engine
  1980. // [zone](/compute/docs/zones#available) in which the
  1981. // cluster
  1982. // resides.
  1983. // This field has been deprecated and replaced by the name field.
  1984. Zone string `json:"zone,omitempty"`
  1985. // ForceSendFields is a list of field names (e.g. "AddonsConfig") to
  1986. // unconditionally include in API requests. By default, fields with
  1987. // empty values are omitted from API requests. However, any non-pointer,
  1988. // non-interface field appearing in ForceSendFields will be sent to the
  1989. // server regardless of whether the field is empty or not. This may be
  1990. // used to include empty fields in Patch requests.
  1991. ForceSendFields []string `json:"-"`
  1992. // NullFields is a list of field names (e.g. "AddonsConfig") to include
  1993. // in API requests with the JSON null value. By default, fields with
  1994. // empty values are omitted from API requests. However, any field with
  1995. // an empty value appearing in NullFields will be sent to the server as
  1996. // null. It is an error if a field in this list has a non-empty value.
  1997. // This may be used to include null fields in Patch requests.
  1998. NullFields []string `json:"-"`
  1999. }
  2000. func (s *SetAddonsConfigRequest) MarshalJSON() ([]byte, error) {
  2001. type NoMethod SetAddonsConfigRequest
  2002. raw := NoMethod(*s)
  2003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2004. }
  2005. // SetLabelsRequest: SetLabelsRequest sets the Google Cloud Platform
  2006. // labels on a Google Container
  2007. // Engine cluster, which will in turn set them for Google Compute
  2008. // Engine
  2009. // resources used by that cluster
  2010. type SetLabelsRequest struct {
  2011. // ClusterId: Deprecated. The name of the cluster.
  2012. // This field has been deprecated and replaced by the name field.
  2013. ClusterId string `json:"clusterId,omitempty"`
  2014. // LabelFingerprint: The fingerprint of the previous set of labels for
  2015. // this resource,
  2016. // used to detect conflicts. The fingerprint is initially generated
  2017. // by
  2018. // Kubernetes Engine and changes after every request to modify or
  2019. // update
  2020. // labels. You must always provide an up-to-date fingerprint hash
  2021. // when
  2022. // updating or changing labels. Make a <code>get()</code> request to
  2023. // the
  2024. // resource to get the latest fingerprint.
  2025. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  2026. // Name: The name (project, location, cluster id) of the cluster to set
  2027. // labels.
  2028. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2029. Name string `json:"name,omitempty"`
  2030. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2031. // project
  2032. // number](https://developers.google.com/console/help/new/#projec
  2033. // tnumber).
  2034. // This field has been deprecated and replaced by the name field.
  2035. ProjectId string `json:"projectId,omitempty"`
  2036. // ResourceLabels: The labels to set for that cluster.
  2037. ResourceLabels map[string]string `json:"resourceLabels,omitempty"`
  2038. // Zone: Deprecated. The name of the Google Compute
  2039. // Engine
  2040. // [zone](/compute/docs/zones#available) in which the
  2041. // cluster
  2042. // resides.
  2043. // This field has been deprecated and replaced by the name field.
  2044. Zone string `json:"zone,omitempty"`
  2045. // ForceSendFields is a list of field names (e.g. "ClusterId") 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. "ClusterId") to include in
  2053. // API 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 *SetLabelsRequest) MarshalJSON() ([]byte, error) {
  2061. type NoMethod SetLabelsRequest
  2062. raw := NoMethod(*s)
  2063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2064. }
  2065. // SetLegacyAbacRequest: SetLegacyAbacRequest enables or disables the
  2066. // ABAC authorization mechanism for
  2067. // a cluster.
  2068. type SetLegacyAbacRequest struct {
  2069. // ClusterId: Deprecated. The name of the cluster to update.
  2070. // This field has been deprecated and replaced by the name field.
  2071. ClusterId string `json:"clusterId,omitempty"`
  2072. // Enabled: Whether ABAC authorization will be enabled in the cluster.
  2073. Enabled bool `json:"enabled,omitempty"`
  2074. // Name: The name (project, location, cluster id) of the cluster to set
  2075. // legacy abac.
  2076. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2077. Name string `json:"name,omitempty"`
  2078. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2079. // project
  2080. // number](https://support.google.com/cloud/answer/6158840).
  2081. // This
  2082. // field has been deprecated and replaced by the name field.
  2083. ProjectId string `json:"projectId,omitempty"`
  2084. // Zone: Deprecated. The name of the Google Compute
  2085. // Engine
  2086. // [zone](/compute/docs/zones#available) in which the
  2087. // cluster
  2088. // resides.
  2089. // This field has been deprecated and replaced by the name field.
  2090. Zone string `json:"zone,omitempty"`
  2091. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2092. // unconditionally include in API requests. By default, fields with
  2093. // empty values are omitted from API requests. However, any non-pointer,
  2094. // non-interface field appearing in ForceSendFields will be sent to the
  2095. // server regardless of whether the field is empty or not. This may be
  2096. // used to include empty fields in Patch requests.
  2097. ForceSendFields []string `json:"-"`
  2098. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2099. // API requests with the JSON null value. By default, fields with empty
  2100. // values are omitted from API requests. However, any field with an
  2101. // empty value appearing in NullFields will be sent to the server as
  2102. // null. It is an error if a field in this list has a non-empty value.
  2103. // This may be used to include null fields in Patch requests.
  2104. NullFields []string `json:"-"`
  2105. }
  2106. func (s *SetLegacyAbacRequest) MarshalJSON() ([]byte, error) {
  2107. type NoMethod SetLegacyAbacRequest
  2108. raw := NoMethod(*s)
  2109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2110. }
  2111. // SetLocationsRequest: SetLocationsRequest sets the locations of the
  2112. // cluster.
  2113. type SetLocationsRequest struct {
  2114. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2115. // This field has been deprecated and replaced by the name field.
  2116. ClusterId string `json:"clusterId,omitempty"`
  2117. // Locations: The desired list of Google Compute
  2118. // Engine
  2119. // [locations](/compute/docs/zones#available) in which the cluster's
  2120. // nodes
  2121. // should be located. Changing the locations a cluster is in will
  2122. // result
  2123. // in nodes being either created or removed from the cluster, depending
  2124. // on
  2125. // whether locations are being added or removed.
  2126. //
  2127. // This list must always include the cluster's primary zone.
  2128. Locations []string `json:"locations,omitempty"`
  2129. // Name: The name (project, location, cluster) of the cluster to set
  2130. // locations.
  2131. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2132. Name string `json:"name,omitempty"`
  2133. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2134. // project
  2135. // number](https://support.google.com/cloud/answer/6158840).
  2136. // This
  2137. // field has been deprecated and replaced by the name field.
  2138. ProjectId string `json:"projectId,omitempty"`
  2139. // Zone: Deprecated. The name of the Google Compute
  2140. // Engine
  2141. // [zone](/compute/docs/zones#available) in which the
  2142. // cluster
  2143. // resides.
  2144. // This field has been deprecated and replaced by the name field.
  2145. Zone string `json:"zone,omitempty"`
  2146. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2147. // unconditionally include in API requests. By default, fields with
  2148. // empty values are omitted from API requests. However, any non-pointer,
  2149. // non-interface field appearing in ForceSendFields will be sent to the
  2150. // server regardless of whether the field is empty or not. This may be
  2151. // used to include empty fields in Patch requests.
  2152. ForceSendFields []string `json:"-"`
  2153. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2154. // API requests with the JSON null value. By default, fields with empty
  2155. // values are omitted from API requests. However, any field with an
  2156. // empty value appearing in NullFields will be sent to the server as
  2157. // null. It is an error if a field in this list has a non-empty value.
  2158. // This may be used to include null fields in Patch requests.
  2159. NullFields []string `json:"-"`
  2160. }
  2161. func (s *SetLocationsRequest) MarshalJSON() ([]byte, error) {
  2162. type NoMethod SetLocationsRequest
  2163. raw := NoMethod(*s)
  2164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2165. }
  2166. // SetLoggingServiceRequest: SetLoggingServiceRequest sets the logging
  2167. // service of a cluster.
  2168. type SetLoggingServiceRequest struct {
  2169. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2170. // This field has been deprecated and replaced by the name field.
  2171. ClusterId string `json:"clusterId,omitempty"`
  2172. // LoggingService: The logging service the cluster should use to write
  2173. // metrics.
  2174. // Currently available options:
  2175. //
  2176. // * "logging.googleapis.com" - the Google Cloud Logging service
  2177. // * "none" - no metrics will be exported from the cluster
  2178. LoggingService string `json:"loggingService,omitempty"`
  2179. // Name: The name (project, location, cluster) of the cluster to set
  2180. // logging.
  2181. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2182. Name string `json:"name,omitempty"`
  2183. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2184. // project
  2185. // number](https://support.google.com/cloud/answer/6158840).
  2186. // This
  2187. // field has been deprecated and replaced by the name field.
  2188. ProjectId string `json:"projectId,omitempty"`
  2189. // Zone: Deprecated. The name of the Google Compute
  2190. // Engine
  2191. // [zone](/compute/docs/zones#available) in which the
  2192. // cluster
  2193. // resides.
  2194. // This field has been deprecated and replaced by the name field.
  2195. Zone string `json:"zone,omitempty"`
  2196. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2197. // unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2204. // API requests with the JSON null value. By default, fields with empty
  2205. // values are omitted from API requests. However, any field with an
  2206. // empty value appearing in NullFields will be sent to the server as
  2207. // null. It is an error if a field in this list has a non-empty value.
  2208. // This may be used to include null fields in Patch requests.
  2209. NullFields []string `json:"-"`
  2210. }
  2211. func (s *SetLoggingServiceRequest) MarshalJSON() ([]byte, error) {
  2212. type NoMethod SetLoggingServiceRequest
  2213. raw := NoMethod(*s)
  2214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2215. }
  2216. // SetMaintenancePolicyRequest: SetMaintenancePolicyRequest sets the
  2217. // maintenance policy for a cluster.
  2218. type SetMaintenancePolicyRequest struct {
  2219. // ClusterId: The name of the cluster to update.
  2220. ClusterId string `json:"clusterId,omitempty"`
  2221. // MaintenancePolicy: The maintenance policy to be set for the cluster.
  2222. // An empty field
  2223. // clears the existing maintenance policy.
  2224. MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy,omitempty"`
  2225. // Name: The name (project, location, cluster id) of the cluster to set
  2226. // maintenance
  2227. // policy.
  2228. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2229. Name string `json:"name,omitempty"`
  2230. // ProjectId: The Google Developers Console [project ID or
  2231. // project
  2232. // number](https://support.google.com/cloud/answer/6158840).
  2233. ProjectId string `json:"projectId,omitempty"`
  2234. // Zone: The name of the Google Compute
  2235. // Engine
  2236. // [zone](/compute/docs/zones#available) in which the cluster
  2237. // resides.
  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 *SetMaintenancePolicyRequest) MarshalJSON() ([]byte, error) {
  2255. type NoMethod SetMaintenancePolicyRequest
  2256. raw := NoMethod(*s)
  2257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2258. }
  2259. // SetMasterAuthRequest: SetMasterAuthRequest updates the admin password
  2260. // of a cluster.
  2261. type SetMasterAuthRequest struct {
  2262. // Action: The exact form of action to be taken on the master auth.
  2263. //
  2264. // Possible values:
  2265. // "UNKNOWN" - Operation is unknown and will error out.
  2266. // "SET_PASSWORD" - Set the password to a user generated value.
  2267. // "GENERATE_PASSWORD" - Generate a new password and set it to that.
  2268. // "SET_USERNAME" - Set the username. If an empty username is
  2269. // provided, basic authentication
  2270. // is disabled for the cluster. If a non-empty username is provided,
  2271. // basic
  2272. // authentication is enabled, with either a provided password or a
  2273. // generated
  2274. // one.
  2275. Action string `json:"action,omitempty"`
  2276. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2277. // This field has been deprecated and replaced by the name field.
  2278. ClusterId string `json:"clusterId,omitempty"`
  2279. // Name: The name (project, location, cluster) of the cluster to set
  2280. // auth.
  2281. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2282. Name string `json:"name,omitempty"`
  2283. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2284. // project
  2285. // number](https://support.google.com/cloud/answer/6158840).
  2286. // This
  2287. // field has been deprecated and replaced by the name field.
  2288. ProjectId string `json:"projectId,omitempty"`
  2289. // Update: A description of the update.
  2290. Update *MasterAuth `json:"update,omitempty"`
  2291. // Zone: Deprecated. The name of the Google Compute
  2292. // Engine
  2293. // [zone](/compute/docs/zones#available) in which the
  2294. // cluster
  2295. // resides.
  2296. // This field has been deprecated and replaced by the name field.
  2297. Zone string `json:"zone,omitempty"`
  2298. // ForceSendFields is a list of field names (e.g. "Action") to
  2299. // unconditionally include in API requests. By default, fields with
  2300. // empty values are omitted from API requests. However, any non-pointer,
  2301. // non-interface field appearing in ForceSendFields will be sent to the
  2302. // server regardless of whether the field is empty or not. This may be
  2303. // used to include empty fields in Patch requests.
  2304. ForceSendFields []string `json:"-"`
  2305. // NullFields is a list of field names (e.g. "Action") to include in API
  2306. // requests with the JSON null value. By default, fields with empty
  2307. // values are omitted from API requests. However, any field with an
  2308. // empty value appearing in NullFields will be sent to the server as
  2309. // null. It is an error if a field in this list has a non-empty value.
  2310. // This may be used to include null fields in Patch requests.
  2311. NullFields []string `json:"-"`
  2312. }
  2313. func (s *SetMasterAuthRequest) MarshalJSON() ([]byte, error) {
  2314. type NoMethod SetMasterAuthRequest
  2315. raw := NoMethod(*s)
  2316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2317. }
  2318. // SetMonitoringServiceRequest: SetMonitoringServiceRequest sets the
  2319. // monitoring service of a cluster.
  2320. type SetMonitoringServiceRequest struct {
  2321. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2322. // This field has been deprecated and replaced by the name field.
  2323. ClusterId string `json:"clusterId,omitempty"`
  2324. // MonitoringService: The monitoring service the cluster should use to
  2325. // write metrics.
  2326. // Currently available options:
  2327. //
  2328. // * "monitoring.googleapis.com" - the Google Cloud Monitoring service
  2329. // * "none" - no metrics will be exported from the cluster
  2330. MonitoringService string `json:"monitoringService,omitempty"`
  2331. // Name: The name (project, location, cluster) of the cluster to set
  2332. // monitoring.
  2333. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2334. Name string `json:"name,omitempty"`
  2335. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2336. // project
  2337. // number](https://support.google.com/cloud/answer/6158840).
  2338. // This
  2339. // field has been deprecated and replaced by the name field.
  2340. ProjectId string `json:"projectId,omitempty"`
  2341. // Zone: Deprecated. The name of the Google Compute
  2342. // Engine
  2343. // [zone](/compute/docs/zones#available) in which the
  2344. // cluster
  2345. // resides.
  2346. // This field has been deprecated and replaced by the name field.
  2347. Zone string `json:"zone,omitempty"`
  2348. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2349. // unconditionally include in API requests. By default, fields with
  2350. // empty values are omitted from API requests. However, any non-pointer,
  2351. // non-interface field appearing in ForceSendFields will be sent to the
  2352. // server regardless of whether the field is empty or not. This may be
  2353. // used to include empty fields in Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2356. // API requests with the JSON null value. By default, fields with empty
  2357. // values are omitted from API requests. However, any field with an
  2358. // empty value appearing in NullFields will be sent to the server as
  2359. // null. It is an error if a field in this list has a non-empty value.
  2360. // This may be used to include null fields in Patch requests.
  2361. NullFields []string `json:"-"`
  2362. }
  2363. func (s *SetMonitoringServiceRequest) MarshalJSON() ([]byte, error) {
  2364. type NoMethod SetMonitoringServiceRequest
  2365. raw := NoMethod(*s)
  2366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2367. }
  2368. // SetNetworkPolicyRequest: SetNetworkPolicyRequest enables/disables
  2369. // network policy for a cluster.
  2370. type SetNetworkPolicyRequest struct {
  2371. // ClusterId: Deprecated. The name of the cluster.
  2372. // This field has been deprecated and replaced by the name field.
  2373. ClusterId string `json:"clusterId,omitempty"`
  2374. // Name: The name (project, location, cluster id) of the cluster to set
  2375. // networking
  2376. // policy. Specified in the format 'projects/*/locations/*/clusters/*'.
  2377. Name string `json:"name,omitempty"`
  2378. // NetworkPolicy: Configuration options for the NetworkPolicy feature.
  2379. NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"`
  2380. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2381. // project
  2382. // number](https://developers.google.com/console/help/new/#projec
  2383. // tnumber).
  2384. // This field has been deprecated and replaced by the name field.
  2385. ProjectId string `json:"projectId,omitempty"`
  2386. // Zone: Deprecated. The name of the Google Compute
  2387. // Engine
  2388. // [zone](/compute/docs/zones#available) in which the
  2389. // cluster
  2390. // resides.
  2391. // This field has been deprecated and replaced by the name field.
  2392. Zone string `json:"zone,omitempty"`
  2393. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2394. // unconditionally include in API requests. By default, fields with
  2395. // empty values are omitted from API requests. However, any non-pointer,
  2396. // non-interface field appearing in ForceSendFields will be sent to the
  2397. // server regardless of whether the field is empty or not. This may be
  2398. // used to include empty fields in Patch requests.
  2399. ForceSendFields []string `json:"-"`
  2400. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2401. // API requests with the JSON null value. By default, fields with empty
  2402. // values are omitted from API requests. However, any field with an
  2403. // empty value appearing in NullFields will be sent to the server as
  2404. // null. It is an error if a field in this list has a non-empty value.
  2405. // This may be used to include null fields in Patch requests.
  2406. NullFields []string `json:"-"`
  2407. }
  2408. func (s *SetNetworkPolicyRequest) MarshalJSON() ([]byte, error) {
  2409. type NoMethod SetNetworkPolicyRequest
  2410. raw := NoMethod(*s)
  2411. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2412. }
  2413. // SetNodePoolAutoscalingRequest: SetNodePoolAutoscalingRequest sets the
  2414. // autoscaler settings of a node pool.
  2415. type SetNodePoolAutoscalingRequest struct {
  2416. // Autoscaling: Autoscaling configuration for the node pool.
  2417. Autoscaling *NodePoolAutoscaling `json:"autoscaling,omitempty"`
  2418. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2419. // This field has been deprecated and replaced by the name field.
  2420. ClusterId string `json:"clusterId,omitempty"`
  2421. // Name: The name (project, location, cluster, node pool) of the node
  2422. // pool to set
  2423. // autoscaler settings. Specified in the
  2424. // format
  2425. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2426. Name string `json:"name,omitempty"`
  2427. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  2428. // This field has been deprecated and replaced by the name field.
  2429. NodePoolId string `json:"nodePoolId,omitempty"`
  2430. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2431. // project
  2432. // number](https://support.google.com/cloud/answer/6158840).
  2433. // This
  2434. // field has been deprecated and replaced by the name field.
  2435. ProjectId string `json:"projectId,omitempty"`
  2436. // Zone: Deprecated. The name of the Google Compute
  2437. // Engine
  2438. // [zone](/compute/docs/zones#available) in which the
  2439. // cluster
  2440. // resides.
  2441. // This field has been deprecated and replaced by the name field.
  2442. Zone string `json:"zone,omitempty"`
  2443. // ForceSendFields is a list of field names (e.g. "Autoscaling") to
  2444. // unconditionally include in API requests. By default, fields with
  2445. // empty values are omitted from API requests. However, any non-pointer,
  2446. // non-interface field appearing in ForceSendFields will be sent to the
  2447. // server regardless of whether the field is empty or not. This may be
  2448. // used to include empty fields in Patch requests.
  2449. ForceSendFields []string `json:"-"`
  2450. // NullFields is a list of field names (e.g. "Autoscaling") to include
  2451. // in API requests with the JSON null value. By default, fields with
  2452. // empty values are omitted from API requests. However, any field with
  2453. // an empty value appearing in NullFields will be sent to the server as
  2454. // null. It is an error if a field in this list has a non-empty value.
  2455. // This may be used to include null fields in Patch requests.
  2456. NullFields []string `json:"-"`
  2457. }
  2458. func (s *SetNodePoolAutoscalingRequest) MarshalJSON() ([]byte, error) {
  2459. type NoMethod SetNodePoolAutoscalingRequest
  2460. raw := NoMethod(*s)
  2461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2462. }
  2463. // SetNodePoolManagementRequest: SetNodePoolManagementRequest sets the
  2464. // node management properties of a node
  2465. // pool.
  2466. type SetNodePoolManagementRequest struct {
  2467. // ClusterId: Deprecated. The name of the cluster to update.
  2468. // This field has been deprecated and replaced by the name field.
  2469. ClusterId string `json:"clusterId,omitempty"`
  2470. // Management: NodeManagement configuration for the node pool.
  2471. Management *NodeManagement `json:"management,omitempty"`
  2472. // Name: The name (project, location, cluster, node pool id) of the node
  2473. // pool to set
  2474. // management properties. Specified in the
  2475. // format
  2476. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2477. Name string `json:"name,omitempty"`
  2478. // NodePoolId: Deprecated. The name of the node pool to update.
  2479. // This field has been deprecated and replaced by the name field.
  2480. NodePoolId string `json:"nodePoolId,omitempty"`
  2481. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2482. // project
  2483. // number](https://support.google.com/cloud/answer/6158840).
  2484. // This
  2485. // field has been deprecated and replaced by the name field.
  2486. ProjectId string `json:"projectId,omitempty"`
  2487. // Zone: Deprecated. The name of the Google Compute
  2488. // Engine
  2489. // [zone](/compute/docs/zones#available) in which the
  2490. // cluster
  2491. // resides.
  2492. // This field has been deprecated and replaced by the name field.
  2493. Zone string `json:"zone,omitempty"`
  2494. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2495. // unconditionally include in API requests. By default, fields with
  2496. // empty values are omitted from API requests. However, any non-pointer,
  2497. // non-interface field appearing in ForceSendFields will be sent to the
  2498. // server regardless of whether the field is empty or not. This may be
  2499. // used to include empty fields in Patch requests.
  2500. ForceSendFields []string `json:"-"`
  2501. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2502. // API requests with the JSON null value. By default, fields with empty
  2503. // values are omitted from API requests. However, any field with an
  2504. // empty value appearing in NullFields will be sent to the server as
  2505. // null. It is an error if a field in this list has a non-empty value.
  2506. // This may be used to include null fields in Patch requests.
  2507. NullFields []string `json:"-"`
  2508. }
  2509. func (s *SetNodePoolManagementRequest) MarshalJSON() ([]byte, error) {
  2510. type NoMethod SetNodePoolManagementRequest
  2511. raw := NoMethod(*s)
  2512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2513. }
  2514. // SetNodePoolSizeRequest: SetNodePoolSizeRequest sets the size a
  2515. // node
  2516. // pool.
  2517. type SetNodePoolSizeRequest struct {
  2518. // ClusterId: Deprecated. The name of the cluster to update.
  2519. // This field has been deprecated and replaced by the name field.
  2520. ClusterId string `json:"clusterId,omitempty"`
  2521. // Name: The name (project, location, cluster, node pool id) of the node
  2522. // pool to set
  2523. // size.
  2524. // Specified in the format
  2525. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2526. Name string `json:"name,omitempty"`
  2527. // NodeCount: The desired node count for the pool.
  2528. NodeCount int64 `json:"nodeCount,omitempty"`
  2529. // NodePoolId: Deprecated. The name of the node pool to update.
  2530. // This field has been deprecated and replaced by the name field.
  2531. NodePoolId string `json:"nodePoolId,omitempty"`
  2532. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2533. // project
  2534. // number](https://support.google.com/cloud/answer/6158840).
  2535. // This
  2536. // field has been deprecated and replaced by the name field.
  2537. ProjectId string `json:"projectId,omitempty"`
  2538. // Zone: Deprecated. The name of the Google Compute
  2539. // Engine
  2540. // [zone](/compute/docs/zones#available) in which the
  2541. // cluster
  2542. // resides.
  2543. // This field has been deprecated and replaced by the name field.
  2544. Zone string `json:"zone,omitempty"`
  2545. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2546. // unconditionally include in API requests. By default, fields with
  2547. // empty values are omitted from API requests. However, any non-pointer,
  2548. // non-interface field appearing in ForceSendFields will be sent to the
  2549. // server regardless of whether the field is empty or not. This may be
  2550. // used to include empty fields in Patch requests.
  2551. ForceSendFields []string `json:"-"`
  2552. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2553. // API requests with the JSON null value. By default, fields with empty
  2554. // values are omitted from API requests. However, any field with an
  2555. // empty value appearing in NullFields will be sent to the server as
  2556. // null. It is an error if a field in this list has a non-empty value.
  2557. // This may be used to include null fields in Patch requests.
  2558. NullFields []string `json:"-"`
  2559. }
  2560. func (s *SetNodePoolSizeRequest) MarshalJSON() ([]byte, error) {
  2561. type NoMethod SetNodePoolSizeRequest
  2562. raw := NoMethod(*s)
  2563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2564. }
  2565. // StartIPRotationRequest: StartIPRotationRequest creates a new IP for
  2566. // the cluster and then performs
  2567. // a node upgrade on each node pool to point to the new IP.
  2568. type StartIPRotationRequest struct {
  2569. // ClusterId: Deprecated. The name of the cluster.
  2570. // This field has been deprecated and replaced by the name field.
  2571. ClusterId string `json:"clusterId,omitempty"`
  2572. // Name: The name (project, location, cluster id) of the cluster to
  2573. // start IP
  2574. // rotation. Specified in the format
  2575. // 'projects/*/locations/*/clusters/*'.
  2576. Name string `json:"name,omitempty"`
  2577. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2578. // project
  2579. // number](https://developers.google.com/console/help/new/#projec
  2580. // tnumber).
  2581. // This field has been deprecated and replaced by the name field.
  2582. ProjectId string `json:"projectId,omitempty"`
  2583. // RotateCredentials: Whether to rotate credentials during IP rotation.
  2584. RotateCredentials bool `json:"rotateCredentials,omitempty"`
  2585. // Zone: Deprecated. The name of the Google Compute
  2586. // Engine
  2587. // [zone](/compute/docs/zones#available) in which the
  2588. // cluster
  2589. // resides.
  2590. // This field has been deprecated and replaced by the name field.
  2591. Zone string `json:"zone,omitempty"`
  2592. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2593. // unconditionally include in API requests. By default, fields with
  2594. // empty values are omitted from API requests. However, any non-pointer,
  2595. // non-interface field appearing in ForceSendFields will be sent to the
  2596. // server regardless of whether the field is empty or not. This may be
  2597. // used to include empty fields in Patch requests.
  2598. ForceSendFields []string `json:"-"`
  2599. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2600. // API requests with the JSON null value. By default, fields with empty
  2601. // values are omitted from API requests. However, any field with an
  2602. // empty value appearing in NullFields will be sent to the server as
  2603. // null. It is an error if a field in this list has a non-empty value.
  2604. // This may be used to include null fields in Patch requests.
  2605. NullFields []string `json:"-"`
  2606. }
  2607. func (s *StartIPRotationRequest) MarshalJSON() ([]byte, error) {
  2608. type NoMethod StartIPRotationRequest
  2609. raw := NoMethod(*s)
  2610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2611. }
  2612. // UpdateClusterRequest: UpdateClusterRequest updates the settings of a
  2613. // cluster.
  2614. type UpdateClusterRequest struct {
  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
  2619. // update.
  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 *ClusterUpdate `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. "ClusterId") 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. "ClusterId") to include in
  2645. // API 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 *UpdateClusterRequest) MarshalJSON() ([]byte, error) {
  2653. type NoMethod UpdateClusterRequest
  2654. raw := NoMethod(*s)
  2655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2656. }
  2657. // UpdateMasterRequest: UpdateMasterRequest updates the master of the
  2658. // cluster.
  2659. type UpdateMasterRequest 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. // MasterVersion: The Kubernetes version to change the master to.
  2664. //
  2665. // Users may specify either explicit versions offered by Kubernetes
  2666. // Engine or
  2667. // version aliases, which have the following behavior:
  2668. //
  2669. // - "latest": picks the highest valid Kubernetes version
  2670. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  2671. // version
  2672. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  2673. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  2674. // - "-": picks the default Kubernetes version
  2675. MasterVersion string `json:"masterVersion,omitempty"`
  2676. // Name: The name (project, location, cluster) of the cluster to
  2677. // update.
  2678. // Specified in the format 'projects/*/locations/*/clusters/*'.
  2679. Name string `json:"name,omitempty"`
  2680. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2681. // project
  2682. // number](https://support.google.com/cloud/answer/6158840).
  2683. // This
  2684. // field has been deprecated and replaced by the name field.
  2685. ProjectId string `json:"projectId,omitempty"`
  2686. // Zone: Deprecated. The name of the Google Compute
  2687. // Engine
  2688. // [zone](/compute/docs/zones#available) in which the
  2689. // cluster
  2690. // resides.
  2691. // This field has been deprecated and replaced by the name field.
  2692. Zone string `json:"zone,omitempty"`
  2693. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2694. // unconditionally include in API requests. By default, fields with
  2695. // empty values are omitted from API requests. However, any non-pointer,
  2696. // non-interface field appearing in ForceSendFields will be sent to the
  2697. // server regardless of whether the field is empty or not. This may be
  2698. // used to include empty fields in Patch requests.
  2699. ForceSendFields []string `json:"-"`
  2700. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2701. // API requests with the JSON null value. By default, fields with empty
  2702. // values are omitted from API requests. However, any field with an
  2703. // empty value appearing in NullFields will be sent to the server as
  2704. // null. It is an error if a field in this list has a non-empty value.
  2705. // This may be used to include null fields in Patch requests.
  2706. NullFields []string `json:"-"`
  2707. }
  2708. func (s *UpdateMasterRequest) MarshalJSON() ([]byte, error) {
  2709. type NoMethod UpdateMasterRequest
  2710. raw := NoMethod(*s)
  2711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2712. }
  2713. // UpdateNodePoolRequest: UpdateNodePoolRequests update a node pool's
  2714. // image and/or version.
  2715. type UpdateNodePoolRequest struct {
  2716. // ClusterId: Deprecated. The name of the cluster to upgrade.
  2717. // This field has been deprecated and replaced by the name field.
  2718. ClusterId string `json:"clusterId,omitempty"`
  2719. // ImageType: The desired image type for the node pool.
  2720. ImageType string `json:"imageType,omitempty"`
  2721. // Name: The name (project, location, cluster, node pool) of the node
  2722. // pool to
  2723. // update. Specified in the
  2724. // format
  2725. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  2726. Name string `json:"name,omitempty"`
  2727. // NodePoolId: Deprecated. The name of the node pool to upgrade.
  2728. // This field has been deprecated and replaced by the name field.
  2729. NodePoolId string `json:"nodePoolId,omitempty"`
  2730. // NodeVersion: The Kubernetes version to change the nodes to (typically
  2731. // an
  2732. // upgrade).
  2733. //
  2734. // Users may specify either explicit versions offered by Kubernetes
  2735. // Engine or
  2736. // version aliases, which have the following behavior:
  2737. //
  2738. // - "latest": picks the highest valid Kubernetes version
  2739. // - "1.X": picks the highest valid patch+gke.N patch in the 1.X
  2740. // version
  2741. // - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
  2742. // - "1.X.Y-gke.N": picks an explicit Kubernetes version
  2743. // - "-": picks the Kubernetes master version
  2744. NodeVersion string `json:"nodeVersion,omitempty"`
  2745. // ProjectId: Deprecated. The Google Developers Console [project ID or
  2746. // project
  2747. // number](https://support.google.com/cloud/answer/6158840).
  2748. // This
  2749. // field has been deprecated and replaced by the name field.
  2750. ProjectId string `json:"projectId,omitempty"`
  2751. // Zone: Deprecated. The name of the Google Compute
  2752. // Engine
  2753. // [zone](/compute/docs/zones#available) in which the
  2754. // cluster
  2755. // resides.
  2756. // This field has been deprecated and replaced by the name field.
  2757. Zone string `json:"zone,omitempty"`
  2758. // ForceSendFields is a list of field names (e.g. "ClusterId") to
  2759. // unconditionally include in API requests. By default, fields with
  2760. // empty values are omitted from API requests. However, any non-pointer,
  2761. // non-interface field appearing in ForceSendFields will be sent to the
  2762. // server regardless of whether the field is empty or not. This may be
  2763. // used to include empty fields in Patch requests.
  2764. ForceSendFields []string `json:"-"`
  2765. // NullFields is a list of field names (e.g. "ClusterId") to include in
  2766. // API requests with the JSON null value. By default, fields with empty
  2767. // values are omitted from API requests. However, any field with an
  2768. // empty value appearing in NullFields will be sent to the server as
  2769. // null. It is an error if a field in this list has a non-empty value.
  2770. // This may be used to include null fields in Patch requests.
  2771. NullFields []string `json:"-"`
  2772. }
  2773. func (s *UpdateNodePoolRequest) MarshalJSON() ([]byte, error) {
  2774. type NoMethod UpdateNodePoolRequest
  2775. raw := NoMethod(*s)
  2776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2777. }
  2778. // method id "container.projects.locations.getServerConfig":
  2779. type ProjectsLocationsGetServerConfigCall struct {
  2780. s *Service
  2781. name string
  2782. urlParams_ gensupport.URLParams
  2783. ifNoneMatch_ string
  2784. ctx_ context.Context
  2785. header_ http.Header
  2786. }
  2787. // GetServerConfig: Returns configuration info about the Kubernetes
  2788. // Engine service.
  2789. func (r *ProjectsLocationsService) GetServerConfig(name string) *ProjectsLocationsGetServerConfigCall {
  2790. c := &ProjectsLocationsGetServerConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2791. c.name = name
  2792. return c
  2793. }
  2794. // ProjectId sets the optional parameter "projectId": Deprecated. The
  2795. // Google Developers Console [project ID or
  2796. // project
  2797. // number](https://support.google.com/cloud/answer/6158840).
  2798. // This
  2799. // field has been deprecated and replaced by the name field.
  2800. func (c *ProjectsLocationsGetServerConfigCall) ProjectId(projectId string) *ProjectsLocationsGetServerConfigCall {
  2801. c.urlParams_.Set("projectId", projectId)
  2802. return c
  2803. }
  2804. // Zone sets the optional parameter "zone": Deprecated. The name of the
  2805. // Google Compute Engine
  2806. // [zone](/compute/docs/zones#available) to return operations for.
  2807. // This field has been deprecated and replaced by the name field.
  2808. func (c *ProjectsLocationsGetServerConfigCall) Zone(zone string) *ProjectsLocationsGetServerConfigCall {
  2809. c.urlParams_.Set("zone", zone)
  2810. return c
  2811. }
  2812. // Fields allows partial responses to be retrieved. See
  2813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2814. // for more information.
  2815. func (c *ProjectsLocationsGetServerConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetServerConfigCall {
  2816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2817. return c
  2818. }
  2819. // IfNoneMatch sets the optional parameter which makes the operation
  2820. // fail if the object's ETag matches the given value. This is useful for
  2821. // getting updates only after the object has changed since the last
  2822. // request. Use googleapi.IsNotModified to check whether the response
  2823. // error from Do is the result of In-None-Match.
  2824. func (c *ProjectsLocationsGetServerConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetServerConfigCall {
  2825. c.ifNoneMatch_ = entityTag
  2826. return c
  2827. }
  2828. // Context sets the context to be used in this call's Do method. Any
  2829. // pending HTTP request will be aborted if the provided context is
  2830. // canceled.
  2831. func (c *ProjectsLocationsGetServerConfigCall) Context(ctx context.Context) *ProjectsLocationsGetServerConfigCall {
  2832. c.ctx_ = ctx
  2833. return c
  2834. }
  2835. // Header returns an http.Header that can be modified by the caller to
  2836. // add HTTP headers to the request.
  2837. func (c *ProjectsLocationsGetServerConfigCall) Header() http.Header {
  2838. if c.header_ == nil {
  2839. c.header_ = make(http.Header)
  2840. }
  2841. return c.header_
  2842. }
  2843. func (c *ProjectsLocationsGetServerConfigCall) doRequest(alt string) (*http.Response, error) {
  2844. reqHeaders := make(http.Header)
  2845. for k, v := range c.header_ {
  2846. reqHeaders[k] = v
  2847. }
  2848. reqHeaders.Set("User-Agent", c.s.userAgent())
  2849. if c.ifNoneMatch_ != "" {
  2850. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2851. }
  2852. var body io.Reader = nil
  2853. c.urlParams_.Set("alt", alt)
  2854. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/serverConfig")
  2855. urls += "?" + c.urlParams_.Encode()
  2856. req, _ := http.NewRequest("GET", urls, body)
  2857. req.Header = reqHeaders
  2858. googleapi.Expand(req.URL, map[string]string{
  2859. "name": c.name,
  2860. })
  2861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2862. }
  2863. // Do executes the "container.projects.locations.getServerConfig" call.
  2864. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  2865. // status code is an error. Response headers are in either
  2866. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  2867. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2868. // to check whether the returned error was because
  2869. // http.StatusNotModified was returned.
  2870. func (c *ProjectsLocationsGetServerConfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  2871. gensupport.SetOptions(c.urlParams_, opts...)
  2872. res, err := c.doRequest("json")
  2873. if res != nil && res.StatusCode == http.StatusNotModified {
  2874. if res.Body != nil {
  2875. res.Body.Close()
  2876. }
  2877. return nil, &googleapi.Error{
  2878. Code: res.StatusCode,
  2879. Header: res.Header,
  2880. }
  2881. }
  2882. if err != nil {
  2883. return nil, err
  2884. }
  2885. defer googleapi.CloseBody(res)
  2886. if err := googleapi.CheckResponse(res); err != nil {
  2887. return nil, err
  2888. }
  2889. ret := &ServerConfig{
  2890. ServerResponse: googleapi.ServerResponse{
  2891. Header: res.Header,
  2892. HTTPStatusCode: res.StatusCode,
  2893. },
  2894. }
  2895. target := &ret
  2896. if err := gensupport.DecodeResponse(target, res); err != nil {
  2897. return nil, err
  2898. }
  2899. return ret, nil
  2900. // {
  2901. // "description": "Returns configuration info about the Kubernetes Engine service.",
  2902. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/serverConfig",
  2903. // "httpMethod": "GET",
  2904. // "id": "container.projects.locations.getServerConfig",
  2905. // "parameterOrder": [
  2906. // "name"
  2907. // ],
  2908. // "parameters": {
  2909. // "name": {
  2910. // "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
  2911. // "location": "path",
  2912. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2913. // "required": true,
  2914. // "type": "string"
  2915. // },
  2916. // "projectId": {
  2917. // "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.",
  2918. // "location": "query",
  2919. // "type": "string"
  2920. // },
  2921. // "zone": {
  2922. // "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.",
  2923. // "location": "query",
  2924. // "type": "string"
  2925. // }
  2926. // },
  2927. // "path": "v1/{+name}/serverConfig",
  2928. // "response": {
  2929. // "$ref": "ServerConfig"
  2930. // },
  2931. // "scopes": [
  2932. // "https://www.googleapis.com/auth/cloud-platform"
  2933. // ]
  2934. // }
  2935. }
  2936. // method id "container.projects.locations.clusters.completeIpRotation":
  2937. type ProjectsLocationsClustersCompleteIpRotationCall struct {
  2938. s *Service
  2939. name string
  2940. completeiprotationrequest *CompleteIPRotationRequest
  2941. urlParams_ gensupport.URLParams
  2942. ctx_ context.Context
  2943. header_ http.Header
  2944. }
  2945. // CompleteIpRotation: Completes master IP rotation.
  2946. func (r *ProjectsLocationsClustersService) CompleteIpRotation(name string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsLocationsClustersCompleteIpRotationCall {
  2947. c := &ProjectsLocationsClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2948. c.name = name
  2949. c.completeiprotationrequest = completeiprotationrequest
  2950. return c
  2951. }
  2952. // Fields allows partial responses to be retrieved. See
  2953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2954. // for more information.
  2955. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCompleteIpRotationCall {
  2956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2957. return c
  2958. }
  2959. // Context sets the context to be used in this call's Do method. Any
  2960. // pending HTTP request will be aborted if the provided context is
  2961. // canceled.
  2962. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersCompleteIpRotationCall {
  2963. c.ctx_ = ctx
  2964. return c
  2965. }
  2966. // Header returns an http.Header that can be modified by the caller to
  2967. // add HTTP headers to the request.
  2968. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Header() http.Header {
  2969. if c.header_ == nil {
  2970. c.header_ = make(http.Header)
  2971. }
  2972. return c.header_
  2973. }
  2974. func (c *ProjectsLocationsClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  2975. reqHeaders := make(http.Header)
  2976. for k, v := range c.header_ {
  2977. reqHeaders[k] = v
  2978. }
  2979. reqHeaders.Set("User-Agent", c.s.userAgent())
  2980. var body io.Reader = nil
  2981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  2982. if err != nil {
  2983. return nil, err
  2984. }
  2985. reqHeaders.Set("Content-Type", "application/json")
  2986. c.urlParams_.Set("alt", alt)
  2987. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:completeIpRotation")
  2988. urls += "?" + c.urlParams_.Encode()
  2989. req, _ := http.NewRequest("POST", urls, body)
  2990. req.Header = reqHeaders
  2991. googleapi.Expand(req.URL, map[string]string{
  2992. "name": c.name,
  2993. })
  2994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2995. }
  2996. // Do executes the "container.projects.locations.clusters.completeIpRotation" call.
  2997. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2998. // status code is an error. Response headers are in either
  2999. // *Operation.ServerResponse.Header or (if a response was returned at
  3000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3001. // to check whether the returned error was because
  3002. // http.StatusNotModified was returned.
  3003. func (c *ProjectsLocationsClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3004. gensupport.SetOptions(c.urlParams_, opts...)
  3005. res, err := c.doRequest("json")
  3006. if res != nil && res.StatusCode == http.StatusNotModified {
  3007. if res.Body != nil {
  3008. res.Body.Close()
  3009. }
  3010. return nil, &googleapi.Error{
  3011. Code: res.StatusCode,
  3012. Header: res.Header,
  3013. }
  3014. }
  3015. if err != nil {
  3016. return nil, err
  3017. }
  3018. defer googleapi.CloseBody(res)
  3019. if err := googleapi.CheckResponse(res); err != nil {
  3020. return nil, err
  3021. }
  3022. ret := &Operation{
  3023. ServerResponse: googleapi.ServerResponse{
  3024. Header: res.Header,
  3025. HTTPStatusCode: res.StatusCode,
  3026. },
  3027. }
  3028. target := &ret
  3029. if err := gensupport.DecodeResponse(target, res); err != nil {
  3030. return nil, err
  3031. }
  3032. return ret, nil
  3033. // {
  3034. // "description": "Completes master IP rotation.",
  3035. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:completeIpRotation",
  3036. // "httpMethod": "POST",
  3037. // "id": "container.projects.locations.clusters.completeIpRotation",
  3038. // "parameterOrder": [
  3039. // "name"
  3040. // ],
  3041. // "parameters": {
  3042. // "name": {
  3043. // "description": "The name (project, location, cluster id) of the cluster to complete IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  3044. // "location": "path",
  3045. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3046. // "required": true,
  3047. // "type": "string"
  3048. // }
  3049. // },
  3050. // "path": "v1/{+name}:completeIpRotation",
  3051. // "request": {
  3052. // "$ref": "CompleteIPRotationRequest"
  3053. // },
  3054. // "response": {
  3055. // "$ref": "Operation"
  3056. // },
  3057. // "scopes": [
  3058. // "https://www.googleapis.com/auth/cloud-platform"
  3059. // ]
  3060. // }
  3061. }
  3062. // method id "container.projects.locations.clusters.create":
  3063. type ProjectsLocationsClustersCreateCall struct {
  3064. s *Service
  3065. parent string
  3066. createclusterrequest *CreateClusterRequest
  3067. urlParams_ gensupport.URLParams
  3068. ctx_ context.Context
  3069. header_ http.Header
  3070. }
  3071. // Create: Creates a cluster, consisting of the specified number and
  3072. // type of Google
  3073. // Compute Engine instances.
  3074. //
  3075. // By default, the cluster is created in the project's
  3076. // [default
  3077. // network](/compute/docs/networks-and-firewalls#networks).
  3078. //
  3079. // One firewall is added for the cluster. After cluster creation,
  3080. // the cluster creates routes for each node to allow the containers
  3081. // on that node to communicate with all other instances in
  3082. // the
  3083. // cluster.
  3084. //
  3085. // Finally, an entry is added to the project's global metadata
  3086. // indicating
  3087. // which CIDR range is being used by the cluster.
  3088. func (r *ProjectsLocationsClustersService) Create(parent string, createclusterrequest *CreateClusterRequest) *ProjectsLocationsClustersCreateCall {
  3089. c := &ProjectsLocationsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3090. c.parent = parent
  3091. c.createclusterrequest = createclusterrequest
  3092. return c
  3093. }
  3094. // Fields allows partial responses to be retrieved. See
  3095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3096. // for more information.
  3097. func (c *ProjectsLocationsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersCreateCall {
  3098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3099. return c
  3100. }
  3101. // Context sets the context to be used in this call's Do method. Any
  3102. // pending HTTP request will be aborted if the provided context is
  3103. // canceled.
  3104. func (c *ProjectsLocationsClustersCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersCreateCall {
  3105. c.ctx_ = ctx
  3106. return c
  3107. }
  3108. // Header returns an http.Header that can be modified by the caller to
  3109. // add HTTP headers to the request.
  3110. func (c *ProjectsLocationsClustersCreateCall) Header() http.Header {
  3111. if c.header_ == nil {
  3112. c.header_ = make(http.Header)
  3113. }
  3114. return c.header_
  3115. }
  3116. func (c *ProjectsLocationsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  3117. reqHeaders := make(http.Header)
  3118. for k, v := range c.header_ {
  3119. reqHeaders[k] = v
  3120. }
  3121. reqHeaders.Set("User-Agent", c.s.userAgent())
  3122. var body io.Reader = nil
  3123. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  3124. if err != nil {
  3125. return nil, err
  3126. }
  3127. reqHeaders.Set("Content-Type", "application/json")
  3128. c.urlParams_.Set("alt", alt)
  3129. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  3130. urls += "?" + c.urlParams_.Encode()
  3131. req, _ := http.NewRequest("POST", urls, body)
  3132. req.Header = reqHeaders
  3133. googleapi.Expand(req.URL, map[string]string{
  3134. "parent": c.parent,
  3135. })
  3136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3137. }
  3138. // Do executes the "container.projects.locations.clusters.create" call.
  3139. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3140. // status code is an error. Response headers are in either
  3141. // *Operation.ServerResponse.Header or (if a response was returned at
  3142. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3143. // to check whether the returned error was because
  3144. // http.StatusNotModified was returned.
  3145. func (c *ProjectsLocationsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3146. gensupport.SetOptions(c.urlParams_, opts...)
  3147. res, err := c.doRequest("json")
  3148. if res != nil && res.StatusCode == http.StatusNotModified {
  3149. if res.Body != nil {
  3150. res.Body.Close()
  3151. }
  3152. return nil, &googleapi.Error{
  3153. Code: res.StatusCode,
  3154. Header: res.Header,
  3155. }
  3156. }
  3157. if err != nil {
  3158. return nil, err
  3159. }
  3160. defer googleapi.CloseBody(res)
  3161. if err := googleapi.CheckResponse(res); err != nil {
  3162. return nil, err
  3163. }
  3164. ret := &Operation{
  3165. ServerResponse: googleapi.ServerResponse{
  3166. Header: res.Header,
  3167. HTTPStatusCode: res.StatusCode,
  3168. },
  3169. }
  3170. target := &ret
  3171. if err := gensupport.DecodeResponse(target, res); err != nil {
  3172. return nil, err
  3173. }
  3174. return ret, nil
  3175. // {
  3176. // "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.",
  3177. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  3178. // "httpMethod": "POST",
  3179. // "id": "container.projects.locations.clusters.create",
  3180. // "parameterOrder": [
  3181. // "parent"
  3182. // ],
  3183. // "parameters": {
  3184. // "parent": {
  3185. // "description": "The parent (project and location) where the cluster will be created.\nSpecified in the format 'projects/*/locations/*'.",
  3186. // "location": "path",
  3187. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3188. // "required": true,
  3189. // "type": "string"
  3190. // }
  3191. // },
  3192. // "path": "v1/{+parent}/clusters",
  3193. // "request": {
  3194. // "$ref": "CreateClusterRequest"
  3195. // },
  3196. // "response": {
  3197. // "$ref": "Operation"
  3198. // },
  3199. // "scopes": [
  3200. // "https://www.googleapis.com/auth/cloud-platform"
  3201. // ]
  3202. // }
  3203. }
  3204. // method id "container.projects.locations.clusters.delete":
  3205. type ProjectsLocationsClustersDeleteCall struct {
  3206. s *Service
  3207. name string
  3208. urlParams_ gensupport.URLParams
  3209. ctx_ context.Context
  3210. header_ http.Header
  3211. }
  3212. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  3213. // all worker
  3214. // nodes.
  3215. //
  3216. // Firewalls and routes that were configured during cluster creation
  3217. // are also deleted.
  3218. //
  3219. // Other Google Compute Engine resources that might be in use by the
  3220. // cluster
  3221. // (e.g. load balancer resources) will not be deleted if they weren't
  3222. // present
  3223. // at the initial create time.
  3224. func (r *ProjectsLocationsClustersService) Delete(name string) *ProjectsLocationsClustersDeleteCall {
  3225. c := &ProjectsLocationsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3226. c.name = name
  3227. return c
  3228. }
  3229. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  3230. // name of the cluster to delete.
  3231. // This field has been deprecated and replaced by the name field.
  3232. func (c *ProjectsLocationsClustersDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersDeleteCall {
  3233. c.urlParams_.Set("clusterId", clusterId)
  3234. return c
  3235. }
  3236. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3237. // Google Developers Console [project ID or
  3238. // project
  3239. // number](https://support.google.com/cloud/answer/6158840).
  3240. // This
  3241. // field has been deprecated and replaced by the name field.
  3242. func (c *ProjectsLocationsClustersDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersDeleteCall {
  3243. c.urlParams_.Set("projectId", projectId)
  3244. return c
  3245. }
  3246. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3247. // Google Compute Engine
  3248. // [zone](/compute/docs/zones#available) in which the
  3249. // cluster
  3250. // resides.
  3251. // This field has been deprecated and replaced by the name field.
  3252. func (c *ProjectsLocationsClustersDeleteCall) Zone(zone string) *ProjectsLocationsClustersDeleteCall {
  3253. c.urlParams_.Set("zone", zone)
  3254. return c
  3255. }
  3256. // Fields allows partial responses to be retrieved. See
  3257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3258. // for more information.
  3259. func (c *ProjectsLocationsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersDeleteCall {
  3260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3261. return c
  3262. }
  3263. // Context sets the context to be used in this call's Do method. Any
  3264. // pending HTTP request will be aborted if the provided context is
  3265. // canceled.
  3266. func (c *ProjectsLocationsClustersDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersDeleteCall {
  3267. c.ctx_ = ctx
  3268. return c
  3269. }
  3270. // Header returns an http.Header that can be modified by the caller to
  3271. // add HTTP headers to the request.
  3272. func (c *ProjectsLocationsClustersDeleteCall) Header() http.Header {
  3273. if c.header_ == nil {
  3274. c.header_ = make(http.Header)
  3275. }
  3276. return c.header_
  3277. }
  3278. func (c *ProjectsLocationsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  3279. reqHeaders := make(http.Header)
  3280. for k, v := range c.header_ {
  3281. reqHeaders[k] = v
  3282. }
  3283. reqHeaders.Set("User-Agent", c.s.userAgent())
  3284. var body io.Reader = nil
  3285. c.urlParams_.Set("alt", alt)
  3286. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3287. urls += "?" + c.urlParams_.Encode()
  3288. req, _ := http.NewRequest("DELETE", urls, body)
  3289. req.Header = reqHeaders
  3290. googleapi.Expand(req.URL, map[string]string{
  3291. "name": c.name,
  3292. })
  3293. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3294. }
  3295. // Do executes the "container.projects.locations.clusters.delete" call.
  3296. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3297. // status code is an error. Response headers are in either
  3298. // *Operation.ServerResponse.Header or (if a response was returned at
  3299. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3300. // to check whether the returned error was because
  3301. // http.StatusNotModified was returned.
  3302. func (c *ProjectsLocationsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3303. gensupport.SetOptions(c.urlParams_, opts...)
  3304. res, err := c.doRequest("json")
  3305. if res != nil && res.StatusCode == http.StatusNotModified {
  3306. if res.Body != nil {
  3307. res.Body.Close()
  3308. }
  3309. return nil, &googleapi.Error{
  3310. Code: res.StatusCode,
  3311. Header: res.Header,
  3312. }
  3313. }
  3314. if err != nil {
  3315. return nil, err
  3316. }
  3317. defer googleapi.CloseBody(res)
  3318. if err := googleapi.CheckResponse(res); err != nil {
  3319. return nil, err
  3320. }
  3321. ret := &Operation{
  3322. ServerResponse: googleapi.ServerResponse{
  3323. Header: res.Header,
  3324. HTTPStatusCode: res.StatusCode,
  3325. },
  3326. }
  3327. target := &ret
  3328. if err := gensupport.DecodeResponse(target, res); err != nil {
  3329. return nil, err
  3330. }
  3331. return ret, nil
  3332. // {
  3333. // "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.",
  3334. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  3335. // "httpMethod": "DELETE",
  3336. // "id": "container.projects.locations.clusters.delete",
  3337. // "parameterOrder": [
  3338. // "name"
  3339. // ],
  3340. // "parameters": {
  3341. // "clusterId": {
  3342. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  3343. // "location": "query",
  3344. // "type": "string"
  3345. // },
  3346. // "name": {
  3347. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3348. // "location": "path",
  3349. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3350. // "required": true,
  3351. // "type": "string"
  3352. // },
  3353. // "projectId": {
  3354. // "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.",
  3355. // "location": "query",
  3356. // "type": "string"
  3357. // },
  3358. // "zone": {
  3359. // "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.",
  3360. // "location": "query",
  3361. // "type": "string"
  3362. // }
  3363. // },
  3364. // "path": "v1/{+name}",
  3365. // "response": {
  3366. // "$ref": "Operation"
  3367. // },
  3368. // "scopes": [
  3369. // "https://www.googleapis.com/auth/cloud-platform"
  3370. // ]
  3371. // }
  3372. }
  3373. // method id "container.projects.locations.clusters.get":
  3374. type ProjectsLocationsClustersGetCall struct {
  3375. s *Service
  3376. name string
  3377. urlParams_ gensupport.URLParams
  3378. ifNoneMatch_ string
  3379. ctx_ context.Context
  3380. header_ http.Header
  3381. }
  3382. // Get: Gets the details of a specific cluster.
  3383. func (r *ProjectsLocationsClustersService) Get(name string) *ProjectsLocationsClustersGetCall {
  3384. c := &ProjectsLocationsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3385. c.name = name
  3386. return c
  3387. }
  3388. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  3389. // name of the cluster to retrieve.
  3390. // This field has been deprecated and replaced by the name field.
  3391. func (c *ProjectsLocationsClustersGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersGetCall {
  3392. c.urlParams_.Set("clusterId", clusterId)
  3393. return c
  3394. }
  3395. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3396. // Google Developers Console [project ID or
  3397. // project
  3398. // number](https://support.google.com/cloud/answer/6158840).
  3399. // This
  3400. // field has been deprecated and replaced by the name field.
  3401. func (c *ProjectsLocationsClustersGetCall) ProjectId(projectId string) *ProjectsLocationsClustersGetCall {
  3402. c.urlParams_.Set("projectId", projectId)
  3403. return c
  3404. }
  3405. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3406. // Google Compute Engine
  3407. // [zone](/compute/docs/zones#available) in which the
  3408. // cluster
  3409. // resides.
  3410. // This field has been deprecated and replaced by the name field.
  3411. func (c *ProjectsLocationsClustersGetCall) Zone(zone string) *ProjectsLocationsClustersGetCall {
  3412. c.urlParams_.Set("zone", zone)
  3413. return c
  3414. }
  3415. // Fields allows partial responses to be retrieved. See
  3416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3417. // for more information.
  3418. func (c *ProjectsLocationsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersGetCall {
  3419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3420. return c
  3421. }
  3422. // IfNoneMatch sets the optional parameter which makes the operation
  3423. // fail if the object's ETag matches the given value. This is useful for
  3424. // getting updates only after the object has changed since the last
  3425. // request. Use googleapi.IsNotModified to check whether the response
  3426. // error from Do is the result of In-None-Match.
  3427. func (c *ProjectsLocationsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersGetCall {
  3428. c.ifNoneMatch_ = entityTag
  3429. return c
  3430. }
  3431. // Context sets the context to be used in this call's Do method. Any
  3432. // pending HTTP request will be aborted if the provided context is
  3433. // canceled.
  3434. func (c *ProjectsLocationsClustersGetCall) Context(ctx context.Context) *ProjectsLocationsClustersGetCall {
  3435. c.ctx_ = ctx
  3436. return c
  3437. }
  3438. // Header returns an http.Header that can be modified by the caller to
  3439. // add HTTP headers to the request.
  3440. func (c *ProjectsLocationsClustersGetCall) Header() http.Header {
  3441. if c.header_ == nil {
  3442. c.header_ = make(http.Header)
  3443. }
  3444. return c.header_
  3445. }
  3446. func (c *ProjectsLocationsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  3447. reqHeaders := make(http.Header)
  3448. for k, v := range c.header_ {
  3449. reqHeaders[k] = v
  3450. }
  3451. reqHeaders.Set("User-Agent", c.s.userAgent())
  3452. if c.ifNoneMatch_ != "" {
  3453. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3454. }
  3455. var body io.Reader = nil
  3456. c.urlParams_.Set("alt", alt)
  3457. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3458. urls += "?" + c.urlParams_.Encode()
  3459. req, _ := http.NewRequest("GET", urls, body)
  3460. req.Header = reqHeaders
  3461. googleapi.Expand(req.URL, map[string]string{
  3462. "name": c.name,
  3463. })
  3464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3465. }
  3466. // Do executes the "container.projects.locations.clusters.get" call.
  3467. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  3468. // code is an error. Response headers are in either
  3469. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  3470. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3471. // check whether the returned error was because http.StatusNotModified
  3472. // was returned.
  3473. func (c *ProjectsLocationsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  3474. gensupport.SetOptions(c.urlParams_, opts...)
  3475. res, err := c.doRequest("json")
  3476. if res != nil && res.StatusCode == http.StatusNotModified {
  3477. if res.Body != nil {
  3478. res.Body.Close()
  3479. }
  3480. return nil, &googleapi.Error{
  3481. Code: res.StatusCode,
  3482. Header: res.Header,
  3483. }
  3484. }
  3485. if err != nil {
  3486. return nil, err
  3487. }
  3488. defer googleapi.CloseBody(res)
  3489. if err := googleapi.CheckResponse(res); err != nil {
  3490. return nil, err
  3491. }
  3492. ret := &Cluster{
  3493. ServerResponse: googleapi.ServerResponse{
  3494. Header: res.Header,
  3495. HTTPStatusCode: res.StatusCode,
  3496. },
  3497. }
  3498. target := &ret
  3499. if err := gensupport.DecodeResponse(target, res); err != nil {
  3500. return nil, err
  3501. }
  3502. return ret, nil
  3503. // {
  3504. // "description": "Gets the details of a specific cluster.",
  3505. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  3506. // "httpMethod": "GET",
  3507. // "id": "container.projects.locations.clusters.get",
  3508. // "parameterOrder": [
  3509. // "name"
  3510. // ],
  3511. // "parameters": {
  3512. // "clusterId": {
  3513. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  3514. // "location": "query",
  3515. // "type": "string"
  3516. // },
  3517. // "name": {
  3518. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3519. // "location": "path",
  3520. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3521. // "required": true,
  3522. // "type": "string"
  3523. // },
  3524. // "projectId": {
  3525. // "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.",
  3526. // "location": "query",
  3527. // "type": "string"
  3528. // },
  3529. // "zone": {
  3530. // "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.",
  3531. // "location": "query",
  3532. // "type": "string"
  3533. // }
  3534. // },
  3535. // "path": "v1/{+name}",
  3536. // "response": {
  3537. // "$ref": "Cluster"
  3538. // },
  3539. // "scopes": [
  3540. // "https://www.googleapis.com/auth/cloud-platform"
  3541. // ]
  3542. // }
  3543. }
  3544. // method id "container.projects.locations.clusters.list":
  3545. type ProjectsLocationsClustersListCall struct {
  3546. s *Service
  3547. parent string
  3548. urlParams_ gensupport.URLParams
  3549. ifNoneMatch_ string
  3550. ctx_ context.Context
  3551. header_ http.Header
  3552. }
  3553. // List: Lists all clusters owned by a project in either the specified
  3554. // zone or all
  3555. // zones.
  3556. func (r *ProjectsLocationsClustersService) List(parent string) *ProjectsLocationsClustersListCall {
  3557. c := &ProjectsLocationsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3558. c.parent = parent
  3559. return c
  3560. }
  3561. // ProjectId sets the optional parameter "projectId": Deprecated. The
  3562. // Google Developers Console [project ID or
  3563. // project
  3564. // number](https://support.google.com/cloud/answer/6158840).
  3565. // This
  3566. // field has been deprecated and replaced by the parent field.
  3567. func (c *ProjectsLocationsClustersListCall) ProjectId(projectId string) *ProjectsLocationsClustersListCall {
  3568. c.urlParams_.Set("projectId", projectId)
  3569. return c
  3570. }
  3571. // Zone sets the optional parameter "zone": Deprecated. The name of the
  3572. // Google Compute Engine
  3573. // [zone](/compute/docs/zones#available) in which the cluster
  3574. // resides, or "-" for all zones.
  3575. // This field has been deprecated and replaced by the parent field.
  3576. func (c *ProjectsLocationsClustersListCall) Zone(zone string) *ProjectsLocationsClustersListCall {
  3577. c.urlParams_.Set("zone", zone)
  3578. return c
  3579. }
  3580. // Fields allows partial responses to be retrieved. See
  3581. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3582. // for more information.
  3583. func (c *ProjectsLocationsClustersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersListCall {
  3584. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3585. return c
  3586. }
  3587. // IfNoneMatch sets the optional parameter which makes the operation
  3588. // fail if the object's ETag matches the given value. This is useful for
  3589. // getting updates only after the object has changed since the last
  3590. // request. Use googleapi.IsNotModified to check whether the response
  3591. // error from Do is the result of In-None-Match.
  3592. func (c *ProjectsLocationsClustersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersListCall {
  3593. c.ifNoneMatch_ = entityTag
  3594. return c
  3595. }
  3596. // Context sets the context to be used in this call's Do method. Any
  3597. // pending HTTP request will be aborted if the provided context is
  3598. // canceled.
  3599. func (c *ProjectsLocationsClustersListCall) Context(ctx context.Context) *ProjectsLocationsClustersListCall {
  3600. c.ctx_ = ctx
  3601. return c
  3602. }
  3603. // Header returns an http.Header that can be modified by the caller to
  3604. // add HTTP headers to the request.
  3605. func (c *ProjectsLocationsClustersListCall) Header() http.Header {
  3606. if c.header_ == nil {
  3607. c.header_ = make(http.Header)
  3608. }
  3609. return c.header_
  3610. }
  3611. func (c *ProjectsLocationsClustersListCall) doRequest(alt string) (*http.Response, error) {
  3612. reqHeaders := make(http.Header)
  3613. for k, v := range c.header_ {
  3614. reqHeaders[k] = v
  3615. }
  3616. reqHeaders.Set("User-Agent", c.s.userAgent())
  3617. if c.ifNoneMatch_ != "" {
  3618. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3619. }
  3620. var body io.Reader = nil
  3621. c.urlParams_.Set("alt", alt)
  3622. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/clusters")
  3623. urls += "?" + c.urlParams_.Encode()
  3624. req, _ := http.NewRequest("GET", urls, body)
  3625. req.Header = reqHeaders
  3626. googleapi.Expand(req.URL, map[string]string{
  3627. "parent": c.parent,
  3628. })
  3629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3630. }
  3631. // Do executes the "container.projects.locations.clusters.list" call.
  3632. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  3633. // non-2xx status code is an error. Response headers are in either
  3634. // *ListClustersResponse.ServerResponse.Header or (if a response was
  3635. // returned at all) in error.(*googleapi.Error).Header. Use
  3636. // googleapi.IsNotModified to check whether the returned error was
  3637. // because http.StatusNotModified was returned.
  3638. func (c *ProjectsLocationsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  3639. gensupport.SetOptions(c.urlParams_, opts...)
  3640. res, err := c.doRequest("json")
  3641. if res != nil && res.StatusCode == http.StatusNotModified {
  3642. if res.Body != nil {
  3643. res.Body.Close()
  3644. }
  3645. return nil, &googleapi.Error{
  3646. Code: res.StatusCode,
  3647. Header: res.Header,
  3648. }
  3649. }
  3650. if err != nil {
  3651. return nil, err
  3652. }
  3653. defer googleapi.CloseBody(res)
  3654. if err := googleapi.CheckResponse(res); err != nil {
  3655. return nil, err
  3656. }
  3657. ret := &ListClustersResponse{
  3658. ServerResponse: googleapi.ServerResponse{
  3659. Header: res.Header,
  3660. HTTPStatusCode: res.StatusCode,
  3661. },
  3662. }
  3663. target := &ret
  3664. if err := gensupport.DecodeResponse(target, res); err != nil {
  3665. return nil, err
  3666. }
  3667. return ret, nil
  3668. // {
  3669. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  3670. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters",
  3671. // "httpMethod": "GET",
  3672. // "id": "container.projects.locations.clusters.list",
  3673. // "parameterOrder": [
  3674. // "parent"
  3675. // ],
  3676. // "parameters": {
  3677. // "parent": {
  3678. // "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.",
  3679. // "location": "path",
  3680. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3681. // "required": true,
  3682. // "type": "string"
  3683. // },
  3684. // "projectId": {
  3685. // "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.",
  3686. // "location": "query",
  3687. // "type": "string"
  3688. // },
  3689. // "zone": {
  3690. // "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.",
  3691. // "location": "query",
  3692. // "type": "string"
  3693. // }
  3694. // },
  3695. // "path": "v1/{+parent}/clusters",
  3696. // "response": {
  3697. // "$ref": "ListClustersResponse"
  3698. // },
  3699. // "scopes": [
  3700. // "https://www.googleapis.com/auth/cloud-platform"
  3701. // ]
  3702. // }
  3703. }
  3704. // method id "container.projects.locations.clusters.setAddons":
  3705. type ProjectsLocationsClustersSetAddonsCall struct {
  3706. s *Service
  3707. name string
  3708. setaddonsconfigrequest *SetAddonsConfigRequest
  3709. urlParams_ gensupport.URLParams
  3710. ctx_ context.Context
  3711. header_ http.Header
  3712. }
  3713. // SetAddons: Sets the addons for a specific cluster.
  3714. func (r *ProjectsLocationsClustersService) SetAddons(name string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsLocationsClustersSetAddonsCall {
  3715. c := &ProjectsLocationsClustersSetAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3716. c.name = name
  3717. c.setaddonsconfigrequest = setaddonsconfigrequest
  3718. return c
  3719. }
  3720. // Fields allows partial responses to be retrieved. See
  3721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3722. // for more information.
  3723. func (c *ProjectsLocationsClustersSetAddonsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetAddonsCall {
  3724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3725. return c
  3726. }
  3727. // Context sets the context to be used in this call's Do method. Any
  3728. // pending HTTP request will be aborted if the provided context is
  3729. // canceled.
  3730. func (c *ProjectsLocationsClustersSetAddonsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetAddonsCall {
  3731. c.ctx_ = ctx
  3732. return c
  3733. }
  3734. // Header returns an http.Header that can be modified by the caller to
  3735. // add HTTP headers to the request.
  3736. func (c *ProjectsLocationsClustersSetAddonsCall) Header() http.Header {
  3737. if c.header_ == nil {
  3738. c.header_ = make(http.Header)
  3739. }
  3740. return c.header_
  3741. }
  3742. func (c *ProjectsLocationsClustersSetAddonsCall) doRequest(alt string) (*http.Response, error) {
  3743. reqHeaders := make(http.Header)
  3744. for k, v := range c.header_ {
  3745. reqHeaders[k] = v
  3746. }
  3747. reqHeaders.Set("User-Agent", c.s.userAgent())
  3748. var body io.Reader = nil
  3749. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  3750. if err != nil {
  3751. return nil, err
  3752. }
  3753. reqHeaders.Set("Content-Type", "application/json")
  3754. c.urlParams_.Set("alt", alt)
  3755. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAddons")
  3756. urls += "?" + c.urlParams_.Encode()
  3757. req, _ := http.NewRequest("POST", urls, body)
  3758. req.Header = reqHeaders
  3759. googleapi.Expand(req.URL, map[string]string{
  3760. "name": c.name,
  3761. })
  3762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3763. }
  3764. // Do executes the "container.projects.locations.clusters.setAddons" call.
  3765. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3766. // status code is an error. Response headers are in either
  3767. // *Operation.ServerResponse.Header or (if a response was returned at
  3768. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3769. // to check whether the returned error was because
  3770. // http.StatusNotModified was returned.
  3771. func (c *ProjectsLocationsClustersSetAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3772. gensupport.SetOptions(c.urlParams_, opts...)
  3773. res, err := c.doRequest("json")
  3774. if res != nil && res.StatusCode == http.StatusNotModified {
  3775. if res.Body != nil {
  3776. res.Body.Close()
  3777. }
  3778. return nil, &googleapi.Error{
  3779. Code: res.StatusCode,
  3780. Header: res.Header,
  3781. }
  3782. }
  3783. if err != nil {
  3784. return nil, err
  3785. }
  3786. defer googleapi.CloseBody(res)
  3787. if err := googleapi.CheckResponse(res); err != nil {
  3788. return nil, err
  3789. }
  3790. ret := &Operation{
  3791. ServerResponse: googleapi.ServerResponse{
  3792. Header: res.Header,
  3793. HTTPStatusCode: res.StatusCode,
  3794. },
  3795. }
  3796. target := &ret
  3797. if err := gensupport.DecodeResponse(target, res); err != nil {
  3798. return nil, err
  3799. }
  3800. return ret, nil
  3801. // {
  3802. // "description": "Sets the addons for a specific cluster.",
  3803. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setAddons",
  3804. // "httpMethod": "POST",
  3805. // "id": "container.projects.locations.clusters.setAddons",
  3806. // "parameterOrder": [
  3807. // "name"
  3808. // ],
  3809. // "parameters": {
  3810. // "name": {
  3811. // "description": "The name (project, location, cluster) of the cluster to set addons.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3812. // "location": "path",
  3813. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3814. // "required": true,
  3815. // "type": "string"
  3816. // }
  3817. // },
  3818. // "path": "v1/{+name}:setAddons",
  3819. // "request": {
  3820. // "$ref": "SetAddonsConfigRequest"
  3821. // },
  3822. // "response": {
  3823. // "$ref": "Operation"
  3824. // },
  3825. // "scopes": [
  3826. // "https://www.googleapis.com/auth/cloud-platform"
  3827. // ]
  3828. // }
  3829. }
  3830. // method id "container.projects.locations.clusters.setLegacyAbac":
  3831. type ProjectsLocationsClustersSetLegacyAbacCall struct {
  3832. s *Service
  3833. name string
  3834. setlegacyabacrequest *SetLegacyAbacRequest
  3835. urlParams_ gensupport.URLParams
  3836. ctx_ context.Context
  3837. header_ http.Header
  3838. }
  3839. // SetLegacyAbac: Enables or disables the ABAC authorization mechanism
  3840. // on a cluster.
  3841. func (r *ProjectsLocationsClustersService) SetLegacyAbac(name string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsLocationsClustersSetLegacyAbacCall {
  3842. c := &ProjectsLocationsClustersSetLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3843. c.name = name
  3844. c.setlegacyabacrequest = setlegacyabacrequest
  3845. return c
  3846. }
  3847. // Fields allows partial responses to be retrieved. See
  3848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3849. // for more information.
  3850. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLegacyAbacCall {
  3851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3852. return c
  3853. }
  3854. // Context sets the context to be used in this call's Do method. Any
  3855. // pending HTTP request will be aborted if the provided context is
  3856. // canceled.
  3857. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLegacyAbacCall {
  3858. c.ctx_ = ctx
  3859. return c
  3860. }
  3861. // Header returns an http.Header that can be modified by the caller to
  3862. // add HTTP headers to the request.
  3863. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Header() http.Header {
  3864. if c.header_ == nil {
  3865. c.header_ = make(http.Header)
  3866. }
  3867. return c.header_
  3868. }
  3869. func (c *ProjectsLocationsClustersSetLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  3870. reqHeaders := make(http.Header)
  3871. for k, v := range c.header_ {
  3872. reqHeaders[k] = v
  3873. }
  3874. reqHeaders.Set("User-Agent", c.s.userAgent())
  3875. var body io.Reader = nil
  3876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  3877. if err != nil {
  3878. return nil, err
  3879. }
  3880. reqHeaders.Set("Content-Type", "application/json")
  3881. c.urlParams_.Set("alt", alt)
  3882. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLegacyAbac")
  3883. urls += "?" + c.urlParams_.Encode()
  3884. req, _ := http.NewRequest("POST", urls, body)
  3885. req.Header = reqHeaders
  3886. googleapi.Expand(req.URL, map[string]string{
  3887. "name": c.name,
  3888. })
  3889. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3890. }
  3891. // Do executes the "container.projects.locations.clusters.setLegacyAbac" call.
  3892. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3893. // status code is an error. Response headers are in either
  3894. // *Operation.ServerResponse.Header or (if a response was returned at
  3895. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3896. // to check whether the returned error was because
  3897. // http.StatusNotModified was returned.
  3898. func (c *ProjectsLocationsClustersSetLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3899. gensupport.SetOptions(c.urlParams_, opts...)
  3900. res, err := c.doRequest("json")
  3901. if res != nil && res.StatusCode == http.StatusNotModified {
  3902. if res.Body != nil {
  3903. res.Body.Close()
  3904. }
  3905. return nil, &googleapi.Error{
  3906. Code: res.StatusCode,
  3907. Header: res.Header,
  3908. }
  3909. }
  3910. if err != nil {
  3911. return nil, err
  3912. }
  3913. defer googleapi.CloseBody(res)
  3914. if err := googleapi.CheckResponse(res); err != nil {
  3915. return nil, err
  3916. }
  3917. ret := &Operation{
  3918. ServerResponse: googleapi.ServerResponse{
  3919. Header: res.Header,
  3920. HTTPStatusCode: res.StatusCode,
  3921. },
  3922. }
  3923. target := &ret
  3924. if err := gensupport.DecodeResponse(target, res); err != nil {
  3925. return nil, err
  3926. }
  3927. return ret, nil
  3928. // {
  3929. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  3930. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLegacyAbac",
  3931. // "httpMethod": "POST",
  3932. // "id": "container.projects.locations.clusters.setLegacyAbac",
  3933. // "parameterOrder": [
  3934. // "name"
  3935. // ],
  3936. // "parameters": {
  3937. // "name": {
  3938. // "description": "The name (project, location, cluster id) of the cluster to set legacy abac.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  3939. // "location": "path",
  3940. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  3941. // "required": true,
  3942. // "type": "string"
  3943. // }
  3944. // },
  3945. // "path": "v1/{+name}:setLegacyAbac",
  3946. // "request": {
  3947. // "$ref": "SetLegacyAbacRequest"
  3948. // },
  3949. // "response": {
  3950. // "$ref": "Operation"
  3951. // },
  3952. // "scopes": [
  3953. // "https://www.googleapis.com/auth/cloud-platform"
  3954. // ]
  3955. // }
  3956. }
  3957. // method id "container.projects.locations.clusters.setLocations":
  3958. type ProjectsLocationsClustersSetLocationsCall struct {
  3959. s *Service
  3960. name string
  3961. setlocationsrequest *SetLocationsRequest
  3962. urlParams_ gensupport.URLParams
  3963. ctx_ context.Context
  3964. header_ http.Header
  3965. }
  3966. // SetLocations: Sets the locations for a specific cluster.
  3967. func (r *ProjectsLocationsClustersService) SetLocations(name string, setlocationsrequest *SetLocationsRequest) *ProjectsLocationsClustersSetLocationsCall {
  3968. c := &ProjectsLocationsClustersSetLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3969. c.name = name
  3970. c.setlocationsrequest = setlocationsrequest
  3971. return c
  3972. }
  3973. // Fields allows partial responses to be retrieved. See
  3974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3975. // for more information.
  3976. func (c *ProjectsLocationsClustersSetLocationsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLocationsCall {
  3977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3978. return c
  3979. }
  3980. // Context sets the context to be used in this call's Do method. Any
  3981. // pending HTTP request will be aborted if the provided context is
  3982. // canceled.
  3983. func (c *ProjectsLocationsClustersSetLocationsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLocationsCall {
  3984. c.ctx_ = ctx
  3985. return c
  3986. }
  3987. // Header returns an http.Header that can be modified by the caller to
  3988. // add HTTP headers to the request.
  3989. func (c *ProjectsLocationsClustersSetLocationsCall) Header() http.Header {
  3990. if c.header_ == nil {
  3991. c.header_ = make(http.Header)
  3992. }
  3993. return c.header_
  3994. }
  3995. func (c *ProjectsLocationsClustersSetLocationsCall) doRequest(alt string) (*http.Response, error) {
  3996. reqHeaders := make(http.Header)
  3997. for k, v := range c.header_ {
  3998. reqHeaders[k] = v
  3999. }
  4000. reqHeaders.Set("User-Agent", c.s.userAgent())
  4001. var body io.Reader = nil
  4002. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  4003. if err != nil {
  4004. return nil, err
  4005. }
  4006. reqHeaders.Set("Content-Type", "application/json")
  4007. c.urlParams_.Set("alt", alt)
  4008. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLocations")
  4009. urls += "?" + c.urlParams_.Encode()
  4010. req, _ := http.NewRequest("POST", urls, body)
  4011. req.Header = reqHeaders
  4012. googleapi.Expand(req.URL, map[string]string{
  4013. "name": c.name,
  4014. })
  4015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4016. }
  4017. // Do executes the "container.projects.locations.clusters.setLocations" call.
  4018. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4019. // status code is an error. Response headers are in either
  4020. // *Operation.ServerResponse.Header or (if a response was returned at
  4021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4022. // to check whether the returned error was because
  4023. // http.StatusNotModified was returned.
  4024. func (c *ProjectsLocationsClustersSetLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4025. gensupport.SetOptions(c.urlParams_, opts...)
  4026. res, err := c.doRequest("json")
  4027. if res != nil && res.StatusCode == http.StatusNotModified {
  4028. if res.Body != nil {
  4029. res.Body.Close()
  4030. }
  4031. return nil, &googleapi.Error{
  4032. Code: res.StatusCode,
  4033. Header: res.Header,
  4034. }
  4035. }
  4036. if err != nil {
  4037. return nil, err
  4038. }
  4039. defer googleapi.CloseBody(res)
  4040. if err := googleapi.CheckResponse(res); err != nil {
  4041. return nil, err
  4042. }
  4043. ret := &Operation{
  4044. ServerResponse: googleapi.ServerResponse{
  4045. Header: res.Header,
  4046. HTTPStatusCode: res.StatusCode,
  4047. },
  4048. }
  4049. target := &ret
  4050. if err := gensupport.DecodeResponse(target, res); err != nil {
  4051. return nil, err
  4052. }
  4053. return ret, nil
  4054. // {
  4055. // "description": "Sets the locations for a specific cluster.",
  4056. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLocations",
  4057. // "httpMethod": "POST",
  4058. // "id": "container.projects.locations.clusters.setLocations",
  4059. // "parameterOrder": [
  4060. // "name"
  4061. // ],
  4062. // "parameters": {
  4063. // "name": {
  4064. // "description": "The name (project, location, cluster) of the cluster to set locations.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4065. // "location": "path",
  4066. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4067. // "required": true,
  4068. // "type": "string"
  4069. // }
  4070. // },
  4071. // "path": "v1/{+name}:setLocations",
  4072. // "request": {
  4073. // "$ref": "SetLocationsRequest"
  4074. // },
  4075. // "response": {
  4076. // "$ref": "Operation"
  4077. // },
  4078. // "scopes": [
  4079. // "https://www.googleapis.com/auth/cloud-platform"
  4080. // ]
  4081. // }
  4082. }
  4083. // method id "container.projects.locations.clusters.setLogging":
  4084. type ProjectsLocationsClustersSetLoggingCall struct {
  4085. s *Service
  4086. name string
  4087. setloggingservicerequest *SetLoggingServiceRequest
  4088. urlParams_ gensupport.URLParams
  4089. ctx_ context.Context
  4090. header_ http.Header
  4091. }
  4092. // SetLogging: Sets the logging service for a specific cluster.
  4093. func (r *ProjectsLocationsClustersService) SetLogging(name string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsLocationsClustersSetLoggingCall {
  4094. c := &ProjectsLocationsClustersSetLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4095. c.name = name
  4096. c.setloggingservicerequest = setloggingservicerequest
  4097. return c
  4098. }
  4099. // Fields allows partial responses to be retrieved. See
  4100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4101. // for more information.
  4102. func (c *ProjectsLocationsClustersSetLoggingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetLoggingCall {
  4103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4104. return c
  4105. }
  4106. // Context sets the context to be used in this call's Do method. Any
  4107. // pending HTTP request will be aborted if the provided context is
  4108. // canceled.
  4109. func (c *ProjectsLocationsClustersSetLoggingCall) Context(ctx context.Context) *ProjectsLocationsClustersSetLoggingCall {
  4110. c.ctx_ = ctx
  4111. return c
  4112. }
  4113. // Header returns an http.Header that can be modified by the caller to
  4114. // add HTTP headers to the request.
  4115. func (c *ProjectsLocationsClustersSetLoggingCall) Header() http.Header {
  4116. if c.header_ == nil {
  4117. c.header_ = make(http.Header)
  4118. }
  4119. return c.header_
  4120. }
  4121. func (c *ProjectsLocationsClustersSetLoggingCall) doRequest(alt string) (*http.Response, error) {
  4122. reqHeaders := make(http.Header)
  4123. for k, v := range c.header_ {
  4124. reqHeaders[k] = v
  4125. }
  4126. reqHeaders.Set("User-Agent", c.s.userAgent())
  4127. var body io.Reader = nil
  4128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  4129. if err != nil {
  4130. return nil, err
  4131. }
  4132. reqHeaders.Set("Content-Type", "application/json")
  4133. c.urlParams_.Set("alt", alt)
  4134. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLogging")
  4135. urls += "?" + c.urlParams_.Encode()
  4136. req, _ := http.NewRequest("POST", urls, body)
  4137. req.Header = reqHeaders
  4138. googleapi.Expand(req.URL, map[string]string{
  4139. "name": c.name,
  4140. })
  4141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4142. }
  4143. // Do executes the "container.projects.locations.clusters.setLogging" call.
  4144. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4145. // status code is an error. Response headers are in either
  4146. // *Operation.ServerResponse.Header or (if a response was returned at
  4147. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4148. // to check whether the returned error was because
  4149. // http.StatusNotModified was returned.
  4150. func (c *ProjectsLocationsClustersSetLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4151. gensupport.SetOptions(c.urlParams_, opts...)
  4152. res, err := c.doRequest("json")
  4153. if res != nil && res.StatusCode == http.StatusNotModified {
  4154. if res.Body != nil {
  4155. res.Body.Close()
  4156. }
  4157. return nil, &googleapi.Error{
  4158. Code: res.StatusCode,
  4159. Header: res.Header,
  4160. }
  4161. }
  4162. if err != nil {
  4163. return nil, err
  4164. }
  4165. defer googleapi.CloseBody(res)
  4166. if err := googleapi.CheckResponse(res); err != nil {
  4167. return nil, err
  4168. }
  4169. ret := &Operation{
  4170. ServerResponse: googleapi.ServerResponse{
  4171. Header: res.Header,
  4172. HTTPStatusCode: res.StatusCode,
  4173. },
  4174. }
  4175. target := &ret
  4176. if err := gensupport.DecodeResponse(target, res); err != nil {
  4177. return nil, err
  4178. }
  4179. return ret, nil
  4180. // {
  4181. // "description": "Sets the logging service for a specific cluster.",
  4182. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setLogging",
  4183. // "httpMethod": "POST",
  4184. // "id": "container.projects.locations.clusters.setLogging",
  4185. // "parameterOrder": [
  4186. // "name"
  4187. // ],
  4188. // "parameters": {
  4189. // "name": {
  4190. // "description": "The name (project, location, cluster) of the cluster to set logging.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4191. // "location": "path",
  4192. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4193. // "required": true,
  4194. // "type": "string"
  4195. // }
  4196. // },
  4197. // "path": "v1/{+name}:setLogging",
  4198. // "request": {
  4199. // "$ref": "SetLoggingServiceRequest"
  4200. // },
  4201. // "response": {
  4202. // "$ref": "Operation"
  4203. // },
  4204. // "scopes": [
  4205. // "https://www.googleapis.com/auth/cloud-platform"
  4206. // ]
  4207. // }
  4208. }
  4209. // method id "container.projects.locations.clusters.setMaintenancePolicy":
  4210. type ProjectsLocationsClustersSetMaintenancePolicyCall struct {
  4211. s *Service
  4212. name string
  4213. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  4214. urlParams_ gensupport.URLParams
  4215. ctx_ context.Context
  4216. header_ http.Header
  4217. }
  4218. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  4219. func (r *ProjectsLocationsClustersService) SetMaintenancePolicy(name string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4220. c := &ProjectsLocationsClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4221. c.name = name
  4222. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  4223. return c
  4224. }
  4225. // Fields allows partial responses to be retrieved. See
  4226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4227. // for more information.
  4228. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4230. return c
  4231. }
  4232. // Context sets the context to be used in this call's Do method. Any
  4233. // pending HTTP request will be aborted if the provided context is
  4234. // canceled.
  4235. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMaintenancePolicyCall {
  4236. c.ctx_ = ctx
  4237. return c
  4238. }
  4239. // Header returns an http.Header that can be modified by the caller to
  4240. // add HTTP headers to the request.
  4241. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Header() http.Header {
  4242. if c.header_ == nil {
  4243. c.header_ = make(http.Header)
  4244. }
  4245. return c.header_
  4246. }
  4247. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  4248. reqHeaders := make(http.Header)
  4249. for k, v := range c.header_ {
  4250. reqHeaders[k] = v
  4251. }
  4252. reqHeaders.Set("User-Agent", c.s.userAgent())
  4253. var body io.Reader = nil
  4254. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  4255. if err != nil {
  4256. return nil, err
  4257. }
  4258. reqHeaders.Set("Content-Type", "application/json")
  4259. c.urlParams_.Set("alt", alt)
  4260. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMaintenancePolicy")
  4261. urls += "?" + c.urlParams_.Encode()
  4262. req, _ := http.NewRequest("POST", urls, body)
  4263. req.Header = reqHeaders
  4264. googleapi.Expand(req.URL, map[string]string{
  4265. "name": c.name,
  4266. })
  4267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4268. }
  4269. // Do executes the "container.projects.locations.clusters.setMaintenancePolicy" call.
  4270. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4271. // status code is an error. Response headers are in either
  4272. // *Operation.ServerResponse.Header or (if a response was returned at
  4273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4274. // to check whether the returned error was because
  4275. // http.StatusNotModified was returned.
  4276. func (c *ProjectsLocationsClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4277. gensupport.SetOptions(c.urlParams_, opts...)
  4278. res, err := c.doRequest("json")
  4279. if res != nil && res.StatusCode == http.StatusNotModified {
  4280. if res.Body != nil {
  4281. res.Body.Close()
  4282. }
  4283. return nil, &googleapi.Error{
  4284. Code: res.StatusCode,
  4285. Header: res.Header,
  4286. }
  4287. }
  4288. if err != nil {
  4289. return nil, err
  4290. }
  4291. defer googleapi.CloseBody(res)
  4292. if err := googleapi.CheckResponse(res); err != nil {
  4293. return nil, err
  4294. }
  4295. ret := &Operation{
  4296. ServerResponse: googleapi.ServerResponse{
  4297. Header: res.Header,
  4298. HTTPStatusCode: res.StatusCode,
  4299. },
  4300. }
  4301. target := &ret
  4302. if err := gensupport.DecodeResponse(target, res); err != nil {
  4303. return nil, err
  4304. }
  4305. return ret, nil
  4306. // {
  4307. // "description": "Sets the maintenance policy for a cluster.",
  4308. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMaintenancePolicy",
  4309. // "httpMethod": "POST",
  4310. // "id": "container.projects.locations.clusters.setMaintenancePolicy",
  4311. // "parameterOrder": [
  4312. // "name"
  4313. // ],
  4314. // "parameters": {
  4315. // "name": {
  4316. // "description": "The name (project, location, cluster id) of the cluster to set maintenance\npolicy.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4317. // "location": "path",
  4318. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4319. // "required": true,
  4320. // "type": "string"
  4321. // }
  4322. // },
  4323. // "path": "v1/{+name}:setMaintenancePolicy",
  4324. // "request": {
  4325. // "$ref": "SetMaintenancePolicyRequest"
  4326. // },
  4327. // "response": {
  4328. // "$ref": "Operation"
  4329. // },
  4330. // "scopes": [
  4331. // "https://www.googleapis.com/auth/cloud-platform"
  4332. // ]
  4333. // }
  4334. }
  4335. // method id "container.projects.locations.clusters.setMasterAuth":
  4336. type ProjectsLocationsClustersSetMasterAuthCall struct {
  4337. s *Service
  4338. name string
  4339. setmasterauthrequest *SetMasterAuthRequest
  4340. urlParams_ gensupport.URLParams
  4341. ctx_ context.Context
  4342. header_ http.Header
  4343. }
  4344. // SetMasterAuth: Used to set master auth materials. Currently supports
  4345. // :-
  4346. // Changing the admin password for a specific cluster.
  4347. // This can be either via password generation or explicitly set the
  4348. // password.
  4349. func (r *ProjectsLocationsClustersService) SetMasterAuth(name string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsLocationsClustersSetMasterAuthCall {
  4350. c := &ProjectsLocationsClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4351. c.name = name
  4352. c.setmasterauthrequest = setmasterauthrequest
  4353. return c
  4354. }
  4355. // Fields allows partial responses to be retrieved. See
  4356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4357. // for more information.
  4358. func (c *ProjectsLocationsClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMasterAuthCall {
  4359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4360. return c
  4361. }
  4362. // Context sets the context to be used in this call's Do method. Any
  4363. // pending HTTP request will be aborted if the provided context is
  4364. // canceled.
  4365. func (c *ProjectsLocationsClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMasterAuthCall {
  4366. c.ctx_ = ctx
  4367. return c
  4368. }
  4369. // Header returns an http.Header that can be modified by the caller to
  4370. // add HTTP headers to the request.
  4371. func (c *ProjectsLocationsClustersSetMasterAuthCall) Header() http.Header {
  4372. if c.header_ == nil {
  4373. c.header_ = make(http.Header)
  4374. }
  4375. return c.header_
  4376. }
  4377. func (c *ProjectsLocationsClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  4378. reqHeaders := make(http.Header)
  4379. for k, v := range c.header_ {
  4380. reqHeaders[k] = v
  4381. }
  4382. reqHeaders.Set("User-Agent", c.s.userAgent())
  4383. var body io.Reader = nil
  4384. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  4385. if err != nil {
  4386. return nil, err
  4387. }
  4388. reqHeaders.Set("Content-Type", "application/json")
  4389. c.urlParams_.Set("alt", alt)
  4390. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMasterAuth")
  4391. urls += "?" + c.urlParams_.Encode()
  4392. req, _ := http.NewRequest("POST", urls, body)
  4393. req.Header = reqHeaders
  4394. googleapi.Expand(req.URL, map[string]string{
  4395. "name": c.name,
  4396. })
  4397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4398. }
  4399. // Do executes the "container.projects.locations.clusters.setMasterAuth" call.
  4400. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4401. // status code is an error. Response headers are in either
  4402. // *Operation.ServerResponse.Header or (if a response was returned at
  4403. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4404. // to check whether the returned error was because
  4405. // http.StatusNotModified was returned.
  4406. func (c *ProjectsLocationsClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4407. gensupport.SetOptions(c.urlParams_, opts...)
  4408. res, err := c.doRequest("json")
  4409. if res != nil && res.StatusCode == http.StatusNotModified {
  4410. if res.Body != nil {
  4411. res.Body.Close()
  4412. }
  4413. return nil, &googleapi.Error{
  4414. Code: res.StatusCode,
  4415. Header: res.Header,
  4416. }
  4417. }
  4418. if err != nil {
  4419. return nil, err
  4420. }
  4421. defer googleapi.CloseBody(res)
  4422. if err := googleapi.CheckResponse(res); err != nil {
  4423. return nil, err
  4424. }
  4425. ret := &Operation{
  4426. ServerResponse: googleapi.ServerResponse{
  4427. Header: res.Header,
  4428. HTTPStatusCode: res.StatusCode,
  4429. },
  4430. }
  4431. target := &ret
  4432. if err := gensupport.DecodeResponse(target, res); err != nil {
  4433. return nil, err
  4434. }
  4435. return ret, nil
  4436. // {
  4437. // "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.",
  4438. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMasterAuth",
  4439. // "httpMethod": "POST",
  4440. // "id": "container.projects.locations.clusters.setMasterAuth",
  4441. // "parameterOrder": [
  4442. // "name"
  4443. // ],
  4444. // "parameters": {
  4445. // "name": {
  4446. // "description": "The name (project, location, cluster) of the cluster to set auth.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4447. // "location": "path",
  4448. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4449. // "required": true,
  4450. // "type": "string"
  4451. // }
  4452. // },
  4453. // "path": "v1/{+name}:setMasterAuth",
  4454. // "request": {
  4455. // "$ref": "SetMasterAuthRequest"
  4456. // },
  4457. // "response": {
  4458. // "$ref": "Operation"
  4459. // },
  4460. // "scopes": [
  4461. // "https://www.googleapis.com/auth/cloud-platform"
  4462. // ]
  4463. // }
  4464. }
  4465. // method id "container.projects.locations.clusters.setMonitoring":
  4466. type ProjectsLocationsClustersSetMonitoringCall struct {
  4467. s *Service
  4468. name string
  4469. setmonitoringservicerequest *SetMonitoringServiceRequest
  4470. urlParams_ gensupport.URLParams
  4471. ctx_ context.Context
  4472. header_ http.Header
  4473. }
  4474. // SetMonitoring: Sets the monitoring service for a specific cluster.
  4475. func (r *ProjectsLocationsClustersService) SetMonitoring(name string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsLocationsClustersSetMonitoringCall {
  4476. c := &ProjectsLocationsClustersSetMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4477. c.name = name
  4478. c.setmonitoringservicerequest = setmonitoringservicerequest
  4479. return c
  4480. }
  4481. // Fields allows partial responses to be retrieved. See
  4482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4483. // for more information.
  4484. func (c *ProjectsLocationsClustersSetMonitoringCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetMonitoringCall {
  4485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4486. return c
  4487. }
  4488. // Context sets the context to be used in this call's Do method. Any
  4489. // pending HTTP request will be aborted if the provided context is
  4490. // canceled.
  4491. func (c *ProjectsLocationsClustersSetMonitoringCall) Context(ctx context.Context) *ProjectsLocationsClustersSetMonitoringCall {
  4492. c.ctx_ = ctx
  4493. return c
  4494. }
  4495. // Header returns an http.Header that can be modified by the caller to
  4496. // add HTTP headers to the request.
  4497. func (c *ProjectsLocationsClustersSetMonitoringCall) Header() http.Header {
  4498. if c.header_ == nil {
  4499. c.header_ = make(http.Header)
  4500. }
  4501. return c.header_
  4502. }
  4503. func (c *ProjectsLocationsClustersSetMonitoringCall) doRequest(alt string) (*http.Response, error) {
  4504. reqHeaders := make(http.Header)
  4505. for k, v := range c.header_ {
  4506. reqHeaders[k] = v
  4507. }
  4508. reqHeaders.Set("User-Agent", c.s.userAgent())
  4509. var body io.Reader = nil
  4510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  4511. if err != nil {
  4512. return nil, err
  4513. }
  4514. reqHeaders.Set("Content-Type", "application/json")
  4515. c.urlParams_.Set("alt", alt)
  4516. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMonitoring")
  4517. urls += "?" + c.urlParams_.Encode()
  4518. req, _ := http.NewRequest("POST", urls, body)
  4519. req.Header = reqHeaders
  4520. googleapi.Expand(req.URL, map[string]string{
  4521. "name": c.name,
  4522. })
  4523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4524. }
  4525. // Do executes the "container.projects.locations.clusters.setMonitoring" call.
  4526. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4527. // status code is an error. Response headers are in either
  4528. // *Operation.ServerResponse.Header or (if a response was returned at
  4529. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4530. // to check whether the returned error was because
  4531. // http.StatusNotModified was returned.
  4532. func (c *ProjectsLocationsClustersSetMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4533. gensupport.SetOptions(c.urlParams_, opts...)
  4534. res, err := c.doRequest("json")
  4535. if res != nil && res.StatusCode == http.StatusNotModified {
  4536. if res.Body != nil {
  4537. res.Body.Close()
  4538. }
  4539. return nil, &googleapi.Error{
  4540. Code: res.StatusCode,
  4541. Header: res.Header,
  4542. }
  4543. }
  4544. if err != nil {
  4545. return nil, err
  4546. }
  4547. defer googleapi.CloseBody(res)
  4548. if err := googleapi.CheckResponse(res); err != nil {
  4549. return nil, err
  4550. }
  4551. ret := &Operation{
  4552. ServerResponse: googleapi.ServerResponse{
  4553. Header: res.Header,
  4554. HTTPStatusCode: res.StatusCode,
  4555. },
  4556. }
  4557. target := &ret
  4558. if err := gensupport.DecodeResponse(target, res); err != nil {
  4559. return nil, err
  4560. }
  4561. return ret, nil
  4562. // {
  4563. // "description": "Sets the monitoring service for a specific cluster.",
  4564. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setMonitoring",
  4565. // "httpMethod": "POST",
  4566. // "id": "container.projects.locations.clusters.setMonitoring",
  4567. // "parameterOrder": [
  4568. // "name"
  4569. // ],
  4570. // "parameters": {
  4571. // "name": {
  4572. // "description": "The name (project, location, cluster) of the cluster to set monitoring.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4573. // "location": "path",
  4574. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4575. // "required": true,
  4576. // "type": "string"
  4577. // }
  4578. // },
  4579. // "path": "v1/{+name}:setMonitoring",
  4580. // "request": {
  4581. // "$ref": "SetMonitoringServiceRequest"
  4582. // },
  4583. // "response": {
  4584. // "$ref": "Operation"
  4585. // },
  4586. // "scopes": [
  4587. // "https://www.googleapis.com/auth/cloud-platform"
  4588. // ]
  4589. // }
  4590. }
  4591. // method id "container.projects.locations.clusters.setNetworkPolicy":
  4592. type ProjectsLocationsClustersSetNetworkPolicyCall struct {
  4593. s *Service
  4594. name string
  4595. setnetworkpolicyrequest *SetNetworkPolicyRequest
  4596. urlParams_ gensupport.URLParams
  4597. ctx_ context.Context
  4598. header_ http.Header
  4599. }
  4600. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  4601. func (r *ProjectsLocationsClustersService) SetNetworkPolicy(name string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsLocationsClustersSetNetworkPolicyCall {
  4602. c := &ProjectsLocationsClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4603. c.name = name
  4604. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  4605. return c
  4606. }
  4607. // Fields allows partial responses to be retrieved. See
  4608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4609. // for more information.
  4610. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetNetworkPolicyCall {
  4611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4612. return c
  4613. }
  4614. // Context sets the context to be used in this call's Do method. Any
  4615. // pending HTTP request will be aborted if the provided context is
  4616. // canceled.
  4617. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsLocationsClustersSetNetworkPolicyCall {
  4618. c.ctx_ = ctx
  4619. return c
  4620. }
  4621. // Header returns an http.Header that can be modified by the caller to
  4622. // add HTTP headers to the request.
  4623. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Header() http.Header {
  4624. if c.header_ == nil {
  4625. c.header_ = make(http.Header)
  4626. }
  4627. return c.header_
  4628. }
  4629. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  4630. reqHeaders := make(http.Header)
  4631. for k, v := range c.header_ {
  4632. reqHeaders[k] = v
  4633. }
  4634. reqHeaders.Set("User-Agent", c.s.userAgent())
  4635. var body io.Reader = nil
  4636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  4637. if err != nil {
  4638. return nil, err
  4639. }
  4640. reqHeaders.Set("Content-Type", "application/json")
  4641. c.urlParams_.Set("alt", alt)
  4642. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setNetworkPolicy")
  4643. urls += "?" + c.urlParams_.Encode()
  4644. req, _ := http.NewRequest("POST", urls, body)
  4645. req.Header = reqHeaders
  4646. googleapi.Expand(req.URL, map[string]string{
  4647. "name": c.name,
  4648. })
  4649. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4650. }
  4651. // Do executes the "container.projects.locations.clusters.setNetworkPolicy" call.
  4652. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4653. // status code is an error. Response headers are in either
  4654. // *Operation.ServerResponse.Header or (if a response was returned at
  4655. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4656. // to check whether the returned error was because
  4657. // http.StatusNotModified was returned.
  4658. func (c *ProjectsLocationsClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4659. gensupport.SetOptions(c.urlParams_, opts...)
  4660. res, err := c.doRequest("json")
  4661. if res != nil && res.StatusCode == http.StatusNotModified {
  4662. if res.Body != nil {
  4663. res.Body.Close()
  4664. }
  4665. return nil, &googleapi.Error{
  4666. Code: res.StatusCode,
  4667. Header: res.Header,
  4668. }
  4669. }
  4670. if err != nil {
  4671. return nil, err
  4672. }
  4673. defer googleapi.CloseBody(res)
  4674. if err := googleapi.CheckResponse(res); err != nil {
  4675. return nil, err
  4676. }
  4677. ret := &Operation{
  4678. ServerResponse: googleapi.ServerResponse{
  4679. Header: res.Header,
  4680. HTTPStatusCode: res.StatusCode,
  4681. },
  4682. }
  4683. target := &ret
  4684. if err := gensupport.DecodeResponse(target, res); err != nil {
  4685. return nil, err
  4686. }
  4687. return ret, nil
  4688. // {
  4689. // "description": "Enables/Disables Network Policy for a cluster.",
  4690. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setNetworkPolicy",
  4691. // "httpMethod": "POST",
  4692. // "id": "container.projects.locations.clusters.setNetworkPolicy",
  4693. // "parameterOrder": [
  4694. // "name"
  4695. // ],
  4696. // "parameters": {
  4697. // "name": {
  4698. // "description": "The name (project, location, cluster id) of the cluster to set networking\npolicy. Specified in the format 'projects/*/locations/*/clusters/*'.",
  4699. // "location": "path",
  4700. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4701. // "required": true,
  4702. // "type": "string"
  4703. // }
  4704. // },
  4705. // "path": "v1/{+name}:setNetworkPolicy",
  4706. // "request": {
  4707. // "$ref": "SetNetworkPolicyRequest"
  4708. // },
  4709. // "response": {
  4710. // "$ref": "Operation"
  4711. // },
  4712. // "scopes": [
  4713. // "https://www.googleapis.com/auth/cloud-platform"
  4714. // ]
  4715. // }
  4716. }
  4717. // method id "container.projects.locations.clusters.setResourceLabels":
  4718. type ProjectsLocationsClustersSetResourceLabelsCall struct {
  4719. s *Service
  4720. name string
  4721. setlabelsrequest *SetLabelsRequest
  4722. urlParams_ gensupport.URLParams
  4723. ctx_ context.Context
  4724. header_ http.Header
  4725. }
  4726. // SetResourceLabels: Sets labels on a cluster.
  4727. func (r *ProjectsLocationsClustersService) SetResourceLabels(name string, setlabelsrequest *SetLabelsRequest) *ProjectsLocationsClustersSetResourceLabelsCall {
  4728. c := &ProjectsLocationsClustersSetResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4729. c.name = name
  4730. c.setlabelsrequest = setlabelsrequest
  4731. return c
  4732. }
  4733. // Fields allows partial responses to be retrieved. See
  4734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4735. // for more information.
  4736. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersSetResourceLabelsCall {
  4737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4738. return c
  4739. }
  4740. // Context sets the context to be used in this call's Do method. Any
  4741. // pending HTTP request will be aborted if the provided context is
  4742. // canceled.
  4743. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Context(ctx context.Context) *ProjectsLocationsClustersSetResourceLabelsCall {
  4744. c.ctx_ = ctx
  4745. return c
  4746. }
  4747. // Header returns an http.Header that can be modified by the caller to
  4748. // add HTTP headers to the request.
  4749. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Header() http.Header {
  4750. if c.header_ == nil {
  4751. c.header_ = make(http.Header)
  4752. }
  4753. return c.header_
  4754. }
  4755. func (c *ProjectsLocationsClustersSetResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  4756. reqHeaders := make(http.Header)
  4757. for k, v := range c.header_ {
  4758. reqHeaders[k] = v
  4759. }
  4760. reqHeaders.Set("User-Agent", c.s.userAgent())
  4761. var body io.Reader = nil
  4762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  4763. if err != nil {
  4764. return nil, err
  4765. }
  4766. reqHeaders.Set("Content-Type", "application/json")
  4767. c.urlParams_.Set("alt", alt)
  4768. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setResourceLabels")
  4769. urls += "?" + c.urlParams_.Encode()
  4770. req, _ := http.NewRequest("POST", urls, body)
  4771. req.Header = reqHeaders
  4772. googleapi.Expand(req.URL, map[string]string{
  4773. "name": c.name,
  4774. })
  4775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4776. }
  4777. // Do executes the "container.projects.locations.clusters.setResourceLabels" call.
  4778. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4779. // status code is an error. Response headers are in either
  4780. // *Operation.ServerResponse.Header or (if a response was returned at
  4781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4782. // to check whether the returned error was because
  4783. // http.StatusNotModified was returned.
  4784. func (c *ProjectsLocationsClustersSetResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4785. gensupport.SetOptions(c.urlParams_, opts...)
  4786. res, err := c.doRequest("json")
  4787. if res != nil && res.StatusCode == http.StatusNotModified {
  4788. if res.Body != nil {
  4789. res.Body.Close()
  4790. }
  4791. return nil, &googleapi.Error{
  4792. Code: res.StatusCode,
  4793. Header: res.Header,
  4794. }
  4795. }
  4796. if err != nil {
  4797. return nil, err
  4798. }
  4799. defer googleapi.CloseBody(res)
  4800. if err := googleapi.CheckResponse(res); err != nil {
  4801. return nil, err
  4802. }
  4803. ret := &Operation{
  4804. ServerResponse: googleapi.ServerResponse{
  4805. Header: res.Header,
  4806. HTTPStatusCode: res.StatusCode,
  4807. },
  4808. }
  4809. target := &ret
  4810. if err := gensupport.DecodeResponse(target, res); err != nil {
  4811. return nil, err
  4812. }
  4813. return ret, nil
  4814. // {
  4815. // "description": "Sets labels on a cluster.",
  4816. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:setResourceLabels",
  4817. // "httpMethod": "POST",
  4818. // "id": "container.projects.locations.clusters.setResourceLabels",
  4819. // "parameterOrder": [
  4820. // "name"
  4821. // ],
  4822. // "parameters": {
  4823. // "name": {
  4824. // "description": "The name (project, location, cluster id) of the cluster to set labels.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  4825. // "location": "path",
  4826. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4827. // "required": true,
  4828. // "type": "string"
  4829. // }
  4830. // },
  4831. // "path": "v1/{+name}:setResourceLabels",
  4832. // "request": {
  4833. // "$ref": "SetLabelsRequest"
  4834. // },
  4835. // "response": {
  4836. // "$ref": "Operation"
  4837. // },
  4838. // "scopes": [
  4839. // "https://www.googleapis.com/auth/cloud-platform"
  4840. // ]
  4841. // }
  4842. }
  4843. // method id "container.projects.locations.clusters.startIpRotation":
  4844. type ProjectsLocationsClustersStartIpRotationCall struct {
  4845. s *Service
  4846. name string
  4847. startiprotationrequest *StartIPRotationRequest
  4848. urlParams_ gensupport.URLParams
  4849. ctx_ context.Context
  4850. header_ http.Header
  4851. }
  4852. // StartIpRotation: Start master IP rotation.
  4853. func (r *ProjectsLocationsClustersService) StartIpRotation(name string, startiprotationrequest *StartIPRotationRequest) *ProjectsLocationsClustersStartIpRotationCall {
  4854. c := &ProjectsLocationsClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4855. c.name = name
  4856. c.startiprotationrequest = startiprotationrequest
  4857. return c
  4858. }
  4859. // Fields allows partial responses to be retrieved. See
  4860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4861. // for more information.
  4862. func (c *ProjectsLocationsClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersStartIpRotationCall {
  4863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4864. return c
  4865. }
  4866. // Context sets the context to be used in this call's Do method. Any
  4867. // pending HTTP request will be aborted if the provided context is
  4868. // canceled.
  4869. func (c *ProjectsLocationsClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsLocationsClustersStartIpRotationCall {
  4870. c.ctx_ = ctx
  4871. return c
  4872. }
  4873. // Header returns an http.Header that can be modified by the caller to
  4874. // add HTTP headers to the request.
  4875. func (c *ProjectsLocationsClustersStartIpRotationCall) Header() http.Header {
  4876. if c.header_ == nil {
  4877. c.header_ = make(http.Header)
  4878. }
  4879. return c.header_
  4880. }
  4881. func (c *ProjectsLocationsClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  4882. reqHeaders := make(http.Header)
  4883. for k, v := range c.header_ {
  4884. reqHeaders[k] = v
  4885. }
  4886. reqHeaders.Set("User-Agent", c.s.userAgent())
  4887. var body io.Reader = nil
  4888. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  4889. if err != nil {
  4890. return nil, err
  4891. }
  4892. reqHeaders.Set("Content-Type", "application/json")
  4893. c.urlParams_.Set("alt", alt)
  4894. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:startIpRotation")
  4895. urls += "?" + c.urlParams_.Encode()
  4896. req, _ := http.NewRequest("POST", urls, body)
  4897. req.Header = reqHeaders
  4898. googleapi.Expand(req.URL, map[string]string{
  4899. "name": c.name,
  4900. })
  4901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4902. }
  4903. // Do executes the "container.projects.locations.clusters.startIpRotation" call.
  4904. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4905. // status code is an error. Response headers are in either
  4906. // *Operation.ServerResponse.Header or (if a response was returned at
  4907. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4908. // to check whether the returned error was because
  4909. // http.StatusNotModified was returned.
  4910. func (c *ProjectsLocationsClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4911. gensupport.SetOptions(c.urlParams_, opts...)
  4912. res, err := c.doRequest("json")
  4913. if res != nil && res.StatusCode == http.StatusNotModified {
  4914. if res.Body != nil {
  4915. res.Body.Close()
  4916. }
  4917. return nil, &googleapi.Error{
  4918. Code: res.StatusCode,
  4919. Header: res.Header,
  4920. }
  4921. }
  4922. if err != nil {
  4923. return nil, err
  4924. }
  4925. defer googleapi.CloseBody(res)
  4926. if err := googleapi.CheckResponse(res); err != nil {
  4927. return nil, err
  4928. }
  4929. ret := &Operation{
  4930. ServerResponse: googleapi.ServerResponse{
  4931. Header: res.Header,
  4932. HTTPStatusCode: res.StatusCode,
  4933. },
  4934. }
  4935. target := &ret
  4936. if err := gensupport.DecodeResponse(target, res); err != nil {
  4937. return nil, err
  4938. }
  4939. return ret, nil
  4940. // {
  4941. // "description": "Start master IP rotation.",
  4942. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:startIpRotation",
  4943. // "httpMethod": "POST",
  4944. // "id": "container.projects.locations.clusters.startIpRotation",
  4945. // "parameterOrder": [
  4946. // "name"
  4947. // ],
  4948. // "parameters": {
  4949. // "name": {
  4950. // "description": "The name (project, location, cluster id) of the cluster to start IP\nrotation. Specified in the format 'projects/*/locations/*/clusters/*'.",
  4951. // "location": "path",
  4952. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  4953. // "required": true,
  4954. // "type": "string"
  4955. // }
  4956. // },
  4957. // "path": "v1/{+name}:startIpRotation",
  4958. // "request": {
  4959. // "$ref": "StartIPRotationRequest"
  4960. // },
  4961. // "response": {
  4962. // "$ref": "Operation"
  4963. // },
  4964. // "scopes": [
  4965. // "https://www.googleapis.com/auth/cloud-platform"
  4966. // ]
  4967. // }
  4968. }
  4969. // method id "container.projects.locations.clusters.update":
  4970. type ProjectsLocationsClustersUpdateCall struct {
  4971. s *Service
  4972. name string
  4973. updateclusterrequest *UpdateClusterRequest
  4974. urlParams_ gensupport.URLParams
  4975. ctx_ context.Context
  4976. header_ http.Header
  4977. }
  4978. // Update: Updates the settings of a specific cluster.
  4979. func (r *ProjectsLocationsClustersService) Update(name string, updateclusterrequest *UpdateClusterRequest) *ProjectsLocationsClustersUpdateCall {
  4980. c := &ProjectsLocationsClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4981. c.name = name
  4982. c.updateclusterrequest = updateclusterrequest
  4983. return c
  4984. }
  4985. // Fields allows partial responses to be retrieved. See
  4986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4987. // for more information.
  4988. func (c *ProjectsLocationsClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateCall {
  4989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4990. return c
  4991. }
  4992. // Context sets the context to be used in this call's Do method. Any
  4993. // pending HTTP request will be aborted if the provided context is
  4994. // canceled.
  4995. func (c *ProjectsLocationsClustersUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateCall {
  4996. c.ctx_ = ctx
  4997. return c
  4998. }
  4999. // Header returns an http.Header that can be modified by the caller to
  5000. // add HTTP headers to the request.
  5001. func (c *ProjectsLocationsClustersUpdateCall) Header() http.Header {
  5002. if c.header_ == nil {
  5003. c.header_ = make(http.Header)
  5004. }
  5005. return c.header_
  5006. }
  5007. func (c *ProjectsLocationsClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  5008. reqHeaders := make(http.Header)
  5009. for k, v := range c.header_ {
  5010. reqHeaders[k] = v
  5011. }
  5012. reqHeaders.Set("User-Agent", c.s.userAgent())
  5013. var body io.Reader = nil
  5014. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  5015. if err != nil {
  5016. return nil, err
  5017. }
  5018. reqHeaders.Set("Content-Type", "application/json")
  5019. c.urlParams_.Set("alt", alt)
  5020. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5021. urls += "?" + c.urlParams_.Encode()
  5022. req, _ := http.NewRequest("PUT", urls, body)
  5023. req.Header = reqHeaders
  5024. googleapi.Expand(req.URL, map[string]string{
  5025. "name": c.name,
  5026. })
  5027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5028. }
  5029. // Do executes the "container.projects.locations.clusters.update" call.
  5030. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5031. // status code is an error. Response headers are in either
  5032. // *Operation.ServerResponse.Header or (if a response was returned at
  5033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5034. // to check whether the returned error was because
  5035. // http.StatusNotModified was returned.
  5036. func (c *ProjectsLocationsClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5037. gensupport.SetOptions(c.urlParams_, opts...)
  5038. res, err := c.doRequest("json")
  5039. if res != nil && res.StatusCode == http.StatusNotModified {
  5040. if res.Body != nil {
  5041. res.Body.Close()
  5042. }
  5043. return nil, &googleapi.Error{
  5044. Code: res.StatusCode,
  5045. Header: res.Header,
  5046. }
  5047. }
  5048. if err != nil {
  5049. return nil, err
  5050. }
  5051. defer googleapi.CloseBody(res)
  5052. if err := googleapi.CheckResponse(res); err != nil {
  5053. return nil, err
  5054. }
  5055. ret := &Operation{
  5056. ServerResponse: googleapi.ServerResponse{
  5057. Header: res.Header,
  5058. HTTPStatusCode: res.StatusCode,
  5059. },
  5060. }
  5061. target := &ret
  5062. if err := gensupport.DecodeResponse(target, res); err != nil {
  5063. return nil, err
  5064. }
  5065. return ret, nil
  5066. // {
  5067. // "description": "Updates the settings of a specific cluster.",
  5068. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}",
  5069. // "httpMethod": "PUT",
  5070. // "id": "container.projects.locations.clusters.update",
  5071. // "parameterOrder": [
  5072. // "name"
  5073. // ],
  5074. // "parameters": {
  5075. // "name": {
  5076. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5077. // "location": "path",
  5078. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5079. // "required": true,
  5080. // "type": "string"
  5081. // }
  5082. // },
  5083. // "path": "v1/{+name}",
  5084. // "request": {
  5085. // "$ref": "UpdateClusterRequest"
  5086. // },
  5087. // "response": {
  5088. // "$ref": "Operation"
  5089. // },
  5090. // "scopes": [
  5091. // "https://www.googleapis.com/auth/cloud-platform"
  5092. // ]
  5093. // }
  5094. }
  5095. // method id "container.projects.locations.clusters.updateMaster":
  5096. type ProjectsLocationsClustersUpdateMasterCall struct {
  5097. s *Service
  5098. name string
  5099. updatemasterrequest *UpdateMasterRequest
  5100. urlParams_ gensupport.URLParams
  5101. ctx_ context.Context
  5102. header_ http.Header
  5103. }
  5104. // UpdateMaster: Updates the master for a specific cluster.
  5105. func (r *ProjectsLocationsClustersService) UpdateMaster(name string, updatemasterrequest *UpdateMasterRequest) *ProjectsLocationsClustersUpdateMasterCall {
  5106. c := &ProjectsLocationsClustersUpdateMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5107. c.name = name
  5108. c.updatemasterrequest = updatemasterrequest
  5109. return c
  5110. }
  5111. // Fields allows partial responses to be retrieved. See
  5112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5113. // for more information.
  5114. func (c *ProjectsLocationsClustersUpdateMasterCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersUpdateMasterCall {
  5115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5116. return c
  5117. }
  5118. // Context sets the context to be used in this call's Do method. Any
  5119. // pending HTTP request will be aborted if the provided context is
  5120. // canceled.
  5121. func (c *ProjectsLocationsClustersUpdateMasterCall) Context(ctx context.Context) *ProjectsLocationsClustersUpdateMasterCall {
  5122. c.ctx_ = ctx
  5123. return c
  5124. }
  5125. // Header returns an http.Header that can be modified by the caller to
  5126. // add HTTP headers to the request.
  5127. func (c *ProjectsLocationsClustersUpdateMasterCall) Header() http.Header {
  5128. if c.header_ == nil {
  5129. c.header_ = make(http.Header)
  5130. }
  5131. return c.header_
  5132. }
  5133. func (c *ProjectsLocationsClustersUpdateMasterCall) doRequest(alt string) (*http.Response, error) {
  5134. reqHeaders := make(http.Header)
  5135. for k, v := range c.header_ {
  5136. reqHeaders[k] = v
  5137. }
  5138. reqHeaders.Set("User-Agent", c.s.userAgent())
  5139. var body io.Reader = nil
  5140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  5141. if err != nil {
  5142. return nil, err
  5143. }
  5144. reqHeaders.Set("Content-Type", "application/json")
  5145. c.urlParams_.Set("alt", alt)
  5146. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:updateMaster")
  5147. urls += "?" + c.urlParams_.Encode()
  5148. req, _ := http.NewRequest("POST", urls, body)
  5149. req.Header = reqHeaders
  5150. googleapi.Expand(req.URL, map[string]string{
  5151. "name": c.name,
  5152. })
  5153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5154. }
  5155. // Do executes the "container.projects.locations.clusters.updateMaster" call.
  5156. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5157. // status code is an error. Response headers are in either
  5158. // *Operation.ServerResponse.Header or (if a response was returned at
  5159. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5160. // to check whether the returned error was because
  5161. // http.StatusNotModified was returned.
  5162. func (c *ProjectsLocationsClustersUpdateMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5163. gensupport.SetOptions(c.urlParams_, opts...)
  5164. res, err := c.doRequest("json")
  5165. if res != nil && res.StatusCode == http.StatusNotModified {
  5166. if res.Body != nil {
  5167. res.Body.Close()
  5168. }
  5169. return nil, &googleapi.Error{
  5170. Code: res.StatusCode,
  5171. Header: res.Header,
  5172. }
  5173. }
  5174. if err != nil {
  5175. return nil, err
  5176. }
  5177. defer googleapi.CloseBody(res)
  5178. if err := googleapi.CheckResponse(res); err != nil {
  5179. return nil, err
  5180. }
  5181. ret := &Operation{
  5182. ServerResponse: googleapi.ServerResponse{
  5183. Header: res.Header,
  5184. HTTPStatusCode: res.StatusCode,
  5185. },
  5186. }
  5187. target := &ret
  5188. if err := gensupport.DecodeResponse(target, res); err != nil {
  5189. return nil, err
  5190. }
  5191. return ret, nil
  5192. // {
  5193. // "description": "Updates the master for a specific cluster.",
  5194. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}:updateMaster",
  5195. // "httpMethod": "POST",
  5196. // "id": "container.projects.locations.clusters.updateMaster",
  5197. // "parameterOrder": [
  5198. // "name"
  5199. // ],
  5200. // "parameters": {
  5201. // "name": {
  5202. // "description": "The name (project, location, cluster) of the cluster to update.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  5203. // "location": "path",
  5204. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5205. // "required": true,
  5206. // "type": "string"
  5207. // }
  5208. // },
  5209. // "path": "v1/{+name}:updateMaster",
  5210. // "request": {
  5211. // "$ref": "UpdateMasterRequest"
  5212. // },
  5213. // "response": {
  5214. // "$ref": "Operation"
  5215. // },
  5216. // "scopes": [
  5217. // "https://www.googleapis.com/auth/cloud-platform"
  5218. // ]
  5219. // }
  5220. }
  5221. // method id "container.projects.locations.clusters.nodePools.create":
  5222. type ProjectsLocationsClustersNodePoolsCreateCall struct {
  5223. s *Service
  5224. parent string
  5225. createnodepoolrequest *CreateNodePoolRequest
  5226. urlParams_ gensupport.URLParams
  5227. ctx_ context.Context
  5228. header_ http.Header
  5229. }
  5230. // Create: Creates a node pool for a cluster.
  5231. func (r *ProjectsLocationsClustersNodePoolsService) Create(parent string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsLocationsClustersNodePoolsCreateCall {
  5232. c := &ProjectsLocationsClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5233. c.parent = parent
  5234. c.createnodepoolrequest = createnodepoolrequest
  5235. return c
  5236. }
  5237. // Fields allows partial responses to be retrieved. See
  5238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5239. // for more information.
  5240. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsCreateCall {
  5241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5242. return c
  5243. }
  5244. // Context sets the context to be used in this call's Do method. Any
  5245. // pending HTTP request will be aborted if the provided context is
  5246. // canceled.
  5247. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsCreateCall {
  5248. c.ctx_ = ctx
  5249. return c
  5250. }
  5251. // Header returns an http.Header that can be modified by the caller to
  5252. // add HTTP headers to the request.
  5253. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Header() http.Header {
  5254. if c.header_ == nil {
  5255. c.header_ = make(http.Header)
  5256. }
  5257. return c.header_
  5258. }
  5259. func (c *ProjectsLocationsClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  5260. reqHeaders := make(http.Header)
  5261. for k, v := range c.header_ {
  5262. reqHeaders[k] = v
  5263. }
  5264. reqHeaders.Set("User-Agent", c.s.userAgent())
  5265. var body io.Reader = nil
  5266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  5267. if err != nil {
  5268. return nil, err
  5269. }
  5270. reqHeaders.Set("Content-Type", "application/json")
  5271. c.urlParams_.Set("alt", alt)
  5272. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  5273. urls += "?" + c.urlParams_.Encode()
  5274. req, _ := http.NewRequest("POST", urls, body)
  5275. req.Header = reqHeaders
  5276. googleapi.Expand(req.URL, map[string]string{
  5277. "parent": c.parent,
  5278. })
  5279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5280. }
  5281. // Do executes the "container.projects.locations.clusters.nodePools.create" call.
  5282. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5283. // status code is an error. Response headers are in either
  5284. // *Operation.ServerResponse.Header or (if a response was returned at
  5285. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5286. // to check whether the returned error was because
  5287. // http.StatusNotModified was returned.
  5288. func (c *ProjectsLocationsClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5289. gensupport.SetOptions(c.urlParams_, opts...)
  5290. res, err := c.doRequest("json")
  5291. if res != nil && res.StatusCode == http.StatusNotModified {
  5292. if res.Body != nil {
  5293. res.Body.Close()
  5294. }
  5295. return nil, &googleapi.Error{
  5296. Code: res.StatusCode,
  5297. Header: res.Header,
  5298. }
  5299. }
  5300. if err != nil {
  5301. return nil, err
  5302. }
  5303. defer googleapi.CloseBody(res)
  5304. if err := googleapi.CheckResponse(res); err != nil {
  5305. return nil, err
  5306. }
  5307. ret := &Operation{
  5308. ServerResponse: googleapi.ServerResponse{
  5309. Header: res.Header,
  5310. HTTPStatusCode: res.StatusCode,
  5311. },
  5312. }
  5313. target := &ret
  5314. if err := gensupport.DecodeResponse(target, res); err != nil {
  5315. return nil, err
  5316. }
  5317. return ret, nil
  5318. // {
  5319. // "description": "Creates a node pool for a cluster.",
  5320. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  5321. // "httpMethod": "POST",
  5322. // "id": "container.projects.locations.clusters.nodePools.create",
  5323. // "parameterOrder": [
  5324. // "parent"
  5325. // ],
  5326. // "parameters": {
  5327. // "parent": {
  5328. // "description": "The parent (project, location, cluster id) where the node pool will be\ncreated. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  5329. // "location": "path",
  5330. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5331. // "required": true,
  5332. // "type": "string"
  5333. // }
  5334. // },
  5335. // "path": "v1/{+parent}/nodePools",
  5336. // "request": {
  5337. // "$ref": "CreateNodePoolRequest"
  5338. // },
  5339. // "response": {
  5340. // "$ref": "Operation"
  5341. // },
  5342. // "scopes": [
  5343. // "https://www.googleapis.com/auth/cloud-platform"
  5344. // ]
  5345. // }
  5346. }
  5347. // method id "container.projects.locations.clusters.nodePools.delete":
  5348. type ProjectsLocationsClustersNodePoolsDeleteCall struct {
  5349. s *Service
  5350. name string
  5351. urlParams_ gensupport.URLParams
  5352. ctx_ context.Context
  5353. header_ http.Header
  5354. }
  5355. // Delete: Deletes a node pool from a cluster.
  5356. func (r *ProjectsLocationsClustersNodePoolsService) Delete(name string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5357. c := &ProjectsLocationsClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5358. c.name = name
  5359. return c
  5360. }
  5361. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  5362. // name of the cluster.
  5363. // This field has been deprecated and replaced by the name field.
  5364. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5365. c.urlParams_.Set("clusterId", clusterId)
  5366. return c
  5367. }
  5368. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  5369. // name of the node pool to delete.
  5370. // This field has been deprecated and replaced by the name field.
  5371. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5372. c.urlParams_.Set("nodePoolId", nodePoolId)
  5373. return c
  5374. }
  5375. // ProjectId sets the optional parameter "projectId": Deprecated. The
  5376. // Google Developers Console [project ID or
  5377. // project
  5378. // number](https://developers.google.com/console/help/new/#projec
  5379. // tnumber).
  5380. // This field has been deprecated and replaced by the name field.
  5381. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5382. c.urlParams_.Set("projectId", projectId)
  5383. return c
  5384. }
  5385. // Zone sets the optional parameter "zone": Deprecated. The name of the
  5386. // Google Compute Engine
  5387. // [zone](/compute/docs/zones#available) in which the
  5388. // cluster
  5389. // resides.
  5390. // This field has been deprecated and replaced by the name field.
  5391. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5392. c.urlParams_.Set("zone", zone)
  5393. return c
  5394. }
  5395. // Fields allows partial responses to be retrieved. See
  5396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5397. // for more information.
  5398. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5400. return c
  5401. }
  5402. // Context sets the context to be used in this call's Do method. Any
  5403. // pending HTTP request will be aborted if the provided context is
  5404. // canceled.
  5405. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsDeleteCall {
  5406. c.ctx_ = ctx
  5407. return c
  5408. }
  5409. // Header returns an http.Header that can be modified by the caller to
  5410. // add HTTP headers to the request.
  5411. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Header() http.Header {
  5412. if c.header_ == nil {
  5413. c.header_ = make(http.Header)
  5414. }
  5415. return c.header_
  5416. }
  5417. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5418. reqHeaders := make(http.Header)
  5419. for k, v := range c.header_ {
  5420. reqHeaders[k] = v
  5421. }
  5422. reqHeaders.Set("User-Agent", c.s.userAgent())
  5423. var body io.Reader = nil
  5424. c.urlParams_.Set("alt", alt)
  5425. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5426. urls += "?" + c.urlParams_.Encode()
  5427. req, _ := http.NewRequest("DELETE", urls, body)
  5428. req.Header = reqHeaders
  5429. googleapi.Expand(req.URL, map[string]string{
  5430. "name": c.name,
  5431. })
  5432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5433. }
  5434. // Do executes the "container.projects.locations.clusters.nodePools.delete" call.
  5435. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5436. // status code is an error. Response headers are in either
  5437. // *Operation.ServerResponse.Header or (if a response was returned at
  5438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5439. // to check whether the returned error was because
  5440. // http.StatusNotModified was returned.
  5441. func (c *ProjectsLocationsClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5442. gensupport.SetOptions(c.urlParams_, opts...)
  5443. res, err := c.doRequest("json")
  5444. if res != nil && res.StatusCode == http.StatusNotModified {
  5445. if res.Body != nil {
  5446. res.Body.Close()
  5447. }
  5448. return nil, &googleapi.Error{
  5449. Code: res.StatusCode,
  5450. Header: res.Header,
  5451. }
  5452. }
  5453. if err != nil {
  5454. return nil, err
  5455. }
  5456. defer googleapi.CloseBody(res)
  5457. if err := googleapi.CheckResponse(res); err != nil {
  5458. return nil, err
  5459. }
  5460. ret := &Operation{
  5461. ServerResponse: googleapi.ServerResponse{
  5462. Header: res.Header,
  5463. HTTPStatusCode: res.StatusCode,
  5464. },
  5465. }
  5466. target := &ret
  5467. if err := gensupport.DecodeResponse(target, res); err != nil {
  5468. return nil, err
  5469. }
  5470. return ret, nil
  5471. // {
  5472. // "description": "Deletes a node pool from a cluster.",
  5473. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  5474. // "httpMethod": "DELETE",
  5475. // "id": "container.projects.locations.clusters.nodePools.delete",
  5476. // "parameterOrder": [
  5477. // "name"
  5478. // ],
  5479. // "parameters": {
  5480. // "clusterId": {
  5481. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  5482. // "location": "query",
  5483. // "type": "string"
  5484. // },
  5485. // "name": {
  5486. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  5487. // "location": "path",
  5488. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  5489. // "required": true,
  5490. // "type": "string"
  5491. // },
  5492. // "nodePoolId": {
  5493. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  5494. // "location": "query",
  5495. // "type": "string"
  5496. // },
  5497. // "projectId": {
  5498. // "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.",
  5499. // "location": "query",
  5500. // "type": "string"
  5501. // },
  5502. // "zone": {
  5503. // "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.",
  5504. // "location": "query",
  5505. // "type": "string"
  5506. // }
  5507. // },
  5508. // "path": "v1/{+name}",
  5509. // "response": {
  5510. // "$ref": "Operation"
  5511. // },
  5512. // "scopes": [
  5513. // "https://www.googleapis.com/auth/cloud-platform"
  5514. // ]
  5515. // }
  5516. }
  5517. // method id "container.projects.locations.clusters.nodePools.get":
  5518. type ProjectsLocationsClustersNodePoolsGetCall struct {
  5519. s *Service
  5520. name string
  5521. urlParams_ gensupport.URLParams
  5522. ifNoneMatch_ string
  5523. ctx_ context.Context
  5524. header_ http.Header
  5525. }
  5526. // Get: Retrieves the node pool requested.
  5527. func (r *ProjectsLocationsClustersNodePoolsService) Get(name string) *ProjectsLocationsClustersNodePoolsGetCall {
  5528. c := &ProjectsLocationsClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5529. c.name = name
  5530. return c
  5531. }
  5532. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  5533. // name of the cluster.
  5534. // This field has been deprecated and replaced by the name field.
  5535. func (c *ProjectsLocationsClustersNodePoolsGetCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsGetCall {
  5536. c.urlParams_.Set("clusterId", clusterId)
  5537. return c
  5538. }
  5539. // NodePoolId sets the optional parameter "nodePoolId": Deprecated. The
  5540. // name of the node pool.
  5541. // This field has been deprecated and replaced by the name field.
  5542. func (c *ProjectsLocationsClustersNodePoolsGetCall) NodePoolId(nodePoolId string) *ProjectsLocationsClustersNodePoolsGetCall {
  5543. c.urlParams_.Set("nodePoolId", nodePoolId)
  5544. return c
  5545. }
  5546. // ProjectId sets the optional parameter "projectId": Deprecated. The
  5547. // Google Developers Console [project ID or
  5548. // project
  5549. // number](https://developers.google.com/console/help/new/#projec
  5550. // tnumber).
  5551. // This field has been deprecated and replaced by the name field.
  5552. func (c *ProjectsLocationsClustersNodePoolsGetCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsGetCall {
  5553. c.urlParams_.Set("projectId", projectId)
  5554. return c
  5555. }
  5556. // Zone sets the optional parameter "zone": Deprecated. The name of the
  5557. // Google Compute Engine
  5558. // [zone](/compute/docs/zones#available) in which the
  5559. // cluster
  5560. // resides.
  5561. // This field has been deprecated and replaced by the name field.
  5562. func (c *ProjectsLocationsClustersNodePoolsGetCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsGetCall {
  5563. c.urlParams_.Set("zone", zone)
  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 *ProjectsLocationsClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsGetCall {
  5570. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5571. return c
  5572. }
  5573. // IfNoneMatch sets the optional parameter which makes the operation
  5574. // fail if the object's ETag matches the given value. This is useful for
  5575. // getting updates only after the object has changed since the last
  5576. // request. Use googleapi.IsNotModified to check whether the response
  5577. // error from Do is the result of In-None-Match.
  5578. func (c *ProjectsLocationsClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsGetCall {
  5579. c.ifNoneMatch_ = entityTag
  5580. return c
  5581. }
  5582. // Context sets the context to be used in this call's Do method. Any
  5583. // pending HTTP request will be aborted if the provided context is
  5584. // canceled.
  5585. func (c *ProjectsLocationsClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsGetCall {
  5586. c.ctx_ = ctx
  5587. return c
  5588. }
  5589. // Header returns an http.Header that can be modified by the caller to
  5590. // add HTTP headers to the request.
  5591. func (c *ProjectsLocationsClustersNodePoolsGetCall) Header() http.Header {
  5592. if c.header_ == nil {
  5593. c.header_ = make(http.Header)
  5594. }
  5595. return c.header_
  5596. }
  5597. func (c *ProjectsLocationsClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  5598. reqHeaders := make(http.Header)
  5599. for k, v := range c.header_ {
  5600. reqHeaders[k] = v
  5601. }
  5602. reqHeaders.Set("User-Agent", c.s.userAgent())
  5603. if c.ifNoneMatch_ != "" {
  5604. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5605. }
  5606. var body io.Reader = nil
  5607. c.urlParams_.Set("alt", alt)
  5608. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5609. urls += "?" + c.urlParams_.Encode()
  5610. req, _ := http.NewRequest("GET", urls, body)
  5611. req.Header = reqHeaders
  5612. googleapi.Expand(req.URL, map[string]string{
  5613. "name": c.name,
  5614. })
  5615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5616. }
  5617. // Do executes the "container.projects.locations.clusters.nodePools.get" call.
  5618. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  5619. // code is an error. Response headers are in either
  5620. // *NodePool.ServerResponse.Header or (if a response was returned at
  5621. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5622. // to check whether the returned error was because
  5623. // http.StatusNotModified was returned.
  5624. func (c *ProjectsLocationsClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  5625. gensupport.SetOptions(c.urlParams_, opts...)
  5626. res, err := c.doRequest("json")
  5627. if res != nil && res.StatusCode == http.StatusNotModified {
  5628. if res.Body != nil {
  5629. res.Body.Close()
  5630. }
  5631. return nil, &googleapi.Error{
  5632. Code: res.StatusCode,
  5633. Header: res.Header,
  5634. }
  5635. }
  5636. if err != nil {
  5637. return nil, err
  5638. }
  5639. defer googleapi.CloseBody(res)
  5640. if err := googleapi.CheckResponse(res); err != nil {
  5641. return nil, err
  5642. }
  5643. ret := &NodePool{
  5644. ServerResponse: googleapi.ServerResponse{
  5645. Header: res.Header,
  5646. HTTPStatusCode: res.StatusCode,
  5647. },
  5648. }
  5649. target := &ret
  5650. if err := gensupport.DecodeResponse(target, res); err != nil {
  5651. return nil, err
  5652. }
  5653. return ret, nil
  5654. // {
  5655. // "description": "Retrieves the node pool requested.",
  5656. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  5657. // "httpMethod": "GET",
  5658. // "id": "container.projects.locations.clusters.nodePools.get",
  5659. // "parameterOrder": [
  5660. // "name"
  5661. // ],
  5662. // "parameters": {
  5663. // "clusterId": {
  5664. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  5665. // "location": "query",
  5666. // "type": "string"
  5667. // },
  5668. // "name": {
  5669. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  5670. // "location": "path",
  5671. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  5672. // "required": true,
  5673. // "type": "string"
  5674. // },
  5675. // "nodePoolId": {
  5676. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  5677. // "location": "query",
  5678. // "type": "string"
  5679. // },
  5680. // "projectId": {
  5681. // "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.",
  5682. // "location": "query",
  5683. // "type": "string"
  5684. // },
  5685. // "zone": {
  5686. // "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.",
  5687. // "location": "query",
  5688. // "type": "string"
  5689. // }
  5690. // },
  5691. // "path": "v1/{+name}",
  5692. // "response": {
  5693. // "$ref": "NodePool"
  5694. // },
  5695. // "scopes": [
  5696. // "https://www.googleapis.com/auth/cloud-platform"
  5697. // ]
  5698. // }
  5699. }
  5700. // method id "container.projects.locations.clusters.nodePools.list":
  5701. type ProjectsLocationsClustersNodePoolsListCall struct {
  5702. s *Service
  5703. parent string
  5704. urlParams_ gensupport.URLParams
  5705. ifNoneMatch_ string
  5706. ctx_ context.Context
  5707. header_ http.Header
  5708. }
  5709. // List: Lists the node pools for a cluster.
  5710. func (r *ProjectsLocationsClustersNodePoolsService) List(parent string) *ProjectsLocationsClustersNodePoolsListCall {
  5711. c := &ProjectsLocationsClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5712. c.parent = parent
  5713. return c
  5714. }
  5715. // ClusterId sets the optional parameter "clusterId": Deprecated. The
  5716. // name of the cluster.
  5717. // This field has been deprecated and replaced by the parent field.
  5718. func (c *ProjectsLocationsClustersNodePoolsListCall) ClusterId(clusterId string) *ProjectsLocationsClustersNodePoolsListCall {
  5719. c.urlParams_.Set("clusterId", clusterId)
  5720. return c
  5721. }
  5722. // ProjectId sets the optional parameter "projectId": Deprecated. The
  5723. // Google Developers Console [project ID or
  5724. // project
  5725. // number](https://developers.google.com/console/help/new/#projec
  5726. // tnumber).
  5727. // This field has been deprecated and replaced by the parent field.
  5728. func (c *ProjectsLocationsClustersNodePoolsListCall) ProjectId(projectId string) *ProjectsLocationsClustersNodePoolsListCall {
  5729. c.urlParams_.Set("projectId", projectId)
  5730. return c
  5731. }
  5732. // Zone sets the optional parameter "zone": Deprecated. The name of the
  5733. // Google Compute Engine
  5734. // [zone](/compute/docs/zones#available) in which the
  5735. // cluster
  5736. // resides.
  5737. // This field has been deprecated and replaced by the parent field.
  5738. func (c *ProjectsLocationsClustersNodePoolsListCall) Zone(zone string) *ProjectsLocationsClustersNodePoolsListCall {
  5739. c.urlParams_.Set("zone", zone)
  5740. return c
  5741. }
  5742. // Fields allows partial responses to be retrieved. See
  5743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5744. // for more information.
  5745. func (c *ProjectsLocationsClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsListCall {
  5746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5747. return c
  5748. }
  5749. // IfNoneMatch sets the optional parameter which makes the operation
  5750. // fail if the object's ETag matches the given value. This is useful for
  5751. // getting updates only after the object has changed since the last
  5752. // request. Use googleapi.IsNotModified to check whether the response
  5753. // error from Do is the result of In-None-Match.
  5754. func (c *ProjectsLocationsClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsClustersNodePoolsListCall {
  5755. c.ifNoneMatch_ = entityTag
  5756. return c
  5757. }
  5758. // Context sets the context to be used in this call's Do method. Any
  5759. // pending HTTP request will be aborted if the provided context is
  5760. // canceled.
  5761. func (c *ProjectsLocationsClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsListCall {
  5762. c.ctx_ = ctx
  5763. return c
  5764. }
  5765. // Header returns an http.Header that can be modified by the caller to
  5766. // add HTTP headers to the request.
  5767. func (c *ProjectsLocationsClustersNodePoolsListCall) Header() http.Header {
  5768. if c.header_ == nil {
  5769. c.header_ = make(http.Header)
  5770. }
  5771. return c.header_
  5772. }
  5773. func (c *ProjectsLocationsClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  5774. reqHeaders := make(http.Header)
  5775. for k, v := range c.header_ {
  5776. reqHeaders[k] = v
  5777. }
  5778. reqHeaders.Set("User-Agent", c.s.userAgent())
  5779. if c.ifNoneMatch_ != "" {
  5780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5781. }
  5782. var body io.Reader = nil
  5783. c.urlParams_.Set("alt", alt)
  5784. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/nodePools")
  5785. urls += "?" + c.urlParams_.Encode()
  5786. req, _ := http.NewRequest("GET", urls, body)
  5787. req.Header = reqHeaders
  5788. googleapi.Expand(req.URL, map[string]string{
  5789. "parent": c.parent,
  5790. })
  5791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5792. }
  5793. // Do executes the "container.projects.locations.clusters.nodePools.list" call.
  5794. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  5795. // non-2xx status code is an error. Response headers are in either
  5796. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  5797. // returned at all) in error.(*googleapi.Error).Header. Use
  5798. // googleapi.IsNotModified to check whether the returned error was
  5799. // because http.StatusNotModified was returned.
  5800. func (c *ProjectsLocationsClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  5801. gensupport.SetOptions(c.urlParams_, opts...)
  5802. res, err := c.doRequest("json")
  5803. if res != nil && res.StatusCode == http.StatusNotModified {
  5804. if res.Body != nil {
  5805. res.Body.Close()
  5806. }
  5807. return nil, &googleapi.Error{
  5808. Code: res.StatusCode,
  5809. Header: res.Header,
  5810. }
  5811. }
  5812. if err != nil {
  5813. return nil, err
  5814. }
  5815. defer googleapi.CloseBody(res)
  5816. if err := googleapi.CheckResponse(res); err != nil {
  5817. return nil, err
  5818. }
  5819. ret := &ListNodePoolsResponse{
  5820. ServerResponse: googleapi.ServerResponse{
  5821. Header: res.Header,
  5822. HTTPStatusCode: res.StatusCode,
  5823. },
  5824. }
  5825. target := &ret
  5826. if err := gensupport.DecodeResponse(target, res); err != nil {
  5827. return nil, err
  5828. }
  5829. return ret, nil
  5830. // {
  5831. // "description": "Lists the node pools for a cluster.",
  5832. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools",
  5833. // "httpMethod": "GET",
  5834. // "id": "container.projects.locations.clusters.nodePools.list",
  5835. // "parameterOrder": [
  5836. // "parent"
  5837. // ],
  5838. // "parameters": {
  5839. // "clusterId": {
  5840. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  5841. // "location": "query",
  5842. // "type": "string"
  5843. // },
  5844. // "parent": {
  5845. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  5846. // "location": "path",
  5847. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+$",
  5848. // "required": true,
  5849. // "type": "string"
  5850. // },
  5851. // "projectId": {
  5852. // "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.",
  5853. // "location": "query",
  5854. // "type": "string"
  5855. // },
  5856. // "zone": {
  5857. // "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.",
  5858. // "location": "query",
  5859. // "type": "string"
  5860. // }
  5861. // },
  5862. // "path": "v1/{+parent}/nodePools",
  5863. // "response": {
  5864. // "$ref": "ListNodePoolsResponse"
  5865. // },
  5866. // "scopes": [
  5867. // "https://www.googleapis.com/auth/cloud-platform"
  5868. // ]
  5869. // }
  5870. }
  5871. // method id "container.projects.locations.clusters.nodePools.rollback":
  5872. type ProjectsLocationsClustersNodePoolsRollbackCall struct {
  5873. s *Service
  5874. name string
  5875. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  5876. urlParams_ gensupport.URLParams
  5877. ctx_ context.Context
  5878. header_ http.Header
  5879. }
  5880. // Rollback: Roll back the previously Aborted or Failed NodePool
  5881. // upgrade.
  5882. // This will be an no-op if the last upgrade successfully completed.
  5883. func (r *ProjectsLocationsClustersNodePoolsService) Rollback(name string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsLocationsClustersNodePoolsRollbackCall {
  5884. c := &ProjectsLocationsClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5885. c.name = name
  5886. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  5887. return c
  5888. }
  5889. // Fields allows partial responses to be retrieved. See
  5890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5891. // for more information.
  5892. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsRollbackCall {
  5893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5894. return c
  5895. }
  5896. // Context sets the context to be used in this call's Do method. Any
  5897. // pending HTTP request will be aborted if the provided context is
  5898. // canceled.
  5899. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsRollbackCall {
  5900. c.ctx_ = ctx
  5901. return c
  5902. }
  5903. // Header returns an http.Header that can be modified by the caller to
  5904. // add HTTP headers to the request.
  5905. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Header() http.Header {
  5906. if c.header_ == nil {
  5907. c.header_ = make(http.Header)
  5908. }
  5909. return c.header_
  5910. }
  5911. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  5912. reqHeaders := make(http.Header)
  5913. for k, v := range c.header_ {
  5914. reqHeaders[k] = v
  5915. }
  5916. reqHeaders.Set("User-Agent", c.s.userAgent())
  5917. var body io.Reader = nil
  5918. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  5919. if err != nil {
  5920. return nil, err
  5921. }
  5922. reqHeaders.Set("Content-Type", "application/json")
  5923. c.urlParams_.Set("alt", alt)
  5924. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
  5925. urls += "?" + c.urlParams_.Encode()
  5926. req, _ := http.NewRequest("POST", urls, body)
  5927. req.Header = reqHeaders
  5928. googleapi.Expand(req.URL, map[string]string{
  5929. "name": c.name,
  5930. })
  5931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5932. }
  5933. // Do executes the "container.projects.locations.clusters.nodePools.rollback" call.
  5934. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5935. // status code is an error. Response headers are in either
  5936. // *Operation.ServerResponse.Header or (if a response was returned at
  5937. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5938. // to check whether the returned error was because
  5939. // http.StatusNotModified was returned.
  5940. func (c *ProjectsLocationsClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5941. gensupport.SetOptions(c.urlParams_, opts...)
  5942. res, err := c.doRequest("json")
  5943. if res != nil && res.StatusCode == http.StatusNotModified {
  5944. if res.Body != nil {
  5945. res.Body.Close()
  5946. }
  5947. return nil, &googleapi.Error{
  5948. Code: res.StatusCode,
  5949. Header: res.Header,
  5950. }
  5951. }
  5952. if err != nil {
  5953. return nil, err
  5954. }
  5955. defer googleapi.CloseBody(res)
  5956. if err := googleapi.CheckResponse(res); err != nil {
  5957. return nil, err
  5958. }
  5959. ret := &Operation{
  5960. ServerResponse: googleapi.ServerResponse{
  5961. Header: res.Header,
  5962. HTTPStatusCode: res.StatusCode,
  5963. },
  5964. }
  5965. target := &ret
  5966. if err := gensupport.DecodeResponse(target, res); err != nil {
  5967. return nil, err
  5968. }
  5969. return ret, nil
  5970. // {
  5971. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  5972. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:rollback",
  5973. // "httpMethod": "POST",
  5974. // "id": "container.projects.locations.clusters.nodePools.rollback",
  5975. // "parameterOrder": [
  5976. // "name"
  5977. // ],
  5978. // "parameters": {
  5979. // "name": {
  5980. // "description": "The name (project, location, cluster, node pool id) of the node poll to\nrollback upgrade.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  5981. // "location": "path",
  5982. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  5983. // "required": true,
  5984. // "type": "string"
  5985. // }
  5986. // },
  5987. // "path": "v1/{+name}:rollback",
  5988. // "request": {
  5989. // "$ref": "RollbackNodePoolUpgradeRequest"
  5990. // },
  5991. // "response": {
  5992. // "$ref": "Operation"
  5993. // },
  5994. // "scopes": [
  5995. // "https://www.googleapis.com/auth/cloud-platform"
  5996. // ]
  5997. // }
  5998. }
  5999. // method id "container.projects.locations.clusters.nodePools.setAutoscaling":
  6000. type ProjectsLocationsClustersNodePoolsSetAutoscalingCall struct {
  6001. s *Service
  6002. name string
  6003. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  6004. urlParams_ gensupport.URLParams
  6005. ctx_ context.Context
  6006. header_ http.Header
  6007. }
  6008. // SetAutoscaling: Sets the autoscaling settings for a specific node
  6009. // pool.
  6010. func (r *ProjectsLocationsClustersNodePoolsService) SetAutoscaling(name string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6011. c := &ProjectsLocationsClustersNodePoolsSetAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6012. c.name = name
  6013. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  6014. return c
  6015. }
  6016. // Fields allows partial responses to be retrieved. See
  6017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6018. // for more information.
  6019. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6021. return c
  6022. }
  6023. // Context sets the context to be used in this call's Do method. Any
  6024. // pending HTTP request will be aborted if the provided context is
  6025. // canceled.
  6026. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetAutoscalingCall {
  6027. c.ctx_ = ctx
  6028. return c
  6029. }
  6030. // Header returns an http.Header that can be modified by the caller to
  6031. // add HTTP headers to the request.
  6032. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Header() http.Header {
  6033. if c.header_ == nil {
  6034. c.header_ = make(http.Header)
  6035. }
  6036. return c.header_
  6037. }
  6038. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  6039. reqHeaders := make(http.Header)
  6040. for k, v := range c.header_ {
  6041. reqHeaders[k] = v
  6042. }
  6043. reqHeaders.Set("User-Agent", c.s.userAgent())
  6044. var body io.Reader = nil
  6045. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  6046. if err != nil {
  6047. return nil, err
  6048. }
  6049. reqHeaders.Set("Content-Type", "application/json")
  6050. c.urlParams_.Set("alt", alt)
  6051. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAutoscaling")
  6052. urls += "?" + c.urlParams_.Encode()
  6053. req, _ := http.NewRequest("POST", urls, body)
  6054. req.Header = reqHeaders
  6055. googleapi.Expand(req.URL, map[string]string{
  6056. "name": c.name,
  6057. })
  6058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6059. }
  6060. // Do executes the "container.projects.locations.clusters.nodePools.setAutoscaling" call.
  6061. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6062. // status code is an error. Response headers are in either
  6063. // *Operation.ServerResponse.Header or (if a response was returned at
  6064. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6065. // to check whether the returned error was because
  6066. // http.StatusNotModified was returned.
  6067. func (c *ProjectsLocationsClustersNodePoolsSetAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6068. gensupport.SetOptions(c.urlParams_, opts...)
  6069. res, err := c.doRequest("json")
  6070. if res != nil && res.StatusCode == http.StatusNotModified {
  6071. if res.Body != nil {
  6072. res.Body.Close()
  6073. }
  6074. return nil, &googleapi.Error{
  6075. Code: res.StatusCode,
  6076. Header: res.Header,
  6077. }
  6078. }
  6079. if err != nil {
  6080. return nil, err
  6081. }
  6082. defer googleapi.CloseBody(res)
  6083. if err := googleapi.CheckResponse(res); err != nil {
  6084. return nil, err
  6085. }
  6086. ret := &Operation{
  6087. ServerResponse: googleapi.ServerResponse{
  6088. Header: res.Header,
  6089. HTTPStatusCode: res.StatusCode,
  6090. },
  6091. }
  6092. target := &ret
  6093. if err := gensupport.DecodeResponse(target, res); err != nil {
  6094. return nil, err
  6095. }
  6096. return ret, nil
  6097. // {
  6098. // "description": "Sets the autoscaling settings for a specific node pool.",
  6099. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setAutoscaling",
  6100. // "httpMethod": "POST",
  6101. // "id": "container.projects.locations.clusters.nodePools.setAutoscaling",
  6102. // "parameterOrder": [
  6103. // "name"
  6104. // ],
  6105. // "parameters": {
  6106. // "name": {
  6107. // "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/*'.",
  6108. // "location": "path",
  6109. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6110. // "required": true,
  6111. // "type": "string"
  6112. // }
  6113. // },
  6114. // "path": "v1/{+name}:setAutoscaling",
  6115. // "request": {
  6116. // "$ref": "SetNodePoolAutoscalingRequest"
  6117. // },
  6118. // "response": {
  6119. // "$ref": "Operation"
  6120. // },
  6121. // "scopes": [
  6122. // "https://www.googleapis.com/auth/cloud-platform"
  6123. // ]
  6124. // }
  6125. }
  6126. // method id "container.projects.locations.clusters.nodePools.setManagement":
  6127. type ProjectsLocationsClustersNodePoolsSetManagementCall struct {
  6128. s *Service
  6129. name string
  6130. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  6131. urlParams_ gensupport.URLParams
  6132. ctx_ context.Context
  6133. header_ http.Header
  6134. }
  6135. // SetManagement: Sets the NodeManagement options for a node pool.
  6136. func (r *ProjectsLocationsClustersNodePoolsService) SetManagement(name string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6137. c := &ProjectsLocationsClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6138. c.name = name
  6139. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  6140. return c
  6141. }
  6142. // Fields allows partial responses to be retrieved. See
  6143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6144. // for more information.
  6145. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6147. return c
  6148. }
  6149. // Context sets the context to be used in this call's Do method. Any
  6150. // pending HTTP request will be aborted if the provided context is
  6151. // canceled.
  6152. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetManagementCall {
  6153. c.ctx_ = ctx
  6154. return c
  6155. }
  6156. // Header returns an http.Header that can be modified by the caller to
  6157. // add HTTP headers to the request.
  6158. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Header() http.Header {
  6159. if c.header_ == nil {
  6160. c.header_ = make(http.Header)
  6161. }
  6162. return c.header_
  6163. }
  6164. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  6165. reqHeaders := make(http.Header)
  6166. for k, v := range c.header_ {
  6167. reqHeaders[k] = v
  6168. }
  6169. reqHeaders.Set("User-Agent", c.s.userAgent())
  6170. var body io.Reader = nil
  6171. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  6172. if err != nil {
  6173. return nil, err
  6174. }
  6175. reqHeaders.Set("Content-Type", "application/json")
  6176. c.urlParams_.Set("alt", alt)
  6177. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setManagement")
  6178. urls += "?" + c.urlParams_.Encode()
  6179. req, _ := http.NewRequest("POST", urls, body)
  6180. req.Header = reqHeaders
  6181. googleapi.Expand(req.URL, map[string]string{
  6182. "name": c.name,
  6183. })
  6184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6185. }
  6186. // Do executes the "container.projects.locations.clusters.nodePools.setManagement" call.
  6187. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6188. // status code is an error. Response headers are in either
  6189. // *Operation.ServerResponse.Header or (if a response was returned at
  6190. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6191. // to check whether the returned error was because
  6192. // http.StatusNotModified was returned.
  6193. func (c *ProjectsLocationsClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6194. gensupport.SetOptions(c.urlParams_, opts...)
  6195. res, err := c.doRequest("json")
  6196. if res != nil && res.StatusCode == http.StatusNotModified {
  6197. if res.Body != nil {
  6198. res.Body.Close()
  6199. }
  6200. return nil, &googleapi.Error{
  6201. Code: res.StatusCode,
  6202. Header: res.Header,
  6203. }
  6204. }
  6205. if err != nil {
  6206. return nil, err
  6207. }
  6208. defer googleapi.CloseBody(res)
  6209. if err := googleapi.CheckResponse(res); err != nil {
  6210. return nil, err
  6211. }
  6212. ret := &Operation{
  6213. ServerResponse: googleapi.ServerResponse{
  6214. Header: res.Header,
  6215. HTTPStatusCode: res.StatusCode,
  6216. },
  6217. }
  6218. target := &ret
  6219. if err := gensupport.DecodeResponse(target, res); err != nil {
  6220. return nil, err
  6221. }
  6222. return ret, nil
  6223. // {
  6224. // "description": "Sets the NodeManagement options for a node pool.",
  6225. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setManagement",
  6226. // "httpMethod": "POST",
  6227. // "id": "container.projects.locations.clusters.nodePools.setManagement",
  6228. // "parameterOrder": [
  6229. // "name"
  6230. // ],
  6231. // "parameters": {
  6232. // "name": {
  6233. // "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/*'.",
  6234. // "location": "path",
  6235. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6236. // "required": true,
  6237. // "type": "string"
  6238. // }
  6239. // },
  6240. // "path": "v1/{+name}:setManagement",
  6241. // "request": {
  6242. // "$ref": "SetNodePoolManagementRequest"
  6243. // },
  6244. // "response": {
  6245. // "$ref": "Operation"
  6246. // },
  6247. // "scopes": [
  6248. // "https://www.googleapis.com/auth/cloud-platform"
  6249. // ]
  6250. // }
  6251. }
  6252. // method id "container.projects.locations.clusters.nodePools.setSize":
  6253. type ProjectsLocationsClustersNodePoolsSetSizeCall struct {
  6254. s *Service
  6255. name string
  6256. setnodepoolsizerequest *SetNodePoolSizeRequest
  6257. urlParams_ gensupport.URLParams
  6258. ctx_ context.Context
  6259. header_ http.Header
  6260. }
  6261. // SetSize: Sets the size for a specific node pool.
  6262. func (r *ProjectsLocationsClustersNodePoolsService) SetSize(name string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6263. c := &ProjectsLocationsClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6264. c.name = name
  6265. c.setnodepoolsizerequest = setnodepoolsizerequest
  6266. return c
  6267. }
  6268. // Fields allows partial responses to be retrieved. See
  6269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6270. // for more information.
  6271. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6273. return c
  6274. }
  6275. // Context sets the context to be used in this call's Do method. Any
  6276. // pending HTTP request will be aborted if the provided context is
  6277. // canceled.
  6278. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsSetSizeCall {
  6279. c.ctx_ = ctx
  6280. return c
  6281. }
  6282. // Header returns an http.Header that can be modified by the caller to
  6283. // add HTTP headers to the request.
  6284. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Header() http.Header {
  6285. if c.header_ == nil {
  6286. c.header_ = make(http.Header)
  6287. }
  6288. return c.header_
  6289. }
  6290. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  6291. reqHeaders := make(http.Header)
  6292. for k, v := range c.header_ {
  6293. reqHeaders[k] = v
  6294. }
  6295. reqHeaders.Set("User-Agent", c.s.userAgent())
  6296. var body io.Reader = nil
  6297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  6298. if err != nil {
  6299. return nil, err
  6300. }
  6301. reqHeaders.Set("Content-Type", "application/json")
  6302. c.urlParams_.Set("alt", alt)
  6303. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setSize")
  6304. urls += "?" + c.urlParams_.Encode()
  6305. req, _ := http.NewRequest("POST", urls, body)
  6306. req.Header = reqHeaders
  6307. googleapi.Expand(req.URL, map[string]string{
  6308. "name": c.name,
  6309. })
  6310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6311. }
  6312. // Do executes the "container.projects.locations.clusters.nodePools.setSize" call.
  6313. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6314. // status code is an error. Response headers are in either
  6315. // *Operation.ServerResponse.Header or (if a response was returned at
  6316. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6317. // to check whether the returned error was because
  6318. // http.StatusNotModified was returned.
  6319. func (c *ProjectsLocationsClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6320. gensupport.SetOptions(c.urlParams_, opts...)
  6321. res, err := c.doRequest("json")
  6322. if res != nil && res.StatusCode == http.StatusNotModified {
  6323. if res.Body != nil {
  6324. res.Body.Close()
  6325. }
  6326. return nil, &googleapi.Error{
  6327. Code: res.StatusCode,
  6328. Header: res.Header,
  6329. }
  6330. }
  6331. if err != nil {
  6332. return nil, err
  6333. }
  6334. defer googleapi.CloseBody(res)
  6335. if err := googleapi.CheckResponse(res); err != nil {
  6336. return nil, err
  6337. }
  6338. ret := &Operation{
  6339. ServerResponse: googleapi.ServerResponse{
  6340. Header: res.Header,
  6341. HTTPStatusCode: res.StatusCode,
  6342. },
  6343. }
  6344. target := &ret
  6345. if err := gensupport.DecodeResponse(target, res); err != nil {
  6346. return nil, err
  6347. }
  6348. return ret, nil
  6349. // {
  6350. // "description": "Sets the size for a specific node pool.",
  6351. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}:setSize",
  6352. // "httpMethod": "POST",
  6353. // "id": "container.projects.locations.clusters.nodePools.setSize",
  6354. // "parameterOrder": [
  6355. // "name"
  6356. // ],
  6357. // "parameters": {
  6358. // "name": {
  6359. // "description": "The name (project, location, cluster, node pool id) of the node pool to set\nsize.\nSpecified in the format 'projects/*/locations/*/clusters/*/nodePools/*'.",
  6360. // "location": "path",
  6361. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6362. // "required": true,
  6363. // "type": "string"
  6364. // }
  6365. // },
  6366. // "path": "v1/{+name}:setSize",
  6367. // "request": {
  6368. // "$ref": "SetNodePoolSizeRequest"
  6369. // },
  6370. // "response": {
  6371. // "$ref": "Operation"
  6372. // },
  6373. // "scopes": [
  6374. // "https://www.googleapis.com/auth/cloud-platform"
  6375. // ]
  6376. // }
  6377. }
  6378. // method id "container.projects.locations.clusters.nodePools.update":
  6379. type ProjectsLocationsClustersNodePoolsUpdateCall struct {
  6380. s *Service
  6381. name string
  6382. updatenodepoolrequest *UpdateNodePoolRequest
  6383. urlParams_ gensupport.URLParams
  6384. ctx_ context.Context
  6385. header_ http.Header
  6386. }
  6387. // Update: Updates the version and/or image type for a specific node
  6388. // pool.
  6389. func (r *ProjectsLocationsClustersNodePoolsService) Update(name string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsLocationsClustersNodePoolsUpdateCall {
  6390. c := &ProjectsLocationsClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6391. c.name = name
  6392. c.updatenodepoolrequest = updatenodepoolrequest
  6393. return c
  6394. }
  6395. // Fields allows partial responses to be retrieved. See
  6396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6397. // for more information.
  6398. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsClustersNodePoolsUpdateCall {
  6399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6400. return c
  6401. }
  6402. // Context sets the context to be used in this call's Do method. Any
  6403. // pending HTTP request will be aborted if the provided context is
  6404. // canceled.
  6405. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsLocationsClustersNodePoolsUpdateCall {
  6406. c.ctx_ = ctx
  6407. return c
  6408. }
  6409. // Header returns an http.Header that can be modified by the caller to
  6410. // add HTTP headers to the request.
  6411. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Header() http.Header {
  6412. if c.header_ == nil {
  6413. c.header_ = make(http.Header)
  6414. }
  6415. return c.header_
  6416. }
  6417. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6418. reqHeaders := make(http.Header)
  6419. for k, v := range c.header_ {
  6420. reqHeaders[k] = v
  6421. }
  6422. reqHeaders.Set("User-Agent", c.s.userAgent())
  6423. var body io.Reader = nil
  6424. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  6425. if err != nil {
  6426. return nil, err
  6427. }
  6428. reqHeaders.Set("Content-Type", "application/json")
  6429. c.urlParams_.Set("alt", alt)
  6430. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6431. urls += "?" + c.urlParams_.Encode()
  6432. req, _ := http.NewRequest("PUT", urls, body)
  6433. req.Header = reqHeaders
  6434. googleapi.Expand(req.URL, map[string]string{
  6435. "name": c.name,
  6436. })
  6437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6438. }
  6439. // Do executes the "container.projects.locations.clusters.nodePools.update" call.
  6440. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6441. // status code is an error. Response headers are in either
  6442. // *Operation.ServerResponse.Header or (if a response was returned at
  6443. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6444. // to check whether the returned error was because
  6445. // http.StatusNotModified was returned.
  6446. func (c *ProjectsLocationsClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6447. gensupport.SetOptions(c.urlParams_, opts...)
  6448. res, err := c.doRequest("json")
  6449. if res != nil && res.StatusCode == http.StatusNotModified {
  6450. if res.Body != nil {
  6451. res.Body.Close()
  6452. }
  6453. return nil, &googleapi.Error{
  6454. Code: res.StatusCode,
  6455. Header: res.Header,
  6456. }
  6457. }
  6458. if err != nil {
  6459. return nil, err
  6460. }
  6461. defer googleapi.CloseBody(res)
  6462. if err := googleapi.CheckResponse(res); err != nil {
  6463. return nil, err
  6464. }
  6465. ret := &Operation{
  6466. ServerResponse: googleapi.ServerResponse{
  6467. Header: res.Header,
  6468. HTTPStatusCode: res.StatusCode,
  6469. },
  6470. }
  6471. target := &ret
  6472. if err := gensupport.DecodeResponse(target, res); err != nil {
  6473. return nil, err
  6474. }
  6475. return ret, nil
  6476. // {
  6477. // "description": "Updates the version and/or image type for a specific node pool.",
  6478. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/clusters/{clustersId}/nodePools/{nodePoolsId}",
  6479. // "httpMethod": "PUT",
  6480. // "id": "container.projects.locations.clusters.nodePools.update",
  6481. // "parameterOrder": [
  6482. // "name"
  6483. // ],
  6484. // "parameters": {
  6485. // "name": {
  6486. // "description": "The name (project, location, cluster, node pool) of the node pool to\nupdate. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  6487. // "location": "path",
  6488. // "pattern": "^projects/[^/]+/locations/[^/]+/clusters/[^/]+/nodePools/[^/]+$",
  6489. // "required": true,
  6490. // "type": "string"
  6491. // }
  6492. // },
  6493. // "path": "v1/{+name}",
  6494. // "request": {
  6495. // "$ref": "UpdateNodePoolRequest"
  6496. // },
  6497. // "response": {
  6498. // "$ref": "Operation"
  6499. // },
  6500. // "scopes": [
  6501. // "https://www.googleapis.com/auth/cloud-platform"
  6502. // ]
  6503. // }
  6504. }
  6505. // method id "container.projects.locations.operations.cancel":
  6506. type ProjectsLocationsOperationsCancelCall struct {
  6507. s *Service
  6508. name string
  6509. canceloperationrequest *CancelOperationRequest
  6510. urlParams_ gensupport.URLParams
  6511. ctx_ context.Context
  6512. header_ http.Header
  6513. }
  6514. // Cancel: Cancels the specified operation.
  6515. func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  6516. c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6517. c.name = name
  6518. c.canceloperationrequest = canceloperationrequest
  6519. return c
  6520. }
  6521. // Fields allows partial responses to be retrieved. See
  6522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6523. // for more information.
  6524. func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  6525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6526. return c
  6527. }
  6528. // Context sets the context to be used in this call's Do method. Any
  6529. // pending HTTP request will be aborted if the provided context is
  6530. // canceled.
  6531. func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  6532. c.ctx_ = ctx
  6533. return c
  6534. }
  6535. // Header returns an http.Header that can be modified by the caller to
  6536. // add HTTP headers to the request.
  6537. func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  6538. if c.header_ == nil {
  6539. c.header_ = make(http.Header)
  6540. }
  6541. return c.header_
  6542. }
  6543. func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  6544. reqHeaders := make(http.Header)
  6545. for k, v := range c.header_ {
  6546. reqHeaders[k] = v
  6547. }
  6548. reqHeaders.Set("User-Agent", c.s.userAgent())
  6549. var body io.Reader = nil
  6550. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  6551. if err != nil {
  6552. return nil, err
  6553. }
  6554. reqHeaders.Set("Content-Type", "application/json")
  6555. c.urlParams_.Set("alt", alt)
  6556. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  6557. urls += "?" + c.urlParams_.Encode()
  6558. req, _ := http.NewRequest("POST", urls, body)
  6559. req.Header = reqHeaders
  6560. googleapi.Expand(req.URL, map[string]string{
  6561. "name": c.name,
  6562. })
  6563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6564. }
  6565. // Do executes the "container.projects.locations.operations.cancel" call.
  6566. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6567. // code is an error. Response headers are in either
  6568. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6569. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6570. // check whether the returned error was because http.StatusNotModified
  6571. // was returned.
  6572. func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6573. gensupport.SetOptions(c.urlParams_, opts...)
  6574. res, err := c.doRequest("json")
  6575. if res != nil && res.StatusCode == http.StatusNotModified {
  6576. if res.Body != nil {
  6577. res.Body.Close()
  6578. }
  6579. return nil, &googleapi.Error{
  6580. Code: res.StatusCode,
  6581. Header: res.Header,
  6582. }
  6583. }
  6584. if err != nil {
  6585. return nil, err
  6586. }
  6587. defer googleapi.CloseBody(res)
  6588. if err := googleapi.CheckResponse(res); err != nil {
  6589. return nil, err
  6590. }
  6591. ret := &Empty{
  6592. ServerResponse: googleapi.ServerResponse{
  6593. Header: res.Header,
  6594. HTTPStatusCode: res.StatusCode,
  6595. },
  6596. }
  6597. target := &ret
  6598. if err := gensupport.DecodeResponse(target, res); err != nil {
  6599. return nil, err
  6600. }
  6601. return ret, nil
  6602. // {
  6603. // "description": "Cancels the specified operation.",
  6604. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  6605. // "httpMethod": "POST",
  6606. // "id": "container.projects.locations.operations.cancel",
  6607. // "parameterOrder": [
  6608. // "name"
  6609. // ],
  6610. // "parameters": {
  6611. // "name": {
  6612. // "description": "The name (project, location, operation id) of the operation to cancel.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  6613. // "location": "path",
  6614. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  6615. // "required": true,
  6616. // "type": "string"
  6617. // }
  6618. // },
  6619. // "path": "v1/{+name}:cancel",
  6620. // "request": {
  6621. // "$ref": "CancelOperationRequest"
  6622. // },
  6623. // "response": {
  6624. // "$ref": "Empty"
  6625. // },
  6626. // "scopes": [
  6627. // "https://www.googleapis.com/auth/cloud-platform"
  6628. // ]
  6629. // }
  6630. }
  6631. // method id "container.projects.locations.operations.get":
  6632. type ProjectsLocationsOperationsGetCall struct {
  6633. s *Service
  6634. name string
  6635. urlParams_ gensupport.URLParams
  6636. ifNoneMatch_ string
  6637. ctx_ context.Context
  6638. header_ http.Header
  6639. }
  6640. // Get: Gets the specified operation.
  6641. func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  6642. c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6643. c.name = name
  6644. return c
  6645. }
  6646. // OperationId sets the optional parameter "operationId": Deprecated.
  6647. // The server-assigned `name` of the operation.
  6648. // This field has been deprecated and replaced by the name field.
  6649. func (c *ProjectsLocationsOperationsGetCall) OperationId(operationId string) *ProjectsLocationsOperationsGetCall {
  6650. c.urlParams_.Set("operationId", operationId)
  6651. return c
  6652. }
  6653. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6654. // Google Developers Console [project ID or
  6655. // project
  6656. // number](https://support.google.com/cloud/answer/6158840).
  6657. // This
  6658. // field has been deprecated and replaced by the name field.
  6659. func (c *ProjectsLocationsOperationsGetCall) ProjectId(projectId string) *ProjectsLocationsOperationsGetCall {
  6660. c.urlParams_.Set("projectId", projectId)
  6661. return c
  6662. }
  6663. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6664. // Google Compute Engine
  6665. // [zone](/compute/docs/zones#available) in which the
  6666. // cluster
  6667. // resides.
  6668. // This field has been deprecated and replaced by the name field.
  6669. func (c *ProjectsLocationsOperationsGetCall) Zone(zone string) *ProjectsLocationsOperationsGetCall {
  6670. c.urlParams_.Set("zone", zone)
  6671. return c
  6672. }
  6673. // Fields allows partial responses to be retrieved. See
  6674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6675. // for more information.
  6676. func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  6677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6678. return c
  6679. }
  6680. // IfNoneMatch sets the optional parameter which makes the operation
  6681. // fail if the object's ETag matches the given value. This is useful for
  6682. // getting updates only after the object has changed since the last
  6683. // request. Use googleapi.IsNotModified to check whether the response
  6684. // error from Do is the result of In-None-Match.
  6685. func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  6686. c.ifNoneMatch_ = entityTag
  6687. return c
  6688. }
  6689. // Context sets the context to be used in this call's Do method. Any
  6690. // pending HTTP request will be aborted if the provided context is
  6691. // canceled.
  6692. func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  6693. c.ctx_ = ctx
  6694. return c
  6695. }
  6696. // Header returns an http.Header that can be modified by the caller to
  6697. // add HTTP headers to the request.
  6698. func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  6699. if c.header_ == nil {
  6700. c.header_ = make(http.Header)
  6701. }
  6702. return c.header_
  6703. }
  6704. func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  6705. reqHeaders := make(http.Header)
  6706. for k, v := range c.header_ {
  6707. reqHeaders[k] = v
  6708. }
  6709. reqHeaders.Set("User-Agent", c.s.userAgent())
  6710. if c.ifNoneMatch_ != "" {
  6711. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6712. }
  6713. var body io.Reader = nil
  6714. c.urlParams_.Set("alt", alt)
  6715. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6716. urls += "?" + c.urlParams_.Encode()
  6717. req, _ := http.NewRequest("GET", urls, body)
  6718. req.Header = reqHeaders
  6719. googleapi.Expand(req.URL, map[string]string{
  6720. "name": c.name,
  6721. })
  6722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6723. }
  6724. // Do executes the "container.projects.locations.operations.get" call.
  6725. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6726. // status code is an error. Response headers are in either
  6727. // *Operation.ServerResponse.Header or (if a response was returned at
  6728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6729. // to check whether the returned error was because
  6730. // http.StatusNotModified was returned.
  6731. func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6732. gensupport.SetOptions(c.urlParams_, opts...)
  6733. res, err := c.doRequest("json")
  6734. if res != nil && res.StatusCode == http.StatusNotModified {
  6735. if res.Body != nil {
  6736. res.Body.Close()
  6737. }
  6738. return nil, &googleapi.Error{
  6739. Code: res.StatusCode,
  6740. Header: res.Header,
  6741. }
  6742. }
  6743. if err != nil {
  6744. return nil, err
  6745. }
  6746. defer googleapi.CloseBody(res)
  6747. if err := googleapi.CheckResponse(res); err != nil {
  6748. return nil, err
  6749. }
  6750. ret := &Operation{
  6751. ServerResponse: googleapi.ServerResponse{
  6752. Header: res.Header,
  6753. HTTPStatusCode: res.StatusCode,
  6754. },
  6755. }
  6756. target := &ret
  6757. if err := gensupport.DecodeResponse(target, res); err != nil {
  6758. return nil, err
  6759. }
  6760. return ret, nil
  6761. // {
  6762. // "description": "Gets the specified operation.",
  6763. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  6764. // "httpMethod": "GET",
  6765. // "id": "container.projects.locations.operations.get",
  6766. // "parameterOrder": [
  6767. // "name"
  6768. // ],
  6769. // "parameters": {
  6770. // "name": {
  6771. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  6772. // "location": "path",
  6773. // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  6774. // "required": true,
  6775. // "type": "string"
  6776. // },
  6777. // "operationId": {
  6778. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  6779. // "location": "query",
  6780. // "type": "string"
  6781. // },
  6782. // "projectId": {
  6783. // "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.",
  6784. // "location": "query",
  6785. // "type": "string"
  6786. // },
  6787. // "zone": {
  6788. // "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.",
  6789. // "location": "query",
  6790. // "type": "string"
  6791. // }
  6792. // },
  6793. // "path": "v1/{+name}",
  6794. // "response": {
  6795. // "$ref": "Operation"
  6796. // },
  6797. // "scopes": [
  6798. // "https://www.googleapis.com/auth/cloud-platform"
  6799. // ]
  6800. // }
  6801. }
  6802. // method id "container.projects.locations.operations.list":
  6803. type ProjectsLocationsOperationsListCall struct {
  6804. s *Service
  6805. parent string
  6806. urlParams_ gensupport.URLParams
  6807. ifNoneMatch_ string
  6808. ctx_ context.Context
  6809. header_ http.Header
  6810. }
  6811. // List: Lists all operations in a project in a specific zone or all
  6812. // zones.
  6813. func (r *ProjectsLocationsOperationsService) List(parent string) *ProjectsLocationsOperationsListCall {
  6814. c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6815. c.parent = parent
  6816. return c
  6817. }
  6818. // ProjectId sets the optional parameter "projectId": Deprecated. The
  6819. // Google Developers Console [project ID or
  6820. // project
  6821. // number](https://support.google.com/cloud/answer/6158840).
  6822. // This
  6823. // field has been deprecated and replaced by the parent field.
  6824. func (c *ProjectsLocationsOperationsListCall) ProjectId(projectId string) *ProjectsLocationsOperationsListCall {
  6825. c.urlParams_.Set("projectId", projectId)
  6826. return c
  6827. }
  6828. // Zone sets the optional parameter "zone": Deprecated. The name of the
  6829. // Google Compute Engine
  6830. // [zone](/compute/docs/zones#available) to return operations for, or
  6831. // `-` for
  6832. // all zones. This field has been deprecated and replaced by the parent
  6833. // field.
  6834. func (c *ProjectsLocationsOperationsListCall) Zone(zone string) *ProjectsLocationsOperationsListCall {
  6835. c.urlParams_.Set("zone", zone)
  6836. return c
  6837. }
  6838. // Fields allows partial responses to be retrieved. See
  6839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6840. // for more information.
  6841. func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  6842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6843. return c
  6844. }
  6845. // IfNoneMatch sets the optional parameter which makes the operation
  6846. // fail if the object's ETag matches the given value. This is useful for
  6847. // getting updates only after the object has changed since the last
  6848. // request. Use googleapi.IsNotModified to check whether the response
  6849. // error from Do is the result of In-None-Match.
  6850. func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  6851. c.ifNoneMatch_ = entityTag
  6852. return c
  6853. }
  6854. // Context sets the context to be used in this call's Do method. Any
  6855. // pending HTTP request will be aborted if the provided context is
  6856. // canceled.
  6857. func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  6858. c.ctx_ = ctx
  6859. return c
  6860. }
  6861. // Header returns an http.Header that can be modified by the caller to
  6862. // add HTTP headers to the request.
  6863. func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  6864. if c.header_ == nil {
  6865. c.header_ = make(http.Header)
  6866. }
  6867. return c.header_
  6868. }
  6869. func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  6870. reqHeaders := make(http.Header)
  6871. for k, v := range c.header_ {
  6872. reqHeaders[k] = v
  6873. }
  6874. reqHeaders.Set("User-Agent", c.s.userAgent())
  6875. if c.ifNoneMatch_ != "" {
  6876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6877. }
  6878. var body io.Reader = nil
  6879. c.urlParams_.Set("alt", alt)
  6880. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/operations")
  6881. urls += "?" + c.urlParams_.Encode()
  6882. req, _ := http.NewRequest("GET", urls, body)
  6883. req.Header = reqHeaders
  6884. googleapi.Expand(req.URL, map[string]string{
  6885. "parent": c.parent,
  6886. })
  6887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6888. }
  6889. // Do executes the "container.projects.locations.operations.list" call.
  6890. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  6891. // non-2xx status code is an error. Response headers are in either
  6892. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  6893. // returned at all) in error.(*googleapi.Error).Header. Use
  6894. // googleapi.IsNotModified to check whether the returned error was
  6895. // because http.StatusNotModified was returned.
  6896. func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  6897. gensupport.SetOptions(c.urlParams_, opts...)
  6898. res, err := c.doRequest("json")
  6899. if res != nil && res.StatusCode == http.StatusNotModified {
  6900. if res.Body != nil {
  6901. res.Body.Close()
  6902. }
  6903. return nil, &googleapi.Error{
  6904. Code: res.StatusCode,
  6905. Header: res.Header,
  6906. }
  6907. }
  6908. if err != nil {
  6909. return nil, err
  6910. }
  6911. defer googleapi.CloseBody(res)
  6912. if err := googleapi.CheckResponse(res); err != nil {
  6913. return nil, err
  6914. }
  6915. ret := &ListOperationsResponse{
  6916. ServerResponse: googleapi.ServerResponse{
  6917. Header: res.Header,
  6918. HTTPStatusCode: res.StatusCode,
  6919. },
  6920. }
  6921. target := &ret
  6922. if err := gensupport.DecodeResponse(target, res); err != nil {
  6923. return nil, err
  6924. }
  6925. return ret, nil
  6926. // {
  6927. // "description": "Lists all operations in a project in a specific zone or all zones.",
  6928. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations",
  6929. // "httpMethod": "GET",
  6930. // "id": "container.projects.locations.operations.list",
  6931. // "parameterOrder": [
  6932. // "parent"
  6933. // ],
  6934. // "parameters": {
  6935. // "parent": {
  6936. // "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.",
  6937. // "location": "path",
  6938. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  6939. // "required": true,
  6940. // "type": "string"
  6941. // },
  6942. // "projectId": {
  6943. // "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.",
  6944. // "location": "query",
  6945. // "type": "string"
  6946. // },
  6947. // "zone": {
  6948. // "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.",
  6949. // "location": "query",
  6950. // "type": "string"
  6951. // }
  6952. // },
  6953. // "path": "v1/{+parent}/operations",
  6954. // "response": {
  6955. // "$ref": "ListOperationsResponse"
  6956. // },
  6957. // "scopes": [
  6958. // "https://www.googleapis.com/auth/cloud-platform"
  6959. // ]
  6960. // }
  6961. }
  6962. // method id "container.projects.zones.getServerconfig":
  6963. type ProjectsZonesGetServerconfigCall struct {
  6964. s *Service
  6965. projectId string
  6966. zone string
  6967. urlParams_ gensupport.URLParams
  6968. ifNoneMatch_ string
  6969. ctx_ context.Context
  6970. header_ http.Header
  6971. }
  6972. // GetServerconfig: Returns configuration info about the Kubernetes
  6973. // Engine service.
  6974. func (r *ProjectsZonesService) GetServerconfig(projectId string, zone string) *ProjectsZonesGetServerconfigCall {
  6975. c := &ProjectsZonesGetServerconfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6976. c.projectId = projectId
  6977. c.zone = zone
  6978. return c
  6979. }
  6980. // Name sets the optional parameter "name": The name (project and
  6981. // location) of the server config to get
  6982. // Specified in the format 'projects/*/locations/*'.
  6983. func (c *ProjectsZonesGetServerconfigCall) Name(name string) *ProjectsZonesGetServerconfigCall {
  6984. c.urlParams_.Set("name", name)
  6985. return c
  6986. }
  6987. // Fields allows partial responses to be retrieved. See
  6988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6989. // for more information.
  6990. func (c *ProjectsZonesGetServerconfigCall) Fields(s ...googleapi.Field) *ProjectsZonesGetServerconfigCall {
  6991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6992. return c
  6993. }
  6994. // IfNoneMatch sets the optional parameter which makes the operation
  6995. // fail if the object's ETag matches the given value. This is useful for
  6996. // getting updates only after the object has changed since the last
  6997. // request. Use googleapi.IsNotModified to check whether the response
  6998. // error from Do is the result of In-None-Match.
  6999. func (c *ProjectsZonesGetServerconfigCall) IfNoneMatch(entityTag string) *ProjectsZonesGetServerconfigCall {
  7000. c.ifNoneMatch_ = entityTag
  7001. return c
  7002. }
  7003. // Context sets the context to be used in this call's Do method. Any
  7004. // pending HTTP request will be aborted if the provided context is
  7005. // canceled.
  7006. func (c *ProjectsZonesGetServerconfigCall) Context(ctx context.Context) *ProjectsZonesGetServerconfigCall {
  7007. c.ctx_ = ctx
  7008. return c
  7009. }
  7010. // Header returns an http.Header that can be modified by the caller to
  7011. // add HTTP headers to the request.
  7012. func (c *ProjectsZonesGetServerconfigCall) Header() http.Header {
  7013. if c.header_ == nil {
  7014. c.header_ = make(http.Header)
  7015. }
  7016. return c.header_
  7017. }
  7018. func (c *ProjectsZonesGetServerconfigCall) doRequest(alt string) (*http.Response, error) {
  7019. reqHeaders := make(http.Header)
  7020. for k, v := range c.header_ {
  7021. reqHeaders[k] = v
  7022. }
  7023. reqHeaders.Set("User-Agent", c.s.userAgent())
  7024. if c.ifNoneMatch_ != "" {
  7025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7026. }
  7027. var body io.Reader = nil
  7028. c.urlParams_.Set("alt", alt)
  7029. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/serverconfig")
  7030. urls += "?" + c.urlParams_.Encode()
  7031. req, _ := http.NewRequest("GET", urls, body)
  7032. req.Header = reqHeaders
  7033. googleapi.Expand(req.URL, map[string]string{
  7034. "projectId": c.projectId,
  7035. "zone": c.zone,
  7036. })
  7037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7038. }
  7039. // Do executes the "container.projects.zones.getServerconfig" call.
  7040. // Exactly one of *ServerConfig or error will be non-nil. Any non-2xx
  7041. // status code is an error. Response headers are in either
  7042. // *ServerConfig.ServerResponse.Header or (if a response was returned at
  7043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7044. // to check whether the returned error was because
  7045. // http.StatusNotModified was returned.
  7046. func (c *ProjectsZonesGetServerconfigCall) Do(opts ...googleapi.CallOption) (*ServerConfig, error) {
  7047. gensupport.SetOptions(c.urlParams_, opts...)
  7048. res, err := c.doRequest("json")
  7049. if res != nil && res.StatusCode == http.StatusNotModified {
  7050. if res.Body != nil {
  7051. res.Body.Close()
  7052. }
  7053. return nil, &googleapi.Error{
  7054. Code: res.StatusCode,
  7055. Header: res.Header,
  7056. }
  7057. }
  7058. if err != nil {
  7059. return nil, err
  7060. }
  7061. defer googleapi.CloseBody(res)
  7062. if err := googleapi.CheckResponse(res); err != nil {
  7063. return nil, err
  7064. }
  7065. ret := &ServerConfig{
  7066. ServerResponse: googleapi.ServerResponse{
  7067. Header: res.Header,
  7068. HTTPStatusCode: res.StatusCode,
  7069. },
  7070. }
  7071. target := &ret
  7072. if err := gensupport.DecodeResponse(target, res); err != nil {
  7073. return nil, err
  7074. }
  7075. return ret, nil
  7076. // {
  7077. // "description": "Returns configuration info about the Kubernetes Engine service.",
  7078. // "flatPath": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  7079. // "httpMethod": "GET",
  7080. // "id": "container.projects.zones.getServerconfig",
  7081. // "parameterOrder": [
  7082. // "projectId",
  7083. // "zone"
  7084. // ],
  7085. // "parameters": {
  7086. // "name": {
  7087. // "description": "The name (project and location) of the server config to get\nSpecified in the format 'projects/*/locations/*'.",
  7088. // "location": "query",
  7089. // "type": "string"
  7090. // },
  7091. // "projectId": {
  7092. // "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.",
  7093. // "location": "path",
  7094. // "required": true,
  7095. // "type": "string"
  7096. // },
  7097. // "zone": {
  7098. // "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.",
  7099. // "location": "path",
  7100. // "required": true,
  7101. // "type": "string"
  7102. // }
  7103. // },
  7104. // "path": "v1/projects/{projectId}/zones/{zone}/serverconfig",
  7105. // "response": {
  7106. // "$ref": "ServerConfig"
  7107. // },
  7108. // "scopes": [
  7109. // "https://www.googleapis.com/auth/cloud-platform"
  7110. // ]
  7111. // }
  7112. }
  7113. // method id "container.projects.zones.clusters.addons":
  7114. type ProjectsZonesClustersAddonsCall struct {
  7115. s *Service
  7116. projectId string
  7117. zone string
  7118. clusterId string
  7119. setaddonsconfigrequest *SetAddonsConfigRequest
  7120. urlParams_ gensupport.URLParams
  7121. ctx_ context.Context
  7122. header_ http.Header
  7123. }
  7124. // Addons: Sets the addons for a specific cluster.
  7125. func (r *ProjectsZonesClustersService) Addons(projectId string, zone string, clusterId string, setaddonsconfigrequest *SetAddonsConfigRequest) *ProjectsZonesClustersAddonsCall {
  7126. c := &ProjectsZonesClustersAddonsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7127. c.projectId = projectId
  7128. c.zone = zone
  7129. c.clusterId = clusterId
  7130. c.setaddonsconfigrequest = setaddonsconfigrequest
  7131. return c
  7132. }
  7133. // Fields allows partial responses to be retrieved. See
  7134. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7135. // for more information.
  7136. func (c *ProjectsZonesClustersAddonsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersAddonsCall {
  7137. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7138. return c
  7139. }
  7140. // Context sets the context to be used in this call's Do method. Any
  7141. // pending HTTP request will be aborted if the provided context is
  7142. // canceled.
  7143. func (c *ProjectsZonesClustersAddonsCall) Context(ctx context.Context) *ProjectsZonesClustersAddonsCall {
  7144. c.ctx_ = ctx
  7145. return c
  7146. }
  7147. // Header returns an http.Header that can be modified by the caller to
  7148. // add HTTP headers to the request.
  7149. func (c *ProjectsZonesClustersAddonsCall) Header() http.Header {
  7150. if c.header_ == nil {
  7151. c.header_ = make(http.Header)
  7152. }
  7153. return c.header_
  7154. }
  7155. func (c *ProjectsZonesClustersAddonsCall) doRequest(alt string) (*http.Response, error) {
  7156. reqHeaders := make(http.Header)
  7157. for k, v := range c.header_ {
  7158. reqHeaders[k] = v
  7159. }
  7160. reqHeaders.Set("User-Agent", c.s.userAgent())
  7161. var body io.Reader = nil
  7162. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setaddonsconfigrequest)
  7163. if err != nil {
  7164. return nil, err
  7165. }
  7166. reqHeaders.Set("Content-Type", "application/json")
  7167. c.urlParams_.Set("alt", alt)
  7168. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons")
  7169. urls += "?" + c.urlParams_.Encode()
  7170. req, _ := http.NewRequest("POST", urls, body)
  7171. req.Header = reqHeaders
  7172. googleapi.Expand(req.URL, map[string]string{
  7173. "projectId": c.projectId,
  7174. "zone": c.zone,
  7175. "clusterId": c.clusterId,
  7176. })
  7177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7178. }
  7179. // Do executes the "container.projects.zones.clusters.addons" call.
  7180. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7181. // status code is an error. Response headers are in either
  7182. // *Operation.ServerResponse.Header or (if a response was returned at
  7183. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7184. // to check whether the returned error was because
  7185. // http.StatusNotModified was returned.
  7186. func (c *ProjectsZonesClustersAddonsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7187. gensupport.SetOptions(c.urlParams_, opts...)
  7188. res, err := c.doRequest("json")
  7189. if res != nil && res.StatusCode == http.StatusNotModified {
  7190. if res.Body != nil {
  7191. res.Body.Close()
  7192. }
  7193. return nil, &googleapi.Error{
  7194. Code: res.StatusCode,
  7195. Header: res.Header,
  7196. }
  7197. }
  7198. if err != nil {
  7199. return nil, err
  7200. }
  7201. defer googleapi.CloseBody(res)
  7202. if err := googleapi.CheckResponse(res); err != nil {
  7203. return nil, err
  7204. }
  7205. ret := &Operation{
  7206. ServerResponse: googleapi.ServerResponse{
  7207. Header: res.Header,
  7208. HTTPStatusCode: res.StatusCode,
  7209. },
  7210. }
  7211. target := &ret
  7212. if err := gensupport.DecodeResponse(target, res); err != nil {
  7213. return nil, err
  7214. }
  7215. return ret, nil
  7216. // {
  7217. // "description": "Sets the addons for a specific cluster.",
  7218. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  7219. // "httpMethod": "POST",
  7220. // "id": "container.projects.zones.clusters.addons",
  7221. // "parameterOrder": [
  7222. // "projectId",
  7223. // "zone",
  7224. // "clusterId"
  7225. // ],
  7226. // "parameters": {
  7227. // "clusterId": {
  7228. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  7229. // "location": "path",
  7230. // "required": true,
  7231. // "type": "string"
  7232. // },
  7233. // "projectId": {
  7234. // "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.",
  7235. // "location": "path",
  7236. // "required": true,
  7237. // "type": "string"
  7238. // },
  7239. // "zone": {
  7240. // "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.",
  7241. // "location": "path",
  7242. // "required": true,
  7243. // "type": "string"
  7244. // }
  7245. // },
  7246. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons",
  7247. // "request": {
  7248. // "$ref": "SetAddonsConfigRequest"
  7249. // },
  7250. // "response": {
  7251. // "$ref": "Operation"
  7252. // },
  7253. // "scopes": [
  7254. // "https://www.googleapis.com/auth/cloud-platform"
  7255. // ]
  7256. // }
  7257. }
  7258. // method id "container.projects.zones.clusters.completeIpRotation":
  7259. type ProjectsZonesClustersCompleteIpRotationCall struct {
  7260. s *Service
  7261. projectId string
  7262. zone string
  7263. clusterId string
  7264. completeiprotationrequest *CompleteIPRotationRequest
  7265. urlParams_ gensupport.URLParams
  7266. ctx_ context.Context
  7267. header_ http.Header
  7268. }
  7269. // CompleteIpRotation: Completes master IP rotation.
  7270. func (r *ProjectsZonesClustersService) CompleteIpRotation(projectId string, zone string, clusterId string, completeiprotationrequest *CompleteIPRotationRequest) *ProjectsZonesClustersCompleteIpRotationCall {
  7271. c := &ProjectsZonesClustersCompleteIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7272. c.projectId = projectId
  7273. c.zone = zone
  7274. c.clusterId = clusterId
  7275. c.completeiprotationrequest = completeiprotationrequest
  7276. return c
  7277. }
  7278. // Fields allows partial responses to be retrieved. See
  7279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7280. // for more information.
  7281. func (c *ProjectsZonesClustersCompleteIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCompleteIpRotationCall {
  7282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7283. return c
  7284. }
  7285. // Context sets the context to be used in this call's Do method. Any
  7286. // pending HTTP request will be aborted if the provided context is
  7287. // canceled.
  7288. func (c *ProjectsZonesClustersCompleteIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersCompleteIpRotationCall {
  7289. c.ctx_ = ctx
  7290. return c
  7291. }
  7292. // Header returns an http.Header that can be modified by the caller to
  7293. // add HTTP headers to the request.
  7294. func (c *ProjectsZonesClustersCompleteIpRotationCall) Header() http.Header {
  7295. if c.header_ == nil {
  7296. c.header_ = make(http.Header)
  7297. }
  7298. return c.header_
  7299. }
  7300. func (c *ProjectsZonesClustersCompleteIpRotationCall) doRequest(alt string) (*http.Response, error) {
  7301. reqHeaders := make(http.Header)
  7302. for k, v := range c.header_ {
  7303. reqHeaders[k] = v
  7304. }
  7305. reqHeaders.Set("User-Agent", c.s.userAgent())
  7306. var body io.Reader = nil
  7307. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completeiprotationrequest)
  7308. if err != nil {
  7309. return nil, err
  7310. }
  7311. reqHeaders.Set("Content-Type", "application/json")
  7312. c.urlParams_.Set("alt", alt)
  7313. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation")
  7314. urls += "?" + c.urlParams_.Encode()
  7315. req, _ := http.NewRequest("POST", urls, body)
  7316. req.Header = reqHeaders
  7317. googleapi.Expand(req.URL, map[string]string{
  7318. "projectId": c.projectId,
  7319. "zone": c.zone,
  7320. "clusterId": c.clusterId,
  7321. })
  7322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7323. }
  7324. // Do executes the "container.projects.zones.clusters.completeIpRotation" call.
  7325. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7326. // status code is an error. Response headers are in either
  7327. // *Operation.ServerResponse.Header or (if a response was returned at
  7328. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7329. // to check whether the returned error was because
  7330. // http.StatusNotModified was returned.
  7331. func (c *ProjectsZonesClustersCompleteIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7332. gensupport.SetOptions(c.urlParams_, opts...)
  7333. res, err := c.doRequest("json")
  7334. if res != nil && res.StatusCode == http.StatusNotModified {
  7335. if res.Body != nil {
  7336. res.Body.Close()
  7337. }
  7338. return nil, &googleapi.Error{
  7339. Code: res.StatusCode,
  7340. Header: res.Header,
  7341. }
  7342. }
  7343. if err != nil {
  7344. return nil, err
  7345. }
  7346. defer googleapi.CloseBody(res)
  7347. if err := googleapi.CheckResponse(res); err != nil {
  7348. return nil, err
  7349. }
  7350. ret := &Operation{
  7351. ServerResponse: googleapi.ServerResponse{
  7352. Header: res.Header,
  7353. HTTPStatusCode: res.StatusCode,
  7354. },
  7355. }
  7356. target := &ret
  7357. if err := gensupport.DecodeResponse(target, res); err != nil {
  7358. return nil, err
  7359. }
  7360. return ret, nil
  7361. // {
  7362. // "description": "Completes master IP rotation.",
  7363. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  7364. // "httpMethod": "POST",
  7365. // "id": "container.projects.zones.clusters.completeIpRotation",
  7366. // "parameterOrder": [
  7367. // "projectId",
  7368. // "zone",
  7369. // "clusterId"
  7370. // ],
  7371. // "parameters": {
  7372. // "clusterId": {
  7373. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  7374. // "location": "path",
  7375. // "required": true,
  7376. // "type": "string"
  7377. // },
  7378. // "projectId": {
  7379. // "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.",
  7380. // "location": "path",
  7381. // "required": true,
  7382. // "type": "string"
  7383. // },
  7384. // "zone": {
  7385. // "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.",
  7386. // "location": "path",
  7387. // "required": true,
  7388. // "type": "string"
  7389. // }
  7390. // },
  7391. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation",
  7392. // "request": {
  7393. // "$ref": "CompleteIPRotationRequest"
  7394. // },
  7395. // "response": {
  7396. // "$ref": "Operation"
  7397. // },
  7398. // "scopes": [
  7399. // "https://www.googleapis.com/auth/cloud-platform"
  7400. // ]
  7401. // }
  7402. }
  7403. // method id "container.projects.zones.clusters.create":
  7404. type ProjectsZonesClustersCreateCall struct {
  7405. s *Service
  7406. projectId string
  7407. zone string
  7408. createclusterrequest *CreateClusterRequest
  7409. urlParams_ gensupport.URLParams
  7410. ctx_ context.Context
  7411. header_ http.Header
  7412. }
  7413. // Create: Creates a cluster, consisting of the specified number and
  7414. // type of Google
  7415. // Compute Engine instances.
  7416. //
  7417. // By default, the cluster is created in the project's
  7418. // [default
  7419. // network](/compute/docs/networks-and-firewalls#networks).
  7420. //
  7421. // One firewall is added for the cluster. After cluster creation,
  7422. // the cluster creates routes for each node to allow the containers
  7423. // on that node to communicate with all other instances in
  7424. // the
  7425. // cluster.
  7426. //
  7427. // Finally, an entry is added to the project's global metadata
  7428. // indicating
  7429. // which CIDR range is being used by the cluster.
  7430. func (r *ProjectsZonesClustersService) Create(projectId string, zone string, createclusterrequest *CreateClusterRequest) *ProjectsZonesClustersCreateCall {
  7431. c := &ProjectsZonesClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7432. c.projectId = projectId
  7433. c.zone = zone
  7434. c.createclusterrequest = createclusterrequest
  7435. return c
  7436. }
  7437. // Fields allows partial responses to be retrieved. See
  7438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7439. // for more information.
  7440. func (c *ProjectsZonesClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersCreateCall {
  7441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7442. return c
  7443. }
  7444. // Context sets the context to be used in this call's Do method. Any
  7445. // pending HTTP request will be aborted if the provided context is
  7446. // canceled.
  7447. func (c *ProjectsZonesClustersCreateCall) Context(ctx context.Context) *ProjectsZonesClustersCreateCall {
  7448. c.ctx_ = ctx
  7449. return c
  7450. }
  7451. // Header returns an http.Header that can be modified by the caller to
  7452. // add HTTP headers to the request.
  7453. func (c *ProjectsZonesClustersCreateCall) Header() http.Header {
  7454. if c.header_ == nil {
  7455. c.header_ = make(http.Header)
  7456. }
  7457. return c.header_
  7458. }
  7459. func (c *ProjectsZonesClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  7460. reqHeaders := make(http.Header)
  7461. for k, v := range c.header_ {
  7462. reqHeaders[k] = v
  7463. }
  7464. reqHeaders.Set("User-Agent", c.s.userAgent())
  7465. var body io.Reader = nil
  7466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createclusterrequest)
  7467. if err != nil {
  7468. return nil, err
  7469. }
  7470. reqHeaders.Set("Content-Type", "application/json")
  7471. c.urlParams_.Set("alt", alt)
  7472. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  7473. urls += "?" + c.urlParams_.Encode()
  7474. req, _ := http.NewRequest("POST", urls, body)
  7475. req.Header = reqHeaders
  7476. googleapi.Expand(req.URL, map[string]string{
  7477. "projectId": c.projectId,
  7478. "zone": c.zone,
  7479. })
  7480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7481. }
  7482. // Do executes the "container.projects.zones.clusters.create" call.
  7483. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7484. // status code is an error. Response headers are in either
  7485. // *Operation.ServerResponse.Header or (if a response was returned at
  7486. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7487. // to check whether the returned error was because
  7488. // http.StatusNotModified was returned.
  7489. func (c *ProjectsZonesClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7490. gensupport.SetOptions(c.urlParams_, opts...)
  7491. res, err := c.doRequest("json")
  7492. if res != nil && res.StatusCode == http.StatusNotModified {
  7493. if res.Body != nil {
  7494. res.Body.Close()
  7495. }
  7496. return nil, &googleapi.Error{
  7497. Code: res.StatusCode,
  7498. Header: res.Header,
  7499. }
  7500. }
  7501. if err != nil {
  7502. return nil, err
  7503. }
  7504. defer googleapi.CloseBody(res)
  7505. if err := googleapi.CheckResponse(res); err != nil {
  7506. return nil, err
  7507. }
  7508. ret := &Operation{
  7509. ServerResponse: googleapi.ServerResponse{
  7510. Header: res.Header,
  7511. HTTPStatusCode: res.StatusCode,
  7512. },
  7513. }
  7514. target := &ret
  7515. if err := gensupport.DecodeResponse(target, res); err != nil {
  7516. return nil, err
  7517. }
  7518. return ret, nil
  7519. // {
  7520. // "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.",
  7521. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  7522. // "httpMethod": "POST",
  7523. // "id": "container.projects.zones.clusters.create",
  7524. // "parameterOrder": [
  7525. // "projectId",
  7526. // "zone"
  7527. // ],
  7528. // "parameters": {
  7529. // "projectId": {
  7530. // "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.",
  7531. // "location": "path",
  7532. // "required": true,
  7533. // "type": "string"
  7534. // },
  7535. // "zone": {
  7536. // "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.",
  7537. // "location": "path",
  7538. // "required": true,
  7539. // "type": "string"
  7540. // }
  7541. // },
  7542. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  7543. // "request": {
  7544. // "$ref": "CreateClusterRequest"
  7545. // },
  7546. // "response": {
  7547. // "$ref": "Operation"
  7548. // },
  7549. // "scopes": [
  7550. // "https://www.googleapis.com/auth/cloud-platform"
  7551. // ]
  7552. // }
  7553. }
  7554. // method id "container.projects.zones.clusters.delete":
  7555. type ProjectsZonesClustersDeleteCall struct {
  7556. s *Service
  7557. projectId string
  7558. zone string
  7559. clusterId string
  7560. urlParams_ gensupport.URLParams
  7561. ctx_ context.Context
  7562. header_ http.Header
  7563. }
  7564. // Delete: Deletes the cluster, including the Kubernetes endpoint and
  7565. // all worker
  7566. // nodes.
  7567. //
  7568. // Firewalls and routes that were configured during cluster creation
  7569. // are also deleted.
  7570. //
  7571. // Other Google Compute Engine resources that might be in use by the
  7572. // cluster
  7573. // (e.g. load balancer resources) will not be deleted if they weren't
  7574. // present
  7575. // at the initial create time.
  7576. func (r *ProjectsZonesClustersService) Delete(projectId string, zone string, clusterId string) *ProjectsZonesClustersDeleteCall {
  7577. c := &ProjectsZonesClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7578. c.projectId = projectId
  7579. c.zone = zone
  7580. c.clusterId = clusterId
  7581. return c
  7582. }
  7583. // Name sets the optional parameter "name": The name (project, location,
  7584. // cluster) of the cluster to delete.
  7585. // Specified in the format 'projects/*/locations/*/clusters/*'.
  7586. func (c *ProjectsZonesClustersDeleteCall) Name(name string) *ProjectsZonesClustersDeleteCall {
  7587. c.urlParams_.Set("name", name)
  7588. return c
  7589. }
  7590. // Fields allows partial responses to be retrieved. See
  7591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7592. // for more information.
  7593. func (c *ProjectsZonesClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersDeleteCall {
  7594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7595. return c
  7596. }
  7597. // Context sets the context to be used in this call's Do method. Any
  7598. // pending HTTP request will be aborted if the provided context is
  7599. // canceled.
  7600. func (c *ProjectsZonesClustersDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersDeleteCall {
  7601. c.ctx_ = ctx
  7602. return c
  7603. }
  7604. // Header returns an http.Header that can be modified by the caller to
  7605. // add HTTP headers to the request.
  7606. func (c *ProjectsZonesClustersDeleteCall) Header() http.Header {
  7607. if c.header_ == nil {
  7608. c.header_ = make(http.Header)
  7609. }
  7610. return c.header_
  7611. }
  7612. func (c *ProjectsZonesClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  7613. reqHeaders := make(http.Header)
  7614. for k, v := range c.header_ {
  7615. reqHeaders[k] = v
  7616. }
  7617. reqHeaders.Set("User-Agent", c.s.userAgent())
  7618. var body io.Reader = nil
  7619. c.urlParams_.Set("alt", alt)
  7620. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  7621. urls += "?" + c.urlParams_.Encode()
  7622. req, _ := http.NewRequest("DELETE", urls, body)
  7623. req.Header = reqHeaders
  7624. googleapi.Expand(req.URL, map[string]string{
  7625. "projectId": c.projectId,
  7626. "zone": c.zone,
  7627. "clusterId": c.clusterId,
  7628. })
  7629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7630. }
  7631. // Do executes the "container.projects.zones.clusters.delete" call.
  7632. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7633. // status code is an error. Response headers are in either
  7634. // *Operation.ServerResponse.Header or (if a response was returned at
  7635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7636. // to check whether the returned error was because
  7637. // http.StatusNotModified was returned.
  7638. func (c *ProjectsZonesClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7639. gensupport.SetOptions(c.urlParams_, opts...)
  7640. res, err := c.doRequest("json")
  7641. if res != nil && res.StatusCode == http.StatusNotModified {
  7642. if res.Body != nil {
  7643. res.Body.Close()
  7644. }
  7645. return nil, &googleapi.Error{
  7646. Code: res.StatusCode,
  7647. Header: res.Header,
  7648. }
  7649. }
  7650. if err != nil {
  7651. return nil, err
  7652. }
  7653. defer googleapi.CloseBody(res)
  7654. if err := googleapi.CheckResponse(res); err != nil {
  7655. return nil, err
  7656. }
  7657. ret := &Operation{
  7658. ServerResponse: googleapi.ServerResponse{
  7659. Header: res.Header,
  7660. HTTPStatusCode: res.StatusCode,
  7661. },
  7662. }
  7663. target := &ret
  7664. if err := gensupport.DecodeResponse(target, res); err != nil {
  7665. return nil, err
  7666. }
  7667. return ret, nil
  7668. // {
  7669. // "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.",
  7670. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  7671. // "httpMethod": "DELETE",
  7672. // "id": "container.projects.zones.clusters.delete",
  7673. // "parameterOrder": [
  7674. // "projectId",
  7675. // "zone",
  7676. // "clusterId"
  7677. // ],
  7678. // "parameters": {
  7679. // "clusterId": {
  7680. // "description": "Deprecated. The name of the cluster to delete.\nThis field has been deprecated and replaced by the name field.",
  7681. // "location": "path",
  7682. // "required": true,
  7683. // "type": "string"
  7684. // },
  7685. // "name": {
  7686. // "description": "The name (project, location, cluster) of the cluster to delete.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  7687. // "location": "query",
  7688. // "type": "string"
  7689. // },
  7690. // "projectId": {
  7691. // "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.",
  7692. // "location": "path",
  7693. // "required": true,
  7694. // "type": "string"
  7695. // },
  7696. // "zone": {
  7697. // "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.",
  7698. // "location": "path",
  7699. // "required": true,
  7700. // "type": "string"
  7701. // }
  7702. // },
  7703. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  7704. // "response": {
  7705. // "$ref": "Operation"
  7706. // },
  7707. // "scopes": [
  7708. // "https://www.googleapis.com/auth/cloud-platform"
  7709. // ]
  7710. // }
  7711. }
  7712. // method id "container.projects.zones.clusters.get":
  7713. type ProjectsZonesClustersGetCall struct {
  7714. s *Service
  7715. projectId string
  7716. zone string
  7717. clusterId string
  7718. urlParams_ gensupport.URLParams
  7719. ifNoneMatch_ string
  7720. ctx_ context.Context
  7721. header_ http.Header
  7722. }
  7723. // Get: Gets the details of a specific cluster.
  7724. func (r *ProjectsZonesClustersService) Get(projectId string, zone string, clusterId string) *ProjectsZonesClustersGetCall {
  7725. c := &ProjectsZonesClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7726. c.projectId = projectId
  7727. c.zone = zone
  7728. c.clusterId = clusterId
  7729. return c
  7730. }
  7731. // Name sets the optional parameter "name": The name (project, location,
  7732. // cluster) of the cluster to retrieve.
  7733. // Specified in the format 'projects/*/locations/*/clusters/*'.
  7734. func (c *ProjectsZonesClustersGetCall) Name(name string) *ProjectsZonesClustersGetCall {
  7735. c.urlParams_.Set("name", name)
  7736. return c
  7737. }
  7738. // Fields allows partial responses to be retrieved. See
  7739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7740. // for more information.
  7741. func (c *ProjectsZonesClustersGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersGetCall {
  7742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7743. return c
  7744. }
  7745. // IfNoneMatch sets the optional parameter which makes the operation
  7746. // fail if the object's ETag matches the given value. This is useful for
  7747. // getting updates only after the object has changed since the last
  7748. // request. Use googleapi.IsNotModified to check whether the response
  7749. // error from Do is the result of In-None-Match.
  7750. func (c *ProjectsZonesClustersGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersGetCall {
  7751. c.ifNoneMatch_ = entityTag
  7752. return c
  7753. }
  7754. // Context sets the context to be used in this call's Do method. Any
  7755. // pending HTTP request will be aborted if the provided context is
  7756. // canceled.
  7757. func (c *ProjectsZonesClustersGetCall) Context(ctx context.Context) *ProjectsZonesClustersGetCall {
  7758. c.ctx_ = ctx
  7759. return c
  7760. }
  7761. // Header returns an http.Header that can be modified by the caller to
  7762. // add HTTP headers to the request.
  7763. func (c *ProjectsZonesClustersGetCall) Header() http.Header {
  7764. if c.header_ == nil {
  7765. c.header_ = make(http.Header)
  7766. }
  7767. return c.header_
  7768. }
  7769. func (c *ProjectsZonesClustersGetCall) doRequest(alt string) (*http.Response, error) {
  7770. reqHeaders := make(http.Header)
  7771. for k, v := range c.header_ {
  7772. reqHeaders[k] = v
  7773. }
  7774. reqHeaders.Set("User-Agent", c.s.userAgent())
  7775. if c.ifNoneMatch_ != "" {
  7776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7777. }
  7778. var body io.Reader = nil
  7779. c.urlParams_.Set("alt", alt)
  7780. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  7781. urls += "?" + c.urlParams_.Encode()
  7782. req, _ := http.NewRequest("GET", urls, body)
  7783. req.Header = reqHeaders
  7784. googleapi.Expand(req.URL, map[string]string{
  7785. "projectId": c.projectId,
  7786. "zone": c.zone,
  7787. "clusterId": c.clusterId,
  7788. })
  7789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7790. }
  7791. // Do executes the "container.projects.zones.clusters.get" call.
  7792. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  7793. // code is an error. Response headers are in either
  7794. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  7795. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7796. // check whether the returned error was because http.StatusNotModified
  7797. // was returned.
  7798. func (c *ProjectsZonesClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  7799. gensupport.SetOptions(c.urlParams_, opts...)
  7800. res, err := c.doRequest("json")
  7801. if res != nil && res.StatusCode == http.StatusNotModified {
  7802. if res.Body != nil {
  7803. res.Body.Close()
  7804. }
  7805. return nil, &googleapi.Error{
  7806. Code: res.StatusCode,
  7807. Header: res.Header,
  7808. }
  7809. }
  7810. if err != nil {
  7811. return nil, err
  7812. }
  7813. defer googleapi.CloseBody(res)
  7814. if err := googleapi.CheckResponse(res); err != nil {
  7815. return nil, err
  7816. }
  7817. ret := &Cluster{
  7818. ServerResponse: googleapi.ServerResponse{
  7819. Header: res.Header,
  7820. HTTPStatusCode: res.StatusCode,
  7821. },
  7822. }
  7823. target := &ret
  7824. if err := gensupport.DecodeResponse(target, res); err != nil {
  7825. return nil, err
  7826. }
  7827. return ret, nil
  7828. // {
  7829. // "description": "Gets the details of a specific cluster.",
  7830. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  7831. // "httpMethod": "GET",
  7832. // "id": "container.projects.zones.clusters.get",
  7833. // "parameterOrder": [
  7834. // "projectId",
  7835. // "zone",
  7836. // "clusterId"
  7837. // ],
  7838. // "parameters": {
  7839. // "clusterId": {
  7840. // "description": "Deprecated. The name of the cluster to retrieve.\nThis field has been deprecated and replaced by the name field.",
  7841. // "location": "path",
  7842. // "required": true,
  7843. // "type": "string"
  7844. // },
  7845. // "name": {
  7846. // "description": "The name (project, location, cluster) of the cluster to retrieve.\nSpecified in the format 'projects/*/locations/*/clusters/*'.",
  7847. // "location": "query",
  7848. // "type": "string"
  7849. // },
  7850. // "projectId": {
  7851. // "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.",
  7852. // "location": "path",
  7853. // "required": true,
  7854. // "type": "string"
  7855. // },
  7856. // "zone": {
  7857. // "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.",
  7858. // "location": "path",
  7859. // "required": true,
  7860. // "type": "string"
  7861. // }
  7862. // },
  7863. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  7864. // "response": {
  7865. // "$ref": "Cluster"
  7866. // },
  7867. // "scopes": [
  7868. // "https://www.googleapis.com/auth/cloud-platform"
  7869. // ]
  7870. // }
  7871. }
  7872. // method id "container.projects.zones.clusters.legacyAbac":
  7873. type ProjectsZonesClustersLegacyAbacCall struct {
  7874. s *Service
  7875. projectId string
  7876. zone string
  7877. clusterId string
  7878. setlegacyabacrequest *SetLegacyAbacRequest
  7879. urlParams_ gensupport.URLParams
  7880. ctx_ context.Context
  7881. header_ http.Header
  7882. }
  7883. // LegacyAbac: Enables or disables the ABAC authorization mechanism on a
  7884. // cluster.
  7885. func (r *ProjectsZonesClustersService) LegacyAbac(projectId string, zone string, clusterId string, setlegacyabacrequest *SetLegacyAbacRequest) *ProjectsZonesClustersLegacyAbacCall {
  7886. c := &ProjectsZonesClustersLegacyAbacCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7887. c.projectId = projectId
  7888. c.zone = zone
  7889. c.clusterId = clusterId
  7890. c.setlegacyabacrequest = setlegacyabacrequest
  7891. return c
  7892. }
  7893. // Fields allows partial responses to be retrieved. See
  7894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7895. // for more information.
  7896. func (c *ProjectsZonesClustersLegacyAbacCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLegacyAbacCall {
  7897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7898. return c
  7899. }
  7900. // Context sets the context to be used in this call's Do method. Any
  7901. // pending HTTP request will be aborted if the provided context is
  7902. // canceled.
  7903. func (c *ProjectsZonesClustersLegacyAbacCall) Context(ctx context.Context) *ProjectsZonesClustersLegacyAbacCall {
  7904. c.ctx_ = ctx
  7905. return c
  7906. }
  7907. // Header returns an http.Header that can be modified by the caller to
  7908. // add HTTP headers to the request.
  7909. func (c *ProjectsZonesClustersLegacyAbacCall) Header() http.Header {
  7910. if c.header_ == nil {
  7911. c.header_ = make(http.Header)
  7912. }
  7913. return c.header_
  7914. }
  7915. func (c *ProjectsZonesClustersLegacyAbacCall) doRequest(alt string) (*http.Response, error) {
  7916. reqHeaders := make(http.Header)
  7917. for k, v := range c.header_ {
  7918. reqHeaders[k] = v
  7919. }
  7920. reqHeaders.Set("User-Agent", c.s.userAgent())
  7921. var body io.Reader = nil
  7922. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlegacyabacrequest)
  7923. if err != nil {
  7924. return nil, err
  7925. }
  7926. reqHeaders.Set("Content-Type", "application/json")
  7927. c.urlParams_.Set("alt", alt)
  7928. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac")
  7929. urls += "?" + c.urlParams_.Encode()
  7930. req, _ := http.NewRequest("POST", urls, body)
  7931. req.Header = reqHeaders
  7932. googleapi.Expand(req.URL, map[string]string{
  7933. "projectId": c.projectId,
  7934. "zone": c.zone,
  7935. "clusterId": c.clusterId,
  7936. })
  7937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7938. }
  7939. // Do executes the "container.projects.zones.clusters.legacyAbac" call.
  7940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7941. // status code is an error. Response headers are in either
  7942. // *Operation.ServerResponse.Header or (if a response was returned at
  7943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7944. // to check whether the returned error was because
  7945. // http.StatusNotModified was returned.
  7946. func (c *ProjectsZonesClustersLegacyAbacCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7947. gensupport.SetOptions(c.urlParams_, opts...)
  7948. res, err := c.doRequest("json")
  7949. if res != nil && res.StatusCode == http.StatusNotModified {
  7950. if res.Body != nil {
  7951. res.Body.Close()
  7952. }
  7953. return nil, &googleapi.Error{
  7954. Code: res.StatusCode,
  7955. Header: res.Header,
  7956. }
  7957. }
  7958. if err != nil {
  7959. return nil, err
  7960. }
  7961. defer googleapi.CloseBody(res)
  7962. if err := googleapi.CheckResponse(res); err != nil {
  7963. return nil, err
  7964. }
  7965. ret := &Operation{
  7966. ServerResponse: googleapi.ServerResponse{
  7967. Header: res.Header,
  7968. HTTPStatusCode: res.StatusCode,
  7969. },
  7970. }
  7971. target := &ret
  7972. if err := gensupport.DecodeResponse(target, res); err != nil {
  7973. return nil, err
  7974. }
  7975. return ret, nil
  7976. // {
  7977. // "description": "Enables or disables the ABAC authorization mechanism on a cluster.",
  7978. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  7979. // "httpMethod": "POST",
  7980. // "id": "container.projects.zones.clusters.legacyAbac",
  7981. // "parameterOrder": [
  7982. // "projectId",
  7983. // "zone",
  7984. // "clusterId"
  7985. // ],
  7986. // "parameters": {
  7987. // "clusterId": {
  7988. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  7989. // "location": "path",
  7990. // "required": true,
  7991. // "type": "string"
  7992. // },
  7993. // "projectId": {
  7994. // "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.",
  7995. // "location": "path",
  7996. // "required": true,
  7997. // "type": "string"
  7998. // },
  7999. // "zone": {
  8000. // "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.",
  8001. // "location": "path",
  8002. // "required": true,
  8003. // "type": "string"
  8004. // }
  8005. // },
  8006. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac",
  8007. // "request": {
  8008. // "$ref": "SetLegacyAbacRequest"
  8009. // },
  8010. // "response": {
  8011. // "$ref": "Operation"
  8012. // },
  8013. // "scopes": [
  8014. // "https://www.googleapis.com/auth/cloud-platform"
  8015. // ]
  8016. // }
  8017. }
  8018. // method id "container.projects.zones.clusters.list":
  8019. type ProjectsZonesClustersListCall struct {
  8020. s *Service
  8021. projectId string
  8022. zone string
  8023. urlParams_ gensupport.URLParams
  8024. ifNoneMatch_ string
  8025. ctx_ context.Context
  8026. header_ http.Header
  8027. }
  8028. // List: Lists all clusters owned by a project in either the specified
  8029. // zone or all
  8030. // zones.
  8031. func (r *ProjectsZonesClustersService) List(projectId string, zone string) *ProjectsZonesClustersListCall {
  8032. c := &ProjectsZonesClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8033. c.projectId = projectId
  8034. c.zone = zone
  8035. return c
  8036. }
  8037. // Parent sets the optional parameter "parent": The parent (project and
  8038. // location) where the clusters will be listed.
  8039. // Specified in the format 'projects/*/locations/*'.
  8040. // Location "-" matches all zones and all regions.
  8041. func (c *ProjectsZonesClustersListCall) Parent(parent string) *ProjectsZonesClustersListCall {
  8042. c.urlParams_.Set("parent", parent)
  8043. return c
  8044. }
  8045. // Fields allows partial responses to be retrieved. See
  8046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8047. // for more information.
  8048. func (c *ProjectsZonesClustersListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersListCall {
  8049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8050. return c
  8051. }
  8052. // IfNoneMatch sets the optional parameter which makes the operation
  8053. // fail if the object's ETag matches the given value. This is useful for
  8054. // getting updates only after the object has changed since the last
  8055. // request. Use googleapi.IsNotModified to check whether the response
  8056. // error from Do is the result of In-None-Match.
  8057. func (c *ProjectsZonesClustersListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersListCall {
  8058. c.ifNoneMatch_ = entityTag
  8059. return c
  8060. }
  8061. // Context sets the context to be used in this call's Do method. Any
  8062. // pending HTTP request will be aborted if the provided context is
  8063. // canceled.
  8064. func (c *ProjectsZonesClustersListCall) Context(ctx context.Context) *ProjectsZonesClustersListCall {
  8065. c.ctx_ = ctx
  8066. return c
  8067. }
  8068. // Header returns an http.Header that can be modified by the caller to
  8069. // add HTTP headers to the request.
  8070. func (c *ProjectsZonesClustersListCall) Header() http.Header {
  8071. if c.header_ == nil {
  8072. c.header_ = make(http.Header)
  8073. }
  8074. return c.header_
  8075. }
  8076. func (c *ProjectsZonesClustersListCall) doRequest(alt string) (*http.Response, error) {
  8077. reqHeaders := make(http.Header)
  8078. for k, v := range c.header_ {
  8079. reqHeaders[k] = v
  8080. }
  8081. reqHeaders.Set("User-Agent", c.s.userAgent())
  8082. if c.ifNoneMatch_ != "" {
  8083. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8084. }
  8085. var body io.Reader = nil
  8086. c.urlParams_.Set("alt", alt)
  8087. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters")
  8088. urls += "?" + c.urlParams_.Encode()
  8089. req, _ := http.NewRequest("GET", urls, body)
  8090. req.Header = reqHeaders
  8091. googleapi.Expand(req.URL, map[string]string{
  8092. "projectId": c.projectId,
  8093. "zone": c.zone,
  8094. })
  8095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8096. }
  8097. // Do executes the "container.projects.zones.clusters.list" call.
  8098. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  8099. // non-2xx status code is an error. Response headers are in either
  8100. // *ListClustersResponse.ServerResponse.Header or (if a response was
  8101. // returned at all) in error.(*googleapi.Error).Header. Use
  8102. // googleapi.IsNotModified to check whether the returned error was
  8103. // because http.StatusNotModified was returned.
  8104. func (c *ProjectsZonesClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  8105. gensupport.SetOptions(c.urlParams_, opts...)
  8106. res, err := c.doRequest("json")
  8107. if res != nil && res.StatusCode == http.StatusNotModified {
  8108. if res.Body != nil {
  8109. res.Body.Close()
  8110. }
  8111. return nil, &googleapi.Error{
  8112. Code: res.StatusCode,
  8113. Header: res.Header,
  8114. }
  8115. }
  8116. if err != nil {
  8117. return nil, err
  8118. }
  8119. defer googleapi.CloseBody(res)
  8120. if err := googleapi.CheckResponse(res); err != nil {
  8121. return nil, err
  8122. }
  8123. ret := &ListClustersResponse{
  8124. ServerResponse: googleapi.ServerResponse{
  8125. Header: res.Header,
  8126. HTTPStatusCode: res.StatusCode,
  8127. },
  8128. }
  8129. target := &ret
  8130. if err := gensupport.DecodeResponse(target, res); err != nil {
  8131. return nil, err
  8132. }
  8133. return ret, nil
  8134. // {
  8135. // "description": "Lists all clusters owned by a project in either the specified zone or all\nzones.",
  8136. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters",
  8137. // "httpMethod": "GET",
  8138. // "id": "container.projects.zones.clusters.list",
  8139. // "parameterOrder": [
  8140. // "projectId",
  8141. // "zone"
  8142. // ],
  8143. // "parameters": {
  8144. // "parent": {
  8145. // "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.",
  8146. // "location": "query",
  8147. // "type": "string"
  8148. // },
  8149. // "projectId": {
  8150. // "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.",
  8151. // "location": "path",
  8152. // "required": true,
  8153. // "type": "string"
  8154. // },
  8155. // "zone": {
  8156. // "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.",
  8157. // "location": "path",
  8158. // "required": true,
  8159. // "type": "string"
  8160. // }
  8161. // },
  8162. // "path": "v1/projects/{projectId}/zones/{zone}/clusters",
  8163. // "response": {
  8164. // "$ref": "ListClustersResponse"
  8165. // },
  8166. // "scopes": [
  8167. // "https://www.googleapis.com/auth/cloud-platform"
  8168. // ]
  8169. // }
  8170. }
  8171. // method id "container.projects.zones.clusters.locations":
  8172. type ProjectsZonesClustersLocationsCall struct {
  8173. s *Service
  8174. projectId string
  8175. zone string
  8176. clusterId string
  8177. setlocationsrequest *SetLocationsRequest
  8178. urlParams_ gensupport.URLParams
  8179. ctx_ context.Context
  8180. header_ http.Header
  8181. }
  8182. // Locations: Sets the locations for a specific cluster.
  8183. func (r *ProjectsZonesClustersService) Locations(projectId string, zone string, clusterId string, setlocationsrequest *SetLocationsRequest) *ProjectsZonesClustersLocationsCall {
  8184. c := &ProjectsZonesClustersLocationsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8185. c.projectId = projectId
  8186. c.zone = zone
  8187. c.clusterId = clusterId
  8188. c.setlocationsrequest = setlocationsrequest
  8189. return c
  8190. }
  8191. // Fields allows partial responses to be retrieved. See
  8192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8193. // for more information.
  8194. func (c *ProjectsZonesClustersLocationsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLocationsCall {
  8195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8196. return c
  8197. }
  8198. // Context sets the context to be used in this call's Do method. Any
  8199. // pending HTTP request will be aborted if the provided context is
  8200. // canceled.
  8201. func (c *ProjectsZonesClustersLocationsCall) Context(ctx context.Context) *ProjectsZonesClustersLocationsCall {
  8202. c.ctx_ = ctx
  8203. return c
  8204. }
  8205. // Header returns an http.Header that can be modified by the caller to
  8206. // add HTTP headers to the request.
  8207. func (c *ProjectsZonesClustersLocationsCall) Header() http.Header {
  8208. if c.header_ == nil {
  8209. c.header_ = make(http.Header)
  8210. }
  8211. return c.header_
  8212. }
  8213. func (c *ProjectsZonesClustersLocationsCall) doRequest(alt string) (*http.Response, error) {
  8214. reqHeaders := make(http.Header)
  8215. for k, v := range c.header_ {
  8216. reqHeaders[k] = v
  8217. }
  8218. reqHeaders.Set("User-Agent", c.s.userAgent())
  8219. var body io.Reader = nil
  8220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlocationsrequest)
  8221. if err != nil {
  8222. return nil, err
  8223. }
  8224. reqHeaders.Set("Content-Type", "application/json")
  8225. c.urlParams_.Set("alt", alt)
  8226. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations")
  8227. urls += "?" + c.urlParams_.Encode()
  8228. req, _ := http.NewRequest("POST", urls, body)
  8229. req.Header = reqHeaders
  8230. googleapi.Expand(req.URL, map[string]string{
  8231. "projectId": c.projectId,
  8232. "zone": c.zone,
  8233. "clusterId": c.clusterId,
  8234. })
  8235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8236. }
  8237. // Do executes the "container.projects.zones.clusters.locations" call.
  8238. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8239. // status code is an error. Response headers are in either
  8240. // *Operation.ServerResponse.Header or (if a response was returned at
  8241. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8242. // to check whether the returned error was because
  8243. // http.StatusNotModified was returned.
  8244. func (c *ProjectsZonesClustersLocationsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8245. gensupport.SetOptions(c.urlParams_, opts...)
  8246. res, err := c.doRequest("json")
  8247. if res != nil && res.StatusCode == http.StatusNotModified {
  8248. if res.Body != nil {
  8249. res.Body.Close()
  8250. }
  8251. return nil, &googleapi.Error{
  8252. Code: res.StatusCode,
  8253. Header: res.Header,
  8254. }
  8255. }
  8256. if err != nil {
  8257. return nil, err
  8258. }
  8259. defer googleapi.CloseBody(res)
  8260. if err := googleapi.CheckResponse(res); err != nil {
  8261. return nil, err
  8262. }
  8263. ret := &Operation{
  8264. ServerResponse: googleapi.ServerResponse{
  8265. Header: res.Header,
  8266. HTTPStatusCode: res.StatusCode,
  8267. },
  8268. }
  8269. target := &ret
  8270. if err := gensupport.DecodeResponse(target, res); err != nil {
  8271. return nil, err
  8272. }
  8273. return ret, nil
  8274. // {
  8275. // "description": "Sets the locations for a specific cluster.",
  8276. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  8277. // "httpMethod": "POST",
  8278. // "id": "container.projects.zones.clusters.locations",
  8279. // "parameterOrder": [
  8280. // "projectId",
  8281. // "zone",
  8282. // "clusterId"
  8283. // ],
  8284. // "parameters": {
  8285. // "clusterId": {
  8286. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8287. // "location": "path",
  8288. // "required": true,
  8289. // "type": "string"
  8290. // },
  8291. // "projectId": {
  8292. // "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.",
  8293. // "location": "path",
  8294. // "required": true,
  8295. // "type": "string"
  8296. // },
  8297. // "zone": {
  8298. // "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.",
  8299. // "location": "path",
  8300. // "required": true,
  8301. // "type": "string"
  8302. // }
  8303. // },
  8304. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations",
  8305. // "request": {
  8306. // "$ref": "SetLocationsRequest"
  8307. // },
  8308. // "response": {
  8309. // "$ref": "Operation"
  8310. // },
  8311. // "scopes": [
  8312. // "https://www.googleapis.com/auth/cloud-platform"
  8313. // ]
  8314. // }
  8315. }
  8316. // method id "container.projects.zones.clusters.logging":
  8317. type ProjectsZonesClustersLoggingCall struct {
  8318. s *Service
  8319. projectId string
  8320. zone string
  8321. clusterId string
  8322. setloggingservicerequest *SetLoggingServiceRequest
  8323. urlParams_ gensupport.URLParams
  8324. ctx_ context.Context
  8325. header_ http.Header
  8326. }
  8327. // Logging: Sets the logging service for a specific cluster.
  8328. func (r *ProjectsZonesClustersService) Logging(projectId string, zone string, clusterId string, setloggingservicerequest *SetLoggingServiceRequest) *ProjectsZonesClustersLoggingCall {
  8329. c := &ProjectsZonesClustersLoggingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8330. c.projectId = projectId
  8331. c.zone = zone
  8332. c.clusterId = clusterId
  8333. c.setloggingservicerequest = setloggingservicerequest
  8334. return c
  8335. }
  8336. // Fields allows partial responses to be retrieved. See
  8337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8338. // for more information.
  8339. func (c *ProjectsZonesClustersLoggingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersLoggingCall {
  8340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8341. return c
  8342. }
  8343. // Context sets the context to be used in this call's Do method. Any
  8344. // pending HTTP request will be aborted if the provided context is
  8345. // canceled.
  8346. func (c *ProjectsZonesClustersLoggingCall) Context(ctx context.Context) *ProjectsZonesClustersLoggingCall {
  8347. c.ctx_ = ctx
  8348. return c
  8349. }
  8350. // Header returns an http.Header that can be modified by the caller to
  8351. // add HTTP headers to the request.
  8352. func (c *ProjectsZonesClustersLoggingCall) Header() http.Header {
  8353. if c.header_ == nil {
  8354. c.header_ = make(http.Header)
  8355. }
  8356. return c.header_
  8357. }
  8358. func (c *ProjectsZonesClustersLoggingCall) doRequest(alt string) (*http.Response, error) {
  8359. reqHeaders := make(http.Header)
  8360. for k, v := range c.header_ {
  8361. reqHeaders[k] = v
  8362. }
  8363. reqHeaders.Set("User-Agent", c.s.userAgent())
  8364. var body io.Reader = nil
  8365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setloggingservicerequest)
  8366. if err != nil {
  8367. return nil, err
  8368. }
  8369. reqHeaders.Set("Content-Type", "application/json")
  8370. c.urlParams_.Set("alt", alt)
  8371. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging")
  8372. urls += "?" + c.urlParams_.Encode()
  8373. req, _ := http.NewRequest("POST", urls, body)
  8374. req.Header = reqHeaders
  8375. googleapi.Expand(req.URL, map[string]string{
  8376. "projectId": c.projectId,
  8377. "zone": c.zone,
  8378. "clusterId": c.clusterId,
  8379. })
  8380. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8381. }
  8382. // Do executes the "container.projects.zones.clusters.logging" call.
  8383. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8384. // status code is an error. Response headers are in either
  8385. // *Operation.ServerResponse.Header or (if a response was returned at
  8386. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8387. // to check whether the returned error was because
  8388. // http.StatusNotModified was returned.
  8389. func (c *ProjectsZonesClustersLoggingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8390. gensupport.SetOptions(c.urlParams_, opts...)
  8391. res, err := c.doRequest("json")
  8392. if res != nil && res.StatusCode == http.StatusNotModified {
  8393. if res.Body != nil {
  8394. res.Body.Close()
  8395. }
  8396. return nil, &googleapi.Error{
  8397. Code: res.StatusCode,
  8398. Header: res.Header,
  8399. }
  8400. }
  8401. if err != nil {
  8402. return nil, err
  8403. }
  8404. defer googleapi.CloseBody(res)
  8405. if err := googleapi.CheckResponse(res); err != nil {
  8406. return nil, err
  8407. }
  8408. ret := &Operation{
  8409. ServerResponse: googleapi.ServerResponse{
  8410. Header: res.Header,
  8411. HTTPStatusCode: res.StatusCode,
  8412. },
  8413. }
  8414. target := &ret
  8415. if err := gensupport.DecodeResponse(target, res); err != nil {
  8416. return nil, err
  8417. }
  8418. return ret, nil
  8419. // {
  8420. // "description": "Sets the logging service for a specific cluster.",
  8421. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  8422. // "httpMethod": "POST",
  8423. // "id": "container.projects.zones.clusters.logging",
  8424. // "parameterOrder": [
  8425. // "projectId",
  8426. // "zone",
  8427. // "clusterId"
  8428. // ],
  8429. // "parameters": {
  8430. // "clusterId": {
  8431. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8432. // "location": "path",
  8433. // "required": true,
  8434. // "type": "string"
  8435. // },
  8436. // "projectId": {
  8437. // "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.",
  8438. // "location": "path",
  8439. // "required": true,
  8440. // "type": "string"
  8441. // },
  8442. // "zone": {
  8443. // "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.",
  8444. // "location": "path",
  8445. // "required": true,
  8446. // "type": "string"
  8447. // }
  8448. // },
  8449. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging",
  8450. // "request": {
  8451. // "$ref": "SetLoggingServiceRequest"
  8452. // },
  8453. // "response": {
  8454. // "$ref": "Operation"
  8455. // },
  8456. // "scopes": [
  8457. // "https://www.googleapis.com/auth/cloud-platform"
  8458. // ]
  8459. // }
  8460. }
  8461. // method id "container.projects.zones.clusters.master":
  8462. type ProjectsZonesClustersMasterCall struct {
  8463. s *Service
  8464. projectId string
  8465. zone string
  8466. clusterId string
  8467. updatemasterrequest *UpdateMasterRequest
  8468. urlParams_ gensupport.URLParams
  8469. ctx_ context.Context
  8470. header_ http.Header
  8471. }
  8472. // Master: Updates the master for a specific cluster.
  8473. func (r *ProjectsZonesClustersService) Master(projectId string, zone string, clusterId string, updatemasterrequest *UpdateMasterRequest) *ProjectsZonesClustersMasterCall {
  8474. c := &ProjectsZonesClustersMasterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8475. c.projectId = projectId
  8476. c.zone = zone
  8477. c.clusterId = clusterId
  8478. c.updatemasterrequest = updatemasterrequest
  8479. return c
  8480. }
  8481. // Fields allows partial responses to be retrieved. See
  8482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8483. // for more information.
  8484. func (c *ProjectsZonesClustersMasterCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMasterCall {
  8485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8486. return c
  8487. }
  8488. // Context sets the context to be used in this call's Do method. Any
  8489. // pending HTTP request will be aborted if the provided context is
  8490. // canceled.
  8491. func (c *ProjectsZonesClustersMasterCall) Context(ctx context.Context) *ProjectsZonesClustersMasterCall {
  8492. c.ctx_ = ctx
  8493. return c
  8494. }
  8495. // Header returns an http.Header that can be modified by the caller to
  8496. // add HTTP headers to the request.
  8497. func (c *ProjectsZonesClustersMasterCall) Header() http.Header {
  8498. if c.header_ == nil {
  8499. c.header_ = make(http.Header)
  8500. }
  8501. return c.header_
  8502. }
  8503. func (c *ProjectsZonesClustersMasterCall) doRequest(alt string) (*http.Response, error) {
  8504. reqHeaders := make(http.Header)
  8505. for k, v := range c.header_ {
  8506. reqHeaders[k] = v
  8507. }
  8508. reqHeaders.Set("User-Agent", c.s.userAgent())
  8509. var body io.Reader = nil
  8510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatemasterrequest)
  8511. if err != nil {
  8512. return nil, err
  8513. }
  8514. reqHeaders.Set("Content-Type", "application/json")
  8515. c.urlParams_.Set("alt", alt)
  8516. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master")
  8517. urls += "?" + c.urlParams_.Encode()
  8518. req, _ := http.NewRequest("POST", urls, body)
  8519. req.Header = reqHeaders
  8520. googleapi.Expand(req.URL, map[string]string{
  8521. "projectId": c.projectId,
  8522. "zone": c.zone,
  8523. "clusterId": c.clusterId,
  8524. })
  8525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8526. }
  8527. // Do executes the "container.projects.zones.clusters.master" call.
  8528. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8529. // status code is an error. Response headers are in either
  8530. // *Operation.ServerResponse.Header or (if a response was returned at
  8531. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8532. // to check whether the returned error was because
  8533. // http.StatusNotModified was returned.
  8534. func (c *ProjectsZonesClustersMasterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8535. gensupport.SetOptions(c.urlParams_, opts...)
  8536. res, err := c.doRequest("json")
  8537. if res != nil && res.StatusCode == http.StatusNotModified {
  8538. if res.Body != nil {
  8539. res.Body.Close()
  8540. }
  8541. return nil, &googleapi.Error{
  8542. Code: res.StatusCode,
  8543. Header: res.Header,
  8544. }
  8545. }
  8546. if err != nil {
  8547. return nil, err
  8548. }
  8549. defer googleapi.CloseBody(res)
  8550. if err := googleapi.CheckResponse(res); err != nil {
  8551. return nil, err
  8552. }
  8553. ret := &Operation{
  8554. ServerResponse: googleapi.ServerResponse{
  8555. Header: res.Header,
  8556. HTTPStatusCode: res.StatusCode,
  8557. },
  8558. }
  8559. target := &ret
  8560. if err := gensupport.DecodeResponse(target, res); err != nil {
  8561. return nil, err
  8562. }
  8563. return ret, nil
  8564. // {
  8565. // "description": "Updates the master for a specific cluster.",
  8566. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  8567. // "httpMethod": "POST",
  8568. // "id": "container.projects.zones.clusters.master",
  8569. // "parameterOrder": [
  8570. // "projectId",
  8571. // "zone",
  8572. // "clusterId"
  8573. // ],
  8574. // "parameters": {
  8575. // "clusterId": {
  8576. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8577. // "location": "path",
  8578. // "required": true,
  8579. // "type": "string"
  8580. // },
  8581. // "projectId": {
  8582. // "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.",
  8583. // "location": "path",
  8584. // "required": true,
  8585. // "type": "string"
  8586. // },
  8587. // "zone": {
  8588. // "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.",
  8589. // "location": "path",
  8590. // "required": true,
  8591. // "type": "string"
  8592. // }
  8593. // },
  8594. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master",
  8595. // "request": {
  8596. // "$ref": "UpdateMasterRequest"
  8597. // },
  8598. // "response": {
  8599. // "$ref": "Operation"
  8600. // },
  8601. // "scopes": [
  8602. // "https://www.googleapis.com/auth/cloud-platform"
  8603. // ]
  8604. // }
  8605. }
  8606. // method id "container.projects.zones.clusters.monitoring":
  8607. type ProjectsZonesClustersMonitoringCall struct {
  8608. s *Service
  8609. projectId string
  8610. zone string
  8611. clusterId string
  8612. setmonitoringservicerequest *SetMonitoringServiceRequest
  8613. urlParams_ gensupport.URLParams
  8614. ctx_ context.Context
  8615. header_ http.Header
  8616. }
  8617. // Monitoring: Sets the monitoring service for a specific cluster.
  8618. func (r *ProjectsZonesClustersService) Monitoring(projectId string, zone string, clusterId string, setmonitoringservicerequest *SetMonitoringServiceRequest) *ProjectsZonesClustersMonitoringCall {
  8619. c := &ProjectsZonesClustersMonitoringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8620. c.projectId = projectId
  8621. c.zone = zone
  8622. c.clusterId = clusterId
  8623. c.setmonitoringservicerequest = setmonitoringservicerequest
  8624. return c
  8625. }
  8626. // Fields allows partial responses to be retrieved. See
  8627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8628. // for more information.
  8629. func (c *ProjectsZonesClustersMonitoringCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersMonitoringCall {
  8630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8631. return c
  8632. }
  8633. // Context sets the context to be used in this call's Do method. Any
  8634. // pending HTTP request will be aborted if the provided context is
  8635. // canceled.
  8636. func (c *ProjectsZonesClustersMonitoringCall) Context(ctx context.Context) *ProjectsZonesClustersMonitoringCall {
  8637. c.ctx_ = ctx
  8638. return c
  8639. }
  8640. // Header returns an http.Header that can be modified by the caller to
  8641. // add HTTP headers to the request.
  8642. func (c *ProjectsZonesClustersMonitoringCall) Header() http.Header {
  8643. if c.header_ == nil {
  8644. c.header_ = make(http.Header)
  8645. }
  8646. return c.header_
  8647. }
  8648. func (c *ProjectsZonesClustersMonitoringCall) doRequest(alt string) (*http.Response, error) {
  8649. reqHeaders := make(http.Header)
  8650. for k, v := range c.header_ {
  8651. reqHeaders[k] = v
  8652. }
  8653. reqHeaders.Set("User-Agent", c.s.userAgent())
  8654. var body io.Reader = nil
  8655. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmonitoringservicerequest)
  8656. if err != nil {
  8657. return nil, err
  8658. }
  8659. reqHeaders.Set("Content-Type", "application/json")
  8660. c.urlParams_.Set("alt", alt)
  8661. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring")
  8662. urls += "?" + c.urlParams_.Encode()
  8663. req, _ := http.NewRequest("POST", urls, body)
  8664. req.Header = reqHeaders
  8665. googleapi.Expand(req.URL, map[string]string{
  8666. "projectId": c.projectId,
  8667. "zone": c.zone,
  8668. "clusterId": c.clusterId,
  8669. })
  8670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8671. }
  8672. // Do executes the "container.projects.zones.clusters.monitoring" call.
  8673. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8674. // status code is an error. Response headers are in either
  8675. // *Operation.ServerResponse.Header or (if a response was returned at
  8676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8677. // to check whether the returned error was because
  8678. // http.StatusNotModified was returned.
  8679. func (c *ProjectsZonesClustersMonitoringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8680. gensupport.SetOptions(c.urlParams_, opts...)
  8681. res, err := c.doRequest("json")
  8682. if res != nil && res.StatusCode == http.StatusNotModified {
  8683. if res.Body != nil {
  8684. res.Body.Close()
  8685. }
  8686. return nil, &googleapi.Error{
  8687. Code: res.StatusCode,
  8688. Header: res.Header,
  8689. }
  8690. }
  8691. if err != nil {
  8692. return nil, err
  8693. }
  8694. defer googleapi.CloseBody(res)
  8695. if err := googleapi.CheckResponse(res); err != nil {
  8696. return nil, err
  8697. }
  8698. ret := &Operation{
  8699. ServerResponse: googleapi.ServerResponse{
  8700. Header: res.Header,
  8701. HTTPStatusCode: res.StatusCode,
  8702. },
  8703. }
  8704. target := &ret
  8705. if err := gensupport.DecodeResponse(target, res); err != nil {
  8706. return nil, err
  8707. }
  8708. return ret, nil
  8709. // {
  8710. // "description": "Sets the monitoring service for a specific cluster.",
  8711. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  8712. // "httpMethod": "POST",
  8713. // "id": "container.projects.zones.clusters.monitoring",
  8714. // "parameterOrder": [
  8715. // "projectId",
  8716. // "zone",
  8717. // "clusterId"
  8718. // ],
  8719. // "parameters": {
  8720. // "clusterId": {
  8721. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  8722. // "location": "path",
  8723. // "required": true,
  8724. // "type": "string"
  8725. // },
  8726. // "projectId": {
  8727. // "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.",
  8728. // "location": "path",
  8729. // "required": true,
  8730. // "type": "string"
  8731. // },
  8732. // "zone": {
  8733. // "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.",
  8734. // "location": "path",
  8735. // "required": true,
  8736. // "type": "string"
  8737. // }
  8738. // },
  8739. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring",
  8740. // "request": {
  8741. // "$ref": "SetMonitoringServiceRequest"
  8742. // },
  8743. // "response": {
  8744. // "$ref": "Operation"
  8745. // },
  8746. // "scopes": [
  8747. // "https://www.googleapis.com/auth/cloud-platform"
  8748. // ]
  8749. // }
  8750. }
  8751. // method id "container.projects.zones.clusters.resourceLabels":
  8752. type ProjectsZonesClustersResourceLabelsCall struct {
  8753. s *Service
  8754. projectId string
  8755. zone string
  8756. clusterId string
  8757. setlabelsrequest *SetLabelsRequest
  8758. urlParams_ gensupport.URLParams
  8759. ctx_ context.Context
  8760. header_ http.Header
  8761. }
  8762. // ResourceLabels: Sets labels on a cluster.
  8763. func (r *ProjectsZonesClustersService) ResourceLabels(projectId string, zone string, clusterId string, setlabelsrequest *SetLabelsRequest) *ProjectsZonesClustersResourceLabelsCall {
  8764. c := &ProjectsZonesClustersResourceLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8765. c.projectId = projectId
  8766. c.zone = zone
  8767. c.clusterId = clusterId
  8768. c.setlabelsrequest = setlabelsrequest
  8769. return c
  8770. }
  8771. // Fields allows partial responses to be retrieved. See
  8772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8773. // for more information.
  8774. func (c *ProjectsZonesClustersResourceLabelsCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersResourceLabelsCall {
  8775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8776. return c
  8777. }
  8778. // Context sets the context to be used in this call's Do method. Any
  8779. // pending HTTP request will be aborted if the provided context is
  8780. // canceled.
  8781. func (c *ProjectsZonesClustersResourceLabelsCall) Context(ctx context.Context) *ProjectsZonesClustersResourceLabelsCall {
  8782. c.ctx_ = ctx
  8783. return c
  8784. }
  8785. // Header returns an http.Header that can be modified by the caller to
  8786. // add HTTP headers to the request.
  8787. func (c *ProjectsZonesClustersResourceLabelsCall) Header() http.Header {
  8788. if c.header_ == nil {
  8789. c.header_ = make(http.Header)
  8790. }
  8791. return c.header_
  8792. }
  8793. func (c *ProjectsZonesClustersResourceLabelsCall) doRequest(alt string) (*http.Response, error) {
  8794. reqHeaders := make(http.Header)
  8795. for k, v := range c.header_ {
  8796. reqHeaders[k] = v
  8797. }
  8798. reqHeaders.Set("User-Agent", c.s.userAgent())
  8799. var body io.Reader = nil
  8800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setlabelsrequest)
  8801. if err != nil {
  8802. return nil, err
  8803. }
  8804. reqHeaders.Set("Content-Type", "application/json")
  8805. c.urlParams_.Set("alt", alt)
  8806. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels")
  8807. urls += "?" + c.urlParams_.Encode()
  8808. req, _ := http.NewRequest("POST", urls, body)
  8809. req.Header = reqHeaders
  8810. googleapi.Expand(req.URL, map[string]string{
  8811. "projectId": c.projectId,
  8812. "zone": c.zone,
  8813. "clusterId": c.clusterId,
  8814. })
  8815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8816. }
  8817. // Do executes the "container.projects.zones.clusters.resourceLabels" call.
  8818. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8819. // status code is an error. Response headers are in either
  8820. // *Operation.ServerResponse.Header or (if a response was returned at
  8821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8822. // to check whether the returned error was because
  8823. // http.StatusNotModified was returned.
  8824. func (c *ProjectsZonesClustersResourceLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8825. gensupport.SetOptions(c.urlParams_, opts...)
  8826. res, err := c.doRequest("json")
  8827. if res != nil && res.StatusCode == http.StatusNotModified {
  8828. if res.Body != nil {
  8829. res.Body.Close()
  8830. }
  8831. return nil, &googleapi.Error{
  8832. Code: res.StatusCode,
  8833. Header: res.Header,
  8834. }
  8835. }
  8836. if err != nil {
  8837. return nil, err
  8838. }
  8839. defer googleapi.CloseBody(res)
  8840. if err := googleapi.CheckResponse(res); err != nil {
  8841. return nil, err
  8842. }
  8843. ret := &Operation{
  8844. ServerResponse: googleapi.ServerResponse{
  8845. Header: res.Header,
  8846. HTTPStatusCode: res.StatusCode,
  8847. },
  8848. }
  8849. target := &ret
  8850. if err := gensupport.DecodeResponse(target, res); err != nil {
  8851. return nil, err
  8852. }
  8853. return ret, nil
  8854. // {
  8855. // "description": "Sets labels on a cluster.",
  8856. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  8857. // "httpMethod": "POST",
  8858. // "id": "container.projects.zones.clusters.resourceLabels",
  8859. // "parameterOrder": [
  8860. // "projectId",
  8861. // "zone",
  8862. // "clusterId"
  8863. // ],
  8864. // "parameters": {
  8865. // "clusterId": {
  8866. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  8867. // "location": "path",
  8868. // "required": true,
  8869. // "type": "string"
  8870. // },
  8871. // "projectId": {
  8872. // "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.",
  8873. // "location": "path",
  8874. // "required": true,
  8875. // "type": "string"
  8876. // },
  8877. // "zone": {
  8878. // "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.",
  8879. // "location": "path",
  8880. // "required": true,
  8881. // "type": "string"
  8882. // }
  8883. // },
  8884. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels",
  8885. // "request": {
  8886. // "$ref": "SetLabelsRequest"
  8887. // },
  8888. // "response": {
  8889. // "$ref": "Operation"
  8890. // },
  8891. // "scopes": [
  8892. // "https://www.googleapis.com/auth/cloud-platform"
  8893. // ]
  8894. // }
  8895. }
  8896. // method id "container.projects.zones.clusters.setMaintenancePolicy":
  8897. type ProjectsZonesClustersSetMaintenancePolicyCall struct {
  8898. s *Service
  8899. projectId string
  8900. zone string
  8901. clusterId string
  8902. setmaintenancepolicyrequest *SetMaintenancePolicyRequest
  8903. urlParams_ gensupport.URLParams
  8904. ctx_ context.Context
  8905. header_ http.Header
  8906. }
  8907. // SetMaintenancePolicy: Sets the maintenance policy for a cluster.
  8908. func (r *ProjectsZonesClustersService) SetMaintenancePolicy(projectId string, zone string, clusterId string, setmaintenancepolicyrequest *SetMaintenancePolicyRequest) *ProjectsZonesClustersSetMaintenancePolicyCall {
  8909. c := &ProjectsZonesClustersSetMaintenancePolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8910. c.projectId = projectId
  8911. c.zone = zone
  8912. c.clusterId = clusterId
  8913. c.setmaintenancepolicyrequest = setmaintenancepolicyrequest
  8914. return c
  8915. }
  8916. // Fields allows partial responses to be retrieved. See
  8917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8918. // for more information.
  8919. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMaintenancePolicyCall {
  8920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8921. return c
  8922. }
  8923. // Context sets the context to be used in this call's Do method. Any
  8924. // pending HTTP request will be aborted if the provided context is
  8925. // canceled.
  8926. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetMaintenancePolicyCall {
  8927. c.ctx_ = ctx
  8928. return c
  8929. }
  8930. // Header returns an http.Header that can be modified by the caller to
  8931. // add HTTP headers to the request.
  8932. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Header() http.Header {
  8933. if c.header_ == nil {
  8934. c.header_ = make(http.Header)
  8935. }
  8936. return c.header_
  8937. }
  8938. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) doRequest(alt string) (*http.Response, error) {
  8939. reqHeaders := make(http.Header)
  8940. for k, v := range c.header_ {
  8941. reqHeaders[k] = v
  8942. }
  8943. reqHeaders.Set("User-Agent", c.s.userAgent())
  8944. var body io.Reader = nil
  8945. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmaintenancepolicyrequest)
  8946. if err != nil {
  8947. return nil, err
  8948. }
  8949. reqHeaders.Set("Content-Type", "application/json")
  8950. c.urlParams_.Set("alt", alt)
  8951. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy")
  8952. urls += "?" + c.urlParams_.Encode()
  8953. req, _ := http.NewRequest("POST", urls, body)
  8954. req.Header = reqHeaders
  8955. googleapi.Expand(req.URL, map[string]string{
  8956. "projectId": c.projectId,
  8957. "zone": c.zone,
  8958. "clusterId": c.clusterId,
  8959. })
  8960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8961. }
  8962. // Do executes the "container.projects.zones.clusters.setMaintenancePolicy" call.
  8963. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8964. // status code is an error. Response headers are in either
  8965. // *Operation.ServerResponse.Header or (if a response was returned at
  8966. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8967. // to check whether the returned error was because
  8968. // http.StatusNotModified was returned.
  8969. func (c *ProjectsZonesClustersSetMaintenancePolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8970. gensupport.SetOptions(c.urlParams_, opts...)
  8971. res, err := c.doRequest("json")
  8972. if res != nil && res.StatusCode == http.StatusNotModified {
  8973. if res.Body != nil {
  8974. res.Body.Close()
  8975. }
  8976. return nil, &googleapi.Error{
  8977. Code: res.StatusCode,
  8978. Header: res.Header,
  8979. }
  8980. }
  8981. if err != nil {
  8982. return nil, err
  8983. }
  8984. defer googleapi.CloseBody(res)
  8985. if err := googleapi.CheckResponse(res); err != nil {
  8986. return nil, err
  8987. }
  8988. ret := &Operation{
  8989. ServerResponse: googleapi.ServerResponse{
  8990. Header: res.Header,
  8991. HTTPStatusCode: res.StatusCode,
  8992. },
  8993. }
  8994. target := &ret
  8995. if err := gensupport.DecodeResponse(target, res); err != nil {
  8996. return nil, err
  8997. }
  8998. return ret, nil
  8999. // {
  9000. // "description": "Sets the maintenance policy for a cluster.",
  9001. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9002. // "httpMethod": "POST",
  9003. // "id": "container.projects.zones.clusters.setMaintenancePolicy",
  9004. // "parameterOrder": [
  9005. // "projectId",
  9006. // "zone",
  9007. // "clusterId"
  9008. // ],
  9009. // "parameters": {
  9010. // "clusterId": {
  9011. // "description": "The name of the cluster to update.",
  9012. // "location": "path",
  9013. // "required": true,
  9014. // "type": "string"
  9015. // },
  9016. // "projectId": {
  9017. // "description": "The Google Developers Console [project ID or project\nnumber](https://support.google.com/cloud/answer/6158840).",
  9018. // "location": "path",
  9019. // "required": true,
  9020. // "type": "string"
  9021. // },
  9022. // "zone": {
  9023. // "description": "The name of the Google Compute Engine\n[zone](/compute/docs/zones#available) in which the cluster\nresides.",
  9024. // "location": "path",
  9025. // "required": true,
  9026. // "type": "string"
  9027. // }
  9028. // },
  9029. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy",
  9030. // "request": {
  9031. // "$ref": "SetMaintenancePolicyRequest"
  9032. // },
  9033. // "response": {
  9034. // "$ref": "Operation"
  9035. // },
  9036. // "scopes": [
  9037. // "https://www.googleapis.com/auth/cloud-platform"
  9038. // ]
  9039. // }
  9040. }
  9041. // method id "container.projects.zones.clusters.setMasterAuth":
  9042. type ProjectsZonesClustersSetMasterAuthCall struct {
  9043. s *Service
  9044. projectId string
  9045. zone string
  9046. clusterId string
  9047. setmasterauthrequest *SetMasterAuthRequest
  9048. urlParams_ gensupport.URLParams
  9049. ctx_ context.Context
  9050. header_ http.Header
  9051. }
  9052. // SetMasterAuth: Used to set master auth materials. Currently supports
  9053. // :-
  9054. // Changing the admin password for a specific cluster.
  9055. // This can be either via password generation or explicitly set the
  9056. // password.
  9057. func (r *ProjectsZonesClustersService) SetMasterAuth(projectId string, zone string, clusterId string, setmasterauthrequest *SetMasterAuthRequest) *ProjectsZonesClustersSetMasterAuthCall {
  9058. c := &ProjectsZonesClustersSetMasterAuthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9059. c.projectId = projectId
  9060. c.zone = zone
  9061. c.clusterId = clusterId
  9062. c.setmasterauthrequest = setmasterauthrequest
  9063. return c
  9064. }
  9065. // Fields allows partial responses to be retrieved. See
  9066. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9067. // for more information.
  9068. func (c *ProjectsZonesClustersSetMasterAuthCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetMasterAuthCall {
  9069. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9070. return c
  9071. }
  9072. // Context sets the context to be used in this call's Do method. Any
  9073. // pending HTTP request will be aborted if the provided context is
  9074. // canceled.
  9075. func (c *ProjectsZonesClustersSetMasterAuthCall) Context(ctx context.Context) *ProjectsZonesClustersSetMasterAuthCall {
  9076. c.ctx_ = ctx
  9077. return c
  9078. }
  9079. // Header returns an http.Header that can be modified by the caller to
  9080. // add HTTP headers to the request.
  9081. func (c *ProjectsZonesClustersSetMasterAuthCall) Header() http.Header {
  9082. if c.header_ == nil {
  9083. c.header_ = make(http.Header)
  9084. }
  9085. return c.header_
  9086. }
  9087. func (c *ProjectsZonesClustersSetMasterAuthCall) doRequest(alt string) (*http.Response, error) {
  9088. reqHeaders := make(http.Header)
  9089. for k, v := range c.header_ {
  9090. reqHeaders[k] = v
  9091. }
  9092. reqHeaders.Set("User-Agent", c.s.userAgent())
  9093. var body io.Reader = nil
  9094. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setmasterauthrequest)
  9095. if err != nil {
  9096. return nil, err
  9097. }
  9098. reqHeaders.Set("Content-Type", "application/json")
  9099. c.urlParams_.Set("alt", alt)
  9100. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth")
  9101. urls += "?" + c.urlParams_.Encode()
  9102. req, _ := http.NewRequest("POST", urls, body)
  9103. req.Header = reqHeaders
  9104. googleapi.Expand(req.URL, map[string]string{
  9105. "projectId": c.projectId,
  9106. "zone": c.zone,
  9107. "clusterId": c.clusterId,
  9108. })
  9109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9110. }
  9111. // Do executes the "container.projects.zones.clusters.setMasterAuth" call.
  9112. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9113. // status code is an error. Response headers are in either
  9114. // *Operation.ServerResponse.Header or (if a response was returned at
  9115. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9116. // to check whether the returned error was because
  9117. // http.StatusNotModified was returned.
  9118. func (c *ProjectsZonesClustersSetMasterAuthCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9119. gensupport.SetOptions(c.urlParams_, opts...)
  9120. res, err := c.doRequest("json")
  9121. if res != nil && res.StatusCode == http.StatusNotModified {
  9122. if res.Body != nil {
  9123. res.Body.Close()
  9124. }
  9125. return nil, &googleapi.Error{
  9126. Code: res.StatusCode,
  9127. Header: res.Header,
  9128. }
  9129. }
  9130. if err != nil {
  9131. return nil, err
  9132. }
  9133. defer googleapi.CloseBody(res)
  9134. if err := googleapi.CheckResponse(res); err != nil {
  9135. return nil, err
  9136. }
  9137. ret := &Operation{
  9138. ServerResponse: googleapi.ServerResponse{
  9139. Header: res.Header,
  9140. HTTPStatusCode: res.StatusCode,
  9141. },
  9142. }
  9143. target := &ret
  9144. if err := gensupport.DecodeResponse(target, res); err != nil {
  9145. return nil, err
  9146. }
  9147. return ret, nil
  9148. // {
  9149. // "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.",
  9150. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  9151. // "httpMethod": "POST",
  9152. // "id": "container.projects.zones.clusters.setMasterAuth",
  9153. // "parameterOrder": [
  9154. // "projectId",
  9155. // "zone",
  9156. // "clusterId"
  9157. // ],
  9158. // "parameters": {
  9159. // "clusterId": {
  9160. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9161. // "location": "path",
  9162. // "required": true,
  9163. // "type": "string"
  9164. // },
  9165. // "projectId": {
  9166. // "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.",
  9167. // "location": "path",
  9168. // "required": true,
  9169. // "type": "string"
  9170. // },
  9171. // "zone": {
  9172. // "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.",
  9173. // "location": "path",
  9174. // "required": true,
  9175. // "type": "string"
  9176. // }
  9177. // },
  9178. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth",
  9179. // "request": {
  9180. // "$ref": "SetMasterAuthRequest"
  9181. // },
  9182. // "response": {
  9183. // "$ref": "Operation"
  9184. // },
  9185. // "scopes": [
  9186. // "https://www.googleapis.com/auth/cloud-platform"
  9187. // ]
  9188. // }
  9189. }
  9190. // method id "container.projects.zones.clusters.setNetworkPolicy":
  9191. type ProjectsZonesClustersSetNetworkPolicyCall struct {
  9192. s *Service
  9193. projectId string
  9194. zone string
  9195. clusterId string
  9196. setnetworkpolicyrequest *SetNetworkPolicyRequest
  9197. urlParams_ gensupport.URLParams
  9198. ctx_ context.Context
  9199. header_ http.Header
  9200. }
  9201. // SetNetworkPolicy: Enables/Disables Network Policy for a cluster.
  9202. func (r *ProjectsZonesClustersService) SetNetworkPolicy(projectId string, zone string, clusterId string, setnetworkpolicyrequest *SetNetworkPolicyRequest) *ProjectsZonesClustersSetNetworkPolicyCall {
  9203. c := &ProjectsZonesClustersSetNetworkPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9204. c.projectId = projectId
  9205. c.zone = zone
  9206. c.clusterId = clusterId
  9207. c.setnetworkpolicyrequest = setnetworkpolicyrequest
  9208. return c
  9209. }
  9210. // Fields allows partial responses to be retrieved. See
  9211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9212. // for more information.
  9213. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersSetNetworkPolicyCall {
  9214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9215. return c
  9216. }
  9217. // Context sets the context to be used in this call's Do method. Any
  9218. // pending HTTP request will be aborted if the provided context is
  9219. // canceled.
  9220. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Context(ctx context.Context) *ProjectsZonesClustersSetNetworkPolicyCall {
  9221. c.ctx_ = ctx
  9222. return c
  9223. }
  9224. // Header returns an http.Header that can be modified by the caller to
  9225. // add HTTP headers to the request.
  9226. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Header() http.Header {
  9227. if c.header_ == nil {
  9228. c.header_ = make(http.Header)
  9229. }
  9230. return c.header_
  9231. }
  9232. func (c *ProjectsZonesClustersSetNetworkPolicyCall) doRequest(alt string) (*http.Response, error) {
  9233. reqHeaders := make(http.Header)
  9234. for k, v := range c.header_ {
  9235. reqHeaders[k] = v
  9236. }
  9237. reqHeaders.Set("User-Agent", c.s.userAgent())
  9238. var body io.Reader = nil
  9239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnetworkpolicyrequest)
  9240. if err != nil {
  9241. return nil, err
  9242. }
  9243. reqHeaders.Set("Content-Type", "application/json")
  9244. c.urlParams_.Set("alt", alt)
  9245. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy")
  9246. urls += "?" + c.urlParams_.Encode()
  9247. req, _ := http.NewRequest("POST", urls, body)
  9248. req.Header = reqHeaders
  9249. googleapi.Expand(req.URL, map[string]string{
  9250. "projectId": c.projectId,
  9251. "zone": c.zone,
  9252. "clusterId": c.clusterId,
  9253. })
  9254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9255. }
  9256. // Do executes the "container.projects.zones.clusters.setNetworkPolicy" call.
  9257. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9258. // status code is an error. Response headers are in either
  9259. // *Operation.ServerResponse.Header or (if a response was returned at
  9260. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9261. // to check whether the returned error was because
  9262. // http.StatusNotModified was returned.
  9263. func (c *ProjectsZonesClustersSetNetworkPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9264. gensupport.SetOptions(c.urlParams_, opts...)
  9265. res, err := c.doRequest("json")
  9266. if res != nil && res.StatusCode == http.StatusNotModified {
  9267. if res.Body != nil {
  9268. res.Body.Close()
  9269. }
  9270. return nil, &googleapi.Error{
  9271. Code: res.StatusCode,
  9272. Header: res.Header,
  9273. }
  9274. }
  9275. if err != nil {
  9276. return nil, err
  9277. }
  9278. defer googleapi.CloseBody(res)
  9279. if err := googleapi.CheckResponse(res); err != nil {
  9280. return nil, err
  9281. }
  9282. ret := &Operation{
  9283. ServerResponse: googleapi.ServerResponse{
  9284. Header: res.Header,
  9285. HTTPStatusCode: res.StatusCode,
  9286. },
  9287. }
  9288. target := &ret
  9289. if err := gensupport.DecodeResponse(target, res); err != nil {
  9290. return nil, err
  9291. }
  9292. return ret, nil
  9293. // {
  9294. // "description": "Enables/Disables Network Policy for a cluster.",
  9295. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  9296. // "httpMethod": "POST",
  9297. // "id": "container.projects.zones.clusters.setNetworkPolicy",
  9298. // "parameterOrder": [
  9299. // "projectId",
  9300. // "zone",
  9301. // "clusterId"
  9302. // ],
  9303. // "parameters": {
  9304. // "clusterId": {
  9305. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  9306. // "location": "path",
  9307. // "required": true,
  9308. // "type": "string"
  9309. // },
  9310. // "projectId": {
  9311. // "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.",
  9312. // "location": "path",
  9313. // "required": true,
  9314. // "type": "string"
  9315. // },
  9316. // "zone": {
  9317. // "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.",
  9318. // "location": "path",
  9319. // "required": true,
  9320. // "type": "string"
  9321. // }
  9322. // },
  9323. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy",
  9324. // "request": {
  9325. // "$ref": "SetNetworkPolicyRequest"
  9326. // },
  9327. // "response": {
  9328. // "$ref": "Operation"
  9329. // },
  9330. // "scopes": [
  9331. // "https://www.googleapis.com/auth/cloud-platform"
  9332. // ]
  9333. // }
  9334. }
  9335. // method id "container.projects.zones.clusters.startIpRotation":
  9336. type ProjectsZonesClustersStartIpRotationCall struct {
  9337. s *Service
  9338. projectId string
  9339. zone string
  9340. clusterId string
  9341. startiprotationrequest *StartIPRotationRequest
  9342. urlParams_ gensupport.URLParams
  9343. ctx_ context.Context
  9344. header_ http.Header
  9345. }
  9346. // StartIpRotation: Start master IP rotation.
  9347. func (r *ProjectsZonesClustersService) StartIpRotation(projectId string, zone string, clusterId string, startiprotationrequest *StartIPRotationRequest) *ProjectsZonesClustersStartIpRotationCall {
  9348. c := &ProjectsZonesClustersStartIpRotationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9349. c.projectId = projectId
  9350. c.zone = zone
  9351. c.clusterId = clusterId
  9352. c.startiprotationrequest = startiprotationrequest
  9353. return c
  9354. }
  9355. // Fields allows partial responses to be retrieved. See
  9356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9357. // for more information.
  9358. func (c *ProjectsZonesClustersStartIpRotationCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersStartIpRotationCall {
  9359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9360. return c
  9361. }
  9362. // Context sets the context to be used in this call's Do method. Any
  9363. // pending HTTP request will be aborted if the provided context is
  9364. // canceled.
  9365. func (c *ProjectsZonesClustersStartIpRotationCall) Context(ctx context.Context) *ProjectsZonesClustersStartIpRotationCall {
  9366. c.ctx_ = ctx
  9367. return c
  9368. }
  9369. // Header returns an http.Header that can be modified by the caller to
  9370. // add HTTP headers to the request.
  9371. func (c *ProjectsZonesClustersStartIpRotationCall) Header() http.Header {
  9372. if c.header_ == nil {
  9373. c.header_ = make(http.Header)
  9374. }
  9375. return c.header_
  9376. }
  9377. func (c *ProjectsZonesClustersStartIpRotationCall) doRequest(alt string) (*http.Response, error) {
  9378. reqHeaders := make(http.Header)
  9379. for k, v := range c.header_ {
  9380. reqHeaders[k] = v
  9381. }
  9382. reqHeaders.Set("User-Agent", c.s.userAgent())
  9383. var body io.Reader = nil
  9384. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startiprotationrequest)
  9385. if err != nil {
  9386. return nil, err
  9387. }
  9388. reqHeaders.Set("Content-Type", "application/json")
  9389. c.urlParams_.Set("alt", alt)
  9390. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation")
  9391. urls += "?" + c.urlParams_.Encode()
  9392. req, _ := http.NewRequest("POST", urls, body)
  9393. req.Header = reqHeaders
  9394. googleapi.Expand(req.URL, map[string]string{
  9395. "projectId": c.projectId,
  9396. "zone": c.zone,
  9397. "clusterId": c.clusterId,
  9398. })
  9399. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9400. }
  9401. // Do executes the "container.projects.zones.clusters.startIpRotation" call.
  9402. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9403. // status code is an error. Response headers are in either
  9404. // *Operation.ServerResponse.Header or (if a response was returned at
  9405. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9406. // to check whether the returned error was because
  9407. // http.StatusNotModified was returned.
  9408. func (c *ProjectsZonesClustersStartIpRotationCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9409. gensupport.SetOptions(c.urlParams_, opts...)
  9410. res, err := c.doRequest("json")
  9411. if res != nil && res.StatusCode == http.StatusNotModified {
  9412. if res.Body != nil {
  9413. res.Body.Close()
  9414. }
  9415. return nil, &googleapi.Error{
  9416. Code: res.StatusCode,
  9417. Header: res.Header,
  9418. }
  9419. }
  9420. if err != nil {
  9421. return nil, err
  9422. }
  9423. defer googleapi.CloseBody(res)
  9424. if err := googleapi.CheckResponse(res); err != nil {
  9425. return nil, err
  9426. }
  9427. ret := &Operation{
  9428. ServerResponse: googleapi.ServerResponse{
  9429. Header: res.Header,
  9430. HTTPStatusCode: res.StatusCode,
  9431. },
  9432. }
  9433. target := &ret
  9434. if err := gensupport.DecodeResponse(target, res); err != nil {
  9435. return nil, err
  9436. }
  9437. return ret, nil
  9438. // {
  9439. // "description": "Start master IP rotation.",
  9440. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  9441. // "httpMethod": "POST",
  9442. // "id": "container.projects.zones.clusters.startIpRotation",
  9443. // "parameterOrder": [
  9444. // "projectId",
  9445. // "zone",
  9446. // "clusterId"
  9447. // ],
  9448. // "parameters": {
  9449. // "clusterId": {
  9450. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  9451. // "location": "path",
  9452. // "required": true,
  9453. // "type": "string"
  9454. // },
  9455. // "projectId": {
  9456. // "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.",
  9457. // "location": "path",
  9458. // "required": true,
  9459. // "type": "string"
  9460. // },
  9461. // "zone": {
  9462. // "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.",
  9463. // "location": "path",
  9464. // "required": true,
  9465. // "type": "string"
  9466. // }
  9467. // },
  9468. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation",
  9469. // "request": {
  9470. // "$ref": "StartIPRotationRequest"
  9471. // },
  9472. // "response": {
  9473. // "$ref": "Operation"
  9474. // },
  9475. // "scopes": [
  9476. // "https://www.googleapis.com/auth/cloud-platform"
  9477. // ]
  9478. // }
  9479. }
  9480. // method id "container.projects.zones.clusters.update":
  9481. type ProjectsZonesClustersUpdateCall struct {
  9482. s *Service
  9483. projectId string
  9484. zone string
  9485. clusterId string
  9486. updateclusterrequest *UpdateClusterRequest
  9487. urlParams_ gensupport.URLParams
  9488. ctx_ context.Context
  9489. header_ http.Header
  9490. }
  9491. // Update: Updates the settings of a specific cluster.
  9492. func (r *ProjectsZonesClustersService) Update(projectId string, zone string, clusterId string, updateclusterrequest *UpdateClusterRequest) *ProjectsZonesClustersUpdateCall {
  9493. c := &ProjectsZonesClustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9494. c.projectId = projectId
  9495. c.zone = zone
  9496. c.clusterId = clusterId
  9497. c.updateclusterrequest = updateclusterrequest
  9498. return c
  9499. }
  9500. // Fields allows partial responses to be retrieved. See
  9501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9502. // for more information.
  9503. func (c *ProjectsZonesClustersUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersUpdateCall {
  9504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9505. return c
  9506. }
  9507. // Context sets the context to be used in this call's Do method. Any
  9508. // pending HTTP request will be aborted if the provided context is
  9509. // canceled.
  9510. func (c *ProjectsZonesClustersUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersUpdateCall {
  9511. c.ctx_ = ctx
  9512. return c
  9513. }
  9514. // Header returns an http.Header that can be modified by the caller to
  9515. // add HTTP headers to the request.
  9516. func (c *ProjectsZonesClustersUpdateCall) Header() http.Header {
  9517. if c.header_ == nil {
  9518. c.header_ = make(http.Header)
  9519. }
  9520. return c.header_
  9521. }
  9522. func (c *ProjectsZonesClustersUpdateCall) doRequest(alt string) (*http.Response, error) {
  9523. reqHeaders := make(http.Header)
  9524. for k, v := range c.header_ {
  9525. reqHeaders[k] = v
  9526. }
  9527. reqHeaders.Set("User-Agent", c.s.userAgent())
  9528. var body io.Reader = nil
  9529. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateclusterrequest)
  9530. if err != nil {
  9531. return nil, err
  9532. }
  9533. reqHeaders.Set("Content-Type", "application/json")
  9534. c.urlParams_.Set("alt", alt)
  9535. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}")
  9536. urls += "?" + c.urlParams_.Encode()
  9537. req, _ := http.NewRequest("PUT", urls, body)
  9538. req.Header = reqHeaders
  9539. googleapi.Expand(req.URL, map[string]string{
  9540. "projectId": c.projectId,
  9541. "zone": c.zone,
  9542. "clusterId": c.clusterId,
  9543. })
  9544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9545. }
  9546. // Do executes the "container.projects.zones.clusters.update" call.
  9547. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9548. // status code is an error. Response headers are in either
  9549. // *Operation.ServerResponse.Header or (if a response was returned at
  9550. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9551. // to check whether the returned error was because
  9552. // http.StatusNotModified was returned.
  9553. func (c *ProjectsZonesClustersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9554. gensupport.SetOptions(c.urlParams_, opts...)
  9555. res, err := c.doRequest("json")
  9556. if res != nil && res.StatusCode == http.StatusNotModified {
  9557. if res.Body != nil {
  9558. res.Body.Close()
  9559. }
  9560. return nil, &googleapi.Error{
  9561. Code: res.StatusCode,
  9562. Header: res.Header,
  9563. }
  9564. }
  9565. if err != nil {
  9566. return nil, err
  9567. }
  9568. defer googleapi.CloseBody(res)
  9569. if err := googleapi.CheckResponse(res); err != nil {
  9570. return nil, err
  9571. }
  9572. ret := &Operation{
  9573. ServerResponse: googleapi.ServerResponse{
  9574. Header: res.Header,
  9575. HTTPStatusCode: res.StatusCode,
  9576. },
  9577. }
  9578. target := &ret
  9579. if err := gensupport.DecodeResponse(target, res); err != nil {
  9580. return nil, err
  9581. }
  9582. return ret, nil
  9583. // {
  9584. // "description": "Updates the settings of a specific cluster.",
  9585. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9586. // "httpMethod": "PUT",
  9587. // "id": "container.projects.zones.clusters.update",
  9588. // "parameterOrder": [
  9589. // "projectId",
  9590. // "zone",
  9591. // "clusterId"
  9592. // ],
  9593. // "parameters": {
  9594. // "clusterId": {
  9595. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9596. // "location": "path",
  9597. // "required": true,
  9598. // "type": "string"
  9599. // },
  9600. // "projectId": {
  9601. // "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.",
  9602. // "location": "path",
  9603. // "required": true,
  9604. // "type": "string"
  9605. // },
  9606. // "zone": {
  9607. // "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.",
  9608. // "location": "path",
  9609. // "required": true,
  9610. // "type": "string"
  9611. // }
  9612. // },
  9613. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}",
  9614. // "request": {
  9615. // "$ref": "UpdateClusterRequest"
  9616. // },
  9617. // "response": {
  9618. // "$ref": "Operation"
  9619. // },
  9620. // "scopes": [
  9621. // "https://www.googleapis.com/auth/cloud-platform"
  9622. // ]
  9623. // }
  9624. }
  9625. // method id "container.projects.zones.clusters.nodePools.autoscaling":
  9626. type ProjectsZonesClustersNodePoolsAutoscalingCall struct {
  9627. s *Service
  9628. projectId string
  9629. zone string
  9630. clusterId string
  9631. nodePoolId string
  9632. setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest
  9633. urlParams_ gensupport.URLParams
  9634. ctx_ context.Context
  9635. header_ http.Header
  9636. }
  9637. // Autoscaling: Sets the autoscaling settings for a specific node pool.
  9638. func (r *ProjectsZonesClustersNodePoolsService) Autoscaling(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolautoscalingrequest *SetNodePoolAutoscalingRequest) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  9639. c := &ProjectsZonesClustersNodePoolsAutoscalingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9640. c.projectId = projectId
  9641. c.zone = zone
  9642. c.clusterId = clusterId
  9643. c.nodePoolId = nodePoolId
  9644. c.setnodepoolautoscalingrequest = setnodepoolautoscalingrequest
  9645. return c
  9646. }
  9647. // Fields allows partial responses to be retrieved. See
  9648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9649. // for more information.
  9650. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  9651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9652. return c
  9653. }
  9654. // Context sets the context to be used in this call's Do method. Any
  9655. // pending HTTP request will be aborted if the provided context is
  9656. // canceled.
  9657. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsAutoscalingCall {
  9658. c.ctx_ = ctx
  9659. return c
  9660. }
  9661. // Header returns an http.Header that can be modified by the caller to
  9662. // add HTTP headers to the request.
  9663. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Header() http.Header {
  9664. if c.header_ == nil {
  9665. c.header_ = make(http.Header)
  9666. }
  9667. return c.header_
  9668. }
  9669. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) doRequest(alt string) (*http.Response, error) {
  9670. reqHeaders := make(http.Header)
  9671. for k, v := range c.header_ {
  9672. reqHeaders[k] = v
  9673. }
  9674. reqHeaders.Set("User-Agent", c.s.userAgent())
  9675. var body io.Reader = nil
  9676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolautoscalingrequest)
  9677. if err != nil {
  9678. return nil, err
  9679. }
  9680. reqHeaders.Set("Content-Type", "application/json")
  9681. c.urlParams_.Set("alt", alt)
  9682. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling")
  9683. urls += "?" + c.urlParams_.Encode()
  9684. req, _ := http.NewRequest("POST", urls, body)
  9685. req.Header = reqHeaders
  9686. googleapi.Expand(req.URL, map[string]string{
  9687. "projectId": c.projectId,
  9688. "zone": c.zone,
  9689. "clusterId": c.clusterId,
  9690. "nodePoolId": c.nodePoolId,
  9691. })
  9692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9693. }
  9694. // Do executes the "container.projects.zones.clusters.nodePools.autoscaling" call.
  9695. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9696. // status code is an error. Response headers are in either
  9697. // *Operation.ServerResponse.Header or (if a response was returned at
  9698. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9699. // to check whether the returned error was because
  9700. // http.StatusNotModified was returned.
  9701. func (c *ProjectsZonesClustersNodePoolsAutoscalingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9702. gensupport.SetOptions(c.urlParams_, opts...)
  9703. res, err := c.doRequest("json")
  9704. if res != nil && res.StatusCode == http.StatusNotModified {
  9705. if res.Body != nil {
  9706. res.Body.Close()
  9707. }
  9708. return nil, &googleapi.Error{
  9709. Code: res.StatusCode,
  9710. Header: res.Header,
  9711. }
  9712. }
  9713. if err != nil {
  9714. return nil, err
  9715. }
  9716. defer googleapi.CloseBody(res)
  9717. if err := googleapi.CheckResponse(res); err != nil {
  9718. return nil, err
  9719. }
  9720. ret := &Operation{
  9721. ServerResponse: googleapi.ServerResponse{
  9722. Header: res.Header,
  9723. HTTPStatusCode: res.StatusCode,
  9724. },
  9725. }
  9726. target := &ret
  9727. if err := gensupport.DecodeResponse(target, res); err != nil {
  9728. return nil, err
  9729. }
  9730. return ret, nil
  9731. // {
  9732. // "description": "Sets the autoscaling settings for a specific node pool.",
  9733. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  9734. // "httpMethod": "POST",
  9735. // "id": "container.projects.zones.clusters.nodePools.autoscaling",
  9736. // "parameterOrder": [
  9737. // "projectId",
  9738. // "zone",
  9739. // "clusterId",
  9740. // "nodePoolId"
  9741. // ],
  9742. // "parameters": {
  9743. // "clusterId": {
  9744. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9745. // "location": "path",
  9746. // "required": true,
  9747. // "type": "string"
  9748. // },
  9749. // "nodePoolId": {
  9750. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  9751. // "location": "path",
  9752. // "required": true,
  9753. // "type": "string"
  9754. // },
  9755. // "projectId": {
  9756. // "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.",
  9757. // "location": "path",
  9758. // "required": true,
  9759. // "type": "string"
  9760. // },
  9761. // "zone": {
  9762. // "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.",
  9763. // "location": "path",
  9764. // "required": true,
  9765. // "type": "string"
  9766. // }
  9767. // },
  9768. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling",
  9769. // "request": {
  9770. // "$ref": "SetNodePoolAutoscalingRequest"
  9771. // },
  9772. // "response": {
  9773. // "$ref": "Operation"
  9774. // },
  9775. // "scopes": [
  9776. // "https://www.googleapis.com/auth/cloud-platform"
  9777. // ]
  9778. // }
  9779. }
  9780. // method id "container.projects.zones.clusters.nodePools.create":
  9781. type ProjectsZonesClustersNodePoolsCreateCall struct {
  9782. s *Service
  9783. projectId string
  9784. zone string
  9785. clusterId string
  9786. createnodepoolrequest *CreateNodePoolRequest
  9787. urlParams_ gensupport.URLParams
  9788. ctx_ context.Context
  9789. header_ http.Header
  9790. }
  9791. // Create: Creates a node pool for a cluster.
  9792. func (r *ProjectsZonesClustersNodePoolsService) Create(projectId string, zone string, clusterId string, createnodepoolrequest *CreateNodePoolRequest) *ProjectsZonesClustersNodePoolsCreateCall {
  9793. c := &ProjectsZonesClustersNodePoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9794. c.projectId = projectId
  9795. c.zone = zone
  9796. c.clusterId = clusterId
  9797. c.createnodepoolrequest = createnodepoolrequest
  9798. return c
  9799. }
  9800. // Fields allows partial responses to be retrieved. See
  9801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9802. // for more information.
  9803. func (c *ProjectsZonesClustersNodePoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsCreateCall {
  9804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9805. return c
  9806. }
  9807. // Context sets the context to be used in this call's Do method. Any
  9808. // pending HTTP request will be aborted if the provided context is
  9809. // canceled.
  9810. func (c *ProjectsZonesClustersNodePoolsCreateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsCreateCall {
  9811. c.ctx_ = ctx
  9812. return c
  9813. }
  9814. // Header returns an http.Header that can be modified by the caller to
  9815. // add HTTP headers to the request.
  9816. func (c *ProjectsZonesClustersNodePoolsCreateCall) Header() http.Header {
  9817. if c.header_ == nil {
  9818. c.header_ = make(http.Header)
  9819. }
  9820. return c.header_
  9821. }
  9822. func (c *ProjectsZonesClustersNodePoolsCreateCall) doRequest(alt string) (*http.Response, error) {
  9823. reqHeaders := make(http.Header)
  9824. for k, v := range c.header_ {
  9825. reqHeaders[k] = v
  9826. }
  9827. reqHeaders.Set("User-Agent", c.s.userAgent())
  9828. var body io.Reader = nil
  9829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createnodepoolrequest)
  9830. if err != nil {
  9831. return nil, err
  9832. }
  9833. reqHeaders.Set("Content-Type", "application/json")
  9834. c.urlParams_.Set("alt", alt)
  9835. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  9836. urls += "?" + c.urlParams_.Encode()
  9837. req, _ := http.NewRequest("POST", urls, body)
  9838. req.Header = reqHeaders
  9839. googleapi.Expand(req.URL, map[string]string{
  9840. "projectId": c.projectId,
  9841. "zone": c.zone,
  9842. "clusterId": c.clusterId,
  9843. })
  9844. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9845. }
  9846. // Do executes the "container.projects.zones.clusters.nodePools.create" call.
  9847. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9848. // status code is an error. Response headers are in either
  9849. // *Operation.ServerResponse.Header or (if a response was returned at
  9850. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9851. // to check whether the returned error was because
  9852. // http.StatusNotModified was returned.
  9853. func (c *ProjectsZonesClustersNodePoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9854. gensupport.SetOptions(c.urlParams_, opts...)
  9855. res, err := c.doRequest("json")
  9856. if res != nil && res.StatusCode == http.StatusNotModified {
  9857. if res.Body != nil {
  9858. res.Body.Close()
  9859. }
  9860. return nil, &googleapi.Error{
  9861. Code: res.StatusCode,
  9862. Header: res.Header,
  9863. }
  9864. }
  9865. if err != nil {
  9866. return nil, err
  9867. }
  9868. defer googleapi.CloseBody(res)
  9869. if err := googleapi.CheckResponse(res); err != nil {
  9870. return nil, err
  9871. }
  9872. ret := &Operation{
  9873. ServerResponse: googleapi.ServerResponse{
  9874. Header: res.Header,
  9875. HTTPStatusCode: res.StatusCode,
  9876. },
  9877. }
  9878. target := &ret
  9879. if err := gensupport.DecodeResponse(target, res); err != nil {
  9880. return nil, err
  9881. }
  9882. return ret, nil
  9883. // {
  9884. // "description": "Creates a node pool for a cluster.",
  9885. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  9886. // "httpMethod": "POST",
  9887. // "id": "container.projects.zones.clusters.nodePools.create",
  9888. // "parameterOrder": [
  9889. // "projectId",
  9890. // "zone",
  9891. // "clusterId"
  9892. // ],
  9893. // "parameters": {
  9894. // "clusterId": {
  9895. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  9896. // "location": "path",
  9897. // "required": true,
  9898. // "type": "string"
  9899. // },
  9900. // "projectId": {
  9901. // "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.",
  9902. // "location": "path",
  9903. // "required": true,
  9904. // "type": "string"
  9905. // },
  9906. // "zone": {
  9907. // "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.",
  9908. // "location": "path",
  9909. // "required": true,
  9910. // "type": "string"
  9911. // }
  9912. // },
  9913. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  9914. // "request": {
  9915. // "$ref": "CreateNodePoolRequest"
  9916. // },
  9917. // "response": {
  9918. // "$ref": "Operation"
  9919. // },
  9920. // "scopes": [
  9921. // "https://www.googleapis.com/auth/cloud-platform"
  9922. // ]
  9923. // }
  9924. }
  9925. // method id "container.projects.zones.clusters.nodePools.delete":
  9926. type ProjectsZonesClustersNodePoolsDeleteCall struct {
  9927. s *Service
  9928. projectId string
  9929. zone string
  9930. clusterId string
  9931. nodePoolId string
  9932. urlParams_ gensupport.URLParams
  9933. ctx_ context.Context
  9934. header_ http.Header
  9935. }
  9936. // Delete: Deletes a node pool from a cluster.
  9937. func (r *ProjectsZonesClustersNodePoolsService) Delete(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsDeleteCall {
  9938. c := &ProjectsZonesClustersNodePoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9939. c.projectId = projectId
  9940. c.zone = zone
  9941. c.clusterId = clusterId
  9942. c.nodePoolId = nodePoolId
  9943. return c
  9944. }
  9945. // Name sets the optional parameter "name": The name (project, location,
  9946. // cluster, node pool id) of the node pool to
  9947. // delete. Specified in the
  9948. // format
  9949. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  9950. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Name(name string) *ProjectsZonesClustersNodePoolsDeleteCall {
  9951. c.urlParams_.Set("name", name)
  9952. return c
  9953. }
  9954. // Fields allows partial responses to be retrieved. See
  9955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9956. // for more information.
  9957. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsDeleteCall {
  9958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9959. return c
  9960. }
  9961. // Context sets the context to be used in this call's Do method. Any
  9962. // pending HTTP request will be aborted if the provided context is
  9963. // canceled.
  9964. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsDeleteCall {
  9965. c.ctx_ = ctx
  9966. return c
  9967. }
  9968. // Header returns an http.Header that can be modified by the caller to
  9969. // add HTTP headers to the request.
  9970. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Header() http.Header {
  9971. if c.header_ == nil {
  9972. c.header_ = make(http.Header)
  9973. }
  9974. return c.header_
  9975. }
  9976. func (c *ProjectsZonesClustersNodePoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9977. reqHeaders := make(http.Header)
  9978. for k, v := range c.header_ {
  9979. reqHeaders[k] = v
  9980. }
  9981. reqHeaders.Set("User-Agent", c.s.userAgent())
  9982. var body io.Reader = nil
  9983. c.urlParams_.Set("alt", alt)
  9984. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  9985. urls += "?" + c.urlParams_.Encode()
  9986. req, _ := http.NewRequest("DELETE", urls, body)
  9987. req.Header = reqHeaders
  9988. googleapi.Expand(req.URL, map[string]string{
  9989. "projectId": c.projectId,
  9990. "zone": c.zone,
  9991. "clusterId": c.clusterId,
  9992. "nodePoolId": c.nodePoolId,
  9993. })
  9994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9995. }
  9996. // Do executes the "container.projects.zones.clusters.nodePools.delete" call.
  9997. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9998. // status code is an error. Response headers are in either
  9999. // *Operation.ServerResponse.Header or (if a response was returned at
  10000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10001. // to check whether the returned error was because
  10002. // http.StatusNotModified was returned.
  10003. func (c *ProjectsZonesClustersNodePoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10004. gensupport.SetOptions(c.urlParams_, opts...)
  10005. res, err := c.doRequest("json")
  10006. if res != nil && res.StatusCode == http.StatusNotModified {
  10007. if res.Body != nil {
  10008. res.Body.Close()
  10009. }
  10010. return nil, &googleapi.Error{
  10011. Code: res.StatusCode,
  10012. Header: res.Header,
  10013. }
  10014. }
  10015. if err != nil {
  10016. return nil, err
  10017. }
  10018. defer googleapi.CloseBody(res)
  10019. if err := googleapi.CheckResponse(res); err != nil {
  10020. return nil, err
  10021. }
  10022. ret := &Operation{
  10023. ServerResponse: googleapi.ServerResponse{
  10024. Header: res.Header,
  10025. HTTPStatusCode: res.StatusCode,
  10026. },
  10027. }
  10028. target := &ret
  10029. if err := gensupport.DecodeResponse(target, res); err != nil {
  10030. return nil, err
  10031. }
  10032. return ret, nil
  10033. // {
  10034. // "description": "Deletes a node pool from a cluster.",
  10035. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10036. // "httpMethod": "DELETE",
  10037. // "id": "container.projects.zones.clusters.nodePools.delete",
  10038. // "parameterOrder": [
  10039. // "projectId",
  10040. // "zone",
  10041. // "clusterId",
  10042. // "nodePoolId"
  10043. // ],
  10044. // "parameters": {
  10045. // "clusterId": {
  10046. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10047. // "location": "path",
  10048. // "required": true,
  10049. // "type": "string"
  10050. // },
  10051. // "name": {
  10052. // "description": "The name (project, location, cluster, node pool id) of the node pool to\ndelete. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  10053. // "location": "query",
  10054. // "type": "string"
  10055. // },
  10056. // "nodePoolId": {
  10057. // "description": "Deprecated. The name of the node pool to delete.\nThis field has been deprecated and replaced by the name field.",
  10058. // "location": "path",
  10059. // "required": true,
  10060. // "type": "string"
  10061. // },
  10062. // "projectId": {
  10063. // "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.",
  10064. // "location": "path",
  10065. // "required": true,
  10066. // "type": "string"
  10067. // },
  10068. // "zone": {
  10069. // "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.",
  10070. // "location": "path",
  10071. // "required": true,
  10072. // "type": "string"
  10073. // }
  10074. // },
  10075. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10076. // "response": {
  10077. // "$ref": "Operation"
  10078. // },
  10079. // "scopes": [
  10080. // "https://www.googleapis.com/auth/cloud-platform"
  10081. // ]
  10082. // }
  10083. }
  10084. // method id "container.projects.zones.clusters.nodePools.get":
  10085. type ProjectsZonesClustersNodePoolsGetCall struct {
  10086. s *Service
  10087. projectId string
  10088. zone string
  10089. clusterId string
  10090. nodePoolId string
  10091. urlParams_ gensupport.URLParams
  10092. ifNoneMatch_ string
  10093. ctx_ context.Context
  10094. header_ http.Header
  10095. }
  10096. // Get: Retrieves the node pool requested.
  10097. func (r *ProjectsZonesClustersNodePoolsService) Get(projectId string, zone string, clusterId string, nodePoolId string) *ProjectsZonesClustersNodePoolsGetCall {
  10098. c := &ProjectsZonesClustersNodePoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10099. c.projectId = projectId
  10100. c.zone = zone
  10101. c.clusterId = clusterId
  10102. c.nodePoolId = nodePoolId
  10103. return c
  10104. }
  10105. // Name sets the optional parameter "name": The name (project, location,
  10106. // cluster, node pool id) of the node pool to
  10107. // get. Specified in the
  10108. // format
  10109. // 'projects/*/locations/*/clusters/*/nodePools/*'.
  10110. func (c *ProjectsZonesClustersNodePoolsGetCall) Name(name string) *ProjectsZonesClustersNodePoolsGetCall {
  10111. c.urlParams_.Set("name", name)
  10112. return c
  10113. }
  10114. // Fields allows partial responses to be retrieved. See
  10115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10116. // for more information.
  10117. func (c *ProjectsZonesClustersNodePoolsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsGetCall {
  10118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10119. return c
  10120. }
  10121. // IfNoneMatch sets the optional parameter which makes the operation
  10122. // fail if the object's ETag matches the given value. This is useful for
  10123. // getting updates only after the object has changed since the last
  10124. // request. Use googleapi.IsNotModified to check whether the response
  10125. // error from Do is the result of In-None-Match.
  10126. func (c *ProjectsZonesClustersNodePoolsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsGetCall {
  10127. c.ifNoneMatch_ = entityTag
  10128. return c
  10129. }
  10130. // Context sets the context to be used in this call's Do method. Any
  10131. // pending HTTP request will be aborted if the provided context is
  10132. // canceled.
  10133. func (c *ProjectsZonesClustersNodePoolsGetCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsGetCall {
  10134. c.ctx_ = ctx
  10135. return c
  10136. }
  10137. // Header returns an http.Header that can be modified by the caller to
  10138. // add HTTP headers to the request.
  10139. func (c *ProjectsZonesClustersNodePoolsGetCall) Header() http.Header {
  10140. if c.header_ == nil {
  10141. c.header_ = make(http.Header)
  10142. }
  10143. return c.header_
  10144. }
  10145. func (c *ProjectsZonesClustersNodePoolsGetCall) doRequest(alt string) (*http.Response, error) {
  10146. reqHeaders := make(http.Header)
  10147. for k, v := range c.header_ {
  10148. reqHeaders[k] = v
  10149. }
  10150. reqHeaders.Set("User-Agent", c.s.userAgent())
  10151. if c.ifNoneMatch_ != "" {
  10152. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10153. }
  10154. var body io.Reader = nil
  10155. c.urlParams_.Set("alt", alt)
  10156. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}")
  10157. urls += "?" + c.urlParams_.Encode()
  10158. req, _ := http.NewRequest("GET", urls, body)
  10159. req.Header = reqHeaders
  10160. googleapi.Expand(req.URL, map[string]string{
  10161. "projectId": c.projectId,
  10162. "zone": c.zone,
  10163. "clusterId": c.clusterId,
  10164. "nodePoolId": c.nodePoolId,
  10165. })
  10166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10167. }
  10168. // Do executes the "container.projects.zones.clusters.nodePools.get" call.
  10169. // Exactly one of *NodePool or error will be non-nil. Any non-2xx status
  10170. // code is an error. Response headers are in either
  10171. // *NodePool.ServerResponse.Header or (if a response was returned at
  10172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10173. // to check whether the returned error was because
  10174. // http.StatusNotModified was returned.
  10175. func (c *ProjectsZonesClustersNodePoolsGetCall) Do(opts ...googleapi.CallOption) (*NodePool, error) {
  10176. gensupport.SetOptions(c.urlParams_, opts...)
  10177. res, err := c.doRequest("json")
  10178. if res != nil && res.StatusCode == http.StatusNotModified {
  10179. if res.Body != nil {
  10180. res.Body.Close()
  10181. }
  10182. return nil, &googleapi.Error{
  10183. Code: res.StatusCode,
  10184. Header: res.Header,
  10185. }
  10186. }
  10187. if err != nil {
  10188. return nil, err
  10189. }
  10190. defer googleapi.CloseBody(res)
  10191. if err := googleapi.CheckResponse(res); err != nil {
  10192. return nil, err
  10193. }
  10194. ret := &NodePool{
  10195. ServerResponse: googleapi.ServerResponse{
  10196. Header: res.Header,
  10197. HTTPStatusCode: res.StatusCode,
  10198. },
  10199. }
  10200. target := &ret
  10201. if err := gensupport.DecodeResponse(target, res); err != nil {
  10202. return nil, err
  10203. }
  10204. return ret, nil
  10205. // {
  10206. // "description": "Retrieves the node pool requested.",
  10207. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10208. // "httpMethod": "GET",
  10209. // "id": "container.projects.zones.clusters.nodePools.get",
  10210. // "parameterOrder": [
  10211. // "projectId",
  10212. // "zone",
  10213. // "clusterId",
  10214. // "nodePoolId"
  10215. // ],
  10216. // "parameters": {
  10217. // "clusterId": {
  10218. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the name field.",
  10219. // "location": "path",
  10220. // "required": true,
  10221. // "type": "string"
  10222. // },
  10223. // "name": {
  10224. // "description": "The name (project, location, cluster, node pool id) of the node pool to\nget. Specified in the format\n'projects/*/locations/*/clusters/*/nodePools/*'.",
  10225. // "location": "query",
  10226. // "type": "string"
  10227. // },
  10228. // "nodePoolId": {
  10229. // "description": "Deprecated. The name of the node pool.\nThis field has been deprecated and replaced by the name field.",
  10230. // "location": "path",
  10231. // "required": true,
  10232. // "type": "string"
  10233. // },
  10234. // "projectId": {
  10235. // "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.",
  10236. // "location": "path",
  10237. // "required": true,
  10238. // "type": "string"
  10239. // },
  10240. // "zone": {
  10241. // "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.",
  10242. // "location": "path",
  10243. // "required": true,
  10244. // "type": "string"
  10245. // }
  10246. // },
  10247. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}",
  10248. // "response": {
  10249. // "$ref": "NodePool"
  10250. // },
  10251. // "scopes": [
  10252. // "https://www.googleapis.com/auth/cloud-platform"
  10253. // ]
  10254. // }
  10255. }
  10256. // method id "container.projects.zones.clusters.nodePools.list":
  10257. type ProjectsZonesClustersNodePoolsListCall struct {
  10258. s *Service
  10259. projectId string
  10260. zone string
  10261. clusterId string
  10262. urlParams_ gensupport.URLParams
  10263. ifNoneMatch_ string
  10264. ctx_ context.Context
  10265. header_ http.Header
  10266. }
  10267. // List: Lists the node pools for a cluster.
  10268. func (r *ProjectsZonesClustersNodePoolsService) List(projectId string, zone string, clusterId string) *ProjectsZonesClustersNodePoolsListCall {
  10269. c := &ProjectsZonesClustersNodePoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10270. c.projectId = projectId
  10271. c.zone = zone
  10272. c.clusterId = clusterId
  10273. return c
  10274. }
  10275. // Parent sets the optional parameter "parent": The parent (project,
  10276. // location, cluster id) where the node pools will be
  10277. // listed. Specified in the format 'projects/*/locations/*/clusters/*'.
  10278. func (c *ProjectsZonesClustersNodePoolsListCall) Parent(parent string) *ProjectsZonesClustersNodePoolsListCall {
  10279. c.urlParams_.Set("parent", parent)
  10280. return c
  10281. }
  10282. // Fields allows partial responses to be retrieved. See
  10283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10284. // for more information.
  10285. func (c *ProjectsZonesClustersNodePoolsListCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsListCall {
  10286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10287. return c
  10288. }
  10289. // IfNoneMatch sets the optional parameter which makes the operation
  10290. // fail if the object's ETag matches the given value. This is useful for
  10291. // getting updates only after the object has changed since the last
  10292. // request. Use googleapi.IsNotModified to check whether the response
  10293. // error from Do is the result of In-None-Match.
  10294. func (c *ProjectsZonesClustersNodePoolsListCall) IfNoneMatch(entityTag string) *ProjectsZonesClustersNodePoolsListCall {
  10295. c.ifNoneMatch_ = entityTag
  10296. return c
  10297. }
  10298. // Context sets the context to be used in this call's Do method. Any
  10299. // pending HTTP request will be aborted if the provided context is
  10300. // canceled.
  10301. func (c *ProjectsZonesClustersNodePoolsListCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsListCall {
  10302. c.ctx_ = ctx
  10303. return c
  10304. }
  10305. // Header returns an http.Header that can be modified by the caller to
  10306. // add HTTP headers to the request.
  10307. func (c *ProjectsZonesClustersNodePoolsListCall) Header() http.Header {
  10308. if c.header_ == nil {
  10309. c.header_ = make(http.Header)
  10310. }
  10311. return c.header_
  10312. }
  10313. func (c *ProjectsZonesClustersNodePoolsListCall) doRequest(alt string) (*http.Response, error) {
  10314. reqHeaders := make(http.Header)
  10315. for k, v := range c.header_ {
  10316. reqHeaders[k] = v
  10317. }
  10318. reqHeaders.Set("User-Agent", c.s.userAgent())
  10319. if c.ifNoneMatch_ != "" {
  10320. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10321. }
  10322. var body io.Reader = nil
  10323. c.urlParams_.Set("alt", alt)
  10324. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools")
  10325. urls += "?" + c.urlParams_.Encode()
  10326. req, _ := http.NewRequest("GET", urls, body)
  10327. req.Header = reqHeaders
  10328. googleapi.Expand(req.URL, map[string]string{
  10329. "projectId": c.projectId,
  10330. "zone": c.zone,
  10331. "clusterId": c.clusterId,
  10332. })
  10333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10334. }
  10335. // Do executes the "container.projects.zones.clusters.nodePools.list" call.
  10336. // Exactly one of *ListNodePoolsResponse or error will be non-nil. Any
  10337. // non-2xx status code is an error. Response headers are in either
  10338. // *ListNodePoolsResponse.ServerResponse.Header or (if a response was
  10339. // returned at all) in error.(*googleapi.Error).Header. Use
  10340. // googleapi.IsNotModified to check whether the returned error was
  10341. // because http.StatusNotModified was returned.
  10342. func (c *ProjectsZonesClustersNodePoolsListCall) Do(opts ...googleapi.CallOption) (*ListNodePoolsResponse, error) {
  10343. gensupport.SetOptions(c.urlParams_, opts...)
  10344. res, err := c.doRequest("json")
  10345. if res != nil && res.StatusCode == http.StatusNotModified {
  10346. if res.Body != nil {
  10347. res.Body.Close()
  10348. }
  10349. return nil, &googleapi.Error{
  10350. Code: res.StatusCode,
  10351. Header: res.Header,
  10352. }
  10353. }
  10354. if err != nil {
  10355. return nil, err
  10356. }
  10357. defer googleapi.CloseBody(res)
  10358. if err := googleapi.CheckResponse(res); err != nil {
  10359. return nil, err
  10360. }
  10361. ret := &ListNodePoolsResponse{
  10362. ServerResponse: googleapi.ServerResponse{
  10363. Header: res.Header,
  10364. HTTPStatusCode: res.StatusCode,
  10365. },
  10366. }
  10367. target := &ret
  10368. if err := gensupport.DecodeResponse(target, res); err != nil {
  10369. return nil, err
  10370. }
  10371. return ret, nil
  10372. // {
  10373. // "description": "Lists the node pools for a cluster.",
  10374. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10375. // "httpMethod": "GET",
  10376. // "id": "container.projects.zones.clusters.nodePools.list",
  10377. // "parameterOrder": [
  10378. // "projectId",
  10379. // "zone",
  10380. // "clusterId"
  10381. // ],
  10382. // "parameters": {
  10383. // "clusterId": {
  10384. // "description": "Deprecated. The name of the cluster.\nThis field has been deprecated and replaced by the parent field.",
  10385. // "location": "path",
  10386. // "required": true,
  10387. // "type": "string"
  10388. // },
  10389. // "parent": {
  10390. // "description": "The parent (project, location, cluster id) where the node pools will be\nlisted. Specified in the format 'projects/*/locations/*/clusters/*'.",
  10391. // "location": "query",
  10392. // "type": "string"
  10393. // },
  10394. // "projectId": {
  10395. // "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.",
  10396. // "location": "path",
  10397. // "required": true,
  10398. // "type": "string"
  10399. // },
  10400. // "zone": {
  10401. // "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.",
  10402. // "location": "path",
  10403. // "required": true,
  10404. // "type": "string"
  10405. // }
  10406. // },
  10407. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools",
  10408. // "response": {
  10409. // "$ref": "ListNodePoolsResponse"
  10410. // },
  10411. // "scopes": [
  10412. // "https://www.googleapis.com/auth/cloud-platform"
  10413. // ]
  10414. // }
  10415. }
  10416. // method id "container.projects.zones.clusters.nodePools.rollback":
  10417. type ProjectsZonesClustersNodePoolsRollbackCall struct {
  10418. s *Service
  10419. projectId string
  10420. zone string
  10421. clusterId string
  10422. nodePoolId string
  10423. rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest
  10424. urlParams_ gensupport.URLParams
  10425. ctx_ context.Context
  10426. header_ http.Header
  10427. }
  10428. // Rollback: Roll back the previously Aborted or Failed NodePool
  10429. // upgrade.
  10430. // This will be an no-op if the last upgrade successfully completed.
  10431. func (r *ProjectsZonesClustersNodePoolsService) Rollback(projectId string, zone string, clusterId string, nodePoolId string, rollbacknodepoolupgraderequest *RollbackNodePoolUpgradeRequest) *ProjectsZonesClustersNodePoolsRollbackCall {
  10432. c := &ProjectsZonesClustersNodePoolsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10433. c.projectId = projectId
  10434. c.zone = zone
  10435. c.clusterId = clusterId
  10436. c.nodePoolId = nodePoolId
  10437. c.rollbacknodepoolupgraderequest = rollbacknodepoolupgraderequest
  10438. return c
  10439. }
  10440. // Fields allows partial responses to be retrieved. See
  10441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10442. // for more information.
  10443. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsRollbackCall {
  10444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10445. return c
  10446. }
  10447. // Context sets the context to be used in this call's Do method. Any
  10448. // pending HTTP request will be aborted if the provided context is
  10449. // canceled.
  10450. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsRollbackCall {
  10451. c.ctx_ = ctx
  10452. return c
  10453. }
  10454. // Header returns an http.Header that can be modified by the caller to
  10455. // add HTTP headers to the request.
  10456. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Header() http.Header {
  10457. if c.header_ == nil {
  10458. c.header_ = make(http.Header)
  10459. }
  10460. return c.header_
  10461. }
  10462. func (c *ProjectsZonesClustersNodePoolsRollbackCall) doRequest(alt string) (*http.Response, error) {
  10463. reqHeaders := make(http.Header)
  10464. for k, v := range c.header_ {
  10465. reqHeaders[k] = v
  10466. }
  10467. reqHeaders.Set("User-Agent", c.s.userAgent())
  10468. var body io.Reader = nil
  10469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbacknodepoolupgraderequest)
  10470. if err != nil {
  10471. return nil, err
  10472. }
  10473. reqHeaders.Set("Content-Type", "application/json")
  10474. c.urlParams_.Set("alt", alt)
  10475. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback")
  10476. urls += "?" + c.urlParams_.Encode()
  10477. req, _ := http.NewRequest("POST", urls, body)
  10478. req.Header = reqHeaders
  10479. googleapi.Expand(req.URL, map[string]string{
  10480. "projectId": c.projectId,
  10481. "zone": c.zone,
  10482. "clusterId": c.clusterId,
  10483. "nodePoolId": c.nodePoolId,
  10484. })
  10485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10486. }
  10487. // Do executes the "container.projects.zones.clusters.nodePools.rollback" call.
  10488. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10489. // status code is an error. Response headers are in either
  10490. // *Operation.ServerResponse.Header or (if a response was returned at
  10491. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10492. // to check whether the returned error was because
  10493. // http.StatusNotModified was returned.
  10494. func (c *ProjectsZonesClustersNodePoolsRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10495. gensupport.SetOptions(c.urlParams_, opts...)
  10496. res, err := c.doRequest("json")
  10497. if res != nil && res.StatusCode == http.StatusNotModified {
  10498. if res.Body != nil {
  10499. res.Body.Close()
  10500. }
  10501. return nil, &googleapi.Error{
  10502. Code: res.StatusCode,
  10503. Header: res.Header,
  10504. }
  10505. }
  10506. if err != nil {
  10507. return nil, err
  10508. }
  10509. defer googleapi.CloseBody(res)
  10510. if err := googleapi.CheckResponse(res); err != nil {
  10511. return nil, err
  10512. }
  10513. ret := &Operation{
  10514. ServerResponse: googleapi.ServerResponse{
  10515. Header: res.Header,
  10516. HTTPStatusCode: res.StatusCode,
  10517. },
  10518. }
  10519. target := &ret
  10520. if err := gensupport.DecodeResponse(target, res); err != nil {
  10521. return nil, err
  10522. }
  10523. return ret, nil
  10524. // {
  10525. // "description": "Roll back the previously Aborted or Failed NodePool upgrade.\nThis will be an no-op if the last upgrade successfully completed.",
  10526. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  10527. // "httpMethod": "POST",
  10528. // "id": "container.projects.zones.clusters.nodePools.rollback",
  10529. // "parameterOrder": [
  10530. // "projectId",
  10531. // "zone",
  10532. // "clusterId",
  10533. // "nodePoolId"
  10534. // ],
  10535. // "parameters": {
  10536. // "clusterId": {
  10537. // "description": "Deprecated. The name of the cluster to rollback.\nThis field has been deprecated and replaced by the name field.",
  10538. // "location": "path",
  10539. // "required": true,
  10540. // "type": "string"
  10541. // },
  10542. // "nodePoolId": {
  10543. // "description": "Deprecated. The name of the node pool to rollback.\nThis field has been deprecated and replaced by the name field.",
  10544. // "location": "path",
  10545. // "required": true,
  10546. // "type": "string"
  10547. // },
  10548. // "projectId": {
  10549. // "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.",
  10550. // "location": "path",
  10551. // "required": true,
  10552. // "type": "string"
  10553. // },
  10554. // "zone": {
  10555. // "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.",
  10556. // "location": "path",
  10557. // "required": true,
  10558. // "type": "string"
  10559. // }
  10560. // },
  10561. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback",
  10562. // "request": {
  10563. // "$ref": "RollbackNodePoolUpgradeRequest"
  10564. // },
  10565. // "response": {
  10566. // "$ref": "Operation"
  10567. // },
  10568. // "scopes": [
  10569. // "https://www.googleapis.com/auth/cloud-platform"
  10570. // ]
  10571. // }
  10572. }
  10573. // method id "container.projects.zones.clusters.nodePools.setManagement":
  10574. type ProjectsZonesClustersNodePoolsSetManagementCall struct {
  10575. s *Service
  10576. projectId string
  10577. zone string
  10578. clusterId string
  10579. nodePoolId string
  10580. setnodepoolmanagementrequest *SetNodePoolManagementRequest
  10581. urlParams_ gensupport.URLParams
  10582. ctx_ context.Context
  10583. header_ http.Header
  10584. }
  10585. // SetManagement: Sets the NodeManagement options for a node pool.
  10586. func (r *ProjectsZonesClustersNodePoolsService) SetManagement(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolmanagementrequest *SetNodePoolManagementRequest) *ProjectsZonesClustersNodePoolsSetManagementCall {
  10587. c := &ProjectsZonesClustersNodePoolsSetManagementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10588. c.projectId = projectId
  10589. c.zone = zone
  10590. c.clusterId = clusterId
  10591. c.nodePoolId = nodePoolId
  10592. c.setnodepoolmanagementrequest = setnodepoolmanagementrequest
  10593. return c
  10594. }
  10595. // Fields allows partial responses to be retrieved. See
  10596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10597. // for more information.
  10598. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetManagementCall {
  10599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10600. return c
  10601. }
  10602. // Context sets the context to be used in this call's Do method. Any
  10603. // pending HTTP request will be aborted if the provided context is
  10604. // canceled.
  10605. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetManagementCall {
  10606. c.ctx_ = ctx
  10607. return c
  10608. }
  10609. // Header returns an http.Header that can be modified by the caller to
  10610. // add HTTP headers to the request.
  10611. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Header() http.Header {
  10612. if c.header_ == nil {
  10613. c.header_ = make(http.Header)
  10614. }
  10615. return c.header_
  10616. }
  10617. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) doRequest(alt string) (*http.Response, error) {
  10618. reqHeaders := make(http.Header)
  10619. for k, v := range c.header_ {
  10620. reqHeaders[k] = v
  10621. }
  10622. reqHeaders.Set("User-Agent", c.s.userAgent())
  10623. var body io.Reader = nil
  10624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolmanagementrequest)
  10625. if err != nil {
  10626. return nil, err
  10627. }
  10628. reqHeaders.Set("Content-Type", "application/json")
  10629. c.urlParams_.Set("alt", alt)
  10630. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement")
  10631. urls += "?" + c.urlParams_.Encode()
  10632. req, _ := http.NewRequest("POST", urls, body)
  10633. req.Header = reqHeaders
  10634. googleapi.Expand(req.URL, map[string]string{
  10635. "projectId": c.projectId,
  10636. "zone": c.zone,
  10637. "clusterId": c.clusterId,
  10638. "nodePoolId": c.nodePoolId,
  10639. })
  10640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10641. }
  10642. // Do executes the "container.projects.zones.clusters.nodePools.setManagement" call.
  10643. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10644. // status code is an error. Response headers are in either
  10645. // *Operation.ServerResponse.Header or (if a response was returned at
  10646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10647. // to check whether the returned error was because
  10648. // http.StatusNotModified was returned.
  10649. func (c *ProjectsZonesClustersNodePoolsSetManagementCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10650. gensupport.SetOptions(c.urlParams_, opts...)
  10651. res, err := c.doRequest("json")
  10652. if res != nil && res.StatusCode == http.StatusNotModified {
  10653. if res.Body != nil {
  10654. res.Body.Close()
  10655. }
  10656. return nil, &googleapi.Error{
  10657. Code: res.StatusCode,
  10658. Header: res.Header,
  10659. }
  10660. }
  10661. if err != nil {
  10662. return nil, err
  10663. }
  10664. defer googleapi.CloseBody(res)
  10665. if err := googleapi.CheckResponse(res); err != nil {
  10666. return nil, err
  10667. }
  10668. ret := &Operation{
  10669. ServerResponse: googleapi.ServerResponse{
  10670. Header: res.Header,
  10671. HTTPStatusCode: res.StatusCode,
  10672. },
  10673. }
  10674. target := &ret
  10675. if err := gensupport.DecodeResponse(target, res); err != nil {
  10676. return nil, err
  10677. }
  10678. return ret, nil
  10679. // {
  10680. // "description": "Sets the NodeManagement options for a node pool.",
  10681. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  10682. // "httpMethod": "POST",
  10683. // "id": "container.projects.zones.clusters.nodePools.setManagement",
  10684. // "parameterOrder": [
  10685. // "projectId",
  10686. // "zone",
  10687. // "clusterId",
  10688. // "nodePoolId"
  10689. // ],
  10690. // "parameters": {
  10691. // "clusterId": {
  10692. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  10693. // "location": "path",
  10694. // "required": true,
  10695. // "type": "string"
  10696. // },
  10697. // "nodePoolId": {
  10698. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  10699. // "location": "path",
  10700. // "required": true,
  10701. // "type": "string"
  10702. // },
  10703. // "projectId": {
  10704. // "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.",
  10705. // "location": "path",
  10706. // "required": true,
  10707. // "type": "string"
  10708. // },
  10709. // "zone": {
  10710. // "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.",
  10711. // "location": "path",
  10712. // "required": true,
  10713. // "type": "string"
  10714. // }
  10715. // },
  10716. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement",
  10717. // "request": {
  10718. // "$ref": "SetNodePoolManagementRequest"
  10719. // },
  10720. // "response": {
  10721. // "$ref": "Operation"
  10722. // },
  10723. // "scopes": [
  10724. // "https://www.googleapis.com/auth/cloud-platform"
  10725. // ]
  10726. // }
  10727. }
  10728. // method id "container.projects.zones.clusters.nodePools.setSize":
  10729. type ProjectsZonesClustersNodePoolsSetSizeCall struct {
  10730. s *Service
  10731. projectId string
  10732. zone string
  10733. clusterId string
  10734. nodePoolId string
  10735. setnodepoolsizerequest *SetNodePoolSizeRequest
  10736. urlParams_ gensupport.URLParams
  10737. ctx_ context.Context
  10738. header_ http.Header
  10739. }
  10740. // SetSize: Sets the size for a specific node pool.
  10741. func (r *ProjectsZonesClustersNodePoolsService) SetSize(projectId string, zone string, clusterId string, nodePoolId string, setnodepoolsizerequest *SetNodePoolSizeRequest) *ProjectsZonesClustersNodePoolsSetSizeCall {
  10742. c := &ProjectsZonesClustersNodePoolsSetSizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10743. c.projectId = projectId
  10744. c.zone = zone
  10745. c.clusterId = clusterId
  10746. c.nodePoolId = nodePoolId
  10747. c.setnodepoolsizerequest = setnodepoolsizerequest
  10748. return c
  10749. }
  10750. // Fields allows partial responses to be retrieved. See
  10751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10752. // for more information.
  10753. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsSetSizeCall {
  10754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10755. return c
  10756. }
  10757. // Context sets the context to be used in this call's Do method. Any
  10758. // pending HTTP request will be aborted if the provided context is
  10759. // canceled.
  10760. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsSetSizeCall {
  10761. c.ctx_ = ctx
  10762. return c
  10763. }
  10764. // Header returns an http.Header that can be modified by the caller to
  10765. // add HTTP headers to the request.
  10766. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Header() http.Header {
  10767. if c.header_ == nil {
  10768. c.header_ = make(http.Header)
  10769. }
  10770. return c.header_
  10771. }
  10772. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) doRequest(alt string) (*http.Response, error) {
  10773. reqHeaders := make(http.Header)
  10774. for k, v := range c.header_ {
  10775. reqHeaders[k] = v
  10776. }
  10777. reqHeaders.Set("User-Agent", c.s.userAgent())
  10778. var body io.Reader = nil
  10779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setnodepoolsizerequest)
  10780. if err != nil {
  10781. return nil, err
  10782. }
  10783. reqHeaders.Set("Content-Type", "application/json")
  10784. c.urlParams_.Set("alt", alt)
  10785. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize")
  10786. urls += "?" + c.urlParams_.Encode()
  10787. req, _ := http.NewRequest("POST", urls, body)
  10788. req.Header = reqHeaders
  10789. googleapi.Expand(req.URL, map[string]string{
  10790. "projectId": c.projectId,
  10791. "zone": c.zone,
  10792. "clusterId": c.clusterId,
  10793. "nodePoolId": c.nodePoolId,
  10794. })
  10795. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10796. }
  10797. // Do executes the "container.projects.zones.clusters.nodePools.setSize" call.
  10798. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10799. // status code is an error. Response headers are in either
  10800. // *Operation.ServerResponse.Header or (if a response was returned at
  10801. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10802. // to check whether the returned error was because
  10803. // http.StatusNotModified was returned.
  10804. func (c *ProjectsZonesClustersNodePoolsSetSizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10805. gensupport.SetOptions(c.urlParams_, opts...)
  10806. res, err := c.doRequest("json")
  10807. if res != nil && res.StatusCode == http.StatusNotModified {
  10808. if res.Body != nil {
  10809. res.Body.Close()
  10810. }
  10811. return nil, &googleapi.Error{
  10812. Code: res.StatusCode,
  10813. Header: res.Header,
  10814. }
  10815. }
  10816. if err != nil {
  10817. return nil, err
  10818. }
  10819. defer googleapi.CloseBody(res)
  10820. if err := googleapi.CheckResponse(res); err != nil {
  10821. return nil, err
  10822. }
  10823. ret := &Operation{
  10824. ServerResponse: googleapi.ServerResponse{
  10825. Header: res.Header,
  10826. HTTPStatusCode: res.StatusCode,
  10827. },
  10828. }
  10829. target := &ret
  10830. if err := gensupport.DecodeResponse(target, res); err != nil {
  10831. return nil, err
  10832. }
  10833. return ret, nil
  10834. // {
  10835. // "description": "Sets the size for a specific node pool.",
  10836. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  10837. // "httpMethod": "POST",
  10838. // "id": "container.projects.zones.clusters.nodePools.setSize",
  10839. // "parameterOrder": [
  10840. // "projectId",
  10841. // "zone",
  10842. // "clusterId",
  10843. // "nodePoolId"
  10844. // ],
  10845. // "parameters": {
  10846. // "clusterId": {
  10847. // "description": "Deprecated. The name of the cluster to update.\nThis field has been deprecated and replaced by the name field.",
  10848. // "location": "path",
  10849. // "required": true,
  10850. // "type": "string"
  10851. // },
  10852. // "nodePoolId": {
  10853. // "description": "Deprecated. The name of the node pool to update.\nThis field has been deprecated and replaced by the name field.",
  10854. // "location": "path",
  10855. // "required": true,
  10856. // "type": "string"
  10857. // },
  10858. // "projectId": {
  10859. // "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.",
  10860. // "location": "path",
  10861. // "required": true,
  10862. // "type": "string"
  10863. // },
  10864. // "zone": {
  10865. // "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.",
  10866. // "location": "path",
  10867. // "required": true,
  10868. // "type": "string"
  10869. // }
  10870. // },
  10871. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize",
  10872. // "request": {
  10873. // "$ref": "SetNodePoolSizeRequest"
  10874. // },
  10875. // "response": {
  10876. // "$ref": "Operation"
  10877. // },
  10878. // "scopes": [
  10879. // "https://www.googleapis.com/auth/cloud-platform"
  10880. // ]
  10881. // }
  10882. }
  10883. // method id "container.projects.zones.clusters.nodePools.update":
  10884. type ProjectsZonesClustersNodePoolsUpdateCall struct {
  10885. s *Service
  10886. projectId string
  10887. zone string
  10888. clusterId string
  10889. nodePoolId string
  10890. updatenodepoolrequest *UpdateNodePoolRequest
  10891. urlParams_ gensupport.URLParams
  10892. ctx_ context.Context
  10893. header_ http.Header
  10894. }
  10895. // Update: Updates the version and/or image type for a specific node
  10896. // pool.
  10897. func (r *ProjectsZonesClustersNodePoolsService) Update(projectId string, zone string, clusterId string, nodePoolId string, updatenodepoolrequest *UpdateNodePoolRequest) *ProjectsZonesClustersNodePoolsUpdateCall {
  10898. c := &ProjectsZonesClustersNodePoolsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10899. c.projectId = projectId
  10900. c.zone = zone
  10901. c.clusterId = clusterId
  10902. c.nodePoolId = nodePoolId
  10903. c.updatenodepoolrequest = updatenodepoolrequest
  10904. return c
  10905. }
  10906. // Fields allows partial responses to be retrieved. See
  10907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10908. // for more information.
  10909. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Fields(s ...googleapi.Field) *ProjectsZonesClustersNodePoolsUpdateCall {
  10910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10911. return c
  10912. }
  10913. // Context sets the context to be used in this call's Do method. Any
  10914. // pending HTTP request will be aborted if the provided context is
  10915. // canceled.
  10916. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Context(ctx context.Context) *ProjectsZonesClustersNodePoolsUpdateCall {
  10917. c.ctx_ = ctx
  10918. return c
  10919. }
  10920. // Header returns an http.Header that can be modified by the caller to
  10921. // add HTTP headers to the request.
  10922. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Header() http.Header {
  10923. if c.header_ == nil {
  10924. c.header_ = make(http.Header)
  10925. }
  10926. return c.header_
  10927. }
  10928. func (c *ProjectsZonesClustersNodePoolsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10929. reqHeaders := make(http.Header)
  10930. for k, v := range c.header_ {
  10931. reqHeaders[k] = v
  10932. }
  10933. reqHeaders.Set("User-Agent", c.s.userAgent())
  10934. var body io.Reader = nil
  10935. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatenodepoolrequest)
  10936. if err != nil {
  10937. return nil, err
  10938. }
  10939. reqHeaders.Set("Content-Type", "application/json")
  10940. c.urlParams_.Set("alt", alt)
  10941. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update")
  10942. urls += "?" + c.urlParams_.Encode()
  10943. req, _ := http.NewRequest("POST", urls, body)
  10944. req.Header = reqHeaders
  10945. googleapi.Expand(req.URL, map[string]string{
  10946. "projectId": c.projectId,
  10947. "zone": c.zone,
  10948. "clusterId": c.clusterId,
  10949. "nodePoolId": c.nodePoolId,
  10950. })
  10951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10952. }
  10953. // Do executes the "container.projects.zones.clusters.nodePools.update" call.
  10954. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10955. // status code is an error. Response headers are in either
  10956. // *Operation.ServerResponse.Header or (if a response was returned at
  10957. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10958. // to check whether the returned error was because
  10959. // http.StatusNotModified was returned.
  10960. func (c *ProjectsZonesClustersNodePoolsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10961. gensupport.SetOptions(c.urlParams_, opts...)
  10962. res, err := c.doRequest("json")
  10963. if res != nil && res.StatusCode == http.StatusNotModified {
  10964. if res.Body != nil {
  10965. res.Body.Close()
  10966. }
  10967. return nil, &googleapi.Error{
  10968. Code: res.StatusCode,
  10969. Header: res.Header,
  10970. }
  10971. }
  10972. if err != nil {
  10973. return nil, err
  10974. }
  10975. defer googleapi.CloseBody(res)
  10976. if err := googleapi.CheckResponse(res); err != nil {
  10977. return nil, err
  10978. }
  10979. ret := &Operation{
  10980. ServerResponse: googleapi.ServerResponse{
  10981. Header: res.Header,
  10982. HTTPStatusCode: res.StatusCode,
  10983. },
  10984. }
  10985. target := &ret
  10986. if err := gensupport.DecodeResponse(target, res); err != nil {
  10987. return nil, err
  10988. }
  10989. return ret, nil
  10990. // {
  10991. // "description": "Updates the version and/or image type for a specific node pool.",
  10992. // "flatPath": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  10993. // "httpMethod": "POST",
  10994. // "id": "container.projects.zones.clusters.nodePools.update",
  10995. // "parameterOrder": [
  10996. // "projectId",
  10997. // "zone",
  10998. // "clusterId",
  10999. // "nodePoolId"
  11000. // ],
  11001. // "parameters": {
  11002. // "clusterId": {
  11003. // "description": "Deprecated. The name of the cluster to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11004. // "location": "path",
  11005. // "required": true,
  11006. // "type": "string"
  11007. // },
  11008. // "nodePoolId": {
  11009. // "description": "Deprecated. The name of the node pool to upgrade.\nThis field has been deprecated and replaced by the name field.",
  11010. // "location": "path",
  11011. // "required": true,
  11012. // "type": "string"
  11013. // },
  11014. // "projectId": {
  11015. // "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.",
  11016. // "location": "path",
  11017. // "required": true,
  11018. // "type": "string"
  11019. // },
  11020. // "zone": {
  11021. // "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.",
  11022. // "location": "path",
  11023. // "required": true,
  11024. // "type": "string"
  11025. // }
  11026. // },
  11027. // "path": "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update",
  11028. // "request": {
  11029. // "$ref": "UpdateNodePoolRequest"
  11030. // },
  11031. // "response": {
  11032. // "$ref": "Operation"
  11033. // },
  11034. // "scopes": [
  11035. // "https://www.googleapis.com/auth/cloud-platform"
  11036. // ]
  11037. // }
  11038. }
  11039. // method id "container.projects.zones.operations.cancel":
  11040. type ProjectsZonesOperationsCancelCall struct {
  11041. s *Service
  11042. projectId string
  11043. zone string
  11044. operationId string
  11045. canceloperationrequest *CancelOperationRequest
  11046. urlParams_ gensupport.URLParams
  11047. ctx_ context.Context
  11048. header_ http.Header
  11049. }
  11050. // Cancel: Cancels the specified operation.
  11051. func (r *ProjectsZonesOperationsService) Cancel(projectId string, zone string, operationId string, canceloperationrequest *CancelOperationRequest) *ProjectsZonesOperationsCancelCall {
  11052. c := &ProjectsZonesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11053. c.projectId = projectId
  11054. c.zone = zone
  11055. c.operationId = operationId
  11056. c.canceloperationrequest = canceloperationrequest
  11057. return c
  11058. }
  11059. // Fields allows partial responses to be retrieved. See
  11060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11061. // for more information.
  11062. func (c *ProjectsZonesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsCancelCall {
  11063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11064. return c
  11065. }
  11066. // Context sets the context to be used in this call's Do method. Any
  11067. // pending HTTP request will be aborted if the provided context is
  11068. // canceled.
  11069. func (c *ProjectsZonesOperationsCancelCall) Context(ctx context.Context) *ProjectsZonesOperationsCancelCall {
  11070. c.ctx_ = ctx
  11071. return c
  11072. }
  11073. // Header returns an http.Header that can be modified by the caller to
  11074. // add HTTP headers to the request.
  11075. func (c *ProjectsZonesOperationsCancelCall) Header() http.Header {
  11076. if c.header_ == nil {
  11077. c.header_ = make(http.Header)
  11078. }
  11079. return c.header_
  11080. }
  11081. func (c *ProjectsZonesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  11082. reqHeaders := make(http.Header)
  11083. for k, v := range c.header_ {
  11084. reqHeaders[k] = v
  11085. }
  11086. reqHeaders.Set("User-Agent", c.s.userAgent())
  11087. var body io.Reader = nil
  11088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  11089. if err != nil {
  11090. return nil, err
  11091. }
  11092. reqHeaders.Set("Content-Type", "application/json")
  11093. c.urlParams_.Set("alt", alt)
  11094. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel")
  11095. urls += "?" + c.urlParams_.Encode()
  11096. req, _ := http.NewRequest("POST", urls, body)
  11097. req.Header = reqHeaders
  11098. googleapi.Expand(req.URL, map[string]string{
  11099. "projectId": c.projectId,
  11100. "zone": c.zone,
  11101. "operationId": c.operationId,
  11102. })
  11103. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11104. }
  11105. // Do executes the "container.projects.zones.operations.cancel" call.
  11106. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  11107. // code is an error. Response headers are in either
  11108. // *Empty.ServerResponse.Header or (if a response was returned at all)
  11109. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11110. // check whether the returned error was because http.StatusNotModified
  11111. // was returned.
  11112. func (c *ProjectsZonesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  11113. gensupport.SetOptions(c.urlParams_, opts...)
  11114. res, err := c.doRequest("json")
  11115. if res != nil && res.StatusCode == http.StatusNotModified {
  11116. if res.Body != nil {
  11117. res.Body.Close()
  11118. }
  11119. return nil, &googleapi.Error{
  11120. Code: res.StatusCode,
  11121. Header: res.Header,
  11122. }
  11123. }
  11124. if err != nil {
  11125. return nil, err
  11126. }
  11127. defer googleapi.CloseBody(res)
  11128. if err := googleapi.CheckResponse(res); err != nil {
  11129. return nil, err
  11130. }
  11131. ret := &Empty{
  11132. ServerResponse: googleapi.ServerResponse{
  11133. Header: res.Header,
  11134. HTTPStatusCode: res.StatusCode,
  11135. },
  11136. }
  11137. target := &ret
  11138. if err := gensupport.DecodeResponse(target, res); err != nil {
  11139. return nil, err
  11140. }
  11141. return ret, nil
  11142. // {
  11143. // "description": "Cancels the specified operation.",
  11144. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  11145. // "httpMethod": "POST",
  11146. // "id": "container.projects.zones.operations.cancel",
  11147. // "parameterOrder": [
  11148. // "projectId",
  11149. // "zone",
  11150. // "operationId"
  11151. // ],
  11152. // "parameters": {
  11153. // "operationId": {
  11154. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  11155. // "location": "path",
  11156. // "required": true,
  11157. // "type": "string"
  11158. // },
  11159. // "projectId": {
  11160. // "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.",
  11161. // "location": "path",
  11162. // "required": true,
  11163. // "type": "string"
  11164. // },
  11165. // "zone": {
  11166. // "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.",
  11167. // "location": "path",
  11168. // "required": true,
  11169. // "type": "string"
  11170. // }
  11171. // },
  11172. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel",
  11173. // "request": {
  11174. // "$ref": "CancelOperationRequest"
  11175. // },
  11176. // "response": {
  11177. // "$ref": "Empty"
  11178. // },
  11179. // "scopes": [
  11180. // "https://www.googleapis.com/auth/cloud-platform"
  11181. // ]
  11182. // }
  11183. }
  11184. // method id "container.projects.zones.operations.get":
  11185. type ProjectsZonesOperationsGetCall struct {
  11186. s *Service
  11187. projectId string
  11188. zone string
  11189. operationId string
  11190. urlParams_ gensupport.URLParams
  11191. ifNoneMatch_ string
  11192. ctx_ context.Context
  11193. header_ http.Header
  11194. }
  11195. // Get: Gets the specified operation.
  11196. func (r *ProjectsZonesOperationsService) Get(projectId string, zone string, operationId string) *ProjectsZonesOperationsGetCall {
  11197. c := &ProjectsZonesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11198. c.projectId = projectId
  11199. c.zone = zone
  11200. c.operationId = operationId
  11201. return c
  11202. }
  11203. // Name sets the optional parameter "name": The name (project, location,
  11204. // operation id) of the operation to get.
  11205. // Specified in the format 'projects/*/locations/*/operations/*'.
  11206. func (c *ProjectsZonesOperationsGetCall) Name(name string) *ProjectsZonesOperationsGetCall {
  11207. c.urlParams_.Set("name", name)
  11208. return c
  11209. }
  11210. // Fields allows partial responses to be retrieved. See
  11211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11212. // for more information.
  11213. func (c *ProjectsZonesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsGetCall {
  11214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11215. return c
  11216. }
  11217. // IfNoneMatch sets the optional parameter which makes the operation
  11218. // fail if the object's ETag matches the given value. This is useful for
  11219. // getting updates only after the object has changed since the last
  11220. // request. Use googleapi.IsNotModified to check whether the response
  11221. // error from Do is the result of In-None-Match.
  11222. func (c *ProjectsZonesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsGetCall {
  11223. c.ifNoneMatch_ = entityTag
  11224. return c
  11225. }
  11226. // Context sets the context to be used in this call's Do method. Any
  11227. // pending HTTP request will be aborted if the provided context is
  11228. // canceled.
  11229. func (c *ProjectsZonesOperationsGetCall) Context(ctx context.Context) *ProjectsZonesOperationsGetCall {
  11230. c.ctx_ = ctx
  11231. return c
  11232. }
  11233. // Header returns an http.Header that can be modified by the caller to
  11234. // add HTTP headers to the request.
  11235. func (c *ProjectsZonesOperationsGetCall) Header() http.Header {
  11236. if c.header_ == nil {
  11237. c.header_ = make(http.Header)
  11238. }
  11239. return c.header_
  11240. }
  11241. func (c *ProjectsZonesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  11242. reqHeaders := make(http.Header)
  11243. for k, v := range c.header_ {
  11244. reqHeaders[k] = v
  11245. }
  11246. reqHeaders.Set("User-Agent", c.s.userAgent())
  11247. if c.ifNoneMatch_ != "" {
  11248. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11249. }
  11250. var body io.Reader = nil
  11251. c.urlParams_.Set("alt", alt)
  11252. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations/{operationId}")
  11253. urls += "?" + c.urlParams_.Encode()
  11254. req, _ := http.NewRequest("GET", urls, body)
  11255. req.Header = reqHeaders
  11256. googleapi.Expand(req.URL, map[string]string{
  11257. "projectId": c.projectId,
  11258. "zone": c.zone,
  11259. "operationId": c.operationId,
  11260. })
  11261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11262. }
  11263. // Do executes the "container.projects.zones.operations.get" call.
  11264. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11265. // status code is an error. Response headers are in either
  11266. // *Operation.ServerResponse.Header or (if a response was returned at
  11267. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11268. // to check whether the returned error was because
  11269. // http.StatusNotModified was returned.
  11270. func (c *ProjectsZonesOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11271. gensupport.SetOptions(c.urlParams_, opts...)
  11272. res, err := c.doRequest("json")
  11273. if res != nil && res.StatusCode == http.StatusNotModified {
  11274. if res.Body != nil {
  11275. res.Body.Close()
  11276. }
  11277. return nil, &googleapi.Error{
  11278. Code: res.StatusCode,
  11279. Header: res.Header,
  11280. }
  11281. }
  11282. if err != nil {
  11283. return nil, err
  11284. }
  11285. defer googleapi.CloseBody(res)
  11286. if err := googleapi.CheckResponse(res); err != nil {
  11287. return nil, err
  11288. }
  11289. ret := &Operation{
  11290. ServerResponse: googleapi.ServerResponse{
  11291. Header: res.Header,
  11292. HTTPStatusCode: res.StatusCode,
  11293. },
  11294. }
  11295. target := &ret
  11296. if err := gensupport.DecodeResponse(target, res); err != nil {
  11297. return nil, err
  11298. }
  11299. return ret, nil
  11300. // {
  11301. // "description": "Gets the specified operation.",
  11302. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  11303. // "httpMethod": "GET",
  11304. // "id": "container.projects.zones.operations.get",
  11305. // "parameterOrder": [
  11306. // "projectId",
  11307. // "zone",
  11308. // "operationId"
  11309. // ],
  11310. // "parameters": {
  11311. // "name": {
  11312. // "description": "The name (project, location, operation id) of the operation to get.\nSpecified in the format 'projects/*/locations/*/operations/*'.",
  11313. // "location": "query",
  11314. // "type": "string"
  11315. // },
  11316. // "operationId": {
  11317. // "description": "Deprecated. The server-assigned `name` of the operation.\nThis field has been deprecated and replaced by the name field.",
  11318. // "location": "path",
  11319. // "required": true,
  11320. // "type": "string"
  11321. // },
  11322. // "projectId": {
  11323. // "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.",
  11324. // "location": "path",
  11325. // "required": true,
  11326. // "type": "string"
  11327. // },
  11328. // "zone": {
  11329. // "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.",
  11330. // "location": "path",
  11331. // "required": true,
  11332. // "type": "string"
  11333. // }
  11334. // },
  11335. // "path": "v1/projects/{projectId}/zones/{zone}/operations/{operationId}",
  11336. // "response": {
  11337. // "$ref": "Operation"
  11338. // },
  11339. // "scopes": [
  11340. // "https://www.googleapis.com/auth/cloud-platform"
  11341. // ]
  11342. // }
  11343. }
  11344. // method id "container.projects.zones.operations.list":
  11345. type ProjectsZonesOperationsListCall struct {
  11346. s *Service
  11347. projectId string
  11348. zone string
  11349. urlParams_ gensupport.URLParams
  11350. ifNoneMatch_ string
  11351. ctx_ context.Context
  11352. header_ http.Header
  11353. }
  11354. // List: Lists all operations in a project in a specific zone or all
  11355. // zones.
  11356. func (r *ProjectsZonesOperationsService) List(projectId string, zone string) *ProjectsZonesOperationsListCall {
  11357. c := &ProjectsZonesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11358. c.projectId = projectId
  11359. c.zone = zone
  11360. return c
  11361. }
  11362. // Parent sets the optional parameter "parent": The parent (project and
  11363. // location) where the operations will be listed.
  11364. // Specified in the format 'projects/*/locations/*'.
  11365. // Location "-" matches all zones and all regions.
  11366. func (c *ProjectsZonesOperationsListCall) Parent(parent string) *ProjectsZonesOperationsListCall {
  11367. c.urlParams_.Set("parent", parent)
  11368. return c
  11369. }
  11370. // Fields allows partial responses to be retrieved. See
  11371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11372. // for more information.
  11373. func (c *ProjectsZonesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsZonesOperationsListCall {
  11374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11375. return c
  11376. }
  11377. // IfNoneMatch sets the optional parameter which makes the operation
  11378. // fail if the object's ETag matches the given value. This is useful for
  11379. // getting updates only after the object has changed since the last
  11380. // request. Use googleapi.IsNotModified to check whether the response
  11381. // error from Do is the result of In-None-Match.
  11382. func (c *ProjectsZonesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsZonesOperationsListCall {
  11383. c.ifNoneMatch_ = entityTag
  11384. return c
  11385. }
  11386. // Context sets the context to be used in this call's Do method. Any
  11387. // pending HTTP request will be aborted if the provided context is
  11388. // canceled.
  11389. func (c *ProjectsZonesOperationsListCall) Context(ctx context.Context) *ProjectsZonesOperationsListCall {
  11390. c.ctx_ = ctx
  11391. return c
  11392. }
  11393. // Header returns an http.Header that can be modified by the caller to
  11394. // add HTTP headers to the request.
  11395. func (c *ProjectsZonesOperationsListCall) Header() http.Header {
  11396. if c.header_ == nil {
  11397. c.header_ = make(http.Header)
  11398. }
  11399. return c.header_
  11400. }
  11401. func (c *ProjectsZonesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  11402. reqHeaders := make(http.Header)
  11403. for k, v := range c.header_ {
  11404. reqHeaders[k] = v
  11405. }
  11406. reqHeaders.Set("User-Agent", c.s.userAgent())
  11407. if c.ifNoneMatch_ != "" {
  11408. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11409. }
  11410. var body io.Reader = nil
  11411. c.urlParams_.Set("alt", alt)
  11412. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/zones/{zone}/operations")
  11413. urls += "?" + c.urlParams_.Encode()
  11414. req, _ := http.NewRequest("GET", urls, body)
  11415. req.Header = reqHeaders
  11416. googleapi.Expand(req.URL, map[string]string{
  11417. "projectId": c.projectId,
  11418. "zone": c.zone,
  11419. })
  11420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11421. }
  11422. // Do executes the "container.projects.zones.operations.list" call.
  11423. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  11424. // non-2xx status code is an error. Response headers are in either
  11425. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  11426. // returned at all) in error.(*googleapi.Error).Header. Use
  11427. // googleapi.IsNotModified to check whether the returned error was
  11428. // because http.StatusNotModified was returned.
  11429. func (c *ProjectsZonesOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  11430. gensupport.SetOptions(c.urlParams_, opts...)
  11431. res, err := c.doRequest("json")
  11432. if res != nil && res.StatusCode == http.StatusNotModified {
  11433. if res.Body != nil {
  11434. res.Body.Close()
  11435. }
  11436. return nil, &googleapi.Error{
  11437. Code: res.StatusCode,
  11438. Header: res.Header,
  11439. }
  11440. }
  11441. if err != nil {
  11442. return nil, err
  11443. }
  11444. defer googleapi.CloseBody(res)
  11445. if err := googleapi.CheckResponse(res); err != nil {
  11446. return nil, err
  11447. }
  11448. ret := &ListOperationsResponse{
  11449. ServerResponse: googleapi.ServerResponse{
  11450. Header: res.Header,
  11451. HTTPStatusCode: res.StatusCode,
  11452. },
  11453. }
  11454. target := &ret
  11455. if err := gensupport.DecodeResponse(target, res); err != nil {
  11456. return nil, err
  11457. }
  11458. return ret, nil
  11459. // {
  11460. // "description": "Lists all operations in a project in a specific zone or all zones.",
  11461. // "flatPath": "v1/projects/{projectId}/zones/{zone}/operations",
  11462. // "httpMethod": "GET",
  11463. // "id": "container.projects.zones.operations.list",
  11464. // "parameterOrder": [
  11465. // "projectId",
  11466. // "zone"
  11467. // ],
  11468. // "parameters": {
  11469. // "parent": {
  11470. // "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.",
  11471. // "location": "query",
  11472. // "type": "string"
  11473. // },
  11474. // "projectId": {
  11475. // "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.",
  11476. // "location": "path",
  11477. // "required": true,
  11478. // "type": "string"
  11479. // },
  11480. // "zone": {
  11481. // "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.",
  11482. // "location": "path",
  11483. // "required": true,
  11484. // "type": "string"
  11485. // }
  11486. // },
  11487. // "path": "v1/projects/{projectId}/zones/{zone}/operations",
  11488. // "response": {
  11489. // "$ref": "ListOperationsResponse"
  11490. // },
  11491. // "scopes": [
  11492. // "https://www.googleapis.com/auth/cloud-platform"
  11493. // ]
  11494. // }
  11495. }